authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-26 07:03:38+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-26 07:03:38+02:00
loga83aad152b502ab205f4f6f6c4f70a25b2fa955d
tree6e073a56aa5955e5da24ade26508fa60a3a4f78a
parentf0a7e3ccae45ce7d09038204c16155d5b98ad560
parent8443e2ab43000a4b196d3a6014655c77f054d893

Merge pull request 'LLVM 22' (#32013) from llvm22 into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32013

730 files changed, 34010 insertions(+), 24951 deletions(-)

CMakeLists.txt+3-3
...@@ -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 21)136find_package(llvm 22)
137find_package(clang 21)137find_package(clang 22)
138find_package(lld 21)138find_package(lld 22)
139139
140if(ZIG_STATIC_ZLIB)140if(ZIG_STATIC_ZLIB)
141 if (MSVC)141 if (MSVC)
build.zig+14-6
...@@ -1206,13 +1206,16 @@ const zig_cpp_sources = [_][]const u8{...@@ -1206,13 +1206,16 @@ const zig_cpp_sources = [_][]const u8{
1206const clang_libs = [_][]const u8{1206const clang_libs = [_][]const u8{
1207 "clangFrontendTool",1207 "clangFrontendTool",
1208 "clangCodeGen",1208 "clangCodeGen",
1209 "clangStaticAnalyzerFrontend",
1210 "clangStaticAnalyzerCheckers",
1211 "clangStaticAnalyzerCore",
1212 "clangCrossTU",
1209 "clangFrontend",1213 "clangFrontend",
1210 "clangDriver",1214 "clangDriver",
1215 "clangOptions",
1211 "clangSerialization",1216 "clangSerialization",
1212 "clangSema",1217 "clangSema",
1213 "clangStaticAnalyzerFrontend",1218 "clangAnalysisLifetimeSafety",
1214 "clangStaticAnalyzerCheckers",
1215 "clangStaticAnalyzerCore",
1216 "clangAnalysis",1219 "clangAnalysis",
1217 "clangASTMatchers",1220 "clangASTMatchers",
1218 "clangAST",1221 "clangAST",
...@@ -1224,8 +1227,9 @@ const clang_libs = [_][]const u8{...@@ -1224,8 +1227,9 @@ const clang_libs = [_][]const u8{
1224 "clangLex",1227 "clangLex",
1225 "clangRewriteFrontend",1228 "clangRewriteFrontend",
1226 "clangRewrite",1229 "clangRewrite",
1227 "clangCrossTU",
1228 "clangIndex",1230 "clangIndex",
1231 "clangFormat",
1232 "clangToolingInclusions",
1229 "clangToolingCore",1233 "clangToolingCore",
1230 "clangExtractAPI",1234 "clangExtractAPI",
1231 "clangSupport",1235 "clangSupport",
...@@ -1373,11 +1377,12 @@ const llvm_libs = [_][]const u8{...@@ -1373,11 +1377,12 @@ const llvm_libs = [_][]const u8{
1373 "LLVMObjCopy",1377 "LLVMObjCopy",
1374 "LLVMMCA",1378 "LLVMMCA",
1375 "LLVMMCDisassembler",1379 "LLVMMCDisassembler",
1380 "LLVMDTLTO",
1376 "LLVMLTO",1381 "LLVMLTO",
1377 "LLVMFrontendOpenACC",1382 "LLVMFrontendOpenACC",
1378 "LLVMFrontendHLSL",
1379 "LLVMFrontendDriver",1383 "LLVMFrontendDriver",
1380 "LLVMExtensions",1384 "LLVMExtensions",
1385 "LLVMPlugins",
1381 "LLVMPasses",1386 "LLVMPasses",
1382 "LLVMHipStdPar",1387 "LLVMHipStdPar",
1383 "LLVMCoroutines",1388 "LLVMCoroutines",
...@@ -1404,6 +1409,7 @@ const llvm_libs = [_][]const u8{...@@ -1404,6 +1409,7 @@ const llvm_libs = [_][]const u8{
1404 "LLVMObjCARCOpts",1409 "LLVMObjCARCOpts",
1405 "LLVMCodeGenTypes",1410 "LLVMCodeGenTypes",
1406 "LLVMCGData",1411 "LLVMCGData",
1412 "LLVMCAS",
1407 "LLVMIRPrinter",1413 "LLVMIRPrinter",
1408 "LLVMInterfaceStub",1414 "LLVMInterfaceStub",
1409 "LLVMFileCheck",1415 "LLVMFileCheck",
...@@ -1422,15 +1428,17 @@ const llvm_libs = [_][]const u8{...@@ -1422,15 +1428,17 @@ const llvm_libs = [_][]const u8{
1422 "LLVMDebugInfoCodeView",1428 "LLVMDebugInfoCodeView",
1423 "LLVMDebugInfoGSYM",1429 "LLVMDebugInfoGSYM",
1424 "LLVMDebugInfoDWARF",1430 "LLVMDebugInfoDWARF",
1425 "LLVMDebugInfoDWARFLowLevel",
1426 "LLVMObject",1431 "LLVMObject",
1427 "LLVMTextAPI",1432 "LLVMTextAPI",
1428 "LLVMMCParser",1433 "LLVMMCParser",
1429 "LLVMIRReader",1434 "LLVMIRReader",
1430 "LLVMAsmParser",1435 "LLVMAsmParser",
1431 "LLVMMC",1436 "LLVMMC",
1437 "LLVMDebugInfoDWARFLowLevel",
1432 "LLVMBitReader",1438 "LLVMBitReader",
1439 "LLVMFrontendHLSL",
1433 "LLVMFuzzerCLI",1440 "LLVMFuzzerCLI",
1441 "LLVMABI",
1434 "LLVMCore",1442 "LLVMCore",
1435 "LLVMRemarks",1443 "LLVMRemarks",
1436 "LLVMBitstreamReader",1444 "LLVMBitstreamReader",
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.16.0-dev.2287+eb3f16db5"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.2287+eb3f16db5"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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
...@@ -8,7 +8,7 @@ set -e...@@ -8,7 +8,7 @@ set -e
8ZIGDIR="$PWD"8ZIGDIR="$PWD"
9TARGET="aarch64-macos-none"9TARGET="aarch64-macos-none"
10MCPU="baseline"10MCPU="baseline"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.104+689461e31"11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
12PREFIX="$HOME/$CACHE_BASENAME"12PREFIX="$HOME/$CACHE_BASENAME"
13ZIG="$PREFIX/bin/zig"13ZIG="$PREFIX/bin/zig"
1414
ci/aarch64-macos-release.sh+1-1
...@@ -8,7 +8,7 @@ set -e...@@ -8,7 +8,7 @@ set -e
8ZIGDIR="$PWD"8ZIGDIR="$PWD"
9TARGET="aarch64-macos-none"9TARGET="aarch64-macos-none"
10MCPU="baseline"10MCPU="baseline"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.104+689461e31"11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
12PREFIX="$HOME/$CACHE_BASENAME"12PREFIX="$HOME/$CACHE_BASENAME"
13ZIG="$PREFIX/bin/zig"13ZIG="$PREFIX/bin/zig"
1414
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.16.0-dev.2287+eb3f16db5"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.2287+eb3f16db5"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-windows.ps1+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1$TARGET = "aarch64-windows-gnu"1$TARGET = "aarch64-windows-gnu"
2$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.16.0-dev.104+689461e31"2$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
3$MCPU = "baseline"3$MCPU = "baseline"
4$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"4$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
5$PREFIX_PATH = "$(Get-Location)\..\$ZIG_LLVM_CLANG_LLD_NAME"5$PREFIX_PATH = "$(Get-Location)\..\$ZIG_LLVM_CLANG_LLD_NAME"
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.16.0-dev.157+7fdd60df1"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.157+7fdd60df1"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.1594+9fa433d71"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.1594+9fa433d71"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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-riscv64-linux-musl-0.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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-riscv64-linux-musl-0.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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="z15"9MCPU="z15"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.1354+94e98bfe8"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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="z15"9MCPU="z15"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.1354+94e98bfe8"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.312+164c598cd"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.312+164c598cd"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.104+689461e31"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.2287+eb3f16db5"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.2287+eb3f16db5"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.2051+28b83e3b0"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.2051+28b83e3b0"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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.16.0-dev.104+689461e31"3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
4$ZIG = "$PREFIX_PATH\bin\zig.exe"4$ZIG = "$PREFIX_PATH\bin\zig.exe"
5$ZIG_LIB_DIR = "$(Get-Location)\lib"5$ZIG_LIB_DIR = "$(Get-Location)\lib"
6$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }6$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }
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.16.0-dev.104+689461e31"3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
4$ZIG = "$PREFIX_PATH\bin\zig.exe"4$ZIG = "$PREFIX_PATH\bin\zig.exe"
5$ZIG_LIB_DIR = "$(Get-Location)\lib"5$ZIG_LIB_DIR = "$(Get-Location)\lib"
6$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }6$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }
cmake/Findclang.cmake+12-8
...@@ -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.2120 libclang-cpp.so.22
21 libclang-cpp.so.21.121 libclang-cpp.so.22.1
22 clang-cpp-21.022 clang-cpp-22.0
23 clang-cpp21023 clang-cpp220
24 clang-cpp24 clang-cpp
25 NAMES_PER_DIR25 NAMES_PER_DIR
26 HINTS "${LLVM_LIBDIRS}"26 HINTS "${LLVM_LIBDIRS}"
...@@ -44,13 +44,16 @@ else()...@@ -44,13 +44,16 @@ else()
4444
45 FIND_AND_ADD_CLANG_LIB(clangFrontendTool)45 FIND_AND_ADD_CLANG_LIB(clangFrontendTool)
46 FIND_AND_ADD_CLANG_LIB(clangCodeGen)46 FIND_AND_ADD_CLANG_LIB(clangCodeGen)
47 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerFrontend)
48 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
49 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
50 FIND_AND_ADD_CLANG_LIB(clangCrossTU)
47 FIND_AND_ADD_CLANG_LIB(clangFrontend)51 FIND_AND_ADD_CLANG_LIB(clangFrontend)
48 FIND_AND_ADD_CLANG_LIB(clangDriver)52 FIND_AND_ADD_CLANG_LIB(clangDriver)
53 FIND_AND_ADD_CLANG_LIB(clangOptions)
49 FIND_AND_ADD_CLANG_LIB(clangSerialization)54 FIND_AND_ADD_CLANG_LIB(clangSerialization)
50 FIND_AND_ADD_CLANG_LIB(clangSema)55 FIND_AND_ADD_CLANG_LIB(clangSema)
51 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerFrontend)56 FIND_AND_ADD_CLANG_LIB(clangAnalysisLifetimeSafety)
52 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
53 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
54 FIND_AND_ADD_CLANG_LIB(clangAnalysis)57 FIND_AND_ADD_CLANG_LIB(clangAnalysis)
55 FIND_AND_ADD_CLANG_LIB(clangASTMatchers)58 FIND_AND_ADD_CLANG_LIB(clangASTMatchers)
56 FIND_AND_ADD_CLANG_LIB(clangAST)59 FIND_AND_ADD_CLANG_LIB(clangAST)
...@@ -62,8 +65,9 @@ else()...@@ -62,8 +65,9 @@ else()
62 FIND_AND_ADD_CLANG_LIB(clangLex)65 FIND_AND_ADD_CLANG_LIB(clangLex)
63 FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)66 FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)
64 FIND_AND_ADD_CLANG_LIB(clangRewrite)67 FIND_AND_ADD_CLANG_LIB(clangRewrite)
65 FIND_AND_ADD_CLANG_LIB(clangCrossTU)
66 FIND_AND_ADD_CLANG_LIB(clangIndex)68 FIND_AND_ADD_CLANG_LIB(clangIndex)
69 FIND_AND_ADD_CLANG_LIB(clangFormat)
70 FIND_AND_ADD_CLANG_LIB(clangToolingInclusions)
67 FIND_AND_ADD_CLANG_LIB(clangToolingCore)71 FIND_AND_ADD_CLANG_LIB(clangToolingCore)
68 FIND_AND_ADD_CLANG_LIB(clangExtractAPI)72 FIND_AND_ADD_CLANG_LIB(clangExtractAPI)
69 FIND_AND_ADD_CLANG_LIB(clangSupport)73 FIND_AND_ADD_CLANG_LIB(clangSupport)
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-21/include12 /usr/lib/llvm-22/include
13 /usr/local/llvm210/include13 /usr/local/llvm220/include
14 /usr/local/llvm21/include14 /usr/local/llvm22/include
15 /usr/local/opt/lld@21/include15 /usr/local/opt/lld@22/include
16 /opt/homebrew/opt/lld@21/include16 /opt/homebrew/opt/lld@22/include
17 /home/linuxbrew/.linuxbrew/opt/lld@21/include17 /home/linuxbrew/.linuxbrew/opt/lld@22/include
18 /mingw64/include)18 /mingw64/include)
1919
20find_library(LLD_LIBRARY NAMES lld-21.0 lld210 lld NAMES_PER_DIR20find_library(LLD_LIBRARY NAMES lld-22.0 lld220 lld NAMES_PER_DIR
21 HINTS ${LLVM_LIBDIRS}21 HINTS ${LLVM_LIBDIRS}
22 PATHS22 PATHS
23 /usr/lib/llvm-21/lib23 /usr/lib/llvm-22/lib
24 /usr/local/llvm210/lib24 /usr/local/llvm220/lib
25 /usr/local/llvm21/lib25 /usr/local/llvm22/lib
26 /usr/local/opt/lld@21/lib26 /usr/local/opt/lld@22/lib
27 /opt/homebrew/opt/lld@21/lib27 /opt/homebrew/opt/lld@22/lib
28 /home/linuxbrew/.linuxbrew/opt/lld@21/lib28 /home/linuxbrew/.linuxbrew/opt/lld@22/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-21/lib39 /usr/lib/llvm-22/lib
40 /usr/local/llvm210/lib40 /usr/local/llvm220/lib
41 /usr/local/llvm21/lib41 /usr/local/llvm22/lib
42 /usr/local/opt/lld@21/lib42 /usr/local/opt/lld@22/lib
43 /opt/homebrew/opt/lld@21/lib43 /opt/homebrew/opt/lld@22/lib
44 /home/linuxbrew/.linuxbrew/opt/lld@21/lib44 /home/linuxbrew/.linuxbrew/opt/lld@22/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+12-8
...@@ -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-21 llvm-config-21.0 llvm-config210 llvm-config21 llvm-config NAMES_PER_DIR20 NAMES llvm-config-22 llvm-config-22.0 llvm-config220 llvm-config22 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-21.0.0/bin")25 "C:/Libraries/llvm-22.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 21 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 22 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 22)43 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 22 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 23 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 23)
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 21.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")45 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 22.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 21.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")69 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 22.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 21.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")71 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 22.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
...@@ -321,11 +321,12 @@ else()...@@ -321,11 +321,12 @@ else()
321 FIND_AND_ADD_LLVM_LIB(LLVMObjCopy)321 FIND_AND_ADD_LLVM_LIB(LLVMObjCopy)
322 FIND_AND_ADD_LLVM_LIB(LLVMMCA)322 FIND_AND_ADD_LLVM_LIB(LLVMMCA)
323 FIND_AND_ADD_LLVM_LIB(LLVMMCDisassembler)323 FIND_AND_ADD_LLVM_LIB(LLVMMCDisassembler)
324 FIND_AND_ADD_LLVM_LIB(LLVMDTLTO)
324 FIND_AND_ADD_LLVM_LIB(LLVMLTO)325 FIND_AND_ADD_LLVM_LIB(LLVMLTO)
325 FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenACC)326 FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenACC)
326 FIND_AND_ADD_LLVM_LIB(LLVMFrontendHLSL)
327 FIND_AND_ADD_LLVM_LIB(LLVMFrontendDriver)327 FIND_AND_ADD_LLVM_LIB(LLVMFrontendDriver)
328 FIND_AND_ADD_LLVM_LIB(LLVMExtensions)328 FIND_AND_ADD_LLVM_LIB(LLVMExtensions)
329 FIND_AND_ADD_LLVM_LIB(LLVMPlugins)
329 FIND_AND_ADD_LLVM_LIB(LLVMPasses)330 FIND_AND_ADD_LLVM_LIB(LLVMPasses)
330 FIND_AND_ADD_LLVM_LIB(LLVMHipStdPar)331 FIND_AND_ADD_LLVM_LIB(LLVMHipStdPar)
331 FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)332 FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
...@@ -352,6 +353,7 @@ else()...@@ -352,6 +353,7 @@ else()
352 FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)353 FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
353 FIND_AND_ADD_LLVM_LIB(LLVMCodeGenTypes)354 FIND_AND_ADD_LLVM_LIB(LLVMCodeGenTypes)
354 FIND_AND_ADD_LLVM_LIB(LLVMCGData)355 FIND_AND_ADD_LLVM_LIB(LLVMCGData)
356 FIND_AND_ADD_LLVM_LIB(LLVMCAS)
355 FIND_AND_ADD_LLVM_LIB(LLVMIRPrinter)357 FIND_AND_ADD_LLVM_LIB(LLVMIRPrinter)
356 FIND_AND_ADD_LLVM_LIB(LLVMInterfaceStub)358 FIND_AND_ADD_LLVM_LIB(LLVMInterfaceStub)
357 FIND_AND_ADD_LLVM_LIB(LLVMFileCheck)359 FIND_AND_ADD_LLVM_LIB(LLVMFileCheck)
...@@ -370,15 +372,17 @@ else()...@@ -370,15 +372,17 @@ else()
370 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)372 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
371 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)373 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
372 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)374 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)
373 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARFLowLevel)
374 FIND_AND_ADD_LLVM_LIB(LLVMObject)375 FIND_AND_ADD_LLVM_LIB(LLVMObject)
375 FIND_AND_ADD_LLVM_LIB(LLVMTextAPI)376 FIND_AND_ADD_LLVM_LIB(LLVMTextAPI)
376 FIND_AND_ADD_LLVM_LIB(LLVMMCParser)377 FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
377 FIND_AND_ADD_LLVM_LIB(LLVMIRReader)378 FIND_AND_ADD_LLVM_LIB(LLVMIRReader)
378 FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)379 FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)
379 FIND_AND_ADD_LLVM_LIB(LLVMMC)380 FIND_AND_ADD_LLVM_LIB(LLVMMC)
381 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARFLowLevel)
380 FIND_AND_ADD_LLVM_LIB(LLVMBitReader)382 FIND_AND_ADD_LLVM_LIB(LLVMBitReader)
383 FIND_AND_ADD_LLVM_LIB(LLVMFrontendHLSL)
381 FIND_AND_ADD_LLVM_LIB(LLVMFuzzerCLI)384 FIND_AND_ADD_LLVM_LIB(LLVMFuzzerCLI)
385 FIND_AND_ADD_LLVM_LIB(LLVMABI)
382 FIND_AND_ADD_LLVM_LIB(LLVMCore)386 FIND_AND_ADD_LLVM_LIB(LLVMCore)
383 FIND_AND_ADD_LLVM_LIB(LLVMRemarks)387 FIND_AND_ADD_LLVM_LIB(LLVMRemarks)
384 FIND_AND_ADD_LLVM_LIB(LLVMBitstreamReader)388 FIND_AND_ADD_LLVM_LIB(LLVMBitstreamReader)
lib/compiler/aro/aro/Compilation.zig-3
...@@ -498,7 +498,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {...@@ -498,7 +498,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {
498 .{ .fma, "__FMA__" },498 .{ .fma, "__FMA__" },
499 .{ .f16c, "__F16C__" },499 .{ .f16c, "__F16C__" },
500 .{ .gfni, "__GFNI__" },500 .{ .gfni, "__GFNI__" },
501 .{ .evex512, "__EVEX512__" },
502501
503 .{ .avx10_1, "__AVX10_1__" },502 .{ .avx10_1, "__AVX10_1__" },
504 .{ .avx10_1, "__AVX10_1_512__" },503 .{ .avx10_1, "__AVX10_1_512__" },
...@@ -560,7 +559,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {...@@ -560,7 +559,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {
560 .{ .amx_complex, "__AMX_COMPLEX__" },559 .{ .amx_complex, "__AMX_COMPLEX__" },
561 .{ .amx_fp8, "__AMX_FP8__" },560 .{ .amx_fp8, "__AMX_FP8__" },
562 .{ .amx_movrs, "__AMX_MOVRS__" },561 .{ .amx_movrs, "__AMX_MOVRS__" },
563 .{ .amx_transpose, "__AMX_TRANSPOSE__" },
564 .{ .amx_avx512, "__AMX_AVX512__" },562 .{ .amx_avx512, "__AMX_AVX512__" },
565 .{ .amx_tf32, "__AMX_TF32__" },563 .{ .amx_tf32, "__AMX_TF32__" },
566 .{ .cmpccxadd, "__CMPCCXADD__" },564 .{ .cmpccxadd, "__CMPCCXADD__" },
...@@ -798,7 +796,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {...@@ -798,7 +796,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {
798 .{ .fullfp16, "FP16_SCALAR_ARITHMETIC" },796 .{ .fullfp16, "FP16_SCALAR_ARITHMETIC" },
799 .{ .dotprod, "DOTPROD" },797 .{ .dotprod, "DOTPROD" },
800 .{ .mte, "MEMORY_TAGGING" },798 .{ .mte, "MEMORY_TAGGING" },
801 .{ .tme, "TME" },
802 .{ .i8mm, "MATMUL_INT8" },799 .{ .i8mm, "MATMUL_INT8" },
803 .{ .lse, "ATOMICS" },800 .{ .lse, "ATOMICS" },
804 .{ .f64mm, "SVE_MATMUL_FP64" },801 .{ .f64mm, "SVE_MATMUL_FP64" },
lib/compiler_rt.zig+1-22
...@@ -447,29 +447,8 @@ pub const gnu_f16_abi = switch (builtin.cpu.arch) {...@@ -447,29 +447,8 @@ pub const gnu_f16_abi = switch (builtin.cpu.arch) {
447447
448pub const want_sparc_abi = builtin.cpu.arch.isSPARC();448pub const want_sparc_abi = builtin.cpu.arch.isSPARC();
449449
450/// This seems to mostly correspond to `clang::TargetInfo::HasFloat16`.
451pub fn F16T(comptime OtherType: type) type {450pub fn F16T(comptime OtherType: type) type {
452 return switch (builtin.cpu.arch) {451 return switch (builtin.cpu.arch) {
453 .amdgcn,
454 .arm,
455 .armeb,
456 .thumb,
457 .thumbeb,
458 .aarch64,
459 .aarch64_be,
460 .hexagon,
461 .loongarch32,
462 .loongarch64,
463 .nvptx,
464 .nvptx64,
465 .riscv32,
466 .riscv32be,
467 .riscv64,
468 .riscv64be,
469 .s390x,
470 .spirv32,
471 .spirv64,
472 => f16,
473 .x86, .x86_64 => if (builtin.target.os.tag.isDarwin()) switch (OtherType) {452 .x86, .x86_64 => if (builtin.target.os.tag.isDarwin()) switch (OtherType) {
474 // Starting with LLVM 16, Darwin uses different abi for f16453 // Starting with LLVM 16, Darwin uses different abi for f16
475 // depending on the type of the other return/argument..???454 // depending on the type of the other return/argument..???
...@@ -477,7 +456,7 @@ pub fn F16T(comptime OtherType: type) type {...@@ -477,7 +456,7 @@ pub fn F16T(comptime OtherType: type) type {
477 f80, f128 => f16,456 f80, f128 => f16,
478 else => unreachable,457 else => unreachable,
479 } else f16,458 } else f16,
480 else => u16,459 else => f16,
481 };460 };
482}461}
483462
lib/compiler_rt/trunctfhf2.zig+3
...@@ -4,6 +4,9 @@ const truncf = @import("./truncf.zig").truncf;...@@ -4,6 +4,9 @@ const truncf = @import("./truncf.zig").truncf;
44
5comptime {5comptime {
6 symbol(&__trunctfhf2, "__trunctfhf2");6 symbol(&__trunctfhf2, "__trunctfhf2");
7 if (compiler_rt.want_ppc_abi) {
8 symbol(&__trunctfhf2, "__trunckfhf2");
9 }
7}10}
811
9pub fn __trunctfhf2(a: f128) callconv(.c) compiler_rt.F16T(f128) {12pub fn __trunctfhf2(a: f128) callconv(.c) compiler_rt.F16T(f128) {
lib/include/__clang_spirv_builtins.h+12-12
...@@ -52,30 +52,30 @@...@@ -52,30 +52,30 @@
52// Builtin IDs and sizes52// Builtin IDs and sizes
5353
54extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_num_workgroups) __size_t54extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_num_workgroups) __size_t
55 __spirv_NumWorkgroups(int);55 __spirv_BuiltInNumWorkgroups(int);
56extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_workgroup_size) __size_t56extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_workgroup_size) __size_t
57 __spirv_WorkgroupSize(int);57 __spirv_BuiltInWorkgroupSize(int);
58extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_workgroup_id) __size_t58extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_workgroup_id) __size_t
59 __spirv_WorkgroupId(int);59 __spirv_BuiltInWorkgroupId(int);
60extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_local_invocation_id) __size_t60extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_local_invocation_id) __size_t
61 __spirv_LocalInvocationId(int);61 __spirv_BuiltInLocalInvocationId(int);
62extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_global_invocation_id) __size_t62extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_global_invocation_id) __size_t
63 __spirv_GlobalInvocationId(int);63 __spirv_BuiltInGlobalInvocationId(int);
6464
65extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_global_size) __size_t65extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_global_size) __size_t
66 __spirv_GlobalSize(int);66 __spirv_BuiltInGlobalSize(int);
67extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_global_offset) __size_t67extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_global_offset) __size_t
68 __spirv_GlobalOffset(int);68 __spirv_BuiltInGlobalOffset(int);
69extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_size) __uint32_t69extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_size) __uint32_t
70 __spirv_SubgroupSize();70 __spirv_BuiltInSubgroupSize();
71extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_max_size) __uint32_t71extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_max_size) __uint32_t
72 __spirv_SubgroupMaxSize();72 __spirv_BuiltInSubgroupMaxSize();
73extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_num_subgroups) __uint32_t73extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_num_subgroups) __uint32_t
74 __spirv_NumSubgroups();74 __spirv_BuiltInNumSubgroups();
75extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_id) __uint32_t75extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_id) __uint32_t
76 __spirv_SubgroupId();76 __spirv_BuiltInSubgroupId();
77extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_local_invocation_id)77extern __SPIRV_BUILTIN_ALIAS(__builtin_spirv_subgroup_local_invocation_id)
78 __uint32_t __spirv_SubgroupLocalInvocationId();78 __uint32_t __spirv_BuiltInSubgroupLocalInvocationId();
7979
80// OpGenericCastToPtrExplicit80// OpGenericCastToPtrExplicit
8181
lib/include/__float_float.h created+176
...@@ -0,0 +1,176 @@
1/*===---- __float_float.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 __CLANG_FLOAT_FLOAT_H
11#define __CLANG_FLOAT_FLOAT_H
12
13#if (defined(__MINGW32__) || defined(_MSC_VER) || defined(_AIX)) && \
14 __STDC_HOSTED__
15
16/* Undefine anything that we'll be redefining below. */
17# undef FLT_EVAL_METHOD
18# undef FLT_ROUNDS
19# undef FLT_RADIX
20# undef FLT_MANT_DIG
21# undef DBL_MANT_DIG
22# undef LDBL_MANT_DIG
23#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
24 !defined(__STRICT_ANSI__) || \
25 (defined(__cplusplus) && __cplusplus >= 201103L) || \
26 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
27# undef DECIMAL_DIG
28# endif
29# undef FLT_DIG
30# undef DBL_DIG
31# undef LDBL_DIG
32# undef FLT_MIN_EXP
33# undef DBL_MIN_EXP
34# undef LDBL_MIN_EXP
35# undef FLT_MIN_10_EXP
36# undef DBL_MIN_10_EXP
37# undef LDBL_MIN_10_EXP
38# undef FLT_MAX_EXP
39# undef DBL_MAX_EXP
40# undef LDBL_MAX_EXP
41# undef FLT_MAX_10_EXP
42# undef DBL_MAX_10_EXP
43# undef LDBL_MAX_10_EXP
44# undef FLT_MAX
45# undef DBL_MAX
46# undef LDBL_MAX
47# undef FLT_EPSILON
48# undef DBL_EPSILON
49# undef LDBL_EPSILON
50# undef FLT_MIN
51# undef DBL_MIN
52# undef LDBL_MIN
53#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
54 !defined(__STRICT_ANSI__) || \
55 (defined(__cplusplus) && __cplusplus >= 201703L) || \
56 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
57# undef FLT_TRUE_MIN
58# undef DBL_TRUE_MIN
59# undef LDBL_TRUE_MIN
60# undef FLT_DECIMAL_DIG
61# undef DBL_DECIMAL_DIG
62# undef LDBL_DECIMAL_DIG
63# undef FLT_HAS_SUBNORM
64# undef DBL_HAS_SUBNORM
65# undef LDBL_HAS_SUBNORM
66# endif
67#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
68 !defined(__STRICT_ANSI__)
69# undef FLT_NORM_MAX
70# undef DBL_NORM_MAX
71# undef LDBL_NORM_MAX
72#endif
73#endif
74
75#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
76 !defined(__STRICT_ANSI__)
77# undef FLT_SNAN
78# undef DBL_SNAN
79# undef LDBL_SNAN
80#endif
81
82/* Characteristics of floating point types, C99 5.2.4.2.2 */
83
84#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
85 (defined(__cplusplus) && __cplusplus >= 201103L)
86#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
87#endif
88#define FLT_ROUNDS (__builtin_flt_rounds())
89#define FLT_RADIX __FLT_RADIX__
90
91#define FLT_MANT_DIG __FLT_MANT_DIG__
92#define DBL_MANT_DIG __DBL_MANT_DIG__
93#define LDBL_MANT_DIG __LDBL_MANT_DIG__
94
95#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
96 !defined(__STRICT_ANSI__) || \
97 (defined(__cplusplus) && __cplusplus >= 201103L) || \
98 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
99# define DECIMAL_DIG __DECIMAL_DIG__
100#endif
101
102#define FLT_DIG __FLT_DIG__
103#define DBL_DIG __DBL_DIG__
104#define LDBL_DIG __LDBL_DIG__
105
106#define FLT_MIN_EXP __FLT_MIN_EXP__
107#define DBL_MIN_EXP __DBL_MIN_EXP__
108#define LDBL_MIN_EXP __LDBL_MIN_EXP__
109
110#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
111#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
112#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
113
114#define FLT_MAX_EXP __FLT_MAX_EXP__
115#define DBL_MAX_EXP __DBL_MAX_EXP__
116#define LDBL_MAX_EXP __LDBL_MAX_EXP__
117
118#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
119#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
120#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
121
122#define FLT_MAX __FLT_MAX__
123#define DBL_MAX __DBL_MAX__
124#define LDBL_MAX __LDBL_MAX__
125
126#define FLT_EPSILON __FLT_EPSILON__
127#define DBL_EPSILON __DBL_EPSILON__
128#define LDBL_EPSILON __LDBL_EPSILON__
129
130#define FLT_MIN __FLT_MIN__
131#define DBL_MIN __DBL_MIN__
132#define LDBL_MIN __LDBL_MIN__
133
134#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
135 !defined(__STRICT_ANSI__) || \
136 (defined(__cplusplus) && __cplusplus >= 201703L) || \
137 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
138# define FLT_TRUE_MIN __FLT_DENORM_MIN__
139# define DBL_TRUE_MIN __DBL_DENORM_MIN__
140# define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
141# define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
142# define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
143# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
144# define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
145# define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
146# define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
147#endif
148
149#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
150 !defined(__STRICT_ANSI__)
151 /* C23 5.2.5.3.2p28 */
152# define FLT_SNAN (__builtin_nansf(""))
153# define DBL_SNAN (__builtin_nans(""))
154# define LDBL_SNAN (__builtin_nansl(""))
155
156 /* C23 5.2.5.3.3p32 */
157# define FLT_NORM_MAX __FLT_NORM_MAX__
158# define DBL_NORM_MAX __DBL_NORM_MAX__
159# define LDBL_NORM_MAX __LDBL_NORM_MAX__
160#endif
161
162#ifdef __STDC_WANT_IEC_60559_TYPES_EXT__
163# define FLT16_MANT_DIG __FLT16_MANT_DIG__
164# define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__
165# define FLT16_DIG __FLT16_DIG__
166# define FLT16_MIN_EXP __FLT16_MIN_EXP__
167# define FLT16_MIN_10_EXP __FLT16_MIN_10_EXP__
168# define FLT16_MAX_EXP __FLT16_MAX_EXP__
169# define FLT16_MAX_10_EXP __FLT16_MAX_10_EXP__
170# define FLT16_MAX __FLT16_MAX__
171# define FLT16_EPSILON __FLT16_EPSILON__
172# define FLT16_MIN __FLT16_MIN__
173# define FLT16_TRUE_MIN __FLT16_TRUE_MIN__
174#endif /* __STDC_WANT_IEC_60559_TYPES_EXT__ */
175
176#endif /* __CLANG_FLOAT_FLOAT_H */
lib/include/__float_header_macro.h created+12
...@@ -0,0 +1,12 @@
1/*===---- __float_header_macro.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 __CLANG_FLOAT_H
11#define __CLANG_FLOAT_H
12#endif /* __CLANG_FLOAT_H */
lib/include/__float_infinity_nan.h created+20
...@@ -0,0 +1,20 @@
1/*===---- __float_infinity_nan.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 __CLANG_FLOAT_INFINITY_NAN_H
11#define __CLANG_FLOAT_INFINITY_NAN_H
12
13/* C23 5.2.5.3.3p29-30 */
14#undef INFINITY
15#undef NAN
16
17#define INFINITY (__builtin_inff())
18#define NAN (__builtin_nanf(""))
19
20#endif /* __CLANG_FLOAT_INFINITY_NAN_H */
lib/include/amo.h created+131
...@@ -0,0 +1,131 @@
1/*===---- amo.h - PowerPC Atomic Memory Operations ------------------------===*\
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 header provides compatibility for GCC's AMO functions.
10 * The functions here call Clang's underlying AMO builtins.
11 */
12
13#ifndef _AMO_H
14#define _AMO_H
15
16#include <stdint.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/* AMO Load Operation Codes (FC values) */
23enum {
24 _AMO_LD_ADD = 0x00, /* Fetch and Add */
25 _AMO_LD_XOR = 0x01, /* Fetch and XOR */
26 _AMO_LD_IOR = 0x02, /* Fetch and OR */
27 _AMO_LD_AND = 0x03, /* Fetch and AND */
28 _AMO_LD_UMAX = 0x04, /* Fetch and Maximum Unsigned */
29 _AMO_LD_SMAX = 0x05, /* Fetch and Maximum Signed */
30 _AMO_LD_UMIN = 0x06, /* Fetch and Minimum Unsigned */
31 _AMO_LD_SMIN = 0x07, /* Fetch and Minimum Signed */
32 _AMO_LD_SWAP = 0x08 /* Swap */
33};
34
35/* 32-bit unsigned AMO load operations */
36static inline uint32_t amo_lwat_add(uint32_t *ptr, uint32_t val) {
37 return __builtin_amo_lwat(ptr, val, _AMO_LD_ADD);
38}
39
40static inline uint32_t amo_lwat_xor(uint32_t *ptr, uint32_t val) {
41 return __builtin_amo_lwat(ptr, val, _AMO_LD_XOR);
42}
43
44static inline uint32_t amo_lwat_ior(uint32_t *ptr, uint32_t val) {
45 return __builtin_amo_lwat(ptr, val, _AMO_LD_IOR);
46}
47
48static inline uint32_t amo_lwat_and(uint32_t *ptr, uint32_t val) {
49 return __builtin_amo_lwat(ptr, val, _AMO_LD_AND);
50}
51
52static inline uint32_t amo_lwat_umax(uint32_t *ptr, uint32_t val) {
53 return __builtin_amo_lwat(ptr, val, _AMO_LD_UMAX);
54}
55
56static inline uint32_t amo_lwat_umin(uint32_t *ptr, uint32_t val) {
57 return __builtin_amo_lwat(ptr, val, _AMO_LD_UMIN);
58}
59
60static inline uint32_t amo_lwat_swap(uint32_t *ptr, uint32_t val) {
61 return __builtin_amo_lwat(ptr, val, _AMO_LD_SWAP);
62}
63
64/* 32-bit signed AMO load operations */
65static inline int32_t amo_lwat_sadd(int32_t *ptr, int32_t val) {
66 return __builtin_amo_lwat_s(ptr, val, _AMO_LD_ADD);
67}
68
69static inline int32_t amo_lwat_smax(int32_t *ptr, int32_t val) {
70 return __builtin_amo_lwat_s(ptr, val, _AMO_LD_SMAX);
71}
72
73static inline int32_t amo_lwat_smin(int32_t *ptr, int32_t val) {
74 return __builtin_amo_lwat_s(ptr, val, _AMO_LD_SMIN);
75}
76
77static inline int32_t amo_lwat_sswap(int32_t *ptr, int32_t val) {
78 return __builtin_amo_lwat_s(ptr, val, _AMO_LD_SWAP);
79}
80
81/* 64-bit unsigned AMO load operations */
82static inline uint64_t amo_ldat_add(uint64_t *ptr, uint64_t val) {
83 return __builtin_amo_ldat(ptr, val, _AMO_LD_ADD);
84}
85
86static inline uint64_t amo_ldat_xor(uint64_t *ptr, uint64_t val) {
87 return __builtin_amo_ldat(ptr, val, _AMO_LD_XOR);
88}
89
90static inline uint64_t amo_ldat_ior(uint64_t *ptr, uint64_t val) {
91 return __builtin_amo_ldat(ptr, val, _AMO_LD_IOR);
92}
93
94static inline uint64_t amo_ldat_and(uint64_t *ptr, uint64_t val) {
95 return __builtin_amo_ldat(ptr, val, _AMO_LD_AND);
96}
97
98static inline uint64_t amo_ldat_umax(uint64_t *ptr, uint64_t val) {
99 return __builtin_amo_ldat(ptr, val, _AMO_LD_UMAX);
100}
101
102static inline uint64_t amo_ldat_umin(uint64_t *ptr, uint64_t val) {
103 return __builtin_amo_ldat(ptr, val, _AMO_LD_UMIN);
104}
105
106static inline uint64_t amo_ldat_swap(uint64_t *ptr, uint64_t val) {
107 return __builtin_amo_ldat(ptr, val, _AMO_LD_SWAP);
108}
109
110/* 64-bit signed AMO load operations */
111static inline int64_t amo_ldat_sadd(int64_t *ptr, int64_t val) {
112 return __builtin_amo_ldat_s(ptr, val, _AMO_LD_ADD);
113}
114
115static inline int64_t amo_ldat_smax(int64_t *ptr, int64_t val) {
116 return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SMAX);
117}
118
119static inline int64_t amo_ldat_smin(int64_t *ptr, int64_t val) {
120 return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SMIN);
121}
122
123static inline int64_t amo_ldat_sswap(int64_t *ptr, int64_t val) {
124 return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SWAP);
125}
126
127#ifdef __cplusplus
128}
129#endif
130
131#endif /* _AMO_H */
lib/include/amxavx512intrin.h+215-1
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
1616
17#define __DEFAULT_FN_ATTRS_AVX512 \17#define __DEFAULT_FN_ATTRS_AVX512 \
18 __attribute__((__always_inline__, __nodebug__, \18 __attribute__((__always_inline__, __nodebug__, \
19 __target__("amx-avx512,avx10.2-512")))19 __target__("amx-avx512,avx10.2"), __min_vector_width__(512)))
2020
21/// Moves a row from a tile register to a zmm destination register, converting21/// Moves a row from a tile register to a zmm destination register, converting
22/// the int32 source elements to fp32. The row of the tile is selected by a22/// the int32 source elements to fp32. The row of the tile is selected by a
...@@ -52,6 +52,40 @@...@@ -52,6 +52,40 @@
52/// The row of the source tile52/// The row of the source tile
53#define _tile_cvtrowd2ps(tsrc, row) __builtin_ia32_tcvtrowd2ps(tsrc, row)53#define _tile_cvtrowd2ps(tsrc, row) __builtin_ia32_tcvtrowd2ps(tsrc, row)
5454
55/// Moves a row from a tile register to a zmm destination register, converting
56/// the int32 source elements to fp32. The row of the tile is selected by a
57/// 8b immediate value.
58///
59/// \headerfile <x86intrin.h>
60///
61/// \code
62/// __m512i _tile_cvtrowd2psi(__tile tsrc, const unsigned int imm8);
63/// \endcode
64///
65/// \code{.operation}
66/// VL := 512
67/// VL_bytes := VL >> 3
68/// row_index := imm8 & 0x3f
69/// row_chunk := (imm8 >> 6) * VL_bytes
70/// FOR i := 0 TO (VL_bytes / 4) - 1
71/// IF i + row_chunk / 4 >= tsrc.colsb / 4
72/// dst.dword[i] := 0
73/// ELSE
74/// dst.f32[i] := CONVERT_INT32_TO_FP32(tsrc.row[row_index].dword[row_chunk/4+i], RNE)
75/// FI
76/// ENDFOR
77/// dst[MAX_VL-1:VL] := 0
78/// zero_tileconfig_start()
79/// \endcode
80///
81/// This intrinsic corresponds to the \c TCVTROWD2PS instruction.
82///
83/// \param tsrc
84/// The source tile. Max size is 1024 Bytes.
85/// \param imm8
86/// The row of the source tile
87#define _tile_cvtrowd2psi(tsrc, imm8) __builtin_ia32_tcvtrowd2psi(tsrc, imm8)
88
55/// Moves a row from a tile register to a zmm destination register, converting89/// Moves a row from a tile register to a zmm destination register, converting
56/// the fp32 source elements to bf16. It places the resulting bf16 elements90/// the fp32 source elements to bf16. It places the resulting bf16 elements
57/// in the high 16 bits within each dword. The row of the tile is selected91/// in the high 16 bits within each dword. The row of the tile is selected
...@@ -89,6 +123,43 @@...@@ -89,6 +123,43 @@
89#define _tile_cvtrowps2bf16h(tsrc, row) \123#define _tile_cvtrowps2bf16h(tsrc, row) \
90 __builtin_ia32_tcvtrowps2bf16h(tsrc, row)124 __builtin_ia32_tcvtrowps2bf16h(tsrc, row)
91125
126/// Moves a row from a tile register to a zmm destination register, converting
127/// the fp32 source elements to bf16. It places the resulting bf16 elements
128/// in the high 16 bits within each dword. The row of the tile is selected
129/// by a 8b immediate value.
130///
131/// \headerfile <x86intrin.h>
132///
133/// \code
134/// __m512i _tile_cvtrowps2bf16hi(__tile tsrc, const unsigned int imm8);
135/// \endcode
136///
137/// \code{.operation}
138/// VL := 512
139/// VL_bytes := VL >> 3
140/// row_index := imm8 & 0x3f
141/// row_chunk := (imm8 >> 6) * VL_bytes
142/// FOR i := 0 TO (VL_bytes / 4) - 1
143/// IF i + row_chunk / 4 >= tsrc.colsb / 4
144/// dst.dword[i] := 0
145/// ELSE
146/// dst.word[2*i+0] := 0
147/// dst.bf16[2*i+1] := CONVERT_FP32_TO_BF16(tsrc.row[row_index].fp32[row_chunk/4+i], RNE)
148/// FI
149/// ENDFOR
150/// dst[MAX_VL-1:VL] := 0
151/// zero_tileconfig_start()
152/// \endcode
153///
154/// This intrinsic corresponds to the \c TCVTROWPS2BF16H instruction.
155///
156/// \param tsrc
157/// The source tile. Max size is 1024 Bytes.
158/// \param imm8
159/// The the row of the source tile.
160#define _tile_cvtrowps2bf16hi(tsrc, imm8) \
161 __builtin_ia32_tcvtrowps2bf16hi(tsrc, imm8)
162
92/// Moves a row from a tile register to a zmm destination register, converting163/// Moves a row from a tile register to a zmm destination register, converting
93/// the fp32 source elements to bf16. It places the resulting bf16 elements164/// the fp32 source elements to bf16. It places the resulting bf16 elements
94/// in the low 16 bits within each dword. The row of the tile is selected165/// in the low 16 bits within each dword. The row of the tile is selected
...@@ -126,6 +197,43 @@...@@ -126,6 +197,43 @@
126#define _tile_cvtrowps2bf16l(tsrc, row) \197#define _tile_cvtrowps2bf16l(tsrc, row) \
127 __builtin_ia32_tcvtrowps2bf16l(tsrc, row)198 __builtin_ia32_tcvtrowps2bf16l(tsrc, row)
128199
200/// Moves a row from a tile register to a zmm destination register, converting
201/// the fp32 source elements to bf16. It places the resulting bf16 elements
202/// in the low 16 bits within each dword. The row of the tile is selected
203/// by a 8b immediate value.
204///
205/// \headerfile <x86intrin.h>
206///
207/// \code
208/// __m512i _tile_cvtrowps2bf16li(__tile tsrc, const unsigned int imm8);
209/// \endcode
210///
211/// \code{.operation}
212/// VL := 512
213/// VL_bytes := VL >> 3
214/// row_index := imm8 & 0x3f
215/// row_chunk := (imm8 >> 6) * VL_bytes
216/// FOR i := 0 TO (VL_bytes / 4) - 1
217/// IF i + row_chunk / 4 >= tsrc.colsb / 4
218/// dst.dword[i] := 0
219/// ELSE
220/// dst.word[2*i+1] := 0
221/// dst.bf16[2*i+0] := CONVERT_FP32_TO_BF16(tsrc.row[row_index].fp32[row_chunk/4+i], RNE)
222/// FI
223/// ENDFOR
224/// dst[MAX_VL-1:VL] := 0
225/// zero_tileconfig_start()
226/// \endcode
227///
228/// This intrinsic corresponds to the \c TCVTROWPS2BF16L instruction.
229///
230/// \param tsrc
231/// The source tile. Max size is 1024 Bytes.
232/// \param imm8
233/// The the row of the source tile.
234#define _tile_cvtrowps2bf16li(tsrc, imm8) \
235 __builtin_ia32_tcvtrowps2bf16li(tsrc, imm8)
236
129/// Moves a row from a tile register to a zmm destination register, converting237/// Moves a row from a tile register to a zmm destination register, converting
130/// the fp32 source elements to fp16. It places the resulting fp16 elements238/// the fp32 source elements to fp16. It places the resulting fp16 elements
131/// in the high 16 bits within each dword. The row of the tile is selected239/// in the high 16 bits within each dword. The row of the tile is selected
...@@ -162,6 +270,43 @@...@@ -162,6 +270,43 @@
162/// The the row of the source tile.270/// The the row of the source tile.
163#define _tile_cvtrowps2phh(tsrc, row) __builtin_ia32_tcvtrowps2phh(tsrc, row)271#define _tile_cvtrowps2phh(tsrc, row) __builtin_ia32_tcvtrowps2phh(tsrc, row)
164272
273/// Moves a row from a tile register to a zmm destination register, converting
274/// the fp32 source elements to fp16. It places the resulting fp16 elements
275/// in the high 16 bits within each dword. The row of the tile is selected
276/// by a 8b immediate value.
277///
278/// \headerfile <x86intrin.h>
279///
280/// \code
281/// __m512i _tile_cvtrowps2phhi(__tile tsrc, constunsigned int imm8);
282/// \endcode
283///
284/// \code{.operation}
285/// VL := 512
286/// VL_bytes := VL >> 3
287/// row_index := imm8 & 0x3f
288/// row_chunk := (imm8 >> 6) * VL_bytes
289/// FOR i := 0 TO (VL_bytes / 4) - 1
290/// IF i + row_chunk / 4 >= tsrc.colsb / 4
291/// dst.dword[i] := 0
292/// ELSE
293/// dst.word[2*i+0] := 0
294/// dst.fp16[2*i+1] := CONVERT_FP32_TO_FP16(tsrc.row[row_index].fp32[row_chunk/4+i], RNE)
295/// FI
296/// ENDFOR
297/// dst[MAX_VL-1:VL] := 0
298/// zero_tileconfig_start()
299/// \endcode
300///
301/// This intrinsic corresponds to the \c TCVTROWPS2PHH instruction.
302///
303/// \param tsrc
304/// The source tile. Max size is 1024 Bytes.
305/// \param imm8
306/// The the row of the source tile.
307#define _tile_cvtrowps2phhi(tsrc, imm8) \
308 __builtin_ia32_tcvtrowps2phhi(tsrc, imm8)
309
165/// Moves a row from a tile register to a zmm destination register, converting310/// Moves a row from a tile register to a zmm destination register, converting
166/// the fp32 source elements to fp16. It places the resulting fp16 elements311/// the fp32 source elements to fp16. It places the resulting fp16 elements
167/// in the low 16 bits within each dword. The row of the tile is selected312/// in the low 16 bits within each dword. The row of the tile is selected
...@@ -198,6 +343,43 @@...@@ -198,6 +343,43 @@
198/// The the row of the source tile.343/// The the row of the source tile.
199#define _tile_cvtrowps2phl(tsrc, row) __builtin_ia32_tcvtrowps2phl(tsrc, row)344#define _tile_cvtrowps2phl(tsrc, row) __builtin_ia32_tcvtrowps2phl(tsrc, row)
200345
346/// Moves a row from a tile register to a zmm destination register, converting
347/// the fp32 source elements to fp16. It places the resulting fp16 elements
348/// in the low 16 bits within each dword. The row of the tile is selected
349/// by a 8b immediate value.
350///
351/// \headerfile <x86intrin.h>
352///
353/// \code
354/// __m512i _tile_cvtrowps2phli(__tile tsrc, const unsigned int imm8);
355/// \endcode
356///
357/// \code{.operation}
358/// VL := 512
359/// VL_bytes := VL >> 3
360/// row_index := imm8 & 0x3f
361/// row_chunk := (imm8 >> 6) * VL_bytes
362/// FOR i := 0 TO (VL_bytes / 4) - 1
363/// IF i + row_chunk / 4 >= tsrc.colsb / 4
364/// dst.dword[i] := 0
365/// ELSE
366/// dst.word[2*i+1] := 0
367/// dst.fp16[2*i+0] := CONVERT_FP32_TO_FP16(tsrc.row[row_index].fp32[row_chunk/4+i], RNE)
368/// FI
369/// ENDFOR
370/// dst[MAX_VL-1:VL] := 0
371/// zero_tileconfig_start()
372/// \endcode
373///
374/// This intrinsic corresponds to the \c TCVTROWPS2PHL instruction.
375///
376/// \param tsrc
377/// The source tile. Max size is 1024 Bytes.
378/// \param imm8
379/// The the row of the source tile.
380#define _tile_cvtrowps2phli(tsrc, imm8) \
381 __builtin_ia32_tcvtrowps2phli(tsrc, imm8)
382
201/// Move one row of a tile data to a v16f32 data.383/// Move one row of a tile data to a v16f32 data.
202/// The row of the tile is selected by a 32b GPR.384/// The row of the tile is selected by a 32b GPR.
203///385///
...@@ -230,6 +412,38 @@...@@ -230,6 +412,38 @@
230/// \endcode412/// \endcode
231#define _tile_movrow(a, b) ((__m512i)__builtin_ia32_tilemovrow(a, b))413#define _tile_movrow(a, b) ((__m512i)__builtin_ia32_tilemovrow(a, b))
232414
415/// Move one row of a tile data to a v16f32 data.
416/// The row of the tile is selected by a 8b immediate value.
417///
418/// \headerfile <immintrin.h>
419///
420/// \code
421/// __m512 _tile_movrowi(__tile a, const unsigned b);
422/// \endcode
423///
424/// This intrinsic corresponds to the <c> TILEMOVROW </c> instruction.
425///
426/// \param a
427/// The 1st source tile. Max size is 1024 Bytes.
428/// \param b
429/// The 2nd source r32. Size is 4 Bytes.
430/// \returns
431/// The destination v16f32 data. Size is 64 Bytes.
432///
433/// \code{.operation}
434/// VL := 512
435/// VL_bytes := VL>>3
436/// row_index := b&0x3f
437/// row_chunk := (b>>6) * VL_bytes
438/// FOR i := 0 TO (VL_bytes-1)
439/// IF (row_chunk + i >= a.colsb)
440/// dst.byte[i] := 0
441/// ELSE
442/// dst.byte[i] := a.row[row_index].byte[row_chunk+i]
443/// ENDFOR
444/// \endcode
445#define _tile_movrowi(a, b) ((__m512i)__builtin_ia32_tilemovrowi(a, b))
446
233/// This is internal intrinsic. C/C++ user should avoid calling it directly.447/// This is internal intrinsic. C/C++ user should avoid calling it directly.
234448
235static __inline__ __m512 __DEFAULT_FN_ATTRS_AVX512 _tile_cvtrowd2ps_internal(449static __inline__ __m512 __DEFAULT_FN_ATTRS_AVX512 _tile_cvtrowd2ps_internal(
lib/include/amxbf16transposeintrin.h deleted-94
...@@ -1,94 +0,0 @@
1/*===----- amxbf16transposeintrin.h - AMX-BF16 and AMX-TRANSPOSE ------------===
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 \
12 "Never use <amxbf16transposeintrin.h> directly; use <immintrin.h> instead."
13#endif /* __IMMINTRIN_H */
14
15#ifndef __AMX_BF16TRANSPOSEINTRIN_H
16#define __AMX_BF16TRANSPOSEINTRIN_H
17#ifdef __x86_64__
18
19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS \
21 __attribute__((__always_inline__, __nodebug__, \
22 __target__("amx-bf16,amx-transpose")))
23
24/// Compute transpose and dot-product of BF16 (16-bit) floating-point pairs in
25/// tiles \a a and \a b, accumulating the intermediate single-precision
26/// (32-bit) floating-point elements with elements in \a dst, and store the
27/// 32-bit result back to tile \a dst.
28///
29/// \headerfile <immintrin.h>
30///
31/// \code
32/// void _tile_tdpbf16ps (__tile dst, __tile a, __tile b)
33/// \endcode
34///
35/// \code{.operation}
36/// FOR m := 0 TO dst.rows - 1
37/// tmp := dst.row[m]
38/// FOR k := 0 TO (a.colsb / 4) - 1
39/// FOR n := 0 TO (dst.colsb / 4) - 1
40/// tmp.bf32[n] += FP32(a.row[m].bf16[2*k+0]) *
41/// FP32(b.row[k].bf16[2*n+0])
42/// tmp.bf32[n] += FP32(a.row[m].bf16[2*k+1]) *
43/// FP32(b.row[k].bf16[2*n+1])
44/// ENDFOR
45/// ENDFOR
46/// write_row_and_zero(dst, m, tmp, dst.colsb)
47/// ENDFOR
48/// zero_upper_rows(dst, dst.rows)
49/// zero_tileconfig_start()
50/// \endcode
51///
52/// This intrinsic corresponds to the \c TTDPBF16PS instruction.
53///
54/// \param dst
55/// The destination tile. Max size is 1024 Bytes.
56/// \param a
57/// The 1st source tile. Max size is 1024 Bytes.
58/// \param b
59/// The 2nd source tile. Max size is 1024 Bytes.
60#define _tile_tdpbf16ps(dst, a, b) __builtin_ia32_ttdpbf16ps((dst), (a), (b))
61
62/// This is internal intrinsic. C/C++ user should avoid calling it directly.
63static __inline__ _tile1024i __DEFAULT_FN_ATTRS
64_tile_tdpbf16ps_internal(unsigned short m, unsigned short n, unsigned short k,
65 _tile1024i dst, _tile1024i src1, _tile1024i src2) {
66 return __builtin_ia32_ttdpbf16ps_internal(m, n, k, dst, src1, src2);
67}
68
69/// Compute transpose and dot-product of BF16 (16-bit) floating-point pairs in
70/// tiles src0 and src1, accumulating the intermediate single-precision
71/// (32-bit) floating-point elements with elements in "dst", and store the
72/// 32-bit result back to tile "dst".
73///
74/// \headerfile <immintrin.h>
75///
76/// This intrinsic corresponds to the <c> TTDPBF16PS </c> instruction.
77///
78/// \param dst
79/// The destination tile. Max size is 1024 Bytes.
80/// \param src0
81/// The 1st source tile. Max size is 1024 Bytes.
82/// \param src1
83/// The 2nd source tile. Max size is 1024 Bytes.
84__DEFAULT_FN_ATTRS
85static __inline__ void __tile_tdpbf16ps(__tile1024i *dst, __tile1024i src0,
86 __tile1024i src1) {
87 dst->tile = _tile_tdpbf16ps_internal(src0.row, src1.col, src0.col, dst->tile,
88 src0.tile, src1.tile);
89}
90
91#undef __DEFAULT_FN_ATTRS
92
93#endif /* __x86_64__ */
94#endif /* __AMX_BF16TRANSPOSEINTRIN_H */
lib/include/amxcomplextransposeintrin.h deleted-303
...@@ -1,303 +0,0 @@
1/*===----- amxcomplextransposeintrin.h - AMX-COMPLEX and AMX-TRANSPOSE ------===
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 \
12 "Never use <amxcomplextransposeintrin.h> directly; include <immintrin.h> instead."
13#endif // __IMMINTRIN_H
14
15#ifndef __AMX_COMPLEXTRANSPOSEINTRIN_H
16#define __AMX_COMPLEXTRANSPOSEINTRIN_H
17#ifdef __x86_64__
18
19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, \
21 __target__("amx-complex,amx-transpose")))
22
23/// Perform matrix multiplication of two tiles containing complex elements and
24/// accumulate the results into a packed single precision tile. Each dword
25/// element in input tiles \a a and \a b is interpreted as a complex number
26/// with FP16 real part and FP16 imaginary part.
27/// Calculates the imaginary part of the result. For each possible combination
28/// of (transposed column of \a a, column of \a b), it performs a set of
29/// multiplication and accumulations on all corresponding complex numbers
30/// (one from \a a and one from \a b). The imaginary part of the \a a element
31/// is multiplied with the real part of the corresponding \a b element, and
32/// the real part of the \a a element is multiplied with the imaginary part
33/// of the corresponding \a b elements. The two accumulated results are
34/// added, and then accumulated into the corresponding row and column of
35/// \a dst.
36///
37/// \headerfile <x86intrin.h>
38///
39/// \code
40/// void _tile_tcmmimfp16ps(__tile dst, __tile a, __tile b);
41/// \endcode
42///
43/// \code{.operation}
44/// FOR m := 0 TO dst.rows - 1
45/// tmp := dst.row[m]
46/// FOR k := 0 TO a.rows - 1
47/// FOR n := 0 TO (dst.colsb / 4) - 1
48/// tmp.fp32[n] += FP32(a.row[m].fp16[2*k+0]) * FP32(b.row[k].fp16[2*n+1])
49/// tmp.fp32[n] += FP32(a.row[m].fp16[2*k+1]) * FP32(b.row[k].fp16[2*n+0])
50/// ENDFOR
51/// ENDFOR
52/// write_row_and_zero(dst, m, tmp, dst.colsb)
53/// ENDFOR
54/// zero_upper_rows(dst, dst.rows)
55/// zero_tileconfig_start()
56/// \endcode
57///
58/// This intrinsic corresponds to the \c TTCMMIMFP16PS instruction.
59///
60/// \param dst
61/// The destination tile. Max size is 1024 Bytes.
62/// \param a
63/// The 1st source tile. Max size is 1024 Bytes.
64/// \param b
65/// The 2nd source tile. Max size is 1024 Bytes.
66#define _tile_tcmmimfp16ps(dst, a, b) \
67 __builtin_ia32_ttcmmimfp16ps((dst), (a), (b))
68
69/// Perform matrix multiplication of two tiles containing complex elements and
70/// accumulate the results into a packed single precision tile. Each dword
71/// element in input tiles \a a and \a b is interpreted as a complex number
72/// with FP16 real part and FP16 imaginary part.
73/// Calculates the real part of the result. For each possible combination
74/// of (rtransposed colum of \a a, column of \a b), it performs a set of
75/// multiplication and accumulations on all corresponding complex numbers
76/// (one from \a a and one from \a b). The real part of the \a a element is
77/// multiplied with the real part of the corresponding \a b element, and the
78/// negated imaginary part of the \a a element is multiplied with the
79/// imaginary part of the corresponding \a b elements. The two accumulated
80/// results are added, and then accumulated into the corresponding row and
81/// column of \a dst.
82///
83/// \headerfile <x86intrin.h>
84///
85/// \code
86/// void _tile_tcmmrlfp16ps(__tile dst, __tile a, __tile b);
87/// \endcode
88///
89/// \code{.operation}
90/// FOR m := 0 TO dst.rows - 1
91/// tmp := dst.row[m]
92/// FOR k := 0 TO a.rows - 1
93/// FOR n := 0 TO (dst.colsb / 4) - 1
94/// tmp.fp32[n] += FP32(a.row[m].fp16[2*k+0]) * FP32(b.row[k].fp16[2*n+0])
95/// tmp.fp32[n] += FP32(-a.row[m].fp16[2*k+1]) * FP32(b.row[k].fp16[2*n+1])
96/// ENDFOR
97/// ENDFOR
98/// write_row_and_zero(dst, m, tmp, dst.colsb)
99/// ENDFOR
100/// zero_upper_rows(dst, dst.rows)
101/// zero_tileconfig_start()
102/// \endcode
103///
104/// This intrinsic corresponds to the \c TTCMMIMFP16PS instruction.
105///
106/// \param dst
107/// The destination tile. Max size is 1024 Bytes.
108/// \param a
109/// The 1st source tile. Max size is 1024 Bytes.
110/// \param b
111/// The 2nd source tile. Max size is 1024 Bytes.
112#define _tile_tcmmrlfp16ps(dst, a, b) \
113 __builtin_ia32_ttcmmrlfp16ps((dst), (a), (b))
114
115/// Perform matrix conjugate transpose and multiplication of two tiles
116/// containing complex elements and accumulate the results into a packed
117/// single precision tile. Each dword element in input tiles \a a and \a b
118/// is interpreted as a complex number with FP16 real part and FP16 imaginary
119/// part.
120/// Calculates the imaginary part of the result. For each possible combination
121/// of (transposed column of \a a, column of \a b), it performs a set of
122/// multiplication and accumulations on all corresponding complex numbers
123/// (one from \a a and one from \a b). The negated imaginary part of the \a a
124/// element is multiplied with the real part of the corresponding \a b
125/// element, and the real part of the \a a element is multiplied with the
126/// imaginary part of the corresponding \a b elements. The two accumulated
127/// results are added, and then accumulated into the corresponding row and
128/// column of \a dst.
129///
130/// \headerfile <x86intrin.h>
131///
132/// \code
133/// void _tile_conjtcmmimfp16ps(__tile dst, __tile a, __tile b);
134/// \endcode
135///
136/// \code{.operation}
137/// FOR m := 0 TO dst.rows - 1
138/// tmp := dst.row[m]
139/// FOR k := 0 TO a.rows - 1
140/// FOR n := 0 TO (dst.colsb / 4) - 1
141/// tmp.fp32[n] += FP32(a.row[m].fp16[2*k+0]) * FP32(b.row[k].fp16[2*n+1])
142/// tmp.fp32[n] += FP32(-a.row[m].fp16[2*k+1]) * FP32(b.row[k].fp16[2*n+0])
143/// ENDFOR
144/// ENDFOR
145/// write_row_and_zero(dst, m, tmp, dst.colsb)
146/// ENDFOR
147/// zero_upper_rows(dst, dst.rows)
148/// zero_tileconfig_start()
149/// \endcode
150///
151/// This intrinsic corresponds to the \c TCONJTCMMIMFP16PS instruction.
152///
153/// \param dst
154/// The destination tile. Max size is 1024 Bytes.
155/// \param a
156/// The 1st source tile. Max size is 1024 Bytes.
157/// \param b
158/// The 2nd source tile. Max size is 1024 Bytes.
159#define _tile_conjtcmmimfp16ps(dst, a, b) \
160 __builtin_ia32_tconjtcmmimfp16ps((dst), (a), (b))
161
162/// Perform conjugate transpose of an FP16-pair of complex elements from \a a
163/// and writes the result to \a dst.
164///
165/// \headerfile <x86intrin.h>
166///
167/// \code
168/// void _tile_conjtfp16(__tile dst, __tile a);
169/// \endcode
170///
171/// \code{.operation}
172/// FOR i := 0 TO dst.rows - 1
173/// FOR j := 0 TO (dst.colsb / 4) - 1
174/// tmp.fp16[2*j+0] := a.row[j].fp16[2*i+0]
175/// tmp.fp16[2*j+1] := -a.row[j].fp16[2*i+1]
176/// ENDFOR
177/// write_row_and_zero(dst, i, tmp, dst.colsb)
178/// ENDFOR
179/// zero_upper_rows(dst, dst.rows)
180/// zero_tileconfig_start()
181/// \endcode
182///
183/// This intrinsic corresponds to the \c TCONJTFP16 instruction.
184///
185/// \param dst
186/// The destination tile. Max size is 1024 Bytes.
187/// \param a
188/// The source tile. Max size is 1024 Bytes.
189#define _tile_conjtfp16(dst, a) __builtin_ia32_tconjtfp16((dst), (a))
190
191static __inline__ _tile1024i __DEFAULT_FN_ATTRS _tile_tcmmimfp16ps_internal(
192 unsigned short m, unsigned short n, unsigned short k, _tile1024i dst,
193 _tile1024i src1, _tile1024i src2) {
194 return __builtin_ia32_ttcmmimfp16ps_internal(m, n, k, dst, src1, src2);
195}
196
197static __inline__ _tile1024i __DEFAULT_FN_ATTRS _tile_tcmmrlfp16ps_internal(
198 unsigned short m, unsigned short n, unsigned short k, _tile1024i dst,
199 _tile1024i src1, _tile1024i src2) {
200 return __builtin_ia32_ttcmmrlfp16ps_internal(m, n, k, dst, src1, src2);
201}
202
203static __inline__ _tile1024i __DEFAULT_FN_ATTRS _tile_conjtcmmimfp16ps_internal(
204 unsigned short m, unsigned short n, unsigned short k, _tile1024i dst,
205 _tile1024i src1, _tile1024i src2) {
206 return __builtin_ia32_tconjtcmmimfp16ps_internal(m, n, k, dst, src1, src2);
207}
208
209static __inline__ _tile1024i __DEFAULT_FN_ATTRS
210_tile_conjtfp16_internal(unsigned short m, unsigned short n, _tile1024i src) {
211 return __builtin_ia32_tconjtfp16_internal(m, n, src);
212}
213
214/// Perform matrix multiplication of two tiles containing complex elements and
215/// accumulate the results into a packed single precision tile. Each dword
216/// element in input tiles src0 and src1 is interpreted as a complex number
217/// with FP16 real part and FP16 imaginary part.
218/// This function calculates the imaginary part of the result.
219///
220/// \headerfile <immintrin.h>
221///
222/// This intrinsic corresponds to the <c> TTCMMIMFP16PS </c> instruction.
223///
224/// \param dst
225/// The destination tile. Max size is 1024 Bytes.
226/// \param src0
227/// The 1st source tile. Max size is 1024 Bytes.
228/// \param src1
229/// The 2nd source tile. Max size is 1024 Bytes.
230__DEFAULT_FN_ATTRS
231static void __tile_tcmmimfp16ps(__tile1024i *dst, __tile1024i src0,
232 __tile1024i src1) {
233 dst->tile = _tile_tcmmimfp16ps_internal(src0.row, src1.col, src0.col,
234 dst->tile, src0.tile, src1.tile);
235}
236
237/// Perform matrix multiplication of two tiles containing complex elements and
238/// accumulate the results into a packed single precision tile. Each dword
239/// element in input tiles src0 and src1 is interpreted as a complex number
240/// with FP16 real part and FP16 imaginary part.
241/// This function calculates the real part of the result.
242///
243/// \headerfile <immintrin.h>
244///
245/// This intrinsic corresponds to the <c> TTCMMRLFP16PS </c> instruction.
246///
247/// \param dst
248/// The destination tile. Max size is 1024 Bytes.
249/// \param src0
250/// The 1st source tile. Max size is 1024 Bytes.
251/// \param src1
252/// The 2nd source tile. Max size is 1024 Bytes.
253__DEFAULT_FN_ATTRS
254static void __tile_tcmmrlfp16ps(__tile1024i *dst, __tile1024i src0,
255 __tile1024i src1) {
256 dst->tile = _tile_tcmmrlfp16ps_internal(src0.row, src1.col, src0.col,
257 dst->tile, src0.tile, src1.tile);
258}
259
260/// Perform matrix conjugate transpose and multiplication of two tiles
261/// containing complex elements and accumulate the results into a packed
262/// single precision tile. Each dword element in input tiles src0 and src1
263/// is interpreted as a complex number with FP16 real part and FP16 imaginary
264/// part.
265/// This function calculates the imaginary part of the result.
266///
267/// \headerfile <immintrin.h>
268///
269/// This intrinsic corresponds to the <c> TCONJTCMMIMFP16PS </c> instruction.
270///
271/// \param dst
272/// The destination tile. Max size is 1024 Bytes.
273/// \param src0
274/// The 1st source tile. Max size is 1024 Bytes.
275/// \param src1
276/// The 2nd source tile. Max size is 1024 Bytes.
277__DEFAULT_FN_ATTRS
278static void __tile_conjtcmmimfp16ps(__tile1024i *dst, __tile1024i src0,
279 __tile1024i src1) {
280 dst->tile = _tile_conjtcmmimfp16ps_internal(src0.row, src1.col, src0.col,
281 dst->tile, src0.tile, src1.tile);
282}
283
284/// Perform conjugate transpose of an FP16-pair of complex elements from src and
285/// writes the result to dst.
286///
287/// \headerfile <immintrin.h>
288///
289/// This intrinsic corresponds to the <c> TCONJTFP16 </c> instruction.
290///
291/// \param dst
292/// The destination tile. Max size is 1024 Bytes.
293/// \param src
294/// The source tile. Max size is 1024 Bytes.
295__DEFAULT_FN_ATTRS
296static void __tile_conjtfp16(__tile1024i *dst, __tile1024i src) {
297 dst->tile = _tile_conjtfp16_internal(src.row, src.col, src.tile);
298}
299
300#undef __DEFAULT_FN_ATTRS
301
302#endif // __x86_64__
303#endif // __AMX_COMPLEXTRANSPOSEINTRIN_H
lib/include/amxfp16transposeintrin.h deleted-94
...@@ -1,94 +0,0 @@
1/*===----- amxfp16transposeintrin.h - AMX-FP16 and AMX-TRANSPOSE ------------===
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 \
12 "Never use <amxfp16transposeintrin.h> directly; use <immintrin.h> instead."
13#endif /* __IMMINTRIN_H */
14
15#ifndef __AMX_FP16TRANSPOSEINTRIN_H
16#define __AMX_FP16TRANSPOSEINTRIN_H
17#ifdef __x86_64__
18
19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS \
21 __attribute__((__always_inline__, __nodebug__, \
22 __target__("amx-fp16,amx-transpose")))
23
24/// Compute transpose and dot-product of FP16 (16-bit) floating-point pairs in
25/// tiles \a a and \a b, accumulating the intermediate single-precision
26/// (32-bit) floating-point elements with elements in \a dst, and store the
27/// 32-bit result back to tile \a dst.
28///
29/// \headerfile <immintrin.h>
30///
31/// \code
32/// void _tile_tdpfp16ps (__tile dst, __tile a, __tile b)
33/// \endcode
34///
35/// \code{.operation}
36/// FOR m := 0 TO dst.rows - 1
37/// tmp := dst.row[m]
38/// FOR k := 0 TO (a.colsb / 4) - 1
39/// FOR n := 0 TO (dst.colsb / 4) - 1
40/// tmp.fp32[n] += FP32(a.row[m].fp16[2*k+0]) *
41/// FP32(b.row[k].fp16[2*n+0])
42/// tmp.fp32[n] += FP32(a.row[m].fp16[2*k+1]) *
43/// FP32(b.row[k].fp16[2*n+1])
44/// ENDFOR
45/// ENDFOR
46/// write_row_and_zero(dst, m, tmp, dst.colsb)
47/// ENDFOR
48/// zero_upper_rows(dst, dst.rows)
49/// zero_tileconfig_start()
50/// \endcode
51///
52/// This intrinsic corresponds to the \c TTDPFP16PS instruction.
53///
54/// \param dst
55/// The destination tile. Max size is 1024 Bytes.
56/// \param a
57/// The 1st source tile. Max size is 1024 Bytes.
58/// \param b
59/// The 2nd source tile. Max size is 1024 Bytes.
60#define _tile_tdpfp16ps(dst, a, b) __builtin_ia32_ttdpfp16ps((dst), (a), (b))
61
62/// This is internal intrinsic. C/C++ user should avoid calling it directly.
63static __inline__ _tile1024i __DEFAULT_FN_ATTRS
64_tile_tdpfp16ps_internal(unsigned short m, unsigned short n, unsigned short k,
65 _tile1024i dst, _tile1024i src1, _tile1024i src2) {
66 return __builtin_ia32_ttdpfp16ps_internal(m, n, k, dst, src1, src2);
67}
68
69/// Compute transpose and dot-product of FP16 (16-bit) floating-point pairs in
70/// tiles src0 and src1, accumulating the intermediate single-precision
71/// (32-bit) floating-point elements with elements in "dst", and store the
72/// 32-bit result back to tile "dst".
73///
74/// \headerfile <immintrin.h>
75///
76/// This intrinsic corresponds to the <c> TTDPFP16PS </c> instruction.
77///
78/// \param dst
79/// The destination tile. Max size is 1024 Bytes.
80/// \param src0
81/// The 1st source tile. Max size is 1024 Bytes.
82/// \param src1
83/// The 2nd source tile. Max size is 1024 Bytes.
84__DEFAULT_FN_ATTRS
85static __inline__ void __tile_tdpfp16ps(__tile1024i *dst, __tile1024i src0,
86 __tile1024i src1) {
87 dst->tile = _tile_tdpfp16ps_internal(src0.row, src1.col, src0.col, dst->tile,
88 src0.tile, src1.tile);
89}
90
91#undef __DEFAULT_FN_ATTRS
92
93#endif /* __x86_64__ */
94#endif /* __AMX_FP16TRANSPOSEINTRIN_H */
lib/include/amxintrin.h-2
...@@ -230,8 +230,6 @@ static __inline__ void __DEFAULT_FN_ATTRS_TILE _tile_release(void) {...@@ -230,8 +230,6 @@ static __inline__ void __DEFAULT_FN_ATTRS_TILE _tile_release(void) {
230/// bytes. Since there is no 2D type in llvm IR, we use vector type to230/// bytes. Since there is no 2D type in llvm IR, we use vector type to
231/// represent 2D tile and the fixed size is maximum amx tile register size.231/// represent 2D tile and the fixed size is maximum amx tile register size.
232typedef int _tile1024i __attribute__((__vector_size__(1024), __aligned__(64)));232typedef int _tile1024i __attribute__((__vector_size__(1024), __aligned__(64)));
233typedef int _tile1024i_1024a
234 __attribute__((__vector_size__(1024), __aligned__(1024)));
235233
236/// This is internal intrinsic. C/C++ user should avoid calling it directly.234/// This is internal intrinsic. C/C++ user should avoid calling it directly.
237static __inline__ _tile1024i __DEFAULT_FN_ATTRS_TILE235static __inline__ _tile1024i __DEFAULT_FN_ATTRS_TILE
lib/include/amxmovrstransposeintrin.h deleted-200
...@@ -1,200 +0,0 @@
1/* ===--- amxmovrstransposeintrin.h - AMX_MOVRS_TRANSPOSE 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 __IMMINTRIN_H
11#error \
12 "Never use <amxmovrstransposeintrin.h> directly; use <immintrin.h> instead."
13#endif /* __IMMINTRIN_H */
14
15#ifndef __AMX_MOVRS_TRANSPOSEINTRIN_H
16#define __AMX_MOVRS_TRANSPOSEINTRIN_H
17#ifdef __x86_64__
18
19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, \
21 __target__("amx-transpose,amx-movrs")))
22
23#define _tile_2rpntlvwz0rs(tdst, base, stride) \
24 __builtin_ia32_t2rpntlvwz0rs(tdst, base, stride)
25#define _tile_2rpntlvwz0rst1(tdst, base, stride) \
26 __builtin_ia32_t2rpntlvwz0rst1(tdst, base, stride)
27#define _tile_2rpntlvwz1rs(tdst, base, stride) \
28 __builtin_ia32_t2rpntlvwz1rs(tdst, base, stride)
29#define _tile_2rpntlvwz1rst1(tdst, base, stride) \
30 __builtin_ia32_t2rpntlvwz1rst1(tdst, base, stride)
31
32static __inline__ void __DEFAULT_FN_ATTRS _tile_2rpntlvwz0rs_internal(
33 unsigned short row, unsigned short col0, unsigned short col1,
34 _tile1024i *dst0, _tile1024i *dst1, const void *base,
35 __SIZE_TYPE__ stride) {
36 // Use __tile1024i_1024a* to escape the alignment check in
37 // clang/test/Headers/x86-intrinsics-headers-clean.cpp
38 __builtin_ia32_t2rpntlvwz0rs_internal(
39 row, col0, col1, (_tile1024i_1024a *)dst0, (_tile1024i_1024a *)dst1, base,
40 (__SIZE_TYPE__)(stride));
41}
42
43static __inline__ void __DEFAULT_FN_ATTRS _tile_2rpntlvwz0rst1_internal(
44 unsigned short row, unsigned short col0, unsigned short col1,
45 _tile1024i *dst0, _tile1024i *dst1, const void *base,
46 __SIZE_TYPE__ stride) {
47 __builtin_ia32_t2rpntlvwz0rst1_internal(
48 row, col0, col1, (_tile1024i_1024a *)dst0, (_tile1024i_1024a *)dst1, base,
49 (__SIZE_TYPE__)(stride));
50}
51
52static __inline__ void __DEFAULT_FN_ATTRS _tile_2rpntlvwz1rs_internal(
53 unsigned short row, unsigned short col0, unsigned short col1,
54 _tile1024i *dst0, _tile1024i *dst1, const void *base,
55 __SIZE_TYPE__ stride) {
56 __builtin_ia32_t2rpntlvwz1rs_internal(
57 row, col0, col1, (_tile1024i_1024a *)dst0, (_tile1024i_1024a *)dst1, base,
58 (__SIZE_TYPE__)(stride));
59}
60
61static __inline__ void __DEFAULT_FN_ATTRS _tile_2rpntlvwz1rst1_internal(
62 unsigned short row, unsigned short col0, unsigned short col1,
63 _tile1024i *dst0, _tile1024i *dst1, const void *base,
64 __SIZE_TYPE__ stride) {
65 __builtin_ia32_t2rpntlvwz1rst1_internal(
66 row, col0, col1, (_tile1024i_1024a *)dst0, (_tile1024i_1024a *)dst1, base,
67 (__SIZE_TYPE__)(stride));
68}
69
70/// Converts a pair of tiles from memory into VNNI format, and places the
71/// results in a pair of destinations specified by dst. The pair of tiles
72/// in memory is specified via a tsib; the second tile is after the first
73/// one, separated by the same stride that separates each row.
74/// The tile configuration for the destination tiles indicates the amount
75/// of data to read from memory. The instruction will load a number of rows
76/// that is equal to twice the number of rows in tmm1. The size of each row
77/// is equal to the average width of the destination tiles. If the second
78/// tile is configured with zero rows and columns, only the first tile will
79/// be written.
80/// Provides a hint to the implementation that the data will likely become
81/// read shared in the near future and the data caching can be optimized.
82///
83/// \headerfile <immintrin.h>
84///
85/// This intrinsic corresponds to the <c> T2RPNTLVWZ0RS </c> instruction.
86///
87/// \param dst0
88/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
89/// \param dst1
90/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
91/// \param base
92/// A pointer to base address.
93/// \param stride
94/// The stride between the rows' data to be loaded in memory.
95__DEFAULT_FN_ATTRS
96static void __tile_2rpntlvwz0rs(__tile1024i *dst0, __tile1024i *dst1,
97 const void *base, __SIZE_TYPE__ stride) {
98 _tile_2rpntlvwz0rs_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
99 &dst1->tile, base, stride);
100}
101
102/// Converts a pair of tiles from memory into VNNI format, and places the
103/// results in a pair of destinations specified by dst. The pair of tiles
104/// in memory is specified via a tsib; the second tile is after the first
105/// one, separated by the same stride that separates each row.
106/// The tile configuration for the destination tiles indicates the amount
107/// of data to read from memory. The instruction will load a number of rows
108/// that is equal to twice the number of rows in tmm1. The size of each row
109/// is equal to the average width of the destination tiles. If the second
110/// tile is configured with zero rows and columns, only the first tile will
111/// be written.
112///
113/// \headerfile <immintrin.h>
114///
115/// This intrinsic corresponds to the <c> T2RPNTLVWZ0T1RS </c> instruction.
116///
117/// \param dst0
118/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
119/// \param dst1
120/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
121/// \param base
122/// A pointer to base address.
123/// \param stride
124/// The stride between the rows' data to be loaded in memory.
125__DEFAULT_FN_ATTRS
126static void __tile_2rpntlvwz0rst1(__tile1024i *dst0, __tile1024i *dst1,
127 const void *base, __SIZE_TYPE__ stride) {
128 _tile_2rpntlvwz0rst1_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
129 &dst1->tile, base, stride);
130}
131
132/// Converts a pair of tiles from memory into VNNI format, and places the
133/// results in a pair of destinations specified by dst. The pair of tiles
134/// in memory is specified via a tsib; the second tile is after the first
135/// one, separated by the same stride that separates each row.
136/// The tile configuration for the destination tiles indicates the amount
137/// of data to read from memory. The instruction will load a number of rows
138/// that is equal to twice the number of rows in tmm1. The size of each row
139/// is equal to the average width of the destination tiles. If the second
140/// tile is configured with zero rows and columns, only the first tile will
141/// be written. The last row will be not be read from memory but instead
142/// filled with zeros.
143/// Provides a hint to the implementation that the data will likely become
144/// read shared in the near future and the data caching can be optimized.
145///
146/// \headerfile <immintrin.h>
147///
148/// This intrinsic corresponds to the <c> T2RPNTLVWZ1 </c> instruction.
149///
150/// \param dst0
151/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
152/// \param dst1
153/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
154/// \param base
155/// A pointer to base address.
156/// \param stride
157/// The stride between the rows' data to be loaded in memory.
158__DEFAULT_FN_ATTRS
159static void __tile_2rpntlvwz1rs(__tile1024i *dst0, __tile1024i *dst1,
160 const void *base, __SIZE_TYPE__ stride) {
161 _tile_2rpntlvwz1rs_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
162 &dst1->tile, base, stride);
163}
164
165/// Converts a pair of tiles from memory into VNNI format, and places the
166/// results in a pair of destinations specified by dst. The pair of tiles
167/// in memory is specified via a tsib; the second tile is after the first
168/// one, separated by the same stride that separates each row.
169/// The tile configuration for the destination tiles indicates the amount
170/// of data to read from memory. The instruction will load a number of rows
171/// that is equal to twice the number of rows in tmm1. The size of each row
172/// is equal to the average width of the destination tiles. If the second
173/// tile is configured with zero rows and columns, only the first tile will
174/// be written. The last row will be not be read from memory but instead
175/// filled with zeros.
176/// Provides a hint to the implementation that the data will likely become
177/// read shared in the near future and the data caching can be optimized.
178///
179/// \headerfile <immintrin.h>
180///
181/// This intrinsic corresponds to the <c> T2RPNTLVWZ1T1RS </c> instruction.
182///
183/// \param dst0
184/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
185/// \param dst1
186/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
187/// \param base
188/// A pointer to base address.
189/// \param stride
190/// The stride between the rows' data to be loaded in memory.
191__DEFAULT_FN_ATTRS
192static void __tile_2rpntlvwz1rst1(__tile1024i *dst0, __tile1024i *dst1,
193 const void *base, __SIZE_TYPE__ stride) {
194 _tile_2rpntlvwz1rst1_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
195 &dst1->tile, base, stride);
196}
197
198#undef __DEFAULT_FN_ATTRS
199#endif /* __x86_64__ */
200#endif /* __AMX_MOVRS_TRANSPOSEINTRIN_H */
lib/include/amxtf32transposeintrin.h deleted-105
...@@ -1,105 +0,0 @@
1/*===--------- amxtf32transposeintrin.h - AMX-TF32 and AMX-TRANSPOSE --------===
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 __IMMINTRIN_H
10#error \
11 "Never use <amxtf32transposeintrin.h> directly; include <immintrin.h> instead."
12#endif // __IMMINTRIN_H
13
14#ifndef __AMX_TF32TRANSPOSEINTRIN_H
15#define __AMX_TF32TRANSPOSEINTRIN_H
16#ifdef __x86_64__
17
18#define __DEFAULT_FN_ATTRS_TF32_TRANSPOSE \
19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("amx-tf32,amx-transpose")))
21
22/// \code
23/// void _tile_tmmultf32ps(constexpr int srcdst, constexpr int a, \
24/// constexpr int b);
25/// \endcode
26///
27/// This intrinsic corresponds to the <c> TTMMULTF32PS </c> instruction.
28///
29/// \param srcdst
30/// The destination tile. Max size is 1024 Bytes.
31/// \param a
32/// The 1st source tile. Max size is 1024 Bytes.
33/// \param b
34/// The 2nd source tile. Max size is 1024 Bytes.
35///
36/// \code{.operation}
37/// DEFINE zero_lower_mantissa_bits_fp32(x[31:0]) {
38/// dword[12:0] := 0
39/// dword[31:13] := x[31:13]
40/// return dword
41/// }
42///
43/// DEFINE silence_snan_fp32(x[31:0]) {
44/// IF (x.exponent == 255 and x.fraction != 0 and x.fraction[22] == 0)
45/// x.fraction[22] := 1
46/// return x
47/// }
48///
49/// elements_dest:= srcdst.colsb/4
50///
51/// FOR m := 0 TO (srcdst.rows-1)
52/// tmp[511:0] := 0
53/// FOR k := 0 TO (a.rows-1)
54/// FOR n := 0 TO (elements_dest-1)
55/// a1e := silence_snan_fp32(a.row[k].fp32[m])
56/// a2e := silence_snan_fp32(b.row[k].fp32[n])
57/// s1e := zero_lower_mantissa_bits_fp32(a1e)
58/// s2e := zero_lower_mantissa_bits_fp32(a2e)
59/// tmp.fp32[n] += s1e * s2e
60/// ENDFOR
61/// ENDFOR
62///
63/// FOR n := 0 TO (elements_dest-1)
64/// tmp.fp32[n] += srcdst.row[m].fp32[n]
65/// ENDFOR
66/// write_row_and_zero(srcdst, m, tmp, srcdst.colsb)
67///
68/// ENDFOR
69///
70/// zero_upper_rows(srcdst, srcdst.rows)
71/// zero_tileconfig_start()
72/// \endcode
73#define _tile_tmmultf32ps(srcdst, a, b) \
74 __builtin_ia32_ttmmultf32ps((srcdst), (a), (b))
75
76// dst = m x n (srcdest), src1 = k x m, src2 = k x n
77static __inline__ _tile1024i __DEFAULT_FN_ATTRS_TF32_TRANSPOSE
78_tile_tmmultf32ps_internal(unsigned short m, unsigned short n, unsigned short k,
79 _tile1024i dst, _tile1024i src1, _tile1024i src2) {
80 return __builtin_ia32_ttmmultf32ps_internal(m, n, k, dst, src1, src2);
81}
82
83/// Compute transpose and do Matrix Multiplication of src0 and src1, and then do
84/// Matrix Plus with dst. All the calculation is base on float32 but with the
85/// lower 13-bit set to 0.
86///
87/// \headerfile <immintrin.h>
88///
89/// This intrinsic corresponds to the <c> TTMMULTF32PS </c> instruction.
90///
91/// \param dst
92/// The destination tile. Max size is 1024 Bytes.
93/// \param src0
94/// The 1st source tile. Max size is 1024 Bytes.
95/// \param src1
96/// The 2nd source tile. Max size is 1024 Bytes.
97__DEFAULT_FN_ATTRS_TF32_TRANSPOSE
98static void __tile_tmmultf32ps(__tile1024i *dst, __tile1024i src0,
99 __tile1024i src1) {
100 dst->tile = _tile_tmmultf32ps_internal(src0.row, src1.col, src0.col,
101 dst->tile, src0.tile, src1.tile);
102}
103
104#endif // __x86_64__
105#endif // __AMX_TF32TRANSPOSEINTRIN_H
lib/include/amxtransposeintrin.h deleted-248
...@@ -1,248 +0,0 @@
1/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE 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 <amxtransposeintrin.h> directly; use <immintrin.h> instead."
12#endif /* __IMMINTRIN_H */
13
14#ifndef __AMX_TRANSPOSEINTRIN_H
15#define __AMX_TRANSPOSEINTRIN_H
16#ifdef __x86_64__
17
18#define __DEFAULT_FN_ATTRS_TRANSPOSE \
19 __attribute__((__always_inline__, __nodebug__, __target__("amx-transpose")))
20
21#define _tile_2rpntlvwz0(tdst, base, stride) \
22 __builtin_ia32_t2rpntlvwz0(tdst, base, stride)
23#define _tile_2rpntlvwz0t1(tdst, base, stride) \
24 __builtin_ia32_t2rpntlvwz0t1(tdst, base, stride)
25#define _tile_2rpntlvwz1(tdst, base, stride) \
26 __builtin_ia32_t2rpntlvwz1(tdst, base, stride)
27#define _tile_2rpntlvwz1t1(tdst, base, stride) \
28 __builtin_ia32_t2rpntlvwz1t1(tdst, base, stride)
29
30/// Transpose 32-bit elements from \a src and write the result to \a dst.
31///
32/// \headerfile <immintrin.h>
33///
34/// \code
35/// void _tile_transposed(__tile dst, __tile src);
36/// \endcode
37///
38/// This intrinsic corresponds to the <c> TTRANSPOSED </c> instruction.
39///
40/// \param dst
41/// The destination tile. Max size is 1024 Bytes.
42/// \param src
43/// The source tile. Max size is 1024 Bytes.
44///
45/// \code{.operation}
46///
47/// FOR i := 0 TO (dst.rows-1)
48/// tmp[511:0] := 0
49/// FOR j := 0 TO (dst.colsb/4-1)
50/// tmp.dword[j] := src.row[j].dword[i]
51/// ENDFOR
52/// dst.row[i] := tmp
53/// ENDFOR
54///
55/// zero_upper_rows(dst, dst.rows)
56/// zero_tileconfig_start()
57/// \endcode
58#define _tile_transposed(dst, src) __builtin_ia32_ttransposed(dst, src)
59
60static __inline__ void __DEFAULT_FN_ATTRS_TRANSPOSE _tile_2rpntlvwz0_internal(
61 unsigned short row, unsigned short col0, unsigned short col1,
62 _tile1024i *dst0, _tile1024i *dst1, const void *base,
63 __SIZE_TYPE__ stride) {
64 // Use __tile1024i_1024a* to escape the alignment check in
65 // clang/test/Headers/x86-intrinsics-headers-clean.cpp
66 __builtin_ia32_t2rpntlvwz0_internal(row, col0, col1, (_tile1024i_1024a *)dst0,
67 (_tile1024i_1024a *)dst1, base,
68 (__SIZE_TYPE__)(stride));
69}
70
71static __inline__ void __DEFAULT_FN_ATTRS_TRANSPOSE _tile_2rpntlvwz0t1_internal(
72 unsigned short row, unsigned short col0, unsigned short col1,
73 _tile1024i *dst0, _tile1024i *dst1, const void *base,
74 __SIZE_TYPE__ stride) {
75 __builtin_ia32_t2rpntlvwz0t1_internal(
76 row, col0, col1, (_tile1024i_1024a *)dst0, (_tile1024i_1024a *)dst1, base,
77 (__SIZE_TYPE__)(stride));
78}
79
80static __inline__ void __DEFAULT_FN_ATTRS_TRANSPOSE _tile_2rpntlvwz1_internal(
81 unsigned short row, unsigned short col0, unsigned short col1,
82 _tile1024i *dst0, _tile1024i *dst1, const void *base,
83 __SIZE_TYPE__ stride) {
84 __builtin_ia32_t2rpntlvwz1_internal(row, col0, col1, (_tile1024i_1024a *)dst0,
85 (_tile1024i_1024a *)dst1, base,
86 (__SIZE_TYPE__)(stride));
87}
88
89static __inline__ void __DEFAULT_FN_ATTRS_TRANSPOSE _tile_2rpntlvwz1t1_internal(
90 unsigned short row, unsigned short col0, unsigned short col1,
91 _tile1024i *dst0, _tile1024i *dst1, const void *base,
92 __SIZE_TYPE__ stride) {
93 __builtin_ia32_t2rpntlvwz1t1_internal(
94 row, col0, col1, (_tile1024i_1024a *)dst0, (_tile1024i_1024a *)dst1, base,
95 (__SIZE_TYPE__)(stride));
96}
97
98// This is internal intrinsic. C/C++ user should avoid calling it directly.
99static __inline__ _tile1024i __DEFAULT_FN_ATTRS_TRANSPOSE
100_tile_transposed_internal(unsigned short m, unsigned short n, _tile1024i src) {
101 return __builtin_ia32_ttransposed_internal(m, n, src);
102}
103
104/// Converts a pair of tiles from memory into VNNI format, and places the
105/// results in a pair of destinations specified by dst. The pair of tiles
106/// in memory is specified via a tsib; the second tile is after the first
107/// one, separated by the same stride that separates each row.
108/// The tile configuration for the destination tiles indicates the amount
109/// of data to read from memory. The instruction will load a number of rows
110/// that is equal to twice the number of rows in tmm1. The size of each row
111/// is equal to the average width of the destination tiles. If the second
112/// tile is configured with zero rows and columns, only the first tile will
113/// be written.
114/// Provides a hint to the implementation that the data will likely not be
115/// reused in the near future and the data caching can be optimized.
116///
117/// \headerfile <immintrin.h>
118///
119/// This intrinsic corresponds to the <c> T2RPNTLVWZ0 </c> instruction.
120///
121/// \param dst0
122/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
123/// \param dst1
124/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
125/// \param base
126/// A pointer to base address.
127/// \param stride
128/// The stride between the rows' data to be loaded in memory.
129__DEFAULT_FN_ATTRS_TRANSPOSE
130static void __tile_2rpntlvwz0(__tile1024i *dst0, __tile1024i *dst1,
131 const void *base, __SIZE_TYPE__ stride) {
132 _tile_2rpntlvwz0_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
133 &dst1->tile, base, stride);
134}
135
136/// Converts a pair of tiles from memory into VNNI format, and places the
137/// results in a pair of destinations specified by dst. The pair of tiles
138/// in memory is specified via a tsib; the second tile is after the first
139/// one, separated by the same stride that separates each row.
140/// The tile configuration for the destination tiles indicates the amount
141/// of data to read from memory. The instruction will load a number of rows
142/// that is equal to twice the number of rows in tmm1. The size of each row
143/// is equal to the average width of the destination tiles. If the second
144/// tile is configured with zero rows and columns, only the first tile will
145/// be written.
146///
147/// \headerfile <immintrin.h>
148///
149/// This intrinsic corresponds to the <c> T2RPNTLVWZ0T1 </c> instruction.
150///
151/// \param dst0
152/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
153/// \param dst1
154/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
155/// \param base
156/// A pointer to base address.
157/// \param stride
158/// The stride between the rows' data to be loaded in memory.
159__DEFAULT_FN_ATTRS_TRANSPOSE
160static void __tile_2rpntlvwz0t1(__tile1024i *dst0, __tile1024i *dst1,
161 const void *base, __SIZE_TYPE__ stride) {
162 _tile_2rpntlvwz0t1_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
163 &dst1->tile, base, stride);
164}
165
166/// Converts a pair of tiles from memory into VNNI format, and places the
167/// results in a pair of destinations specified by dst. The pair of tiles
168/// in memory is specified via a tsib; the second tile is after the first
169/// one, separated by the same stride that separates each row.
170/// The tile configuration for the destination tiles indicates the amount
171/// of data to read from memory. The instruction will load a number of rows
172/// that is equal to twice the number of rows in tmm1. The size of each row
173/// is equal to the average width of the destination tiles. If the second
174/// tile is configured with zero rows and columns, only the first tile will
175/// be written. The last row will be not be read from memory but instead
176/// filled with zeros.
177/// Provides a hint to the implementation that the data will likely not be
178/// reused in the near future and the data caching can be optimized.
179///
180/// \headerfile <immintrin.h>
181///
182/// This intrinsic corresponds to the <c> T2RPNTLVWZ1 </c> instruction.
183///
184/// \param dst0
185/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
186/// \param dst1
187/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
188/// \param base
189/// A pointer to base address.
190/// \param stride
191/// The stride between the rows' data to be loaded in memory.
192__DEFAULT_FN_ATTRS_TRANSPOSE
193static void __tile_2rpntlvwz1(__tile1024i *dst0, __tile1024i *dst1,
194 const void *base, __SIZE_TYPE__ stride) {
195 _tile_2rpntlvwz1_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
196 &dst1->tile, base, stride);
197}
198
199/// Converts a pair of tiles from memory into VNNI format, and places the
200/// results in a pair of destinations specified by dst. The pair of tiles
201/// in memory is specified via a tsib; the second tile is after the first
202/// one, separated by the same stride that separates each row.
203/// The tile configuration for the destination tiles indicates the amount
204/// of data to read from memory. The instruction will load a number of rows
205/// that is equal to twice the number of rows in tmm1. The size of each row
206/// is equal to the average width of the destination tiles. If the second
207/// tile is configured with zero rows and columns, only the first tile will
208/// be written. The last row will be not be read from memory but instead
209/// filled with zeros.
210/// Provides a hint to the implementation that the data will likely not be
211/// reused in the near future and the data caching can be optimized.
212///
213/// \headerfile <immintrin.h>
214///
215/// This intrinsic corresponds to the <c> T2RPNTLVWZ1T1 </c> instruction.
216///
217/// \param dst0
218/// First tile of destination tile pair. Max size is 1024i*2 Bytes.
219/// \param dst1
220/// Second tile of destination tile pair. Max size is 1024i*2 Bytes.
221/// \param base
222/// A pointer to base address.
223/// \param stride
224/// The stride between the rows' data to be loaded in memory.
225__DEFAULT_FN_ATTRS_TRANSPOSE
226static void __tile_2rpntlvwz1t1(__tile1024i *dst0, __tile1024i *dst1,
227 const void *base, __SIZE_TYPE__ stride) {
228 _tile_2rpntlvwz1t1_internal(dst0->row, dst0->col, dst1->col, &dst0->tile,
229 &dst1->tile, base, stride);
230}
231
232/// Transpose 32-bit elements from src and write the result to dst.
233///
234/// \headerfile <immintrin.h>
235///
236/// This intrinsic corresponds to the <c> TTRANSPOSED </c> instruction.
237///
238/// \param dst
239/// The destination tile. Max size is 1024 Bytes.
240/// \param src
241/// The source tile. Max size is 1024 Bytes.
242__DEFAULT_FN_ATTRS_TRANSPOSE
243static void __tile_transposed(__tile1024i *dst, __tile1024i src) {
244 dst->tile = _tile_transposed_internal(dst->row, dst->col, src.tile);
245}
246
247#endif /* __x86_64__ */
248#endif /* __AMX_TRANSPOSEINTRIN_H */
lib/include/arm_acle.h+37-27
...@@ -55,11 +55,37 @@ __chkfeat(uint64_t __features) {...@@ -55,11 +55,37 @@ __chkfeat(uint64_t __features) {
55/* 7.5 Swap */55/* 7.5 Swap */
56static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))56static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
57__swp(uint32_t __x, volatile uint32_t *__p) {57__swp(uint32_t __x, volatile uint32_t *__p) {
58 uint32_t v;58 uint32_t __v;
59 do59#if (__ARM_FEATURE_LDREX & 4) || __ARM_ARCH_6M__ || __linux__
60 v = __builtin_arm_ldrex(__p);60 /*
61 while (__builtin_arm_strex(__x, __p));61 * Using this clang builtin is sensible in most situations. Where
62 return v;62 * LDREX and STREX are available, it will compile to a loop using
63 * them. Otherwise it will compile to a libcall, requiring the
64 * runtime to provide that library function.
65 *
66 * That's unavoidable on Armv6-M, which has no atomic instructions
67 * at all (not even SWP), so in that situation the user will just
68 * have to provide an implementation of __atomic_exchange_4 (perhaps
69 * it would temporarily disable interrupts, and then do a separate
70 * load and store).
71 *
72 * We also use the libcall strategy on pre-Armv7 Linux targets, on
73 * the theory that Linux's runtime support library _will_ provide a
74 * suitable libcall, and it's better to use that than the SWP
75 * instruction because then when the same binary is run on a later
76 * Linux system the libcall implementation will use LDREX instead.
77 */
78 __v = __atomic_exchange_n(__p, __x, __ATOMIC_RELAXED);
79#else
80 /*
81 * But for older Arm architectures when the target is not Linux, we
82 * fall back to using the SWP instruction via inline assembler. ACLE
83 * is clear that we're allowed to do this, but shouldn't do it if we
84 * have a better alternative.
85 */
86 __asm__("swp %0, %1, [%2]" : "=r"(__v) : "r"(__x), "r"(__p) : "memory");
87#endif
88 return __v;
63}89}
6490
65/* 7.6 Memory prefetch intrinsics */91/* 7.6 Memory prefetch intrinsics */
...@@ -72,6 +98,12 @@ __swp(uint32_t __x, volatile uint32_t *__p) {...@@ -72,6 +98,12 @@ __swp(uint32_t __x, volatile uint32_t *__p) {
72#else98#else
73#define __pldx(access_kind, cache_level, retention_policy, addr) \99#define __pldx(access_kind, cache_level, retention_policy, addr) \
74 __builtin_arm_prefetch(addr, access_kind, cache_level, retention_policy, 1)100 __builtin_arm_prefetch(addr, access_kind, cache_level, retention_policy, 1)
101#define __pldx_range(access_kind, retention_policy, length, count, stride, \
102 reuse_distance, addr) \
103 __builtin_arm_range_prefetch_x(addr, access_kind, retention_policy, length, \
104 count, stride, reuse_distance)
105#define __pld_range(access_kind, retention_policy, metadata, addr) \
106 __builtin_arm_range_prefetch(addr, access_kind, retention_policy, metadata)
75#endif107#endif
76108
77/* 7.6.2 Instruction prefetch */109/* 7.6.2 Instruction prefetch */
...@@ -795,28 +827,6 @@ __arm_st64bv0(void *__addr, data512_t __value) {...@@ -795,28 +827,6 @@ __arm_st64bv0(void *__addr, data512_t __value) {
795827
796#endif // __ARM_FEATURE_COPROC828#endif // __ARM_FEATURE_COPROC
797829
798/* 17 Transactional Memory Extension (TME) Intrinsics */
799#if defined(__ARM_FEATURE_TME) && __ARM_FEATURE_TME
800
801#define _TMFAILURE_REASON 0x00007fffu
802#define _TMFAILURE_RTRY 0x00008000u
803#define _TMFAILURE_CNCL 0x00010000u
804#define _TMFAILURE_MEM 0x00020000u
805#define _TMFAILURE_IMP 0x00040000u
806#define _TMFAILURE_ERR 0x00080000u
807#define _TMFAILURE_SIZE 0x00100000u
808#define _TMFAILURE_NEST 0x00200000u
809#define _TMFAILURE_DBG 0x00400000u
810#define _TMFAILURE_INT 0x00800000u
811#define _TMFAILURE_TRIVIAL 0x01000000u
812
813#define __tstart() __builtin_arm_tstart()
814#define __tcommit() __builtin_arm_tcommit()
815#define __tcancel(__arg) __builtin_arm_tcancel(__arg)
816#define __ttest() __builtin_arm_ttest()
817
818#endif /* __ARM_FEATURE_TME */
819
820/* 8.7 Armv8.5-A Random number generation intrinsics */830/* 8.7 Armv8.5-A Random number generation intrinsics */
821#if defined(__ARM_64BIT_STATE) && __ARM_64BIT_STATE831#if defined(__ARM_64BIT_STATE) && __ARM_64BIT_STATE
822static __inline__ int __attribute__((__always_inline__, __nodebug__, target("rand")))832static __inline__ int __attribute__((__always_inline__, __nodebug__, target("rand")))
lib/include/arm_neon.h+218-82
...@@ -10562,7 +10562,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10562,7 +10562,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10562#define vget_lane_p8(__p0, __p1) __extension__ ({ \10562#define vget_lane_p8(__p0, __p1) __extension__ ({ \
10563 poly8_t __ret; \10563 poly8_t __ret; \
10564 poly8x8_t __s0 = __p0; \10564 poly8x8_t __s0 = __p0; \
10565 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vget_lane_i8(__s0, __p1)); \10565 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vget_lane_i8(__builtin_bit_cast(int8x8_t, __s0), __p1)); \
10566 __ret; \10566 __ret; \
10567})10567})
10568#else10568#else
...@@ -10570,13 +10570,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10570,13 +10570,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10570 poly8_t __ret; \10570 poly8_t __ret; \
10571 poly8x8_t __s0 = __p0; \10571 poly8x8_t __s0 = __p0; \
10572 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_8); \10572 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_8); \
10573 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vget_lane_i8(__rev0, __p1)); \10573 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vget_lane_i8(__builtin_bit_cast(int8x8_t, __rev0), __p1)); \
10574 __ret; \10574 __ret; \
10575})10575})
10576#define __noswap_vget_lane_p8(__p0, __p1) __extension__ ({ \10576#define __noswap_vget_lane_p8(__p0, __p1) __extension__ ({ \
10577 poly8_t __ret; \10577 poly8_t __ret; \
10578 poly8x8_t __s0 = __p0; \10578 poly8x8_t __s0 = __p0; \
10579 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vget_lane_i8(__s0, __p1)); \10579 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vget_lane_i8(__builtin_bit_cast(int8x8_t, __s0), __p1)); \
10580 __ret; \10580 __ret; \
10581})10581})
10582#endif10582#endif
...@@ -10585,7 +10585,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10585,7 +10585,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10585#define vget_lane_p16(__p0, __p1) __extension__ ({ \10585#define vget_lane_p16(__p0, __p1) __extension__ ({ \
10586 poly16_t __ret; \10586 poly16_t __ret; \
10587 poly16x4_t __s0 = __p0; \10587 poly16x4_t __s0 = __p0; \
10588 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vget_lane_i16(__s0, __p1)); \10588 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vget_lane_i16(__builtin_bit_cast(int16x4_t, __s0), __p1)); \
10589 __ret; \10589 __ret; \
10590})10590})
10591#else10591#else
...@@ -10593,13 +10593,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10593,13 +10593,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10593 poly16_t __ret; \10593 poly16_t __ret; \
10594 poly16x4_t __s0 = __p0; \10594 poly16x4_t __s0 = __p0; \
10595 poly16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \10595 poly16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
10596 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vget_lane_i16(__rev0, __p1)); \10596 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vget_lane_i16(__builtin_bit_cast(int16x4_t, __rev0), __p1)); \
10597 __ret; \10597 __ret; \
10598})10598})
10599#define __noswap_vget_lane_p16(__p0, __p1) __extension__ ({ \10599#define __noswap_vget_lane_p16(__p0, __p1) __extension__ ({ \
10600 poly16_t __ret; \10600 poly16_t __ret; \
10601 poly16x4_t __s0 = __p0; \10601 poly16x4_t __s0 = __p0; \
10602 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vget_lane_i16(__s0, __p1)); \10602 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vget_lane_i16(__builtin_bit_cast(int16x4_t, __s0), __p1)); \
10603 __ret; \10603 __ret; \
10604})10604})
10605#endif10605#endif
...@@ -10608,7 +10608,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10608,7 +10608,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10608#define vgetq_lane_p8(__p0, __p1) __extension__ ({ \10608#define vgetq_lane_p8(__p0, __p1) __extension__ ({ \
10609 poly8_t __ret; \10609 poly8_t __ret; \
10610 poly8x16_t __s0 = __p0; \10610 poly8x16_t __s0 = __p0; \
10611 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vgetq_lane_i8(__s0, __p1)); \10611 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vgetq_lane_i8(__builtin_bit_cast(int8x16_t, __s0), __p1)); \
10612 __ret; \10612 __ret; \
10613})10613})
10614#else10614#else
...@@ -10616,13 +10616,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10616,13 +10616,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10616 poly8_t __ret; \10616 poly8_t __ret; \
10617 poly8x16_t __s0 = __p0; \10617 poly8x16_t __s0 = __p0; \
10618 poly8x16_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_8); \10618 poly8x16_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_8); \
10619 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vgetq_lane_i8(__rev0, __p1)); \10619 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vgetq_lane_i8(__builtin_bit_cast(int8x16_t, __rev0), __p1)); \
10620 __ret; \10620 __ret; \
10621})10621})
10622#define __noswap_vgetq_lane_p8(__p0, __p1) __extension__ ({ \10622#define __noswap_vgetq_lane_p8(__p0, __p1) __extension__ ({ \
10623 poly8_t __ret; \10623 poly8_t __ret; \
10624 poly8x16_t __s0 = __p0; \10624 poly8x16_t __s0 = __p0; \
10625 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vgetq_lane_i8(__s0, __p1)); \10625 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vgetq_lane_i8(__builtin_bit_cast(int8x16_t, __s0), __p1)); \
10626 __ret; \10626 __ret; \
10627})10627})
10628#endif10628#endif
...@@ -10631,7 +10631,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10631,7 +10631,7 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10631#define vgetq_lane_p16(__p0, __p1) __extension__ ({ \10631#define vgetq_lane_p16(__p0, __p1) __extension__ ({ \
10632 poly16_t __ret; \10632 poly16_t __ret; \
10633 poly16x8_t __s0 = __p0; \10633 poly16x8_t __s0 = __p0; \
10634 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vgetq_lane_i16(__s0, __p1)); \10634 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vgetq_lane_i16(__builtin_bit_cast(int16x8_t, __s0), __p1)); \
10635 __ret; \10635 __ret; \
10636})10636})
10637#else10637#else
...@@ -10639,13 +10639,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10639,13 +10639,13 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10639 poly16_t __ret; \10639 poly16_t __ret; \
10640 poly16x8_t __s0 = __p0; \10640 poly16x8_t __s0 = __p0; \
10641 poly16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \10641 poly16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
10642 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vgetq_lane_i16(__rev0, __p1)); \10642 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vgetq_lane_i16(__builtin_bit_cast(int16x8_t, __rev0), __p1)); \
10643 __ret; \10643 __ret; \
10644})10644})
10645#define __noswap_vgetq_lane_p16(__p0, __p1) __extension__ ({ \10645#define __noswap_vgetq_lane_p16(__p0, __p1) __extension__ ({ \
10646 poly16_t __ret; \10646 poly16_t __ret; \
10647 poly16x8_t __s0 = __p0; \10647 poly16x8_t __s0 = __p0; \
10648 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vgetq_lane_i16(__s0, __p1)); \10648 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vgetq_lane_i16(__builtin_bit_cast(int16x8_t, __s0), __p1)); \
10649 __ret; \10649 __ret; \
10650})10650})
10651#endif10651#endif
...@@ -27027,7 +27027,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27027,7 +27027,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27027 poly8x8_t __ret; \27027 poly8x8_t __ret; \
27028 poly8_t __s0 = __p0; \27028 poly8_t __s0 = __p0; \
27029 poly8x8_t __s1 = __p1; \27029 poly8x8_t __s1 = __p1; \
27030 __ret = __builtin_bit_cast(poly8x8_t, __builtin_neon_vset_lane_i8(__s0, __s1, __p2)); \27030 __ret = __builtin_bit_cast(poly8x8_t, __builtin_neon_vset_lane_i8(__s0, __builtin_bit_cast(int8x8_t, __s1), __p2)); \
27031 __ret; \27031 __ret; \
27032})27032})
27033#else27033#else
...@@ -27036,7 +27036,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27036,7 +27036,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27036 poly8_t __s0 = __p0; \27036 poly8_t __s0 = __p0; \
27037 poly8x8_t __s1 = __p1; \27037 poly8x8_t __s1 = __p1; \
27038 poly8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \27038 poly8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
27039 __ret = __builtin_bit_cast(poly8x8_t, __builtin_neon_vset_lane_i8(__s0, __rev1, __p2)); \27039 __ret = __builtin_bit_cast(poly8x8_t, __builtin_neon_vset_lane_i8(__s0, __builtin_bit_cast(int8x8_t, __rev1), __p2)); \
27040 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_8); \27040 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_8); \
27041 __ret; \27041 __ret; \
27042})27042})
...@@ -27044,7 +27044,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27044,7 +27044,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27044 poly8x8_t __ret; \27044 poly8x8_t __ret; \
27045 poly8_t __s0 = __p0; \27045 poly8_t __s0 = __p0; \
27046 poly8x8_t __s1 = __p1; \27046 poly8x8_t __s1 = __p1; \
27047 __ret = __builtin_bit_cast(poly8x8_t, __builtin_neon_vset_lane_i8(__s0, __s1, __p2)); \27047 __ret = __builtin_bit_cast(poly8x8_t, __builtin_neon_vset_lane_i8(__s0, __builtin_bit_cast(int8x8_t, __s1), __p2)); \
27048 __ret; \27048 __ret; \
27049})27049})
27050#endif27050#endif
...@@ -27054,7 +27054,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27054,7 +27054,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27054 poly16x4_t __ret; \27054 poly16x4_t __ret; \
27055 poly16_t __s0 = __p0; \27055 poly16_t __s0 = __p0; \
27056 poly16x4_t __s1 = __p1; \27056 poly16x4_t __s1 = __p1; \
27057 __ret = __builtin_bit_cast(poly16x4_t, __builtin_neon_vset_lane_i16(__s0, __s1, __p2)); \27057 __ret = __builtin_bit_cast(poly16x4_t, __builtin_neon_vset_lane_i16(__s0, __builtin_bit_cast(int16x4_t, __s1), __p2)); \
27058 __ret; \27058 __ret; \
27059})27059})
27060#else27060#else
...@@ -27063,7 +27063,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27063,7 +27063,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27063 poly16_t __s0 = __p0; \27063 poly16_t __s0 = __p0; \
27064 poly16x4_t __s1 = __p1; \27064 poly16x4_t __s1 = __p1; \
27065 poly16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \27065 poly16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
27066 __ret = __builtin_bit_cast(poly16x4_t, __builtin_neon_vset_lane_i16(__s0, __rev1, __p2)); \27066 __ret = __builtin_bit_cast(poly16x4_t, __builtin_neon_vset_lane_i16(__s0, __builtin_bit_cast(int16x4_t, __rev1), __p2)); \
27067 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \27067 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
27068 __ret; \27068 __ret; \
27069})27069})
...@@ -27071,7 +27071,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27071,7 +27071,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27071 poly16x4_t __ret; \27071 poly16x4_t __ret; \
27072 poly16_t __s0 = __p0; \27072 poly16_t __s0 = __p0; \
27073 poly16x4_t __s1 = __p1; \27073 poly16x4_t __s1 = __p1; \
27074 __ret = __builtin_bit_cast(poly16x4_t, __builtin_neon_vset_lane_i16(__s0, __s1, __p2)); \27074 __ret = __builtin_bit_cast(poly16x4_t, __builtin_neon_vset_lane_i16(__s0, __builtin_bit_cast(int16x4_t, __s1), __p2)); \
27075 __ret; \27075 __ret; \
27076})27076})
27077#endif27077#endif
...@@ -27081,7 +27081,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27081,7 +27081,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27081 poly8x16_t __ret; \27081 poly8x16_t __ret; \
27082 poly8_t __s0 = __p0; \27082 poly8_t __s0 = __p0; \
27083 poly8x16_t __s1 = __p1; \27083 poly8x16_t __s1 = __p1; \
27084 __ret = __builtin_bit_cast(poly8x16_t, __builtin_neon_vsetq_lane_i8(__s0, __s1, __p2)); \27084 __ret = __builtin_bit_cast(poly8x16_t, __builtin_neon_vsetq_lane_i8(__s0, __builtin_bit_cast(int8x16_t, __s1), __p2)); \
27085 __ret; \27085 __ret; \
27086})27086})
27087#else27087#else
...@@ -27090,7 +27090,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27090,7 +27090,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27090 poly8_t __s0 = __p0; \27090 poly8_t __s0 = __p0; \
27091 poly8x16_t __s1 = __p1; \27091 poly8x16_t __s1 = __p1; \
27092 poly8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \27092 poly8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
27093 __ret = __builtin_bit_cast(poly8x16_t, __builtin_neon_vsetq_lane_i8(__s0, __rev1, __p2)); \27093 __ret = __builtin_bit_cast(poly8x16_t, __builtin_neon_vsetq_lane_i8(__s0, __builtin_bit_cast(int8x16_t, __rev1), __p2)); \
27094 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_8); \27094 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_8); \
27095 __ret; \27095 __ret; \
27096})27096})
...@@ -27098,7 +27098,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27098,7 +27098,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27098 poly8x16_t __ret; \27098 poly8x16_t __ret; \
27099 poly8_t __s0 = __p0; \27099 poly8_t __s0 = __p0; \
27100 poly8x16_t __s1 = __p1; \27100 poly8x16_t __s1 = __p1; \
27101 __ret = __builtin_bit_cast(poly8x16_t, __builtin_neon_vsetq_lane_i8(__s0, __s1, __p2)); \27101 __ret = __builtin_bit_cast(poly8x16_t, __builtin_neon_vsetq_lane_i8(__s0, __builtin_bit_cast(int8x16_t, __s1), __p2)); \
27102 __ret; \27102 __ret; \
27103})27103})
27104#endif27104#endif
...@@ -27108,7 +27108,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27108,7 +27108,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27108 poly16x8_t __ret; \27108 poly16x8_t __ret; \
27109 poly16_t __s0 = __p0; \27109 poly16_t __s0 = __p0; \
27110 poly16x8_t __s1 = __p1; \27110 poly16x8_t __s1 = __p1; \
27111 __ret = __builtin_bit_cast(poly16x8_t, __builtin_neon_vsetq_lane_i16(__s0, __s1, __p2)); \27111 __ret = __builtin_bit_cast(poly16x8_t, __builtin_neon_vsetq_lane_i16(__s0, __builtin_bit_cast(int16x8_t, __s1), __p2)); \
27112 __ret; \27112 __ret; \
27113})27113})
27114#else27114#else
...@@ -27117,7 +27117,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27117,7 +27117,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27117 poly16_t __s0 = __p0; \27117 poly16_t __s0 = __p0; \
27118 poly16x8_t __s1 = __p1; \27118 poly16x8_t __s1 = __p1; \
27119 poly16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \27119 poly16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
27120 __ret = __builtin_bit_cast(poly16x8_t, __builtin_neon_vsetq_lane_i16(__s0, __rev1, __p2)); \27120 __ret = __builtin_bit_cast(poly16x8_t, __builtin_neon_vsetq_lane_i16(__s0, __builtin_bit_cast(int16x8_t, __rev1), __p2)); \
27121 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \27121 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
27122 __ret; \27122 __ret; \
27123})27123})
...@@ -27125,7 +27125,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27125,7 +27125,7 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27125 poly16x8_t __ret; \27125 poly16x8_t __ret; \
27126 poly16_t __s0 = __p0; \27126 poly16_t __s0 = __p0; \
27127 poly16x8_t __s1 = __p1; \27127 poly16x8_t __s1 = __p1; \
27128 __ret = __builtin_bit_cast(poly16x8_t, __builtin_neon_vsetq_lane_i16(__s0, __s1, __p2)); \27128 __ret = __builtin_bit_cast(poly16x8_t, __builtin_neon_vsetq_lane_i16(__s0, __builtin_bit_cast(int16x8_t, __s1), __p2)); \
27129 __ret; \27129 __ret; \
27130})27130})
27131#endif27131#endif
...@@ -41141,6 +41141,42 @@ __ai __attribute__((target("neon"))) float32x2_t vfms_f32(float32x2_t __p0, floa...@@ -41141,6 +41141,42 @@ __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("f8f16mm,neon"))) float16x8_t vmmlaq_f16_mf8_fpm(float16x8_t __p0, mfloat8x16_t __p1, mfloat8x16_t __p2, fpm_t __p3) {
41146 float16x8_t __ret;
41147 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmmlaq_f16_mf8_fpm(__builtin_bit_cast(int8x16_t, __p0), __p1, __p2, __p3));
41148 return __ret;
41149}
41150#else
41151__ai __attribute__((target("f8f16mm,neon"))) float16x8_t vmmlaq_f16_mf8_fpm(float16x8_t __p0, mfloat8x16_t __p1, mfloat8x16_t __p2, fpm_t __p3) {
41152 float16x8_t __ret;
41153 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
41154 mfloat8x16_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_8);
41155 mfloat8x16_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_8);
41156 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmmlaq_f16_mf8_fpm(__builtin_bit_cast(int8x16_t, __rev0), __rev1, __rev2, __p3));
41157 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
41158 return __ret;
41159}
41160#endif
41161
41162#ifdef __LITTLE_ENDIAN__
41163__ai __attribute__((target("f8f32mm,neon"))) float32x4_t vmmlaq_f32_mf8_fpm(float32x4_t __p0, mfloat8x16_t __p1, mfloat8x16_t __p2, fpm_t __p3) {
41164 float32x4_t __ret;
41165 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vmmlaq_f32_mf8_fpm(__p0, __p1, __p2, __p3));
41166 return __ret;
41167}
41168#else
41169__ai __attribute__((target("f8f32mm,neon"))) float32x4_t vmmlaq_f32_mf8_fpm(float32x4_t __p0, mfloat8x16_t __p1, mfloat8x16_t __p2, fpm_t __p3) {
41170 float32x4_t __ret;
41171 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
41172 mfloat8x16_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_8);
41173 mfloat8x16_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_8);
41174 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vmmlaq_f32_mf8_fpm(__rev0, __rev1, __rev2, __p3));
41175 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
41176 return __ret;
41177}
41178#endif
41179
41144#ifdef __LITTLE_ENDIAN__41180#ifdef __LITTLE_ENDIAN__
41145__ai __attribute__((target("fp8,neon"))) bfloat16x8_t vcvt1_bf16_mf8_fpm(mfloat8x8_t __p0, fpm_t __p1) {41181__ai __attribute__((target("fp8,neon"))) bfloat16x8_t vcvt1_bf16_mf8_fpm(mfloat8x8_t __p0, fpm_t __p1) {
41146 bfloat16x8_t __ret;41182 bfloat16x8_t __ret;
...@@ -49847,6 +49883,16 @@ __ai __attribute__((target("neon"))) int32_t vcvts_s32_f32(float32_t __p0) {...@@ -49847,6 +49883,16 @@ __ai __attribute__((target("neon"))) int32_t vcvts_s32_f32(float32_t __p0) {
49847 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvts_s32_f32(__p0));49883 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvts_s32_f32(__p0));
49848 return __ret;49884 return __ret;
49849}49885}
49886__ai __attribute__((target("neon"))) int32_t vcvtd_s32_f64(float64_t __p0) {
49887 int32_t __ret;
49888 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtd_s32_f64(__p0));
49889 return __ret;
49890}
49891__ai __attribute__((target("neon"))) int64_t vcvts_s64_f32(float32_t __p0) {
49892 int64_t __ret;
49893 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvts_s64_f32(__p0));
49894 return __ret;
49895}
49850__ai __attribute__((target("neon"))) int64_t vcvtd_s64_f64(float64_t __p0) {49896__ai __attribute__((target("neon"))) int64_t vcvtd_s64_f64(float64_t __p0) {
49851 int64_t __ret;49897 int64_t __ret;
49852 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtd_s64_f64(__p0));49898 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtd_s64_f64(__p0));
...@@ -49878,6 +49924,16 @@ __ai __attribute__((target("neon"))) uint32_t vcvts_u32_f32(float32_t __p0) {...@@ -49878,6 +49924,16 @@ __ai __attribute__((target("neon"))) uint32_t vcvts_u32_f32(float32_t __p0) {
49878 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvts_u32_f32(__p0));49924 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvts_u32_f32(__p0));
49879 return __ret;49925 return __ret;
49880}49926}
49927__ai __attribute__((target("neon"))) uint32_t vcvtd_u32_f64(float64_t __p0) {
49928 uint32_t __ret;
49929 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtd_u32_f64(__p0));
49930 return __ret;
49931}
49932__ai __attribute__((target("neon"))) uint64_t vcvts_u64_f32(float32_t __p0) {
49933 uint64_t __ret;
49934 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvts_u64_f32(__p0));
49935 return __ret;
49936}
49881__ai __attribute__((target("neon"))) uint64_t vcvtd_u64_f64(float64_t __p0) {49937__ai __attribute__((target("neon"))) uint64_t vcvtd_u64_f64(float64_t __p0) {
49882 uint64_t __ret;49938 uint64_t __ret;
49883 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtd_u64_f64(__p0));49939 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtd_u64_f64(__p0));
...@@ -49909,6 +49965,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtas_s32_f32(float32_t __p0) {...@@ -49909,6 +49965,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtas_s32_f32(float32_t __p0) {
49909 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtas_s32_f32(__p0));49965 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtas_s32_f32(__p0));
49910 return __ret;49966 return __ret;
49911}49967}
49968__ai __attribute__((target("neon"))) int32_t vcvtad_s32_f64(float64_t __p0) {
49969 int32_t __ret;
49970 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtad_s32_f64(__p0));
49971 return __ret;
49972}
49912#ifdef __LITTLE_ENDIAN__49973#ifdef __LITTLE_ENDIAN__
49913__ai __attribute__((target("neon"))) int64x2_t vcvtaq_s64_f64(float64x2_t __p0) {49974__ai __attribute__((target("neon"))) int64x2_t vcvtaq_s64_f64(float64x2_t __p0) {
49914 int64x2_t __ret;49975 int64x2_t __ret;
...@@ -49930,6 +49991,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvta_s64_f64(float64x1_t __p0) {...@@ -49930,6 +49991,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvta_s64_f64(float64x1_t __p0) {
49930 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvta_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));49991 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvta_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));
49931 return __ret;49992 return __ret;
49932}49993}
49994__ai __attribute__((target("neon"))) int64_t vcvtas_s64_f32(float32_t __p0) {
49995 int64_t __ret;
49996 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtas_s64_f32(__p0));
49997 return __ret;
49998}
49933__ai __attribute__((target("neon"))) int64_t vcvtad_s64_f64(float64_t __p0) {49999__ai __attribute__((target("neon"))) int64_t vcvtad_s64_f64(float64_t __p0) {
49934 int64_t __ret;50000 int64_t __ret;
49935 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtad_s64_f64(__p0));50001 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtad_s64_f64(__p0));
...@@ -49940,6 +50006,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtas_u32_f32(float32_t __p0) {...@@ -49940,6 +50006,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtas_u32_f32(float32_t __p0) {
49940 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtas_u32_f32(__p0));50006 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtas_u32_f32(__p0));
49941 return __ret;50007 return __ret;
49942}50008}
50009__ai __attribute__((target("neon"))) uint32_t vcvtad_u32_f64(float64_t __p0) {
50010 uint32_t __ret;
50011 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtad_u32_f64(__p0));
50012 return __ret;
50013}
49943#ifdef __LITTLE_ENDIAN__50014#ifdef __LITTLE_ENDIAN__
49944__ai __attribute__((target("neon"))) uint64x2_t vcvtaq_u64_f64(float64x2_t __p0) {50015__ai __attribute__((target("neon"))) uint64x2_t vcvtaq_u64_f64(float64x2_t __p0) {
49945 uint64x2_t __ret;50016 uint64x2_t __ret;
...@@ -49961,6 +50032,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvta_u64_f64(float64x1_t __p0)...@@ -49961,6 +50032,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvta_u64_f64(float64x1_t __p0)
49961 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvta_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));50032 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvta_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));
49962 return __ret;50033 return __ret;
49963}50034}
50035__ai __attribute__((target("neon"))) uint64_t vcvtas_u64_f32(float32_t __p0) {
50036 uint64_t __ret;
50037 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtas_u64_f32(__p0));
50038 return __ret;
50039}
49964__ai __attribute__((target("neon"))) uint64_t vcvtad_u64_f64(float64_t __p0) {50040__ai __attribute__((target("neon"))) uint64_t vcvtad_u64_f64(float64_t __p0) {
49965 uint64_t __ret;50041 uint64_t __ret;
49966 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtad_u64_f64(__p0));50042 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtad_u64_f64(__p0));
...@@ -49971,6 +50047,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtms_s32_f32(float32_t __p0) {...@@ -49971,6 +50047,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtms_s32_f32(float32_t __p0) {
49971 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtms_s32_f32(__p0));50047 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtms_s32_f32(__p0));
49972 return __ret;50048 return __ret;
49973}50049}
50050__ai __attribute__((target("neon"))) int32_t vcvtmd_s32_f64(float64_t __p0) {
50051 int32_t __ret;
50052 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtmd_s32_f64(__p0));
50053 return __ret;
50054}
49974#ifdef __LITTLE_ENDIAN__50055#ifdef __LITTLE_ENDIAN__
49975__ai __attribute__((target("neon"))) int64x2_t vcvtmq_s64_f64(float64x2_t __p0) {50056__ai __attribute__((target("neon"))) int64x2_t vcvtmq_s64_f64(float64x2_t __p0) {
49976 int64x2_t __ret;50057 int64x2_t __ret;
...@@ -49992,6 +50073,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvtm_s64_f64(float64x1_t __p0) {...@@ -49992,6 +50073,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvtm_s64_f64(float64x1_t __p0) {
49992 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvtm_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));50073 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvtm_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));
49993 return __ret;50074 return __ret;
49994}50075}
50076__ai __attribute__((target("neon"))) int64_t vcvtms_s64_f32(float32_t __p0) {
50077 int64_t __ret;
50078 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtms_s64_f32(__p0));
50079 return __ret;
50080}
49995__ai __attribute__((target("neon"))) int64_t vcvtmd_s64_f64(float64_t __p0) {50081__ai __attribute__((target("neon"))) int64_t vcvtmd_s64_f64(float64_t __p0) {
49996 int64_t __ret;50082 int64_t __ret;
49997 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtmd_s64_f64(__p0));50083 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtmd_s64_f64(__p0));
...@@ -50002,6 +50088,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtms_u32_f32(float32_t __p0) {...@@ -50002,6 +50088,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtms_u32_f32(float32_t __p0) {
50002 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtms_u32_f32(__p0));50088 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtms_u32_f32(__p0));
50003 return __ret;50089 return __ret;
50004}50090}
50091__ai __attribute__((target("neon"))) uint32_t vcvtmd_u32_f64(float64_t __p0) {
50092 uint32_t __ret;
50093 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtmd_u32_f64(__p0));
50094 return __ret;
50095}
50005#ifdef __LITTLE_ENDIAN__50096#ifdef __LITTLE_ENDIAN__
50006__ai __attribute__((target("neon"))) uint64x2_t vcvtmq_u64_f64(float64x2_t __p0) {50097__ai __attribute__((target("neon"))) uint64x2_t vcvtmq_u64_f64(float64x2_t __p0) {
50007 uint64x2_t __ret;50098 uint64x2_t __ret;
...@@ -50023,6 +50114,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvtm_u64_f64(float64x1_t __p0)...@@ -50023,6 +50114,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvtm_u64_f64(float64x1_t __p0)
50023 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvtm_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));50114 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvtm_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));
50024 return __ret;50115 return __ret;
50025}50116}
50117__ai __attribute__((target("neon"))) uint64_t vcvtms_u64_f32(float32_t __p0) {
50118 uint64_t __ret;
50119 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtms_u64_f32(__p0));
50120 return __ret;
50121}
50026__ai __attribute__((target("neon"))) uint64_t vcvtmd_u64_f64(float64_t __p0) {50122__ai __attribute__((target("neon"))) uint64_t vcvtmd_u64_f64(float64_t __p0) {
50027 uint64_t __ret;50123 uint64_t __ret;
50028 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtmd_u64_f64(__p0));50124 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtmd_u64_f64(__p0));
...@@ -50033,6 +50129,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtns_s32_f32(float32_t __p0) {...@@ -50033,6 +50129,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtns_s32_f32(float32_t __p0) {
50033 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtns_s32_f32(__p0));50129 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtns_s32_f32(__p0));
50034 return __ret;50130 return __ret;
50035}50131}
50132__ai __attribute__((target("neon"))) int32_t vcvtnd_s32_f64(float64_t __p0) {
50133 int32_t __ret;
50134 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtnd_s32_f64(__p0));
50135 return __ret;
50136}
50036#ifdef __LITTLE_ENDIAN__50137#ifdef __LITTLE_ENDIAN__
50037__ai __attribute__((target("neon"))) int64x2_t vcvtnq_s64_f64(float64x2_t __p0) {50138__ai __attribute__((target("neon"))) int64x2_t vcvtnq_s64_f64(float64x2_t __p0) {
50038 int64x2_t __ret;50139 int64x2_t __ret;
...@@ -50054,6 +50155,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvtn_s64_f64(float64x1_t __p0) {...@@ -50054,6 +50155,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvtn_s64_f64(float64x1_t __p0) {
50054 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvtn_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));50155 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvtn_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));
50055 return __ret;50156 return __ret;
50056}50157}
50158__ai __attribute__((target("neon"))) int64_t vcvtns_s64_f32(float32_t __p0) {
50159 int64_t __ret;
50160 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtns_s64_f32(__p0));
50161 return __ret;
50162}
50057__ai __attribute__((target("neon"))) int64_t vcvtnd_s64_f64(float64_t __p0) {50163__ai __attribute__((target("neon"))) int64_t vcvtnd_s64_f64(float64_t __p0) {
50058 int64_t __ret;50164 int64_t __ret;
50059 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtnd_s64_f64(__p0));50165 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtnd_s64_f64(__p0));
...@@ -50064,6 +50170,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtns_u32_f32(float32_t __p0) {...@@ -50064,6 +50170,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtns_u32_f32(float32_t __p0) {
50064 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtns_u32_f32(__p0));50170 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtns_u32_f32(__p0));
50065 return __ret;50171 return __ret;
50066}50172}
50173__ai __attribute__((target("neon"))) uint32_t vcvtnd_u32_f64(float64_t __p0) {
50174 uint32_t __ret;
50175 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtnd_u32_f64(__p0));
50176 return __ret;
50177}
50067#ifdef __LITTLE_ENDIAN__50178#ifdef __LITTLE_ENDIAN__
50068__ai __attribute__((target("neon"))) uint64x2_t vcvtnq_u64_f64(float64x2_t __p0) {50179__ai __attribute__((target("neon"))) uint64x2_t vcvtnq_u64_f64(float64x2_t __p0) {
50069 uint64x2_t __ret;50180 uint64x2_t __ret;
...@@ -50085,6 +50196,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvtn_u64_f64(float64x1_t __p0)...@@ -50085,6 +50196,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvtn_u64_f64(float64x1_t __p0)
50085 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvtn_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));50196 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvtn_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));
50086 return __ret;50197 return __ret;
50087}50198}
50199__ai __attribute__((target("neon"))) uint64_t vcvtns_u64_f32(float32_t __p0) {
50200 uint64_t __ret;
50201 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtns_u64_f32(__p0));
50202 return __ret;
50203}
50088__ai __attribute__((target("neon"))) uint64_t vcvtnd_u64_f64(float64_t __p0) {50204__ai __attribute__((target("neon"))) uint64_t vcvtnd_u64_f64(float64_t __p0) {
50089 uint64_t __ret;50205 uint64_t __ret;
50090 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtnd_u64_f64(__p0));50206 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtnd_u64_f64(__p0));
...@@ -50095,6 +50211,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtps_s32_f32(float32_t __p0) {...@@ -50095,6 +50211,11 @@ __ai __attribute__((target("neon"))) int32_t vcvtps_s32_f32(float32_t __p0) {
50095 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtps_s32_f32(__p0));50211 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtps_s32_f32(__p0));
50096 return __ret;50212 return __ret;
50097}50213}
50214__ai __attribute__((target("neon"))) int32_t vcvtpd_s32_f64(float64_t __p0) {
50215 int32_t __ret;
50216 __ret = __builtin_bit_cast(int32_t, __builtin_neon_vcvtpd_s32_f64(__p0));
50217 return __ret;
50218}
50098#ifdef __LITTLE_ENDIAN__50219#ifdef __LITTLE_ENDIAN__
50099__ai __attribute__((target("neon"))) int64x2_t vcvtpq_s64_f64(float64x2_t __p0) {50220__ai __attribute__((target("neon"))) int64x2_t vcvtpq_s64_f64(float64x2_t __p0) {
50100 int64x2_t __ret;50221 int64x2_t __ret;
...@@ -50116,6 +50237,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvtp_s64_f64(float64x1_t __p0) {...@@ -50116,6 +50237,11 @@ __ai __attribute__((target("neon"))) int64x1_t vcvtp_s64_f64(float64x1_t __p0) {
50116 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvtp_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));50237 __ret = __builtin_bit_cast(int64x1_t, __builtin_neon_vcvtp_s64_v(__builtin_bit_cast(int8x8_t, __p0), 3));
50117 return __ret;50238 return __ret;
50118}50239}
50240__ai __attribute__((target("neon"))) int64_t vcvtps_s64_f32(float32_t __p0) {
50241 int64_t __ret;
50242 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtps_s64_f32(__p0));
50243 return __ret;
50244}
50119__ai __attribute__((target("neon"))) int64_t vcvtpd_s64_f64(float64_t __p0) {50245__ai __attribute__((target("neon"))) int64_t vcvtpd_s64_f64(float64_t __p0) {
50120 int64_t __ret;50246 int64_t __ret;
50121 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtpd_s64_f64(__p0));50247 __ret = __builtin_bit_cast(int64_t, __builtin_neon_vcvtpd_s64_f64(__p0));
...@@ -50126,6 +50252,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtps_u32_f32(float32_t __p0) {...@@ -50126,6 +50252,11 @@ __ai __attribute__((target("neon"))) uint32_t vcvtps_u32_f32(float32_t __p0) {
50126 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtps_u32_f32(__p0));50252 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtps_u32_f32(__p0));
50127 return __ret;50253 return __ret;
50128}50254}
50255__ai __attribute__((target("neon"))) uint32_t vcvtpd_u32_f64(float64_t __p0) {
50256 uint32_t __ret;
50257 __ret = __builtin_bit_cast(uint32_t, __builtin_neon_vcvtpd_u32_f64(__p0));
50258 return __ret;
50259}
50129#ifdef __LITTLE_ENDIAN__50260#ifdef __LITTLE_ENDIAN__
50130__ai __attribute__((target("neon"))) uint64x2_t vcvtpq_u64_f64(float64x2_t __p0) {50261__ai __attribute__((target("neon"))) uint64x2_t vcvtpq_u64_f64(float64x2_t __p0) {
50131 uint64x2_t __ret;50262 uint64x2_t __ret;
...@@ -50147,6 +50278,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvtp_u64_f64(float64x1_t __p0)...@@ -50147,6 +50278,11 @@ __ai __attribute__((target("neon"))) uint64x1_t vcvtp_u64_f64(float64x1_t __p0)
50147 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvtp_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));50278 __ret = __builtin_bit_cast(uint64x1_t, __builtin_neon_vcvtp_u64_v(__builtin_bit_cast(int8x8_t, __p0), 19));
50148 return __ret;50279 return __ret;
50149}50280}
50281__ai __attribute__((target("neon"))) uint64_t vcvtps_u64_f32(float32_t __p0) {
50282 uint64_t __ret;
50283 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtps_u64_f32(__p0));
50284 return __ret;
50285}
50150__ai __attribute__((target("neon"))) uint64_t vcvtpd_u64_f64(float64_t __p0) {50286__ai __attribute__((target("neon"))) uint64_t vcvtpd_u64_f64(float64_t __p0) {
50151 uint64_t __ret;50287 uint64_t __ret;
50152 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtpd_u64_f64(__p0));50288 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vcvtpd_u64_f64(__p0));
...@@ -50255,7 +50391,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50255,7 +50391,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50255#define vdupb_lane_p8(__p0, __p1) __extension__ ({ \50391#define vdupb_lane_p8(__p0, __p1) __extension__ ({ \
50256 poly8_t __ret; \50392 poly8_t __ret; \
50257 poly8x8_t __s0 = __p0; \50393 poly8x8_t __s0 = __p0; \
50258 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_lane_i8(__s0, __p1)); \50394 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_lane_i8(__builtin_bit_cast(int8x8_t, __s0), __p1)); \
50259 __ret; \50395 __ret; \
50260})50396})
50261#else50397#else
...@@ -50263,7 +50399,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50263,7 +50399,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50263 poly8_t __ret; \50399 poly8_t __ret; \
50264 poly8x8_t __s0 = __p0; \50400 poly8x8_t __s0 = __p0; \
50265 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_8); \50401 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_8); \
50266 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_lane_i8(__rev0, __p1)); \50402 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_lane_i8(__builtin_bit_cast(int8x8_t, __rev0), __p1)); \
50267 __ret; \50403 __ret; \
50268})50404})
50269#endif50405#endif
...@@ -50272,7 +50408,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50272,7 +50408,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50272#define vduph_lane_p16(__p0, __p1) __extension__ ({ \50408#define vduph_lane_p16(__p0, __p1) __extension__ ({ \
50273 poly16_t __ret; \50409 poly16_t __ret; \
50274 poly16x4_t __s0 = __p0; \50410 poly16x4_t __s0 = __p0; \
50275 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_lane_i16(__s0, __p1)); \50411 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_lane_i16(__builtin_bit_cast(int16x4_t, __s0), __p1)); \
50276 __ret; \50412 __ret; \
50277})50413})
50278#else50414#else
...@@ -50280,7 +50416,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50280,7 +50416,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50280 poly16_t __ret; \50416 poly16_t __ret; \
50281 poly16x4_t __s0 = __p0; \50417 poly16x4_t __s0 = __p0; \
50282 poly16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \50418 poly16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
50283 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_lane_i16(__rev0, __p1)); \50419 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_lane_i16(__builtin_bit_cast(int16x4_t, __rev0), __p1)); \
50284 __ret; \50420 __ret; \
50285})50421})
50286#endif50422#endif
...@@ -50506,7 +50642,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50506,7 +50642,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50506#define vdupb_laneq_p8(__p0, __p1) __extension__ ({ \50642#define vdupb_laneq_p8(__p0, __p1) __extension__ ({ \
50507 poly8_t __ret; \50643 poly8_t __ret; \
50508 poly8x16_t __s0 = __p0; \50644 poly8x16_t __s0 = __p0; \
50509 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_laneq_i8(__s0, __p1)); \50645 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_laneq_i8(__builtin_bit_cast(int8x16_t, __s0), __p1)); \
50510 __ret; \50646 __ret; \
50511})50647})
50512#else50648#else
...@@ -50514,7 +50650,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50514,7 +50650,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50514 poly8_t __ret; \50650 poly8_t __ret; \
50515 poly8x16_t __s0 = __p0; \50651 poly8x16_t __s0 = __p0; \
50516 poly8x16_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_8); \50652 poly8x16_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_8); \
50517 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_laneq_i8(__rev0, __p1)); \50653 __ret = __builtin_bit_cast(poly8_t, __builtin_neon_vdupb_laneq_i8(__builtin_bit_cast(int8x16_t, __rev0), __p1)); \
50518 __ret; \50654 __ret; \
50519})50655})
50520#endif50656#endif
...@@ -50523,7 +50659,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50523,7 +50659,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50523#define vduph_laneq_p16(__p0, __p1) __extension__ ({ \50659#define vduph_laneq_p16(__p0, __p1) __extension__ ({ \
50524 poly16_t __ret; \50660 poly16_t __ret; \
50525 poly16x8_t __s0 = __p0; \50661 poly16x8_t __s0 = __p0; \
50526 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_laneq_i16(__s0, __p1)); \50662 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_laneq_i16(__builtin_bit_cast(int16x8_t, __s0), __p1)); \
50527 __ret; \50663 __ret; \
50528})50664})
50529#else50665#else
...@@ -50531,7 +50667,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa...@@ -50531,7 +50667,7 @@ __ai __attribute__((target("neon"))) float32x2_t vdiv_f32(float32x2_t __p0, floa
50531 poly16_t __ret; \50667 poly16_t __ret; \
50532 poly16x8_t __s0 = __p0; \50668 poly16x8_t __s0 = __p0; \
50533 poly16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \50669 poly16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
50534 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_laneq_i16(__rev0, __p1)); \50670 __ret = __builtin_bit_cast(poly16_t, __builtin_neon_vduph_laneq_i16(__builtin_bit_cast(int16x8_t, __rev0), __p1)); \
50535 __ret; \50671 __ret; \
50536})50672})
50537#endif50673#endif
...@@ -52105,14 +52241,14 @@ __ai __attribute__((target("neon"))) float64x1_t vget_high_f64(float64x2_t __p0)...@@ -52105,14 +52241,14 @@ __ai __attribute__((target("neon"))) float64x1_t vget_high_f64(float64x2_t __p0)
52105#define vget_lane_p64(__p0, __p1) __extension__ ({ \52241#define vget_lane_p64(__p0, __p1) __extension__ ({ \
52106 poly64_t __ret; \52242 poly64_t __ret; \
52107 poly64x1_t __s0 = __p0; \52243 poly64x1_t __s0 = __p0; \
52108 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vget_lane_i64(__s0, __p1)); \52244 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vget_lane_i64(__builtin_bit_cast(int64x1_t, __s0), __p1)); \
52109 __ret; \52245 __ret; \
52110})52246})
52111#ifdef __LITTLE_ENDIAN__52247#ifdef __LITTLE_ENDIAN__
52112#define vgetq_lane_p64(__p0, __p1) __extension__ ({ \52248#define vgetq_lane_p64(__p0, __p1) __extension__ ({ \
52113 poly64_t __ret; \52249 poly64_t __ret; \
52114 poly64x2_t __s0 = __p0; \52250 poly64x2_t __s0 = __p0; \
52115 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vgetq_lane_i64(__s0, __p1)); \52251 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vgetq_lane_i64(__builtin_bit_cast(int64x2_t, __s0), __p1)); \
52116 __ret; \52252 __ret; \
52117})52253})
52118#else52254#else
...@@ -52120,13 +52256,13 @@ __ai __attribute__((target("neon"))) float64x1_t vget_high_f64(float64x2_t __p0)...@@ -52120,13 +52256,13 @@ __ai __attribute__((target("neon"))) float64x1_t vget_high_f64(float64x2_t __p0)
52120 poly64_t __ret; \52256 poly64_t __ret; \
52121 poly64x2_t __s0 = __p0; \52257 poly64x2_t __s0 = __p0; \
52122 poly64x2_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_64); \52258 poly64x2_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_64); \
52123 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vgetq_lane_i64(__rev0, __p1)); \52259 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vgetq_lane_i64(__builtin_bit_cast(int64x2_t, __rev0), __p1)); \
52124 __ret; \52260 __ret; \
52125})52261})
52126#define __noswap_vgetq_lane_p64(__p0, __p1) __extension__ ({ \52262#define __noswap_vgetq_lane_p64(__p0, __p1) __extension__ ({ \
52127 poly64_t __ret; \52263 poly64_t __ret; \
52128 poly64x2_t __s0 = __p0; \52264 poly64x2_t __s0 = __p0; \
52129 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vgetq_lane_i64(__s0, __p1)); \52265 __ret = __builtin_bit_cast(poly64_t, __builtin_neon_vgetq_lane_i64(__builtin_bit_cast(int64x2_t, __s0), __p1)); \
52130 __ret; \52266 __ret; \
52131})52267})
52132#endif52268#endif
...@@ -59743,20 +59879,20 @@ __ai __attribute__((target("neon"))) int16_t vqrshlh_s16(int16_t __p0, int16_t _...@@ -59743,20 +59879,20 @@ __ai __attribute__((target("neon"))) int16_t vqrshlh_s16(int16_t __p0, int16_t _
59743})59879})
59744#ifdef __LITTLE_ENDIAN__59880#ifdef __LITTLE_ENDIAN__
59745#define vqrshrun_high_n_s32(__p0_716, __p1_716, __p2_716) __extension__ ({ \59881#define vqrshrun_high_n_s32(__p0_716, __p1_716, __p2_716) __extension__ ({ \
59746 int16x8_t __ret_716; \59882 uint16x8_t __ret_716; \
59747 int16x4_t __s0_716 = __p0_716; \59883 uint16x4_t __s0_716 = __p0_716; \
59748 int32x4_t __s1_716 = __p1_716; \59884 int32x4_t __s1_716 = __p1_716; \
59749 __ret_716 = __builtin_bit_cast(int16x8_t, vcombine_s16(__builtin_bit_cast(int16x4_t, __s0_716), __builtin_bit_cast(int16x4_t, vqrshrun_n_s32(__s1_716, __p2_716)))); \59885 __ret_716 = __builtin_bit_cast(uint16x8_t, vcombine_u16(__builtin_bit_cast(uint16x4_t, __s0_716), __builtin_bit_cast(uint16x4_t, vqrshrun_n_s32(__s1_716, __p2_716)))); \
59750 __ret_716; \59886 __ret_716; \
59751})59887})
59752#else59888#else
59753#define vqrshrun_high_n_s32(__p0_717, __p1_717, __p2_717) __extension__ ({ \59889#define vqrshrun_high_n_s32(__p0_717, __p1_717, __p2_717) __extension__ ({ \
59754 int16x8_t __ret_717; \59890 uint16x8_t __ret_717; \
59755 int16x4_t __s0_717 = __p0_717; \59891 uint16x4_t __s0_717 = __p0_717; \
59756 int32x4_t __s1_717 = __p1_717; \59892 int32x4_t __s1_717 = __p1_717; \
59757 int16x4_t __rev0_717; __rev0_717 = __builtin_shufflevector(__s0_717, __s0_717, __lane_reverse_64_16); \59893 uint16x4_t __rev0_717; __rev0_717 = __builtin_shufflevector(__s0_717, __s0_717, __lane_reverse_64_16); \
59758 int32x4_t __rev1_717; __rev1_717 = __builtin_shufflevector(__s1_717, __s1_717, __lane_reverse_128_32); \59894 int32x4_t __rev1_717; __rev1_717 = __builtin_shufflevector(__s1_717, __s1_717, __lane_reverse_128_32); \
59759 __ret_717 = __builtin_bit_cast(int16x8_t, __noswap_vcombine_s16(__builtin_bit_cast(int16x4_t, __rev0_717), __builtin_bit_cast(int16x4_t, __noswap_vqrshrun_n_s32(__rev1_717, __p2_717)))); \59895 __ret_717 = __builtin_bit_cast(uint16x8_t, __noswap_vcombine_u16(__builtin_bit_cast(uint16x4_t, __rev0_717), __builtin_bit_cast(uint16x4_t, __noswap_vqrshrun_n_s32(__rev1_717, __p2_717)))); \
59760 __ret_717 = __builtin_shufflevector(__ret_717, __ret_717, __lane_reverse_128_16); \59896 __ret_717 = __builtin_shufflevector(__ret_717, __ret_717, __lane_reverse_128_16); \
59761 __ret_717; \59897 __ret_717; \
59762})59898})
...@@ -59764,20 +59900,20 @@ __ai __attribute__((target("neon"))) int16_t vqrshlh_s16(int16_t __p0, int16_t _...@@ -59764,20 +59900,20 @@ __ai __attribute__((target("neon"))) int16_t vqrshlh_s16(int16_t __p0, int16_t _
5976459900
59765#ifdef __LITTLE_ENDIAN__59901#ifdef __LITTLE_ENDIAN__
59766#define vqrshrun_high_n_s64(__p0_718, __p1_718, __p2_718) __extension__ ({ \59902#define vqrshrun_high_n_s64(__p0_718, __p1_718, __p2_718) __extension__ ({ \
59767 int32x4_t __ret_718; \59903 uint32x4_t __ret_718; \
59768 int32x2_t __s0_718 = __p0_718; \59904 uint32x2_t __s0_718 = __p0_718; \
59769 int64x2_t __s1_718 = __p1_718; \59905 int64x2_t __s1_718 = __p1_718; \
59770 __ret_718 = __builtin_bit_cast(int32x4_t, vcombine_s32(__builtin_bit_cast(int32x2_t, __s0_718), __builtin_bit_cast(int32x2_t, vqrshrun_n_s64(__s1_718, __p2_718)))); \59906 __ret_718 = __builtin_bit_cast(uint32x4_t, vcombine_u32(__builtin_bit_cast(uint32x2_t, __s0_718), __builtin_bit_cast(uint32x2_t, vqrshrun_n_s64(__s1_718, __p2_718)))); \
59771 __ret_718; \59907 __ret_718; \
59772})59908})
59773#else59909#else
59774#define vqrshrun_high_n_s64(__p0_719, __p1_719, __p2_719) __extension__ ({ \59910#define vqrshrun_high_n_s64(__p0_719, __p1_719, __p2_719) __extension__ ({ \
59775 int32x4_t __ret_719; \59911 uint32x4_t __ret_719; \
59776 int32x2_t __s0_719 = __p0_719; \59912 uint32x2_t __s0_719 = __p0_719; \
59777 int64x2_t __s1_719 = __p1_719; \59913 int64x2_t __s1_719 = __p1_719; \
59778 int32x2_t __rev0_719; __rev0_719 = __builtin_shufflevector(__s0_719, __s0_719, __lane_reverse_64_32); \59914 uint32x2_t __rev0_719; __rev0_719 = __builtin_shufflevector(__s0_719, __s0_719, __lane_reverse_64_32); \
59779 int64x2_t __rev1_719; __rev1_719 = __builtin_shufflevector(__s1_719, __s1_719, __lane_reverse_128_64); \59915 int64x2_t __rev1_719; __rev1_719 = __builtin_shufflevector(__s1_719, __s1_719, __lane_reverse_128_64); \
59780 __ret_719 = __builtin_bit_cast(int32x4_t, __noswap_vcombine_s32(__builtin_bit_cast(int32x2_t, __rev0_719), __builtin_bit_cast(int32x2_t, __noswap_vqrshrun_n_s64(__rev1_719, __p2_719)))); \59916 __ret_719 = __builtin_bit_cast(uint32x4_t, __noswap_vcombine_u32(__builtin_bit_cast(uint32x2_t, __rev0_719), __builtin_bit_cast(uint32x2_t, __noswap_vqrshrun_n_s64(__rev1_719, __p2_719)))); \
59781 __ret_719 = __builtin_shufflevector(__ret_719, __ret_719, __lane_reverse_128_32); \59917 __ret_719 = __builtin_shufflevector(__ret_719, __ret_719, __lane_reverse_128_32); \
59782 __ret_719; \59918 __ret_719; \
59783})59919})
...@@ -59785,20 +59921,20 @@ __ai __attribute__((target("neon"))) int16_t vqrshlh_s16(int16_t __p0, int16_t _...@@ -59785,20 +59921,20 @@ __ai __attribute__((target("neon"))) int16_t vqrshlh_s16(int16_t __p0, int16_t _
5978559921
59786#ifdef __LITTLE_ENDIAN__59922#ifdef __LITTLE_ENDIAN__
59787#define vqrshrun_high_n_s16(__p0_720, __p1_720, __p2_720) __extension__ ({ \59923#define vqrshrun_high_n_s16(__p0_720, __p1_720, __p2_720) __extension__ ({ \
59788 int8x16_t __ret_720; \59924 uint8x16_t __ret_720; \
59789 int8x8_t __s0_720 = __p0_720; \59925 uint8x8_t __s0_720 = __p0_720; \
59790 int16x8_t __s1_720 = __p1_720; \59926 int16x8_t __s1_720 = __p1_720; \
59791 __ret_720 = __builtin_bit_cast(int8x16_t, vcombine_s8(__builtin_bit_cast(int8x8_t, __s0_720), __builtin_bit_cast(int8x8_t, vqrshrun_n_s16(__s1_720, __p2_720)))); \59927 __ret_720 = __builtin_bit_cast(uint8x16_t, vcombine_u8(__builtin_bit_cast(uint8x8_t, __s0_720), __builtin_bit_cast(uint8x8_t, vqrshrun_n_s16(__s1_720, __p2_720)))); \
59792 __ret_720; \59928 __ret_720; \
59793})59929})
59794#else59930#else
59795#define vqrshrun_high_n_s16(__p0_721, __p1_721, __p2_721) __extension__ ({ \59931#define vqrshrun_high_n_s16(__p0_721, __p1_721, __p2_721) __extension__ ({ \
59796 int8x16_t __ret_721; \59932 uint8x16_t __ret_721; \
59797 int8x8_t __s0_721 = __p0_721; \59933 uint8x8_t __s0_721 = __p0_721; \
59798 int16x8_t __s1_721 = __p1_721; \59934 int16x8_t __s1_721 = __p1_721; \
59799 int8x8_t __rev0_721; __rev0_721 = __builtin_shufflevector(__s0_721, __s0_721, __lane_reverse_64_8); \59935 uint8x8_t __rev0_721; __rev0_721 = __builtin_shufflevector(__s0_721, __s0_721, __lane_reverse_64_8); \
59800 int16x8_t __rev1_721; __rev1_721 = __builtin_shufflevector(__s1_721, __s1_721, __lane_reverse_128_16); \59936 int16x8_t __rev1_721; __rev1_721 = __builtin_shufflevector(__s1_721, __s1_721, __lane_reverse_128_16); \
59801 __ret_721 = __builtin_bit_cast(int8x16_t, __noswap_vcombine_s8(__builtin_bit_cast(int8x8_t, __rev0_721), __builtin_bit_cast(int8x8_t, __noswap_vqrshrun_n_s16(__rev1_721, __p2_721)))); \59937 __ret_721 = __builtin_bit_cast(uint8x16_t, __noswap_vcombine_u8(__builtin_bit_cast(uint8x8_t, __rev0_721), __builtin_bit_cast(uint8x8_t, __noswap_vqrshrun_n_s16(__rev1_721, __p2_721)))); \
59802 __ret_721 = __builtin_shufflevector(__ret_721, __ret_721, __lane_reverse_128_8); \59938 __ret_721 = __builtin_shufflevector(__ret_721, __ret_721, __lane_reverse_128_8); \
59803 __ret_721; \59939 __ret_721; \
59804})59940})
...@@ -60098,20 +60234,20 @@ __ai __attribute__((target("neon"))) int16_t vqshlh_s16(int16_t __p0, int16_t __...@@ -60098,20 +60234,20 @@ __ai __attribute__((target("neon"))) int16_t vqshlh_s16(int16_t __p0, int16_t __
60098})60234})
60099#ifdef __LITTLE_ENDIAN__60235#ifdef __LITTLE_ENDIAN__
60100#define vqshrun_high_n_s32(__p0_734, __p1_734, __p2_734) __extension__ ({ \60236#define vqshrun_high_n_s32(__p0_734, __p1_734, __p2_734) __extension__ ({ \
60101 int16x8_t __ret_734; \60237 uint16x8_t __ret_734; \
60102 int16x4_t __s0_734 = __p0_734; \60238 uint16x4_t __s0_734 = __p0_734; \
60103 int32x4_t __s1_734 = __p1_734; \60239 int32x4_t __s1_734 = __p1_734; \
60104 __ret_734 = __builtin_bit_cast(int16x8_t, vcombine_s16(__builtin_bit_cast(int16x4_t, __s0_734), __builtin_bit_cast(int16x4_t, vqshrun_n_s32(__s1_734, __p2_734)))); \60240 __ret_734 = __builtin_bit_cast(uint16x8_t, vcombine_u16(__builtin_bit_cast(uint16x4_t, __s0_734), __builtin_bit_cast(uint16x4_t, vqshrun_n_s32(__s1_734, __p2_734)))); \
60105 __ret_734; \60241 __ret_734; \
60106})60242})
60107#else60243#else
60108#define vqshrun_high_n_s32(__p0_735, __p1_735, __p2_735) __extension__ ({ \60244#define vqshrun_high_n_s32(__p0_735, __p1_735, __p2_735) __extension__ ({ \
60109 int16x8_t __ret_735; \60245 uint16x8_t __ret_735; \
60110 int16x4_t __s0_735 = __p0_735; \60246 uint16x4_t __s0_735 = __p0_735; \
60111 int32x4_t __s1_735 = __p1_735; \60247 int32x4_t __s1_735 = __p1_735; \
60112 int16x4_t __rev0_735; __rev0_735 = __builtin_shufflevector(__s0_735, __s0_735, __lane_reverse_64_16); \60248 uint16x4_t __rev0_735; __rev0_735 = __builtin_shufflevector(__s0_735, __s0_735, __lane_reverse_64_16); \
60113 int32x4_t __rev1_735; __rev1_735 = __builtin_shufflevector(__s1_735, __s1_735, __lane_reverse_128_32); \60249 int32x4_t __rev1_735; __rev1_735 = __builtin_shufflevector(__s1_735, __s1_735, __lane_reverse_128_32); \
60114 __ret_735 = __builtin_bit_cast(int16x8_t, __noswap_vcombine_s16(__builtin_bit_cast(int16x4_t, __rev0_735), __builtin_bit_cast(int16x4_t, __noswap_vqshrun_n_s32(__rev1_735, __p2_735)))); \60250 __ret_735 = __builtin_bit_cast(uint16x8_t, __noswap_vcombine_u16(__builtin_bit_cast(uint16x4_t, __rev0_735), __builtin_bit_cast(uint16x4_t, __noswap_vqshrun_n_s32(__rev1_735, __p2_735)))); \
60115 __ret_735 = __builtin_shufflevector(__ret_735, __ret_735, __lane_reverse_128_16); \60251 __ret_735 = __builtin_shufflevector(__ret_735, __ret_735, __lane_reverse_128_16); \
60116 __ret_735; \60252 __ret_735; \
60117})60253})
...@@ -60119,20 +60255,20 @@ __ai __attribute__((target("neon"))) int16_t vqshlh_s16(int16_t __p0, int16_t __...@@ -60119,20 +60255,20 @@ __ai __attribute__((target("neon"))) int16_t vqshlh_s16(int16_t __p0, int16_t __
6011960255
60120#ifdef __LITTLE_ENDIAN__60256#ifdef __LITTLE_ENDIAN__
60121#define vqshrun_high_n_s64(__p0_736, __p1_736, __p2_736) __extension__ ({ \60257#define vqshrun_high_n_s64(__p0_736, __p1_736, __p2_736) __extension__ ({ \
60122 int32x4_t __ret_736; \60258 uint32x4_t __ret_736; \
60123 int32x2_t __s0_736 = __p0_736; \60259 uint32x2_t __s0_736 = __p0_736; \
60124 int64x2_t __s1_736 = __p1_736; \60260 int64x2_t __s1_736 = __p1_736; \
60125 __ret_736 = __builtin_bit_cast(int32x4_t, vcombine_s32(__builtin_bit_cast(int32x2_t, __s0_736), __builtin_bit_cast(int32x2_t, vqshrun_n_s64(__s1_736, __p2_736)))); \60261 __ret_736 = __builtin_bit_cast(uint32x4_t, vcombine_u32(__builtin_bit_cast(uint32x2_t, __s0_736), __builtin_bit_cast(uint32x2_t, vqshrun_n_s64(__s1_736, __p2_736)))); \
60126 __ret_736; \60262 __ret_736; \
60127})60263})
60128#else60264#else
60129#define vqshrun_high_n_s64(__p0_737, __p1_737, __p2_737) __extension__ ({ \60265#define vqshrun_high_n_s64(__p0_737, __p1_737, __p2_737) __extension__ ({ \
60130 int32x4_t __ret_737; \60266 uint32x4_t __ret_737; \
60131 int32x2_t __s0_737 = __p0_737; \60267 uint32x2_t __s0_737 = __p0_737; \
60132 int64x2_t __s1_737 = __p1_737; \60268 int64x2_t __s1_737 = __p1_737; \
60133 int32x2_t __rev0_737; __rev0_737 = __builtin_shufflevector(__s0_737, __s0_737, __lane_reverse_64_32); \60269 uint32x2_t __rev0_737; __rev0_737 = __builtin_shufflevector(__s0_737, __s0_737, __lane_reverse_64_32); \
60134 int64x2_t __rev1_737; __rev1_737 = __builtin_shufflevector(__s1_737, __s1_737, __lane_reverse_128_64); \60270 int64x2_t __rev1_737; __rev1_737 = __builtin_shufflevector(__s1_737, __s1_737, __lane_reverse_128_64); \
60135 __ret_737 = __builtin_bit_cast(int32x4_t, __noswap_vcombine_s32(__builtin_bit_cast(int32x2_t, __rev0_737), __builtin_bit_cast(int32x2_t, __noswap_vqshrun_n_s64(__rev1_737, __p2_737)))); \60271 __ret_737 = __builtin_bit_cast(uint32x4_t, __noswap_vcombine_u32(__builtin_bit_cast(uint32x2_t, __rev0_737), __builtin_bit_cast(uint32x2_t, __noswap_vqshrun_n_s64(__rev1_737, __p2_737)))); \
60136 __ret_737 = __builtin_shufflevector(__ret_737, __ret_737, __lane_reverse_128_32); \60272 __ret_737 = __builtin_shufflevector(__ret_737, __ret_737, __lane_reverse_128_32); \
60137 __ret_737; \60273 __ret_737; \
60138})60274})
...@@ -60140,20 +60276,20 @@ __ai __attribute__((target("neon"))) int16_t vqshlh_s16(int16_t __p0, int16_t __...@@ -60140,20 +60276,20 @@ __ai __attribute__((target("neon"))) int16_t vqshlh_s16(int16_t __p0, int16_t __
6014060276
60141#ifdef __LITTLE_ENDIAN__60277#ifdef __LITTLE_ENDIAN__
60142#define vqshrun_high_n_s16(__p0_738, __p1_738, __p2_738) __extension__ ({ \60278#define vqshrun_high_n_s16(__p0_738, __p1_738, __p2_738) __extension__ ({ \
60143 int8x16_t __ret_738; \60279 uint8x16_t __ret_738; \
60144 int8x8_t __s0_738 = __p0_738; \60280 uint8x8_t __s0_738 = __p0_738; \
60145 int16x8_t __s1_738 = __p1_738; \60281 int16x8_t __s1_738 = __p1_738; \
60146 __ret_738 = __builtin_bit_cast(int8x16_t, vcombine_s8(__builtin_bit_cast(int8x8_t, __s0_738), __builtin_bit_cast(int8x8_t, vqshrun_n_s16(__s1_738, __p2_738)))); \60282 __ret_738 = __builtin_bit_cast(uint8x16_t, vcombine_u8(__builtin_bit_cast(uint8x8_t, __s0_738), __builtin_bit_cast(uint8x8_t, vqshrun_n_s16(__s1_738, __p2_738)))); \
60147 __ret_738; \60283 __ret_738; \
60148})60284})
60149#else60285#else
60150#define vqshrun_high_n_s16(__p0_739, __p1_739, __p2_739) __extension__ ({ \60286#define vqshrun_high_n_s16(__p0_739, __p1_739, __p2_739) __extension__ ({ \
60151 int8x16_t __ret_739; \60287 uint8x16_t __ret_739; \
60152 int8x8_t __s0_739 = __p0_739; \60288 uint8x8_t __s0_739 = __p0_739; \
60153 int16x8_t __s1_739 = __p1_739; \60289 int16x8_t __s1_739 = __p1_739; \
60154 int8x8_t __rev0_739; __rev0_739 = __builtin_shufflevector(__s0_739, __s0_739, __lane_reverse_64_8); \60290 uint8x8_t __rev0_739; __rev0_739 = __builtin_shufflevector(__s0_739, __s0_739, __lane_reverse_64_8); \
60155 int16x8_t __rev1_739; __rev1_739 = __builtin_shufflevector(__s1_739, __s1_739, __lane_reverse_128_16); \60291 int16x8_t __rev1_739; __rev1_739 = __builtin_shufflevector(__s1_739, __s1_739, __lane_reverse_128_16); \
60156 __ret_739 = __builtin_bit_cast(int8x16_t, __noswap_vcombine_s8(__builtin_bit_cast(int8x8_t, __rev0_739), __builtin_bit_cast(int8x8_t, __noswap_vqshrun_n_s16(__rev1_739, __p2_739)))); \60292 __ret_739 = __builtin_bit_cast(uint8x16_t, __noswap_vcombine_u8(__builtin_bit_cast(uint8x8_t, __rev0_739), __builtin_bit_cast(uint8x8_t, __noswap_vqshrun_n_s16(__rev1_739, __p2_739)))); \
60157 __ret_739 = __builtin_shufflevector(__ret_739, __ret_739, __lane_reverse_128_8); \60293 __ret_739 = __builtin_shufflevector(__ret_739, __ret_739, __lane_reverse_128_8); \
60158 __ret_739; \60294 __ret_739; \
60159})60295})
...@@ -64345,7 +64481,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i...@@ -64345,7 +64481,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i
64345 poly64x1_t __ret; \64481 poly64x1_t __ret; \
64346 poly64_t __s0 = __p0; \64482 poly64_t __s0 = __p0; \
64347 poly64x1_t __s1 = __p1; \64483 poly64x1_t __s1 = __p1; \
64348 __ret = __builtin_bit_cast(poly64x1_t, __builtin_neon_vset_lane_i64(__s0, __s1, __p2)); \64484 __ret = __builtin_bit_cast(poly64x1_t, __builtin_neon_vset_lane_i64(__s0, __builtin_bit_cast(int64x1_t, __s1), __p2)); \
64349 __ret; \64485 __ret; \
64350})64486})
64351#ifdef __LITTLE_ENDIAN__64487#ifdef __LITTLE_ENDIAN__
...@@ -64353,7 +64489,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i...@@ -64353,7 +64489,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i
64353 poly64x2_t __ret; \64489 poly64x2_t __ret; \
64354 poly64_t __s0 = __p0; \64490 poly64_t __s0 = __p0; \
64355 poly64x2_t __s1 = __p1; \64491 poly64x2_t __s1 = __p1; \
64356 __ret = __builtin_bit_cast(poly64x2_t, __builtin_neon_vsetq_lane_i64(__s0, __s1, __p2)); \64492 __ret = __builtin_bit_cast(poly64x2_t, __builtin_neon_vsetq_lane_i64(__s0, __builtin_bit_cast(int64x2_t, __s1), __p2)); \
64357 __ret; \64493 __ret; \
64358})64494})
64359#else64495#else
...@@ -64362,7 +64498,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i...@@ -64362,7 +64498,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i
64362 poly64_t __s0 = __p0; \64498 poly64_t __s0 = __p0; \
64363 poly64x2_t __s1 = __p1; \64499 poly64x2_t __s1 = __p1; \
64364 poly64x2_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_64); \64500 poly64x2_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_64); \
64365 __ret = __builtin_bit_cast(poly64x2_t, __builtin_neon_vsetq_lane_i64(__s0, __rev1, __p2)); \64501 __ret = __builtin_bit_cast(poly64x2_t, __builtin_neon_vsetq_lane_i64(__s0, __builtin_bit_cast(int64x2_t, __rev1), __p2)); \
64366 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_64); \64502 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_64); \
64367 __ret; \64503 __ret; \
64368})64504})
...@@ -64370,7 +64506,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i...@@ -64370,7 +64506,7 @@ __ai __attribute__((target("neon"))) int8x16_t vrsubhn_high_s16(int8x8_t __p0, i
64370 poly64x2_t __ret; \64506 poly64x2_t __ret; \
64371 poly64_t __s0 = __p0; \64507 poly64_t __s0 = __p0; \
64372 poly64x2_t __s1 = __p1; \64508 poly64x2_t __s1 = __p1; \
64373 __ret = __builtin_bit_cast(poly64x2_t, __builtin_neon_vsetq_lane_i64(__s0, __s1, __p2)); \64509 __ret = __builtin_bit_cast(poly64x2_t, __builtin_neon_vsetq_lane_i64(__s0, __builtin_bit_cast(int64x2_t, __s1), __p2)); \
64374 __ret; \64510 __ret; \
64375})64511})
64376#endif64512#endif
lib/include/arm_sme.h+8-8
...@@ -796,8 +796,6 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x2...@@ -796,8 +796,6 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x2
796void svdot_za16_mf8_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);796void svdot_za16_mf8_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
797__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x4_fpm)))797__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x4_fpm)))
798void svdot_za16_mf8_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);798void svdot_za16_mf8_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);
799__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x1_fpm)))
800void svmla_single_za16_mf8_vg2x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
801__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x2_fpm)))799__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x2_fpm)))
802void svmla_single_za16_mf8_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);800void svmla_single_za16_mf8_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);
803__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x4_fpm)))801__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x4_fpm)))
...@@ -808,6 +806,8 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8_...@@ -808,6 +806,8 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8_
808void svmla_lane_za16_mf8_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);806void svmla_lane_za16_mf8_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);
809__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8_vg2x4_fpm)))807__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8_vg2x4_fpm)))
810void svmla_lane_za16_mf8_vg2x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);808void svmla_lane_za16_mf8_vg2x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);
809__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x1_fpm)))
810void svmla_za16_mf8_vg2x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
811__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x2_fpm)))811__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x2_fpm)))
812void svmla_za16_mf8_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);812void svmla_za16_mf8_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
813__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x4_fpm)))813__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x4_fpm)))
...@@ -828,8 +828,6 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x...@@ -828,8 +828,6 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x
828void svdot_za16_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);828void svdot_za16_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
829__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x4_fpm)))829__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za16_mf8_vg1x4_fpm)))
830void svdot_za16_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);830void svdot_za16_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);
831__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x1_fpm)))
832void svmla_za16_vg2x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
833__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x2_fpm)))831__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x2_fpm)))
834void svmla_za16_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);832void svmla_za16_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);
835__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x4_fpm)))833__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za16_mf8_vg2x4_fpm)))
...@@ -840,6 +838,8 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8...@@ -840,6 +838,8 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8
840void svmla_lane_za16_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);838void svmla_lane_za16_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);
841__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8_vg2x4_fpm)))839__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za16_mf8_vg2x4_fpm)))
842void svmla_lane_za16_vg2x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);840void svmla_lane_za16_vg2x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);
841__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x1_fpm)))
842void svmla_za16_vg2x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
843__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x2_fpm)))843__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x2_fpm)))
844void svmla_za16_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);844void svmla_za16_vg2x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
845__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x4_fpm)))845__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za16_mf8_vg2x4_fpm)))
...@@ -860,8 +860,6 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x2...@@ -860,8 +860,6 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x2
860void svdot_za32_mf8_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);860void svdot_za32_mf8_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
861__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x4_fpm)))861__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x4_fpm)))
862void svdot_za32_mf8_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);862void svdot_za32_mf8_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);
863__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x1_fpm)))
864void svmla_single_za32_mf8_vg4x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
865__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x2_fpm)))863__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x2_fpm)))
866void svmla_single_za32_mf8_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);864void svmla_single_za32_mf8_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);
867__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x4_fpm)))865__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x4_fpm)))
...@@ -872,6 +870,8 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8_...@@ -872,6 +870,8 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8_
872void svmla_lane_za32_mf8_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);870void svmla_lane_za32_mf8_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);
873__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8_vg4x4_fpm)))871__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8_vg4x4_fpm)))
874void svmla_lane_za32_mf8_vg4x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);872void svmla_lane_za32_mf8_vg4x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);
873__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x1_fpm)))
874void svmla_za32_mf8_vg4x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
875__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x2_fpm)))875__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x2_fpm)))
876void svmla_za32_mf8_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);876void svmla_za32_mf8_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
877__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x4_fpm)))877__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x4_fpm)))
...@@ -894,8 +894,6 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x...@@ -894,8 +894,6 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x
894void svdot_za32_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);894void svdot_za32_vg1x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
895__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x4_fpm)))895__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svdot_za32_mf8_vg1x4_fpm)))
896void svdot_za32_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);896void svdot_za32_vg1x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8x4_t, fpm_t);
897__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x1_fpm)))
898void svmla_za32_vg4x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
899__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x2_fpm)))897__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x2_fpm)))
900void svmla_za32_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);898void svmla_za32_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, fpm_t);
901__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x4_fpm)))899__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_single_za32_mf8_vg4x4_fpm)))
...@@ -906,6 +904,8 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8...@@ -906,6 +904,8 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8
906void svmla_lane_za32_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);904void svmla_lane_za32_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8_t, uint64_t, fpm_t);
907__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8_vg4x4_fpm)))905__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_lane_za32_mf8_vg4x4_fpm)))
908void svmla_lane_za32_vg4x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);906void svmla_lane_za32_vg4x4_fpm(uint32_t, svmfloat8x4_t, svmfloat8_t, uint64_t, fpm_t);
907__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x1_fpm)))
908void svmla_za32_vg4x1_fpm(uint32_t, svmfloat8_t, svmfloat8_t, fpm_t);
909__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x2_fpm)))909__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x2_fpm)))
910void svmla_za32_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);910void svmla_za32_vg4x2_fpm(uint32_t, svmfloat8x2_t, svmfloat8x2_t, fpm_t);
911__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x4_fpm)))911__aio __attribute__((__clang_arm_builtin_alias(__builtin_sme_svmla_za32_mf8_vg4x4_fpm)))
lib/include/arm_sve.h+4162-3782
...@@ -4617,6 +4617,86 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x2)))...@@ -4617,6 +4617,86 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x2)))
4617svbfloat16x2_t svminnm(svbfloat16x2_t, svbfloat16x2_t);4617svbfloat16x2_t svminnm(svbfloat16x2_t, svbfloat16x2_t);
4618__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x4)))4618__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x4)))
4619svbfloat16x4_t svminnm(svbfloat16x4_t, svbfloat16x4_t);4619svbfloat16x4_t svminnm(svbfloat16x4_t, svbfloat16x4_t);
4620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_bf16_x2)))
4621svbfloat16x2_t svmul_single_bf16_x2(svbfloat16x2_t, svbfloat16_t);
4622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_bf16_x4)))
4623svbfloat16x4_t svmul_single_bf16_x4(svbfloat16x4_t, svbfloat16_t);
4624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x2)))
4625svbfloat16x2_t svmul_bf16_x2(svbfloat16x2_t, svbfloat16x2_t);
4626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x4)))
4627svbfloat16x4_t svmul_bf16_x4(svbfloat16x4_t, svbfloat16x4_t);
4628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_single_bf16_x2)))
4629svbfloat16x2_t svscale_single_bf16_x2(svbfloat16x2_t, svint16_t);
4630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_single_bf16_x4)))
4631svbfloat16x4_t svscale_single_bf16_x4(svbfloat16x4_t, svint16_t);
4632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_x2)))
4633svbfloat16x2_t svscale_bf16_x2(svbfloat16x2_t, svint16x2_t);
4634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_x4)))
4635svbfloat16x4_t svscale_bf16_x4(svbfloat16x4_t, svint16x4_t);
4636__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_bf16_x2)))
4637svbfloat16x2_t svmul(svbfloat16x2_t, svbfloat16_t);
4638__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_bf16_x4)))
4639svbfloat16x4_t svmul(svbfloat16x4_t, svbfloat16_t);
4640__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x2)))
4641svbfloat16x2_t svmul(svbfloat16x2_t, svbfloat16x2_t);
4642__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x4)))
4643svbfloat16x4_t svmul(svbfloat16x4_t, svbfloat16x4_t);
4644__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_single_bf16_x2)))
4645svbfloat16x2_t svscale(svbfloat16x2_t, svint16_t);
4646__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_single_bf16_x4)))
4647svbfloat16x4_t svscale(svbfloat16x4_t, svint16_t);
4648__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_x2)))
4649svbfloat16x2_t svscale(svbfloat16x2_t, svint16x2_t);
4650__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_x4)))
4651svbfloat16x4_t svscale(svbfloat16x4_t, svint16x4_t);
4652__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f64_x2)))
4653svfloat64x2_t svmul_single_f64_x2(svfloat64x2_t, svfloat64_t);
4654__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f32_x2)))
4655svfloat32x2_t svmul_single_f32_x2(svfloat32x2_t, svfloat32_t);
4656__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f16_x2)))
4657svfloat16x2_t svmul_single_f16_x2(svfloat16x2_t, svfloat16_t);
4658__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f64_x4)))
4659svfloat64x4_t svmul_single_f64_x4(svfloat64x4_t, svfloat64_t);
4660__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f32_x4)))
4661svfloat32x4_t svmul_single_f32_x4(svfloat32x4_t, svfloat32_t);
4662__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f16_x4)))
4663svfloat16x4_t svmul_single_f16_x4(svfloat16x4_t, svfloat16_t);
4664__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f64_x2)))
4665svfloat64x2_t svmul_f64_x2(svfloat64x2_t, svfloat64x2_t);
4666__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f32_x2)))
4667svfloat32x2_t svmul_f32_x2(svfloat32x2_t, svfloat32x2_t);
4668__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f16_x2)))
4669svfloat16x2_t svmul_f16_x2(svfloat16x2_t, svfloat16x2_t);
4670__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f64_x4)))
4671svfloat64x4_t svmul_f64_x4(svfloat64x4_t, svfloat64x4_t);
4672__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f32_x4)))
4673svfloat32x4_t svmul_f32_x4(svfloat32x4_t, svfloat32x4_t);
4674__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f16_x4)))
4675svfloat16x4_t svmul_f16_x4(svfloat16x4_t, svfloat16x4_t);
4676__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f64_x2)))
4677svfloat64x2_t svmul(svfloat64x2_t, svfloat64_t);
4678__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f32_x2)))
4679svfloat32x2_t svmul(svfloat32x2_t, svfloat32_t);
4680__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f16_x2)))
4681svfloat16x2_t svmul(svfloat16x2_t, svfloat16_t);
4682__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f64_x4)))
4683svfloat64x4_t svmul(svfloat64x4_t, svfloat64_t);
4684__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f32_x4)))
4685svfloat32x4_t svmul(svfloat32x4_t, svfloat32_t);
4686__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_single_f16_x4)))
4687svfloat16x4_t svmul(svfloat16x4_t, svfloat16_t);
4688__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f64_x2)))
4689svfloat64x2_t svmul(svfloat64x2_t, svfloat64x2_t);
4690__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f32_x2)))
4691svfloat32x2_t svmul(svfloat32x2_t, svfloat32x2_t);
4692__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f16_x2)))
4693svfloat16x2_t svmul(svfloat16x2_t, svfloat16x2_t);
4694__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f64_x4)))
4695svfloat64x4_t svmul(svfloat64x4_t, svfloat64x4_t);
4696__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f32_x4)))
4697svfloat32x4_t svmul(svfloat32x4_t, svfloat32x4_t);
4698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f16_x4)))
4699svfloat16x4_t svmul(svfloat16x4_t, svfloat16x4_t);
4620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f64)))4700__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f64)))
4621float64_t svadda_f64(svbool_t, float64_t, svfloat64_t);4701float64_t svadda_f64(svbool_t, float64_t, svfloat64_t);
4622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f32)))4702__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f32)))
...@@ -4655,18 +4735,6 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u32base_s32in...@@ -4655,18 +4735,6 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u32base_s32in
4655svuint32_t svadrw_u32base_s32index(svuint32_t, svint32_t);4735svuint32_t svadrw_u32base_s32index(svuint32_t, svint32_t);
4656__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u64base_s64index)))4736__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u64base_s64index)))
4657svuint64_t svadrw_u64base_s64index(svuint64_t, svint64_t);4737svuint64_t svadrw_u64base_s64index(svuint64_t, svint64_t);
4658__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u32)))
4659svuint32_t svcompact_u32(svbool_t, svuint32_t);
4660__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u64)))
4661svuint64_t svcompact_u64(svbool_t, svuint64_t);
4662__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f64)))
4663svfloat64_t svcompact_f64(svbool_t, svfloat64_t);
4664__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f32)))
4665svfloat32_t svcompact_f32(svbool_t, svfloat32_t);
4666__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s32)))
4667svint32_t svcompact_s32(svbool_t, svint32_t);
4668__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s64)))
4669svint64_t svcompact_s64(svbool_t, svint64_t);
4670__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u32base_index_u32)))4738__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u32base_index_u32)))
4671svuint32_t svld1_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);4739svuint32_t svld1_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
4672__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u64base_index_u64)))4740__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u64base_index_u64)))
...@@ -5923,18 +5991,6 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u32base_s32i...@@ -5923,18 +5991,6 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u32base_s32i
5923svuint32_t svadrw_index(svuint32_t, svint32_t);5991svuint32_t svadrw_index(svuint32_t, svint32_t);
5924__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u64base_s64index)))5992__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadrw_u64base_s64index)))
5925svuint64_t svadrw_index(svuint64_t, svint64_t);5993svuint64_t svadrw_index(svuint64_t, svint64_t);
5926__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u32)))
5927svuint32_t svcompact(svbool_t, svuint32_t);
5928__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u64)))
5929svuint64_t svcompact(svbool_t, svuint64_t);
5930__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f64)))
5931svfloat64_t svcompact(svbool_t, svfloat64_t);
5932__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f32)))
5933svfloat32_t svcompact(svbool_t, svfloat32_t);
5934__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s32)))
5935svint32_t svcompact(svbool_t, svint32_t);
5936__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s64)))
5937svint64_t svcompact(svbool_t, svint64_t);
5938__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u32base_index_u32)))5994__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u32base_index_u32)))
5939svuint32_t svld1_gather_index_u32(svbool_t, svuint32_t, int64_t);5995svuint32_t svld1_gather_index_u32(svbool_t, svuint32_t, int64_t);
5940__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u64base_index_u64)))5996__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_gather_u64base_index_u64)))
...@@ -8777,3764 +8833,222 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzipq2_mf8)))...@@ -8777,3764 +8833,222 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzipq2_mf8)))
8777svmfloat8_t svzipq2(svmfloat8_t, svmfloat8_t);8833svmfloat8_t svzipq2(svmfloat8_t, svmfloat8_t);
8778__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzipq2_s16)))8834__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzipq2_s16)))
8779svint16_t svzipq2(svint16_t, svint16_t);8835svint16_t svzipq2(svint16_t, svint16_t);
8780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmmla_f32)))8836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt_f32_f16_z)))
8781svfloat32_t svbfmmla_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);8837svfloat32_t svcvtlt_f32_f16_z(svbool_t, svfloat16_t);
8782__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmmla_f32)))8838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt_f64_f32_z)))
8783svfloat32_t svbfmmla(svfloat32_t, svbfloat16_t, svbfloat16_t);8839svfloat64_t svcvtlt_f64_f32_z(svbool_t, svfloat32_t);
8784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_n_f32)))8840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_bf16_f32_z)))
8785svfloat32_t svbfdot_n_f32(svfloat32_t, svbfloat16_t, bfloat16_t);8841svbfloat16_t svcvtnt_bf16_f32_z(svbfloat16_t, svbool_t, svfloat32_t);
8786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_f32)))8842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_f16_f32_z)))
8787svfloat32_t svbfdot_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);8843svfloat16_t svcvtnt_f16_f32_z(svfloat16_t, svbool_t, svfloat32_t);
8788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_lane_f32)))8844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_f32_f64_z)))
8789svfloat32_t svbfdot_lane_f32(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);8845svfloat32_t svcvtnt_f32_f64_z(svfloat32_t, svbool_t, svfloat64_t);
8790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_n_f32)))8846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtxnt_f32_f64_z)))
8791svfloat32_t svbfmlalb_n_f32(svfloat32_t, svbfloat16_t, bfloat16_t);8847svfloat32_t svcvtxnt_f32_f64_z(svfloat32_t, svbool_t, svfloat64_t);
8792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_f32)))8848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svfirstp_b8)))
8793svfloat32_t svbfmlalb_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);8849int64_t svfirstp_b8(svbool_t, svbool_t);
8794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_lane_f32)))8850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svfirstp_b32)))
8795svfloat32_t svbfmlalb_lane_f32(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);8851int64_t svfirstp_b32(svbool_t, svbool_t);
8796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_n_f32)))8852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svfirstp_b64)))
8797svfloat32_t svbfmlalt_n_f32(svfloat32_t, svbfloat16_t, bfloat16_t);8853int64_t svfirstp_b64(svbool_t, svbool_t);
8798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_f32)))8854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svfirstp_b16)))
8799svfloat32_t svbfmlalt_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);8855int64_t svfirstp_b16(svbool_t, svbool_t);
8800__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_lane_f32)))8856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svlastp_b8)))
8801svfloat32_t svbfmlalt_lane_f32(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);8857int64_t svlastp_b8(svbool_t, svbool_t);
8802__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_m)))8858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svlastp_b32)))
8803svbfloat16_t svcvt_bf16_f32_m(svbfloat16_t, svbool_t, svfloat32_t);8859int64_t svlastp_b32(svbool_t, svbool_t);
8804__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_x)))8860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svlastp_b64)))
8805svbfloat16_t svcvt_bf16_f32_x(svbool_t, svfloat32_t);8861int64_t svlastp_b64(svbool_t, svbool_t);
8806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_z)))8862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svlastp_b16)))
8807svbfloat16_t svcvt_bf16_f32_z(svbool_t, svfloat32_t);8863int64_t svlastp_b16(svbool_t, svbool_t);
8808__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_bf16_f32_m)))8864__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f64_m)))
8809svbfloat16_t svcvtnt_bf16_f32_m(svbfloat16_t, svbool_t, svfloat32_t);8865svfloat64_t svrint32x_f64_m(svfloat64_t, svbool_t, svfloat64_t);
8810__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_n_f32)))8866__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f32_m)))
8811svfloat32_t svbfdot(svfloat32_t, svbfloat16_t, bfloat16_t);8867svfloat32_t svrint32x_f32_m(svfloat32_t, svbool_t, svfloat32_t);
8812__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_f32)))8868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f64_x)))
8813svfloat32_t svbfdot(svfloat32_t, svbfloat16_t, svbfloat16_t);8869svfloat64_t svrint32x_f64_x(svbool_t, svfloat64_t);
8814__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_lane_f32)))8870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f32_x)))
8815svfloat32_t svbfdot_lane(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);8871svfloat32_t svrint32x_f32_x(svbool_t, svfloat32_t);
8816__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_n_f32)))8872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f64_z)))
8817svfloat32_t svbfmlalb(svfloat32_t, svbfloat16_t, bfloat16_t);8873svfloat64_t svrint32x_f64_z(svbool_t, svfloat64_t);
8818__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_f32)))8874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f32_z)))
8819svfloat32_t svbfmlalb(svfloat32_t, svbfloat16_t, svbfloat16_t);8875svfloat32_t svrint32x_f32_z(svbool_t, svfloat32_t);
8820__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_lane_f32)))8876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f64_m)))
8821svfloat32_t svbfmlalb_lane(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);8877svfloat64_t svrint32z_f64_m(svfloat64_t, svbool_t, svfloat64_t);
8822__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_n_f32)))8878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f32_m)))
8823svfloat32_t svbfmlalt(svfloat32_t, svbfloat16_t, bfloat16_t);8879svfloat32_t svrint32z_f32_m(svfloat32_t, svbool_t, svfloat32_t);
8824__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_f32)))8880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f64_x)))
8825svfloat32_t svbfmlalt(svfloat32_t, svbfloat16_t, svbfloat16_t);8881svfloat64_t svrint32z_f64_x(svbool_t, svfloat64_t);
8826__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_lane_f32)))8882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f32_x)))
8827svfloat32_t svbfmlalt_lane(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);8883svfloat32_t svrint32z_f32_x(svbool_t, svfloat32_t);
8828__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_m)))8884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f64_z)))
8829svbfloat16_t svcvt_bf16_m(svbfloat16_t, svbool_t, svfloat32_t);8885svfloat64_t svrint32z_f64_z(svbool_t, svfloat64_t);
8830__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_x)))8886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f32_z)))
8831svbfloat16_t svcvt_bf16_x(svbool_t, svfloat32_t);8887svfloat32_t svrint32z_f32_z(svbool_t, svfloat32_t);
8832__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_z)))8888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f64_m)))
8833svbfloat16_t svcvt_bf16_z(svbool_t, svfloat32_t);8889svfloat64_t svrint64x_f64_m(svfloat64_t, svbool_t, svfloat64_t);
8834__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_bf16_f32_m)))8890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f32_m)))
8835svbfloat16_t svcvtnt_bf16_m(svbfloat16_t, svbool_t, svfloat32_t);8891svfloat32_t svrint64x_f32_m(svfloat32_t, svbool_t, svfloat32_t);
8836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32)))8892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f64_x)))
8837svfloat32_t svmmla_f32(svfloat32_t, svfloat32_t, svfloat32_t);8893svfloat64_t svrint64x_f64_x(svbool_t, svfloat64_t);
8838__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32)))8894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f32_x)))
8839svfloat32_t svmmla(svfloat32_t, svfloat32_t, svfloat32_t);8895svfloat32_t svrint64x_f32_x(svbool_t, svfloat32_t);
8840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u8)))8896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f64_z)))
8841svuint8_t svld1ro_u8(svbool_t, uint8_t const *);8897svfloat64_t svrint64x_f64_z(svbool_t, svfloat64_t);
8842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u32)))8898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f32_z)))
8843svuint32_t svld1ro_u32(svbool_t, uint32_t const *);8899svfloat32_t svrint64x_f32_z(svbool_t, svfloat32_t);
8844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u64)))8900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f64_m)))
8845svuint64_t svld1ro_u64(svbool_t, uint64_t const *);8901svfloat64_t svrint64z_f64_m(svfloat64_t, svbool_t, svfloat64_t);
8846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u16)))8902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f32_m)))
8847svuint16_t svld1ro_u16(svbool_t, uint16_t const *);8903svfloat32_t svrint64z_f32_m(svfloat32_t, svbool_t, svfloat32_t);
8848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_bf16)))8904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f64_x)))
8849svbfloat16_t svld1ro_bf16(svbool_t, bfloat16_t const *);8905svfloat64_t svrint64z_f64_x(svbool_t, svfloat64_t);
8850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s8)))8906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f32_x)))
8851svint8_t svld1ro_s8(svbool_t, int8_t const *);8907svfloat32_t svrint64z_f32_x(svbool_t, svfloat32_t);
8852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f64)))8908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f64_z)))
8853svfloat64_t svld1ro_f64(svbool_t, float64_t const *);8909svfloat64_t svrint64z_f64_z(svbool_t, svfloat64_t);
8854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f32)))8910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f32_z)))
8855svfloat32_t svld1ro_f32(svbool_t, float32_t const *);8911svfloat32_t svrint64z_f32_z(svbool_t, svfloat32_t);
8856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f16)))8912__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt_f32_f16_z)))
8857svfloat16_t svld1ro_f16(svbool_t, float16_t const *);8913svfloat32_t svcvtlt_f32_z(svbool_t, svfloat16_t);
8858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s32)))8914__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt_f64_f32_z)))
8859svint32_t svld1ro_s32(svbool_t, int32_t const *);8915svfloat64_t svcvtlt_f64_z(svbool_t, svfloat32_t);
8860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s64)))8916__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_bf16_f32_z)))
8861svint64_t svld1ro_s64(svbool_t, int64_t const *);8917svbfloat16_t svcvtnt_bf16_z(svbfloat16_t, svbool_t, svfloat32_t);
8862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_mf8)))8918__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_f16_f32_z)))
8863svmfloat8_t svld1ro_mf8(svbool_t, mfloat8_t const *);8919svfloat16_t svcvtnt_f16_z(svfloat16_t, svbool_t, svfloat32_t);
8864__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s16)))8920__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_f32_f64_z)))
8865svint16_t svld1ro_s16(svbool_t, int16_t const *);8921svfloat32_t svcvtnt_f32_z(svfloat32_t, svbool_t, svfloat64_t);
8866__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f64)))8922__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtxnt_f32_f64_z)))
8867svfloat64_t svmmla_f64(svfloat64_t, svfloat64_t, svfloat64_t);8923svfloat32_t svcvtxnt_f32_z(svfloat32_t, svbool_t, svfloat64_t);
8868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u8)))8924__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f64_m)))
8869svuint8_t svtrn1q_u8(svuint8_t, svuint8_t);8925svfloat64_t svrint32x_m(svfloat64_t, svbool_t, svfloat64_t);
8870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u32)))8926__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f32_m)))
8871svuint32_t svtrn1q_u32(svuint32_t, svuint32_t);8927svfloat32_t svrint32x_m(svfloat32_t, svbool_t, svfloat32_t);
8872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u64)))8928__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f64_x)))
8873svuint64_t svtrn1q_u64(svuint64_t, svuint64_t);8929svfloat64_t svrint32x_x(svbool_t, svfloat64_t);
8874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u16)))8930__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f32_x)))
8875svuint16_t svtrn1q_u16(svuint16_t, svuint16_t);8931svfloat32_t svrint32x_x(svbool_t, svfloat32_t);
8876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_bf16)))8932__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f64_z)))
8877svbfloat16_t svtrn1q_bf16(svbfloat16_t, svbfloat16_t);8933svfloat64_t svrint32x_z(svbool_t, svfloat64_t);
8878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s8)))8934__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32x_f32_z)))
8879svint8_t svtrn1q_s8(svint8_t, svint8_t);8935svfloat32_t svrint32x_z(svbool_t, svfloat32_t);
8880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f64)))8936__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f64_m)))
8881svfloat64_t svtrn1q_f64(svfloat64_t, svfloat64_t);8937svfloat64_t svrint32z_m(svfloat64_t, svbool_t, svfloat64_t);
8882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f32)))8938__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f32_m)))
8883svfloat32_t svtrn1q_f32(svfloat32_t, svfloat32_t);8939svfloat32_t svrint32z_m(svfloat32_t, svbool_t, svfloat32_t);
8884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f16)))8940__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f64_x)))
8885svfloat16_t svtrn1q_f16(svfloat16_t, svfloat16_t);8941svfloat64_t svrint32z_x(svbool_t, svfloat64_t);
8886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s32)))8942__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f32_x)))
8887svint32_t svtrn1q_s32(svint32_t, svint32_t);8943svfloat32_t svrint32z_x(svbool_t, svfloat32_t);
8888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s64)))8944__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f64_z)))
8889svint64_t svtrn1q_s64(svint64_t, svint64_t);8945svfloat64_t svrint32z_z(svbool_t, svfloat64_t);
8890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s16)))8946__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint32z_f32_z)))
8891svint16_t svtrn1q_s16(svint16_t, svint16_t);8947svfloat32_t svrint32z_z(svbool_t, svfloat32_t);
8892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u8)))8948__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f64_m)))
8893svuint8_t svtrn2q_u8(svuint8_t, svuint8_t);8949svfloat64_t svrint64x_m(svfloat64_t, svbool_t, svfloat64_t);
8894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u32)))8950__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f32_m)))
8895svuint32_t svtrn2q_u32(svuint32_t, svuint32_t);8951svfloat32_t svrint64x_m(svfloat32_t, svbool_t, svfloat32_t);
8896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u64)))8952__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f64_x)))
8897svuint64_t svtrn2q_u64(svuint64_t, svuint64_t);8953svfloat64_t svrint64x_x(svbool_t, svfloat64_t);
8898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u16)))8954__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f32_x)))
8899svuint16_t svtrn2q_u16(svuint16_t, svuint16_t);8955svfloat32_t svrint64x_x(svbool_t, svfloat32_t);
8900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_bf16)))8956__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f64_z)))
8901svbfloat16_t svtrn2q_bf16(svbfloat16_t, svbfloat16_t);8957svfloat64_t svrint64x_z(svbool_t, svfloat64_t);
8902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s8)))8958__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64x_f32_z)))
8903svint8_t svtrn2q_s8(svint8_t, svint8_t);8959svfloat32_t svrint64x_z(svbool_t, svfloat32_t);
8904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f64)))8960__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f64_m)))
8905svfloat64_t svtrn2q_f64(svfloat64_t, svfloat64_t);8961svfloat64_t svrint64z_m(svfloat64_t, svbool_t, svfloat64_t);
8906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f32)))8962__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f32_m)))
8907svfloat32_t svtrn2q_f32(svfloat32_t, svfloat32_t);8963svfloat32_t svrint64z_m(svfloat32_t, svbool_t, svfloat32_t);
8908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f16)))8964__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f64_x)))
8909svfloat16_t svtrn2q_f16(svfloat16_t, svfloat16_t);8965svfloat64_t svrint64z_x(svbool_t, svfloat64_t);
8910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s32)))8966__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f32_x)))
8911svint32_t svtrn2q_s32(svint32_t, svint32_t);8967svfloat32_t svrint64z_x(svbool_t, svfloat32_t);
8912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s64)))8968__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f64_z)))
8913svint64_t svtrn2q_s64(svint64_t, svint64_t);8969svfloat64_t svrint64z_z(svbool_t, svfloat64_t);
8914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s16)))8970__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrint64z_f32_z)))
8915svint16_t svtrn2q_s16(svint16_t, svint16_t);8971svfloat32_t svrint64z_z(svbool_t, svfloat32_t);
8916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u8)))8972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u8)))
8917svuint8_t svuzp1q_u8(svuint8_t, svuint8_t);8973svuint8_t svcompact_u8(svbool_t, svuint8_t);
8918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u32)))8974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u16)))
8919svuint32_t svuzp1q_u32(svuint32_t, svuint32_t);8975svuint16_t svcompact_u16(svbool_t, svuint16_t);
8920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u64)))8976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_bf16)))
8921svuint64_t svuzp1q_u64(svuint64_t, svuint64_t);8977svbfloat16_t svcompact_bf16(svbool_t, svbfloat16_t);
8922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u16)))8978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s8)))
8923svuint16_t svuzp1q_u16(svuint16_t, svuint16_t);8979svint8_t svcompact_s8(svbool_t, svint8_t);
8924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_bf16)))8980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f16)))
8925svbfloat16_t svuzp1q_bf16(svbfloat16_t, svbfloat16_t);8981svfloat16_t svcompact_f16(svbool_t, svfloat16_t);
8926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s8)))8982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_mf8)))
8927svint8_t svuzp1q_s8(svint8_t, svint8_t);8983svmfloat8_t svcompact_mf8(svbool_t, svmfloat8_t);
8928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f64)))8984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s16)))
8929svfloat64_t svuzp1q_f64(svfloat64_t, svfloat64_t);8985svint16_t svcompact_s16(svbool_t, svint16_t);
8930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f32)))8986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u8)))
8931svfloat32_t svuzp1q_f32(svfloat32_t, svfloat32_t);8987svuint8_t svexpand_u8(svbool_t, svuint8_t);
8932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f16)))8988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u32)))
8933svfloat16_t svuzp1q_f16(svfloat16_t, svfloat16_t);8989svuint32_t svexpand_u32(svbool_t, svuint32_t);
8934__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s32)))8990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u64)))
8935svint32_t svuzp1q_s32(svint32_t, svint32_t);8991svuint64_t svexpand_u64(svbool_t, svuint64_t);
8936__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s64)))8992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u16)))
8937svint64_t svuzp1q_s64(svint64_t, svint64_t);8993svuint16_t svexpand_u16(svbool_t, svuint16_t);
8938__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s16)))8994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_bf16)))
8939svint16_t svuzp1q_s16(svint16_t, svint16_t);8995svbfloat16_t svexpand_bf16(svbool_t, svbfloat16_t);
8940__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u8)))8996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s8)))
8941svuint8_t svuzp2q_u8(svuint8_t, svuint8_t);8997svint8_t svexpand_s8(svbool_t, svint8_t);
8942__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u32)))8998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_f64)))
8943svuint32_t svuzp2q_u32(svuint32_t, svuint32_t);8999svfloat64_t svexpand_f64(svbool_t, svfloat64_t);
8944__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u64)))9000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_f32)))
8945svuint64_t svuzp2q_u64(svuint64_t, svuint64_t);9001svfloat32_t svexpand_f32(svbool_t, svfloat32_t);
8946__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u16)))9002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_f16)))
8947svuint16_t svuzp2q_u16(svuint16_t, svuint16_t);9003svfloat16_t svexpand_f16(svbool_t, svfloat16_t);
8948__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_bf16)))9004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s32)))
8949svbfloat16_t svuzp2q_bf16(svbfloat16_t, svbfloat16_t);9005svint32_t svexpand_s32(svbool_t, svint32_t);
8950__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s8)))9006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s64)))
8951svint8_t svuzp2q_s8(svint8_t, svint8_t);9007svint64_t svexpand_s64(svbool_t, svint64_t);
8952__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f64)))9008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_mf8)))
8953svfloat64_t svuzp2q_f64(svfloat64_t, svfloat64_t);9009svmfloat8_t svexpand_mf8(svbool_t, svmfloat8_t);
8954__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f32)))9010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s16)))
8955svfloat32_t svuzp2q_f32(svfloat32_t, svfloat32_t);9011svint16_t svexpand_s16(svbool_t, svint16_t);
8956__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f16)))9012__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u8)))
8957svfloat16_t svuzp2q_f16(svfloat16_t, svfloat16_t);9013svuint8_t svcompact(svbool_t, svuint8_t);
8958__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s32)))9014__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u16)))
8959svint32_t svuzp2q_s32(svint32_t, svint32_t);9015svuint16_t svcompact(svbool_t, svuint16_t);
8960__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s64)))9016__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_bf16)))
8961svint64_t svuzp2q_s64(svint64_t, svint64_t);9017svbfloat16_t svcompact(svbool_t, svbfloat16_t);
8962__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s16)))9018__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s8)))
8963svint16_t svuzp2q_s16(svint16_t, svint16_t);9019svint8_t svcompact(svbool_t, svint8_t);
8964__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u8)))9020__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f16)))
8965svuint8_t svzip1q_u8(svuint8_t, svuint8_t);9021svfloat16_t svcompact(svbool_t, svfloat16_t);
8966__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u32)))9022__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_mf8)))
8967svuint32_t svzip1q_u32(svuint32_t, svuint32_t);9023svmfloat8_t svcompact(svbool_t, svmfloat8_t);
8968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u64)))9024__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s16)))
8969svuint64_t svzip1q_u64(svuint64_t, svuint64_t);9025svint16_t svcompact(svbool_t, svint16_t);
8970__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u16)))9026__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u8)))
8971svuint16_t svzip1q_u16(svuint16_t, svuint16_t);9027svuint8_t svexpand(svbool_t, svuint8_t);
8972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_bf16)))9028__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u32)))
8973svbfloat16_t svzip1q_bf16(svbfloat16_t, svbfloat16_t);9029svuint32_t svexpand(svbool_t, svuint32_t);
8974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s8)))9030__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u64)))
8975svint8_t svzip1q_s8(svint8_t, svint8_t);9031svuint64_t svexpand(svbool_t, svuint64_t);
8976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f64)))9032__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_u16)))
8977svfloat64_t svzip1q_f64(svfloat64_t, svfloat64_t);9033svuint16_t svexpand(svbool_t, svuint16_t);
8978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f32)))9034__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_bf16)))
8979svfloat32_t svzip1q_f32(svfloat32_t, svfloat32_t);9035svbfloat16_t svexpand(svbool_t, svbfloat16_t);
8980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f16)))9036__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s8)))
8981svfloat16_t svzip1q_f16(svfloat16_t, svfloat16_t);9037svint8_t svexpand(svbool_t, svint8_t);
8982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s32)))9038__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_f64)))
8983svint32_t svzip1q_s32(svint32_t, svint32_t);9039svfloat64_t svexpand(svbool_t, svfloat64_t);
8984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s64)))9040__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_f32)))
8985svint64_t svzip1q_s64(svint64_t, svint64_t);9041svfloat32_t svexpand(svbool_t, svfloat32_t);
8986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s16)))9042__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_f16)))
8987svint16_t svzip1q_s16(svint16_t, svint16_t);9043svfloat16_t svexpand(svbool_t, svfloat16_t);
8988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u8)))9044__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s32)))
8989svuint8_t svzip2q_u8(svuint8_t, svuint8_t);9045svint32_t svexpand(svbool_t, svint32_t);
8990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u32)))9046__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s64)))
8991svuint32_t svzip2q_u32(svuint32_t, svuint32_t);9047svint64_t svexpand(svbool_t, svint64_t);
8992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u64)))9048__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_mf8)))
8993svuint64_t svzip2q_u64(svuint64_t, svuint64_t);9049svmfloat8_t svexpand(svbool_t, svmfloat8_t);
8994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u16)))9050__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s16)))
8995svuint16_t svzip2q_u16(svuint16_t, svuint16_t);9051svint16_t svexpand(svbool_t, svint16_t);
8996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_bf16)))
8997svbfloat16_t svzip2q_bf16(svbfloat16_t, svbfloat16_t);
8998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s8)))
8999svint8_t svzip2q_s8(svint8_t, svint8_t);
9000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f64)))
9001svfloat64_t svzip2q_f64(svfloat64_t, svfloat64_t);
9002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f32)))
9003svfloat32_t svzip2q_f32(svfloat32_t, svfloat32_t);
9004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f16)))
9005svfloat16_t svzip2q_f16(svfloat16_t, svfloat16_t);
9006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s32)))
9007svint32_t svzip2q_s32(svint32_t, svint32_t);
9008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s64)))
9009svint64_t svzip2q_s64(svint64_t, svint64_t);
9010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s16)))
9011svint16_t svzip2q_s16(svint16_t, svint16_t);
9012__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u8)))
9013svuint8_t svld1ro(svbool_t, uint8_t const *);
9014__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u32)))
9015svuint32_t svld1ro(svbool_t, uint32_t const *);
9016__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u64)))
9017svuint64_t svld1ro(svbool_t, uint64_t const *);
9018__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u16)))
9019svuint16_t svld1ro(svbool_t, uint16_t const *);
9020__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_bf16)))
9021svbfloat16_t svld1ro(svbool_t, bfloat16_t const *);
9022__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s8)))
9023svint8_t svld1ro(svbool_t, int8_t const *);
9024__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f64)))
9025svfloat64_t svld1ro(svbool_t, float64_t const *);
9026__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f32)))
9027svfloat32_t svld1ro(svbool_t, float32_t const *);
9028__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f16)))
9029svfloat16_t svld1ro(svbool_t, float16_t const *);
9030__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s32)))
9031svint32_t svld1ro(svbool_t, int32_t const *);
9032__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s64)))
9033svint64_t svld1ro(svbool_t, int64_t const *);
9034__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_mf8)))
9035svmfloat8_t svld1ro(svbool_t, mfloat8_t const *);
9036__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s16)))
9037svint16_t svld1ro(svbool_t, int16_t const *);
9038__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f64)))
9039svfloat64_t svmmla(svfloat64_t, svfloat64_t, svfloat64_t);
9040__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u8)))
9041svuint8_t svtrn1q(svuint8_t, svuint8_t);
9042__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u32)))
9043svuint32_t svtrn1q(svuint32_t, svuint32_t);
9044__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u64)))
9045svuint64_t svtrn1q(svuint64_t, svuint64_t);
9046__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u16)))
9047svuint16_t svtrn1q(svuint16_t, svuint16_t);
9048__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_bf16)))
9049svbfloat16_t svtrn1q(svbfloat16_t, svbfloat16_t);
9050__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s8)))
9051svint8_t svtrn1q(svint8_t, svint8_t);
9052__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f64)))
9053svfloat64_t svtrn1q(svfloat64_t, svfloat64_t);
9054__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f32)))
9055svfloat32_t svtrn1q(svfloat32_t, svfloat32_t);
9056__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f16)))
9057svfloat16_t svtrn1q(svfloat16_t, svfloat16_t);
9058__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s32)))
9059svint32_t svtrn1q(svint32_t, svint32_t);
9060__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s64)))
9061svint64_t svtrn1q(svint64_t, svint64_t);
9062__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s16)))
9063svint16_t svtrn1q(svint16_t, svint16_t);
9064__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u8)))
9065svuint8_t svtrn2q(svuint8_t, svuint8_t);
9066__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u32)))
9067svuint32_t svtrn2q(svuint32_t, svuint32_t);
9068__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u64)))
9069svuint64_t svtrn2q(svuint64_t, svuint64_t);
9070__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u16)))
9071svuint16_t svtrn2q(svuint16_t, svuint16_t);
9072__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_bf16)))
9073svbfloat16_t svtrn2q(svbfloat16_t, svbfloat16_t);
9074__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s8)))
9075svint8_t svtrn2q(svint8_t, svint8_t);
9076__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f64)))
9077svfloat64_t svtrn2q(svfloat64_t, svfloat64_t);
9078__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f32)))
9079svfloat32_t svtrn2q(svfloat32_t, svfloat32_t);
9080__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f16)))
9081svfloat16_t svtrn2q(svfloat16_t, svfloat16_t);
9082__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s32)))
9083svint32_t svtrn2q(svint32_t, svint32_t);
9084__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s64)))
9085svint64_t svtrn2q(svint64_t, svint64_t);
9086__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s16)))
9087svint16_t svtrn2q(svint16_t, svint16_t);
9088__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u8)))
9089svuint8_t svuzp1q(svuint8_t, svuint8_t);
9090__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u32)))
9091svuint32_t svuzp1q(svuint32_t, svuint32_t);
9092__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u64)))
9093svuint64_t svuzp1q(svuint64_t, svuint64_t);
9094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u16)))
9095svuint16_t svuzp1q(svuint16_t, svuint16_t);
9096__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_bf16)))
9097svbfloat16_t svuzp1q(svbfloat16_t, svbfloat16_t);
9098__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s8)))
9099svint8_t svuzp1q(svint8_t, svint8_t);
9100__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f64)))
9101svfloat64_t svuzp1q(svfloat64_t, svfloat64_t);
9102__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f32)))
9103svfloat32_t svuzp1q(svfloat32_t, svfloat32_t);
9104__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f16)))
9105svfloat16_t svuzp1q(svfloat16_t, svfloat16_t);
9106__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s32)))
9107svint32_t svuzp1q(svint32_t, svint32_t);
9108__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s64)))
9109svint64_t svuzp1q(svint64_t, svint64_t);
9110__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s16)))
9111svint16_t svuzp1q(svint16_t, svint16_t);
9112__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u8)))
9113svuint8_t svuzp2q(svuint8_t, svuint8_t);
9114__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u32)))
9115svuint32_t svuzp2q(svuint32_t, svuint32_t);
9116__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u64)))
9117svuint64_t svuzp2q(svuint64_t, svuint64_t);
9118__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u16)))
9119svuint16_t svuzp2q(svuint16_t, svuint16_t);
9120__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_bf16)))
9121svbfloat16_t svuzp2q(svbfloat16_t, svbfloat16_t);
9122__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s8)))
9123svint8_t svuzp2q(svint8_t, svint8_t);
9124__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f64)))
9125svfloat64_t svuzp2q(svfloat64_t, svfloat64_t);
9126__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f32)))
9127svfloat32_t svuzp2q(svfloat32_t, svfloat32_t);
9128__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f16)))
9129svfloat16_t svuzp2q(svfloat16_t, svfloat16_t);
9130__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s32)))
9131svint32_t svuzp2q(svint32_t, svint32_t);
9132__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s64)))
9133svint64_t svuzp2q(svint64_t, svint64_t);
9134__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s16)))
9135svint16_t svuzp2q(svint16_t, svint16_t);
9136__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u8)))
9137svuint8_t svzip1q(svuint8_t, svuint8_t);
9138__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u32)))
9139svuint32_t svzip1q(svuint32_t, svuint32_t);
9140__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u64)))
9141svuint64_t svzip1q(svuint64_t, svuint64_t);
9142__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u16)))
9143svuint16_t svzip1q(svuint16_t, svuint16_t);
9144__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_bf16)))
9145svbfloat16_t svzip1q(svbfloat16_t, svbfloat16_t);
9146__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s8)))
9147svint8_t svzip1q(svint8_t, svint8_t);
9148__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f64)))
9149svfloat64_t svzip1q(svfloat64_t, svfloat64_t);
9150__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f32)))
9151svfloat32_t svzip1q(svfloat32_t, svfloat32_t);
9152__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f16)))
9153svfloat16_t svzip1q(svfloat16_t, svfloat16_t);
9154__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s32)))
9155svint32_t svzip1q(svint32_t, svint32_t);
9156__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s64)))
9157svint64_t svzip1q(svint64_t, svint64_t);
9158__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s16)))
9159svint16_t svzip1q(svint16_t, svint16_t);
9160__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u8)))
9161svuint8_t svzip2q(svuint8_t, svuint8_t);
9162__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u32)))
9163svuint32_t svzip2q(svuint32_t, svuint32_t);
9164__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u64)))
9165svuint64_t svzip2q(svuint64_t, svuint64_t);
9166__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u16)))
9167svuint16_t svzip2q(svuint16_t, svuint16_t);
9168__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_bf16)))
9169svbfloat16_t svzip2q(svbfloat16_t, svbfloat16_t);
9170__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s8)))
9171svint8_t svzip2q(svint8_t, svint8_t);
9172__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f64)))
9173svfloat64_t svzip2q(svfloat64_t, svfloat64_t);
9174__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f32)))
9175svfloat32_t svzip2q(svfloat32_t, svfloat32_t);
9176__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f16)))
9177svfloat16_t svzip2q(svfloat16_t, svfloat16_t);
9178__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s32)))
9179svint32_t svzip2q(svint32_t, svint32_t);
9180__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s64)))
9181svint64_t svzip2q(svint64_t, svint64_t);
9182__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s16)))
9183svint16_t svzip2q(svint16_t, svint16_t);
9184__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_s32)))
9185svint32_t svmmla_s32(svint32_t, svint8_t, svint8_t);
9186__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_u32)))
9187svuint32_t svmmla_u32(svuint32_t, svuint8_t, svuint8_t);
9188__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusmmla_s32)))
9189svint32_t svusmmla_s32(svint32_t, svuint8_t, svint8_t);
9190__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_s32)))
9191svint32_t svmmla(svint32_t, svint8_t, svint8_t);
9192__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_u32)))
9193svuint32_t svmmla(svuint32_t, svuint8_t, svuint8_t);
9194__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusmmla_s32)))
9195svint32_t svusmmla(svint32_t, svuint8_t, svint8_t);
9196__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_n_s32)))
9197svint32_t svsudot_n_s32(svint32_t, svint8_t, uint8_t);
9198__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_s32)))
9199svint32_t svsudot_s32(svint32_t, svint8_t, svuint8_t);
9200__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_lane_s32)))
9201svint32_t svsudot_lane_s32(svint32_t, svint8_t, svuint8_t, uint64_t);
9202__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_n_s32)))
9203svint32_t svusdot_n_s32(svint32_t, svuint8_t, int8_t);
9204__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_s32)))
9205svint32_t svusdot_s32(svint32_t, svuint8_t, svint8_t);
9206__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_lane_s32)))
9207svint32_t svusdot_lane_s32(svint32_t, svuint8_t, svint8_t, uint64_t);
9208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_n_s32)))
9209svint32_t svsudot(svint32_t, svint8_t, uint8_t);
9210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_s32)))
9211svint32_t svsudot(svint32_t, svint8_t, svuint8_t);
9212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_lane_s32)))
9213svint32_t svsudot_lane(svint32_t, svint8_t, svuint8_t, uint64_t);
9214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_n_s32)))
9215svint32_t svusdot(svint32_t, svuint8_t, int8_t);
9216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_s32)))
9217svint32_t svusdot(svint32_t, svuint8_t, svint8_t);
9218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_lane_s32)))
9219svint32_t svusdot_lane(svint32_t, svuint8_t, svint8_t, uint64_t);
9220__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_u64)))
9221svuint64_t svrax1_u64(svuint64_t, svuint64_t);
9222__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_s64)))
9223svint64_t svrax1_s64(svint64_t, svint64_t);
9224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_u64)))
9225svuint64_t svrax1(svuint64_t, svuint64_t);
9226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_s64)))
9227svint64_t svrax1(svint64_t, svint64_t);
9228__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u32_z)))
9229svuint32_t svhistcnt_u32_z(svbool_t, svuint32_t, svuint32_t);
9230__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u64_z)))
9231svuint64_t svhistcnt_u64_z(svbool_t, svuint64_t, svuint64_t);
9232__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s32_z)))
9233svuint32_t svhistcnt_s32_z(svbool_t, svint32_t, svint32_t);
9234__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s64_z)))
9235svuint64_t svhistcnt_s64_z(svbool_t, svint64_t, svint64_t);
9236__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_u8)))
9237svuint8_t svhistseg_u8(svuint8_t, svuint8_t);
9238__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_s8)))
9239svuint8_t svhistseg_s8(svint8_t, svint8_t);
9240__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_u32)))
9241svuint32_t svldnt1_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
9242__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_u64)))
9243svuint64_t svldnt1_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
9244__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_f64)))
9245svfloat64_t svldnt1_gather_u64base_index_f64(svbool_t, svuint64_t, int64_t);
9246__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_f32)))
9247svfloat32_t svldnt1_gather_u32base_index_f32(svbool_t, svuint32_t, int64_t);
9248__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_s32)))
9249svint32_t svldnt1_gather_u32base_index_s32(svbool_t, svuint32_t, int64_t);
9250__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_s64)))
9251svint64_t svldnt1_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
9252__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_u32)))
9253svuint32_t svldnt1_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
9254__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_u64)))
9255svuint64_t svldnt1_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9256__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_f64)))
9257svfloat64_t svldnt1_gather_u64base_offset_f64(svbool_t, svuint64_t, int64_t);
9258__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_f32)))
9259svfloat32_t svldnt1_gather_u32base_offset_f32(svbool_t, svuint32_t, int64_t);
9260__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_s32)))
9261svint32_t svldnt1_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
9262__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_s64)))
9263svint64_t svldnt1_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9264__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_u32)))
9265svuint32_t svldnt1_gather_u32base_u32(svbool_t, svuint32_t);
9266__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_u64)))
9267svuint64_t svldnt1_gather_u64base_u64(svbool_t, svuint64_t);
9268__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_f64)))
9269svfloat64_t svldnt1_gather_u64base_f64(svbool_t, svuint64_t);
9270__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_f32)))
9271svfloat32_t svldnt1_gather_u32base_f32(svbool_t, svuint32_t);
9272__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_s32)))
9273svint32_t svldnt1_gather_u32base_s32(svbool_t, svuint32_t);
9274__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_s64)))
9275svint64_t svldnt1_gather_u64base_s64(svbool_t, svuint64_t);
9276__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_u64)))
9277svuint64_t svldnt1_gather_s64index_u64(svbool_t, uint64_t const *, svint64_t);
9278__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_f64)))
9279svfloat64_t svldnt1_gather_s64index_f64(svbool_t, float64_t const *, svint64_t);
9280__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_s64)))
9281svint64_t svldnt1_gather_s64index_s64(svbool_t, int64_t const *, svint64_t);
9282__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_u64)))
9283svuint64_t svldnt1_gather_u64index_u64(svbool_t, uint64_t const *, svuint64_t);
9284__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_f64)))
9285svfloat64_t svldnt1_gather_u64index_f64(svbool_t, float64_t const *, svuint64_t);
9286__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_s64)))
9287svint64_t svldnt1_gather_u64index_s64(svbool_t, int64_t const *, svuint64_t);
9288__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_u32)))
9289svuint32_t svldnt1_gather_u32offset_u32(svbool_t, uint32_t const *, svuint32_t);
9290__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_f32)))
9291svfloat32_t svldnt1_gather_u32offset_f32(svbool_t, float32_t const *, svuint32_t);
9292__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_s32)))
9293svint32_t svldnt1_gather_u32offset_s32(svbool_t, int32_t const *, svuint32_t);
9294__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_u64)))
9295svuint64_t svldnt1_gather_s64offset_u64(svbool_t, uint64_t const *, svint64_t);
9296__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_f64)))
9297svfloat64_t svldnt1_gather_s64offset_f64(svbool_t, float64_t const *, svint64_t);
9298__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_s64)))
9299svint64_t svldnt1_gather_s64offset_s64(svbool_t, int64_t const *, svint64_t);
9300__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_u64)))
9301svuint64_t svldnt1_gather_u64offset_u64(svbool_t, uint64_t const *, svuint64_t);
9302__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_f64)))
9303svfloat64_t svldnt1_gather_u64offset_f64(svbool_t, float64_t const *, svuint64_t);
9304__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_s64)))
9305svint64_t svldnt1_gather_u64offset_s64(svbool_t, int64_t const *, svuint64_t);
9306__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_u32)))
9307svuint32_t svldnt1sb_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
9308__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_u64)))
9309svuint64_t svldnt1sb_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9310__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_s32)))
9311svint32_t svldnt1sb_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
9312__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_s64)))
9313svint64_t svldnt1sb_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9314__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_u32)))
9315svuint32_t svldnt1sb_gather_u32base_u32(svbool_t, svuint32_t);
9316__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_u64)))
9317svuint64_t svldnt1sb_gather_u64base_u64(svbool_t, svuint64_t);
9318__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_s32)))
9319svint32_t svldnt1sb_gather_u32base_s32(svbool_t, svuint32_t);
9320__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_s64)))
9321svint64_t svldnt1sb_gather_u64base_s64(svbool_t, svuint64_t);
9322__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_u32)))
9323svuint32_t svldnt1sb_gather_u32offset_u32(svbool_t, int8_t const *, svuint32_t);
9324__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_s32)))
9325svint32_t svldnt1sb_gather_u32offset_s32(svbool_t, int8_t const *, svuint32_t);
9326__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_u64)))
9327svuint64_t svldnt1sb_gather_s64offset_u64(svbool_t, int8_t const *, svint64_t);
9328__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_s64)))
9329svint64_t svldnt1sb_gather_s64offset_s64(svbool_t, int8_t const *, svint64_t);
9330__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_u64)))
9331svuint64_t svldnt1sb_gather_u64offset_u64(svbool_t, int8_t const *, svuint64_t);
9332__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_s64)))
9333svint64_t svldnt1sb_gather_u64offset_s64(svbool_t, int8_t const *, svuint64_t);
9334__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_u32)))
9335svuint32_t svldnt1sh_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
9336__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_u64)))
9337svuint64_t svldnt1sh_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
9338__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_s32)))
9339svint32_t svldnt1sh_gather_u32base_index_s32(svbool_t, svuint32_t, int64_t);
9340__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_s64)))
9341svint64_t svldnt1sh_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
9342__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_u32)))
9343svuint32_t svldnt1sh_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
9344__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_u64)))
9345svuint64_t svldnt1sh_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9346__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_s32)))
9347svint32_t svldnt1sh_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
9348__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_s64)))
9349svint64_t svldnt1sh_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9350__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_u32)))
9351svuint32_t svldnt1sh_gather_u32base_u32(svbool_t, svuint32_t);
9352__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_u64)))
9353svuint64_t svldnt1sh_gather_u64base_u64(svbool_t, svuint64_t);
9354__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_s32)))
9355svint32_t svldnt1sh_gather_u32base_s32(svbool_t, svuint32_t);
9356__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_s64)))
9357svint64_t svldnt1sh_gather_u64base_s64(svbool_t, svuint64_t);
9358__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_u64)))
9359svuint64_t svldnt1sh_gather_s64index_u64(svbool_t, int16_t const *, svint64_t);
9360__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_s64)))
9361svint64_t svldnt1sh_gather_s64index_s64(svbool_t, int16_t const *, svint64_t);
9362__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_u64)))
9363svuint64_t svldnt1sh_gather_u64index_u64(svbool_t, int16_t const *, svuint64_t);
9364__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_s64)))
9365svint64_t svldnt1sh_gather_u64index_s64(svbool_t, int16_t const *, svuint64_t);
9366__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_u32)))
9367svuint32_t svldnt1sh_gather_u32offset_u32(svbool_t, int16_t const *, svuint32_t);
9368__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_s32)))
9369svint32_t svldnt1sh_gather_u32offset_s32(svbool_t, int16_t const *, svuint32_t);
9370__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_u64)))
9371svuint64_t svldnt1sh_gather_s64offset_u64(svbool_t, int16_t const *, svint64_t);
9372__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_s64)))
9373svint64_t svldnt1sh_gather_s64offset_s64(svbool_t, int16_t const *, svint64_t);
9374__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_u64)))
9375svuint64_t svldnt1sh_gather_u64offset_u64(svbool_t, int16_t const *, svuint64_t);
9376__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_s64)))
9377svint64_t svldnt1sh_gather_u64offset_s64(svbool_t, int16_t const *, svuint64_t);
9378__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_u64)))
9379svuint64_t svldnt1sw_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
9380__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_s64)))
9381svint64_t svldnt1sw_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
9382__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_u64)))
9383svuint64_t svldnt1sw_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9384__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_s64)))
9385svint64_t svldnt1sw_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9386__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_u64)))
9387svuint64_t svldnt1sw_gather_u64base_u64(svbool_t, svuint64_t);
9388__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_s64)))
9389svint64_t svldnt1sw_gather_u64base_s64(svbool_t, svuint64_t);
9390__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_u64)))
9391svuint64_t svldnt1sw_gather_s64index_u64(svbool_t, int32_t const *, svint64_t);
9392__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_s64)))
9393svint64_t svldnt1sw_gather_s64index_s64(svbool_t, int32_t const *, svint64_t);
9394__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_u64)))
9395svuint64_t svldnt1sw_gather_u64index_u64(svbool_t, int32_t const *, svuint64_t);
9396__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_s64)))
9397svint64_t svldnt1sw_gather_u64index_s64(svbool_t, int32_t const *, svuint64_t);
9398__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_u64)))
9399svuint64_t svldnt1sw_gather_s64offset_u64(svbool_t, int32_t const *, svint64_t);
9400__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_s64)))
9401svint64_t svldnt1sw_gather_s64offset_s64(svbool_t, int32_t const *, svint64_t);
9402__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_u64)))
9403svuint64_t svldnt1sw_gather_u64offset_u64(svbool_t, int32_t const *, svuint64_t);
9404__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_s64)))
9405svint64_t svldnt1sw_gather_u64offset_s64(svbool_t, int32_t const *, svuint64_t);
9406__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_u32)))
9407svuint32_t svldnt1ub_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
9408__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_u64)))
9409svuint64_t svldnt1ub_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9410__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_s32)))
9411svint32_t svldnt1ub_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
9412__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_s64)))
9413svint64_t svldnt1ub_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9414__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_u32)))
9415svuint32_t svldnt1ub_gather_u32base_u32(svbool_t, svuint32_t);
9416__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_u64)))
9417svuint64_t svldnt1ub_gather_u64base_u64(svbool_t, svuint64_t);
9418__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_s32)))
9419svint32_t svldnt1ub_gather_u32base_s32(svbool_t, svuint32_t);
9420__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_s64)))
9421svint64_t svldnt1ub_gather_u64base_s64(svbool_t, svuint64_t);
9422__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_u32)))
9423svuint32_t svldnt1ub_gather_u32offset_u32(svbool_t, uint8_t const *, svuint32_t);
9424__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_s32)))
9425svint32_t svldnt1ub_gather_u32offset_s32(svbool_t, uint8_t const *, svuint32_t);
9426__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_u64)))
9427svuint64_t svldnt1ub_gather_s64offset_u64(svbool_t, uint8_t const *, svint64_t);
9428__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_s64)))
9429svint64_t svldnt1ub_gather_s64offset_s64(svbool_t, uint8_t const *, svint64_t);
9430__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_u64)))
9431svuint64_t svldnt1ub_gather_u64offset_u64(svbool_t, uint8_t const *, svuint64_t);
9432__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_s64)))
9433svint64_t svldnt1ub_gather_u64offset_s64(svbool_t, uint8_t const *, svuint64_t);
9434__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_u32)))
9435svuint32_t svldnt1uh_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
9436__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_u64)))
9437svuint64_t svldnt1uh_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
9438__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_s32)))
9439svint32_t svldnt1uh_gather_u32base_index_s32(svbool_t, svuint32_t, int64_t);
9440__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_s64)))
9441svint64_t svldnt1uh_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
9442__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_u32)))
9443svuint32_t svldnt1uh_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
9444__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_u64)))
9445svuint64_t svldnt1uh_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9446__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_s32)))
9447svint32_t svldnt1uh_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
9448__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_s64)))
9449svint64_t svldnt1uh_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9450__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_u32)))
9451svuint32_t svldnt1uh_gather_u32base_u32(svbool_t, svuint32_t);
9452__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_u64)))
9453svuint64_t svldnt1uh_gather_u64base_u64(svbool_t, svuint64_t);
9454__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_s32)))
9455svint32_t svldnt1uh_gather_u32base_s32(svbool_t, svuint32_t);
9456__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_s64)))
9457svint64_t svldnt1uh_gather_u64base_s64(svbool_t, svuint64_t);
9458__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_u64)))
9459svuint64_t svldnt1uh_gather_s64index_u64(svbool_t, uint16_t const *, svint64_t);
9460__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_s64)))
9461svint64_t svldnt1uh_gather_s64index_s64(svbool_t, uint16_t const *, svint64_t);
9462__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_u64)))
9463svuint64_t svldnt1uh_gather_u64index_u64(svbool_t, uint16_t const *, svuint64_t);
9464__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_s64)))
9465svint64_t svldnt1uh_gather_u64index_s64(svbool_t, uint16_t const *, svuint64_t);
9466__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_u32)))
9467svuint32_t svldnt1uh_gather_u32offset_u32(svbool_t, uint16_t const *, svuint32_t);
9468__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_s32)))
9469svint32_t svldnt1uh_gather_u32offset_s32(svbool_t, uint16_t const *, svuint32_t);
9470__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_u64)))
9471svuint64_t svldnt1uh_gather_s64offset_u64(svbool_t, uint16_t const *, svint64_t);
9472__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_s64)))
9473svint64_t svldnt1uh_gather_s64offset_s64(svbool_t, uint16_t const *, svint64_t);
9474__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_u64)))
9475svuint64_t svldnt1uh_gather_u64offset_u64(svbool_t, uint16_t const *, svuint64_t);
9476__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_s64)))
9477svint64_t svldnt1uh_gather_u64offset_s64(svbool_t, uint16_t const *, svuint64_t);
9478__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_u64)))
9479svuint64_t svldnt1uw_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
9480__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_s64)))
9481svint64_t svldnt1uw_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
9482__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_u64)))
9483svuint64_t svldnt1uw_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
9484__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_s64)))
9485svint64_t svldnt1uw_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
9486__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_u64)))
9487svuint64_t svldnt1uw_gather_u64base_u64(svbool_t, svuint64_t);
9488__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_s64)))
9489svint64_t svldnt1uw_gather_u64base_s64(svbool_t, svuint64_t);
9490__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_u64)))
9491svuint64_t svldnt1uw_gather_s64index_u64(svbool_t, uint32_t const *, svint64_t);
9492__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_s64)))
9493svint64_t svldnt1uw_gather_s64index_s64(svbool_t, uint32_t const *, svint64_t);
9494__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_u64)))
9495svuint64_t svldnt1uw_gather_u64index_u64(svbool_t, uint32_t const *, svuint64_t);
9496__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_s64)))
9497svint64_t svldnt1uw_gather_u64index_s64(svbool_t, uint32_t const *, svuint64_t);
9498__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_u64)))
9499svuint64_t svldnt1uw_gather_s64offset_u64(svbool_t, uint32_t const *, svint64_t);
9500__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_s64)))
9501svint64_t svldnt1uw_gather_s64offset_s64(svbool_t, uint32_t const *, svint64_t);
9502__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_u64)))
9503svuint64_t svldnt1uw_gather_u64offset_u64(svbool_t, uint32_t const *, svuint64_t);
9504__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_s64)))
9505svint64_t svldnt1uw_gather_u64offset_s64(svbool_t, uint32_t const *, svuint64_t);
9506__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u8)))
9507svbool_t svmatch_u8(svbool_t, svuint8_t, svuint8_t);
9508__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u16)))
9509svbool_t svmatch_u16(svbool_t, svuint16_t, svuint16_t);
9510__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s8)))
9511svbool_t svmatch_s8(svbool_t, svint8_t, svint8_t);
9512__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s16)))
9513svbool_t svmatch_s16(svbool_t, svint16_t, svint16_t);
9514__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u8)))
9515svbool_t svnmatch_u8(svbool_t, svuint8_t, svuint8_t);
9516__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u16)))
9517svbool_t svnmatch_u16(svbool_t, svuint16_t, svuint16_t);
9518__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s8)))
9519svbool_t svnmatch_s8(svbool_t, svint8_t, svint8_t);
9520__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s16)))
9521svbool_t svnmatch_s16(svbool_t, svint16_t, svint16_t);
9522__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_u32)))
9523void svstnt1_scatter_u32base_index_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
9524__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_u64)))
9525void svstnt1_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9526__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_f64)))
9527void svstnt1_scatter_u64base_index_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
9528__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_f32)))
9529void svstnt1_scatter_u32base_index_f32(svbool_t, svuint32_t, int64_t, svfloat32_t);
9530__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_s32)))
9531void svstnt1_scatter_u32base_index_s32(svbool_t, svuint32_t, int64_t, svint32_t);
9532__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_s64)))
9533void svstnt1_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9534__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_u32)))
9535void svstnt1_scatter_u32base_offset_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
9536__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_u64)))
9537void svstnt1_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9538__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_f64)))
9539void svstnt1_scatter_u64base_offset_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
9540__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_f32)))
9541void svstnt1_scatter_u32base_offset_f32(svbool_t, svuint32_t, int64_t, svfloat32_t);
9542__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_s32)))
9543void svstnt1_scatter_u32base_offset_s32(svbool_t, svuint32_t, int64_t, svint32_t);
9544__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_s64)))
9545void svstnt1_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9546__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_u32)))
9547void svstnt1_scatter_u32base_u32(svbool_t, svuint32_t, svuint32_t);
9548__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_u64)))
9549void svstnt1_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
9550__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_f64)))
9551void svstnt1_scatter_u64base_f64(svbool_t, svuint64_t, svfloat64_t);
9552__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_f32)))
9553void svstnt1_scatter_u32base_f32(svbool_t, svuint32_t, svfloat32_t);
9554__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_s32)))
9555void svstnt1_scatter_u32base_s32(svbool_t, svuint32_t, svint32_t);
9556__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_s64)))
9557void svstnt1_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
9558__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_u64)))
9559void svstnt1_scatter_s64index_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
9560__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_f64)))
9561void svstnt1_scatter_s64index_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
9562__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_s64)))
9563void svstnt1_scatter_s64index_s64(svbool_t, int64_t *, svint64_t, svint64_t);
9564__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_u64)))
9565void svstnt1_scatter_u64index_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
9566__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_f64)))
9567void svstnt1_scatter_u64index_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
9568__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_s64)))
9569void svstnt1_scatter_u64index_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
9570__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_u32)))
9571void svstnt1_scatter_u32offset_u32(svbool_t, uint32_t *, svuint32_t, svuint32_t);
9572__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_f32)))
9573void svstnt1_scatter_u32offset_f32(svbool_t, float32_t *, svuint32_t, svfloat32_t);
9574__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_s32)))
9575void svstnt1_scatter_u32offset_s32(svbool_t, int32_t *, svuint32_t, svint32_t);
9576__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_u64)))
9577void svstnt1_scatter_s64offset_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
9578__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_f64)))
9579void svstnt1_scatter_s64offset_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
9580__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_s64)))
9581void svstnt1_scatter_s64offset_s64(svbool_t, int64_t *, svint64_t, svint64_t);
9582__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_u64)))
9583void svstnt1_scatter_u64offset_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
9584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_f64)))
9585void svstnt1_scatter_u64offset_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
9586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_s64)))
9587void svstnt1_scatter_u64offset_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
9588__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_u32)))
9589void svstnt1b_scatter_u32base_offset_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
9590__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_u64)))
9591void svstnt1b_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9592__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_s32)))
9593void svstnt1b_scatter_u32base_offset_s32(svbool_t, svuint32_t, int64_t, svint32_t);
9594__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_s64)))
9595void svstnt1b_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9596__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_u32)))
9597void svstnt1b_scatter_u32base_u32(svbool_t, svuint32_t, svuint32_t);
9598__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_u64)))
9599void svstnt1b_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
9600__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_s32)))
9601void svstnt1b_scatter_u32base_s32(svbool_t, svuint32_t, svint32_t);
9602__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_s64)))
9603void svstnt1b_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
9604__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_s32)))
9605void svstnt1b_scatter_u32offset_s32(svbool_t, int8_t *, svuint32_t, svint32_t);
9606__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_u32)))
9607void svstnt1b_scatter_u32offset_u32(svbool_t, uint8_t *, svuint32_t, svuint32_t);
9608__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_s64)))
9609void svstnt1b_scatter_s64offset_s64(svbool_t, int8_t *, svint64_t, svint64_t);
9610__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_u64)))
9611void svstnt1b_scatter_s64offset_u64(svbool_t, uint8_t *, svint64_t, svuint64_t);
9612__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_s64)))
9613void svstnt1b_scatter_u64offset_s64(svbool_t, int8_t *, svuint64_t, svint64_t);
9614__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_u64)))
9615void svstnt1b_scatter_u64offset_u64(svbool_t, uint8_t *, svuint64_t, svuint64_t);
9616__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_u32)))
9617void svstnt1h_scatter_u32base_index_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
9618__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_u64)))
9619void svstnt1h_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_s32)))
9621void svstnt1h_scatter_u32base_index_s32(svbool_t, svuint32_t, int64_t, svint32_t);
9622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_s64)))
9623void svstnt1h_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_u32)))
9625void svstnt1h_scatter_u32base_offset_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
9626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_u64)))
9627void svstnt1h_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_s32)))
9629void svstnt1h_scatter_u32base_offset_s32(svbool_t, svuint32_t, int64_t, svint32_t);
9630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_s64)))
9631void svstnt1h_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_u32)))
9633void svstnt1h_scatter_u32base_u32(svbool_t, svuint32_t, svuint32_t);
9634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_u64)))
9635void svstnt1h_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
9636__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_s32)))
9637void svstnt1h_scatter_u32base_s32(svbool_t, svuint32_t, svint32_t);
9638__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_s64)))
9639void svstnt1h_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
9640__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_s64)))
9641void svstnt1h_scatter_s64index_s64(svbool_t, int16_t *, svint64_t, svint64_t);
9642__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_u64)))
9643void svstnt1h_scatter_s64index_u64(svbool_t, uint16_t *, svint64_t, svuint64_t);
9644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_s64)))
9645void svstnt1h_scatter_u64index_s64(svbool_t, int16_t *, svuint64_t, svint64_t);
9646__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_u64)))
9647void svstnt1h_scatter_u64index_u64(svbool_t, uint16_t *, svuint64_t, svuint64_t);
9648__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_s32)))
9649void svstnt1h_scatter_u32offset_s32(svbool_t, int16_t *, svuint32_t, svint32_t);
9650__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_u32)))
9651void svstnt1h_scatter_u32offset_u32(svbool_t, uint16_t *, svuint32_t, svuint32_t);
9652__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_s64)))
9653void svstnt1h_scatter_s64offset_s64(svbool_t, int16_t *, svint64_t, svint64_t);
9654__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_u64)))
9655void svstnt1h_scatter_s64offset_u64(svbool_t, uint16_t *, svint64_t, svuint64_t);
9656__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_s64)))
9657void svstnt1h_scatter_u64offset_s64(svbool_t, int16_t *, svuint64_t, svint64_t);
9658__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_u64)))
9659void svstnt1h_scatter_u64offset_u64(svbool_t, uint16_t *, svuint64_t, svuint64_t);
9660__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_u64)))
9661void svstnt1w_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9662__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_s64)))
9663void svstnt1w_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9664__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_u64)))
9665void svstnt1w_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
9666__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_s64)))
9667void svstnt1w_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
9668__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_u64)))
9669void svstnt1w_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
9670__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_s64)))
9671void svstnt1w_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
9672__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_s64)))
9673void svstnt1w_scatter_s64index_s64(svbool_t, int32_t *, svint64_t, svint64_t);
9674__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_u64)))
9675void svstnt1w_scatter_s64index_u64(svbool_t, uint32_t *, svint64_t, svuint64_t);
9676__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_s64)))
9677void svstnt1w_scatter_u64index_s64(svbool_t, int32_t *, svuint64_t, svint64_t);
9678__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_u64)))
9679void svstnt1w_scatter_u64index_u64(svbool_t, uint32_t *, svuint64_t, svuint64_t);
9680__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_s64)))
9681void svstnt1w_scatter_s64offset_s64(svbool_t, int32_t *, svint64_t, svint64_t);
9682__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_u64)))
9683void svstnt1w_scatter_s64offset_u64(svbool_t, uint32_t *, svint64_t, svuint64_t);
9684__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_s64)))
9685void svstnt1w_scatter_u64offset_s64(svbool_t, int32_t *, svuint64_t, svint64_t);
9686__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_u64)))
9687void svstnt1w_scatter_u64offset_u64(svbool_t, uint32_t *, svuint64_t, svuint64_t);
9688__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u32_z)))
9689svuint32_t svhistcnt_z(svbool_t, svuint32_t, svuint32_t);
9690__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u64_z)))
9691svuint64_t svhistcnt_z(svbool_t, svuint64_t, svuint64_t);
9692__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s32_z)))
9693svuint32_t svhistcnt_z(svbool_t, svint32_t, svint32_t);
9694__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s64_z)))
9695svuint64_t svhistcnt_z(svbool_t, svint64_t, svint64_t);
9696__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_u8)))
9697svuint8_t svhistseg(svuint8_t, svuint8_t);
9698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_s8)))
9699svuint8_t svhistseg(svint8_t, svint8_t);
9700__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_u32)))
9701svuint32_t svldnt1_gather_index_u32(svbool_t, svuint32_t, int64_t);
9702__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_u64)))
9703svuint64_t svldnt1_gather_index_u64(svbool_t, svuint64_t, int64_t);
9704__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_f64)))
9705svfloat64_t svldnt1_gather_index_f64(svbool_t, svuint64_t, int64_t);
9706__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_f32)))
9707svfloat32_t svldnt1_gather_index_f32(svbool_t, svuint32_t, int64_t);
9708__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_s32)))
9709svint32_t svldnt1_gather_index_s32(svbool_t, svuint32_t, int64_t);
9710__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_s64)))
9711svint64_t svldnt1_gather_index_s64(svbool_t, svuint64_t, int64_t);
9712__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_u32)))
9713svuint32_t svldnt1_gather_offset_u32(svbool_t, svuint32_t, int64_t);
9714__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_u64)))
9715svuint64_t svldnt1_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9716__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_f64)))
9717svfloat64_t svldnt1_gather_offset_f64(svbool_t, svuint64_t, int64_t);
9718__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_f32)))
9719svfloat32_t svldnt1_gather_offset_f32(svbool_t, svuint32_t, int64_t);
9720__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_s32)))
9721svint32_t svldnt1_gather_offset_s32(svbool_t, svuint32_t, int64_t);
9722__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_s64)))
9723svint64_t svldnt1_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9724__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_u32)))
9725svuint32_t svldnt1_gather_u32(svbool_t, svuint32_t);
9726__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_u64)))
9727svuint64_t svldnt1_gather_u64(svbool_t, svuint64_t);
9728__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_f64)))
9729svfloat64_t svldnt1_gather_f64(svbool_t, svuint64_t);
9730__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_f32)))
9731svfloat32_t svldnt1_gather_f32(svbool_t, svuint32_t);
9732__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_s32)))
9733svint32_t svldnt1_gather_s32(svbool_t, svuint32_t);
9734__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_s64)))
9735svint64_t svldnt1_gather_s64(svbool_t, svuint64_t);
9736__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_u64)))
9737svuint64_t svldnt1_gather_index(svbool_t, uint64_t const *, svint64_t);
9738__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_f64)))
9739svfloat64_t svldnt1_gather_index(svbool_t, float64_t const *, svint64_t);
9740__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_s64)))
9741svint64_t svldnt1_gather_index(svbool_t, int64_t const *, svint64_t);
9742__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_u64)))
9743svuint64_t svldnt1_gather_index(svbool_t, uint64_t const *, svuint64_t);
9744__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_f64)))
9745svfloat64_t svldnt1_gather_index(svbool_t, float64_t const *, svuint64_t);
9746__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_s64)))
9747svint64_t svldnt1_gather_index(svbool_t, int64_t const *, svuint64_t);
9748__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_u32)))
9749svuint32_t svldnt1_gather_offset(svbool_t, uint32_t const *, svuint32_t);
9750__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_f32)))
9751svfloat32_t svldnt1_gather_offset(svbool_t, float32_t const *, svuint32_t);
9752__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_s32)))
9753svint32_t svldnt1_gather_offset(svbool_t, int32_t const *, svuint32_t);
9754__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_u64)))
9755svuint64_t svldnt1_gather_offset(svbool_t, uint64_t const *, svint64_t);
9756__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_f64)))
9757svfloat64_t svldnt1_gather_offset(svbool_t, float64_t const *, svint64_t);
9758__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_s64)))
9759svint64_t svldnt1_gather_offset(svbool_t, int64_t const *, svint64_t);
9760__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_u64)))
9761svuint64_t svldnt1_gather_offset(svbool_t, uint64_t const *, svuint64_t);
9762__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_f64)))
9763svfloat64_t svldnt1_gather_offset(svbool_t, float64_t const *, svuint64_t);
9764__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_s64)))
9765svint64_t svldnt1_gather_offset(svbool_t, int64_t const *, svuint64_t);
9766__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_u32)))
9767svuint32_t svldnt1sb_gather_offset_u32(svbool_t, svuint32_t, int64_t);
9768__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_u64)))
9769svuint64_t svldnt1sb_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9770__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_s32)))
9771svint32_t svldnt1sb_gather_offset_s32(svbool_t, svuint32_t, int64_t);
9772__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_s64)))
9773svint64_t svldnt1sb_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9774__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_u32)))
9775svuint32_t svldnt1sb_gather_u32(svbool_t, svuint32_t);
9776__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_u64)))
9777svuint64_t svldnt1sb_gather_u64(svbool_t, svuint64_t);
9778__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_s32)))
9779svint32_t svldnt1sb_gather_s32(svbool_t, svuint32_t);
9780__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_s64)))
9781svint64_t svldnt1sb_gather_s64(svbool_t, svuint64_t);
9782__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_u32)))
9783svuint32_t svldnt1sb_gather_offset_u32(svbool_t, int8_t const *, svuint32_t);
9784__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_s32)))
9785svint32_t svldnt1sb_gather_offset_s32(svbool_t, int8_t const *, svuint32_t);
9786__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_u64)))
9787svuint64_t svldnt1sb_gather_offset_u64(svbool_t, int8_t const *, svint64_t);
9788__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_s64)))
9789svint64_t svldnt1sb_gather_offset_s64(svbool_t, int8_t const *, svint64_t);
9790__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_u64)))
9791svuint64_t svldnt1sb_gather_offset_u64(svbool_t, int8_t const *, svuint64_t);
9792__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_s64)))
9793svint64_t svldnt1sb_gather_offset_s64(svbool_t, int8_t const *, svuint64_t);
9794__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_u32)))
9795svuint32_t svldnt1sh_gather_index_u32(svbool_t, svuint32_t, int64_t);
9796__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_u64)))
9797svuint64_t svldnt1sh_gather_index_u64(svbool_t, svuint64_t, int64_t);
9798__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_s32)))
9799svint32_t svldnt1sh_gather_index_s32(svbool_t, svuint32_t, int64_t);
9800__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_s64)))
9801svint64_t svldnt1sh_gather_index_s64(svbool_t, svuint64_t, int64_t);
9802__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_u32)))
9803svuint32_t svldnt1sh_gather_offset_u32(svbool_t, svuint32_t, int64_t);
9804__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_u64)))
9805svuint64_t svldnt1sh_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9806__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_s32)))
9807svint32_t svldnt1sh_gather_offset_s32(svbool_t, svuint32_t, int64_t);
9808__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_s64)))
9809svint64_t svldnt1sh_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9810__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_u32)))
9811svuint32_t svldnt1sh_gather_u32(svbool_t, svuint32_t);
9812__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_u64)))
9813svuint64_t svldnt1sh_gather_u64(svbool_t, svuint64_t);
9814__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_s32)))
9815svint32_t svldnt1sh_gather_s32(svbool_t, svuint32_t);
9816__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_s64)))
9817svint64_t svldnt1sh_gather_s64(svbool_t, svuint64_t);
9818__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_u64)))
9819svuint64_t svldnt1sh_gather_index_u64(svbool_t, int16_t const *, svint64_t);
9820__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_s64)))
9821svint64_t svldnt1sh_gather_index_s64(svbool_t, int16_t const *, svint64_t);
9822__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_u64)))
9823svuint64_t svldnt1sh_gather_index_u64(svbool_t, int16_t const *, svuint64_t);
9824__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_s64)))
9825svint64_t svldnt1sh_gather_index_s64(svbool_t, int16_t const *, svuint64_t);
9826__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_u32)))
9827svuint32_t svldnt1sh_gather_offset_u32(svbool_t, int16_t const *, svuint32_t);
9828__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_s32)))
9829svint32_t svldnt1sh_gather_offset_s32(svbool_t, int16_t const *, svuint32_t);
9830__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_u64)))
9831svuint64_t svldnt1sh_gather_offset_u64(svbool_t, int16_t const *, svint64_t);
9832__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_s64)))
9833svint64_t svldnt1sh_gather_offset_s64(svbool_t, int16_t const *, svint64_t);
9834__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_u64)))
9835svuint64_t svldnt1sh_gather_offset_u64(svbool_t, int16_t const *, svuint64_t);
9836__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_s64)))
9837svint64_t svldnt1sh_gather_offset_s64(svbool_t, int16_t const *, svuint64_t);
9838__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_u64)))
9839svuint64_t svldnt1sw_gather_index_u64(svbool_t, svuint64_t, int64_t);
9840__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_s64)))
9841svint64_t svldnt1sw_gather_index_s64(svbool_t, svuint64_t, int64_t);
9842__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_u64)))
9843svuint64_t svldnt1sw_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9844__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_s64)))
9845svint64_t svldnt1sw_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9846__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_u64)))
9847svuint64_t svldnt1sw_gather_u64(svbool_t, svuint64_t);
9848__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_s64)))
9849svint64_t svldnt1sw_gather_s64(svbool_t, svuint64_t);
9850__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_u64)))
9851svuint64_t svldnt1sw_gather_index_u64(svbool_t, int32_t const *, svint64_t);
9852__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_s64)))
9853svint64_t svldnt1sw_gather_index_s64(svbool_t, int32_t const *, svint64_t);
9854__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_u64)))
9855svuint64_t svldnt1sw_gather_index_u64(svbool_t, int32_t const *, svuint64_t);
9856__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_s64)))
9857svint64_t svldnt1sw_gather_index_s64(svbool_t, int32_t const *, svuint64_t);
9858__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_u64)))
9859svuint64_t svldnt1sw_gather_offset_u64(svbool_t, int32_t const *, svint64_t);
9860__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_s64)))
9861svint64_t svldnt1sw_gather_offset_s64(svbool_t, int32_t const *, svint64_t);
9862__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_u64)))
9863svuint64_t svldnt1sw_gather_offset_u64(svbool_t, int32_t const *, svuint64_t);
9864__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_s64)))
9865svint64_t svldnt1sw_gather_offset_s64(svbool_t, int32_t const *, svuint64_t);
9866__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_u32)))
9867svuint32_t svldnt1ub_gather_offset_u32(svbool_t, svuint32_t, int64_t);
9868__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_u64)))
9869svuint64_t svldnt1ub_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9870__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_s32)))
9871svint32_t svldnt1ub_gather_offset_s32(svbool_t, svuint32_t, int64_t);
9872__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_s64)))
9873svint64_t svldnt1ub_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9874__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_u32)))
9875svuint32_t svldnt1ub_gather_u32(svbool_t, svuint32_t);
9876__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_u64)))
9877svuint64_t svldnt1ub_gather_u64(svbool_t, svuint64_t);
9878__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_s32)))
9879svint32_t svldnt1ub_gather_s32(svbool_t, svuint32_t);
9880__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_s64)))
9881svint64_t svldnt1ub_gather_s64(svbool_t, svuint64_t);
9882__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_u32)))
9883svuint32_t svldnt1ub_gather_offset_u32(svbool_t, uint8_t const *, svuint32_t);
9884__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_s32)))
9885svint32_t svldnt1ub_gather_offset_s32(svbool_t, uint8_t const *, svuint32_t);
9886__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_u64)))
9887svuint64_t svldnt1ub_gather_offset_u64(svbool_t, uint8_t const *, svint64_t);
9888__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_s64)))
9889svint64_t svldnt1ub_gather_offset_s64(svbool_t, uint8_t const *, svint64_t);
9890__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_u64)))
9891svuint64_t svldnt1ub_gather_offset_u64(svbool_t, uint8_t const *, svuint64_t);
9892__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_s64)))
9893svint64_t svldnt1ub_gather_offset_s64(svbool_t, uint8_t const *, svuint64_t);
9894__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_u32)))
9895svuint32_t svldnt1uh_gather_index_u32(svbool_t, svuint32_t, int64_t);
9896__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_u64)))
9897svuint64_t svldnt1uh_gather_index_u64(svbool_t, svuint64_t, int64_t);
9898__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_s32)))
9899svint32_t svldnt1uh_gather_index_s32(svbool_t, svuint32_t, int64_t);
9900__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_s64)))
9901svint64_t svldnt1uh_gather_index_s64(svbool_t, svuint64_t, int64_t);
9902__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_u32)))
9903svuint32_t svldnt1uh_gather_offset_u32(svbool_t, svuint32_t, int64_t);
9904__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_u64)))
9905svuint64_t svldnt1uh_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9906__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_s32)))
9907svint32_t svldnt1uh_gather_offset_s32(svbool_t, svuint32_t, int64_t);
9908__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_s64)))
9909svint64_t svldnt1uh_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9910__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_u32)))
9911svuint32_t svldnt1uh_gather_u32(svbool_t, svuint32_t);
9912__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_u64)))
9913svuint64_t svldnt1uh_gather_u64(svbool_t, svuint64_t);
9914__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_s32)))
9915svint32_t svldnt1uh_gather_s32(svbool_t, svuint32_t);
9916__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_s64)))
9917svint64_t svldnt1uh_gather_s64(svbool_t, svuint64_t);
9918__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_u64)))
9919svuint64_t svldnt1uh_gather_index_u64(svbool_t, uint16_t const *, svint64_t);
9920__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_s64)))
9921svint64_t svldnt1uh_gather_index_s64(svbool_t, uint16_t const *, svint64_t);
9922__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_u64)))
9923svuint64_t svldnt1uh_gather_index_u64(svbool_t, uint16_t const *, svuint64_t);
9924__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_s64)))
9925svint64_t svldnt1uh_gather_index_s64(svbool_t, uint16_t const *, svuint64_t);
9926__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_u32)))
9927svuint32_t svldnt1uh_gather_offset_u32(svbool_t, uint16_t const *, svuint32_t);
9928__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_s32)))
9929svint32_t svldnt1uh_gather_offset_s32(svbool_t, uint16_t const *, svuint32_t);
9930__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_u64)))
9931svuint64_t svldnt1uh_gather_offset_u64(svbool_t, uint16_t const *, svint64_t);
9932__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_s64)))
9933svint64_t svldnt1uh_gather_offset_s64(svbool_t, uint16_t const *, svint64_t);
9934__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_u64)))
9935svuint64_t svldnt1uh_gather_offset_u64(svbool_t, uint16_t const *, svuint64_t);
9936__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_s64)))
9937svint64_t svldnt1uh_gather_offset_s64(svbool_t, uint16_t const *, svuint64_t);
9938__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_u64)))
9939svuint64_t svldnt1uw_gather_index_u64(svbool_t, svuint64_t, int64_t);
9940__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_s64)))
9941svint64_t svldnt1uw_gather_index_s64(svbool_t, svuint64_t, int64_t);
9942__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_u64)))
9943svuint64_t svldnt1uw_gather_offset_u64(svbool_t, svuint64_t, int64_t);
9944__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_s64)))
9945svint64_t svldnt1uw_gather_offset_s64(svbool_t, svuint64_t, int64_t);
9946__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_u64)))
9947svuint64_t svldnt1uw_gather_u64(svbool_t, svuint64_t);
9948__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_s64)))
9949svint64_t svldnt1uw_gather_s64(svbool_t, svuint64_t);
9950__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_u64)))
9951svuint64_t svldnt1uw_gather_index_u64(svbool_t, uint32_t const *, svint64_t);
9952__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_s64)))
9953svint64_t svldnt1uw_gather_index_s64(svbool_t, uint32_t const *, svint64_t);
9954__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_u64)))
9955svuint64_t svldnt1uw_gather_index_u64(svbool_t, uint32_t const *, svuint64_t);
9956__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_s64)))
9957svint64_t svldnt1uw_gather_index_s64(svbool_t, uint32_t const *, svuint64_t);
9958__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_u64)))
9959svuint64_t svldnt1uw_gather_offset_u64(svbool_t, uint32_t const *, svint64_t);
9960__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_s64)))
9961svint64_t svldnt1uw_gather_offset_s64(svbool_t, uint32_t const *, svint64_t);
9962__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_u64)))
9963svuint64_t svldnt1uw_gather_offset_u64(svbool_t, uint32_t const *, svuint64_t);
9964__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_s64)))
9965svint64_t svldnt1uw_gather_offset_s64(svbool_t, uint32_t const *, svuint64_t);
9966__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u8)))
9967svbool_t svmatch(svbool_t, svuint8_t, svuint8_t);
9968__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u16)))
9969svbool_t svmatch(svbool_t, svuint16_t, svuint16_t);
9970__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s8)))
9971svbool_t svmatch(svbool_t, svint8_t, svint8_t);
9972__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s16)))
9973svbool_t svmatch(svbool_t, svint16_t, svint16_t);
9974__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u8)))
9975svbool_t svnmatch(svbool_t, svuint8_t, svuint8_t);
9976__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u16)))
9977svbool_t svnmatch(svbool_t, svuint16_t, svuint16_t);
9978__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s8)))
9979svbool_t svnmatch(svbool_t, svint8_t, svint8_t);
9980__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s16)))
9981svbool_t svnmatch(svbool_t, svint16_t, svint16_t);
9982__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_u32)))
9983void svstnt1_scatter_index(svbool_t, svuint32_t, int64_t, svuint32_t);
9984__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_u64)))
9985void svstnt1_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
9986__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_f64)))
9987void svstnt1_scatter_index(svbool_t, svuint64_t, int64_t, svfloat64_t);
9988__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_f32)))
9989void svstnt1_scatter_index(svbool_t, svuint32_t, int64_t, svfloat32_t);
9990__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_s32)))
9991void svstnt1_scatter_index(svbool_t, svuint32_t, int64_t, svint32_t);
9992__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_s64)))
9993void svstnt1_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
9994__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_u32)))
9995void svstnt1_scatter_offset(svbool_t, svuint32_t, int64_t, svuint32_t);
9996__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_u64)))
9997void svstnt1_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
9998__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_f64)))
9999void svstnt1_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat64_t);
10000__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_f32)))
10001void svstnt1_scatter_offset(svbool_t, svuint32_t, int64_t, svfloat32_t);
10002__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_s32)))
10003void svstnt1_scatter_offset(svbool_t, svuint32_t, int64_t, svint32_t);
10004__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_s64)))
10005void svstnt1_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
10006__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_u32)))
10007void svstnt1_scatter(svbool_t, svuint32_t, svuint32_t);
10008__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_u64)))
10009void svstnt1_scatter(svbool_t, svuint64_t, svuint64_t);
10010__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_f64)))
10011void svstnt1_scatter(svbool_t, svuint64_t, svfloat64_t);
10012__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_f32)))
10013void svstnt1_scatter(svbool_t, svuint32_t, svfloat32_t);
10014__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_s32)))
10015void svstnt1_scatter(svbool_t, svuint32_t, svint32_t);
10016__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_s64)))
10017void svstnt1_scatter(svbool_t, svuint64_t, svint64_t);
10018__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_u64)))
10019void svstnt1_scatter_index(svbool_t, uint64_t *, svint64_t, svuint64_t);
10020__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_f64)))
10021void svstnt1_scatter_index(svbool_t, float64_t *, svint64_t, svfloat64_t);
10022__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_s64)))
10023void svstnt1_scatter_index(svbool_t, int64_t *, svint64_t, svint64_t);
10024__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_u64)))
10025void svstnt1_scatter_index(svbool_t, uint64_t *, svuint64_t, svuint64_t);
10026__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_f64)))
10027void svstnt1_scatter_index(svbool_t, float64_t *, svuint64_t, svfloat64_t);
10028__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_s64)))
10029void svstnt1_scatter_index(svbool_t, int64_t *, svuint64_t, svint64_t);
10030__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_u32)))
10031void svstnt1_scatter_offset(svbool_t, uint32_t *, svuint32_t, svuint32_t);
10032__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_f32)))
10033void svstnt1_scatter_offset(svbool_t, float32_t *, svuint32_t, svfloat32_t);
10034__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_s32)))
10035void svstnt1_scatter_offset(svbool_t, int32_t *, svuint32_t, svint32_t);
10036__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_u64)))
10037void svstnt1_scatter_offset(svbool_t, uint64_t *, svint64_t, svuint64_t);
10038__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_f64)))
10039void svstnt1_scatter_offset(svbool_t, float64_t *, svint64_t, svfloat64_t);
10040__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_s64)))
10041void svstnt1_scatter_offset(svbool_t, int64_t *, svint64_t, svint64_t);
10042__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_u64)))
10043void svstnt1_scatter_offset(svbool_t, uint64_t *, svuint64_t, svuint64_t);
10044__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_f64)))
10045void svstnt1_scatter_offset(svbool_t, float64_t *, svuint64_t, svfloat64_t);
10046__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_s64)))
10047void svstnt1_scatter_offset(svbool_t, int64_t *, svuint64_t, svint64_t);
10048__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_u32)))
10049void svstnt1b_scatter_offset(svbool_t, svuint32_t, int64_t, svuint32_t);
10050__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_u64)))
10051void svstnt1b_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
10052__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_s32)))
10053void svstnt1b_scatter_offset(svbool_t, svuint32_t, int64_t, svint32_t);
10054__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_s64)))
10055void svstnt1b_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
10056__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_u32)))
10057void svstnt1b_scatter(svbool_t, svuint32_t, svuint32_t);
10058__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_u64)))
10059void svstnt1b_scatter(svbool_t, svuint64_t, svuint64_t);
10060__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_s32)))
10061void svstnt1b_scatter(svbool_t, svuint32_t, svint32_t);
10062__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_s64)))
10063void svstnt1b_scatter(svbool_t, svuint64_t, svint64_t);
10064__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_s32)))
10065void svstnt1b_scatter_offset(svbool_t, int8_t *, svuint32_t, svint32_t);
10066__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_u32)))
10067void svstnt1b_scatter_offset(svbool_t, uint8_t *, svuint32_t, svuint32_t);
10068__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_s64)))
10069void svstnt1b_scatter_offset(svbool_t, int8_t *, svint64_t, svint64_t);
10070__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_u64)))
10071void svstnt1b_scatter_offset(svbool_t, uint8_t *, svint64_t, svuint64_t);
10072__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_s64)))
10073void svstnt1b_scatter_offset(svbool_t, int8_t *, svuint64_t, svint64_t);
10074__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_u64)))
10075void svstnt1b_scatter_offset(svbool_t, uint8_t *, svuint64_t, svuint64_t);
10076__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_u32)))
10077void svstnt1h_scatter_index(svbool_t, svuint32_t, int64_t, svuint32_t);
10078__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_u64)))
10079void svstnt1h_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
10080__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_s32)))
10081void svstnt1h_scatter_index(svbool_t, svuint32_t, int64_t, svint32_t);
10082__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_s64)))
10083void svstnt1h_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
10084__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_u32)))
10085void svstnt1h_scatter_offset(svbool_t, svuint32_t, int64_t, svuint32_t);
10086__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_u64)))
10087void svstnt1h_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
10088__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_s32)))
10089void svstnt1h_scatter_offset(svbool_t, svuint32_t, int64_t, svint32_t);
10090__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_s64)))
10091void svstnt1h_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
10092__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_u32)))
10093void svstnt1h_scatter(svbool_t, svuint32_t, svuint32_t);
10094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_u64)))
10095void svstnt1h_scatter(svbool_t, svuint64_t, svuint64_t);
10096__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_s32)))
10097void svstnt1h_scatter(svbool_t, svuint32_t, svint32_t);
10098__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_s64)))
10099void svstnt1h_scatter(svbool_t, svuint64_t, svint64_t);
10100__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_s64)))
10101void svstnt1h_scatter_index(svbool_t, int16_t *, svint64_t, svint64_t);
10102__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_u64)))
10103void svstnt1h_scatter_index(svbool_t, uint16_t *, svint64_t, svuint64_t);
10104__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_s64)))
10105void svstnt1h_scatter_index(svbool_t, int16_t *, svuint64_t, svint64_t);
10106__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_u64)))
10107void svstnt1h_scatter_index(svbool_t, uint16_t *, svuint64_t, svuint64_t);
10108__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_s32)))
10109void svstnt1h_scatter_offset(svbool_t, int16_t *, svuint32_t, svint32_t);
10110__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_u32)))
10111void svstnt1h_scatter_offset(svbool_t, uint16_t *, svuint32_t, svuint32_t);
10112__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_s64)))
10113void svstnt1h_scatter_offset(svbool_t, int16_t *, svint64_t, svint64_t);
10114__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_u64)))
10115void svstnt1h_scatter_offset(svbool_t, uint16_t *, svint64_t, svuint64_t);
10116__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_s64)))
10117void svstnt1h_scatter_offset(svbool_t, int16_t *, svuint64_t, svint64_t);
10118__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_u64)))
10119void svstnt1h_scatter_offset(svbool_t, uint16_t *, svuint64_t, svuint64_t);
10120__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_u64)))
10121void svstnt1w_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
10122__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_s64)))
10123void svstnt1w_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
10124__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_u64)))
10125void svstnt1w_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
10126__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_s64)))
10127void svstnt1w_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
10128__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_u64)))
10129void svstnt1w_scatter(svbool_t, svuint64_t, svuint64_t);
10130__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_s64)))
10131void svstnt1w_scatter(svbool_t, svuint64_t, svint64_t);
10132__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_s64)))
10133void svstnt1w_scatter_index(svbool_t, int32_t *, svint64_t, svint64_t);
10134__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_u64)))
10135void svstnt1w_scatter_index(svbool_t, uint32_t *, svint64_t, svuint64_t);
10136__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_s64)))
10137void svstnt1w_scatter_index(svbool_t, int32_t *, svuint64_t, svint64_t);
10138__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_u64)))
10139void svstnt1w_scatter_index(svbool_t, uint32_t *, svuint64_t, svuint64_t);
10140__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_s64)))
10141void svstnt1w_scatter_offset(svbool_t, int32_t *, svint64_t, svint64_t);
10142__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_u64)))
10143void svstnt1w_scatter_offset(svbool_t, uint32_t *, svint64_t, svuint64_t);
10144__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_s64)))
10145void svstnt1w_scatter_offset(svbool_t, int32_t *, svuint64_t, svint64_t);
10146__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_u64)))
10147void svstnt1w_scatter_offset(svbool_t, uint32_t *, svuint64_t, svuint64_t);
10148__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_m)))
10149svfloat64_t svamax_n_f64_m(svbool_t, svfloat64_t, float64_t);
10150__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_m)))
10151svfloat32_t svamax_n_f32_m(svbool_t, svfloat32_t, float32_t);
10152__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_m)))
10153svfloat16_t svamax_n_f16_m(svbool_t, svfloat16_t, float16_t);
10154__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_x)))
10155svfloat64_t svamax_n_f64_x(svbool_t, svfloat64_t, float64_t);
10156__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_x)))
10157svfloat32_t svamax_n_f32_x(svbool_t, svfloat32_t, float32_t);
10158__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_x)))
10159svfloat16_t svamax_n_f16_x(svbool_t, svfloat16_t, float16_t);
10160__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_z)))
10161svfloat64_t svamax_n_f64_z(svbool_t, svfloat64_t, float64_t);
10162__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_z)))
10163svfloat32_t svamax_n_f32_z(svbool_t, svfloat32_t, float32_t);
10164__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_z)))
10165svfloat16_t svamax_n_f16_z(svbool_t, svfloat16_t, float16_t);
10166__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_m)))
10167svfloat64_t svamax_f64_m(svbool_t, svfloat64_t, svfloat64_t);
10168__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_m)))
10169svfloat32_t svamax_f32_m(svbool_t, svfloat32_t, svfloat32_t);
10170__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_m)))
10171svfloat16_t svamax_f16_m(svbool_t, svfloat16_t, svfloat16_t);
10172__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_x)))
10173svfloat64_t svamax_f64_x(svbool_t, svfloat64_t, svfloat64_t);
10174__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_x)))
10175svfloat32_t svamax_f32_x(svbool_t, svfloat32_t, svfloat32_t);
10176__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_x)))
10177svfloat16_t svamax_f16_x(svbool_t, svfloat16_t, svfloat16_t);
10178__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_z)))
10179svfloat64_t svamax_f64_z(svbool_t, svfloat64_t, svfloat64_t);
10180__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_z)))
10181svfloat32_t svamax_f32_z(svbool_t, svfloat32_t, svfloat32_t);
10182__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_z)))
10183svfloat16_t svamax_f16_z(svbool_t, svfloat16_t, svfloat16_t);
10184__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_m)))
10185svfloat64_t svamin_n_f64_m(svbool_t, svfloat64_t, float64_t);
10186__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_m)))
10187svfloat32_t svamin_n_f32_m(svbool_t, svfloat32_t, float32_t);
10188__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_m)))
10189svfloat16_t svamin_n_f16_m(svbool_t, svfloat16_t, float16_t);
10190__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_x)))
10191svfloat64_t svamin_n_f64_x(svbool_t, svfloat64_t, float64_t);
10192__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_x)))
10193svfloat32_t svamin_n_f32_x(svbool_t, svfloat32_t, float32_t);
10194__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_x)))
10195svfloat16_t svamin_n_f16_x(svbool_t, svfloat16_t, float16_t);
10196__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_z)))
10197svfloat64_t svamin_n_f64_z(svbool_t, svfloat64_t, float64_t);
10198__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_z)))
10199svfloat32_t svamin_n_f32_z(svbool_t, svfloat32_t, float32_t);
10200__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_z)))
10201svfloat16_t svamin_n_f16_z(svbool_t, svfloat16_t, float16_t);
10202__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_m)))
10203svfloat64_t svamin_f64_m(svbool_t, svfloat64_t, svfloat64_t);
10204__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_m)))
10205svfloat32_t svamin_f32_m(svbool_t, svfloat32_t, svfloat32_t);
10206__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_m)))
10207svfloat16_t svamin_f16_m(svbool_t, svfloat16_t, svfloat16_t);
10208__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_x)))
10209svfloat64_t svamin_f64_x(svbool_t, svfloat64_t, svfloat64_t);
10210__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_x)))
10211svfloat32_t svamin_f32_x(svbool_t, svfloat32_t, svfloat32_t);
10212__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_x)))
10213svfloat16_t svamin_f16_x(svbool_t, svfloat16_t, svfloat16_t);
10214__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_z)))
10215svfloat64_t svamin_f64_z(svbool_t, svfloat64_t, svfloat64_t);
10216__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_z)))
10217svfloat32_t svamin_f32_z(svbool_t, svfloat32_t, svfloat32_t);
10218__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_z)))
10219svfloat16_t svamin_f16_z(svbool_t, svfloat16_t, svfloat16_t);
10220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_m)))
10221svfloat64_t svamax_m(svbool_t, svfloat64_t, float64_t);
10222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_m)))
10223svfloat32_t svamax_m(svbool_t, svfloat32_t, float32_t);
10224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_m)))
10225svfloat16_t svamax_m(svbool_t, svfloat16_t, float16_t);
10226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_x)))
10227svfloat64_t svamax_x(svbool_t, svfloat64_t, float64_t);
10228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_x)))
10229svfloat32_t svamax_x(svbool_t, svfloat32_t, float32_t);
10230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_x)))
10231svfloat16_t svamax_x(svbool_t, svfloat16_t, float16_t);
10232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_z)))
10233svfloat64_t svamax_z(svbool_t, svfloat64_t, float64_t);
10234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_z)))
10235svfloat32_t svamax_z(svbool_t, svfloat32_t, float32_t);
10236__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_z)))
10237svfloat16_t svamax_z(svbool_t, svfloat16_t, float16_t);
10238__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_m)))
10239svfloat64_t svamax_m(svbool_t, svfloat64_t, svfloat64_t);
10240__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_m)))
10241svfloat32_t svamax_m(svbool_t, svfloat32_t, svfloat32_t);
10242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_m)))
10243svfloat16_t svamax_m(svbool_t, svfloat16_t, svfloat16_t);
10244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_x)))
10245svfloat64_t svamax_x(svbool_t, svfloat64_t, svfloat64_t);
10246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_x)))
10247svfloat32_t svamax_x(svbool_t, svfloat32_t, svfloat32_t);
10248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_x)))
10249svfloat16_t svamax_x(svbool_t, svfloat16_t, svfloat16_t);
10250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_z)))
10251svfloat64_t svamax_z(svbool_t, svfloat64_t, svfloat64_t);
10252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_z)))
10253svfloat32_t svamax_z(svbool_t, svfloat32_t, svfloat32_t);
10254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_z)))
10255svfloat16_t svamax_z(svbool_t, svfloat16_t, svfloat16_t);
10256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_m)))
10257svfloat64_t svamin_m(svbool_t, svfloat64_t, float64_t);
10258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_m)))
10259svfloat32_t svamin_m(svbool_t, svfloat32_t, float32_t);
10260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_m)))
10261svfloat16_t svamin_m(svbool_t, svfloat16_t, float16_t);
10262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_x)))
10263svfloat64_t svamin_x(svbool_t, svfloat64_t, float64_t);
10264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_x)))
10265svfloat32_t svamin_x(svbool_t, svfloat32_t, float32_t);
10266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_x)))
10267svfloat16_t svamin_x(svbool_t, svfloat16_t, float16_t);
10268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_z)))
10269svfloat64_t svamin_z(svbool_t, svfloat64_t, float64_t);
10270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_z)))
10271svfloat32_t svamin_z(svbool_t, svfloat32_t, float32_t);
10272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_z)))
10273svfloat16_t svamin_z(svbool_t, svfloat16_t, float16_t);
10274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_m)))
10275svfloat64_t svamin_m(svbool_t, svfloat64_t, svfloat64_t);
10276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_m)))
10277svfloat32_t svamin_m(svbool_t, svfloat32_t, svfloat32_t);
10278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_m)))
10279svfloat16_t svamin_m(svbool_t, svfloat16_t, svfloat16_t);
10280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_x)))
10281svfloat64_t svamin_x(svbool_t, svfloat64_t, svfloat64_t);
10282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_x)))
10283svfloat32_t svamin_x(svbool_t, svfloat32_t, svfloat32_t);
10284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_x)))
10285svfloat16_t svamin_x(svbool_t, svfloat16_t, svfloat16_t);
10286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_z)))
10287svfloat64_t svamin_z(svbool_t, svfloat64_t, svfloat64_t);
10288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_z)))
10289svfloat32_t svamin_z(svbool_t, svfloat32_t, svfloat32_t);
10290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_z)))
10291svfloat16_t svamin_z(svbool_t, svfloat16_t, svfloat16_t);
10292__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f16_mf8_fpm)))
10293svfloat16_t svdot_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
10294__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f16_mf8_fpm)))
10295svfloat16_t svdot_n_f16_mf8_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
10296__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f16_mf8_fpm)))
10297svfloat16_t svdot_lane_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f16_mf8_fpm)))
10299svfloat16_t svdot_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
10300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f16_mf8_fpm)))
10301svfloat16_t svdot_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
10302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f16_mf8_fpm)))
10303svfloat16_t svdot_lane_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10304__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_mf8_fpm)))
10305svfloat32_t svdot_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10306__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f32_mf8_fpm)))
10307svfloat32_t svdot_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10308__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f32_mf8_fpm)))
10309svfloat32_t svdot_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_mf8_fpm)))
10311svfloat32_t svdot_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f32_mf8_fpm)))
10313svfloat32_t svdot_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f32_mf8_fpm)))
10315svfloat32_t svdot_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10316__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_f16_mf8_fpm)))
10317svfloat16_t svmlalb_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
10318__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_n_f16_mf8_fpm)))
10319svfloat16_t svmlalb_n_f16_mf8_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
10320__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_lane_f16_mf8_fpm)))
10321svfloat16_t svmlalb_lane_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10322__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_f32_mf8_fpm)))
10323svfloat32_t svmlallbb_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10324__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_n_f32_mf8_fpm)))
10325svfloat32_t svmlallbb_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10326__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_lane_f32_mf8_fpm)))
10327svfloat32_t svmlallbb_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10328__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_f32_mf8_fpm)))
10329svfloat32_t svmlallbt_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10330__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_n_f32_mf8_fpm)))
10331svfloat32_t svmlallbt_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10332__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_lane_f32_mf8_fpm)))
10333svfloat32_t svmlallbt_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10334__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_f32_mf8_fpm)))
10335svfloat32_t svmlalltb_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10336__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_n_f32_mf8_fpm)))
10337svfloat32_t svmlalltb_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10338__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_lane_f32_mf8_fpm)))
10339svfloat32_t svmlalltb_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10340__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_f32_mf8_fpm)))
10341svfloat32_t svmlalltt_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10342__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_n_f32_mf8_fpm)))
10343svfloat32_t svmlalltt_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10344__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_lane_f32_mf8_fpm)))
10345svfloat32_t svmlalltt_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10346__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_f16_mf8_fpm)))
10347svfloat16_t svmlalt_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
10348__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_n_f16_mf8_fpm)))
10349svfloat16_t svmlalt_n_f16_mf8_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
10350__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_lane_f16_mf8_fpm)))
10351svfloat16_t svmlalt_lane_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_f16_mf8_fpm)))
10353svfloat16_t svmlalb_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
10354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_n_f16_mf8_fpm)))
10355svfloat16_t svmlalb_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
10356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_lane_f16_mf8_fpm)))
10357svfloat16_t svmlalb_lane_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_f32_mf8_fpm)))
10359svfloat32_t svmlallbb_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_n_f32_mf8_fpm)))
10361svfloat32_t svmlallbb_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_lane_f32_mf8_fpm)))
10363svfloat32_t svmlallbb_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_f32_mf8_fpm)))
10365svfloat32_t svmlallbt_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_n_f32_mf8_fpm)))
10367svfloat32_t svmlallbt_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_lane_f32_mf8_fpm)))
10369svfloat32_t svmlallbt_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_f32_mf8_fpm)))
10371svfloat32_t svmlalltb_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_n_f32_mf8_fpm)))
10373svfloat32_t svmlalltb_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_lane_f32_mf8_fpm)))
10375svfloat32_t svmlalltb_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_f32_mf8_fpm)))
10377svfloat32_t svmlalltt_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
10378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_n_f32_mf8_fpm)))
10379svfloat32_t svmlalltt_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
10380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_lane_f32_mf8_fpm)))
10381svfloat32_t svmlalltt_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_f16_mf8_fpm)))
10383svfloat16_t svmlalt_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
10384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_n_f16_mf8_fpm)))
10385svfloat16_t svmlalt_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
10386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_lane_f16_mf8_fpm)))
10387svfloat16_t svmlalt_lane_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
10388__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_bf16_mf8_fpm)))
10389svbfloat16_t svcvt1_bf16_mf8_fpm(svmfloat8_t, fpm_t);
10390__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_f16_mf8_fpm)))
10391svfloat16_t svcvt1_f16_mf8_fpm(svmfloat8_t, fpm_t);
10392__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_bf16_mf8_fpm)))
10393svbfloat16_t svcvt2_bf16_mf8_fpm(svmfloat8_t, fpm_t);
10394__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_f16_mf8_fpm)))
10395svfloat16_t svcvt2_f16_mf8_fpm(svmfloat8_t, fpm_t);
10396__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_bf16_mf8_fpm)))
10397svbfloat16_t svcvtlt1_bf16_mf8_fpm(svmfloat8_t, fpm_t);
10398__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_f16_mf8_fpm)))
10399svfloat16_t svcvtlt1_f16_mf8_fpm(svmfloat8_t, fpm_t);
10400__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_bf16_mf8_fpm)))
10401svbfloat16_t svcvtlt2_bf16_mf8_fpm(svmfloat8_t, fpm_t);
10402__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_f16_mf8_fpm)))
10403svfloat16_t svcvtlt2_f16_mf8_fpm(svmfloat8_t, fpm_t);
10404__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_bf16_x2_fpm)))
10405svmfloat8_t svcvtn_mf8_bf16_x2_fpm(svbfloat16x2_t, fpm_t);
10406__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_f16_x2_fpm)))
10407svmfloat8_t svcvtn_mf8_f16_x2_fpm(svfloat16x2_t, fpm_t);
10408__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnb_mf8_f32_x2_fpm)))
10409svmfloat8_t svcvtnb_mf8_f32_x2_fpm(svfloat32x2_t, fpm_t);
10410__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_mf8_f32_x2_fpm)))
10411svmfloat8_t svcvtnt_mf8_f32_x2_fpm(svmfloat8_t, svfloat32x2_t, fpm_t);
10412__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_bf16_mf8_fpm)))
10413svbfloat16_t svcvt1_bf16_fpm(svmfloat8_t, fpm_t);
10414__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_f16_mf8_fpm)))
10415svfloat16_t svcvt1_f16_fpm(svmfloat8_t, fpm_t);
10416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_bf16_mf8_fpm)))
10417svbfloat16_t svcvt2_bf16_fpm(svmfloat8_t, fpm_t);
10418__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_f16_mf8_fpm)))
10419svfloat16_t svcvt2_f16_fpm(svmfloat8_t, fpm_t);
10420__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_bf16_mf8_fpm)))
10421svbfloat16_t svcvtlt1_bf16_fpm(svmfloat8_t, fpm_t);
10422__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_f16_mf8_fpm)))
10423svfloat16_t svcvtlt1_f16_fpm(svmfloat8_t, fpm_t);
10424__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_bf16_mf8_fpm)))
10425svbfloat16_t svcvtlt2_bf16_fpm(svmfloat8_t, fpm_t);
10426__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_f16_mf8_fpm)))
10427svfloat16_t svcvtlt2_f16_fpm(svmfloat8_t, fpm_t);
10428__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_bf16_x2_fpm)))
10429svmfloat8_t svcvtn_mf8_fpm(svbfloat16x2_t, fpm_t);
10430__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_f16_x2_fpm)))
10431svmfloat8_t svcvtn_mf8_fpm(svfloat16x2_t, fpm_t);
10432__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnb_mf8_f32_x2_fpm)))
10433svmfloat8_t svcvtnb_mf8_fpm(svfloat32x2_t, fpm_t);
10434__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_mf8_f32_x2_fpm)))
10435svmfloat8_t svcvtnt_mf8_fpm(svmfloat8_t, svfloat32x2_t, fpm_t);
10436__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u8)))
10437svuint8_t svluti2_lane_u8(svuint8_t, svuint8_t, uint64_t);
10438__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s8)))
10439svint8_t svluti2_lane_s8(svint8_t, svuint8_t, uint64_t);
10440__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u16)))
10441svuint16_t svluti2_lane_u16(svuint16_t, svuint8_t, uint64_t);
10442__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_bf16)))
10443svbfloat16_t svluti2_lane_bf16(svbfloat16_t, svuint8_t, uint64_t);
10444__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_f16)))
10445svfloat16_t svluti2_lane_f16(svfloat16_t, svuint8_t, uint64_t);
10446__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s16)))
10447svint16_t svluti2_lane_s16(svint16_t, svuint8_t, uint64_t);
10448__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u8)))
10449svuint8_t svluti4_lane_u8(svuint8_t, svuint8_t, uint64_t);
10450__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s8)))
10451svint8_t svluti4_lane_s8(svint8_t, svuint8_t, uint64_t);
10452__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16)))
10453svuint16_t svluti4_lane_u16(svuint16_t, svuint8_t, uint64_t);
10454__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16)))
10455svbfloat16_t svluti4_lane_bf16(svbfloat16_t, svuint8_t, uint64_t);
10456__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16)))
10457svfloat16_t svluti4_lane_f16(svfloat16_t, svuint8_t, uint64_t);
10458__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16)))
10459svint16_t svluti4_lane_s16(svint16_t, svuint8_t, uint64_t);
10460__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16_x2)))
10461svuint16_t svluti4_lane_u16_x2(svuint16x2_t, svuint8_t, uint64_t);
10462__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16_x2)))
10463svbfloat16_t svluti4_lane_bf16_x2(svbfloat16x2_t, svuint8_t, uint64_t);
10464__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16_x2)))
10465svfloat16_t svluti4_lane_f16_x2(svfloat16x2_t, svuint8_t, uint64_t);
10466__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16_x2)))
10467svint16_t svluti4_lane_s16_x2(svint16x2_t, svuint8_t, uint64_t);
10468__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u8)))
10469svuint8_t svluti2_lane(svuint8_t, svuint8_t, uint64_t);
10470__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s8)))
10471svint8_t svluti2_lane(svint8_t, svuint8_t, uint64_t);
10472__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u16)))
10473svuint16_t svluti2_lane(svuint16_t, svuint8_t, uint64_t);
10474__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_bf16)))
10475svbfloat16_t svluti2_lane(svbfloat16_t, svuint8_t, uint64_t);
10476__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_f16)))
10477svfloat16_t svluti2_lane(svfloat16_t, svuint8_t, uint64_t);
10478__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s16)))
10479svint16_t svluti2_lane(svint16_t, svuint8_t, uint64_t);
10480__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u8)))
10481svuint8_t svluti4_lane(svuint8_t, svuint8_t, uint64_t);
10482__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s8)))
10483svint8_t svluti4_lane(svint8_t, svuint8_t, uint64_t);
10484__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16)))
10485svuint16_t svluti4_lane(svuint16_t, svuint8_t, uint64_t);
10486__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16)))
10487svbfloat16_t svluti4_lane(svbfloat16_t, svuint8_t, uint64_t);
10488__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16)))
10489svfloat16_t svluti4_lane(svfloat16_t, svuint8_t, uint64_t);
10490__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16)))
10491svint16_t svluti4_lane(svint16_t, svuint8_t, uint64_t);
10492__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16_x2)))
10493svuint16_t svluti4_lane(svuint16x2_t, svuint8_t, uint64_t);
10494__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16_x2)))
10495svbfloat16_t svluti4_lane(svbfloat16x2_t, svuint8_t, uint64_t);
10496__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16_x2)))
10497svfloat16_t svluti4_lane(svfloat16x2_t, svuint8_t, uint64_t);
10498__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16_x2)))
10499svint16_t svluti4_lane(svint16x2_t, svuint8_t, uint64_t);
10500__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_u8)))
10501svuint8_t svaesd_u8(svuint8_t, svuint8_t);
10502__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_u8)))
10503svuint8_t svaese_u8(svuint8_t, svuint8_t);
10504__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesimc_u8)))
10505svuint8_t svaesimc_u8(svuint8_t);
10506__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesmc_u8)))
10507svuint8_t svaesmc_u8(svuint8_t);
10508__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_n_u64)))
10509svuint64_t svpmullb_pair_n_u64(svuint64_t, uint64_t);
10510__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_u64)))
10511svuint64_t svpmullb_pair_u64(svuint64_t, svuint64_t);
10512__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_n_u64)))
10513svuint64_t svpmullt_pair_n_u64(svuint64_t, uint64_t);
10514__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_u64)))
10515svuint64_t svpmullt_pair_u64(svuint64_t, svuint64_t);
10516__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_u8)))
10517svuint8_t svaesd(svuint8_t, svuint8_t);
10518__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_u8)))
10519svuint8_t svaese(svuint8_t, svuint8_t);
10520__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesimc_u8)))
10521svuint8_t svaesimc(svuint8_t);
10522__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesmc_u8)))
10523svuint8_t svaesmc(svuint8_t);
10524__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_n_u64)))
10525svuint64_t svpmullb_pair(svuint64_t, uint64_t);
10526__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_u64)))
10527svuint64_t svpmullb_pair(svuint64_t, svuint64_t);
10528__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_n_u64)))
10529svuint64_t svpmullt_pair(svuint64_t, uint64_t);
10530__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_u64)))
10531svuint64_t svpmullt_pair(svuint64_t, svuint64_t);
10532__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_m)))
10533svbfloat16_t svadd_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10534__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_x)))
10535svbfloat16_t svadd_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10536__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_z)))
10537svbfloat16_t svadd_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10538__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_m)))
10539svbfloat16_t svadd_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10540__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_x)))
10541svbfloat16_t svadd_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10542__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_z)))
10543svbfloat16_t svadd_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10544__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svclamp_bf16)))
10545svbfloat16_t svclamp_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t);
10546__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_m)))
10547svbfloat16_t svmax_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10548__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_x)))
10549svbfloat16_t svmax_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10550__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_z)))
10551svbfloat16_t svmax_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10552__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_m)))
10553svbfloat16_t svmax_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10554__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_x)))
10555svbfloat16_t svmax_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10556__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_z)))
10557svbfloat16_t svmax_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10558__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_m)))
10559svbfloat16_t svmaxnm_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10560__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_x)))
10561svbfloat16_t svmaxnm_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10562__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_z)))
10563svbfloat16_t svmaxnm_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10564__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_m)))
10565svbfloat16_t svmaxnm_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10566__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_x)))
10567svbfloat16_t svmaxnm_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10568__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_z)))
10569svbfloat16_t svmaxnm_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10570__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_m)))
10571svbfloat16_t svmin_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10572__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_x)))
10573svbfloat16_t svmin_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10574__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_z)))
10575svbfloat16_t svmin_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10576__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_m)))
10577svbfloat16_t svmin_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10578__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_x)))
10579svbfloat16_t svmin_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10580__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_z)))
10581svbfloat16_t svmin_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10582__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_m)))
10583svbfloat16_t svminnm_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_x)))
10585svbfloat16_t svminnm_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_z)))
10587svbfloat16_t svminnm_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10588__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_m)))
10589svbfloat16_t svminnm_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10590__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x)))
10591svbfloat16_t svminnm_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10592__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_z)))
10593svbfloat16_t svminnm_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10594__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_m)))
10595svbfloat16_t svmla_n_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10596__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_x)))
10597svbfloat16_t svmla_n_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10598__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_z)))
10599svbfloat16_t svmla_n_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10600__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_m)))
10601svbfloat16_t svmla_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10602__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_x)))
10603svbfloat16_t svmla_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10604__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_z)))
10605svbfloat16_t svmla_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10606__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_lane_bf16)))
10607svbfloat16_t svmla_lane_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
10608__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_m)))
10609svbfloat16_t svmls_n_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10610__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_x)))
10611svbfloat16_t svmls_n_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10612__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_z)))
10613svbfloat16_t svmls_n_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10614__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_m)))
10615svbfloat16_t svmls_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10616__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_x)))
10617svbfloat16_t svmls_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10618__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_z)))
10619svbfloat16_t svmls_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_lane_bf16)))
10621svbfloat16_t svmls_lane_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
10622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_m)))
10623svbfloat16_t svmul_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_x)))
10625svbfloat16_t svmul_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_z)))
10627svbfloat16_t svmul_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_m)))
10629svbfloat16_t svmul_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x)))
10631svbfloat16_t svmul_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_z)))
10633svbfloat16_t svmul_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_lane_bf16)))
10635svbfloat16_t svmul_lane_bf16(svbfloat16_t, svbfloat16_t, uint64_t);
10636__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_m)))
10637svbfloat16_t svsub_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
10638__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_x)))
10639svbfloat16_t svsub_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
10640__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_z)))
10641svbfloat16_t svsub_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
10642__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_m)))
10643svbfloat16_t svsub_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
10644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_x)))
10645svbfloat16_t svsub_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
10646__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_z)))
10647svbfloat16_t svsub_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
10648__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_m)))
10649svbfloat16_t svadd_m(svbool_t, svbfloat16_t, bfloat16_t);
10650__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_x)))
10651svbfloat16_t svadd_x(svbool_t, svbfloat16_t, bfloat16_t);
10652__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_z)))
10653svbfloat16_t svadd_z(svbool_t, svbfloat16_t, bfloat16_t);
10654__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_m)))
10655svbfloat16_t svadd_m(svbool_t, svbfloat16_t, svbfloat16_t);
10656__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_x)))
10657svbfloat16_t svadd_x(svbool_t, svbfloat16_t, svbfloat16_t);
10658__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_z)))
10659svbfloat16_t svadd_z(svbool_t, svbfloat16_t, svbfloat16_t);
10660__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svclamp_bf16)))
10661svbfloat16_t svclamp(svbfloat16_t, svbfloat16_t, svbfloat16_t);
10662__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_m)))
10663svbfloat16_t svmax_m(svbool_t, svbfloat16_t, bfloat16_t);
10664__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_x)))
10665svbfloat16_t svmax_x(svbool_t, svbfloat16_t, bfloat16_t);
10666__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_z)))
10667svbfloat16_t svmax_z(svbool_t, svbfloat16_t, bfloat16_t);
10668__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_m)))
10669svbfloat16_t svmax_m(svbool_t, svbfloat16_t, svbfloat16_t);
10670__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_x)))
10671svbfloat16_t svmax_x(svbool_t, svbfloat16_t, svbfloat16_t);
10672__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_z)))
10673svbfloat16_t svmax_z(svbool_t, svbfloat16_t, svbfloat16_t);
10674__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_m)))
10675svbfloat16_t svmaxnm_m(svbool_t, svbfloat16_t, bfloat16_t);
10676__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_x)))
10677svbfloat16_t svmaxnm_x(svbool_t, svbfloat16_t, bfloat16_t);
10678__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_z)))
10679svbfloat16_t svmaxnm_z(svbool_t, svbfloat16_t, bfloat16_t);
10680__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_m)))
10681svbfloat16_t svmaxnm_m(svbool_t, svbfloat16_t, svbfloat16_t);
10682__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_x)))
10683svbfloat16_t svmaxnm_x(svbool_t, svbfloat16_t, svbfloat16_t);
10684__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_z)))
10685svbfloat16_t svmaxnm_z(svbool_t, svbfloat16_t, svbfloat16_t);
10686__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_m)))
10687svbfloat16_t svmin_m(svbool_t, svbfloat16_t, bfloat16_t);
10688__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_x)))
10689svbfloat16_t svmin_x(svbool_t, svbfloat16_t, bfloat16_t);
10690__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_z)))
10691svbfloat16_t svmin_z(svbool_t, svbfloat16_t, bfloat16_t);
10692__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_m)))
10693svbfloat16_t svmin_m(svbool_t, svbfloat16_t, svbfloat16_t);
10694__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_x)))
10695svbfloat16_t svmin_x(svbool_t, svbfloat16_t, svbfloat16_t);
10696__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_z)))
10697svbfloat16_t svmin_z(svbool_t, svbfloat16_t, svbfloat16_t);
10698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_m)))
10699svbfloat16_t svminnm_m(svbool_t, svbfloat16_t, bfloat16_t);
10700__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_x)))
10701svbfloat16_t svminnm_x(svbool_t, svbfloat16_t, bfloat16_t);
10702__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_z)))
10703svbfloat16_t svminnm_z(svbool_t, svbfloat16_t, bfloat16_t);
10704__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_m)))
10705svbfloat16_t svminnm_m(svbool_t, svbfloat16_t, svbfloat16_t);
10706__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x)))
10707svbfloat16_t svminnm_x(svbool_t, svbfloat16_t, svbfloat16_t);
10708__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_z)))
10709svbfloat16_t svminnm_z(svbool_t, svbfloat16_t, svbfloat16_t);
10710__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_m)))
10711svbfloat16_t svmla_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10712__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_x)))
10713svbfloat16_t svmla_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10714__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_z)))
10715svbfloat16_t svmla_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10716__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_m)))
10717svbfloat16_t svmla_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10718__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_x)))
10719svbfloat16_t svmla_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10720__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_z)))
10721svbfloat16_t svmla_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10722__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_lane_bf16)))
10723svbfloat16_t svmla_lane(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
10724__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_m)))
10725svbfloat16_t svmls_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10726__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_x)))
10727svbfloat16_t svmls_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10728__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_z)))
10729svbfloat16_t svmls_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
10730__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_m)))
10731svbfloat16_t svmls_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10732__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_x)))
10733svbfloat16_t svmls_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10734__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_z)))
10735svbfloat16_t svmls_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
10736__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_lane_bf16)))
10737svbfloat16_t svmls_lane(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
10738__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_m)))
10739svbfloat16_t svmul_m(svbool_t, svbfloat16_t, bfloat16_t);
10740__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_x)))
10741svbfloat16_t svmul_x(svbool_t, svbfloat16_t, bfloat16_t);
10742__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_z)))
10743svbfloat16_t svmul_z(svbool_t, svbfloat16_t, bfloat16_t);
10744__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_m)))
10745svbfloat16_t svmul_m(svbool_t, svbfloat16_t, svbfloat16_t);
10746__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x)))
10747svbfloat16_t svmul_x(svbool_t, svbfloat16_t, svbfloat16_t);
10748__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_z)))
10749svbfloat16_t svmul_z(svbool_t, svbfloat16_t, svbfloat16_t);
10750__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_lane_bf16)))
10751svbfloat16_t svmul_lane(svbfloat16_t, svbfloat16_t, uint64_t);
10752__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_m)))
10753svbfloat16_t svsub_m(svbool_t, svbfloat16_t, bfloat16_t);
10754__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_x)))
10755svbfloat16_t svsub_x(svbool_t, svbfloat16_t, bfloat16_t);
10756__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_z)))
10757svbfloat16_t svsub_z(svbool_t, svbfloat16_t, bfloat16_t);
10758__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_m)))
10759svbfloat16_t svsub_m(svbool_t, svbfloat16_t, svbfloat16_t);
10760__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_x)))
10761svbfloat16_t svsub_x(svbool_t, svbfloat16_t, svbfloat16_t);
10762__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_z)))
10763svbfloat16_t svsub_z(svbool_t, svbfloat16_t, svbfloat16_t);
10764__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u8)))
10765svuint8_t svbdep_n_u8(svuint8_t, uint8_t);
10766__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u32)))
10767svuint32_t svbdep_n_u32(svuint32_t, uint32_t);
10768__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u64)))
10769svuint64_t svbdep_n_u64(svuint64_t, uint64_t);
10770__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u16)))
10771svuint16_t svbdep_n_u16(svuint16_t, uint16_t);
10772__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u8)))
10773svuint8_t svbdep_u8(svuint8_t, svuint8_t);
10774__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u32)))
10775svuint32_t svbdep_u32(svuint32_t, svuint32_t);
10776__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u64)))
10777svuint64_t svbdep_u64(svuint64_t, svuint64_t);
10778__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u16)))
10779svuint16_t svbdep_u16(svuint16_t, svuint16_t);
10780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u8)))
10781svuint8_t svbext_n_u8(svuint8_t, uint8_t);
10782__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u32)))
10783svuint32_t svbext_n_u32(svuint32_t, uint32_t);
10784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u64)))
10785svuint64_t svbext_n_u64(svuint64_t, uint64_t);
10786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u16)))
10787svuint16_t svbext_n_u16(svuint16_t, uint16_t);
10788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u8)))
10789svuint8_t svbext_u8(svuint8_t, svuint8_t);
10790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u32)))
10791svuint32_t svbext_u32(svuint32_t, svuint32_t);
10792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u64)))
10793svuint64_t svbext_u64(svuint64_t, svuint64_t);
10794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u16)))
10795svuint16_t svbext_u16(svuint16_t, svuint16_t);
10796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u8)))
10797svuint8_t svbgrp_n_u8(svuint8_t, uint8_t);
10798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u32)))
10799svuint32_t svbgrp_n_u32(svuint32_t, uint32_t);
10800__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u64)))
10801svuint64_t svbgrp_n_u64(svuint64_t, uint64_t);
10802__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u16)))
10803svuint16_t svbgrp_n_u16(svuint16_t, uint16_t);
10804__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u8)))
10805svuint8_t svbgrp_u8(svuint8_t, svuint8_t);
10806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u32)))
10807svuint32_t svbgrp_u32(svuint32_t, svuint32_t);
10808__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u64)))
10809svuint64_t svbgrp_u64(svuint64_t, svuint64_t);
10810__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u16)))
10811svuint16_t svbgrp_u16(svuint16_t, svuint16_t);
10812__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u8)))
10813svuint8_t svbdep(svuint8_t, uint8_t);
10814__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u32)))
10815svuint32_t svbdep(svuint32_t, uint32_t);
10816__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u64)))
10817svuint64_t svbdep(svuint64_t, uint64_t);
10818__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u16)))
10819svuint16_t svbdep(svuint16_t, uint16_t);
10820__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u8)))
10821svuint8_t svbdep(svuint8_t, svuint8_t);
10822__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u32)))
10823svuint32_t svbdep(svuint32_t, svuint32_t);
10824__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u64)))
10825svuint64_t svbdep(svuint64_t, svuint64_t);
10826__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u16)))
10827svuint16_t svbdep(svuint16_t, svuint16_t);
10828__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u8)))
10829svuint8_t svbext(svuint8_t, uint8_t);
10830__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u32)))
10831svuint32_t svbext(svuint32_t, uint32_t);
10832__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u64)))
10833svuint64_t svbext(svuint64_t, uint64_t);
10834__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u16)))
10835svuint16_t svbext(svuint16_t, uint16_t);
10836__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u8)))
10837svuint8_t svbext(svuint8_t, svuint8_t);
10838__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u32)))
10839svuint32_t svbext(svuint32_t, svuint32_t);
10840__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u64)))
10841svuint64_t svbext(svuint64_t, svuint64_t);
10842__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u16)))
10843svuint16_t svbext(svuint16_t, svuint16_t);
10844__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u8)))
10845svuint8_t svbgrp(svuint8_t, uint8_t);
10846__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u32)))
10847svuint32_t svbgrp(svuint32_t, uint32_t);
10848__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u64)))
10849svuint64_t svbgrp(svuint64_t, uint64_t);
10850__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u16)))
10851svuint16_t svbgrp(svuint16_t, uint16_t);
10852__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u8)))
10853svuint8_t svbgrp(svuint8_t, svuint8_t);
10854__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u32)))
10855svuint32_t svbgrp(svuint32_t, svuint32_t);
10856__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u64)))
10857svuint64_t svbgrp(svuint64_t, svuint64_t);
10858__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u16)))
10859svuint16_t svbgrp(svuint16_t, svuint16_t);
10860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4e_u32)))
10861svuint32_t svsm4e_u32(svuint32_t, svuint32_t);
10862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4ekey_u32)))
10863svuint32_t svsm4ekey_u32(svuint32_t, svuint32_t);
10864__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4e_u32)))
10865svuint32_t svsm4e(svuint32_t, svuint32_t);
10866__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4ekey_u32)))
10867svuint32_t svsm4ekey(svuint32_t, svuint32_t);
10868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u32)))
10869svuint32_t svld1q_gather_u64base_index_u32(svbool_t, svuint64_t, int64_t);
10870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u64)))
10871svuint64_t svld1q_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
10872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u16)))
10873svuint16_t svld1q_gather_u64base_index_u16(svbool_t, svuint64_t, int64_t);
10874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_bf16)))
10875svbfloat16_t svld1q_gather_u64base_index_bf16(svbool_t, svuint64_t, int64_t);
10876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f64)))
10877svfloat64_t svld1q_gather_u64base_index_f64(svbool_t, svuint64_t, int64_t);
10878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f32)))
10879svfloat32_t svld1q_gather_u64base_index_f32(svbool_t, svuint64_t, int64_t);
10880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f16)))
10881svfloat16_t svld1q_gather_u64base_index_f16(svbool_t, svuint64_t, int64_t);
10882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s32)))
10883svint32_t svld1q_gather_u64base_index_s32(svbool_t, svuint64_t, int64_t);
10884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s64)))
10885svint64_t svld1q_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
10886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s16)))
10887svint16_t svld1q_gather_u64base_index_s16(svbool_t, svuint64_t, int64_t);
10888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u8)))
10889svuint8_t svld1q_gather_u64base_offset_u8(svbool_t, svuint64_t, int64_t);
10890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u32)))
10891svuint32_t svld1q_gather_u64base_offset_u32(svbool_t, svuint64_t, int64_t);
10892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u64)))
10893svuint64_t svld1q_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
10894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u16)))
10895svuint16_t svld1q_gather_u64base_offset_u16(svbool_t, svuint64_t, int64_t);
10896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_bf16)))
10897svbfloat16_t svld1q_gather_u64base_offset_bf16(svbool_t, svuint64_t, int64_t);
10898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s8)))
10899svint8_t svld1q_gather_u64base_offset_s8(svbool_t, svuint64_t, int64_t);
10900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f64)))
10901svfloat64_t svld1q_gather_u64base_offset_f64(svbool_t, svuint64_t, int64_t);
10902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f32)))
10903svfloat32_t svld1q_gather_u64base_offset_f32(svbool_t, svuint64_t, int64_t);
10904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f16)))
10905svfloat16_t svld1q_gather_u64base_offset_f16(svbool_t, svuint64_t, int64_t);
10906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s32)))
10907svint32_t svld1q_gather_u64base_offset_s32(svbool_t, svuint64_t, int64_t);
10908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s64)))
10909svint64_t svld1q_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
10910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_mf8)))
10911svmfloat8_t svld1q_gather_u64base_offset_mf8(svbool_t, svuint64_t, int64_t);
10912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s16)))
10913svint16_t svld1q_gather_u64base_offset_s16(svbool_t, svuint64_t, int64_t);
10914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u8)))
10915svuint8_t svld1q_gather_u64base_u8(svbool_t, svuint64_t);
10916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u32)))
10917svuint32_t svld1q_gather_u64base_u32(svbool_t, svuint64_t);
10918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u64)))
10919svuint64_t svld1q_gather_u64base_u64(svbool_t, svuint64_t);
10920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u16)))
10921svuint16_t svld1q_gather_u64base_u16(svbool_t, svuint64_t);
10922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_bf16)))
10923svbfloat16_t svld1q_gather_u64base_bf16(svbool_t, svuint64_t);
10924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s8)))
10925svint8_t svld1q_gather_u64base_s8(svbool_t, svuint64_t);
10926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f64)))
10927svfloat64_t svld1q_gather_u64base_f64(svbool_t, svuint64_t);
10928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f32)))
10929svfloat32_t svld1q_gather_u64base_f32(svbool_t, svuint64_t);
10930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f16)))
10931svfloat16_t svld1q_gather_u64base_f16(svbool_t, svuint64_t);
10932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s32)))
10933svint32_t svld1q_gather_u64base_s32(svbool_t, svuint64_t);
10934__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s64)))
10935svint64_t svld1q_gather_u64base_s64(svbool_t, svuint64_t);
10936__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_mf8)))
10937svmfloat8_t svld1q_gather_u64base_mf8(svbool_t, svuint64_t);
10938__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s16)))
10939svint16_t svld1q_gather_u64base_s16(svbool_t, svuint64_t);
10940__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u32)))
10941svuint32_t svld1q_gather_u64index_u32(svbool_t, uint32_t const *, svuint64_t);
10942__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u64)))
10943svuint64_t svld1q_gather_u64index_u64(svbool_t, uint64_t const *, svuint64_t);
10944__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u16)))
10945svuint16_t svld1q_gather_u64index_u16(svbool_t, uint16_t const *, svuint64_t);
10946__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_bf16)))
10947svbfloat16_t svld1q_gather_u64index_bf16(svbool_t, bfloat16_t const *, svuint64_t);
10948__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f64)))
10949svfloat64_t svld1q_gather_u64index_f64(svbool_t, float64_t const *, svuint64_t);
10950__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f32)))
10951svfloat32_t svld1q_gather_u64index_f32(svbool_t, float32_t const *, svuint64_t);
10952__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f16)))
10953svfloat16_t svld1q_gather_u64index_f16(svbool_t, float16_t const *, svuint64_t);
10954__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s32)))
10955svint32_t svld1q_gather_u64index_s32(svbool_t, int32_t const *, svuint64_t);
10956__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s64)))
10957svint64_t svld1q_gather_u64index_s64(svbool_t, int64_t const *, svuint64_t);
10958__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s16)))
10959svint16_t svld1q_gather_u64index_s16(svbool_t, int16_t const *, svuint64_t);
10960__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u8)))
10961svuint8_t svld1q_gather_u64offset_u8(svbool_t, uint8_t const *, svuint64_t);
10962__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u32)))
10963svuint32_t svld1q_gather_u64offset_u32(svbool_t, uint32_t const *, svuint64_t);
10964__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u64)))
10965svuint64_t svld1q_gather_u64offset_u64(svbool_t, uint64_t const *, svuint64_t);
10966__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u16)))
10967svuint16_t svld1q_gather_u64offset_u16(svbool_t, uint16_t const *, svuint64_t);
10968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_bf16)))
10969svbfloat16_t svld1q_gather_u64offset_bf16(svbool_t, bfloat16_t const *, svuint64_t);
10970__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s8)))
10971svint8_t svld1q_gather_u64offset_s8(svbool_t, int8_t const *, svuint64_t);
10972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f64)))
10973svfloat64_t svld1q_gather_u64offset_f64(svbool_t, float64_t const *, svuint64_t);
10974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f32)))
10975svfloat32_t svld1q_gather_u64offset_f32(svbool_t, float32_t const *, svuint64_t);
10976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f16)))
10977svfloat16_t svld1q_gather_u64offset_f16(svbool_t, float16_t const *, svuint64_t);
10978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s32)))
10979svint32_t svld1q_gather_u64offset_s32(svbool_t, int32_t const *, svuint64_t);
10980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s64)))
10981svint64_t svld1q_gather_u64offset_s64(svbool_t, int64_t const *, svuint64_t);
10982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_mf8)))
10983svmfloat8_t svld1q_gather_u64offset_mf8(svbool_t, mfloat8_t const *, svuint64_t);
10984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s16)))
10985svint16_t svld1q_gather_u64offset_s16(svbool_t, int16_t const *, svuint64_t);
10986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_u64)))
10987svuint64_t svld1udq_u64(svbool_t, uint64_t const *);
10988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_f64)))
10989svfloat64_t svld1udq_f64(svbool_t, float64_t const *);
10990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_s64)))
10991svint64_t svld1udq_s64(svbool_t, int64_t const *);
10992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_u64)))
10993svuint64_t svld1udq_vnum_u64(svbool_t, uint64_t const *, int64_t);
10994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_f64)))
10995svfloat64_t svld1udq_vnum_f64(svbool_t, float64_t const *, int64_t);
10996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_s64)))
10997svint64_t svld1udq_vnum_s64(svbool_t, int64_t const *, int64_t);
10998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_u32)))
10999svuint32_t svld1uwq_u32(svbool_t, uint32_t const *);
11000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_f32)))
11001svfloat32_t svld1uwq_f32(svbool_t, float32_t const *);
11002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_s32)))
11003svint32_t svld1uwq_s32(svbool_t, int32_t const *);
11004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_u32)))
11005svuint32_t svld1uwq_vnum_u32(svbool_t, uint32_t const *, int64_t);
11006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_f32)))
11007svfloat32_t svld1uwq_vnum_f32(svbool_t, float32_t const *, int64_t);
11008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_s32)))
11009svint32_t svld1uwq_vnum_s32(svbool_t, int32_t const *, int64_t);
11010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_u64)))
11011void svst1dq_u64(svbool_t, uint64_t *, svuint64_t);
11012__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_f64)))
11013void svst1dq_f64(svbool_t, float64_t *, svfloat64_t);
11014__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_s64)))
11015void svst1dq_s64(svbool_t, int64_t *, svint64_t);
11016__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_u64)))
11017void svst1dq_vnum_u64(svbool_t, uint64_t *, int64_t, svuint64_t);
11018__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_f64)))
11019void svst1dq_vnum_f64(svbool_t, float64_t *, int64_t, svfloat64_t);
11020__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_s64)))
11021void svst1dq_vnum_s64(svbool_t, int64_t *, int64_t, svint64_t);
11022__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u8)))
11023void svst1q_scatter_u64base_u8(svbool_t, svuint64_t, svuint8_t);
11024__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u32)))
11025void svst1q_scatter_u64base_u32(svbool_t, svuint64_t, svuint32_t);
11026__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u64)))
11027void svst1q_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
11028__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u16)))
11029void svst1q_scatter_u64base_u16(svbool_t, svuint64_t, svuint16_t);
11030__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_bf16)))
11031void svst1q_scatter_u64base_bf16(svbool_t, svuint64_t, svbfloat16_t);
11032__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s8)))
11033void svst1q_scatter_u64base_s8(svbool_t, svuint64_t, svint8_t);
11034__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f64)))
11035void svst1q_scatter_u64base_f64(svbool_t, svuint64_t, svfloat64_t);
11036__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f32)))
11037void svst1q_scatter_u64base_f32(svbool_t, svuint64_t, svfloat32_t);
11038__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f16)))
11039void svst1q_scatter_u64base_f16(svbool_t, svuint64_t, svfloat16_t);
11040__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s32)))
11041void svst1q_scatter_u64base_s32(svbool_t, svuint64_t, svint32_t);
11042__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s64)))
11043void svst1q_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
11044__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_mf8)))
11045void svst1q_scatter_u64base_mf8(svbool_t, svuint64_t, svmfloat8_t);
11046__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s16)))
11047void svst1q_scatter_u64base_s16(svbool_t, svuint64_t, svint16_t);
11048__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u32)))
11049void svst1q_scatter_u64base_index_u32(svbool_t, svuint64_t, int64_t, svuint32_t);
11050__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u64)))
11051void svst1q_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
11052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u16)))
11053void svst1q_scatter_u64base_index_u16(svbool_t, svuint64_t, int64_t, svuint16_t);
11054__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_bf16)))
11055void svst1q_scatter_u64base_index_bf16(svbool_t, svuint64_t, int64_t, svbfloat16_t);
11056__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f64)))
11057void svst1q_scatter_u64base_index_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
11058__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f32)))
11059void svst1q_scatter_u64base_index_f32(svbool_t, svuint64_t, int64_t, svfloat32_t);
11060__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f16)))
11061void svst1q_scatter_u64base_index_f16(svbool_t, svuint64_t, int64_t, svfloat16_t);
11062__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s32)))
11063void svst1q_scatter_u64base_index_s32(svbool_t, svuint64_t, int64_t, svint32_t);
11064__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s64)))
11065void svst1q_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
11066__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s16)))
11067void svst1q_scatter_u64base_index_s16(svbool_t, svuint64_t, int64_t, svint16_t);
11068__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u8)))
11069void svst1q_scatter_u64base_offset_u8(svbool_t, svuint64_t, int64_t, svuint8_t);
11070__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u32)))
11071void svst1q_scatter_u64base_offset_u32(svbool_t, svuint64_t, int64_t, svuint32_t);
11072__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u64)))
11073void svst1q_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
11074__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u16)))
11075void svst1q_scatter_u64base_offset_u16(svbool_t, svuint64_t, int64_t, svuint16_t);
11076__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_bf16)))
11077void svst1q_scatter_u64base_offset_bf16(svbool_t, svuint64_t, int64_t, svbfloat16_t);
11078__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s8)))
11079void svst1q_scatter_u64base_offset_s8(svbool_t, svuint64_t, int64_t, svint8_t);
11080__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f64)))
11081void svst1q_scatter_u64base_offset_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
11082__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f32)))
11083void svst1q_scatter_u64base_offset_f32(svbool_t, svuint64_t, int64_t, svfloat32_t);
11084__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f16)))
11085void svst1q_scatter_u64base_offset_f16(svbool_t, svuint64_t, int64_t, svfloat16_t);
11086__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s32)))
11087void svst1q_scatter_u64base_offset_s32(svbool_t, svuint64_t, int64_t, svint32_t);
11088__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s64)))
11089void svst1q_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
11090__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_mf8)))
11091void svst1q_scatter_u64base_offset_mf8(svbool_t, svuint64_t, int64_t, svmfloat8_t);
11092__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s16)))
11093void svst1q_scatter_u64base_offset_s16(svbool_t, svuint64_t, int64_t, svint16_t);
11094__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u32)))
11095void svst1q_scatter_s64index_u32(svbool_t, uint32_t *, svint64_t, svuint32_t);
11096__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u64)))
11097void svst1q_scatter_s64index_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
11098__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u16)))
11099void svst1q_scatter_s64index_u16(svbool_t, uint16_t *, svint64_t, svuint16_t);
11100__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_bf16)))
11101void svst1q_scatter_s64index_bf16(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
11102__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f64)))
11103void svst1q_scatter_s64index_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
11104__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f32)))
11105void svst1q_scatter_s64index_f32(svbool_t, float32_t *, svint64_t, svfloat32_t);
11106__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f16)))
11107void svst1q_scatter_s64index_f16(svbool_t, float16_t *, svint64_t, svfloat16_t);
11108__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s32)))
11109void svst1q_scatter_s64index_s32(svbool_t, int32_t *, svint64_t, svint32_t);
11110__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s64)))
11111void svst1q_scatter_s64index_s64(svbool_t, int64_t *, svint64_t, svint64_t);
11112__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s16)))
11113void svst1q_scatter_s64index_s16(svbool_t, int16_t *, svint64_t, svint16_t);
11114__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u32)))
11115void svst1q_scatter_u64index_u32(svbool_t, uint32_t *, svuint64_t, svuint32_t);
11116__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u64)))
11117void svst1q_scatter_u64index_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
11118__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u16)))
11119void svst1q_scatter_u64index_u16(svbool_t, uint16_t *, svuint64_t, svuint16_t);
11120__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_bf16)))
11121void svst1q_scatter_u64index_bf16(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
11122__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f64)))
11123void svst1q_scatter_u64index_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
11124__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f32)))
11125void svst1q_scatter_u64index_f32(svbool_t, float32_t *, svuint64_t, svfloat32_t);
11126__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f16)))
11127void svst1q_scatter_u64index_f16(svbool_t, float16_t *, svuint64_t, svfloat16_t);
11128__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s32)))
11129void svst1q_scatter_u64index_s32(svbool_t, int32_t *, svuint64_t, svint32_t);
11130__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s64)))
11131void svst1q_scatter_u64index_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
11132__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s16)))
11133void svst1q_scatter_u64index_s16(svbool_t, int16_t *, svuint64_t, svint16_t);
11134__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u8)))
11135void svst1q_scatter_s64offset_u8(svbool_t, uint8_t *, svint64_t, svuint8_t);
11136__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u32)))
11137void svst1q_scatter_s64offset_u32(svbool_t, uint32_t *, svint64_t, svuint32_t);
11138__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u64)))
11139void svst1q_scatter_s64offset_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
11140__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u16)))
11141void svst1q_scatter_s64offset_u16(svbool_t, uint16_t *, svint64_t, svuint16_t);
11142__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_bf16)))
11143void svst1q_scatter_s64offset_bf16(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
11144__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s8)))
11145void svst1q_scatter_s64offset_s8(svbool_t, int8_t *, svint64_t, svint8_t);
11146__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f64)))
11147void svst1q_scatter_s64offset_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
11148__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f32)))
11149void svst1q_scatter_s64offset_f32(svbool_t, float32_t *, svint64_t, svfloat32_t);
11150__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f16)))
11151void svst1q_scatter_s64offset_f16(svbool_t, float16_t *, svint64_t, svfloat16_t);
11152__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s32)))
11153void svst1q_scatter_s64offset_s32(svbool_t, int32_t *, svint64_t, svint32_t);
11154__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s64)))
11155void svst1q_scatter_s64offset_s64(svbool_t, int64_t *, svint64_t, svint64_t);
11156__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_mf8)))
11157void svst1q_scatter_s64offset_mf8(svbool_t, mfloat8_t *, svint64_t, svmfloat8_t);
11158__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s16)))
11159void svst1q_scatter_s64offset_s16(svbool_t, int16_t *, svint64_t, svint16_t);
11160__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u8)))
11161void svst1q_scatter_u64offset_u8(svbool_t, uint8_t *, svuint64_t, svuint8_t);
11162__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u32)))
11163void svst1q_scatter_u64offset_u32(svbool_t, uint32_t *, svuint64_t, svuint32_t);
11164__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u64)))
11165void svst1q_scatter_u64offset_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
11166__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u16)))
11167void svst1q_scatter_u64offset_u16(svbool_t, uint16_t *, svuint64_t, svuint16_t);
11168__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_bf16)))
11169void svst1q_scatter_u64offset_bf16(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
11170__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s8)))
11171void svst1q_scatter_u64offset_s8(svbool_t, int8_t *, svuint64_t, svint8_t);
11172__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f64)))
11173void svst1q_scatter_u64offset_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
11174__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f32)))
11175void svst1q_scatter_u64offset_f32(svbool_t, float32_t *, svuint64_t, svfloat32_t);
11176__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f16)))
11177void svst1q_scatter_u64offset_f16(svbool_t, float16_t *, svuint64_t, svfloat16_t);
11178__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s32)))
11179void svst1q_scatter_u64offset_s32(svbool_t, int32_t *, svuint64_t, svint32_t);
11180__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s64)))
11181void svst1q_scatter_u64offset_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
11182__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_mf8)))
11183void svst1q_scatter_u64offset_mf8(svbool_t, mfloat8_t *, svuint64_t, svmfloat8_t);
11184__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s16)))
11185void svst1q_scatter_u64offset_s16(svbool_t, int16_t *, svuint64_t, svint16_t);
11186__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_u32)))
11187void svst1wq_u32(svbool_t, uint32_t *, svuint32_t);
11188__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_f32)))
11189void svst1wq_f32(svbool_t, float32_t *, svfloat32_t);
11190__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_s32)))
11191void svst1wq_s32(svbool_t, int32_t *, svint32_t);
11192__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_u32)))
11193void svst1wq_vnum_u32(svbool_t, uint32_t *, int64_t, svuint32_t);
11194__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_f32)))
11195void svst1wq_vnum_f32(svbool_t, float32_t *, int64_t, svfloat32_t);
11196__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_s32)))
11197void svst1wq_vnum_s32(svbool_t, int32_t *, int64_t, svint32_t);
11198__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u32)))
11199svuint32_t svld1q_gather_index_u32(svbool_t, svuint64_t, int64_t);
11200__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u64)))
11201svuint64_t svld1q_gather_index_u64(svbool_t, svuint64_t, int64_t);
11202__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u16)))
11203svuint16_t svld1q_gather_index_u16(svbool_t, svuint64_t, int64_t);
11204__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_bf16)))
11205svbfloat16_t svld1q_gather_index_bf16(svbool_t, svuint64_t, int64_t);
11206__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f64)))
11207svfloat64_t svld1q_gather_index_f64(svbool_t, svuint64_t, int64_t);
11208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f32)))
11209svfloat32_t svld1q_gather_index_f32(svbool_t, svuint64_t, int64_t);
11210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f16)))
11211svfloat16_t svld1q_gather_index_f16(svbool_t, svuint64_t, int64_t);
11212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s32)))
11213svint32_t svld1q_gather_index_s32(svbool_t, svuint64_t, int64_t);
11214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s64)))
11215svint64_t svld1q_gather_index_s64(svbool_t, svuint64_t, int64_t);
11216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s16)))
11217svint16_t svld1q_gather_index_s16(svbool_t, svuint64_t, int64_t);
11218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u8)))
11219svuint8_t svld1q_gather_offset_u8(svbool_t, svuint64_t, int64_t);
11220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u32)))
11221svuint32_t svld1q_gather_offset_u32(svbool_t, svuint64_t, int64_t);
11222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u64)))
11223svuint64_t svld1q_gather_offset_u64(svbool_t, svuint64_t, int64_t);
11224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u16)))
11225svuint16_t svld1q_gather_offset_u16(svbool_t, svuint64_t, int64_t);
11226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_bf16)))
11227svbfloat16_t svld1q_gather_offset_bf16(svbool_t, svuint64_t, int64_t);
11228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s8)))
11229svint8_t svld1q_gather_offset_s8(svbool_t, svuint64_t, int64_t);
11230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f64)))
11231svfloat64_t svld1q_gather_offset_f64(svbool_t, svuint64_t, int64_t);
11232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f32)))
11233svfloat32_t svld1q_gather_offset_f32(svbool_t, svuint64_t, int64_t);
11234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f16)))
11235svfloat16_t svld1q_gather_offset_f16(svbool_t, svuint64_t, int64_t);
11236__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s32)))
11237svint32_t svld1q_gather_offset_s32(svbool_t, svuint64_t, int64_t);
11238__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s64)))
11239svint64_t svld1q_gather_offset_s64(svbool_t, svuint64_t, int64_t);
11240__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_mf8)))
11241svmfloat8_t svld1q_gather_offset_mf8(svbool_t, svuint64_t, int64_t);
11242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s16)))
11243svint16_t svld1q_gather_offset_s16(svbool_t, svuint64_t, int64_t);
11244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u8)))
11245svuint8_t svld1q_gather_u8(svbool_t, svuint64_t);
11246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u32)))
11247svuint32_t svld1q_gather_u32(svbool_t, svuint64_t);
11248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u64)))
11249svuint64_t svld1q_gather_u64(svbool_t, svuint64_t);
11250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u16)))
11251svuint16_t svld1q_gather_u16(svbool_t, svuint64_t);
11252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_bf16)))
11253svbfloat16_t svld1q_gather_bf16(svbool_t, svuint64_t);
11254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s8)))
11255svint8_t svld1q_gather_s8(svbool_t, svuint64_t);
11256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f64)))
11257svfloat64_t svld1q_gather_f64(svbool_t, svuint64_t);
11258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f32)))
11259svfloat32_t svld1q_gather_f32(svbool_t, svuint64_t);
11260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f16)))
11261svfloat16_t svld1q_gather_f16(svbool_t, svuint64_t);
11262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s32)))
11263svint32_t svld1q_gather_s32(svbool_t, svuint64_t);
11264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s64)))
11265svint64_t svld1q_gather_s64(svbool_t, svuint64_t);
11266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_mf8)))
11267svmfloat8_t svld1q_gather_mf8(svbool_t, svuint64_t);
11268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s16)))
11269svint16_t svld1q_gather_s16(svbool_t, svuint64_t);
11270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u32)))
11271svuint32_t svld1q_gather_index(svbool_t, uint32_t const *, svuint64_t);
11272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u64)))
11273svuint64_t svld1q_gather_index(svbool_t, uint64_t const *, svuint64_t);
11274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u16)))
11275svuint16_t svld1q_gather_index(svbool_t, uint16_t const *, svuint64_t);
11276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_bf16)))
11277svbfloat16_t svld1q_gather_index(svbool_t, bfloat16_t const *, svuint64_t);
11278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f64)))
11279svfloat64_t svld1q_gather_index(svbool_t, float64_t const *, svuint64_t);
11280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f32)))
11281svfloat32_t svld1q_gather_index(svbool_t, float32_t const *, svuint64_t);
11282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f16)))
11283svfloat16_t svld1q_gather_index(svbool_t, float16_t const *, svuint64_t);
11284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s32)))
11285svint32_t svld1q_gather_index(svbool_t, int32_t const *, svuint64_t);
11286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s64)))
11287svint64_t svld1q_gather_index(svbool_t, int64_t const *, svuint64_t);
11288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s16)))
11289svint16_t svld1q_gather_index(svbool_t, int16_t const *, svuint64_t);
11290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u8)))
11291svuint8_t svld1q_gather_offset(svbool_t, uint8_t const *, svuint64_t);
11292__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u32)))
11293svuint32_t svld1q_gather_offset(svbool_t, uint32_t const *, svuint64_t);
11294__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u64)))
11295svuint64_t svld1q_gather_offset(svbool_t, uint64_t const *, svuint64_t);
11296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u16)))
11297svuint16_t svld1q_gather_offset(svbool_t, uint16_t const *, svuint64_t);
11298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_bf16)))
11299svbfloat16_t svld1q_gather_offset(svbool_t, bfloat16_t const *, svuint64_t);
11300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s8)))
11301svint8_t svld1q_gather_offset(svbool_t, int8_t const *, svuint64_t);
11302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f64)))
11303svfloat64_t svld1q_gather_offset(svbool_t, float64_t const *, svuint64_t);
11304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f32)))
11305svfloat32_t svld1q_gather_offset(svbool_t, float32_t const *, svuint64_t);
11306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f16)))
11307svfloat16_t svld1q_gather_offset(svbool_t, float16_t const *, svuint64_t);
11308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s32)))
11309svint32_t svld1q_gather_offset(svbool_t, int32_t const *, svuint64_t);
11310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s64)))
11311svint64_t svld1q_gather_offset(svbool_t, int64_t const *, svuint64_t);
11312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_mf8)))
11313svmfloat8_t svld1q_gather_offset(svbool_t, mfloat8_t const *, svuint64_t);
11314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s16)))
11315svint16_t svld1q_gather_offset(svbool_t, int16_t const *, svuint64_t);
11316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_u64)))
11317svuint64_t svld1udq(svbool_t, uint64_t const *);
11318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_f64)))
11319svfloat64_t svld1udq(svbool_t, float64_t const *);
11320__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_s64)))
11321svint64_t svld1udq(svbool_t, int64_t const *);
11322__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_u64)))
11323svuint64_t svld1udq_vnum(svbool_t, uint64_t const *, int64_t);
11324__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_f64)))
11325svfloat64_t svld1udq_vnum(svbool_t, float64_t const *, int64_t);
11326__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_s64)))
11327svint64_t svld1udq_vnum(svbool_t, int64_t const *, int64_t);
11328__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_u32)))
11329svuint32_t svld1uwq(svbool_t, uint32_t const *);
11330__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_f32)))
11331svfloat32_t svld1uwq(svbool_t, float32_t const *);
11332__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_s32)))
11333svint32_t svld1uwq(svbool_t, int32_t const *);
11334__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_u32)))
11335svuint32_t svld1uwq_vnum(svbool_t, uint32_t const *, int64_t);
11336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_f32)))
11337svfloat32_t svld1uwq_vnum(svbool_t, float32_t const *, int64_t);
11338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_s32)))
11339svint32_t svld1uwq_vnum(svbool_t, int32_t const *, int64_t);
11340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_u64)))
11341void svst1dq(svbool_t, uint64_t *, svuint64_t);
11342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_f64)))
11343void svst1dq(svbool_t, float64_t *, svfloat64_t);
11344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_s64)))
11345void svst1dq(svbool_t, int64_t *, svint64_t);
11346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_u64)))
11347void svst1dq_vnum(svbool_t, uint64_t *, int64_t, svuint64_t);
11348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_f64)))
11349void svst1dq_vnum(svbool_t, float64_t *, int64_t, svfloat64_t);
11350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_s64)))
11351void svst1dq_vnum(svbool_t, int64_t *, int64_t, svint64_t);
11352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u8)))
11353void svst1q_scatter(svbool_t, svuint64_t, svuint8_t);
11354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u32)))
11355void svst1q_scatter(svbool_t, svuint64_t, svuint32_t);
11356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u64)))
11357void svst1q_scatter(svbool_t, svuint64_t, svuint64_t);
11358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u16)))
11359void svst1q_scatter(svbool_t, svuint64_t, svuint16_t);
11360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_bf16)))
11361void svst1q_scatter(svbool_t, svuint64_t, svbfloat16_t);
11362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s8)))
11363void svst1q_scatter(svbool_t, svuint64_t, svint8_t);
11364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f64)))
11365void svst1q_scatter(svbool_t, svuint64_t, svfloat64_t);
11366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f32)))
11367void svst1q_scatter(svbool_t, svuint64_t, svfloat32_t);
11368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f16)))
11369void svst1q_scatter(svbool_t, svuint64_t, svfloat16_t);
11370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s32)))
11371void svst1q_scatter(svbool_t, svuint64_t, svint32_t);
11372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s64)))
11373void svst1q_scatter(svbool_t, svuint64_t, svint64_t);
11374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_mf8)))
11375void svst1q_scatter(svbool_t, svuint64_t, svmfloat8_t);
11376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s16)))
11377void svst1q_scatter(svbool_t, svuint64_t, svint16_t);
11378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u32)))
11379void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svuint32_t);
11380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u64)))
11381void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
11382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u16)))
11383void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svuint16_t);
11384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_bf16)))
11385void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svbfloat16_t);
11386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f64)))
11387void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svfloat64_t);
11388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f32)))
11389void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svfloat32_t);
11390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f16)))
11391void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svfloat16_t);
11392__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s32)))
11393void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svint32_t);
11394__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s64)))
11395void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
11396__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s16)))
11397void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svint16_t);
11398__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u8)))
11399void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint8_t);
11400__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u32)))
11401void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint32_t);
11402__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u64)))
11403void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
11404__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u16)))
11405void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint16_t);
11406__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_bf16)))
11407void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svbfloat16_t);
11408__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s8)))
11409void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint8_t);
11410__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f64)))
11411void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat64_t);
11412__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f32)))
11413void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat32_t);
11414__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f16)))
11415void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat16_t);
11416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s32)))
11417void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint32_t);
11418__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s64)))
11419void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
11420__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_mf8)))
11421void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svmfloat8_t);
11422__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s16)))
11423void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint16_t);
11424__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u32)))
11425void svst1q_scatter_index(svbool_t, uint32_t *, svint64_t, svuint32_t);
11426__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u64)))
11427void svst1q_scatter_index(svbool_t, uint64_t *, svint64_t, svuint64_t);
11428__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u16)))
11429void svst1q_scatter_index(svbool_t, uint16_t *, svint64_t, svuint16_t);
11430__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_bf16)))
11431void svst1q_scatter_index(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
11432__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f64)))
11433void svst1q_scatter_index(svbool_t, float64_t *, svint64_t, svfloat64_t);
11434__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f32)))
11435void svst1q_scatter_index(svbool_t, float32_t *, svint64_t, svfloat32_t);
11436__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f16)))
11437void svst1q_scatter_index(svbool_t, float16_t *, svint64_t, svfloat16_t);
11438__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s32)))
11439void svst1q_scatter_index(svbool_t, int32_t *, svint64_t, svint32_t);
11440__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s64)))
11441void svst1q_scatter_index(svbool_t, int64_t *, svint64_t, svint64_t);
11442__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s16)))
11443void svst1q_scatter_index(svbool_t, int16_t *, svint64_t, svint16_t);
11444__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u32)))
11445void svst1q_scatter_index(svbool_t, uint32_t *, svuint64_t, svuint32_t);
11446__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u64)))
11447void svst1q_scatter_index(svbool_t, uint64_t *, svuint64_t, svuint64_t);
11448__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u16)))
11449void svst1q_scatter_index(svbool_t, uint16_t *, svuint64_t, svuint16_t);
11450__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_bf16)))
11451void svst1q_scatter_index(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
11452__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f64)))
11453void svst1q_scatter_index(svbool_t, float64_t *, svuint64_t, svfloat64_t);
11454__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f32)))
11455void svst1q_scatter_index(svbool_t, float32_t *, svuint64_t, svfloat32_t);
11456__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f16)))
11457void svst1q_scatter_index(svbool_t, float16_t *, svuint64_t, svfloat16_t);
11458__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s32)))
11459void svst1q_scatter_index(svbool_t, int32_t *, svuint64_t, svint32_t);
11460__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s64)))
11461void svst1q_scatter_index(svbool_t, int64_t *, svuint64_t, svint64_t);
11462__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s16)))
11463void svst1q_scatter_index(svbool_t, int16_t *, svuint64_t, svint16_t);
11464__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u8)))
11465void svst1q_scatter_offset(svbool_t, uint8_t *, svint64_t, svuint8_t);
11466__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u32)))
11467void svst1q_scatter_offset(svbool_t, uint32_t *, svint64_t, svuint32_t);
11468__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u64)))
11469void svst1q_scatter_offset(svbool_t, uint64_t *, svint64_t, svuint64_t);
11470__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u16)))
11471void svst1q_scatter_offset(svbool_t, uint16_t *, svint64_t, svuint16_t);
11472__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_bf16)))
11473void svst1q_scatter_offset(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
11474__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s8)))
11475void svst1q_scatter_offset(svbool_t, int8_t *, svint64_t, svint8_t);
11476__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f64)))
11477void svst1q_scatter_offset(svbool_t, float64_t *, svint64_t, svfloat64_t);
11478__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f32)))
11479void svst1q_scatter_offset(svbool_t, float32_t *, svint64_t, svfloat32_t);
11480__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f16)))
11481void svst1q_scatter_offset(svbool_t, float16_t *, svint64_t, svfloat16_t);
11482__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s32)))
11483void svst1q_scatter_offset(svbool_t, int32_t *, svint64_t, svint32_t);
11484__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s64)))
11485void svst1q_scatter_offset(svbool_t, int64_t *, svint64_t, svint64_t);
11486__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_mf8)))
11487void svst1q_scatter_offset(svbool_t, mfloat8_t *, svint64_t, svmfloat8_t);
11488__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s16)))
11489void svst1q_scatter_offset(svbool_t, int16_t *, svint64_t, svint16_t);
11490__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u8)))
11491void svst1q_scatter_offset(svbool_t, uint8_t *, svuint64_t, svuint8_t);
11492__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u32)))
11493void svst1q_scatter_offset(svbool_t, uint32_t *, svuint64_t, svuint32_t);
11494__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u64)))
11495void svst1q_scatter_offset(svbool_t, uint64_t *, svuint64_t, svuint64_t);
11496__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u16)))
11497void svst1q_scatter_offset(svbool_t, uint16_t *, svuint64_t, svuint16_t);
11498__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_bf16)))
11499void svst1q_scatter_offset(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
11500__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s8)))
11501void svst1q_scatter_offset(svbool_t, int8_t *, svuint64_t, svint8_t);
11502__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f64)))
11503void svst1q_scatter_offset(svbool_t, float64_t *, svuint64_t, svfloat64_t);
11504__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f32)))
11505void svst1q_scatter_offset(svbool_t, float32_t *, svuint64_t, svfloat32_t);
11506__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f16)))
11507void svst1q_scatter_offset(svbool_t, float16_t *, svuint64_t, svfloat16_t);
11508__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s32)))
11509void svst1q_scatter_offset(svbool_t, int32_t *, svuint64_t, svint32_t);
11510__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s64)))
11511void svst1q_scatter_offset(svbool_t, int64_t *, svuint64_t, svint64_t);
11512__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_mf8)))
11513void svst1q_scatter_offset(svbool_t, mfloat8_t *, svuint64_t, svmfloat8_t);
11514__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s16)))
11515void svst1q_scatter_offset(svbool_t, int16_t *, svuint64_t, svint16_t);
11516__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_u32)))
11517void svst1wq(svbool_t, uint32_t *, svuint32_t);
11518__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_f32)))
11519void svst1wq(svbool_t, float32_t *, svfloat32_t);
11520__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_s32)))
11521void svst1wq(svbool_t, int32_t *, svint32_t);
11522__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_u32)))
11523void svst1wq_vnum(svbool_t, uint32_t *, int64_t, svuint32_t);
11524__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_f32)))
11525void svst1wq_vnum(svbool_t, float32_t *, int64_t, svfloat32_t);
11526__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_s32)))
11527void svst1wq_vnum(svbool_t, int32_t *, int64_t, svint32_t);
11528__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c8)))
11529uint64_t svcntp_c8(svcount_t, uint64_t);
11530__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c32)))
11531uint64_t svcntp_c32(svcount_t, uint64_t);
11532__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c64)))
11533uint64_t svcntp_c64(svcount_t, uint64_t);
11534__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c16)))
11535uint64_t svcntp_c16(svcount_t, uint64_t);
11536__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x2)))
11537svuint8x2_t svld1_u8_x2(svcount_t, uint8_t const *);
11538__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x2)))
11539svint8x2_t svld1_s8_x2(svcount_t, int8_t const *);
11540__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x2)))
11541svmfloat8x2_t svld1_mf8_x2(svcount_t, mfloat8_t const *);
11542__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x2)))
11543svuint64x2_t svld1_u64_x2(svcount_t, uint64_t const *);
11544__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x2)))
11545svfloat64x2_t svld1_f64_x2(svcount_t, float64_t const *);
11546__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x2)))
11547svint64x2_t svld1_s64_x2(svcount_t, int64_t const *);
11548__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x2)))
11549svuint16x2_t svld1_u16_x2(svcount_t, uint16_t const *);
11550__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x2)))
11551svbfloat16x2_t svld1_bf16_x2(svcount_t, bfloat16_t const *);
11552__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x2)))
11553svfloat16x2_t svld1_f16_x2(svcount_t, float16_t const *);
11554__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x2)))
11555svint16x2_t svld1_s16_x2(svcount_t, int16_t const *);
11556__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x2)))
11557svuint32x2_t svld1_u32_x2(svcount_t, uint32_t const *);
11558__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x2)))
11559svfloat32x2_t svld1_f32_x2(svcount_t, float32_t const *);
11560__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x2)))
11561svint32x2_t svld1_s32_x2(svcount_t, int32_t const *);
11562__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x4)))
11563svuint8x4_t svld1_u8_x4(svcount_t, uint8_t const *);
11564__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x4)))
11565svint8x4_t svld1_s8_x4(svcount_t, int8_t const *);
11566__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x4)))
11567svmfloat8x4_t svld1_mf8_x4(svcount_t, mfloat8_t const *);
11568__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x4)))
11569svuint64x4_t svld1_u64_x4(svcount_t, uint64_t const *);
11570__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x4)))
11571svfloat64x4_t svld1_f64_x4(svcount_t, float64_t const *);
11572__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x4)))
11573svint64x4_t svld1_s64_x4(svcount_t, int64_t const *);
11574__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x4)))
11575svuint16x4_t svld1_u16_x4(svcount_t, uint16_t const *);
11576__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x4)))
11577svbfloat16x4_t svld1_bf16_x4(svcount_t, bfloat16_t const *);
11578__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x4)))
11579svfloat16x4_t svld1_f16_x4(svcount_t, float16_t const *);
11580__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x4)))
11581svint16x4_t svld1_s16_x4(svcount_t, int16_t const *);
11582__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x4)))
11583svuint32x4_t svld1_u32_x4(svcount_t, uint32_t const *);
11584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x4)))
11585svfloat32x4_t svld1_f32_x4(svcount_t, float32_t const *);
11586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x4)))
11587svint32x4_t svld1_s32_x4(svcount_t, int32_t const *);
11588__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x2)))
11589svuint8x2_t svld1_vnum_u8_x2(svcount_t, uint8_t const *, int64_t);
11590__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x2)))
11591svint8x2_t svld1_vnum_s8_x2(svcount_t, int8_t const *, int64_t);
11592__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x2)))
11593svmfloat8x2_t svld1_vnum_mf8_x2(svcount_t, mfloat8_t const *, int64_t);
11594__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x2)))
11595svuint64x2_t svld1_vnum_u64_x2(svcount_t, uint64_t const *, int64_t);
11596__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x2)))
11597svfloat64x2_t svld1_vnum_f64_x2(svcount_t, float64_t const *, int64_t);
11598__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x2)))
11599svint64x2_t svld1_vnum_s64_x2(svcount_t, int64_t const *, int64_t);
11600__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x2)))
11601svuint16x2_t svld1_vnum_u16_x2(svcount_t, uint16_t const *, int64_t);
11602__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x2)))
11603svbfloat16x2_t svld1_vnum_bf16_x2(svcount_t, bfloat16_t const *, int64_t);
11604__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x2)))
11605svfloat16x2_t svld1_vnum_f16_x2(svcount_t, float16_t const *, int64_t);
11606__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x2)))
11607svint16x2_t svld1_vnum_s16_x2(svcount_t, int16_t const *, int64_t);
11608__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x2)))
11609svuint32x2_t svld1_vnum_u32_x2(svcount_t, uint32_t const *, int64_t);
11610__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x2)))
11611svfloat32x2_t svld1_vnum_f32_x2(svcount_t, float32_t const *, int64_t);
11612__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x2)))
11613svint32x2_t svld1_vnum_s32_x2(svcount_t, int32_t const *, int64_t);
11614__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x4)))
11615svuint8x4_t svld1_vnum_u8_x4(svcount_t, uint8_t const *, int64_t);
11616__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x4)))
11617svint8x4_t svld1_vnum_s8_x4(svcount_t, int8_t const *, int64_t);
11618__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x4)))
11619svmfloat8x4_t svld1_vnum_mf8_x4(svcount_t, mfloat8_t const *, int64_t);
11620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x4)))
11621svuint64x4_t svld1_vnum_u64_x4(svcount_t, uint64_t const *, int64_t);
11622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x4)))
11623svfloat64x4_t svld1_vnum_f64_x4(svcount_t, float64_t const *, int64_t);
11624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x4)))
11625svint64x4_t svld1_vnum_s64_x4(svcount_t, int64_t const *, int64_t);
11626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x4)))
11627svuint16x4_t svld1_vnum_u16_x4(svcount_t, uint16_t const *, int64_t);
11628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x4)))
11629svbfloat16x4_t svld1_vnum_bf16_x4(svcount_t, bfloat16_t const *, int64_t);
11630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x4)))
11631svfloat16x4_t svld1_vnum_f16_x4(svcount_t, float16_t const *, int64_t);
11632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x4)))
11633svint16x4_t svld1_vnum_s16_x4(svcount_t, int16_t const *, int64_t);
11634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x4)))
11635svuint32x4_t svld1_vnum_u32_x4(svcount_t, uint32_t const *, int64_t);
11636__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x4)))
11637svfloat32x4_t svld1_vnum_f32_x4(svcount_t, float32_t const *, int64_t);
11638__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x4)))
11639svint32x4_t svld1_vnum_s32_x4(svcount_t, int32_t const *, int64_t);
11640__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x2)))
11641svuint8x2_t svldnt1_u8_x2(svcount_t, uint8_t const *);
11642__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x2)))
11643svint8x2_t svldnt1_s8_x2(svcount_t, int8_t const *);
11644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x2)))
11645svmfloat8x2_t svldnt1_mf8_x2(svcount_t, mfloat8_t const *);
11646__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x2)))
11647svuint64x2_t svldnt1_u64_x2(svcount_t, uint64_t const *);
11648__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x2)))
11649svfloat64x2_t svldnt1_f64_x2(svcount_t, float64_t const *);
11650__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x2)))
11651svint64x2_t svldnt1_s64_x2(svcount_t, int64_t const *);
11652__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x2)))
11653svuint16x2_t svldnt1_u16_x2(svcount_t, uint16_t const *);
11654__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x2)))
11655svbfloat16x2_t svldnt1_bf16_x2(svcount_t, bfloat16_t const *);
11656__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x2)))
11657svfloat16x2_t svldnt1_f16_x2(svcount_t, float16_t const *);
11658__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x2)))
11659svint16x2_t svldnt1_s16_x2(svcount_t, int16_t const *);
11660__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x2)))
11661svuint32x2_t svldnt1_u32_x2(svcount_t, uint32_t const *);
11662__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x2)))
11663svfloat32x2_t svldnt1_f32_x2(svcount_t, float32_t const *);
11664__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x2)))
11665svint32x2_t svldnt1_s32_x2(svcount_t, int32_t const *);
11666__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x4)))
11667svuint8x4_t svldnt1_u8_x4(svcount_t, uint8_t const *);
11668__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x4)))
11669svint8x4_t svldnt1_s8_x4(svcount_t, int8_t const *);
11670__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x4)))
11671svmfloat8x4_t svldnt1_mf8_x4(svcount_t, mfloat8_t const *);
11672__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x4)))
11673svuint64x4_t svldnt1_u64_x4(svcount_t, uint64_t const *);
11674__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x4)))
11675svfloat64x4_t svldnt1_f64_x4(svcount_t, float64_t const *);
11676__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x4)))
11677svint64x4_t svldnt1_s64_x4(svcount_t, int64_t const *);
11678__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x4)))
11679svuint16x4_t svldnt1_u16_x4(svcount_t, uint16_t const *);
11680__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x4)))
11681svbfloat16x4_t svldnt1_bf16_x4(svcount_t, bfloat16_t const *);
11682__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x4)))
11683svfloat16x4_t svldnt1_f16_x4(svcount_t, float16_t const *);
11684__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x4)))
11685svint16x4_t svldnt1_s16_x4(svcount_t, int16_t const *);
11686__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x4)))
11687svuint32x4_t svldnt1_u32_x4(svcount_t, uint32_t const *);
11688__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x4)))
11689svfloat32x4_t svldnt1_f32_x4(svcount_t, float32_t const *);
11690__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x4)))
11691svint32x4_t svldnt1_s32_x4(svcount_t, int32_t const *);
11692__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x2)))
11693svuint8x2_t svldnt1_vnum_u8_x2(svcount_t, uint8_t const *, int64_t);
11694__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x2)))
11695svint8x2_t svldnt1_vnum_s8_x2(svcount_t, int8_t const *, int64_t);
11696__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x2)))
11697svmfloat8x2_t svldnt1_vnum_mf8_x2(svcount_t, mfloat8_t const *, int64_t);
11698__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x2)))
11699svuint64x2_t svldnt1_vnum_u64_x2(svcount_t, uint64_t const *, int64_t);
11700__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x2)))
11701svfloat64x2_t svldnt1_vnum_f64_x2(svcount_t, float64_t const *, int64_t);
11702__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x2)))
11703svint64x2_t svldnt1_vnum_s64_x2(svcount_t, int64_t const *, int64_t);
11704__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x2)))
11705svuint16x2_t svldnt1_vnum_u16_x2(svcount_t, uint16_t const *, int64_t);
11706__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x2)))
11707svbfloat16x2_t svldnt1_vnum_bf16_x2(svcount_t, bfloat16_t const *, int64_t);
11708__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x2)))
11709svfloat16x2_t svldnt1_vnum_f16_x2(svcount_t, float16_t const *, int64_t);
11710__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x2)))
11711svint16x2_t svldnt1_vnum_s16_x2(svcount_t, int16_t const *, int64_t);
11712__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x2)))
11713svuint32x2_t svldnt1_vnum_u32_x2(svcount_t, uint32_t const *, int64_t);
11714__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x2)))
11715svfloat32x2_t svldnt1_vnum_f32_x2(svcount_t, float32_t const *, int64_t);
11716__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x2)))
11717svint32x2_t svldnt1_vnum_s32_x2(svcount_t, int32_t const *, int64_t);
11718__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x4)))
11719svuint8x4_t svldnt1_vnum_u8_x4(svcount_t, uint8_t const *, int64_t);
11720__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x4)))
11721svint8x4_t svldnt1_vnum_s8_x4(svcount_t, int8_t const *, int64_t);
11722__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x4)))
11723svmfloat8x4_t svldnt1_vnum_mf8_x4(svcount_t, mfloat8_t const *, int64_t);
11724__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x4)))
11725svuint64x4_t svldnt1_vnum_u64_x4(svcount_t, uint64_t const *, int64_t);
11726__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x4)))
11727svfloat64x4_t svldnt1_vnum_f64_x4(svcount_t, float64_t const *, int64_t);
11728__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x4)))
11729svint64x4_t svldnt1_vnum_s64_x4(svcount_t, int64_t const *, int64_t);
11730__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x4)))
11731svuint16x4_t svldnt1_vnum_u16_x4(svcount_t, uint16_t const *, int64_t);
11732__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x4)))
11733svbfloat16x4_t svldnt1_vnum_bf16_x4(svcount_t, bfloat16_t const *, int64_t);
11734__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x4)))
11735svfloat16x4_t svldnt1_vnum_f16_x4(svcount_t, float16_t const *, int64_t);
11736__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x4)))
11737svint16x4_t svldnt1_vnum_s16_x4(svcount_t, int16_t const *, int64_t);
11738__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x4)))
11739svuint32x4_t svldnt1_vnum_u32_x4(svcount_t, uint32_t const *, int64_t);
11740__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x4)))
11741svfloat32x4_t svldnt1_vnum_f32_x4(svcount_t, float32_t const *, int64_t);
11742__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x4)))
11743svint32x4_t svldnt1_vnum_s32_x4(svcount_t, int32_t const *, int64_t);
11744__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c8)))
11745svbool_t svpext_lane_c8(svcount_t, uint64_t);
11746__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c32)))
11747svbool_t svpext_lane_c32(svcount_t, uint64_t);
11748__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c64)))
11749svbool_t svpext_lane_c64(svcount_t, uint64_t);
11750__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c16)))
11751svbool_t svpext_lane_c16(svcount_t, uint64_t);
11752__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c8_x2)))
11753svboolx2_t svpext_lane_c8_x2(svcount_t, uint64_t);
11754__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c32_x2)))
11755svboolx2_t svpext_lane_c32_x2(svcount_t, uint64_t);
11756__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c64_x2)))
11757svboolx2_t svpext_lane_c64_x2(svcount_t, uint64_t);
11758__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c16_x2)))
11759svboolx2_t svpext_lane_c16_x2(svcount_t, uint64_t);
11760__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpfalse_c)))
11761svcount_t svpfalse_c(void);
11762__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c16)))
11763svcount_t svpsel_lane_c16(svcount_t, svbool_t, uint32_t);
11764__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c32)))
11765svcount_t svpsel_lane_c32(svcount_t, svbool_t, uint32_t);
11766__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c64)))
11767svcount_t svpsel_lane_c64(svcount_t, svbool_t, uint32_t);
11768__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c8)))
11769svcount_t svpsel_lane_c8(svcount_t, svbool_t, uint32_t);
11770__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c8)))
11771svcount_t svptrue_c8(void);
11772__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c32)))
11773svcount_t svptrue_c32(void);
11774__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c64)))
11775svcount_t svptrue_c64(void);
11776__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c16)))
11777svcount_t svptrue_c16(void);
11778__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_b)))
11779svbool_t svreinterpret_b(svcount_t);
11780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_c)))
11781svcount_t svreinterpret_c(svbool_t);
11782__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x2)))
11783void svst1_u8_x2(svcount_t, uint8_t *, svuint8x2_t);
11784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x2)))
11785void svst1_s8_x2(svcount_t, int8_t *, svint8x2_t);
11786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x2)))
11787void svst1_mf8_x2(svcount_t, mfloat8_t *, svmfloat8x2_t);
11788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x2)))
11789void svst1_u64_x2(svcount_t, uint64_t *, svuint64x2_t);
11790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x2)))
11791void svst1_f64_x2(svcount_t, float64_t *, svfloat64x2_t);
11792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x2)))
11793void svst1_s64_x2(svcount_t, int64_t *, svint64x2_t);
11794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x2)))
11795void svst1_u16_x2(svcount_t, uint16_t *, svuint16x2_t);
11796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x2)))
11797void svst1_bf16_x2(svcount_t, bfloat16_t *, svbfloat16x2_t);
11798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x2)))
11799void svst1_f16_x2(svcount_t, float16_t *, svfloat16x2_t);
11800__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x2)))
11801void svst1_s16_x2(svcount_t, int16_t *, svint16x2_t);
11802__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x2)))
11803void svst1_u32_x2(svcount_t, uint32_t *, svuint32x2_t);
11804__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x2)))
11805void svst1_f32_x2(svcount_t, float32_t *, svfloat32x2_t);
11806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x2)))
11807void svst1_s32_x2(svcount_t, int32_t *, svint32x2_t);
11808__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x4)))
11809void svst1_u8_x4(svcount_t, uint8_t *, svuint8x4_t);
11810__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x4)))
11811void svst1_s8_x4(svcount_t, int8_t *, svint8x4_t);
11812__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x4)))
11813void svst1_mf8_x4(svcount_t, mfloat8_t *, svmfloat8x4_t);
11814__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x4)))
11815void svst1_u64_x4(svcount_t, uint64_t *, svuint64x4_t);
11816__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x4)))
11817void svst1_f64_x4(svcount_t, float64_t *, svfloat64x4_t);
11818__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x4)))
11819void svst1_s64_x4(svcount_t, int64_t *, svint64x4_t);
11820__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x4)))
11821void svst1_u16_x4(svcount_t, uint16_t *, svuint16x4_t);
11822__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x4)))
11823void svst1_bf16_x4(svcount_t, bfloat16_t *, svbfloat16x4_t);
11824__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x4)))
11825void svst1_f16_x4(svcount_t, float16_t *, svfloat16x4_t);
11826__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x4)))
11827void svst1_s16_x4(svcount_t, int16_t *, svint16x4_t);
11828__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x4)))
11829void svst1_u32_x4(svcount_t, uint32_t *, svuint32x4_t);
11830__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x4)))
11831void svst1_f32_x4(svcount_t, float32_t *, svfloat32x4_t);
11832__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x4)))
11833void svst1_s32_x4(svcount_t, int32_t *, svint32x4_t);
11834__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x2)))
11835void svst1_vnum_u8_x2(svcount_t, uint8_t *, int64_t, svuint8x2_t);
11836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x2)))
11837void svst1_vnum_s8_x2(svcount_t, int8_t *, int64_t, svint8x2_t);
11838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x2)))
11839void svst1_vnum_mf8_x2(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
11840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x2)))
11841void svst1_vnum_u64_x2(svcount_t, uint64_t *, int64_t, svuint64x2_t);
11842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x2)))
11843void svst1_vnum_f64_x2(svcount_t, float64_t *, int64_t, svfloat64x2_t);
11844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x2)))
11845void svst1_vnum_s64_x2(svcount_t, int64_t *, int64_t, svint64x2_t);
11846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x2)))
11847void svst1_vnum_u16_x2(svcount_t, uint16_t *, int64_t, svuint16x2_t);
11848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x2)))
11849void svst1_vnum_bf16_x2(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
11850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x2)))
11851void svst1_vnum_f16_x2(svcount_t, float16_t *, int64_t, svfloat16x2_t);
11852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x2)))
11853void svst1_vnum_s16_x2(svcount_t, int16_t *, int64_t, svint16x2_t);
11854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x2)))
11855void svst1_vnum_u32_x2(svcount_t, uint32_t *, int64_t, svuint32x2_t);
11856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x2)))
11857void svst1_vnum_f32_x2(svcount_t, float32_t *, int64_t, svfloat32x2_t);
11858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x2)))
11859void svst1_vnum_s32_x2(svcount_t, int32_t *, int64_t, svint32x2_t);
11860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x4)))
11861void svst1_vnum_u8_x4(svcount_t, uint8_t *, int64_t, svuint8x4_t);
11862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x4)))
11863void svst1_vnum_s8_x4(svcount_t, int8_t *, int64_t, svint8x4_t);
11864__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x4)))
11865void svst1_vnum_mf8_x4(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
11866__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x4)))
11867void svst1_vnum_u64_x4(svcount_t, uint64_t *, int64_t, svuint64x4_t);
11868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x4)))
11869void svst1_vnum_f64_x4(svcount_t, float64_t *, int64_t, svfloat64x4_t);
11870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x4)))
11871void svst1_vnum_s64_x4(svcount_t, int64_t *, int64_t, svint64x4_t);
11872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x4)))
11873void svst1_vnum_u16_x4(svcount_t, uint16_t *, int64_t, svuint16x4_t);
11874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x4)))
11875void svst1_vnum_bf16_x4(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
11876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x4)))
11877void svst1_vnum_f16_x4(svcount_t, float16_t *, int64_t, svfloat16x4_t);
11878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x4)))
11879void svst1_vnum_s16_x4(svcount_t, int16_t *, int64_t, svint16x4_t);
11880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x4)))
11881void svst1_vnum_u32_x4(svcount_t, uint32_t *, int64_t, svuint32x4_t);
11882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x4)))
11883void svst1_vnum_f32_x4(svcount_t, float32_t *, int64_t, svfloat32x4_t);
11884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x4)))
11885void svst1_vnum_s32_x4(svcount_t, int32_t *, int64_t, svint32x4_t);
11886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x2)))
11887void svstnt1_u8_x2(svcount_t, uint8_t *, svuint8x2_t);
11888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x2)))
11889void svstnt1_s8_x2(svcount_t, int8_t *, svint8x2_t);
11890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x2)))
11891void svstnt1_mf8_x2(svcount_t, mfloat8_t *, svmfloat8x2_t);
11892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x2)))
11893void svstnt1_u64_x2(svcount_t, uint64_t *, svuint64x2_t);
11894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x2)))
11895void svstnt1_f64_x2(svcount_t, float64_t *, svfloat64x2_t);
11896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x2)))
11897void svstnt1_s64_x2(svcount_t, int64_t *, svint64x2_t);
11898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x2)))
11899void svstnt1_u16_x2(svcount_t, uint16_t *, svuint16x2_t);
11900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x2)))
11901void svstnt1_bf16_x2(svcount_t, bfloat16_t *, svbfloat16x2_t);
11902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x2)))
11903void svstnt1_f16_x2(svcount_t, float16_t *, svfloat16x2_t);
11904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x2)))
11905void svstnt1_s16_x2(svcount_t, int16_t *, svint16x2_t);
11906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x2)))
11907void svstnt1_u32_x2(svcount_t, uint32_t *, svuint32x2_t);
11908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x2)))
11909void svstnt1_f32_x2(svcount_t, float32_t *, svfloat32x2_t);
11910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x2)))
11911void svstnt1_s32_x2(svcount_t, int32_t *, svint32x2_t);
11912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x4)))
11913void svstnt1_u8_x4(svcount_t, uint8_t *, svuint8x4_t);
11914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x4)))
11915void svstnt1_s8_x4(svcount_t, int8_t *, svint8x4_t);
11916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x4)))
11917void svstnt1_mf8_x4(svcount_t, mfloat8_t *, svmfloat8x4_t);
11918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x4)))
11919void svstnt1_u64_x4(svcount_t, uint64_t *, svuint64x4_t);
11920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x4)))
11921void svstnt1_f64_x4(svcount_t, float64_t *, svfloat64x4_t);
11922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x4)))
11923void svstnt1_s64_x4(svcount_t, int64_t *, svint64x4_t);
11924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x4)))
11925void svstnt1_u16_x4(svcount_t, uint16_t *, svuint16x4_t);
11926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x4)))
11927void svstnt1_bf16_x4(svcount_t, bfloat16_t *, svbfloat16x4_t);
11928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x4)))
11929void svstnt1_f16_x4(svcount_t, float16_t *, svfloat16x4_t);
11930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x4)))
11931void svstnt1_s16_x4(svcount_t, int16_t *, svint16x4_t);
11932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x4)))
11933void svstnt1_u32_x4(svcount_t, uint32_t *, svuint32x4_t);
11934__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x4)))
11935void svstnt1_f32_x4(svcount_t, float32_t *, svfloat32x4_t);
11936__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x4)))
11937void svstnt1_s32_x4(svcount_t, int32_t *, svint32x4_t);
11938__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x2)))
11939void svstnt1_vnum_u8_x2(svcount_t, uint8_t *, int64_t, svuint8x2_t);
11940__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x2)))
11941void svstnt1_vnum_s8_x2(svcount_t, int8_t *, int64_t, svint8x2_t);
11942__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x2)))
11943void svstnt1_vnum_mf8_x2(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
11944__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x2)))
11945void svstnt1_vnum_u64_x2(svcount_t, uint64_t *, int64_t, svuint64x2_t);
11946__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x2)))
11947void svstnt1_vnum_f64_x2(svcount_t, float64_t *, int64_t, svfloat64x2_t);
11948__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x2)))
11949void svstnt1_vnum_s64_x2(svcount_t, int64_t *, int64_t, svint64x2_t);
11950__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x2)))
11951void svstnt1_vnum_u16_x2(svcount_t, uint16_t *, int64_t, svuint16x2_t);
11952__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x2)))
11953void svstnt1_vnum_bf16_x2(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
11954__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x2)))
11955void svstnt1_vnum_f16_x2(svcount_t, float16_t *, int64_t, svfloat16x2_t);
11956__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x2)))
11957void svstnt1_vnum_s16_x2(svcount_t, int16_t *, int64_t, svint16x2_t);
11958__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x2)))
11959void svstnt1_vnum_u32_x2(svcount_t, uint32_t *, int64_t, svuint32x2_t);
11960__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x2)))
11961void svstnt1_vnum_f32_x2(svcount_t, float32_t *, int64_t, svfloat32x2_t);
11962__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x2)))
11963void svstnt1_vnum_s32_x2(svcount_t, int32_t *, int64_t, svint32x2_t);
11964__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x4)))
11965void svstnt1_vnum_u8_x4(svcount_t, uint8_t *, int64_t, svuint8x4_t);
11966__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x4)))
11967void svstnt1_vnum_s8_x4(svcount_t, int8_t *, int64_t, svint8x4_t);
11968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x4)))
11969void svstnt1_vnum_mf8_x4(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
11970__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x4)))
11971void svstnt1_vnum_u64_x4(svcount_t, uint64_t *, int64_t, svuint64x4_t);
11972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x4)))
11973void svstnt1_vnum_f64_x4(svcount_t, float64_t *, int64_t, svfloat64x4_t);
11974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x4)))
11975void svstnt1_vnum_s64_x4(svcount_t, int64_t *, int64_t, svint64x4_t);
11976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x4)))
11977void svstnt1_vnum_u16_x4(svcount_t, uint16_t *, int64_t, svuint16x4_t);
11978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x4)))
11979void svstnt1_vnum_bf16_x4(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
11980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x4)))
11981void svstnt1_vnum_f16_x4(svcount_t, float16_t *, int64_t, svfloat16x4_t);
11982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x4)))
11983void svstnt1_vnum_s16_x4(svcount_t, int16_t *, int64_t, svint16x4_t);
11984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x4)))
11985void svstnt1_vnum_u32_x4(svcount_t, uint32_t *, int64_t, svuint32x4_t);
11986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x4)))
11987void svstnt1_vnum_f32_x4(svcount_t, float32_t *, int64_t, svfloat32x4_t);
11988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x4)))
11989void svstnt1_vnum_s32_x4(svcount_t, int32_t *, int64_t, svint32x4_t);
11990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_s64)))
11991svcount_t svwhilege_c8_s64(int64_t, int64_t, uint64_t);
11992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_s64)))
11993svcount_t svwhilege_c32_s64(int64_t, int64_t, uint64_t);
11994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_s64)))
11995svcount_t svwhilege_c64_s64(int64_t, int64_t, uint64_t);
11996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_s64)))
11997svcount_t svwhilege_c16_s64(int64_t, int64_t, uint64_t);
11998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_u64)))
11999svcount_t svwhilege_c8_u64(uint64_t, uint64_t, uint64_t);
12000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_u64)))
12001svcount_t svwhilege_c32_u64(uint64_t, uint64_t, uint64_t);
12002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_u64)))
12003svcount_t svwhilege_c64_u64(uint64_t, uint64_t, uint64_t);
12004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_u64)))
12005svcount_t svwhilege_c16_u64(uint64_t, uint64_t, uint64_t);
12006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_s64)))
12007svcount_t svwhilegt_c8_s64(int64_t, int64_t, uint64_t);
12008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_s64)))
12009svcount_t svwhilegt_c32_s64(int64_t, int64_t, uint64_t);
12010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_s64)))
12011svcount_t svwhilegt_c64_s64(int64_t, int64_t, uint64_t);
12012__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_s64)))
12013svcount_t svwhilegt_c16_s64(int64_t, int64_t, uint64_t);
12014__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_u64)))
12015svcount_t svwhilegt_c8_u64(uint64_t, uint64_t, uint64_t);
12016__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_u64)))
12017svcount_t svwhilegt_c32_u64(uint64_t, uint64_t, uint64_t);
12018__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_u64)))
12019svcount_t svwhilegt_c64_u64(uint64_t, uint64_t, uint64_t);
12020__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_u64)))
12021svcount_t svwhilegt_c16_u64(uint64_t, uint64_t, uint64_t);
12022__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_s64)))
12023svcount_t svwhilele_c8_s64(int64_t, int64_t, uint64_t);
12024__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_s64)))
12025svcount_t svwhilele_c32_s64(int64_t, int64_t, uint64_t);
12026__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_s64)))
12027svcount_t svwhilele_c64_s64(int64_t, int64_t, uint64_t);
12028__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_s64)))
12029svcount_t svwhilele_c16_s64(int64_t, int64_t, uint64_t);
12030__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_u64)))
12031svcount_t svwhilele_c8_u64(uint64_t, uint64_t, uint64_t);
12032__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_u64)))
12033svcount_t svwhilele_c32_u64(uint64_t, uint64_t, uint64_t);
12034__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_u64)))
12035svcount_t svwhilele_c64_u64(uint64_t, uint64_t, uint64_t);
12036__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_u64)))
12037svcount_t svwhilele_c16_u64(uint64_t, uint64_t, uint64_t);
12038__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_u64)))
12039svcount_t svwhilelt_c8_u64(uint64_t, uint64_t, uint64_t);
12040__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_u64)))
12041svcount_t svwhilelt_c32_u64(uint64_t, uint64_t, uint64_t);
12042__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_u64)))
12043svcount_t svwhilelt_c64_u64(uint64_t, uint64_t, uint64_t);
12044__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_u64)))
12045svcount_t svwhilelt_c16_u64(uint64_t, uint64_t, uint64_t);
12046__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_s64)))
12047svcount_t svwhilelt_c8_s64(int64_t, int64_t, uint64_t);
12048__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_s64)))
12049svcount_t svwhilelt_c32_s64(int64_t, int64_t, uint64_t);
12050__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_s64)))
12051svcount_t svwhilelt_c64_s64(int64_t, int64_t, uint64_t);
12052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_s64)))
12053svcount_t svwhilelt_c16_s64(int64_t, int64_t, uint64_t);
12054__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x2)))
12055svuint8x2_t svld1_x2(svcount_t, uint8_t const *);
12056__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x2)))
12057svint8x2_t svld1_x2(svcount_t, int8_t const *);
12058__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x2)))
12059svmfloat8x2_t svld1_x2(svcount_t, mfloat8_t const *);
12060__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x2)))
12061svuint64x2_t svld1_x2(svcount_t, uint64_t const *);
12062__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x2)))
12063svfloat64x2_t svld1_x2(svcount_t, float64_t const *);
12064__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x2)))
12065svint64x2_t svld1_x2(svcount_t, int64_t const *);
12066__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x2)))
12067svuint16x2_t svld1_x2(svcount_t, uint16_t const *);
12068__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x2)))
12069svbfloat16x2_t svld1_x2(svcount_t, bfloat16_t const *);
12070__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x2)))
12071svfloat16x2_t svld1_x2(svcount_t, float16_t const *);
12072__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x2)))
12073svint16x2_t svld1_x2(svcount_t, int16_t const *);
12074__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x2)))
12075svuint32x2_t svld1_x2(svcount_t, uint32_t const *);
12076__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x2)))
12077svfloat32x2_t svld1_x2(svcount_t, float32_t const *);
12078__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x2)))
12079svint32x2_t svld1_x2(svcount_t, int32_t const *);
12080__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x4)))
12081svuint8x4_t svld1_x4(svcount_t, uint8_t const *);
12082__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x4)))
12083svint8x4_t svld1_x4(svcount_t, int8_t const *);
12084__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x4)))
12085svmfloat8x4_t svld1_x4(svcount_t, mfloat8_t const *);
12086__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x4)))
12087svuint64x4_t svld1_x4(svcount_t, uint64_t const *);
12088__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x4)))
12089svfloat64x4_t svld1_x4(svcount_t, float64_t const *);
12090__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x4)))
12091svint64x4_t svld1_x4(svcount_t, int64_t const *);
12092__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x4)))
12093svuint16x4_t svld1_x4(svcount_t, uint16_t const *);
12094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x4)))
12095svbfloat16x4_t svld1_x4(svcount_t, bfloat16_t const *);
12096__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x4)))
12097svfloat16x4_t svld1_x4(svcount_t, float16_t const *);
12098__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x4)))
12099svint16x4_t svld1_x4(svcount_t, int16_t const *);
12100__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x4)))
12101svuint32x4_t svld1_x4(svcount_t, uint32_t const *);
12102__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x4)))
12103svfloat32x4_t svld1_x4(svcount_t, float32_t const *);
12104__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x4)))
12105svint32x4_t svld1_x4(svcount_t, int32_t const *);
12106__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x2)))
12107svuint8x2_t svld1_vnum_x2(svcount_t, uint8_t const *, int64_t);
12108__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x2)))
12109svint8x2_t svld1_vnum_x2(svcount_t, int8_t const *, int64_t);
12110__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x2)))
12111svmfloat8x2_t svld1_vnum_x2(svcount_t, mfloat8_t const *, int64_t);
12112__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x2)))
12113svuint64x2_t svld1_vnum_x2(svcount_t, uint64_t const *, int64_t);
12114__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x2)))
12115svfloat64x2_t svld1_vnum_x2(svcount_t, float64_t const *, int64_t);
12116__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x2)))
12117svint64x2_t svld1_vnum_x2(svcount_t, int64_t const *, int64_t);
12118__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x2)))
12119svuint16x2_t svld1_vnum_x2(svcount_t, uint16_t const *, int64_t);
12120__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x2)))
12121svbfloat16x2_t svld1_vnum_x2(svcount_t, bfloat16_t const *, int64_t);
12122__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x2)))
12123svfloat16x2_t svld1_vnum_x2(svcount_t, float16_t const *, int64_t);
12124__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x2)))
12125svint16x2_t svld1_vnum_x2(svcount_t, int16_t const *, int64_t);
12126__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x2)))
12127svuint32x2_t svld1_vnum_x2(svcount_t, uint32_t const *, int64_t);
12128__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x2)))
12129svfloat32x2_t svld1_vnum_x2(svcount_t, float32_t const *, int64_t);
12130__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x2)))
12131svint32x2_t svld1_vnum_x2(svcount_t, int32_t const *, int64_t);
12132__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x4)))
12133svuint8x4_t svld1_vnum_x4(svcount_t, uint8_t const *, int64_t);
12134__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x4)))
12135svint8x4_t svld1_vnum_x4(svcount_t, int8_t const *, int64_t);
12136__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x4)))
12137svmfloat8x4_t svld1_vnum_x4(svcount_t, mfloat8_t const *, int64_t);
12138__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x4)))
12139svuint64x4_t svld1_vnum_x4(svcount_t, uint64_t const *, int64_t);
12140__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x4)))
12141svfloat64x4_t svld1_vnum_x4(svcount_t, float64_t const *, int64_t);
12142__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x4)))
12143svint64x4_t svld1_vnum_x4(svcount_t, int64_t const *, int64_t);
12144__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x4)))
12145svuint16x4_t svld1_vnum_x4(svcount_t, uint16_t const *, int64_t);
12146__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x4)))
12147svbfloat16x4_t svld1_vnum_x4(svcount_t, bfloat16_t const *, int64_t);
12148__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x4)))
12149svfloat16x4_t svld1_vnum_x4(svcount_t, float16_t const *, int64_t);
12150__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x4)))
12151svint16x4_t svld1_vnum_x4(svcount_t, int16_t const *, int64_t);
12152__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x4)))
12153svuint32x4_t svld1_vnum_x4(svcount_t, uint32_t const *, int64_t);
12154__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x4)))
12155svfloat32x4_t svld1_vnum_x4(svcount_t, float32_t const *, int64_t);
12156__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x4)))
12157svint32x4_t svld1_vnum_x4(svcount_t, int32_t const *, int64_t);
12158__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x2)))
12159svuint8x2_t svldnt1_x2(svcount_t, uint8_t const *);
12160__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x2)))
12161svint8x2_t svldnt1_x2(svcount_t, int8_t const *);
12162__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x2)))
12163svmfloat8x2_t svldnt1_x2(svcount_t, mfloat8_t const *);
12164__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x2)))
12165svuint64x2_t svldnt1_x2(svcount_t, uint64_t const *);
12166__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x2)))
12167svfloat64x2_t svldnt1_x2(svcount_t, float64_t const *);
12168__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x2)))
12169svint64x2_t svldnt1_x2(svcount_t, int64_t const *);
12170__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x2)))
12171svuint16x2_t svldnt1_x2(svcount_t, uint16_t const *);
12172__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x2)))
12173svbfloat16x2_t svldnt1_x2(svcount_t, bfloat16_t const *);
12174__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x2)))
12175svfloat16x2_t svldnt1_x2(svcount_t, float16_t const *);
12176__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x2)))
12177svint16x2_t svldnt1_x2(svcount_t, int16_t const *);
12178__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x2)))
12179svuint32x2_t svldnt1_x2(svcount_t, uint32_t const *);
12180__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x2)))
12181svfloat32x2_t svldnt1_x2(svcount_t, float32_t const *);
12182__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x2)))
12183svint32x2_t svldnt1_x2(svcount_t, int32_t const *);
12184__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x4)))
12185svuint8x4_t svldnt1_x4(svcount_t, uint8_t const *);
12186__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x4)))
12187svint8x4_t svldnt1_x4(svcount_t, int8_t const *);
12188__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x4)))
12189svmfloat8x4_t svldnt1_x4(svcount_t, mfloat8_t const *);
12190__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x4)))
12191svuint64x4_t svldnt1_x4(svcount_t, uint64_t const *);
12192__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x4)))
12193svfloat64x4_t svldnt1_x4(svcount_t, float64_t const *);
12194__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x4)))
12195svint64x4_t svldnt1_x4(svcount_t, int64_t const *);
12196__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x4)))
12197svuint16x4_t svldnt1_x4(svcount_t, uint16_t const *);
12198__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x4)))
12199svbfloat16x4_t svldnt1_x4(svcount_t, bfloat16_t const *);
12200__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x4)))
12201svfloat16x4_t svldnt1_x4(svcount_t, float16_t const *);
12202__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x4)))
12203svint16x4_t svldnt1_x4(svcount_t, int16_t const *);
12204__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x4)))
12205svuint32x4_t svldnt1_x4(svcount_t, uint32_t const *);
12206__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x4)))
12207svfloat32x4_t svldnt1_x4(svcount_t, float32_t const *);
12208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x4)))
12209svint32x4_t svldnt1_x4(svcount_t, int32_t const *);
12210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x2)))
12211svuint8x2_t svldnt1_vnum_x2(svcount_t, uint8_t const *, int64_t);
12212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x2)))
12213svint8x2_t svldnt1_vnum_x2(svcount_t, int8_t const *, int64_t);
12214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x2)))
12215svmfloat8x2_t svldnt1_vnum_x2(svcount_t, mfloat8_t const *, int64_t);
12216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x2)))
12217svuint64x2_t svldnt1_vnum_x2(svcount_t, uint64_t const *, int64_t);
12218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x2)))
12219svfloat64x2_t svldnt1_vnum_x2(svcount_t, float64_t const *, int64_t);
12220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x2)))
12221svint64x2_t svldnt1_vnum_x2(svcount_t, int64_t const *, int64_t);
12222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x2)))
12223svuint16x2_t svldnt1_vnum_x2(svcount_t, uint16_t const *, int64_t);
12224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x2)))
12225svbfloat16x2_t svldnt1_vnum_x2(svcount_t, bfloat16_t const *, int64_t);
12226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x2)))
12227svfloat16x2_t svldnt1_vnum_x2(svcount_t, float16_t const *, int64_t);
12228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x2)))
12229svint16x2_t svldnt1_vnum_x2(svcount_t, int16_t const *, int64_t);
12230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x2)))
12231svuint32x2_t svldnt1_vnum_x2(svcount_t, uint32_t const *, int64_t);
12232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x2)))
12233svfloat32x2_t svldnt1_vnum_x2(svcount_t, float32_t const *, int64_t);
12234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x2)))
12235svint32x2_t svldnt1_vnum_x2(svcount_t, int32_t const *, int64_t);
12236__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x4)))
12237svuint8x4_t svldnt1_vnum_x4(svcount_t, uint8_t const *, int64_t);
12238__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x4)))
12239svint8x4_t svldnt1_vnum_x4(svcount_t, int8_t const *, int64_t);
12240__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x4)))
12241svmfloat8x4_t svldnt1_vnum_x4(svcount_t, mfloat8_t const *, int64_t);
12242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x4)))
12243svuint64x4_t svldnt1_vnum_x4(svcount_t, uint64_t const *, int64_t);
12244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x4)))
12245svfloat64x4_t svldnt1_vnum_x4(svcount_t, float64_t const *, int64_t);
12246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x4)))
12247svint64x4_t svldnt1_vnum_x4(svcount_t, int64_t const *, int64_t);
12248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x4)))
12249svuint16x4_t svldnt1_vnum_x4(svcount_t, uint16_t const *, int64_t);
12250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x4)))
12251svbfloat16x4_t svldnt1_vnum_x4(svcount_t, bfloat16_t const *, int64_t);
12252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x4)))
12253svfloat16x4_t svldnt1_vnum_x4(svcount_t, float16_t const *, int64_t);
12254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x4)))
12255svint16x4_t svldnt1_vnum_x4(svcount_t, int16_t const *, int64_t);
12256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x4)))
12257svuint32x4_t svldnt1_vnum_x4(svcount_t, uint32_t const *, int64_t);
12258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x4)))
12259svfloat32x4_t svldnt1_vnum_x4(svcount_t, float32_t const *, int64_t);
12260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x4)))
12261svint32x4_t svldnt1_vnum_x4(svcount_t, int32_t const *, int64_t);
12262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_b)))
12263svbool_t svreinterpret(svcount_t);
12264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_c)))
12265svcount_t svreinterpret(svbool_t);
12266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x2)))
12267void svst1(svcount_t, uint8_t *, svuint8x2_t);
12268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x2)))
12269void svst1(svcount_t, int8_t *, svint8x2_t);
12270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x2)))
12271void svst1(svcount_t, mfloat8_t *, svmfloat8x2_t);
12272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x2)))
12273void svst1(svcount_t, uint64_t *, svuint64x2_t);
12274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x2)))
12275void svst1(svcount_t, float64_t *, svfloat64x2_t);
12276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x2)))
12277void svst1(svcount_t, int64_t *, svint64x2_t);
12278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x2)))
12279void svst1(svcount_t, uint16_t *, svuint16x2_t);
12280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x2)))
12281void svst1(svcount_t, bfloat16_t *, svbfloat16x2_t);
12282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x2)))
12283void svst1(svcount_t, float16_t *, svfloat16x2_t);
12284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x2)))
12285void svst1(svcount_t, int16_t *, svint16x2_t);
12286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x2)))
12287void svst1(svcount_t, uint32_t *, svuint32x2_t);
12288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x2)))
12289void svst1(svcount_t, float32_t *, svfloat32x2_t);
12290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x2)))
12291void svst1(svcount_t, int32_t *, svint32x2_t);
12292__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x4)))
12293void svst1(svcount_t, uint8_t *, svuint8x4_t);
12294__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x4)))
12295void svst1(svcount_t, int8_t *, svint8x4_t);
12296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x4)))
12297void svst1(svcount_t, mfloat8_t *, svmfloat8x4_t);
12298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x4)))
12299void svst1(svcount_t, uint64_t *, svuint64x4_t);
12300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x4)))
12301void svst1(svcount_t, float64_t *, svfloat64x4_t);
12302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x4)))
12303void svst1(svcount_t, int64_t *, svint64x4_t);
12304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x4)))
12305void svst1(svcount_t, uint16_t *, svuint16x4_t);
12306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x4)))
12307void svst1(svcount_t, bfloat16_t *, svbfloat16x4_t);
12308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x4)))
12309void svst1(svcount_t, float16_t *, svfloat16x4_t);
12310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x4)))
12311void svst1(svcount_t, int16_t *, svint16x4_t);
12312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x4)))
12313void svst1(svcount_t, uint32_t *, svuint32x4_t);
12314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x4)))
12315void svst1(svcount_t, float32_t *, svfloat32x4_t);
12316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x4)))
12317void svst1(svcount_t, int32_t *, svint32x4_t);
12318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x2)))
12319void svst1_vnum(svcount_t, uint8_t *, int64_t, svuint8x2_t);
12320__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x2)))
12321void svst1_vnum(svcount_t, int8_t *, int64_t, svint8x2_t);
12322__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x2)))
12323void svst1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
12324__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x2)))
12325void svst1_vnum(svcount_t, uint64_t *, int64_t, svuint64x2_t);
12326__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x2)))
12327void svst1_vnum(svcount_t, float64_t *, int64_t, svfloat64x2_t);
12328__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x2)))
12329void svst1_vnum(svcount_t, int64_t *, int64_t, svint64x2_t);
12330__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x2)))
12331void svst1_vnum(svcount_t, uint16_t *, int64_t, svuint16x2_t);
12332__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x2)))
12333void svst1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
12334__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x2)))
12335void svst1_vnum(svcount_t, float16_t *, int64_t, svfloat16x2_t);
12336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x2)))
12337void svst1_vnum(svcount_t, int16_t *, int64_t, svint16x2_t);
12338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x2)))
12339void svst1_vnum(svcount_t, uint32_t *, int64_t, svuint32x2_t);
12340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x2)))
12341void svst1_vnum(svcount_t, float32_t *, int64_t, svfloat32x2_t);
12342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x2)))
12343void svst1_vnum(svcount_t, int32_t *, int64_t, svint32x2_t);
12344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x4)))
12345void svst1_vnum(svcount_t, uint8_t *, int64_t, svuint8x4_t);
12346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x4)))
12347void svst1_vnum(svcount_t, int8_t *, int64_t, svint8x4_t);
12348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x4)))
12349void svst1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
12350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x4)))
12351void svst1_vnum(svcount_t, uint64_t *, int64_t, svuint64x4_t);
12352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x4)))
12353void svst1_vnum(svcount_t, float64_t *, int64_t, svfloat64x4_t);
12354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x4)))
12355void svst1_vnum(svcount_t, int64_t *, int64_t, svint64x4_t);
12356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x4)))
12357void svst1_vnum(svcount_t, uint16_t *, int64_t, svuint16x4_t);
12358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x4)))
12359void svst1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
12360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x4)))
12361void svst1_vnum(svcount_t, float16_t *, int64_t, svfloat16x4_t);
12362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x4)))
12363void svst1_vnum(svcount_t, int16_t *, int64_t, svint16x4_t);
12364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x4)))
12365void svst1_vnum(svcount_t, uint32_t *, int64_t, svuint32x4_t);
12366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x4)))
12367void svst1_vnum(svcount_t, float32_t *, int64_t, svfloat32x4_t);
12368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x4)))
12369void svst1_vnum(svcount_t, int32_t *, int64_t, svint32x4_t);
12370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x2)))
12371void svstnt1(svcount_t, uint8_t *, svuint8x2_t);
12372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x2)))
12373void svstnt1(svcount_t, int8_t *, svint8x2_t);
12374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x2)))
12375void svstnt1(svcount_t, mfloat8_t *, svmfloat8x2_t);
12376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x2)))
12377void svstnt1(svcount_t, uint64_t *, svuint64x2_t);
12378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x2)))
12379void svstnt1(svcount_t, float64_t *, svfloat64x2_t);
12380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x2)))
12381void svstnt1(svcount_t, int64_t *, svint64x2_t);
12382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x2)))
12383void svstnt1(svcount_t, uint16_t *, svuint16x2_t);
12384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x2)))
12385void svstnt1(svcount_t, bfloat16_t *, svbfloat16x2_t);
12386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x2)))
12387void svstnt1(svcount_t, float16_t *, svfloat16x2_t);
12388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x2)))
12389void svstnt1(svcount_t, int16_t *, svint16x2_t);
12390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x2)))
12391void svstnt1(svcount_t, uint32_t *, svuint32x2_t);
12392__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x2)))
12393void svstnt1(svcount_t, float32_t *, svfloat32x2_t);
12394__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x2)))
12395void svstnt1(svcount_t, int32_t *, svint32x2_t);
12396__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x4)))
12397void svstnt1(svcount_t, uint8_t *, svuint8x4_t);
12398__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x4)))
12399void svstnt1(svcount_t, int8_t *, svint8x4_t);
12400__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x4)))
12401void svstnt1(svcount_t, mfloat8_t *, svmfloat8x4_t);
12402__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x4)))
12403void svstnt1(svcount_t, uint64_t *, svuint64x4_t);
12404__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x4)))
12405void svstnt1(svcount_t, float64_t *, svfloat64x4_t);
12406__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x4)))
12407void svstnt1(svcount_t, int64_t *, svint64x4_t);
12408__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x4)))
12409void svstnt1(svcount_t, uint16_t *, svuint16x4_t);
12410__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x4)))
12411void svstnt1(svcount_t, bfloat16_t *, svbfloat16x4_t);
12412__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x4)))
12413void svstnt1(svcount_t, float16_t *, svfloat16x4_t);
12414__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x4)))
12415void svstnt1(svcount_t, int16_t *, svint16x4_t);
12416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x4)))
12417void svstnt1(svcount_t, uint32_t *, svuint32x4_t);
12418__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x4)))
12419void svstnt1(svcount_t, float32_t *, svfloat32x4_t);
12420__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x4)))
12421void svstnt1(svcount_t, int32_t *, svint32x4_t);
12422__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x2)))
12423void svstnt1_vnum(svcount_t, uint8_t *, int64_t, svuint8x2_t);
12424__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x2)))
12425void svstnt1_vnum(svcount_t, int8_t *, int64_t, svint8x2_t);
12426__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x2)))
12427void svstnt1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
12428__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x2)))
12429void svstnt1_vnum(svcount_t, uint64_t *, int64_t, svuint64x2_t);
12430__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x2)))
12431void svstnt1_vnum(svcount_t, float64_t *, int64_t, svfloat64x2_t);
12432__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x2)))
12433void svstnt1_vnum(svcount_t, int64_t *, int64_t, svint64x2_t);
12434__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x2)))
12435void svstnt1_vnum(svcount_t, uint16_t *, int64_t, svuint16x2_t);
12436__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x2)))
12437void svstnt1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
12438__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x2)))
12439void svstnt1_vnum(svcount_t, float16_t *, int64_t, svfloat16x2_t);
12440__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x2)))
12441void svstnt1_vnum(svcount_t, int16_t *, int64_t, svint16x2_t);
12442__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x2)))
12443void svstnt1_vnum(svcount_t, uint32_t *, int64_t, svuint32x2_t);
12444__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x2)))
12445void svstnt1_vnum(svcount_t, float32_t *, int64_t, svfloat32x2_t);
12446__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x2)))
12447void svstnt1_vnum(svcount_t, int32_t *, int64_t, svint32x2_t);
12448__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x4)))
12449void svstnt1_vnum(svcount_t, uint8_t *, int64_t, svuint8x4_t);
12450__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x4)))
12451void svstnt1_vnum(svcount_t, int8_t *, int64_t, svint8x4_t);
12452__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x4)))
12453void svstnt1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
12454__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x4)))
12455void svstnt1_vnum(svcount_t, uint64_t *, int64_t, svuint64x4_t);
12456__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x4)))
12457void svstnt1_vnum(svcount_t, float64_t *, int64_t, svfloat64x4_t);
12458__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x4)))
12459void svstnt1_vnum(svcount_t, int64_t *, int64_t, svint64x4_t);
12460__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x4)))
12461void svstnt1_vnum(svcount_t, uint16_t *, int64_t, svuint16x4_t);
12462__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x4)))
12463void svstnt1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
12464__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x4)))
12465void svstnt1_vnum(svcount_t, float16_t *, int64_t, svfloat16x4_t);
12466__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x4)))
12467void svstnt1_vnum(svcount_t, int16_t *, int64_t, svint16x4_t);
12468__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x4)))
12469void svstnt1_vnum(svcount_t, uint32_t *, int64_t, svuint32x4_t);
12470__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x4)))
12471void svstnt1_vnum(svcount_t, float32_t *, int64_t, svfloat32x4_t);
12472__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x4)))
12473void svstnt1_vnum(svcount_t, int32_t *, int64_t, svint32x4_t);
12474__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_s64)))
12475svcount_t svwhilege_c8(int64_t, int64_t, uint64_t);
12476__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_s64)))
12477svcount_t svwhilege_c32(int64_t, int64_t, uint64_t);
12478__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_s64)))
12479svcount_t svwhilege_c64(int64_t, int64_t, uint64_t);
12480__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_s64)))
12481svcount_t svwhilege_c16(int64_t, int64_t, uint64_t);
12482__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_u64)))
12483svcount_t svwhilege_c8(uint64_t, uint64_t, uint64_t);
12484__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_u64)))
12485svcount_t svwhilege_c32(uint64_t, uint64_t, uint64_t);
12486__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_u64)))
12487svcount_t svwhilege_c64(uint64_t, uint64_t, uint64_t);
12488__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_u64)))
12489svcount_t svwhilege_c16(uint64_t, uint64_t, uint64_t);
12490__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_s64)))
12491svcount_t svwhilegt_c8(int64_t, int64_t, uint64_t);
12492__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_s64)))
12493svcount_t svwhilegt_c32(int64_t, int64_t, uint64_t);
12494__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_s64)))
12495svcount_t svwhilegt_c64(int64_t, int64_t, uint64_t);
12496__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_s64)))
12497svcount_t svwhilegt_c16(int64_t, int64_t, uint64_t);
12498__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_u64)))
12499svcount_t svwhilegt_c8(uint64_t, uint64_t, uint64_t);
12500__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_u64)))
12501svcount_t svwhilegt_c32(uint64_t, uint64_t, uint64_t);
12502__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_u64)))
12503svcount_t svwhilegt_c64(uint64_t, uint64_t, uint64_t);
12504__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_u64)))
12505svcount_t svwhilegt_c16(uint64_t, uint64_t, uint64_t);
12506__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_s64)))
12507svcount_t svwhilele_c8(int64_t, int64_t, uint64_t);
12508__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_s64)))
12509svcount_t svwhilele_c32(int64_t, int64_t, uint64_t);
12510__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_s64)))
12511svcount_t svwhilele_c64(int64_t, int64_t, uint64_t);
12512__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_s64)))
12513svcount_t svwhilele_c16(int64_t, int64_t, uint64_t);
12514__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_u64)))
12515svcount_t svwhilele_c8(uint64_t, uint64_t, uint64_t);
12516__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_u64)))
12517svcount_t svwhilele_c32(uint64_t, uint64_t, uint64_t);
12518__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_u64)))
12519svcount_t svwhilele_c64(uint64_t, uint64_t, uint64_t);
12520__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_u64)))
12521svcount_t svwhilele_c16(uint64_t, uint64_t, uint64_t);
12522__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_u64)))
12523svcount_t svwhilelt_c8(uint64_t, uint64_t, uint64_t);
12524__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_u64)))
12525svcount_t svwhilelt_c32(uint64_t, uint64_t, uint64_t);
12526__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_u64)))
12527svcount_t svwhilelt_c64(uint64_t, uint64_t, uint64_t);
12528__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_u64)))
12529svcount_t svwhilelt_c16(uint64_t, uint64_t, uint64_t);
12530__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_s64)))
12531svcount_t svwhilelt_c8(int64_t, int64_t, uint64_t);
12532__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_s64)))
12533svcount_t svwhilelt_c32(int64_t, int64_t, uint64_t);
12534__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_s64)))
12535svcount_t svwhilelt_c64(int64_t, int64_t, uint64_t);
12536__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_s64)))
12537svcount_t svwhilelt_c16(int64_t, int64_t, uint64_t);
12538__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s8)))9052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s8)))
12539svint8_t svaba_n_s8(svint8_t, svint8_t, int8_t);9053svint8_t svaba_n_s8(svint8_t, svint8_t, int8_t);
12540__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s32)))9054__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s32)))
...@@ -19059,6 +15573,3848 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svxar_n_s64)))...@@ -19059,6 +15573,3848 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svxar_n_s64)))
19059svint64_t svxar(svint64_t, svint64_t, uint64_t);15573svint64_t svxar(svint64_t, svint64_t, uint64_t);
19060__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svxar_n_s16)))15574__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svxar_n_s16)))
19061svint16_t svxar(svint16_t, svint16_t, uint64_t);15575svint16_t svxar(svint16_t, svint16_t, uint64_t);
15576__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_m)))
15577svfloat64_t svamax_n_f64_m(svbool_t, svfloat64_t, float64_t);
15578__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_m)))
15579svfloat32_t svamax_n_f32_m(svbool_t, svfloat32_t, float32_t);
15580__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_m)))
15581svfloat16_t svamax_n_f16_m(svbool_t, svfloat16_t, float16_t);
15582__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_x)))
15583svfloat64_t svamax_n_f64_x(svbool_t, svfloat64_t, float64_t);
15584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_x)))
15585svfloat32_t svamax_n_f32_x(svbool_t, svfloat32_t, float32_t);
15586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_x)))
15587svfloat16_t svamax_n_f16_x(svbool_t, svfloat16_t, float16_t);
15588__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_z)))
15589svfloat64_t svamax_n_f64_z(svbool_t, svfloat64_t, float64_t);
15590__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_z)))
15591svfloat32_t svamax_n_f32_z(svbool_t, svfloat32_t, float32_t);
15592__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_z)))
15593svfloat16_t svamax_n_f16_z(svbool_t, svfloat16_t, float16_t);
15594__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_m)))
15595svfloat64_t svamax_f64_m(svbool_t, svfloat64_t, svfloat64_t);
15596__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_m)))
15597svfloat32_t svamax_f32_m(svbool_t, svfloat32_t, svfloat32_t);
15598__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_m)))
15599svfloat16_t svamax_f16_m(svbool_t, svfloat16_t, svfloat16_t);
15600__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_x)))
15601svfloat64_t svamax_f64_x(svbool_t, svfloat64_t, svfloat64_t);
15602__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_x)))
15603svfloat32_t svamax_f32_x(svbool_t, svfloat32_t, svfloat32_t);
15604__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_x)))
15605svfloat16_t svamax_f16_x(svbool_t, svfloat16_t, svfloat16_t);
15606__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_z)))
15607svfloat64_t svamax_f64_z(svbool_t, svfloat64_t, svfloat64_t);
15608__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_z)))
15609svfloat32_t svamax_f32_z(svbool_t, svfloat32_t, svfloat32_t);
15610__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_z)))
15611svfloat16_t svamax_f16_z(svbool_t, svfloat16_t, svfloat16_t);
15612__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_m)))
15613svfloat64_t svamin_n_f64_m(svbool_t, svfloat64_t, float64_t);
15614__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_m)))
15615svfloat32_t svamin_n_f32_m(svbool_t, svfloat32_t, float32_t);
15616__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_m)))
15617svfloat16_t svamin_n_f16_m(svbool_t, svfloat16_t, float16_t);
15618__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_x)))
15619svfloat64_t svamin_n_f64_x(svbool_t, svfloat64_t, float64_t);
15620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_x)))
15621svfloat32_t svamin_n_f32_x(svbool_t, svfloat32_t, float32_t);
15622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_x)))
15623svfloat16_t svamin_n_f16_x(svbool_t, svfloat16_t, float16_t);
15624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_z)))
15625svfloat64_t svamin_n_f64_z(svbool_t, svfloat64_t, float64_t);
15626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_z)))
15627svfloat32_t svamin_n_f32_z(svbool_t, svfloat32_t, float32_t);
15628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_z)))
15629svfloat16_t svamin_n_f16_z(svbool_t, svfloat16_t, float16_t);
15630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_m)))
15631svfloat64_t svamin_f64_m(svbool_t, svfloat64_t, svfloat64_t);
15632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_m)))
15633svfloat32_t svamin_f32_m(svbool_t, svfloat32_t, svfloat32_t);
15634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_m)))
15635svfloat16_t svamin_f16_m(svbool_t, svfloat16_t, svfloat16_t);
15636__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_x)))
15637svfloat64_t svamin_f64_x(svbool_t, svfloat64_t, svfloat64_t);
15638__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_x)))
15639svfloat32_t svamin_f32_x(svbool_t, svfloat32_t, svfloat32_t);
15640__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_x)))
15641svfloat16_t svamin_f16_x(svbool_t, svfloat16_t, svfloat16_t);
15642__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_z)))
15643svfloat64_t svamin_f64_z(svbool_t, svfloat64_t, svfloat64_t);
15644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_z)))
15645svfloat32_t svamin_f32_z(svbool_t, svfloat32_t, svfloat32_t);
15646__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_z)))
15647svfloat16_t svamin_f16_z(svbool_t, svfloat16_t, svfloat16_t);
15648__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_m)))
15649svfloat64_t svamax_m(svbool_t, svfloat64_t, float64_t);
15650__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_m)))
15651svfloat32_t svamax_m(svbool_t, svfloat32_t, float32_t);
15652__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_m)))
15653svfloat16_t svamax_m(svbool_t, svfloat16_t, float16_t);
15654__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_x)))
15655svfloat64_t svamax_x(svbool_t, svfloat64_t, float64_t);
15656__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_x)))
15657svfloat32_t svamax_x(svbool_t, svfloat32_t, float32_t);
15658__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_x)))
15659svfloat16_t svamax_x(svbool_t, svfloat16_t, float16_t);
15660__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f64_z)))
15661svfloat64_t svamax_z(svbool_t, svfloat64_t, float64_t);
15662__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f32_z)))
15663svfloat32_t svamax_z(svbool_t, svfloat32_t, float32_t);
15664__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_n_f16_z)))
15665svfloat16_t svamax_z(svbool_t, svfloat16_t, float16_t);
15666__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_m)))
15667svfloat64_t svamax_m(svbool_t, svfloat64_t, svfloat64_t);
15668__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_m)))
15669svfloat32_t svamax_m(svbool_t, svfloat32_t, svfloat32_t);
15670__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_m)))
15671svfloat16_t svamax_m(svbool_t, svfloat16_t, svfloat16_t);
15672__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_x)))
15673svfloat64_t svamax_x(svbool_t, svfloat64_t, svfloat64_t);
15674__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_x)))
15675svfloat32_t svamax_x(svbool_t, svfloat32_t, svfloat32_t);
15676__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_x)))
15677svfloat16_t svamax_x(svbool_t, svfloat16_t, svfloat16_t);
15678__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f64_z)))
15679svfloat64_t svamax_z(svbool_t, svfloat64_t, svfloat64_t);
15680__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f32_z)))
15681svfloat32_t svamax_z(svbool_t, svfloat32_t, svfloat32_t);
15682__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamax_f16_z)))
15683svfloat16_t svamax_z(svbool_t, svfloat16_t, svfloat16_t);
15684__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_m)))
15685svfloat64_t svamin_m(svbool_t, svfloat64_t, float64_t);
15686__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_m)))
15687svfloat32_t svamin_m(svbool_t, svfloat32_t, float32_t);
15688__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_m)))
15689svfloat16_t svamin_m(svbool_t, svfloat16_t, float16_t);
15690__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_x)))
15691svfloat64_t svamin_x(svbool_t, svfloat64_t, float64_t);
15692__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_x)))
15693svfloat32_t svamin_x(svbool_t, svfloat32_t, float32_t);
15694__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_x)))
15695svfloat16_t svamin_x(svbool_t, svfloat16_t, float16_t);
15696__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f64_z)))
15697svfloat64_t svamin_z(svbool_t, svfloat64_t, float64_t);
15698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f32_z)))
15699svfloat32_t svamin_z(svbool_t, svfloat32_t, float32_t);
15700__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_n_f16_z)))
15701svfloat16_t svamin_z(svbool_t, svfloat16_t, float16_t);
15702__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_m)))
15703svfloat64_t svamin_m(svbool_t, svfloat64_t, svfloat64_t);
15704__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_m)))
15705svfloat32_t svamin_m(svbool_t, svfloat32_t, svfloat32_t);
15706__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_m)))
15707svfloat16_t svamin_m(svbool_t, svfloat16_t, svfloat16_t);
15708__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_x)))
15709svfloat64_t svamin_x(svbool_t, svfloat64_t, svfloat64_t);
15710__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_x)))
15711svfloat32_t svamin_x(svbool_t, svfloat32_t, svfloat32_t);
15712__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_x)))
15713svfloat16_t svamin_x(svbool_t, svfloat16_t, svfloat16_t);
15714__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f64_z)))
15715svfloat64_t svamin_z(svbool_t, svfloat64_t, svfloat64_t);
15716__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f32_z)))
15717svfloat32_t svamin_z(svbool_t, svfloat32_t, svfloat32_t);
15718__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svamin_f16_z)))
15719svfloat16_t svamin_z(svbool_t, svfloat16_t, svfloat16_t);
15720__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_bf16_mf8_fpm)))
15721svbfloat16_t svcvt1_bf16_mf8_fpm(svmfloat8_t, fpm_t);
15722__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_f16_mf8_fpm)))
15723svfloat16_t svcvt1_f16_mf8_fpm(svmfloat8_t, fpm_t);
15724__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_bf16_mf8_fpm)))
15725svbfloat16_t svcvt2_bf16_mf8_fpm(svmfloat8_t, fpm_t);
15726__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_f16_mf8_fpm)))
15727svfloat16_t svcvt2_f16_mf8_fpm(svmfloat8_t, fpm_t);
15728__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_bf16_mf8_fpm)))
15729svbfloat16_t svcvtlt1_bf16_mf8_fpm(svmfloat8_t, fpm_t);
15730__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_f16_mf8_fpm)))
15731svfloat16_t svcvtlt1_f16_mf8_fpm(svmfloat8_t, fpm_t);
15732__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_bf16_mf8_fpm)))
15733svbfloat16_t svcvtlt2_bf16_mf8_fpm(svmfloat8_t, fpm_t);
15734__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_f16_mf8_fpm)))
15735svfloat16_t svcvtlt2_f16_mf8_fpm(svmfloat8_t, fpm_t);
15736__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_bf16_x2_fpm)))
15737svmfloat8_t svcvtn_mf8_bf16_x2_fpm(svbfloat16x2_t, fpm_t);
15738__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_f16_x2_fpm)))
15739svmfloat8_t svcvtn_mf8_f16_x2_fpm(svfloat16x2_t, fpm_t);
15740__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnb_mf8_f32_x2_fpm)))
15741svmfloat8_t svcvtnb_mf8_f32_x2_fpm(svfloat32x2_t, fpm_t);
15742__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_mf8_f32_x2_fpm)))
15743svmfloat8_t svcvtnt_mf8_f32_x2_fpm(svmfloat8_t, svfloat32x2_t, fpm_t);
15744__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_bf16_mf8_fpm)))
15745svbfloat16_t svcvt1_bf16_fpm(svmfloat8_t, fpm_t);
15746__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt1_f16_mf8_fpm)))
15747svfloat16_t svcvt1_f16_fpm(svmfloat8_t, fpm_t);
15748__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_bf16_mf8_fpm)))
15749svbfloat16_t svcvt2_bf16_fpm(svmfloat8_t, fpm_t);
15750__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt2_f16_mf8_fpm)))
15751svfloat16_t svcvt2_f16_fpm(svmfloat8_t, fpm_t);
15752__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_bf16_mf8_fpm)))
15753svbfloat16_t svcvtlt1_bf16_fpm(svmfloat8_t, fpm_t);
15754__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt1_f16_mf8_fpm)))
15755svfloat16_t svcvtlt1_f16_fpm(svmfloat8_t, fpm_t);
15756__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_bf16_mf8_fpm)))
15757svbfloat16_t svcvtlt2_bf16_fpm(svmfloat8_t, fpm_t);
15758__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtlt2_f16_mf8_fpm)))
15759svfloat16_t svcvtlt2_f16_fpm(svmfloat8_t, fpm_t);
15760__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_bf16_x2_fpm)))
15761svmfloat8_t svcvtn_mf8_fpm(svbfloat16x2_t, fpm_t);
15762__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_mf8_f16_x2_fpm)))
15763svmfloat8_t svcvtn_mf8_fpm(svfloat16x2_t, fpm_t);
15764__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnb_mf8_f32_x2_fpm)))
15765svmfloat8_t svcvtnb_mf8_fpm(svfloat32x2_t, fpm_t);
15766__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_mf8_f32_x2_fpm)))
15767svmfloat8_t svcvtnt_mf8_fpm(svmfloat8_t, svfloat32x2_t, fpm_t);
15768__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u8)))
15769svuint8_t svluti2_lane_u8(svuint8_t, svuint8_t, uint64_t);
15770__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s8)))
15771svint8_t svluti2_lane_s8(svint8_t, svuint8_t, uint64_t);
15772__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u16)))
15773svuint16_t svluti2_lane_u16(svuint16_t, svuint8_t, uint64_t);
15774__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_bf16)))
15775svbfloat16_t svluti2_lane_bf16(svbfloat16_t, svuint8_t, uint64_t);
15776__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_f16)))
15777svfloat16_t svluti2_lane_f16(svfloat16_t, svuint8_t, uint64_t);
15778__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s16)))
15779svint16_t svluti2_lane_s16(svint16_t, svuint8_t, uint64_t);
15780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u8)))
15781svuint8_t svluti4_lane_u8(svuint8_t, svuint8_t, uint64_t);
15782__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s8)))
15783svint8_t svluti4_lane_s8(svint8_t, svuint8_t, uint64_t);
15784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16)))
15785svuint16_t svluti4_lane_u16(svuint16_t, svuint8_t, uint64_t);
15786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16)))
15787svbfloat16_t svluti4_lane_bf16(svbfloat16_t, svuint8_t, uint64_t);
15788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16)))
15789svfloat16_t svluti4_lane_f16(svfloat16_t, svuint8_t, uint64_t);
15790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16)))
15791svint16_t svluti4_lane_s16(svint16_t, svuint8_t, uint64_t);
15792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16_x2)))
15793svuint16_t svluti4_lane_u16_x2(svuint16x2_t, svuint8_t, uint64_t);
15794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16_x2)))
15795svbfloat16_t svluti4_lane_bf16_x2(svbfloat16x2_t, svuint8_t, uint64_t);
15796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16_x2)))
15797svfloat16_t svluti4_lane_f16_x2(svfloat16x2_t, svuint8_t, uint64_t);
15798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16_x2)))
15799svint16_t svluti4_lane_s16_x2(svint16x2_t, svuint8_t, uint64_t);
15800__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u8)))
15801svuint8_t svluti2_lane(svuint8_t, svuint8_t, uint64_t);
15802__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s8)))
15803svint8_t svluti2_lane(svint8_t, svuint8_t, uint64_t);
15804__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_u16)))
15805svuint16_t svluti2_lane(svuint16_t, svuint8_t, uint64_t);
15806__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_bf16)))
15807svbfloat16_t svluti2_lane(svbfloat16_t, svuint8_t, uint64_t);
15808__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_f16)))
15809svfloat16_t svluti2_lane(svfloat16_t, svuint8_t, uint64_t);
15810__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti2_lane_s16)))
15811svint16_t svluti2_lane(svint16_t, svuint8_t, uint64_t);
15812__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u8)))
15813svuint8_t svluti4_lane(svuint8_t, svuint8_t, uint64_t);
15814__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s8)))
15815svint8_t svluti4_lane(svint8_t, svuint8_t, uint64_t);
15816__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16)))
15817svuint16_t svluti4_lane(svuint16_t, svuint8_t, uint64_t);
15818__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16)))
15819svbfloat16_t svluti4_lane(svbfloat16_t, svuint8_t, uint64_t);
15820__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16)))
15821svfloat16_t svluti4_lane(svfloat16_t, svuint8_t, uint64_t);
15822__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16)))
15823svint16_t svluti4_lane(svint16_t, svuint8_t, uint64_t);
15824__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_u16_x2)))
15825svuint16_t svluti4_lane(svuint16x2_t, svuint8_t, uint64_t);
15826__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_bf16_x2)))
15827svbfloat16_t svluti4_lane(svbfloat16x2_t, svuint8_t, uint64_t);
15828__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_f16_x2)))
15829svfloat16_t svluti4_lane(svfloat16x2_t, svuint8_t, uint64_t);
15830__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti4_lane_s16_x2)))
15831svint16_t svluti4_lane(svint16x2_t, svuint8_t, uint64_t);
15832__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmmla_f32)))
15833svfloat32_t svbfmmla_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);
15834__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmmla_f32)))
15835svfloat32_t svbfmmla(svfloat32_t, svbfloat16_t, svbfloat16_t);
15836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_n_f32)))
15837svfloat32_t svbfdot_n_f32(svfloat32_t, svbfloat16_t, bfloat16_t);
15838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_f32)))
15839svfloat32_t svbfdot_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);
15840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_lane_f32)))
15841svfloat32_t svbfdot_lane_f32(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);
15842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_n_f32)))
15843svfloat32_t svbfmlalb_n_f32(svfloat32_t, svbfloat16_t, bfloat16_t);
15844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_f32)))
15845svfloat32_t svbfmlalb_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);
15846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_lane_f32)))
15847svfloat32_t svbfmlalb_lane_f32(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);
15848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_n_f32)))
15849svfloat32_t svbfmlalt_n_f32(svfloat32_t, svbfloat16_t, bfloat16_t);
15850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_f32)))
15851svfloat32_t svbfmlalt_f32(svfloat32_t, svbfloat16_t, svbfloat16_t);
15852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_lane_f32)))
15853svfloat32_t svbfmlalt_lane_f32(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);
15854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_m)))
15855svbfloat16_t svcvt_bf16_f32_m(svbfloat16_t, svbool_t, svfloat32_t);
15856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_x)))
15857svbfloat16_t svcvt_bf16_f32_x(svbool_t, svfloat32_t);
15858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_z)))
15859svbfloat16_t svcvt_bf16_f32_z(svbool_t, svfloat32_t);
15860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_bf16_f32_m)))
15861svbfloat16_t svcvtnt_bf16_f32_m(svbfloat16_t, svbool_t, svfloat32_t);
15862__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_n_f32)))
15863svfloat32_t svbfdot(svfloat32_t, svbfloat16_t, bfloat16_t);
15864__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_f32)))
15865svfloat32_t svbfdot(svfloat32_t, svbfloat16_t, svbfloat16_t);
15866__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfdot_lane_f32)))
15867svfloat32_t svbfdot_lane(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);
15868__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_n_f32)))
15869svfloat32_t svbfmlalb(svfloat32_t, svbfloat16_t, bfloat16_t);
15870__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_f32)))
15871svfloat32_t svbfmlalb(svfloat32_t, svbfloat16_t, svbfloat16_t);
15872__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalb_lane_f32)))
15873svfloat32_t svbfmlalb_lane(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);
15874__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_n_f32)))
15875svfloat32_t svbfmlalt(svfloat32_t, svbfloat16_t, bfloat16_t);
15876__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_f32)))
15877svfloat32_t svbfmlalt(svfloat32_t, svbfloat16_t, svbfloat16_t);
15878__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbfmlalt_lane_f32)))
15879svfloat32_t svbfmlalt_lane(svfloat32_t, svbfloat16_t, svbfloat16_t, uint64_t);
15880__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_m)))
15881svbfloat16_t svcvt_bf16_m(svbfloat16_t, svbool_t, svfloat32_t);
15882__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_x)))
15883svbfloat16_t svcvt_bf16_x(svbool_t, svfloat32_t);
15884__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvt_bf16_f32_z)))
15885svbfloat16_t svcvt_bf16_z(svbool_t, svfloat32_t);
15886__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtnt_bf16_f32_m)))
15887svbfloat16_t svcvtnt_bf16_m(svbfloat16_t, svbool_t, svfloat32_t);
15888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32)))
15889svfloat32_t svmmla_f32(svfloat32_t, svfloat32_t, svfloat32_t);
15890__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32)))
15891svfloat32_t svmmla(svfloat32_t, svfloat32_t, svfloat32_t);
15892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u8)))
15893svuint8_t svld1ro_u8(svbool_t, uint8_t const *);
15894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u32)))
15895svuint32_t svld1ro_u32(svbool_t, uint32_t const *);
15896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u64)))
15897svuint64_t svld1ro_u64(svbool_t, uint64_t const *);
15898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u16)))
15899svuint16_t svld1ro_u16(svbool_t, uint16_t const *);
15900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_bf16)))
15901svbfloat16_t svld1ro_bf16(svbool_t, bfloat16_t const *);
15902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s8)))
15903svint8_t svld1ro_s8(svbool_t, int8_t const *);
15904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f64)))
15905svfloat64_t svld1ro_f64(svbool_t, float64_t const *);
15906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f32)))
15907svfloat32_t svld1ro_f32(svbool_t, float32_t const *);
15908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f16)))
15909svfloat16_t svld1ro_f16(svbool_t, float16_t const *);
15910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s32)))
15911svint32_t svld1ro_s32(svbool_t, int32_t const *);
15912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s64)))
15913svint64_t svld1ro_s64(svbool_t, int64_t const *);
15914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_mf8)))
15915svmfloat8_t svld1ro_mf8(svbool_t, mfloat8_t const *);
15916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s16)))
15917svint16_t svld1ro_s16(svbool_t, int16_t const *);
15918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f64)))
15919svfloat64_t svmmla_f64(svfloat64_t, svfloat64_t, svfloat64_t);
15920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u8)))
15921svuint8_t svtrn1q_u8(svuint8_t, svuint8_t);
15922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u32)))
15923svuint32_t svtrn1q_u32(svuint32_t, svuint32_t);
15924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u64)))
15925svuint64_t svtrn1q_u64(svuint64_t, svuint64_t);
15926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u16)))
15927svuint16_t svtrn1q_u16(svuint16_t, svuint16_t);
15928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_bf16)))
15929svbfloat16_t svtrn1q_bf16(svbfloat16_t, svbfloat16_t);
15930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s8)))
15931svint8_t svtrn1q_s8(svint8_t, svint8_t);
15932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f64)))
15933svfloat64_t svtrn1q_f64(svfloat64_t, svfloat64_t);
15934__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f32)))
15935svfloat32_t svtrn1q_f32(svfloat32_t, svfloat32_t);
15936__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f16)))
15937svfloat16_t svtrn1q_f16(svfloat16_t, svfloat16_t);
15938__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s32)))
15939svint32_t svtrn1q_s32(svint32_t, svint32_t);
15940__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s64)))
15941svint64_t svtrn1q_s64(svint64_t, svint64_t);
15942__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s16)))
15943svint16_t svtrn1q_s16(svint16_t, svint16_t);
15944__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u8)))
15945svuint8_t svtrn2q_u8(svuint8_t, svuint8_t);
15946__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u32)))
15947svuint32_t svtrn2q_u32(svuint32_t, svuint32_t);
15948__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u64)))
15949svuint64_t svtrn2q_u64(svuint64_t, svuint64_t);
15950__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u16)))
15951svuint16_t svtrn2q_u16(svuint16_t, svuint16_t);
15952__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_bf16)))
15953svbfloat16_t svtrn2q_bf16(svbfloat16_t, svbfloat16_t);
15954__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s8)))
15955svint8_t svtrn2q_s8(svint8_t, svint8_t);
15956__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f64)))
15957svfloat64_t svtrn2q_f64(svfloat64_t, svfloat64_t);
15958__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f32)))
15959svfloat32_t svtrn2q_f32(svfloat32_t, svfloat32_t);
15960__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f16)))
15961svfloat16_t svtrn2q_f16(svfloat16_t, svfloat16_t);
15962__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s32)))
15963svint32_t svtrn2q_s32(svint32_t, svint32_t);
15964__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s64)))
15965svint64_t svtrn2q_s64(svint64_t, svint64_t);
15966__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s16)))
15967svint16_t svtrn2q_s16(svint16_t, svint16_t);
15968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u8)))
15969svuint8_t svuzp1q_u8(svuint8_t, svuint8_t);
15970__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u32)))
15971svuint32_t svuzp1q_u32(svuint32_t, svuint32_t);
15972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u64)))
15973svuint64_t svuzp1q_u64(svuint64_t, svuint64_t);
15974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u16)))
15975svuint16_t svuzp1q_u16(svuint16_t, svuint16_t);
15976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_bf16)))
15977svbfloat16_t svuzp1q_bf16(svbfloat16_t, svbfloat16_t);
15978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s8)))
15979svint8_t svuzp1q_s8(svint8_t, svint8_t);
15980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f64)))
15981svfloat64_t svuzp1q_f64(svfloat64_t, svfloat64_t);
15982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f32)))
15983svfloat32_t svuzp1q_f32(svfloat32_t, svfloat32_t);
15984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f16)))
15985svfloat16_t svuzp1q_f16(svfloat16_t, svfloat16_t);
15986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s32)))
15987svint32_t svuzp1q_s32(svint32_t, svint32_t);
15988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s64)))
15989svint64_t svuzp1q_s64(svint64_t, svint64_t);
15990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s16)))
15991svint16_t svuzp1q_s16(svint16_t, svint16_t);
15992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u8)))
15993svuint8_t svuzp2q_u8(svuint8_t, svuint8_t);
15994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u32)))
15995svuint32_t svuzp2q_u32(svuint32_t, svuint32_t);
15996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u64)))
15997svuint64_t svuzp2q_u64(svuint64_t, svuint64_t);
15998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u16)))
15999svuint16_t svuzp2q_u16(svuint16_t, svuint16_t);
16000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_bf16)))
16001svbfloat16_t svuzp2q_bf16(svbfloat16_t, svbfloat16_t);
16002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s8)))
16003svint8_t svuzp2q_s8(svint8_t, svint8_t);
16004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f64)))
16005svfloat64_t svuzp2q_f64(svfloat64_t, svfloat64_t);
16006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f32)))
16007svfloat32_t svuzp2q_f32(svfloat32_t, svfloat32_t);
16008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f16)))
16009svfloat16_t svuzp2q_f16(svfloat16_t, svfloat16_t);
16010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s32)))
16011svint32_t svuzp2q_s32(svint32_t, svint32_t);
16012__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s64)))
16013svint64_t svuzp2q_s64(svint64_t, svint64_t);
16014__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s16)))
16015svint16_t svuzp2q_s16(svint16_t, svint16_t);
16016__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u8)))
16017svuint8_t svzip1q_u8(svuint8_t, svuint8_t);
16018__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u32)))
16019svuint32_t svzip1q_u32(svuint32_t, svuint32_t);
16020__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u64)))
16021svuint64_t svzip1q_u64(svuint64_t, svuint64_t);
16022__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u16)))
16023svuint16_t svzip1q_u16(svuint16_t, svuint16_t);
16024__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_bf16)))
16025svbfloat16_t svzip1q_bf16(svbfloat16_t, svbfloat16_t);
16026__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s8)))
16027svint8_t svzip1q_s8(svint8_t, svint8_t);
16028__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f64)))
16029svfloat64_t svzip1q_f64(svfloat64_t, svfloat64_t);
16030__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f32)))
16031svfloat32_t svzip1q_f32(svfloat32_t, svfloat32_t);
16032__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f16)))
16033svfloat16_t svzip1q_f16(svfloat16_t, svfloat16_t);
16034__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s32)))
16035svint32_t svzip1q_s32(svint32_t, svint32_t);
16036__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s64)))
16037svint64_t svzip1q_s64(svint64_t, svint64_t);
16038__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s16)))
16039svint16_t svzip1q_s16(svint16_t, svint16_t);
16040__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u8)))
16041svuint8_t svzip2q_u8(svuint8_t, svuint8_t);
16042__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u32)))
16043svuint32_t svzip2q_u32(svuint32_t, svuint32_t);
16044__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u64)))
16045svuint64_t svzip2q_u64(svuint64_t, svuint64_t);
16046__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u16)))
16047svuint16_t svzip2q_u16(svuint16_t, svuint16_t);
16048__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_bf16)))
16049svbfloat16_t svzip2q_bf16(svbfloat16_t, svbfloat16_t);
16050__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s8)))
16051svint8_t svzip2q_s8(svint8_t, svint8_t);
16052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f64)))
16053svfloat64_t svzip2q_f64(svfloat64_t, svfloat64_t);
16054__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f32)))
16055svfloat32_t svzip2q_f32(svfloat32_t, svfloat32_t);
16056__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f16)))
16057svfloat16_t svzip2q_f16(svfloat16_t, svfloat16_t);
16058__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s32)))
16059svint32_t svzip2q_s32(svint32_t, svint32_t);
16060__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s64)))
16061svint64_t svzip2q_s64(svint64_t, svint64_t);
16062__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s16)))
16063svint16_t svzip2q_s16(svint16_t, svint16_t);
16064__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u8)))
16065svuint8_t svld1ro(svbool_t, uint8_t const *);
16066__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u32)))
16067svuint32_t svld1ro(svbool_t, uint32_t const *);
16068__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u64)))
16069svuint64_t svld1ro(svbool_t, uint64_t const *);
16070__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_u16)))
16071svuint16_t svld1ro(svbool_t, uint16_t const *);
16072__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_bf16)))
16073svbfloat16_t svld1ro(svbool_t, bfloat16_t const *);
16074__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s8)))
16075svint8_t svld1ro(svbool_t, int8_t const *);
16076__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f64)))
16077svfloat64_t svld1ro(svbool_t, float64_t const *);
16078__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f32)))
16079svfloat32_t svld1ro(svbool_t, float32_t const *);
16080__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_f16)))
16081svfloat16_t svld1ro(svbool_t, float16_t const *);
16082__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s32)))
16083svint32_t svld1ro(svbool_t, int32_t const *);
16084__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s64)))
16085svint64_t svld1ro(svbool_t, int64_t const *);
16086__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_mf8)))
16087svmfloat8_t svld1ro(svbool_t, mfloat8_t const *);
16088__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1ro_s16)))
16089svint16_t svld1ro(svbool_t, int16_t const *);
16090__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f64)))
16091svfloat64_t svmmla(svfloat64_t, svfloat64_t, svfloat64_t);
16092__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u8)))
16093svuint8_t svtrn1q(svuint8_t, svuint8_t);
16094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u32)))
16095svuint32_t svtrn1q(svuint32_t, svuint32_t);
16096__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u64)))
16097svuint64_t svtrn1q(svuint64_t, svuint64_t);
16098__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_u16)))
16099svuint16_t svtrn1q(svuint16_t, svuint16_t);
16100__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_bf16)))
16101svbfloat16_t svtrn1q(svbfloat16_t, svbfloat16_t);
16102__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s8)))
16103svint8_t svtrn1q(svint8_t, svint8_t);
16104__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f64)))
16105svfloat64_t svtrn1q(svfloat64_t, svfloat64_t);
16106__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f32)))
16107svfloat32_t svtrn1q(svfloat32_t, svfloat32_t);
16108__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_f16)))
16109svfloat16_t svtrn1q(svfloat16_t, svfloat16_t);
16110__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s32)))
16111svint32_t svtrn1q(svint32_t, svint32_t);
16112__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s64)))
16113svint64_t svtrn1q(svint64_t, svint64_t);
16114__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn1q_s16)))
16115svint16_t svtrn1q(svint16_t, svint16_t);
16116__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u8)))
16117svuint8_t svtrn2q(svuint8_t, svuint8_t);
16118__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u32)))
16119svuint32_t svtrn2q(svuint32_t, svuint32_t);
16120__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u64)))
16121svuint64_t svtrn2q(svuint64_t, svuint64_t);
16122__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_u16)))
16123svuint16_t svtrn2q(svuint16_t, svuint16_t);
16124__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_bf16)))
16125svbfloat16_t svtrn2q(svbfloat16_t, svbfloat16_t);
16126__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s8)))
16127svint8_t svtrn2q(svint8_t, svint8_t);
16128__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f64)))
16129svfloat64_t svtrn2q(svfloat64_t, svfloat64_t);
16130__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f32)))
16131svfloat32_t svtrn2q(svfloat32_t, svfloat32_t);
16132__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_f16)))
16133svfloat16_t svtrn2q(svfloat16_t, svfloat16_t);
16134__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s32)))
16135svint32_t svtrn2q(svint32_t, svint32_t);
16136__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s64)))
16137svint64_t svtrn2q(svint64_t, svint64_t);
16138__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svtrn2q_s16)))
16139svint16_t svtrn2q(svint16_t, svint16_t);
16140__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u8)))
16141svuint8_t svuzp1q(svuint8_t, svuint8_t);
16142__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u32)))
16143svuint32_t svuzp1q(svuint32_t, svuint32_t);
16144__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u64)))
16145svuint64_t svuzp1q(svuint64_t, svuint64_t);
16146__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_u16)))
16147svuint16_t svuzp1q(svuint16_t, svuint16_t);
16148__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_bf16)))
16149svbfloat16_t svuzp1q(svbfloat16_t, svbfloat16_t);
16150__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s8)))
16151svint8_t svuzp1q(svint8_t, svint8_t);
16152__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f64)))
16153svfloat64_t svuzp1q(svfloat64_t, svfloat64_t);
16154__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f32)))
16155svfloat32_t svuzp1q(svfloat32_t, svfloat32_t);
16156__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_f16)))
16157svfloat16_t svuzp1q(svfloat16_t, svfloat16_t);
16158__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s32)))
16159svint32_t svuzp1q(svint32_t, svint32_t);
16160__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s64)))
16161svint64_t svuzp1q(svint64_t, svint64_t);
16162__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp1q_s16)))
16163svint16_t svuzp1q(svint16_t, svint16_t);
16164__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u8)))
16165svuint8_t svuzp2q(svuint8_t, svuint8_t);
16166__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u32)))
16167svuint32_t svuzp2q(svuint32_t, svuint32_t);
16168__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u64)))
16169svuint64_t svuzp2q(svuint64_t, svuint64_t);
16170__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_u16)))
16171svuint16_t svuzp2q(svuint16_t, svuint16_t);
16172__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_bf16)))
16173svbfloat16_t svuzp2q(svbfloat16_t, svbfloat16_t);
16174__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s8)))
16175svint8_t svuzp2q(svint8_t, svint8_t);
16176__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f64)))
16177svfloat64_t svuzp2q(svfloat64_t, svfloat64_t);
16178__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f32)))
16179svfloat32_t svuzp2q(svfloat32_t, svfloat32_t);
16180__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_f16)))
16181svfloat16_t svuzp2q(svfloat16_t, svfloat16_t);
16182__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s32)))
16183svint32_t svuzp2q(svint32_t, svint32_t);
16184__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s64)))
16185svint64_t svuzp2q(svint64_t, svint64_t);
16186__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svuzp2q_s16)))
16187svint16_t svuzp2q(svint16_t, svint16_t);
16188__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u8)))
16189svuint8_t svzip1q(svuint8_t, svuint8_t);
16190__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u32)))
16191svuint32_t svzip1q(svuint32_t, svuint32_t);
16192__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u64)))
16193svuint64_t svzip1q(svuint64_t, svuint64_t);
16194__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_u16)))
16195svuint16_t svzip1q(svuint16_t, svuint16_t);
16196__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_bf16)))
16197svbfloat16_t svzip1q(svbfloat16_t, svbfloat16_t);
16198__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s8)))
16199svint8_t svzip1q(svint8_t, svint8_t);
16200__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f64)))
16201svfloat64_t svzip1q(svfloat64_t, svfloat64_t);
16202__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f32)))
16203svfloat32_t svzip1q(svfloat32_t, svfloat32_t);
16204__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_f16)))
16205svfloat16_t svzip1q(svfloat16_t, svfloat16_t);
16206__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s32)))
16207svint32_t svzip1q(svint32_t, svint32_t);
16208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s64)))
16209svint64_t svzip1q(svint64_t, svint64_t);
16210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip1q_s16)))
16211svint16_t svzip1q(svint16_t, svint16_t);
16212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u8)))
16213svuint8_t svzip2q(svuint8_t, svuint8_t);
16214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u32)))
16215svuint32_t svzip2q(svuint32_t, svuint32_t);
16216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u64)))
16217svuint64_t svzip2q(svuint64_t, svuint64_t);
16218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_u16)))
16219svuint16_t svzip2q(svuint16_t, svuint16_t);
16220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_bf16)))
16221svbfloat16_t svzip2q(svbfloat16_t, svbfloat16_t);
16222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s8)))
16223svint8_t svzip2q(svint8_t, svint8_t);
16224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f64)))
16225svfloat64_t svzip2q(svfloat64_t, svfloat64_t);
16226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f32)))
16227svfloat32_t svzip2q(svfloat32_t, svfloat32_t);
16228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_f16)))
16229svfloat16_t svzip2q(svfloat16_t, svfloat16_t);
16230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s32)))
16231svint32_t svzip2q(svint32_t, svint32_t);
16232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s64)))
16233svint64_t svzip2q(svint64_t, svint64_t);
16234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svzip2q_s16)))
16235svint16_t svzip2q(svint16_t, svint16_t);
16236__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_s32)))
16237svint32_t svmmla_s32(svint32_t, svint8_t, svint8_t);
16238__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_u32)))
16239svuint32_t svmmla_u32(svuint32_t, svuint8_t, svuint8_t);
16240__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusmmla_s32)))
16241svint32_t svusmmla_s32(svint32_t, svuint8_t, svint8_t);
16242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_s32)))
16243svint32_t svmmla(svint32_t, svint8_t, svint8_t);
16244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_u32)))
16245svuint32_t svmmla(svuint32_t, svuint8_t, svuint8_t);
16246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusmmla_s32)))
16247svint32_t svusmmla(svint32_t, svuint8_t, svint8_t);
16248__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_n_s32)))
16249svint32_t svsudot_n_s32(svint32_t, svint8_t, uint8_t);
16250__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_s32)))
16251svint32_t svsudot_s32(svint32_t, svint8_t, svuint8_t);
16252__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_lane_s32)))
16253svint32_t svsudot_lane_s32(svint32_t, svint8_t, svuint8_t, uint64_t);
16254__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_n_s32)))
16255svint32_t svusdot_n_s32(svint32_t, svuint8_t, int8_t);
16256__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_s32)))
16257svint32_t svusdot_s32(svint32_t, svuint8_t, svint8_t);
16258__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_lane_s32)))
16259svint32_t svusdot_lane_s32(svint32_t, svuint8_t, svint8_t, uint64_t);
16260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_n_s32)))
16261svint32_t svsudot(svint32_t, svint8_t, uint8_t);
16262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_s32)))
16263svint32_t svsudot(svint32_t, svint8_t, svuint8_t);
16264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsudot_lane_s32)))
16265svint32_t svsudot_lane(svint32_t, svint8_t, svuint8_t, uint64_t);
16266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_n_s32)))
16267svint32_t svusdot(svint32_t, svuint8_t, int8_t);
16268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_s32)))
16269svint32_t svusdot(svint32_t, svuint8_t, svint8_t);
16270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svusdot_lane_s32)))
16271svint32_t svusdot_lane(svint32_t, svuint8_t, svint8_t, uint64_t);
16272__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_lane_u8_x2)))
16273svuint8x2_t svaesd_lane_u8_x2(svuint8x2_t, svuint8_t, uint64_t);
16274__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_lane_u8_x4)))
16275svuint8x4_t svaesd_lane_u8_x4(svuint8x4_t, svuint8_t, uint64_t);
16276__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesdimc_lane_u8_x2)))
16277svuint8x2_t svaesdimc_lane_u8_x2(svuint8x2_t, svuint8_t, uint64_t);
16278__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesdimc_lane_u8_x4)))
16279svuint8x4_t svaesdimc_lane_u8_x4(svuint8x4_t, svuint8_t, uint64_t);
16280__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_lane_u8_x2)))
16281svuint8x2_t svaese_lane_u8_x2(svuint8x2_t, svuint8_t, uint64_t);
16282__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_lane_u8_x4)))
16283svuint8x4_t svaese_lane_u8_x4(svuint8x4_t, svuint8_t, uint64_t);
16284__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesemc_lane_u8_x2)))
16285svuint8x2_t svaesemc_lane_u8_x2(svuint8x2_t, svuint8_t, uint64_t);
16286__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesemc_lane_u8_x4)))
16287svuint8x4_t svaesemc_lane_u8_x4(svuint8x4_t, svuint8_t, uint64_t);
16288__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmlal_pair_n_u64_x2)))
16289svuint64x2_t svpmlal_pair_n_u64_x2(svuint64x2_t, svuint64_t, uint64_t);
16290__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmlal_pair_u64_x2)))
16291svuint64x2_t svpmlal_pair_u64_x2(svuint64x2_t, svuint64_t, svuint64_t);
16292__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmull_pair_n_u64_x2)))
16293svuint64x2_t svpmull_pair_n_u64_x2(svuint64_t, uint64_t);
16294__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmull_pair_u64_x2)))
16295svuint64x2_t svpmull_pair_u64_x2(svuint64_t, svuint64_t);
16296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_lane_u8_x2)))
16297svuint8x2_t svaesd_lane(svuint8x2_t, svuint8_t, uint64_t);
16298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_lane_u8_x4)))
16299svuint8x4_t svaesd_lane(svuint8x4_t, svuint8_t, uint64_t);
16300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesdimc_lane_u8_x2)))
16301svuint8x2_t svaesdimc_lane(svuint8x2_t, svuint8_t, uint64_t);
16302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesdimc_lane_u8_x4)))
16303svuint8x4_t svaesdimc_lane(svuint8x4_t, svuint8_t, uint64_t);
16304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_lane_u8_x2)))
16305svuint8x2_t svaese_lane(svuint8x2_t, svuint8_t, uint64_t);
16306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_lane_u8_x4)))
16307svuint8x4_t svaese_lane(svuint8x4_t, svuint8_t, uint64_t);
16308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesemc_lane_u8_x2)))
16309svuint8x2_t svaesemc_lane(svuint8x2_t, svuint8_t, uint64_t);
16310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesemc_lane_u8_x4)))
16311svuint8x4_t svaesemc_lane(svuint8x4_t, svuint8_t, uint64_t);
16312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmlal_pair_n_u64_x2)))
16313svuint64x2_t svpmlal_pair(svuint64x2_t, svuint64_t, uint64_t);
16314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmlal_pair_u64_x2)))
16315svuint64x2_t svpmlal_pair(svuint64x2_t, svuint64_t, svuint64_t);
16316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmull_pair_n_u64_x2)))
16317svuint64x2_t svpmull_pair(svuint64_t, uint64_t);
16318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmull_pair_u64_x2)))
16319svuint64x2_t svpmull_pair(svuint64_t, svuint64_t);
16320__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_u8)))
16321svuint8_t svaesd_u8(svuint8_t, svuint8_t);
16322__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_u8)))
16323svuint8_t svaese_u8(svuint8_t, svuint8_t);
16324__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesimc_u8)))
16325svuint8_t svaesimc_u8(svuint8_t);
16326__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesmc_u8)))
16327svuint8_t svaesmc_u8(svuint8_t);
16328__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_n_u64)))
16329svuint64_t svpmullb_pair_n_u64(svuint64_t, uint64_t);
16330__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_u64)))
16331svuint64_t svpmullb_pair_u64(svuint64_t, svuint64_t);
16332__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_n_u64)))
16333svuint64_t svpmullt_pair_n_u64(svuint64_t, uint64_t);
16334__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_u64)))
16335svuint64_t svpmullt_pair_u64(svuint64_t, svuint64_t);
16336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesd_u8)))
16337svuint8_t svaesd(svuint8_t, svuint8_t);
16338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaese_u8)))
16339svuint8_t svaese(svuint8_t, svuint8_t);
16340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesimc_u8)))
16341svuint8_t svaesimc(svuint8_t);
16342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaesmc_u8)))
16343svuint8_t svaesmc(svuint8_t);
16344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_n_u64)))
16345svuint64_t svpmullb_pair(svuint64_t, uint64_t);
16346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullb_pair_u64)))
16347svuint64_t svpmullb_pair(svuint64_t, svuint64_t);
16348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_n_u64)))
16349svuint64_t svpmullt_pair(svuint64_t, uint64_t);
16350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpmullt_pair_u64)))
16351svuint64_t svpmullt_pair(svuint64_t, svuint64_t);
16352__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_m)))
16353svbfloat16_t svadd_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16354__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_x)))
16355svbfloat16_t svadd_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16356__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_z)))
16357svbfloat16_t svadd_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16358__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_m)))
16359svbfloat16_t svadd_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16360__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_x)))
16361svbfloat16_t svadd_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16362__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_z)))
16363svbfloat16_t svadd_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16364__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svclamp_bf16)))
16365svbfloat16_t svclamp_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t);
16366__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_m)))
16367svbfloat16_t svmax_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16368__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_x)))
16369svbfloat16_t svmax_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16370__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_z)))
16371svbfloat16_t svmax_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16372__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_m)))
16373svbfloat16_t svmax_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16374__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_x)))
16375svbfloat16_t svmax_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16376__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_z)))
16377svbfloat16_t svmax_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16378__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_m)))
16379svbfloat16_t svmaxnm_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16380__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_x)))
16381svbfloat16_t svmaxnm_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16382__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_z)))
16383svbfloat16_t svmaxnm_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16384__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_m)))
16385svbfloat16_t svmaxnm_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16386__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_x)))
16387svbfloat16_t svmaxnm_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16388__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_z)))
16389svbfloat16_t svmaxnm_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16390__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_m)))
16391svbfloat16_t svmin_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16392__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_x)))
16393svbfloat16_t svmin_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16394__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_z)))
16395svbfloat16_t svmin_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16396__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_m)))
16397svbfloat16_t svmin_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16398__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_x)))
16399svbfloat16_t svmin_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16400__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_z)))
16401svbfloat16_t svmin_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16402__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_m)))
16403svbfloat16_t svminnm_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16404__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_x)))
16405svbfloat16_t svminnm_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16406__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_z)))
16407svbfloat16_t svminnm_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16408__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_m)))
16409svbfloat16_t svminnm_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16410__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x)))
16411svbfloat16_t svminnm_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16412__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_z)))
16413svbfloat16_t svminnm_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16414__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_m)))
16415svbfloat16_t svmla_n_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16416__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_x)))
16417svbfloat16_t svmla_n_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16418__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_z)))
16419svbfloat16_t svmla_n_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16420__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_m)))
16421svbfloat16_t svmla_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16422__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_x)))
16423svbfloat16_t svmla_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16424__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_z)))
16425svbfloat16_t svmla_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16426__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_lane_bf16)))
16427svbfloat16_t svmla_lane_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
16428__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_m)))
16429svbfloat16_t svmls_n_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16430__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_x)))
16431svbfloat16_t svmls_n_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16432__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_z)))
16433svbfloat16_t svmls_n_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16434__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_m)))
16435svbfloat16_t svmls_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16436__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_x)))
16437svbfloat16_t svmls_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16438__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_z)))
16439svbfloat16_t svmls_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16440__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_lane_bf16)))
16441svbfloat16_t svmls_lane_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
16442__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_m)))
16443svbfloat16_t svmul_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16444__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_x)))
16445svbfloat16_t svmul_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16446__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_z)))
16447svbfloat16_t svmul_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16448__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_m)))
16449svbfloat16_t svmul_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16450__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x)))
16451svbfloat16_t svmul_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16452__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_z)))
16453svbfloat16_t svmul_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16454__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_lane_bf16)))
16455svbfloat16_t svmul_lane_bf16(svbfloat16_t, svbfloat16_t, uint64_t);
16456__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_m)))
16457svbfloat16_t svsub_n_bf16_m(svbool_t, svbfloat16_t, bfloat16_t);
16458__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_x)))
16459svbfloat16_t svsub_n_bf16_x(svbool_t, svbfloat16_t, bfloat16_t);
16460__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_z)))
16461svbfloat16_t svsub_n_bf16_z(svbool_t, svbfloat16_t, bfloat16_t);
16462__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_m)))
16463svbfloat16_t svsub_bf16_m(svbool_t, svbfloat16_t, svbfloat16_t);
16464__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_x)))
16465svbfloat16_t svsub_bf16_x(svbool_t, svbfloat16_t, svbfloat16_t);
16466__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_z)))
16467svbfloat16_t svsub_bf16_z(svbool_t, svbfloat16_t, svbfloat16_t);
16468__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_m)))
16469svbfloat16_t svadd_m(svbool_t, svbfloat16_t, bfloat16_t);
16470__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_x)))
16471svbfloat16_t svadd_x(svbool_t, svbfloat16_t, bfloat16_t);
16472__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_n_bf16_z)))
16473svbfloat16_t svadd_z(svbool_t, svbfloat16_t, bfloat16_t);
16474__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_m)))
16475svbfloat16_t svadd_m(svbool_t, svbfloat16_t, svbfloat16_t);
16476__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_x)))
16477svbfloat16_t svadd_x(svbool_t, svbfloat16_t, svbfloat16_t);
16478__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadd_bf16_z)))
16479svbfloat16_t svadd_z(svbool_t, svbfloat16_t, svbfloat16_t);
16480__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svclamp_bf16)))
16481svbfloat16_t svclamp(svbfloat16_t, svbfloat16_t, svbfloat16_t);
16482__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_m)))
16483svbfloat16_t svmax_m(svbool_t, svbfloat16_t, bfloat16_t);
16484__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_x)))
16485svbfloat16_t svmax_x(svbool_t, svbfloat16_t, bfloat16_t);
16486__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_n_bf16_z)))
16487svbfloat16_t svmax_z(svbool_t, svbfloat16_t, bfloat16_t);
16488__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_m)))
16489svbfloat16_t svmax_m(svbool_t, svbfloat16_t, svbfloat16_t);
16490__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_x)))
16491svbfloat16_t svmax_x(svbool_t, svbfloat16_t, svbfloat16_t);
16492__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmax_bf16_z)))
16493svbfloat16_t svmax_z(svbool_t, svbfloat16_t, svbfloat16_t);
16494__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_m)))
16495svbfloat16_t svmaxnm_m(svbool_t, svbfloat16_t, bfloat16_t);
16496__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_x)))
16497svbfloat16_t svmaxnm_x(svbool_t, svbfloat16_t, bfloat16_t);
16498__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_n_bf16_z)))
16499svbfloat16_t svmaxnm_z(svbool_t, svbfloat16_t, bfloat16_t);
16500__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_m)))
16501svbfloat16_t svmaxnm_m(svbool_t, svbfloat16_t, svbfloat16_t);
16502__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_x)))
16503svbfloat16_t svmaxnm_x(svbool_t, svbfloat16_t, svbfloat16_t);
16504__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmaxnm_bf16_z)))
16505svbfloat16_t svmaxnm_z(svbool_t, svbfloat16_t, svbfloat16_t);
16506__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_m)))
16507svbfloat16_t svmin_m(svbool_t, svbfloat16_t, bfloat16_t);
16508__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_x)))
16509svbfloat16_t svmin_x(svbool_t, svbfloat16_t, bfloat16_t);
16510__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_n_bf16_z)))
16511svbfloat16_t svmin_z(svbool_t, svbfloat16_t, bfloat16_t);
16512__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_m)))
16513svbfloat16_t svmin_m(svbool_t, svbfloat16_t, svbfloat16_t);
16514__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_x)))
16515svbfloat16_t svmin_x(svbool_t, svbfloat16_t, svbfloat16_t);
16516__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmin_bf16_z)))
16517svbfloat16_t svmin_z(svbool_t, svbfloat16_t, svbfloat16_t);
16518__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_m)))
16519svbfloat16_t svminnm_m(svbool_t, svbfloat16_t, bfloat16_t);
16520__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_x)))
16521svbfloat16_t svminnm_x(svbool_t, svbfloat16_t, bfloat16_t);
16522__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_n_bf16_z)))
16523svbfloat16_t svminnm_z(svbool_t, svbfloat16_t, bfloat16_t);
16524__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_m)))
16525svbfloat16_t svminnm_m(svbool_t, svbfloat16_t, svbfloat16_t);
16526__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_x)))
16527svbfloat16_t svminnm_x(svbool_t, svbfloat16_t, svbfloat16_t);
16528__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svminnm_bf16_z)))
16529svbfloat16_t svminnm_z(svbool_t, svbfloat16_t, svbfloat16_t);
16530__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_m)))
16531svbfloat16_t svmla_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16532__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_x)))
16533svbfloat16_t svmla_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16534__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_n_bf16_z)))
16535svbfloat16_t svmla_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16536__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_m)))
16537svbfloat16_t svmla_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16538__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_x)))
16539svbfloat16_t svmla_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16540__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_bf16_z)))
16541svbfloat16_t svmla_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16542__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmla_lane_bf16)))
16543svbfloat16_t svmla_lane(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
16544__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_m)))
16545svbfloat16_t svmls_m(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16546__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_x)))
16547svbfloat16_t svmls_x(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16548__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_n_bf16_z)))
16549svbfloat16_t svmls_z(svbool_t, svbfloat16_t, svbfloat16_t, bfloat16_t);
16550__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_m)))
16551svbfloat16_t svmls_m(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16552__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_x)))
16553svbfloat16_t svmls_x(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16554__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_bf16_z)))
16555svbfloat16_t svmls_z(svbool_t, svbfloat16_t, svbfloat16_t, svbfloat16_t);
16556__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmls_lane_bf16)))
16557svbfloat16_t svmls_lane(svbfloat16_t, svbfloat16_t, svbfloat16_t, uint64_t);
16558__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_m)))
16559svbfloat16_t svmul_m(svbool_t, svbfloat16_t, bfloat16_t);
16560__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_x)))
16561svbfloat16_t svmul_x(svbool_t, svbfloat16_t, bfloat16_t);
16562__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_n_bf16_z)))
16563svbfloat16_t svmul_z(svbool_t, svbfloat16_t, bfloat16_t);
16564__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_m)))
16565svbfloat16_t svmul_m(svbool_t, svbfloat16_t, svbfloat16_t);
16566__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_x)))
16567svbfloat16_t svmul_x(svbool_t, svbfloat16_t, svbfloat16_t);
16568__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_bf16_z)))
16569svbfloat16_t svmul_z(svbool_t, svbfloat16_t, svbfloat16_t);
16570__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_lane_bf16)))
16571svbfloat16_t svmul_lane(svbfloat16_t, svbfloat16_t, uint64_t);
16572__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_m)))
16573svbfloat16_t svsub_m(svbool_t, svbfloat16_t, bfloat16_t);
16574__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_x)))
16575svbfloat16_t svsub_x(svbool_t, svbfloat16_t, bfloat16_t);
16576__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_n_bf16_z)))
16577svbfloat16_t svsub_z(svbool_t, svbfloat16_t, bfloat16_t);
16578__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_m)))
16579svbfloat16_t svsub_m(svbool_t, svbfloat16_t, svbfloat16_t);
16580__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_x)))
16581svbfloat16_t svsub_x(svbool_t, svbfloat16_t, svbfloat16_t);
16582__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_z)))
16583svbfloat16_t svsub_z(svbool_t, svbfloat16_t, svbfloat16_t);
16584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_m)))
16585svbfloat16_t svscale_n_bf16_m(svbool_t, svbfloat16_t, int16_t);
16586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_x)))
16587svbfloat16_t svscale_n_bf16_x(svbool_t, svbfloat16_t, int16_t);
16588__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_z)))
16589svbfloat16_t svscale_n_bf16_z(svbool_t, svbfloat16_t, int16_t);
16590__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_m)))
16591svbfloat16_t svscale_bf16_m(svbool_t, svbfloat16_t, svint16_t);
16592__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_x)))
16593svbfloat16_t svscale_bf16_x(svbool_t, svbfloat16_t, svint16_t);
16594__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_z)))
16595svbfloat16_t svscale_bf16_z(svbool_t, svbfloat16_t, svint16_t);
16596__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_m)))
16597svbfloat16_t svscale_m(svbool_t, svbfloat16_t, int16_t);
16598__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_x)))
16599svbfloat16_t svscale_x(svbool_t, svbfloat16_t, int16_t);
16600__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_z)))
16601svbfloat16_t svscale_z(svbool_t, svbfloat16_t, int16_t);
16602__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_m)))
16603svbfloat16_t svscale_m(svbool_t, svbfloat16_t, svint16_t);
16604__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_x)))
16605svbfloat16_t svscale_x(svbool_t, svbfloat16_t, svint16_t);
16606__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_bf16_z)))
16607svbfloat16_t svscale_z(svbool_t, svbfloat16_t, svint16_t);
16608__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u8)))
16609svuint8_t svbdep_n_u8(svuint8_t, uint8_t);
16610__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u32)))
16611svuint32_t svbdep_n_u32(svuint32_t, uint32_t);
16612__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u64)))
16613svuint64_t svbdep_n_u64(svuint64_t, uint64_t);
16614__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u16)))
16615svuint16_t svbdep_n_u16(svuint16_t, uint16_t);
16616__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u8)))
16617svuint8_t svbdep_u8(svuint8_t, svuint8_t);
16618__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u32)))
16619svuint32_t svbdep_u32(svuint32_t, svuint32_t);
16620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u64)))
16621svuint64_t svbdep_u64(svuint64_t, svuint64_t);
16622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u16)))
16623svuint16_t svbdep_u16(svuint16_t, svuint16_t);
16624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u8)))
16625svuint8_t svbext_n_u8(svuint8_t, uint8_t);
16626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u32)))
16627svuint32_t svbext_n_u32(svuint32_t, uint32_t);
16628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u64)))
16629svuint64_t svbext_n_u64(svuint64_t, uint64_t);
16630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u16)))
16631svuint16_t svbext_n_u16(svuint16_t, uint16_t);
16632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u8)))
16633svuint8_t svbext_u8(svuint8_t, svuint8_t);
16634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u32)))
16635svuint32_t svbext_u32(svuint32_t, svuint32_t);
16636__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u64)))
16637svuint64_t svbext_u64(svuint64_t, svuint64_t);
16638__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u16)))
16639svuint16_t svbext_u16(svuint16_t, svuint16_t);
16640__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u8)))
16641svuint8_t svbgrp_n_u8(svuint8_t, uint8_t);
16642__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u32)))
16643svuint32_t svbgrp_n_u32(svuint32_t, uint32_t);
16644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u64)))
16645svuint64_t svbgrp_n_u64(svuint64_t, uint64_t);
16646__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u16)))
16647svuint16_t svbgrp_n_u16(svuint16_t, uint16_t);
16648__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u8)))
16649svuint8_t svbgrp_u8(svuint8_t, svuint8_t);
16650__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u32)))
16651svuint32_t svbgrp_u32(svuint32_t, svuint32_t);
16652__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u64)))
16653svuint64_t svbgrp_u64(svuint64_t, svuint64_t);
16654__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u16)))
16655svuint16_t svbgrp_u16(svuint16_t, svuint16_t);
16656__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u8)))
16657svuint8_t svbdep(svuint8_t, uint8_t);
16658__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u32)))
16659svuint32_t svbdep(svuint32_t, uint32_t);
16660__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u64)))
16661svuint64_t svbdep(svuint64_t, uint64_t);
16662__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_n_u16)))
16663svuint16_t svbdep(svuint16_t, uint16_t);
16664__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u8)))
16665svuint8_t svbdep(svuint8_t, svuint8_t);
16666__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u32)))
16667svuint32_t svbdep(svuint32_t, svuint32_t);
16668__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u64)))
16669svuint64_t svbdep(svuint64_t, svuint64_t);
16670__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbdep_u16)))
16671svuint16_t svbdep(svuint16_t, svuint16_t);
16672__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u8)))
16673svuint8_t svbext(svuint8_t, uint8_t);
16674__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u32)))
16675svuint32_t svbext(svuint32_t, uint32_t);
16676__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u64)))
16677svuint64_t svbext(svuint64_t, uint64_t);
16678__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_n_u16)))
16679svuint16_t svbext(svuint16_t, uint16_t);
16680__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u8)))
16681svuint8_t svbext(svuint8_t, svuint8_t);
16682__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u32)))
16683svuint32_t svbext(svuint32_t, svuint32_t);
16684__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u64)))
16685svuint64_t svbext(svuint64_t, svuint64_t);
16686__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbext_u16)))
16687svuint16_t svbext(svuint16_t, svuint16_t);
16688__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u8)))
16689svuint8_t svbgrp(svuint8_t, uint8_t);
16690__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u32)))
16691svuint32_t svbgrp(svuint32_t, uint32_t);
16692__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u64)))
16693svuint64_t svbgrp(svuint64_t, uint64_t);
16694__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_n_u16)))
16695svuint16_t svbgrp(svuint16_t, uint16_t);
16696__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u8)))
16697svuint8_t svbgrp(svuint8_t, svuint8_t);
16698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u32)))
16699svuint32_t svbgrp(svuint32_t, svuint32_t);
16700__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u64)))
16701svuint64_t svbgrp(svuint64_t, svuint64_t);
16702__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svbgrp_u16)))
16703svuint16_t svbgrp(svuint16_t, svuint16_t);
16704__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32_f16)))
16705svfloat32_t svmmla_f32_f16(svfloat32_t, svfloat16_t, svfloat16_t);
16706__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32_f16)))
16707svfloat32_t svmmla(svfloat32_t, svfloat16_t, svfloat16_t);
16708__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_u64)))
16709svuint64_t svrax1_u64(svuint64_t, svuint64_t);
16710__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_s64)))
16711svint64_t svrax1_s64(svint64_t, svint64_t);
16712__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_u64)))
16713svuint64_t svrax1(svuint64_t, svuint64_t);
16714__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svrax1_s64)))
16715svint64_t svrax1(svint64_t, svint64_t);
16716__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4e_u32)))
16717svuint32_t svsm4e_u32(svuint32_t, svuint32_t);
16718__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4ekey_u32)))
16719svuint32_t svsm4ekey_u32(svuint32_t, svuint32_t);
16720__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4e_u32)))
16721svuint32_t svsm4e(svuint32_t, svuint32_t);
16722__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsm4ekey_u32)))
16723svuint32_t svsm4ekey(svuint32_t, svuint32_t);
16724__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u32_z)))
16725svuint32_t svhistcnt_u32_z(svbool_t, svuint32_t, svuint32_t);
16726__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u64_z)))
16727svuint64_t svhistcnt_u64_z(svbool_t, svuint64_t, svuint64_t);
16728__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s32_z)))
16729svuint32_t svhistcnt_s32_z(svbool_t, svint32_t, svint32_t);
16730__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s64_z)))
16731svuint64_t svhistcnt_s64_z(svbool_t, svint64_t, svint64_t);
16732__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_u8)))
16733svuint8_t svhistseg_u8(svuint8_t, svuint8_t);
16734__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_s8)))
16735svuint8_t svhistseg_s8(svint8_t, svint8_t);
16736__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_u32)))
16737svuint32_t svldnt1_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
16738__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_u64)))
16739svuint64_t svldnt1_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
16740__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_f64)))
16741svfloat64_t svldnt1_gather_u64base_index_f64(svbool_t, svuint64_t, int64_t);
16742__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_f32)))
16743svfloat32_t svldnt1_gather_u32base_index_f32(svbool_t, svuint32_t, int64_t);
16744__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_s32)))
16745svint32_t svldnt1_gather_u32base_index_s32(svbool_t, svuint32_t, int64_t);
16746__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_s64)))
16747svint64_t svldnt1_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
16748__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_u32)))
16749svuint32_t svldnt1_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
16750__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_u64)))
16751svuint64_t svldnt1_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16752__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_f64)))
16753svfloat64_t svldnt1_gather_u64base_offset_f64(svbool_t, svuint64_t, int64_t);
16754__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_f32)))
16755svfloat32_t svldnt1_gather_u32base_offset_f32(svbool_t, svuint32_t, int64_t);
16756__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_s32)))
16757svint32_t svldnt1_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
16758__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_s64)))
16759svint64_t svldnt1_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16760__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_u32)))
16761svuint32_t svldnt1_gather_u32base_u32(svbool_t, svuint32_t);
16762__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_u64)))
16763svuint64_t svldnt1_gather_u64base_u64(svbool_t, svuint64_t);
16764__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_f64)))
16765svfloat64_t svldnt1_gather_u64base_f64(svbool_t, svuint64_t);
16766__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_f32)))
16767svfloat32_t svldnt1_gather_u32base_f32(svbool_t, svuint32_t);
16768__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_s32)))
16769svint32_t svldnt1_gather_u32base_s32(svbool_t, svuint32_t);
16770__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_s64)))
16771svint64_t svldnt1_gather_u64base_s64(svbool_t, svuint64_t);
16772__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_u64)))
16773svuint64_t svldnt1_gather_s64index_u64(svbool_t, uint64_t const *, svint64_t);
16774__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_f64)))
16775svfloat64_t svldnt1_gather_s64index_f64(svbool_t, float64_t const *, svint64_t);
16776__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_s64)))
16777svint64_t svldnt1_gather_s64index_s64(svbool_t, int64_t const *, svint64_t);
16778__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_u64)))
16779svuint64_t svldnt1_gather_u64index_u64(svbool_t, uint64_t const *, svuint64_t);
16780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_f64)))
16781svfloat64_t svldnt1_gather_u64index_f64(svbool_t, float64_t const *, svuint64_t);
16782__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_s64)))
16783svint64_t svldnt1_gather_u64index_s64(svbool_t, int64_t const *, svuint64_t);
16784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_u32)))
16785svuint32_t svldnt1_gather_u32offset_u32(svbool_t, uint32_t const *, svuint32_t);
16786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_f32)))
16787svfloat32_t svldnt1_gather_u32offset_f32(svbool_t, float32_t const *, svuint32_t);
16788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_s32)))
16789svint32_t svldnt1_gather_u32offset_s32(svbool_t, int32_t const *, svuint32_t);
16790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_u64)))
16791svuint64_t svldnt1_gather_s64offset_u64(svbool_t, uint64_t const *, svint64_t);
16792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_f64)))
16793svfloat64_t svldnt1_gather_s64offset_f64(svbool_t, float64_t const *, svint64_t);
16794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_s64)))
16795svint64_t svldnt1_gather_s64offset_s64(svbool_t, int64_t const *, svint64_t);
16796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_u64)))
16797svuint64_t svldnt1_gather_u64offset_u64(svbool_t, uint64_t const *, svuint64_t);
16798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_f64)))
16799svfloat64_t svldnt1_gather_u64offset_f64(svbool_t, float64_t const *, svuint64_t);
16800__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_s64)))
16801svint64_t svldnt1_gather_u64offset_s64(svbool_t, int64_t const *, svuint64_t);
16802__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_u32)))
16803svuint32_t svldnt1sb_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
16804__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_u64)))
16805svuint64_t svldnt1sb_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_s32)))
16807svint32_t svldnt1sb_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
16808__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_s64)))
16809svint64_t svldnt1sb_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16810__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_u32)))
16811svuint32_t svldnt1sb_gather_u32base_u32(svbool_t, svuint32_t);
16812__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_u64)))
16813svuint64_t svldnt1sb_gather_u64base_u64(svbool_t, svuint64_t);
16814__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_s32)))
16815svint32_t svldnt1sb_gather_u32base_s32(svbool_t, svuint32_t);
16816__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_s64)))
16817svint64_t svldnt1sb_gather_u64base_s64(svbool_t, svuint64_t);
16818__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_u32)))
16819svuint32_t svldnt1sb_gather_u32offset_u32(svbool_t, int8_t const *, svuint32_t);
16820__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_s32)))
16821svint32_t svldnt1sb_gather_u32offset_s32(svbool_t, int8_t const *, svuint32_t);
16822__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_u64)))
16823svuint64_t svldnt1sb_gather_s64offset_u64(svbool_t, int8_t const *, svint64_t);
16824__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_s64)))
16825svint64_t svldnt1sb_gather_s64offset_s64(svbool_t, int8_t const *, svint64_t);
16826__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_u64)))
16827svuint64_t svldnt1sb_gather_u64offset_u64(svbool_t, int8_t const *, svuint64_t);
16828__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_s64)))
16829svint64_t svldnt1sb_gather_u64offset_s64(svbool_t, int8_t const *, svuint64_t);
16830__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_u32)))
16831svuint32_t svldnt1sh_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
16832__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_u64)))
16833svuint64_t svldnt1sh_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
16834__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_s32)))
16835svint32_t svldnt1sh_gather_u32base_index_s32(svbool_t, svuint32_t, int64_t);
16836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_s64)))
16837svint64_t svldnt1sh_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
16838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_u32)))
16839svuint32_t svldnt1sh_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
16840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_u64)))
16841svuint64_t svldnt1sh_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_s32)))
16843svint32_t svldnt1sh_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
16844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_s64)))
16845svint64_t svldnt1sh_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_u32)))
16847svuint32_t svldnt1sh_gather_u32base_u32(svbool_t, svuint32_t);
16848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_u64)))
16849svuint64_t svldnt1sh_gather_u64base_u64(svbool_t, svuint64_t);
16850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_s32)))
16851svint32_t svldnt1sh_gather_u32base_s32(svbool_t, svuint32_t);
16852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_s64)))
16853svint64_t svldnt1sh_gather_u64base_s64(svbool_t, svuint64_t);
16854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_u64)))
16855svuint64_t svldnt1sh_gather_s64index_u64(svbool_t, int16_t const *, svint64_t);
16856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_s64)))
16857svint64_t svldnt1sh_gather_s64index_s64(svbool_t, int16_t const *, svint64_t);
16858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_u64)))
16859svuint64_t svldnt1sh_gather_u64index_u64(svbool_t, int16_t const *, svuint64_t);
16860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_s64)))
16861svint64_t svldnt1sh_gather_u64index_s64(svbool_t, int16_t const *, svuint64_t);
16862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_u32)))
16863svuint32_t svldnt1sh_gather_u32offset_u32(svbool_t, int16_t const *, svuint32_t);
16864__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_s32)))
16865svint32_t svldnt1sh_gather_u32offset_s32(svbool_t, int16_t const *, svuint32_t);
16866__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_u64)))
16867svuint64_t svldnt1sh_gather_s64offset_u64(svbool_t, int16_t const *, svint64_t);
16868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_s64)))
16869svint64_t svldnt1sh_gather_s64offset_s64(svbool_t, int16_t const *, svint64_t);
16870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_u64)))
16871svuint64_t svldnt1sh_gather_u64offset_u64(svbool_t, int16_t const *, svuint64_t);
16872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_s64)))
16873svint64_t svldnt1sh_gather_u64offset_s64(svbool_t, int16_t const *, svuint64_t);
16874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_u64)))
16875svuint64_t svldnt1sw_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
16876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_s64)))
16877svint64_t svldnt1sw_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
16878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_u64)))
16879svuint64_t svldnt1sw_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_s64)))
16881svint64_t svldnt1sw_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_u64)))
16883svuint64_t svldnt1sw_gather_u64base_u64(svbool_t, svuint64_t);
16884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_s64)))
16885svint64_t svldnt1sw_gather_u64base_s64(svbool_t, svuint64_t);
16886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_u64)))
16887svuint64_t svldnt1sw_gather_s64index_u64(svbool_t, int32_t const *, svint64_t);
16888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_s64)))
16889svint64_t svldnt1sw_gather_s64index_s64(svbool_t, int32_t const *, svint64_t);
16890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_u64)))
16891svuint64_t svldnt1sw_gather_u64index_u64(svbool_t, int32_t const *, svuint64_t);
16892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_s64)))
16893svint64_t svldnt1sw_gather_u64index_s64(svbool_t, int32_t const *, svuint64_t);
16894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_u64)))
16895svuint64_t svldnt1sw_gather_s64offset_u64(svbool_t, int32_t const *, svint64_t);
16896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_s64)))
16897svint64_t svldnt1sw_gather_s64offset_s64(svbool_t, int32_t const *, svint64_t);
16898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_u64)))
16899svuint64_t svldnt1sw_gather_u64offset_u64(svbool_t, int32_t const *, svuint64_t);
16900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_s64)))
16901svint64_t svldnt1sw_gather_u64offset_s64(svbool_t, int32_t const *, svuint64_t);
16902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_u32)))
16903svuint32_t svldnt1ub_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
16904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_u64)))
16905svuint64_t svldnt1ub_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_s32)))
16907svint32_t svldnt1ub_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
16908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_s64)))
16909svint64_t svldnt1ub_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_u32)))
16911svuint32_t svldnt1ub_gather_u32base_u32(svbool_t, svuint32_t);
16912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_u64)))
16913svuint64_t svldnt1ub_gather_u64base_u64(svbool_t, svuint64_t);
16914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_s32)))
16915svint32_t svldnt1ub_gather_u32base_s32(svbool_t, svuint32_t);
16916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_s64)))
16917svint64_t svldnt1ub_gather_u64base_s64(svbool_t, svuint64_t);
16918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_u32)))
16919svuint32_t svldnt1ub_gather_u32offset_u32(svbool_t, uint8_t const *, svuint32_t);
16920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_s32)))
16921svint32_t svldnt1ub_gather_u32offset_s32(svbool_t, uint8_t const *, svuint32_t);
16922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_u64)))
16923svuint64_t svldnt1ub_gather_s64offset_u64(svbool_t, uint8_t const *, svint64_t);
16924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_s64)))
16925svint64_t svldnt1ub_gather_s64offset_s64(svbool_t, uint8_t const *, svint64_t);
16926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_u64)))
16927svuint64_t svldnt1ub_gather_u64offset_u64(svbool_t, uint8_t const *, svuint64_t);
16928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_s64)))
16929svint64_t svldnt1ub_gather_u64offset_s64(svbool_t, uint8_t const *, svuint64_t);
16930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_u32)))
16931svuint32_t svldnt1uh_gather_u32base_index_u32(svbool_t, svuint32_t, int64_t);
16932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_u64)))
16933svuint64_t svldnt1uh_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
16934__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_s32)))
16935svint32_t svldnt1uh_gather_u32base_index_s32(svbool_t, svuint32_t, int64_t);
16936__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_s64)))
16937svint64_t svldnt1uh_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
16938__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_u32)))
16939svuint32_t svldnt1uh_gather_u32base_offset_u32(svbool_t, svuint32_t, int64_t);
16940__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_u64)))
16941svuint64_t svldnt1uh_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16942__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_s32)))
16943svint32_t svldnt1uh_gather_u32base_offset_s32(svbool_t, svuint32_t, int64_t);
16944__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_s64)))
16945svint64_t svldnt1uh_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16946__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_u32)))
16947svuint32_t svldnt1uh_gather_u32base_u32(svbool_t, svuint32_t);
16948__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_u64)))
16949svuint64_t svldnt1uh_gather_u64base_u64(svbool_t, svuint64_t);
16950__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_s32)))
16951svint32_t svldnt1uh_gather_u32base_s32(svbool_t, svuint32_t);
16952__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_s64)))
16953svint64_t svldnt1uh_gather_u64base_s64(svbool_t, svuint64_t);
16954__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_u64)))
16955svuint64_t svldnt1uh_gather_s64index_u64(svbool_t, uint16_t const *, svint64_t);
16956__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_s64)))
16957svint64_t svldnt1uh_gather_s64index_s64(svbool_t, uint16_t const *, svint64_t);
16958__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_u64)))
16959svuint64_t svldnt1uh_gather_u64index_u64(svbool_t, uint16_t const *, svuint64_t);
16960__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_s64)))
16961svint64_t svldnt1uh_gather_u64index_s64(svbool_t, uint16_t const *, svuint64_t);
16962__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_u32)))
16963svuint32_t svldnt1uh_gather_u32offset_u32(svbool_t, uint16_t const *, svuint32_t);
16964__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_s32)))
16965svint32_t svldnt1uh_gather_u32offset_s32(svbool_t, uint16_t const *, svuint32_t);
16966__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_u64)))
16967svuint64_t svldnt1uh_gather_s64offset_u64(svbool_t, uint16_t const *, svint64_t);
16968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_s64)))
16969svint64_t svldnt1uh_gather_s64offset_s64(svbool_t, uint16_t const *, svint64_t);
16970__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_u64)))
16971svuint64_t svldnt1uh_gather_u64offset_u64(svbool_t, uint16_t const *, svuint64_t);
16972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_s64)))
16973svint64_t svldnt1uh_gather_u64offset_s64(svbool_t, uint16_t const *, svuint64_t);
16974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_u64)))
16975svuint64_t svldnt1uw_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
16976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_s64)))
16977svint64_t svldnt1uw_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
16978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_u64)))
16979svuint64_t svldnt1uw_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
16980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_s64)))
16981svint64_t svldnt1uw_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
16982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_u64)))
16983svuint64_t svldnt1uw_gather_u64base_u64(svbool_t, svuint64_t);
16984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_s64)))
16985svint64_t svldnt1uw_gather_u64base_s64(svbool_t, svuint64_t);
16986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_u64)))
16987svuint64_t svldnt1uw_gather_s64index_u64(svbool_t, uint32_t const *, svint64_t);
16988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_s64)))
16989svint64_t svldnt1uw_gather_s64index_s64(svbool_t, uint32_t const *, svint64_t);
16990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_u64)))
16991svuint64_t svldnt1uw_gather_u64index_u64(svbool_t, uint32_t const *, svuint64_t);
16992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_s64)))
16993svint64_t svldnt1uw_gather_u64index_s64(svbool_t, uint32_t const *, svuint64_t);
16994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_u64)))
16995svuint64_t svldnt1uw_gather_s64offset_u64(svbool_t, uint32_t const *, svint64_t);
16996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_s64)))
16997svint64_t svldnt1uw_gather_s64offset_s64(svbool_t, uint32_t const *, svint64_t);
16998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_u64)))
16999svuint64_t svldnt1uw_gather_u64offset_u64(svbool_t, uint32_t const *, svuint64_t);
17000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_s64)))
17001svint64_t svldnt1uw_gather_u64offset_s64(svbool_t, uint32_t const *, svuint64_t);
17002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u8)))
17003svbool_t svmatch_u8(svbool_t, svuint8_t, svuint8_t);
17004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u16)))
17005svbool_t svmatch_u16(svbool_t, svuint16_t, svuint16_t);
17006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s8)))
17007svbool_t svmatch_s8(svbool_t, svint8_t, svint8_t);
17008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s16)))
17009svbool_t svmatch_s16(svbool_t, svint16_t, svint16_t);
17010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u8)))
17011svbool_t svnmatch_u8(svbool_t, svuint8_t, svuint8_t);
17012__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u16)))
17013svbool_t svnmatch_u16(svbool_t, svuint16_t, svuint16_t);
17014__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s8)))
17015svbool_t svnmatch_s8(svbool_t, svint8_t, svint8_t);
17016__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s16)))
17017svbool_t svnmatch_s16(svbool_t, svint16_t, svint16_t);
17018__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_u32)))
17019void svstnt1_scatter_u32base_index_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
17020__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_u64)))
17021void svstnt1_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17022__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_f64)))
17023void svstnt1_scatter_u64base_index_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
17024__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_f32)))
17025void svstnt1_scatter_u32base_index_f32(svbool_t, svuint32_t, int64_t, svfloat32_t);
17026__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_s32)))
17027void svstnt1_scatter_u32base_index_s32(svbool_t, svuint32_t, int64_t, svint32_t);
17028__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_s64)))
17029void svstnt1_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17030__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_u32)))
17031void svstnt1_scatter_u32base_offset_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
17032__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_u64)))
17033void svstnt1_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17034__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_f64)))
17035void svstnt1_scatter_u64base_offset_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
17036__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_f32)))
17037void svstnt1_scatter_u32base_offset_f32(svbool_t, svuint32_t, int64_t, svfloat32_t);
17038__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_s32)))
17039void svstnt1_scatter_u32base_offset_s32(svbool_t, svuint32_t, int64_t, svint32_t);
17040__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_s64)))
17041void svstnt1_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17042__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_u32)))
17043void svstnt1_scatter_u32base_u32(svbool_t, svuint32_t, svuint32_t);
17044__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_u64)))
17045void svstnt1_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
17046__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_f64)))
17047void svstnt1_scatter_u64base_f64(svbool_t, svuint64_t, svfloat64_t);
17048__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_f32)))
17049void svstnt1_scatter_u32base_f32(svbool_t, svuint32_t, svfloat32_t);
17050__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_s32)))
17051void svstnt1_scatter_u32base_s32(svbool_t, svuint32_t, svint32_t);
17052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_s64)))
17053void svstnt1_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
17054__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_u64)))
17055void svstnt1_scatter_s64index_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
17056__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_f64)))
17057void svstnt1_scatter_s64index_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
17058__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_s64)))
17059void svstnt1_scatter_s64index_s64(svbool_t, int64_t *, svint64_t, svint64_t);
17060__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_u64)))
17061void svstnt1_scatter_u64index_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
17062__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_f64)))
17063void svstnt1_scatter_u64index_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
17064__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_s64)))
17065void svstnt1_scatter_u64index_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
17066__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_u32)))
17067void svstnt1_scatter_u32offset_u32(svbool_t, uint32_t *, svuint32_t, svuint32_t);
17068__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_f32)))
17069void svstnt1_scatter_u32offset_f32(svbool_t, float32_t *, svuint32_t, svfloat32_t);
17070__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_s32)))
17071void svstnt1_scatter_u32offset_s32(svbool_t, int32_t *, svuint32_t, svint32_t);
17072__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_u64)))
17073void svstnt1_scatter_s64offset_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
17074__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_f64)))
17075void svstnt1_scatter_s64offset_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
17076__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_s64)))
17077void svstnt1_scatter_s64offset_s64(svbool_t, int64_t *, svint64_t, svint64_t);
17078__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_u64)))
17079void svstnt1_scatter_u64offset_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
17080__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_f64)))
17081void svstnt1_scatter_u64offset_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
17082__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_s64)))
17083void svstnt1_scatter_u64offset_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
17084__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_u32)))
17085void svstnt1b_scatter_u32base_offset_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
17086__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_u64)))
17087void svstnt1b_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17088__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_s32)))
17089void svstnt1b_scatter_u32base_offset_s32(svbool_t, svuint32_t, int64_t, svint32_t);
17090__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_s64)))
17091void svstnt1b_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17092__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_u32)))
17093void svstnt1b_scatter_u32base_u32(svbool_t, svuint32_t, svuint32_t);
17094__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_u64)))
17095void svstnt1b_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
17096__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_s32)))
17097void svstnt1b_scatter_u32base_s32(svbool_t, svuint32_t, svint32_t);
17098__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_s64)))
17099void svstnt1b_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
17100__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_s32)))
17101void svstnt1b_scatter_u32offset_s32(svbool_t, int8_t *, svuint32_t, svint32_t);
17102__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_u32)))
17103void svstnt1b_scatter_u32offset_u32(svbool_t, uint8_t *, svuint32_t, svuint32_t);
17104__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_s64)))
17105void svstnt1b_scatter_s64offset_s64(svbool_t, int8_t *, svint64_t, svint64_t);
17106__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_u64)))
17107void svstnt1b_scatter_s64offset_u64(svbool_t, uint8_t *, svint64_t, svuint64_t);
17108__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_s64)))
17109void svstnt1b_scatter_u64offset_s64(svbool_t, int8_t *, svuint64_t, svint64_t);
17110__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_u64)))
17111void svstnt1b_scatter_u64offset_u64(svbool_t, uint8_t *, svuint64_t, svuint64_t);
17112__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_u32)))
17113void svstnt1h_scatter_u32base_index_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
17114__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_u64)))
17115void svstnt1h_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17116__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_s32)))
17117void svstnt1h_scatter_u32base_index_s32(svbool_t, svuint32_t, int64_t, svint32_t);
17118__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_s64)))
17119void svstnt1h_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17120__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_u32)))
17121void svstnt1h_scatter_u32base_offset_u32(svbool_t, svuint32_t, int64_t, svuint32_t);
17122__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_u64)))
17123void svstnt1h_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17124__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_s32)))
17125void svstnt1h_scatter_u32base_offset_s32(svbool_t, svuint32_t, int64_t, svint32_t);
17126__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_s64)))
17127void svstnt1h_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17128__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_u32)))
17129void svstnt1h_scatter_u32base_u32(svbool_t, svuint32_t, svuint32_t);
17130__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_u64)))
17131void svstnt1h_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
17132__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_s32)))
17133void svstnt1h_scatter_u32base_s32(svbool_t, svuint32_t, svint32_t);
17134__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_s64)))
17135void svstnt1h_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
17136__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_s64)))
17137void svstnt1h_scatter_s64index_s64(svbool_t, int16_t *, svint64_t, svint64_t);
17138__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_u64)))
17139void svstnt1h_scatter_s64index_u64(svbool_t, uint16_t *, svint64_t, svuint64_t);
17140__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_s64)))
17141void svstnt1h_scatter_u64index_s64(svbool_t, int16_t *, svuint64_t, svint64_t);
17142__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_u64)))
17143void svstnt1h_scatter_u64index_u64(svbool_t, uint16_t *, svuint64_t, svuint64_t);
17144__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_s32)))
17145void svstnt1h_scatter_u32offset_s32(svbool_t, int16_t *, svuint32_t, svint32_t);
17146__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_u32)))
17147void svstnt1h_scatter_u32offset_u32(svbool_t, uint16_t *, svuint32_t, svuint32_t);
17148__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_s64)))
17149void svstnt1h_scatter_s64offset_s64(svbool_t, int16_t *, svint64_t, svint64_t);
17150__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_u64)))
17151void svstnt1h_scatter_s64offset_u64(svbool_t, uint16_t *, svint64_t, svuint64_t);
17152__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_s64)))
17153void svstnt1h_scatter_u64offset_s64(svbool_t, int16_t *, svuint64_t, svint64_t);
17154__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_u64)))
17155void svstnt1h_scatter_u64offset_u64(svbool_t, uint16_t *, svuint64_t, svuint64_t);
17156__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_u64)))
17157void svstnt1w_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17158__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_s64)))
17159void svstnt1w_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17160__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_u64)))
17161void svstnt1w_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17162__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_s64)))
17163void svstnt1w_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17164__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_u64)))
17165void svstnt1w_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
17166__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_s64)))
17167void svstnt1w_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
17168__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_s64)))
17169void svstnt1w_scatter_s64index_s64(svbool_t, int32_t *, svint64_t, svint64_t);
17170__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_u64)))
17171void svstnt1w_scatter_s64index_u64(svbool_t, uint32_t *, svint64_t, svuint64_t);
17172__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_s64)))
17173void svstnt1w_scatter_u64index_s64(svbool_t, int32_t *, svuint64_t, svint64_t);
17174__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_u64)))
17175void svstnt1w_scatter_u64index_u64(svbool_t, uint32_t *, svuint64_t, svuint64_t);
17176__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_s64)))
17177void svstnt1w_scatter_s64offset_s64(svbool_t, int32_t *, svint64_t, svint64_t);
17178__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_u64)))
17179void svstnt1w_scatter_s64offset_u64(svbool_t, uint32_t *, svint64_t, svuint64_t);
17180__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_s64)))
17181void svstnt1w_scatter_u64offset_s64(svbool_t, int32_t *, svuint64_t, svint64_t);
17182__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_u64)))
17183void svstnt1w_scatter_u64offset_u64(svbool_t, uint32_t *, svuint64_t, svuint64_t);
17184__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u32_z)))
17185svuint32_t svhistcnt_z(svbool_t, svuint32_t, svuint32_t);
17186__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_u64_z)))
17187svuint64_t svhistcnt_z(svbool_t, svuint64_t, svuint64_t);
17188__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s32_z)))
17189svuint32_t svhistcnt_z(svbool_t, svint32_t, svint32_t);
17190__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistcnt_s64_z)))
17191svuint64_t svhistcnt_z(svbool_t, svint64_t, svint64_t);
17192__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_u8)))
17193svuint8_t svhistseg(svuint8_t, svuint8_t);
17194__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svhistseg_s8)))
17195svuint8_t svhistseg(svint8_t, svint8_t);
17196__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_u32)))
17197svuint32_t svldnt1_gather_index_u32(svbool_t, svuint32_t, int64_t);
17198__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_u64)))
17199svuint64_t svldnt1_gather_index_u64(svbool_t, svuint64_t, int64_t);
17200__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_f64)))
17201svfloat64_t svldnt1_gather_index_f64(svbool_t, svuint64_t, int64_t);
17202__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_f32)))
17203svfloat32_t svldnt1_gather_index_f32(svbool_t, svuint32_t, int64_t);
17204__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_index_s32)))
17205svint32_t svldnt1_gather_index_s32(svbool_t, svuint32_t, int64_t);
17206__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_index_s64)))
17207svint64_t svldnt1_gather_index_s64(svbool_t, svuint64_t, int64_t);
17208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_u32)))
17209svuint32_t svldnt1_gather_offset_u32(svbool_t, svuint32_t, int64_t);
17210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_u64)))
17211svuint64_t svldnt1_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_f64)))
17213svfloat64_t svldnt1_gather_offset_f64(svbool_t, svuint64_t, int64_t);
17214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_f32)))
17215svfloat32_t svldnt1_gather_offset_f32(svbool_t, svuint32_t, int64_t);
17216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_offset_s32)))
17217svint32_t svldnt1_gather_offset_s32(svbool_t, svuint32_t, int64_t);
17218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_offset_s64)))
17219svint64_t svldnt1_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_u32)))
17221svuint32_t svldnt1_gather_u32(svbool_t, svuint32_t);
17222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_u64)))
17223svuint64_t svldnt1_gather_u64(svbool_t, svuint64_t);
17224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_f64)))
17225svfloat64_t svldnt1_gather_f64(svbool_t, svuint64_t);
17226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_f32)))
17227svfloat32_t svldnt1_gather_f32(svbool_t, svuint32_t);
17228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32base_s32)))
17229svint32_t svldnt1_gather_s32(svbool_t, svuint32_t);
17230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64base_s64)))
17231svint64_t svldnt1_gather_s64(svbool_t, svuint64_t);
17232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_u64)))
17233svuint64_t svldnt1_gather_index(svbool_t, uint64_t const *, svint64_t);
17234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_f64)))
17235svfloat64_t svldnt1_gather_index(svbool_t, float64_t const *, svint64_t);
17236__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64index_s64)))
17237svint64_t svldnt1_gather_index(svbool_t, int64_t const *, svint64_t);
17238__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_u64)))
17239svuint64_t svldnt1_gather_index(svbool_t, uint64_t const *, svuint64_t);
17240__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_f64)))
17241svfloat64_t svldnt1_gather_index(svbool_t, float64_t const *, svuint64_t);
17242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64index_s64)))
17243svint64_t svldnt1_gather_index(svbool_t, int64_t const *, svuint64_t);
17244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_u32)))
17245svuint32_t svldnt1_gather_offset(svbool_t, uint32_t const *, svuint32_t);
17246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_f32)))
17247svfloat32_t svldnt1_gather_offset(svbool_t, float32_t const *, svuint32_t);
17248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u32offset_s32)))
17249svint32_t svldnt1_gather_offset(svbool_t, int32_t const *, svuint32_t);
17250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_u64)))
17251svuint64_t svldnt1_gather_offset(svbool_t, uint64_t const *, svint64_t);
17252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_f64)))
17253svfloat64_t svldnt1_gather_offset(svbool_t, float64_t const *, svint64_t);
17254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_s64offset_s64)))
17255svint64_t svldnt1_gather_offset(svbool_t, int64_t const *, svint64_t);
17256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_u64)))
17257svuint64_t svldnt1_gather_offset(svbool_t, uint64_t const *, svuint64_t);
17258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_f64)))
17259svfloat64_t svldnt1_gather_offset(svbool_t, float64_t const *, svuint64_t);
17260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_gather_u64offset_s64)))
17261svint64_t svldnt1_gather_offset(svbool_t, int64_t const *, svuint64_t);
17262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_u32)))
17263svuint32_t svldnt1sb_gather_offset_u32(svbool_t, svuint32_t, int64_t);
17264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_u64)))
17265svuint64_t svldnt1sb_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_offset_s32)))
17267svint32_t svldnt1sb_gather_offset_s32(svbool_t, svuint32_t, int64_t);
17268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_offset_s64)))
17269svint64_t svldnt1sb_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_u32)))
17271svuint32_t svldnt1sb_gather_u32(svbool_t, svuint32_t);
17272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_u64)))
17273svuint64_t svldnt1sb_gather_u64(svbool_t, svuint64_t);
17274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32base_s32)))
17275svint32_t svldnt1sb_gather_s32(svbool_t, svuint32_t);
17276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64base_s64)))
17277svint64_t svldnt1sb_gather_s64(svbool_t, svuint64_t);
17278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_u32)))
17279svuint32_t svldnt1sb_gather_offset_u32(svbool_t, int8_t const *, svuint32_t);
17280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u32offset_s32)))
17281svint32_t svldnt1sb_gather_offset_s32(svbool_t, int8_t const *, svuint32_t);
17282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_u64)))
17283svuint64_t svldnt1sb_gather_offset_u64(svbool_t, int8_t const *, svint64_t);
17284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_s64offset_s64)))
17285svint64_t svldnt1sb_gather_offset_s64(svbool_t, int8_t const *, svint64_t);
17286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_u64)))
17287svuint64_t svldnt1sb_gather_offset_u64(svbool_t, int8_t const *, svuint64_t);
17288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sb_gather_u64offset_s64)))
17289svint64_t svldnt1sb_gather_offset_s64(svbool_t, int8_t const *, svuint64_t);
17290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_u32)))
17291svuint32_t svldnt1sh_gather_index_u32(svbool_t, svuint32_t, int64_t);
17292__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_u64)))
17293svuint64_t svldnt1sh_gather_index_u64(svbool_t, svuint64_t, int64_t);
17294__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_index_s32)))
17295svint32_t svldnt1sh_gather_index_s32(svbool_t, svuint32_t, int64_t);
17296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_index_s64)))
17297svint64_t svldnt1sh_gather_index_s64(svbool_t, svuint64_t, int64_t);
17298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_u32)))
17299svuint32_t svldnt1sh_gather_offset_u32(svbool_t, svuint32_t, int64_t);
17300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_u64)))
17301svuint64_t svldnt1sh_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_offset_s32)))
17303svint32_t svldnt1sh_gather_offset_s32(svbool_t, svuint32_t, int64_t);
17304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_offset_s64)))
17305svint64_t svldnt1sh_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_u32)))
17307svuint32_t svldnt1sh_gather_u32(svbool_t, svuint32_t);
17308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_u64)))
17309svuint64_t svldnt1sh_gather_u64(svbool_t, svuint64_t);
17310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32base_s32)))
17311svint32_t svldnt1sh_gather_s32(svbool_t, svuint32_t);
17312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64base_s64)))
17313svint64_t svldnt1sh_gather_s64(svbool_t, svuint64_t);
17314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_u64)))
17315svuint64_t svldnt1sh_gather_index_u64(svbool_t, int16_t const *, svint64_t);
17316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64index_s64)))
17317svint64_t svldnt1sh_gather_index_s64(svbool_t, int16_t const *, svint64_t);
17318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_u64)))
17319svuint64_t svldnt1sh_gather_index_u64(svbool_t, int16_t const *, svuint64_t);
17320__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64index_s64)))
17321svint64_t svldnt1sh_gather_index_s64(svbool_t, int16_t const *, svuint64_t);
17322__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_u32)))
17323svuint32_t svldnt1sh_gather_offset_u32(svbool_t, int16_t const *, svuint32_t);
17324__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u32offset_s32)))
17325svint32_t svldnt1sh_gather_offset_s32(svbool_t, int16_t const *, svuint32_t);
17326__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_u64)))
17327svuint64_t svldnt1sh_gather_offset_u64(svbool_t, int16_t const *, svint64_t);
17328__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_s64offset_s64)))
17329svint64_t svldnt1sh_gather_offset_s64(svbool_t, int16_t const *, svint64_t);
17330__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_u64)))
17331svuint64_t svldnt1sh_gather_offset_u64(svbool_t, int16_t const *, svuint64_t);
17332__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sh_gather_u64offset_s64)))
17333svint64_t svldnt1sh_gather_offset_s64(svbool_t, int16_t const *, svuint64_t);
17334__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_u64)))
17335svuint64_t svldnt1sw_gather_index_u64(svbool_t, svuint64_t, int64_t);
17336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_index_s64)))
17337svint64_t svldnt1sw_gather_index_s64(svbool_t, svuint64_t, int64_t);
17338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_u64)))
17339svuint64_t svldnt1sw_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_offset_s64)))
17341svint64_t svldnt1sw_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_u64)))
17343svuint64_t svldnt1sw_gather_u64(svbool_t, svuint64_t);
17344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64base_s64)))
17345svint64_t svldnt1sw_gather_s64(svbool_t, svuint64_t);
17346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_u64)))
17347svuint64_t svldnt1sw_gather_index_u64(svbool_t, int32_t const *, svint64_t);
17348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64index_s64)))
17349svint64_t svldnt1sw_gather_index_s64(svbool_t, int32_t const *, svint64_t);
17350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_u64)))
17351svuint64_t svldnt1sw_gather_index_u64(svbool_t, int32_t const *, svuint64_t);
17352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64index_s64)))
17353svint64_t svldnt1sw_gather_index_s64(svbool_t, int32_t const *, svuint64_t);
17354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_u64)))
17355svuint64_t svldnt1sw_gather_offset_u64(svbool_t, int32_t const *, svint64_t);
17356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_s64offset_s64)))
17357svint64_t svldnt1sw_gather_offset_s64(svbool_t, int32_t const *, svint64_t);
17358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_u64)))
17359svuint64_t svldnt1sw_gather_offset_u64(svbool_t, int32_t const *, svuint64_t);
17360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1sw_gather_u64offset_s64)))
17361svint64_t svldnt1sw_gather_offset_s64(svbool_t, int32_t const *, svuint64_t);
17362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_u32)))
17363svuint32_t svldnt1ub_gather_offset_u32(svbool_t, svuint32_t, int64_t);
17364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_u64)))
17365svuint64_t svldnt1ub_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_offset_s32)))
17367svint32_t svldnt1ub_gather_offset_s32(svbool_t, svuint32_t, int64_t);
17368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_offset_s64)))
17369svint64_t svldnt1ub_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_u32)))
17371svuint32_t svldnt1ub_gather_u32(svbool_t, svuint32_t);
17372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_u64)))
17373svuint64_t svldnt1ub_gather_u64(svbool_t, svuint64_t);
17374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32base_s32)))
17375svint32_t svldnt1ub_gather_s32(svbool_t, svuint32_t);
17376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64base_s64)))
17377svint64_t svldnt1ub_gather_s64(svbool_t, svuint64_t);
17378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_u32)))
17379svuint32_t svldnt1ub_gather_offset_u32(svbool_t, uint8_t const *, svuint32_t);
17380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u32offset_s32)))
17381svint32_t svldnt1ub_gather_offset_s32(svbool_t, uint8_t const *, svuint32_t);
17382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_u64)))
17383svuint64_t svldnt1ub_gather_offset_u64(svbool_t, uint8_t const *, svint64_t);
17384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_s64offset_s64)))
17385svint64_t svldnt1ub_gather_offset_s64(svbool_t, uint8_t const *, svint64_t);
17386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_u64)))
17387svuint64_t svldnt1ub_gather_offset_u64(svbool_t, uint8_t const *, svuint64_t);
17388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1ub_gather_u64offset_s64)))
17389svint64_t svldnt1ub_gather_offset_s64(svbool_t, uint8_t const *, svuint64_t);
17390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_u32)))
17391svuint32_t svldnt1uh_gather_index_u32(svbool_t, svuint32_t, int64_t);
17392__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_u64)))
17393svuint64_t svldnt1uh_gather_index_u64(svbool_t, svuint64_t, int64_t);
17394__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_index_s32)))
17395svint32_t svldnt1uh_gather_index_s32(svbool_t, svuint32_t, int64_t);
17396__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_index_s64)))
17397svint64_t svldnt1uh_gather_index_s64(svbool_t, svuint64_t, int64_t);
17398__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_u32)))
17399svuint32_t svldnt1uh_gather_offset_u32(svbool_t, svuint32_t, int64_t);
17400__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_u64)))
17401svuint64_t svldnt1uh_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17402__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_offset_s32)))
17403svint32_t svldnt1uh_gather_offset_s32(svbool_t, svuint32_t, int64_t);
17404__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_offset_s64)))
17405svint64_t svldnt1uh_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17406__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_u32)))
17407svuint32_t svldnt1uh_gather_u32(svbool_t, svuint32_t);
17408__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_u64)))
17409svuint64_t svldnt1uh_gather_u64(svbool_t, svuint64_t);
17410__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32base_s32)))
17411svint32_t svldnt1uh_gather_s32(svbool_t, svuint32_t);
17412__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64base_s64)))
17413svint64_t svldnt1uh_gather_s64(svbool_t, svuint64_t);
17414__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_u64)))
17415svuint64_t svldnt1uh_gather_index_u64(svbool_t, uint16_t const *, svint64_t);
17416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64index_s64)))
17417svint64_t svldnt1uh_gather_index_s64(svbool_t, uint16_t const *, svint64_t);
17418__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_u64)))
17419svuint64_t svldnt1uh_gather_index_u64(svbool_t, uint16_t const *, svuint64_t);
17420__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64index_s64)))
17421svint64_t svldnt1uh_gather_index_s64(svbool_t, uint16_t const *, svuint64_t);
17422__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_u32)))
17423svuint32_t svldnt1uh_gather_offset_u32(svbool_t, uint16_t const *, svuint32_t);
17424__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u32offset_s32)))
17425svint32_t svldnt1uh_gather_offset_s32(svbool_t, uint16_t const *, svuint32_t);
17426__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_u64)))
17427svuint64_t svldnt1uh_gather_offset_u64(svbool_t, uint16_t const *, svint64_t);
17428__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_s64offset_s64)))
17429svint64_t svldnt1uh_gather_offset_s64(svbool_t, uint16_t const *, svint64_t);
17430__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_u64)))
17431svuint64_t svldnt1uh_gather_offset_u64(svbool_t, uint16_t const *, svuint64_t);
17432__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uh_gather_u64offset_s64)))
17433svint64_t svldnt1uh_gather_offset_s64(svbool_t, uint16_t const *, svuint64_t);
17434__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_u64)))
17435svuint64_t svldnt1uw_gather_index_u64(svbool_t, svuint64_t, int64_t);
17436__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_index_s64)))
17437svint64_t svldnt1uw_gather_index_s64(svbool_t, svuint64_t, int64_t);
17438__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_u64)))
17439svuint64_t svldnt1uw_gather_offset_u64(svbool_t, svuint64_t, int64_t);
17440__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_offset_s64)))
17441svint64_t svldnt1uw_gather_offset_s64(svbool_t, svuint64_t, int64_t);
17442__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_u64)))
17443svuint64_t svldnt1uw_gather_u64(svbool_t, svuint64_t);
17444__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64base_s64)))
17445svint64_t svldnt1uw_gather_s64(svbool_t, svuint64_t);
17446__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_u64)))
17447svuint64_t svldnt1uw_gather_index_u64(svbool_t, uint32_t const *, svint64_t);
17448__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64index_s64)))
17449svint64_t svldnt1uw_gather_index_s64(svbool_t, uint32_t const *, svint64_t);
17450__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_u64)))
17451svuint64_t svldnt1uw_gather_index_u64(svbool_t, uint32_t const *, svuint64_t);
17452__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64index_s64)))
17453svint64_t svldnt1uw_gather_index_s64(svbool_t, uint32_t const *, svuint64_t);
17454__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_u64)))
17455svuint64_t svldnt1uw_gather_offset_u64(svbool_t, uint32_t const *, svint64_t);
17456__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_s64offset_s64)))
17457svint64_t svldnt1uw_gather_offset_s64(svbool_t, uint32_t const *, svint64_t);
17458__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_u64)))
17459svuint64_t svldnt1uw_gather_offset_u64(svbool_t, uint32_t const *, svuint64_t);
17460__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1uw_gather_u64offset_s64)))
17461svint64_t svldnt1uw_gather_offset_s64(svbool_t, uint32_t const *, svuint64_t);
17462__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u8)))
17463svbool_t svmatch(svbool_t, svuint8_t, svuint8_t);
17464__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_u16)))
17465svbool_t svmatch(svbool_t, svuint16_t, svuint16_t);
17466__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s8)))
17467svbool_t svmatch(svbool_t, svint8_t, svint8_t);
17468__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmatch_s16)))
17469svbool_t svmatch(svbool_t, svint16_t, svint16_t);
17470__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u8)))
17471svbool_t svnmatch(svbool_t, svuint8_t, svuint8_t);
17472__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_u16)))
17473svbool_t svnmatch(svbool_t, svuint16_t, svuint16_t);
17474__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s8)))
17475svbool_t svnmatch(svbool_t, svint8_t, svint8_t);
17476__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svnmatch_s16)))
17477svbool_t svnmatch(svbool_t, svint16_t, svint16_t);
17478__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_u32)))
17479void svstnt1_scatter_index(svbool_t, svuint32_t, int64_t, svuint32_t);
17480__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_u64)))
17481void svstnt1_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
17482__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_f64)))
17483void svstnt1_scatter_index(svbool_t, svuint64_t, int64_t, svfloat64_t);
17484__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_f32)))
17485void svstnt1_scatter_index(svbool_t, svuint32_t, int64_t, svfloat32_t);
17486__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_index_s32)))
17487void svstnt1_scatter_index(svbool_t, svuint32_t, int64_t, svint32_t);
17488__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_index_s64)))
17489void svstnt1_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
17490__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_u32)))
17491void svstnt1_scatter_offset(svbool_t, svuint32_t, int64_t, svuint32_t);
17492__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_u64)))
17493void svstnt1_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
17494__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_f64)))
17495void svstnt1_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat64_t);
17496__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_f32)))
17497void svstnt1_scatter_offset(svbool_t, svuint32_t, int64_t, svfloat32_t);
17498__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_offset_s32)))
17499void svstnt1_scatter_offset(svbool_t, svuint32_t, int64_t, svint32_t);
17500__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_offset_s64)))
17501void svstnt1_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
17502__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_u32)))
17503void svstnt1_scatter(svbool_t, svuint32_t, svuint32_t);
17504__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_u64)))
17505void svstnt1_scatter(svbool_t, svuint64_t, svuint64_t);
17506__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_f64)))
17507void svstnt1_scatter(svbool_t, svuint64_t, svfloat64_t);
17508__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_f32)))
17509void svstnt1_scatter(svbool_t, svuint32_t, svfloat32_t);
17510__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32base_s32)))
17511void svstnt1_scatter(svbool_t, svuint32_t, svint32_t);
17512__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64base_s64)))
17513void svstnt1_scatter(svbool_t, svuint64_t, svint64_t);
17514__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_u64)))
17515void svstnt1_scatter_index(svbool_t, uint64_t *, svint64_t, svuint64_t);
17516__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_f64)))
17517void svstnt1_scatter_index(svbool_t, float64_t *, svint64_t, svfloat64_t);
17518__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64index_s64)))
17519void svstnt1_scatter_index(svbool_t, int64_t *, svint64_t, svint64_t);
17520__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_u64)))
17521void svstnt1_scatter_index(svbool_t, uint64_t *, svuint64_t, svuint64_t);
17522__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_f64)))
17523void svstnt1_scatter_index(svbool_t, float64_t *, svuint64_t, svfloat64_t);
17524__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64index_s64)))
17525void svstnt1_scatter_index(svbool_t, int64_t *, svuint64_t, svint64_t);
17526__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_u32)))
17527void svstnt1_scatter_offset(svbool_t, uint32_t *, svuint32_t, svuint32_t);
17528__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_f32)))
17529void svstnt1_scatter_offset(svbool_t, float32_t *, svuint32_t, svfloat32_t);
17530__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u32offset_s32)))
17531void svstnt1_scatter_offset(svbool_t, int32_t *, svuint32_t, svint32_t);
17532__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_u64)))
17533void svstnt1_scatter_offset(svbool_t, uint64_t *, svint64_t, svuint64_t);
17534__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_f64)))
17535void svstnt1_scatter_offset(svbool_t, float64_t *, svint64_t, svfloat64_t);
17536__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_s64offset_s64)))
17537void svstnt1_scatter_offset(svbool_t, int64_t *, svint64_t, svint64_t);
17538__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_u64)))
17539void svstnt1_scatter_offset(svbool_t, uint64_t *, svuint64_t, svuint64_t);
17540__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_f64)))
17541void svstnt1_scatter_offset(svbool_t, float64_t *, svuint64_t, svfloat64_t);
17542__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_scatter_u64offset_s64)))
17543void svstnt1_scatter_offset(svbool_t, int64_t *, svuint64_t, svint64_t);
17544__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_u32)))
17545void svstnt1b_scatter_offset(svbool_t, svuint32_t, int64_t, svuint32_t);
17546__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_u64)))
17547void svstnt1b_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
17548__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_offset_s32)))
17549void svstnt1b_scatter_offset(svbool_t, svuint32_t, int64_t, svint32_t);
17550__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_offset_s64)))
17551void svstnt1b_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
17552__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_u32)))
17553void svstnt1b_scatter(svbool_t, svuint32_t, svuint32_t);
17554__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_u64)))
17555void svstnt1b_scatter(svbool_t, svuint64_t, svuint64_t);
17556__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32base_s32)))
17557void svstnt1b_scatter(svbool_t, svuint32_t, svint32_t);
17558__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64base_s64)))
17559void svstnt1b_scatter(svbool_t, svuint64_t, svint64_t);
17560__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_s32)))
17561void svstnt1b_scatter_offset(svbool_t, int8_t *, svuint32_t, svint32_t);
17562__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u32offset_u32)))
17563void svstnt1b_scatter_offset(svbool_t, uint8_t *, svuint32_t, svuint32_t);
17564__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_s64)))
17565void svstnt1b_scatter_offset(svbool_t, int8_t *, svint64_t, svint64_t);
17566__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_s64offset_u64)))
17567void svstnt1b_scatter_offset(svbool_t, uint8_t *, svint64_t, svuint64_t);
17568__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_s64)))
17569void svstnt1b_scatter_offset(svbool_t, int8_t *, svuint64_t, svint64_t);
17570__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1b_scatter_u64offset_u64)))
17571void svstnt1b_scatter_offset(svbool_t, uint8_t *, svuint64_t, svuint64_t);
17572__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_u32)))
17573void svstnt1h_scatter_index(svbool_t, svuint32_t, int64_t, svuint32_t);
17574__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_u64)))
17575void svstnt1h_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
17576__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_index_s32)))
17577void svstnt1h_scatter_index(svbool_t, svuint32_t, int64_t, svint32_t);
17578__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_index_s64)))
17579void svstnt1h_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
17580__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_u32)))
17581void svstnt1h_scatter_offset(svbool_t, svuint32_t, int64_t, svuint32_t);
17582__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_u64)))
17583void svstnt1h_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
17584__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_offset_s32)))
17585void svstnt1h_scatter_offset(svbool_t, svuint32_t, int64_t, svint32_t);
17586__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_offset_s64)))
17587void svstnt1h_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
17588__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_u32)))
17589void svstnt1h_scatter(svbool_t, svuint32_t, svuint32_t);
17590__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_u64)))
17591void svstnt1h_scatter(svbool_t, svuint64_t, svuint64_t);
17592__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32base_s32)))
17593void svstnt1h_scatter(svbool_t, svuint32_t, svint32_t);
17594__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64base_s64)))
17595void svstnt1h_scatter(svbool_t, svuint64_t, svint64_t);
17596__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_s64)))
17597void svstnt1h_scatter_index(svbool_t, int16_t *, svint64_t, svint64_t);
17598__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64index_u64)))
17599void svstnt1h_scatter_index(svbool_t, uint16_t *, svint64_t, svuint64_t);
17600__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_s64)))
17601void svstnt1h_scatter_index(svbool_t, int16_t *, svuint64_t, svint64_t);
17602__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64index_u64)))
17603void svstnt1h_scatter_index(svbool_t, uint16_t *, svuint64_t, svuint64_t);
17604__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_s32)))
17605void svstnt1h_scatter_offset(svbool_t, int16_t *, svuint32_t, svint32_t);
17606__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u32offset_u32)))
17607void svstnt1h_scatter_offset(svbool_t, uint16_t *, svuint32_t, svuint32_t);
17608__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_s64)))
17609void svstnt1h_scatter_offset(svbool_t, int16_t *, svint64_t, svint64_t);
17610__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_s64offset_u64)))
17611void svstnt1h_scatter_offset(svbool_t, uint16_t *, svint64_t, svuint64_t);
17612__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_s64)))
17613void svstnt1h_scatter_offset(svbool_t, int16_t *, svuint64_t, svint64_t);
17614__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1h_scatter_u64offset_u64)))
17615void svstnt1h_scatter_offset(svbool_t, uint16_t *, svuint64_t, svuint64_t);
17616__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_u64)))
17617void svstnt1w_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
17618__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_index_s64)))
17619void svstnt1w_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
17620__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_u64)))
17621void svstnt1w_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
17622__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_offset_s64)))
17623void svstnt1w_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
17624__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_u64)))
17625void svstnt1w_scatter(svbool_t, svuint64_t, svuint64_t);
17626__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64base_s64)))
17627void svstnt1w_scatter(svbool_t, svuint64_t, svint64_t);
17628__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_s64)))
17629void svstnt1w_scatter_index(svbool_t, int32_t *, svint64_t, svint64_t);
17630__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64index_u64)))
17631void svstnt1w_scatter_index(svbool_t, uint32_t *, svint64_t, svuint64_t);
17632__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_s64)))
17633void svstnt1w_scatter_index(svbool_t, int32_t *, svuint64_t, svint64_t);
17634__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64index_u64)))
17635void svstnt1w_scatter_index(svbool_t, uint32_t *, svuint64_t, svuint64_t);
17636__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_s64)))
17637void svstnt1w_scatter_offset(svbool_t, int32_t *, svint64_t, svint64_t);
17638__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_s64offset_u64)))
17639void svstnt1w_scatter_offset(svbool_t, uint32_t *, svint64_t, svuint64_t);
17640__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_s64)))
17641void svstnt1w_scatter_offset(svbool_t, int32_t *, svuint64_t, svint64_t);
17642__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1w_scatter_u64offset_u64)))
17643void svstnt1w_scatter_offset(svbool_t, uint32_t *, svuint64_t, svuint64_t);
17644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f16_mf8_fpm)))
17645svfloat16_t svmmla_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17646__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f16_mf8_fpm)))
17647svfloat16_t svmmla_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17648__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32_mf8_fpm)))
17649svfloat32_t svmmla_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17650__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f32_mf8_fpm)))
17651svfloat32_t svmmla_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17652__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f16_mf8_fpm)))
17653svfloat16_t svdot_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17654__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f16_mf8_fpm)))
17655svfloat16_t svdot_n_f16_mf8_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
17656__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f16_mf8_fpm)))
17657svfloat16_t svdot_lane_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17658__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f16_mf8_fpm)))
17659svfloat16_t svdot_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17660__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f16_mf8_fpm)))
17661svfloat16_t svdot_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
17662__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f16_mf8_fpm)))
17663svfloat16_t svdot_lane_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17664__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_mf8_fpm)))
17665svfloat32_t svdot_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17666__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f32_mf8_fpm)))
17667svfloat32_t svdot_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17668__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f32_mf8_fpm)))
17669svfloat32_t svdot_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17670__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_mf8_fpm)))
17671svfloat32_t svdot_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17672__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f32_mf8_fpm)))
17673svfloat32_t svdot_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17674__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_f32_mf8_fpm)))
17675svfloat32_t svdot_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17676__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_f16_mf8_fpm)))
17677svfloat16_t svmlalb_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17678__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_n_f16_mf8_fpm)))
17679svfloat16_t svmlalb_n_f16_mf8_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
17680__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_lane_f16_mf8_fpm)))
17681svfloat16_t svmlalb_lane_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17682__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_f32_mf8_fpm)))
17683svfloat32_t svmlallbb_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17684__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_n_f32_mf8_fpm)))
17685svfloat32_t svmlallbb_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17686__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_lane_f32_mf8_fpm)))
17687svfloat32_t svmlallbb_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17688__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_f32_mf8_fpm)))
17689svfloat32_t svmlallbt_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17690__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_n_f32_mf8_fpm)))
17691svfloat32_t svmlallbt_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17692__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_lane_f32_mf8_fpm)))
17693svfloat32_t svmlallbt_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17694__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_f32_mf8_fpm)))
17695svfloat32_t svmlalltb_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17696__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_n_f32_mf8_fpm)))
17697svfloat32_t svmlalltb_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17698__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_lane_f32_mf8_fpm)))
17699svfloat32_t svmlalltb_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17700__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_f32_mf8_fpm)))
17701svfloat32_t svmlalltt_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17702__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_n_f32_mf8_fpm)))
17703svfloat32_t svmlalltt_n_f32_mf8_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17704__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_lane_f32_mf8_fpm)))
17705svfloat32_t svmlalltt_lane_f32_mf8_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17706__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_f16_mf8_fpm)))
17707svfloat16_t svmlalt_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17708__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_n_f16_mf8_fpm)))
17709svfloat16_t svmlalt_n_f16_mf8_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
17710__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_lane_f16_mf8_fpm)))
17711svfloat16_t svmlalt_lane_f16_mf8_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17712__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_f16_mf8_fpm)))
17713svfloat16_t svmlalb_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17714__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_n_f16_mf8_fpm)))
17715svfloat16_t svmlalb_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
17716__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalb_lane_f16_mf8_fpm)))
17717svfloat16_t svmlalb_lane_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17718__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_f32_mf8_fpm)))
17719svfloat32_t svmlallbb_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17720__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_n_f32_mf8_fpm)))
17721svfloat32_t svmlallbb_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17722__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbb_lane_f32_mf8_fpm)))
17723svfloat32_t svmlallbb_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17724__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_f32_mf8_fpm)))
17725svfloat32_t svmlallbt_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17726__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_n_f32_mf8_fpm)))
17727svfloat32_t svmlallbt_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17728__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlallbt_lane_f32_mf8_fpm)))
17729svfloat32_t svmlallbt_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17730__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_f32_mf8_fpm)))
17731svfloat32_t svmlalltb_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17732__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_n_f32_mf8_fpm)))
17733svfloat32_t svmlalltb_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17734__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltb_lane_f32_mf8_fpm)))
17735svfloat32_t svmlalltb_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17736__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_f32_mf8_fpm)))
17737svfloat32_t svmlalltt_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, fpm_t);
17738__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_n_f32_mf8_fpm)))
17739svfloat32_t svmlalltt_fpm(svfloat32_t, svmfloat8_t, mfloat8_t, fpm_t);
17740__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalltt_lane_f32_mf8_fpm)))
17741svfloat32_t svmlalltt_lane_fpm(svfloat32_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17742__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_f16_mf8_fpm)))
17743svfloat16_t svmlalt_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, fpm_t);
17744__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_n_f16_mf8_fpm)))
17745svfloat16_t svmlalt_fpm(svfloat16_t, svmfloat8_t, mfloat8_t, fpm_t);
17746__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmlalt_lane_f16_mf8_fpm)))
17747svfloat16_t svmlalt_lane_fpm(svfloat16_t, svmfloat8_t, svmfloat8_t, uint64_t, fpm_t);
17748__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u32)))
17749svuint32_t svld1q_gather_u64base_index_u32(svbool_t, svuint64_t, int64_t);
17750__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u64)))
17751svuint64_t svld1q_gather_u64base_index_u64(svbool_t, svuint64_t, int64_t);
17752__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u16)))
17753svuint16_t svld1q_gather_u64base_index_u16(svbool_t, svuint64_t, int64_t);
17754__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_bf16)))
17755svbfloat16_t svld1q_gather_u64base_index_bf16(svbool_t, svuint64_t, int64_t);
17756__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f64)))
17757svfloat64_t svld1q_gather_u64base_index_f64(svbool_t, svuint64_t, int64_t);
17758__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f32)))
17759svfloat32_t svld1q_gather_u64base_index_f32(svbool_t, svuint64_t, int64_t);
17760__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f16)))
17761svfloat16_t svld1q_gather_u64base_index_f16(svbool_t, svuint64_t, int64_t);
17762__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s32)))
17763svint32_t svld1q_gather_u64base_index_s32(svbool_t, svuint64_t, int64_t);
17764__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s64)))
17765svint64_t svld1q_gather_u64base_index_s64(svbool_t, svuint64_t, int64_t);
17766__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s16)))
17767svint16_t svld1q_gather_u64base_index_s16(svbool_t, svuint64_t, int64_t);
17768__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u8)))
17769svuint8_t svld1q_gather_u64base_offset_u8(svbool_t, svuint64_t, int64_t);
17770__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u32)))
17771svuint32_t svld1q_gather_u64base_offset_u32(svbool_t, svuint64_t, int64_t);
17772__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u64)))
17773svuint64_t svld1q_gather_u64base_offset_u64(svbool_t, svuint64_t, int64_t);
17774__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u16)))
17775svuint16_t svld1q_gather_u64base_offset_u16(svbool_t, svuint64_t, int64_t);
17776__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_bf16)))
17777svbfloat16_t svld1q_gather_u64base_offset_bf16(svbool_t, svuint64_t, int64_t);
17778__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s8)))
17779svint8_t svld1q_gather_u64base_offset_s8(svbool_t, svuint64_t, int64_t);
17780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f64)))
17781svfloat64_t svld1q_gather_u64base_offset_f64(svbool_t, svuint64_t, int64_t);
17782__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f32)))
17783svfloat32_t svld1q_gather_u64base_offset_f32(svbool_t, svuint64_t, int64_t);
17784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f16)))
17785svfloat16_t svld1q_gather_u64base_offset_f16(svbool_t, svuint64_t, int64_t);
17786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s32)))
17787svint32_t svld1q_gather_u64base_offset_s32(svbool_t, svuint64_t, int64_t);
17788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s64)))
17789svint64_t svld1q_gather_u64base_offset_s64(svbool_t, svuint64_t, int64_t);
17790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_mf8)))
17791svmfloat8_t svld1q_gather_u64base_offset_mf8(svbool_t, svuint64_t, int64_t);
17792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s16)))
17793svint16_t svld1q_gather_u64base_offset_s16(svbool_t, svuint64_t, int64_t);
17794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u8)))
17795svuint8_t svld1q_gather_u64base_u8(svbool_t, svuint64_t);
17796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u32)))
17797svuint32_t svld1q_gather_u64base_u32(svbool_t, svuint64_t);
17798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u64)))
17799svuint64_t svld1q_gather_u64base_u64(svbool_t, svuint64_t);
17800__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u16)))
17801svuint16_t svld1q_gather_u64base_u16(svbool_t, svuint64_t);
17802__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_bf16)))
17803svbfloat16_t svld1q_gather_u64base_bf16(svbool_t, svuint64_t);
17804__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s8)))
17805svint8_t svld1q_gather_u64base_s8(svbool_t, svuint64_t);
17806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f64)))
17807svfloat64_t svld1q_gather_u64base_f64(svbool_t, svuint64_t);
17808__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f32)))
17809svfloat32_t svld1q_gather_u64base_f32(svbool_t, svuint64_t);
17810__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f16)))
17811svfloat16_t svld1q_gather_u64base_f16(svbool_t, svuint64_t);
17812__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s32)))
17813svint32_t svld1q_gather_u64base_s32(svbool_t, svuint64_t);
17814__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s64)))
17815svint64_t svld1q_gather_u64base_s64(svbool_t, svuint64_t);
17816__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_mf8)))
17817svmfloat8_t svld1q_gather_u64base_mf8(svbool_t, svuint64_t);
17818__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s16)))
17819svint16_t svld1q_gather_u64base_s16(svbool_t, svuint64_t);
17820__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u32)))
17821svuint32_t svld1q_gather_u64index_u32(svbool_t, uint32_t const *, svuint64_t);
17822__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u64)))
17823svuint64_t svld1q_gather_u64index_u64(svbool_t, uint64_t const *, svuint64_t);
17824__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u16)))
17825svuint16_t svld1q_gather_u64index_u16(svbool_t, uint16_t const *, svuint64_t);
17826__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_bf16)))
17827svbfloat16_t svld1q_gather_u64index_bf16(svbool_t, bfloat16_t const *, svuint64_t);
17828__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f64)))
17829svfloat64_t svld1q_gather_u64index_f64(svbool_t, float64_t const *, svuint64_t);
17830__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f32)))
17831svfloat32_t svld1q_gather_u64index_f32(svbool_t, float32_t const *, svuint64_t);
17832__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f16)))
17833svfloat16_t svld1q_gather_u64index_f16(svbool_t, float16_t const *, svuint64_t);
17834__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s32)))
17835svint32_t svld1q_gather_u64index_s32(svbool_t, int32_t const *, svuint64_t);
17836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s64)))
17837svint64_t svld1q_gather_u64index_s64(svbool_t, int64_t const *, svuint64_t);
17838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s16)))
17839svint16_t svld1q_gather_u64index_s16(svbool_t, int16_t const *, svuint64_t);
17840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u8)))
17841svuint8_t svld1q_gather_u64offset_u8(svbool_t, uint8_t const *, svuint64_t);
17842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u32)))
17843svuint32_t svld1q_gather_u64offset_u32(svbool_t, uint32_t const *, svuint64_t);
17844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u64)))
17845svuint64_t svld1q_gather_u64offset_u64(svbool_t, uint64_t const *, svuint64_t);
17846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u16)))
17847svuint16_t svld1q_gather_u64offset_u16(svbool_t, uint16_t const *, svuint64_t);
17848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_bf16)))
17849svbfloat16_t svld1q_gather_u64offset_bf16(svbool_t, bfloat16_t const *, svuint64_t);
17850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s8)))
17851svint8_t svld1q_gather_u64offset_s8(svbool_t, int8_t const *, svuint64_t);
17852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f64)))
17853svfloat64_t svld1q_gather_u64offset_f64(svbool_t, float64_t const *, svuint64_t);
17854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f32)))
17855svfloat32_t svld1q_gather_u64offset_f32(svbool_t, float32_t const *, svuint64_t);
17856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f16)))
17857svfloat16_t svld1q_gather_u64offset_f16(svbool_t, float16_t const *, svuint64_t);
17858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s32)))
17859svint32_t svld1q_gather_u64offset_s32(svbool_t, int32_t const *, svuint64_t);
17860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s64)))
17861svint64_t svld1q_gather_u64offset_s64(svbool_t, int64_t const *, svuint64_t);
17862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_mf8)))
17863svmfloat8_t svld1q_gather_u64offset_mf8(svbool_t, mfloat8_t const *, svuint64_t);
17864__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s16)))
17865svint16_t svld1q_gather_u64offset_s16(svbool_t, int16_t const *, svuint64_t);
17866__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_u64)))
17867svuint64_t svld1udq_u64(svbool_t, uint64_t const *);
17868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_f64)))
17869svfloat64_t svld1udq_f64(svbool_t, float64_t const *);
17870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_s64)))
17871svint64_t svld1udq_s64(svbool_t, int64_t const *);
17872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_u64)))
17873svuint64_t svld1udq_vnum_u64(svbool_t, uint64_t const *, int64_t);
17874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_f64)))
17875svfloat64_t svld1udq_vnum_f64(svbool_t, float64_t const *, int64_t);
17876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_s64)))
17877svint64_t svld1udq_vnum_s64(svbool_t, int64_t const *, int64_t);
17878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_u32)))
17879svuint32_t svld1uwq_u32(svbool_t, uint32_t const *);
17880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_f32)))
17881svfloat32_t svld1uwq_f32(svbool_t, float32_t const *);
17882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_s32)))
17883svint32_t svld1uwq_s32(svbool_t, int32_t const *);
17884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_u32)))
17885svuint32_t svld1uwq_vnum_u32(svbool_t, uint32_t const *, int64_t);
17886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_f32)))
17887svfloat32_t svld1uwq_vnum_f32(svbool_t, float32_t const *, int64_t);
17888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_s32)))
17889svint32_t svld1uwq_vnum_s32(svbool_t, int32_t const *, int64_t);
17890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_u64)))
17891void svst1dq_u64(svbool_t, uint64_t *, svuint64_t);
17892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_f64)))
17893void svst1dq_f64(svbool_t, float64_t *, svfloat64_t);
17894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_s64)))
17895void svst1dq_s64(svbool_t, int64_t *, svint64_t);
17896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_u64)))
17897void svst1dq_vnum_u64(svbool_t, uint64_t *, int64_t, svuint64_t);
17898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_f64)))
17899void svst1dq_vnum_f64(svbool_t, float64_t *, int64_t, svfloat64_t);
17900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_s64)))
17901void svst1dq_vnum_s64(svbool_t, int64_t *, int64_t, svint64_t);
17902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u8)))
17903void svst1q_scatter_u64base_u8(svbool_t, svuint64_t, svuint8_t);
17904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u32)))
17905void svst1q_scatter_u64base_u32(svbool_t, svuint64_t, svuint32_t);
17906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u64)))
17907void svst1q_scatter_u64base_u64(svbool_t, svuint64_t, svuint64_t);
17908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u16)))
17909void svst1q_scatter_u64base_u16(svbool_t, svuint64_t, svuint16_t);
17910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_bf16)))
17911void svst1q_scatter_u64base_bf16(svbool_t, svuint64_t, svbfloat16_t);
17912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s8)))
17913void svst1q_scatter_u64base_s8(svbool_t, svuint64_t, svint8_t);
17914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f64)))
17915void svst1q_scatter_u64base_f64(svbool_t, svuint64_t, svfloat64_t);
17916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f32)))
17917void svst1q_scatter_u64base_f32(svbool_t, svuint64_t, svfloat32_t);
17918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f16)))
17919void svst1q_scatter_u64base_f16(svbool_t, svuint64_t, svfloat16_t);
17920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s32)))
17921void svst1q_scatter_u64base_s32(svbool_t, svuint64_t, svint32_t);
17922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s64)))
17923void svst1q_scatter_u64base_s64(svbool_t, svuint64_t, svint64_t);
17924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_mf8)))
17925void svst1q_scatter_u64base_mf8(svbool_t, svuint64_t, svmfloat8_t);
17926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s16)))
17927void svst1q_scatter_u64base_s16(svbool_t, svuint64_t, svint16_t);
17928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u32)))
17929void svst1q_scatter_u64base_index_u32(svbool_t, svuint64_t, int64_t, svuint32_t);
17930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u64)))
17931void svst1q_scatter_u64base_index_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u16)))
17933void svst1q_scatter_u64base_index_u16(svbool_t, svuint64_t, int64_t, svuint16_t);
17934__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_bf16)))
17935void svst1q_scatter_u64base_index_bf16(svbool_t, svuint64_t, int64_t, svbfloat16_t);
17936__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f64)))
17937void svst1q_scatter_u64base_index_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
17938__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f32)))
17939void svst1q_scatter_u64base_index_f32(svbool_t, svuint64_t, int64_t, svfloat32_t);
17940__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f16)))
17941void svst1q_scatter_u64base_index_f16(svbool_t, svuint64_t, int64_t, svfloat16_t);
17942__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s32)))
17943void svst1q_scatter_u64base_index_s32(svbool_t, svuint64_t, int64_t, svint32_t);
17944__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s64)))
17945void svst1q_scatter_u64base_index_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17946__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s16)))
17947void svst1q_scatter_u64base_index_s16(svbool_t, svuint64_t, int64_t, svint16_t);
17948__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u8)))
17949void svst1q_scatter_u64base_offset_u8(svbool_t, svuint64_t, int64_t, svuint8_t);
17950__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u32)))
17951void svst1q_scatter_u64base_offset_u32(svbool_t, svuint64_t, int64_t, svuint32_t);
17952__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u64)))
17953void svst1q_scatter_u64base_offset_u64(svbool_t, svuint64_t, int64_t, svuint64_t);
17954__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u16)))
17955void svst1q_scatter_u64base_offset_u16(svbool_t, svuint64_t, int64_t, svuint16_t);
17956__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_bf16)))
17957void svst1q_scatter_u64base_offset_bf16(svbool_t, svuint64_t, int64_t, svbfloat16_t);
17958__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s8)))
17959void svst1q_scatter_u64base_offset_s8(svbool_t, svuint64_t, int64_t, svint8_t);
17960__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f64)))
17961void svst1q_scatter_u64base_offset_f64(svbool_t, svuint64_t, int64_t, svfloat64_t);
17962__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f32)))
17963void svst1q_scatter_u64base_offset_f32(svbool_t, svuint64_t, int64_t, svfloat32_t);
17964__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f16)))
17965void svst1q_scatter_u64base_offset_f16(svbool_t, svuint64_t, int64_t, svfloat16_t);
17966__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s32)))
17967void svst1q_scatter_u64base_offset_s32(svbool_t, svuint64_t, int64_t, svint32_t);
17968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s64)))
17969void svst1q_scatter_u64base_offset_s64(svbool_t, svuint64_t, int64_t, svint64_t);
17970__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_mf8)))
17971void svst1q_scatter_u64base_offset_mf8(svbool_t, svuint64_t, int64_t, svmfloat8_t);
17972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s16)))
17973void svst1q_scatter_u64base_offset_s16(svbool_t, svuint64_t, int64_t, svint16_t);
17974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u32)))
17975void svst1q_scatter_s64index_u32(svbool_t, uint32_t *, svint64_t, svuint32_t);
17976__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u64)))
17977void svst1q_scatter_s64index_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
17978__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u16)))
17979void svst1q_scatter_s64index_u16(svbool_t, uint16_t *, svint64_t, svuint16_t);
17980__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_bf16)))
17981void svst1q_scatter_s64index_bf16(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
17982__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f64)))
17983void svst1q_scatter_s64index_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
17984__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f32)))
17985void svst1q_scatter_s64index_f32(svbool_t, float32_t *, svint64_t, svfloat32_t);
17986__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f16)))
17987void svst1q_scatter_s64index_f16(svbool_t, float16_t *, svint64_t, svfloat16_t);
17988__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s32)))
17989void svst1q_scatter_s64index_s32(svbool_t, int32_t *, svint64_t, svint32_t);
17990__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s64)))
17991void svst1q_scatter_s64index_s64(svbool_t, int64_t *, svint64_t, svint64_t);
17992__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s16)))
17993void svst1q_scatter_s64index_s16(svbool_t, int16_t *, svint64_t, svint16_t);
17994__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u32)))
17995void svst1q_scatter_u64index_u32(svbool_t, uint32_t *, svuint64_t, svuint32_t);
17996__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u64)))
17997void svst1q_scatter_u64index_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
17998__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u16)))
17999void svst1q_scatter_u64index_u16(svbool_t, uint16_t *, svuint64_t, svuint16_t);
18000__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_bf16)))
18001void svst1q_scatter_u64index_bf16(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
18002__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f64)))
18003void svst1q_scatter_u64index_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
18004__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f32)))
18005void svst1q_scatter_u64index_f32(svbool_t, float32_t *, svuint64_t, svfloat32_t);
18006__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f16)))
18007void svst1q_scatter_u64index_f16(svbool_t, float16_t *, svuint64_t, svfloat16_t);
18008__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s32)))
18009void svst1q_scatter_u64index_s32(svbool_t, int32_t *, svuint64_t, svint32_t);
18010__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s64)))
18011void svst1q_scatter_u64index_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
18012__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s16)))
18013void svst1q_scatter_u64index_s16(svbool_t, int16_t *, svuint64_t, svint16_t);
18014__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u8)))
18015void svst1q_scatter_s64offset_u8(svbool_t, uint8_t *, svint64_t, svuint8_t);
18016__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u32)))
18017void svst1q_scatter_s64offset_u32(svbool_t, uint32_t *, svint64_t, svuint32_t);
18018__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u64)))
18019void svst1q_scatter_s64offset_u64(svbool_t, uint64_t *, svint64_t, svuint64_t);
18020__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u16)))
18021void svst1q_scatter_s64offset_u16(svbool_t, uint16_t *, svint64_t, svuint16_t);
18022__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_bf16)))
18023void svst1q_scatter_s64offset_bf16(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
18024__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s8)))
18025void svst1q_scatter_s64offset_s8(svbool_t, int8_t *, svint64_t, svint8_t);
18026__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f64)))
18027void svst1q_scatter_s64offset_f64(svbool_t, float64_t *, svint64_t, svfloat64_t);
18028__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f32)))
18029void svst1q_scatter_s64offset_f32(svbool_t, float32_t *, svint64_t, svfloat32_t);
18030__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f16)))
18031void svst1q_scatter_s64offset_f16(svbool_t, float16_t *, svint64_t, svfloat16_t);
18032__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s32)))
18033void svst1q_scatter_s64offset_s32(svbool_t, int32_t *, svint64_t, svint32_t);
18034__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s64)))
18035void svst1q_scatter_s64offset_s64(svbool_t, int64_t *, svint64_t, svint64_t);
18036__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_mf8)))
18037void svst1q_scatter_s64offset_mf8(svbool_t, mfloat8_t *, svint64_t, svmfloat8_t);
18038__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s16)))
18039void svst1q_scatter_s64offset_s16(svbool_t, int16_t *, svint64_t, svint16_t);
18040__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u8)))
18041void svst1q_scatter_u64offset_u8(svbool_t, uint8_t *, svuint64_t, svuint8_t);
18042__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u32)))
18043void svst1q_scatter_u64offset_u32(svbool_t, uint32_t *, svuint64_t, svuint32_t);
18044__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u64)))
18045void svst1q_scatter_u64offset_u64(svbool_t, uint64_t *, svuint64_t, svuint64_t);
18046__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u16)))
18047void svst1q_scatter_u64offset_u16(svbool_t, uint16_t *, svuint64_t, svuint16_t);
18048__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_bf16)))
18049void svst1q_scatter_u64offset_bf16(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
18050__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s8)))
18051void svst1q_scatter_u64offset_s8(svbool_t, int8_t *, svuint64_t, svint8_t);
18052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f64)))
18053void svst1q_scatter_u64offset_f64(svbool_t, float64_t *, svuint64_t, svfloat64_t);
18054__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f32)))
18055void svst1q_scatter_u64offset_f32(svbool_t, float32_t *, svuint64_t, svfloat32_t);
18056__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f16)))
18057void svst1q_scatter_u64offset_f16(svbool_t, float16_t *, svuint64_t, svfloat16_t);
18058__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s32)))
18059void svst1q_scatter_u64offset_s32(svbool_t, int32_t *, svuint64_t, svint32_t);
18060__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s64)))
18061void svst1q_scatter_u64offset_s64(svbool_t, int64_t *, svuint64_t, svint64_t);
18062__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_mf8)))
18063void svst1q_scatter_u64offset_mf8(svbool_t, mfloat8_t *, svuint64_t, svmfloat8_t);
18064__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s16)))
18065void svst1q_scatter_u64offset_s16(svbool_t, int16_t *, svuint64_t, svint16_t);
18066__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_u32)))
18067void svst1wq_u32(svbool_t, uint32_t *, svuint32_t);
18068__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_f32)))
18069void svst1wq_f32(svbool_t, float32_t *, svfloat32_t);
18070__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_s32)))
18071void svst1wq_s32(svbool_t, int32_t *, svint32_t);
18072__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_u32)))
18073void svst1wq_vnum_u32(svbool_t, uint32_t *, int64_t, svuint32_t);
18074__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_f32)))
18075void svst1wq_vnum_f32(svbool_t, float32_t *, int64_t, svfloat32_t);
18076__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_s32)))
18077void svst1wq_vnum_s32(svbool_t, int32_t *, int64_t, svint32_t);
18078__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u32)))
18079svuint32_t svld1q_gather_index_u32(svbool_t, svuint64_t, int64_t);
18080__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u64)))
18081svuint64_t svld1q_gather_index_u64(svbool_t, svuint64_t, int64_t);
18082__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_u16)))
18083svuint16_t svld1q_gather_index_u16(svbool_t, svuint64_t, int64_t);
18084__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_bf16)))
18085svbfloat16_t svld1q_gather_index_bf16(svbool_t, svuint64_t, int64_t);
18086__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f64)))
18087svfloat64_t svld1q_gather_index_f64(svbool_t, svuint64_t, int64_t);
18088__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f32)))
18089svfloat32_t svld1q_gather_index_f32(svbool_t, svuint64_t, int64_t);
18090__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_f16)))
18091svfloat16_t svld1q_gather_index_f16(svbool_t, svuint64_t, int64_t);
18092__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s32)))
18093svint32_t svld1q_gather_index_s32(svbool_t, svuint64_t, int64_t);
18094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s64)))
18095svint64_t svld1q_gather_index_s64(svbool_t, svuint64_t, int64_t);
18096__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_index_s16)))
18097svint16_t svld1q_gather_index_s16(svbool_t, svuint64_t, int64_t);
18098__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u8)))
18099svuint8_t svld1q_gather_offset_u8(svbool_t, svuint64_t, int64_t);
18100__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u32)))
18101svuint32_t svld1q_gather_offset_u32(svbool_t, svuint64_t, int64_t);
18102__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u64)))
18103svuint64_t svld1q_gather_offset_u64(svbool_t, svuint64_t, int64_t);
18104__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_u16)))
18105svuint16_t svld1q_gather_offset_u16(svbool_t, svuint64_t, int64_t);
18106__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_bf16)))
18107svbfloat16_t svld1q_gather_offset_bf16(svbool_t, svuint64_t, int64_t);
18108__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s8)))
18109svint8_t svld1q_gather_offset_s8(svbool_t, svuint64_t, int64_t);
18110__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f64)))
18111svfloat64_t svld1q_gather_offset_f64(svbool_t, svuint64_t, int64_t);
18112__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f32)))
18113svfloat32_t svld1q_gather_offset_f32(svbool_t, svuint64_t, int64_t);
18114__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_f16)))
18115svfloat16_t svld1q_gather_offset_f16(svbool_t, svuint64_t, int64_t);
18116__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s32)))
18117svint32_t svld1q_gather_offset_s32(svbool_t, svuint64_t, int64_t);
18118__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s64)))
18119svint64_t svld1q_gather_offset_s64(svbool_t, svuint64_t, int64_t);
18120__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_mf8)))
18121svmfloat8_t svld1q_gather_offset_mf8(svbool_t, svuint64_t, int64_t);
18122__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_offset_s16)))
18123svint16_t svld1q_gather_offset_s16(svbool_t, svuint64_t, int64_t);
18124__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u8)))
18125svuint8_t svld1q_gather_u8(svbool_t, svuint64_t);
18126__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u32)))
18127svuint32_t svld1q_gather_u32(svbool_t, svuint64_t);
18128__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u64)))
18129svuint64_t svld1q_gather_u64(svbool_t, svuint64_t);
18130__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_u16)))
18131svuint16_t svld1q_gather_u16(svbool_t, svuint64_t);
18132__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_bf16)))
18133svbfloat16_t svld1q_gather_bf16(svbool_t, svuint64_t);
18134__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s8)))
18135svint8_t svld1q_gather_s8(svbool_t, svuint64_t);
18136__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f64)))
18137svfloat64_t svld1q_gather_f64(svbool_t, svuint64_t);
18138__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f32)))
18139svfloat32_t svld1q_gather_f32(svbool_t, svuint64_t);
18140__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_f16)))
18141svfloat16_t svld1q_gather_f16(svbool_t, svuint64_t);
18142__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s32)))
18143svint32_t svld1q_gather_s32(svbool_t, svuint64_t);
18144__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s64)))
18145svint64_t svld1q_gather_s64(svbool_t, svuint64_t);
18146__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_mf8)))
18147svmfloat8_t svld1q_gather_mf8(svbool_t, svuint64_t);
18148__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64base_s16)))
18149svint16_t svld1q_gather_s16(svbool_t, svuint64_t);
18150__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u32)))
18151svuint32_t svld1q_gather_index(svbool_t, uint32_t const *, svuint64_t);
18152__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u64)))
18153svuint64_t svld1q_gather_index(svbool_t, uint64_t const *, svuint64_t);
18154__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_u16)))
18155svuint16_t svld1q_gather_index(svbool_t, uint16_t const *, svuint64_t);
18156__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_bf16)))
18157svbfloat16_t svld1q_gather_index(svbool_t, bfloat16_t const *, svuint64_t);
18158__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f64)))
18159svfloat64_t svld1q_gather_index(svbool_t, float64_t const *, svuint64_t);
18160__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f32)))
18161svfloat32_t svld1q_gather_index(svbool_t, float32_t const *, svuint64_t);
18162__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_f16)))
18163svfloat16_t svld1q_gather_index(svbool_t, float16_t const *, svuint64_t);
18164__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s32)))
18165svint32_t svld1q_gather_index(svbool_t, int32_t const *, svuint64_t);
18166__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s64)))
18167svint64_t svld1q_gather_index(svbool_t, int64_t const *, svuint64_t);
18168__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64index_s16)))
18169svint16_t svld1q_gather_index(svbool_t, int16_t const *, svuint64_t);
18170__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u8)))
18171svuint8_t svld1q_gather_offset(svbool_t, uint8_t const *, svuint64_t);
18172__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u32)))
18173svuint32_t svld1q_gather_offset(svbool_t, uint32_t const *, svuint64_t);
18174__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u64)))
18175svuint64_t svld1q_gather_offset(svbool_t, uint64_t const *, svuint64_t);
18176__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_u16)))
18177svuint16_t svld1q_gather_offset(svbool_t, uint16_t const *, svuint64_t);
18178__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_bf16)))
18179svbfloat16_t svld1q_gather_offset(svbool_t, bfloat16_t const *, svuint64_t);
18180__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s8)))
18181svint8_t svld1q_gather_offset(svbool_t, int8_t const *, svuint64_t);
18182__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f64)))
18183svfloat64_t svld1q_gather_offset(svbool_t, float64_t const *, svuint64_t);
18184__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f32)))
18185svfloat32_t svld1q_gather_offset(svbool_t, float32_t const *, svuint64_t);
18186__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_f16)))
18187svfloat16_t svld1q_gather_offset(svbool_t, float16_t const *, svuint64_t);
18188__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s32)))
18189svint32_t svld1q_gather_offset(svbool_t, int32_t const *, svuint64_t);
18190__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s64)))
18191svint64_t svld1q_gather_offset(svbool_t, int64_t const *, svuint64_t);
18192__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_mf8)))
18193svmfloat8_t svld1q_gather_offset(svbool_t, mfloat8_t const *, svuint64_t);
18194__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1q_gather_u64offset_s16)))
18195svint16_t svld1q_gather_offset(svbool_t, int16_t const *, svuint64_t);
18196__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_u64)))
18197svuint64_t svld1udq(svbool_t, uint64_t const *);
18198__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_f64)))
18199svfloat64_t svld1udq(svbool_t, float64_t const *);
18200__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_s64)))
18201svint64_t svld1udq(svbool_t, int64_t const *);
18202__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_u64)))
18203svuint64_t svld1udq_vnum(svbool_t, uint64_t const *, int64_t);
18204__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_f64)))
18205svfloat64_t svld1udq_vnum(svbool_t, float64_t const *, int64_t);
18206__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1udq_vnum_s64)))
18207svint64_t svld1udq_vnum(svbool_t, int64_t const *, int64_t);
18208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_u32)))
18209svuint32_t svld1uwq(svbool_t, uint32_t const *);
18210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_f32)))
18211svfloat32_t svld1uwq(svbool_t, float32_t const *);
18212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_s32)))
18213svint32_t svld1uwq(svbool_t, int32_t const *);
18214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_u32)))
18215svuint32_t svld1uwq_vnum(svbool_t, uint32_t const *, int64_t);
18216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_f32)))
18217svfloat32_t svld1uwq_vnum(svbool_t, float32_t const *, int64_t);
18218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1uwq_vnum_s32)))
18219svint32_t svld1uwq_vnum(svbool_t, int32_t const *, int64_t);
18220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_u64)))
18221void svst1dq(svbool_t, uint64_t *, svuint64_t);
18222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_f64)))
18223void svst1dq(svbool_t, float64_t *, svfloat64_t);
18224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_s64)))
18225void svst1dq(svbool_t, int64_t *, svint64_t);
18226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_u64)))
18227void svst1dq_vnum(svbool_t, uint64_t *, int64_t, svuint64_t);
18228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_f64)))
18229void svst1dq_vnum(svbool_t, float64_t *, int64_t, svfloat64_t);
18230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1dq_vnum_s64)))
18231void svst1dq_vnum(svbool_t, int64_t *, int64_t, svint64_t);
18232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u8)))
18233void svst1q_scatter(svbool_t, svuint64_t, svuint8_t);
18234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u32)))
18235void svst1q_scatter(svbool_t, svuint64_t, svuint32_t);
18236__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u64)))
18237void svst1q_scatter(svbool_t, svuint64_t, svuint64_t);
18238__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_u16)))
18239void svst1q_scatter(svbool_t, svuint64_t, svuint16_t);
18240__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_bf16)))
18241void svst1q_scatter(svbool_t, svuint64_t, svbfloat16_t);
18242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s8)))
18243void svst1q_scatter(svbool_t, svuint64_t, svint8_t);
18244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f64)))
18245void svst1q_scatter(svbool_t, svuint64_t, svfloat64_t);
18246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f32)))
18247void svst1q_scatter(svbool_t, svuint64_t, svfloat32_t);
18248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_f16)))
18249void svst1q_scatter(svbool_t, svuint64_t, svfloat16_t);
18250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s32)))
18251void svst1q_scatter(svbool_t, svuint64_t, svint32_t);
18252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s64)))
18253void svst1q_scatter(svbool_t, svuint64_t, svint64_t);
18254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_mf8)))
18255void svst1q_scatter(svbool_t, svuint64_t, svmfloat8_t);
18256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_s16)))
18257void svst1q_scatter(svbool_t, svuint64_t, svint16_t);
18258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u32)))
18259void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svuint32_t);
18260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u64)))
18261void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svuint64_t);
18262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_u16)))
18263void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svuint16_t);
18264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_bf16)))
18265void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svbfloat16_t);
18266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f64)))
18267void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svfloat64_t);
18268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f32)))
18269void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svfloat32_t);
18270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_f16)))
18271void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svfloat16_t);
18272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s32)))
18273void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svint32_t);
18274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s64)))
18275void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svint64_t);
18276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_index_s16)))
18277void svst1q_scatter_index(svbool_t, svuint64_t, int64_t, svint16_t);
18278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u8)))
18279void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint8_t);
18280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u32)))
18281void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint32_t);
18282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u64)))
18283void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint64_t);
18284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_u16)))
18285void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svuint16_t);
18286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_bf16)))
18287void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svbfloat16_t);
18288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s8)))
18289void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint8_t);
18290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f64)))
18291void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat64_t);
18292__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f32)))
18293void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat32_t);
18294__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_f16)))
18295void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svfloat16_t);
18296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s32)))
18297void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint32_t);
18298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s64)))
18299void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint64_t);
18300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_mf8)))
18301void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svmfloat8_t);
18302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64base_offset_s16)))
18303void svst1q_scatter_offset(svbool_t, svuint64_t, int64_t, svint16_t);
18304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u32)))
18305void svst1q_scatter_index(svbool_t, uint32_t *, svint64_t, svuint32_t);
18306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u64)))
18307void svst1q_scatter_index(svbool_t, uint64_t *, svint64_t, svuint64_t);
18308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_u16)))
18309void svst1q_scatter_index(svbool_t, uint16_t *, svint64_t, svuint16_t);
18310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_bf16)))
18311void svst1q_scatter_index(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
18312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f64)))
18313void svst1q_scatter_index(svbool_t, float64_t *, svint64_t, svfloat64_t);
18314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f32)))
18315void svst1q_scatter_index(svbool_t, float32_t *, svint64_t, svfloat32_t);
18316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_f16)))
18317void svst1q_scatter_index(svbool_t, float16_t *, svint64_t, svfloat16_t);
18318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s32)))
18319void svst1q_scatter_index(svbool_t, int32_t *, svint64_t, svint32_t);
18320__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s64)))
18321void svst1q_scatter_index(svbool_t, int64_t *, svint64_t, svint64_t);
18322__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64index_s16)))
18323void svst1q_scatter_index(svbool_t, int16_t *, svint64_t, svint16_t);
18324__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u32)))
18325void svst1q_scatter_index(svbool_t, uint32_t *, svuint64_t, svuint32_t);
18326__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u64)))
18327void svst1q_scatter_index(svbool_t, uint64_t *, svuint64_t, svuint64_t);
18328__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_u16)))
18329void svst1q_scatter_index(svbool_t, uint16_t *, svuint64_t, svuint16_t);
18330__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_bf16)))
18331void svst1q_scatter_index(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
18332__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f64)))
18333void svst1q_scatter_index(svbool_t, float64_t *, svuint64_t, svfloat64_t);
18334__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f32)))
18335void svst1q_scatter_index(svbool_t, float32_t *, svuint64_t, svfloat32_t);
18336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_f16)))
18337void svst1q_scatter_index(svbool_t, float16_t *, svuint64_t, svfloat16_t);
18338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s32)))
18339void svst1q_scatter_index(svbool_t, int32_t *, svuint64_t, svint32_t);
18340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s64)))
18341void svst1q_scatter_index(svbool_t, int64_t *, svuint64_t, svint64_t);
18342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64index_s16)))
18343void svst1q_scatter_index(svbool_t, int16_t *, svuint64_t, svint16_t);
18344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u8)))
18345void svst1q_scatter_offset(svbool_t, uint8_t *, svint64_t, svuint8_t);
18346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u32)))
18347void svst1q_scatter_offset(svbool_t, uint32_t *, svint64_t, svuint32_t);
18348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u64)))
18349void svst1q_scatter_offset(svbool_t, uint64_t *, svint64_t, svuint64_t);
18350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_u16)))
18351void svst1q_scatter_offset(svbool_t, uint16_t *, svint64_t, svuint16_t);
18352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_bf16)))
18353void svst1q_scatter_offset(svbool_t, bfloat16_t *, svint64_t, svbfloat16_t);
18354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s8)))
18355void svst1q_scatter_offset(svbool_t, int8_t *, svint64_t, svint8_t);
18356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f64)))
18357void svst1q_scatter_offset(svbool_t, float64_t *, svint64_t, svfloat64_t);
18358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f32)))
18359void svst1q_scatter_offset(svbool_t, float32_t *, svint64_t, svfloat32_t);
18360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_f16)))
18361void svst1q_scatter_offset(svbool_t, float16_t *, svint64_t, svfloat16_t);
18362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s32)))
18363void svst1q_scatter_offset(svbool_t, int32_t *, svint64_t, svint32_t);
18364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s64)))
18365void svst1q_scatter_offset(svbool_t, int64_t *, svint64_t, svint64_t);
18366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_mf8)))
18367void svst1q_scatter_offset(svbool_t, mfloat8_t *, svint64_t, svmfloat8_t);
18368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_s64offset_s16)))
18369void svst1q_scatter_offset(svbool_t, int16_t *, svint64_t, svint16_t);
18370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u8)))
18371void svst1q_scatter_offset(svbool_t, uint8_t *, svuint64_t, svuint8_t);
18372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u32)))
18373void svst1q_scatter_offset(svbool_t, uint32_t *, svuint64_t, svuint32_t);
18374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u64)))
18375void svst1q_scatter_offset(svbool_t, uint64_t *, svuint64_t, svuint64_t);
18376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_u16)))
18377void svst1q_scatter_offset(svbool_t, uint16_t *, svuint64_t, svuint16_t);
18378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_bf16)))
18379void svst1q_scatter_offset(svbool_t, bfloat16_t *, svuint64_t, svbfloat16_t);
18380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s8)))
18381void svst1q_scatter_offset(svbool_t, int8_t *, svuint64_t, svint8_t);
18382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f64)))
18383void svst1q_scatter_offset(svbool_t, float64_t *, svuint64_t, svfloat64_t);
18384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f32)))
18385void svst1q_scatter_offset(svbool_t, float32_t *, svuint64_t, svfloat32_t);
18386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_f16)))
18387void svst1q_scatter_offset(svbool_t, float16_t *, svuint64_t, svfloat16_t);
18388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s32)))
18389void svst1q_scatter_offset(svbool_t, int32_t *, svuint64_t, svint32_t);
18390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s64)))
18391void svst1q_scatter_offset(svbool_t, int64_t *, svuint64_t, svint64_t);
18392__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_mf8)))
18393void svst1q_scatter_offset(svbool_t, mfloat8_t *, svuint64_t, svmfloat8_t);
18394__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1q_scatter_u64offset_s16)))
18395void svst1q_scatter_offset(svbool_t, int16_t *, svuint64_t, svint16_t);
18396__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_u32)))
18397void svst1wq(svbool_t, uint32_t *, svuint32_t);
18398__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_f32)))
18399void svst1wq(svbool_t, float32_t *, svfloat32_t);
18400__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_s32)))
18401void svst1wq(svbool_t, int32_t *, svint32_t);
18402__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_u32)))
18403void svst1wq_vnum(svbool_t, uint32_t *, int64_t, svuint32_t);
18404__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_f32)))
18405void svst1wq_vnum(svbool_t, float32_t *, int64_t, svfloat32_t);
18406__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1wq_vnum_s32)))
18407void svst1wq_vnum(svbool_t, int32_t *, int64_t, svint32_t);
18408__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c8)))
18409uint64_t svcntp_c8(svcount_t, uint64_t);
18410__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c32)))
18411uint64_t svcntp_c32(svcount_t, uint64_t);
18412__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c64)))
18413uint64_t svcntp_c64(svcount_t, uint64_t);
18414__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcntp_c16)))
18415uint64_t svcntp_c16(svcount_t, uint64_t);
18416__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x2)))
18417svuint8x2_t svld1_u8_x2(svcount_t, uint8_t const *);
18418__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x2)))
18419svint8x2_t svld1_s8_x2(svcount_t, int8_t const *);
18420__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x2)))
18421svmfloat8x2_t svld1_mf8_x2(svcount_t, mfloat8_t const *);
18422__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x2)))
18423svuint64x2_t svld1_u64_x2(svcount_t, uint64_t const *);
18424__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x2)))
18425svfloat64x2_t svld1_f64_x2(svcount_t, float64_t const *);
18426__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x2)))
18427svint64x2_t svld1_s64_x2(svcount_t, int64_t const *);
18428__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x2)))
18429svuint16x2_t svld1_u16_x2(svcount_t, uint16_t const *);
18430__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x2)))
18431svbfloat16x2_t svld1_bf16_x2(svcount_t, bfloat16_t const *);
18432__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x2)))
18433svfloat16x2_t svld1_f16_x2(svcount_t, float16_t const *);
18434__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x2)))
18435svint16x2_t svld1_s16_x2(svcount_t, int16_t const *);
18436__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x2)))
18437svuint32x2_t svld1_u32_x2(svcount_t, uint32_t const *);
18438__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x2)))
18439svfloat32x2_t svld1_f32_x2(svcount_t, float32_t const *);
18440__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x2)))
18441svint32x2_t svld1_s32_x2(svcount_t, int32_t const *);
18442__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x4)))
18443svuint8x4_t svld1_u8_x4(svcount_t, uint8_t const *);
18444__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x4)))
18445svint8x4_t svld1_s8_x4(svcount_t, int8_t const *);
18446__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x4)))
18447svmfloat8x4_t svld1_mf8_x4(svcount_t, mfloat8_t const *);
18448__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x4)))
18449svuint64x4_t svld1_u64_x4(svcount_t, uint64_t const *);
18450__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x4)))
18451svfloat64x4_t svld1_f64_x4(svcount_t, float64_t const *);
18452__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x4)))
18453svint64x4_t svld1_s64_x4(svcount_t, int64_t const *);
18454__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x4)))
18455svuint16x4_t svld1_u16_x4(svcount_t, uint16_t const *);
18456__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x4)))
18457svbfloat16x4_t svld1_bf16_x4(svcount_t, bfloat16_t const *);
18458__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x4)))
18459svfloat16x4_t svld1_f16_x4(svcount_t, float16_t const *);
18460__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x4)))
18461svint16x4_t svld1_s16_x4(svcount_t, int16_t const *);
18462__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x4)))
18463svuint32x4_t svld1_u32_x4(svcount_t, uint32_t const *);
18464__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x4)))
18465svfloat32x4_t svld1_f32_x4(svcount_t, float32_t const *);
18466__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x4)))
18467svint32x4_t svld1_s32_x4(svcount_t, int32_t const *);
18468__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x2)))
18469svuint8x2_t svld1_vnum_u8_x2(svcount_t, uint8_t const *, int64_t);
18470__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x2)))
18471svint8x2_t svld1_vnum_s8_x2(svcount_t, int8_t const *, int64_t);
18472__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x2)))
18473svmfloat8x2_t svld1_vnum_mf8_x2(svcount_t, mfloat8_t const *, int64_t);
18474__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x2)))
18475svuint64x2_t svld1_vnum_u64_x2(svcount_t, uint64_t const *, int64_t);
18476__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x2)))
18477svfloat64x2_t svld1_vnum_f64_x2(svcount_t, float64_t const *, int64_t);
18478__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x2)))
18479svint64x2_t svld1_vnum_s64_x2(svcount_t, int64_t const *, int64_t);
18480__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x2)))
18481svuint16x2_t svld1_vnum_u16_x2(svcount_t, uint16_t const *, int64_t);
18482__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x2)))
18483svbfloat16x2_t svld1_vnum_bf16_x2(svcount_t, bfloat16_t const *, int64_t);
18484__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x2)))
18485svfloat16x2_t svld1_vnum_f16_x2(svcount_t, float16_t const *, int64_t);
18486__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x2)))
18487svint16x2_t svld1_vnum_s16_x2(svcount_t, int16_t const *, int64_t);
18488__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x2)))
18489svuint32x2_t svld1_vnum_u32_x2(svcount_t, uint32_t const *, int64_t);
18490__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x2)))
18491svfloat32x2_t svld1_vnum_f32_x2(svcount_t, float32_t const *, int64_t);
18492__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x2)))
18493svint32x2_t svld1_vnum_s32_x2(svcount_t, int32_t const *, int64_t);
18494__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x4)))
18495svuint8x4_t svld1_vnum_u8_x4(svcount_t, uint8_t const *, int64_t);
18496__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x4)))
18497svint8x4_t svld1_vnum_s8_x4(svcount_t, int8_t const *, int64_t);
18498__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x4)))
18499svmfloat8x4_t svld1_vnum_mf8_x4(svcount_t, mfloat8_t const *, int64_t);
18500__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x4)))
18501svuint64x4_t svld1_vnum_u64_x4(svcount_t, uint64_t const *, int64_t);
18502__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x4)))
18503svfloat64x4_t svld1_vnum_f64_x4(svcount_t, float64_t const *, int64_t);
18504__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x4)))
18505svint64x4_t svld1_vnum_s64_x4(svcount_t, int64_t const *, int64_t);
18506__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x4)))
18507svuint16x4_t svld1_vnum_u16_x4(svcount_t, uint16_t const *, int64_t);
18508__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x4)))
18509svbfloat16x4_t svld1_vnum_bf16_x4(svcount_t, bfloat16_t const *, int64_t);
18510__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x4)))
18511svfloat16x4_t svld1_vnum_f16_x4(svcount_t, float16_t const *, int64_t);
18512__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x4)))
18513svint16x4_t svld1_vnum_s16_x4(svcount_t, int16_t const *, int64_t);
18514__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x4)))
18515svuint32x4_t svld1_vnum_u32_x4(svcount_t, uint32_t const *, int64_t);
18516__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x4)))
18517svfloat32x4_t svld1_vnum_f32_x4(svcount_t, float32_t const *, int64_t);
18518__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x4)))
18519svint32x4_t svld1_vnum_s32_x4(svcount_t, int32_t const *, int64_t);
18520__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x2)))
18521svuint8x2_t svldnt1_u8_x2(svcount_t, uint8_t const *);
18522__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x2)))
18523svint8x2_t svldnt1_s8_x2(svcount_t, int8_t const *);
18524__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x2)))
18525svmfloat8x2_t svldnt1_mf8_x2(svcount_t, mfloat8_t const *);
18526__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x2)))
18527svuint64x2_t svldnt1_u64_x2(svcount_t, uint64_t const *);
18528__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x2)))
18529svfloat64x2_t svldnt1_f64_x2(svcount_t, float64_t const *);
18530__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x2)))
18531svint64x2_t svldnt1_s64_x2(svcount_t, int64_t const *);
18532__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x2)))
18533svuint16x2_t svldnt1_u16_x2(svcount_t, uint16_t const *);
18534__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x2)))
18535svbfloat16x2_t svldnt1_bf16_x2(svcount_t, bfloat16_t const *);
18536__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x2)))
18537svfloat16x2_t svldnt1_f16_x2(svcount_t, float16_t const *);
18538__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x2)))
18539svint16x2_t svldnt1_s16_x2(svcount_t, int16_t const *);
18540__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x2)))
18541svuint32x2_t svldnt1_u32_x2(svcount_t, uint32_t const *);
18542__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x2)))
18543svfloat32x2_t svldnt1_f32_x2(svcount_t, float32_t const *);
18544__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x2)))
18545svint32x2_t svldnt1_s32_x2(svcount_t, int32_t const *);
18546__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x4)))
18547svuint8x4_t svldnt1_u8_x4(svcount_t, uint8_t const *);
18548__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x4)))
18549svint8x4_t svldnt1_s8_x4(svcount_t, int8_t const *);
18550__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x4)))
18551svmfloat8x4_t svldnt1_mf8_x4(svcount_t, mfloat8_t const *);
18552__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x4)))
18553svuint64x4_t svldnt1_u64_x4(svcount_t, uint64_t const *);
18554__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x4)))
18555svfloat64x4_t svldnt1_f64_x4(svcount_t, float64_t const *);
18556__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x4)))
18557svint64x4_t svldnt1_s64_x4(svcount_t, int64_t const *);
18558__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x4)))
18559svuint16x4_t svldnt1_u16_x4(svcount_t, uint16_t const *);
18560__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x4)))
18561svbfloat16x4_t svldnt1_bf16_x4(svcount_t, bfloat16_t const *);
18562__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x4)))
18563svfloat16x4_t svldnt1_f16_x4(svcount_t, float16_t const *);
18564__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x4)))
18565svint16x4_t svldnt1_s16_x4(svcount_t, int16_t const *);
18566__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x4)))
18567svuint32x4_t svldnt1_u32_x4(svcount_t, uint32_t const *);
18568__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x4)))
18569svfloat32x4_t svldnt1_f32_x4(svcount_t, float32_t const *);
18570__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x4)))
18571svint32x4_t svldnt1_s32_x4(svcount_t, int32_t const *);
18572__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x2)))
18573svuint8x2_t svldnt1_vnum_u8_x2(svcount_t, uint8_t const *, int64_t);
18574__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x2)))
18575svint8x2_t svldnt1_vnum_s8_x2(svcount_t, int8_t const *, int64_t);
18576__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x2)))
18577svmfloat8x2_t svldnt1_vnum_mf8_x2(svcount_t, mfloat8_t const *, int64_t);
18578__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x2)))
18579svuint64x2_t svldnt1_vnum_u64_x2(svcount_t, uint64_t const *, int64_t);
18580__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x2)))
18581svfloat64x2_t svldnt1_vnum_f64_x2(svcount_t, float64_t const *, int64_t);
18582__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x2)))
18583svint64x2_t svldnt1_vnum_s64_x2(svcount_t, int64_t const *, int64_t);
18584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x2)))
18585svuint16x2_t svldnt1_vnum_u16_x2(svcount_t, uint16_t const *, int64_t);
18586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x2)))
18587svbfloat16x2_t svldnt1_vnum_bf16_x2(svcount_t, bfloat16_t const *, int64_t);
18588__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x2)))
18589svfloat16x2_t svldnt1_vnum_f16_x2(svcount_t, float16_t const *, int64_t);
18590__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x2)))
18591svint16x2_t svldnt1_vnum_s16_x2(svcount_t, int16_t const *, int64_t);
18592__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x2)))
18593svuint32x2_t svldnt1_vnum_u32_x2(svcount_t, uint32_t const *, int64_t);
18594__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x2)))
18595svfloat32x2_t svldnt1_vnum_f32_x2(svcount_t, float32_t const *, int64_t);
18596__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x2)))
18597svint32x2_t svldnt1_vnum_s32_x2(svcount_t, int32_t const *, int64_t);
18598__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x4)))
18599svuint8x4_t svldnt1_vnum_u8_x4(svcount_t, uint8_t const *, int64_t);
18600__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x4)))
18601svint8x4_t svldnt1_vnum_s8_x4(svcount_t, int8_t const *, int64_t);
18602__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x4)))
18603svmfloat8x4_t svldnt1_vnum_mf8_x4(svcount_t, mfloat8_t const *, int64_t);
18604__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x4)))
18605svuint64x4_t svldnt1_vnum_u64_x4(svcount_t, uint64_t const *, int64_t);
18606__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x4)))
18607svfloat64x4_t svldnt1_vnum_f64_x4(svcount_t, float64_t const *, int64_t);
18608__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x4)))
18609svint64x4_t svldnt1_vnum_s64_x4(svcount_t, int64_t const *, int64_t);
18610__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x4)))
18611svuint16x4_t svldnt1_vnum_u16_x4(svcount_t, uint16_t const *, int64_t);
18612__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x4)))
18613svbfloat16x4_t svldnt1_vnum_bf16_x4(svcount_t, bfloat16_t const *, int64_t);
18614__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x4)))
18615svfloat16x4_t svldnt1_vnum_f16_x4(svcount_t, float16_t const *, int64_t);
18616__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x4)))
18617svint16x4_t svldnt1_vnum_s16_x4(svcount_t, int16_t const *, int64_t);
18618__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x4)))
18619svuint32x4_t svldnt1_vnum_u32_x4(svcount_t, uint32_t const *, int64_t);
18620__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x4)))
18621svfloat32x4_t svldnt1_vnum_f32_x4(svcount_t, float32_t const *, int64_t);
18622__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x4)))
18623svint32x4_t svldnt1_vnum_s32_x4(svcount_t, int32_t const *, int64_t);
18624__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c8)))
18625svbool_t svpext_lane_c8(svcount_t, uint64_t);
18626__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c32)))
18627svbool_t svpext_lane_c32(svcount_t, uint64_t);
18628__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c64)))
18629svbool_t svpext_lane_c64(svcount_t, uint64_t);
18630__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c16)))
18631svbool_t svpext_lane_c16(svcount_t, uint64_t);
18632__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c8_x2)))
18633svboolx2_t svpext_lane_c8_x2(svcount_t, uint64_t);
18634__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c32_x2)))
18635svboolx2_t svpext_lane_c32_x2(svcount_t, uint64_t);
18636__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c64_x2)))
18637svboolx2_t svpext_lane_c64_x2(svcount_t, uint64_t);
18638__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpext_lane_c16_x2)))
18639svboolx2_t svpext_lane_c16_x2(svcount_t, uint64_t);
18640__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpfalse_c)))
18641svcount_t svpfalse_c(void);
18642__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c16)))
18643svcount_t svpsel_lane_c16(svcount_t, svbool_t, uint32_t);
18644__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c32)))
18645svcount_t svpsel_lane_c32(svcount_t, svbool_t, uint32_t);
18646__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c64)))
18647svcount_t svpsel_lane_c64(svcount_t, svbool_t, uint32_t);
18648__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpsel_lane_c8)))
18649svcount_t svpsel_lane_c8(svcount_t, svbool_t, uint32_t);
18650__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c8)))
18651svcount_t svptrue_c8(void);
18652__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c32)))
18653svcount_t svptrue_c32(void);
18654__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c64)))
18655svcount_t svptrue_c64(void);
18656__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svptrue_c16)))
18657svcount_t svptrue_c16(void);
18658__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_b)))
18659svbool_t svreinterpret_b(svcount_t);
18660__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_c)))
18661svcount_t svreinterpret_c(svbool_t);
18662__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x2)))
18663void svst1_u8_x2(svcount_t, uint8_t *, svuint8x2_t);
18664__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x2)))
18665void svst1_s8_x2(svcount_t, int8_t *, svint8x2_t);
18666__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x2)))
18667void svst1_mf8_x2(svcount_t, mfloat8_t *, svmfloat8x2_t);
18668__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x2)))
18669void svst1_u64_x2(svcount_t, uint64_t *, svuint64x2_t);
18670__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x2)))
18671void svst1_f64_x2(svcount_t, float64_t *, svfloat64x2_t);
18672__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x2)))
18673void svst1_s64_x2(svcount_t, int64_t *, svint64x2_t);
18674__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x2)))
18675void svst1_u16_x2(svcount_t, uint16_t *, svuint16x2_t);
18676__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x2)))
18677void svst1_bf16_x2(svcount_t, bfloat16_t *, svbfloat16x2_t);
18678__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x2)))
18679void svst1_f16_x2(svcount_t, float16_t *, svfloat16x2_t);
18680__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x2)))
18681void svst1_s16_x2(svcount_t, int16_t *, svint16x2_t);
18682__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x2)))
18683void svst1_u32_x2(svcount_t, uint32_t *, svuint32x2_t);
18684__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x2)))
18685void svst1_f32_x2(svcount_t, float32_t *, svfloat32x2_t);
18686__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x2)))
18687void svst1_s32_x2(svcount_t, int32_t *, svint32x2_t);
18688__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x4)))
18689void svst1_u8_x4(svcount_t, uint8_t *, svuint8x4_t);
18690__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x4)))
18691void svst1_s8_x4(svcount_t, int8_t *, svint8x4_t);
18692__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x4)))
18693void svst1_mf8_x4(svcount_t, mfloat8_t *, svmfloat8x4_t);
18694__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x4)))
18695void svst1_u64_x4(svcount_t, uint64_t *, svuint64x4_t);
18696__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x4)))
18697void svst1_f64_x4(svcount_t, float64_t *, svfloat64x4_t);
18698__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x4)))
18699void svst1_s64_x4(svcount_t, int64_t *, svint64x4_t);
18700__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x4)))
18701void svst1_u16_x4(svcount_t, uint16_t *, svuint16x4_t);
18702__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x4)))
18703void svst1_bf16_x4(svcount_t, bfloat16_t *, svbfloat16x4_t);
18704__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x4)))
18705void svst1_f16_x4(svcount_t, float16_t *, svfloat16x4_t);
18706__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x4)))
18707void svst1_s16_x4(svcount_t, int16_t *, svint16x4_t);
18708__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x4)))
18709void svst1_u32_x4(svcount_t, uint32_t *, svuint32x4_t);
18710__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x4)))
18711void svst1_f32_x4(svcount_t, float32_t *, svfloat32x4_t);
18712__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x4)))
18713void svst1_s32_x4(svcount_t, int32_t *, svint32x4_t);
18714__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x2)))
18715void svst1_vnum_u8_x2(svcount_t, uint8_t *, int64_t, svuint8x2_t);
18716__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x2)))
18717void svst1_vnum_s8_x2(svcount_t, int8_t *, int64_t, svint8x2_t);
18718__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x2)))
18719void svst1_vnum_mf8_x2(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
18720__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x2)))
18721void svst1_vnum_u64_x2(svcount_t, uint64_t *, int64_t, svuint64x2_t);
18722__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x2)))
18723void svst1_vnum_f64_x2(svcount_t, float64_t *, int64_t, svfloat64x2_t);
18724__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x2)))
18725void svst1_vnum_s64_x2(svcount_t, int64_t *, int64_t, svint64x2_t);
18726__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x2)))
18727void svst1_vnum_u16_x2(svcount_t, uint16_t *, int64_t, svuint16x2_t);
18728__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x2)))
18729void svst1_vnum_bf16_x2(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
18730__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x2)))
18731void svst1_vnum_f16_x2(svcount_t, float16_t *, int64_t, svfloat16x2_t);
18732__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x2)))
18733void svst1_vnum_s16_x2(svcount_t, int16_t *, int64_t, svint16x2_t);
18734__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x2)))
18735void svst1_vnum_u32_x2(svcount_t, uint32_t *, int64_t, svuint32x2_t);
18736__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x2)))
18737void svst1_vnum_f32_x2(svcount_t, float32_t *, int64_t, svfloat32x2_t);
18738__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x2)))
18739void svst1_vnum_s32_x2(svcount_t, int32_t *, int64_t, svint32x2_t);
18740__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x4)))
18741void svst1_vnum_u8_x4(svcount_t, uint8_t *, int64_t, svuint8x4_t);
18742__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x4)))
18743void svst1_vnum_s8_x4(svcount_t, int8_t *, int64_t, svint8x4_t);
18744__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x4)))
18745void svst1_vnum_mf8_x4(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
18746__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x4)))
18747void svst1_vnum_u64_x4(svcount_t, uint64_t *, int64_t, svuint64x4_t);
18748__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x4)))
18749void svst1_vnum_f64_x4(svcount_t, float64_t *, int64_t, svfloat64x4_t);
18750__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x4)))
18751void svst1_vnum_s64_x4(svcount_t, int64_t *, int64_t, svint64x4_t);
18752__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x4)))
18753void svst1_vnum_u16_x4(svcount_t, uint16_t *, int64_t, svuint16x4_t);
18754__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x4)))
18755void svst1_vnum_bf16_x4(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
18756__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x4)))
18757void svst1_vnum_f16_x4(svcount_t, float16_t *, int64_t, svfloat16x4_t);
18758__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x4)))
18759void svst1_vnum_s16_x4(svcount_t, int16_t *, int64_t, svint16x4_t);
18760__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x4)))
18761void svst1_vnum_u32_x4(svcount_t, uint32_t *, int64_t, svuint32x4_t);
18762__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x4)))
18763void svst1_vnum_f32_x4(svcount_t, float32_t *, int64_t, svfloat32x4_t);
18764__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x4)))
18765void svst1_vnum_s32_x4(svcount_t, int32_t *, int64_t, svint32x4_t);
18766__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x2)))
18767void svstnt1_u8_x2(svcount_t, uint8_t *, svuint8x2_t);
18768__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x2)))
18769void svstnt1_s8_x2(svcount_t, int8_t *, svint8x2_t);
18770__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x2)))
18771void svstnt1_mf8_x2(svcount_t, mfloat8_t *, svmfloat8x2_t);
18772__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x2)))
18773void svstnt1_u64_x2(svcount_t, uint64_t *, svuint64x2_t);
18774__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x2)))
18775void svstnt1_f64_x2(svcount_t, float64_t *, svfloat64x2_t);
18776__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x2)))
18777void svstnt1_s64_x2(svcount_t, int64_t *, svint64x2_t);
18778__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x2)))
18779void svstnt1_u16_x2(svcount_t, uint16_t *, svuint16x2_t);
18780__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x2)))
18781void svstnt1_bf16_x2(svcount_t, bfloat16_t *, svbfloat16x2_t);
18782__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x2)))
18783void svstnt1_f16_x2(svcount_t, float16_t *, svfloat16x2_t);
18784__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x2)))
18785void svstnt1_s16_x2(svcount_t, int16_t *, svint16x2_t);
18786__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x2)))
18787void svstnt1_u32_x2(svcount_t, uint32_t *, svuint32x2_t);
18788__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x2)))
18789void svstnt1_f32_x2(svcount_t, float32_t *, svfloat32x2_t);
18790__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x2)))
18791void svstnt1_s32_x2(svcount_t, int32_t *, svint32x2_t);
18792__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x4)))
18793void svstnt1_u8_x4(svcount_t, uint8_t *, svuint8x4_t);
18794__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x4)))
18795void svstnt1_s8_x4(svcount_t, int8_t *, svint8x4_t);
18796__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x4)))
18797void svstnt1_mf8_x4(svcount_t, mfloat8_t *, svmfloat8x4_t);
18798__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x4)))
18799void svstnt1_u64_x4(svcount_t, uint64_t *, svuint64x4_t);
18800__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x4)))
18801void svstnt1_f64_x4(svcount_t, float64_t *, svfloat64x4_t);
18802__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x4)))
18803void svstnt1_s64_x4(svcount_t, int64_t *, svint64x4_t);
18804__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x4)))
18805void svstnt1_u16_x4(svcount_t, uint16_t *, svuint16x4_t);
18806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x4)))
18807void svstnt1_bf16_x4(svcount_t, bfloat16_t *, svbfloat16x4_t);
18808__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x4)))
18809void svstnt1_f16_x4(svcount_t, float16_t *, svfloat16x4_t);
18810__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x4)))
18811void svstnt1_s16_x4(svcount_t, int16_t *, svint16x4_t);
18812__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x4)))
18813void svstnt1_u32_x4(svcount_t, uint32_t *, svuint32x4_t);
18814__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x4)))
18815void svstnt1_f32_x4(svcount_t, float32_t *, svfloat32x4_t);
18816__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x4)))
18817void svstnt1_s32_x4(svcount_t, int32_t *, svint32x4_t);
18818__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x2)))
18819void svstnt1_vnum_u8_x2(svcount_t, uint8_t *, int64_t, svuint8x2_t);
18820__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x2)))
18821void svstnt1_vnum_s8_x2(svcount_t, int8_t *, int64_t, svint8x2_t);
18822__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x2)))
18823void svstnt1_vnum_mf8_x2(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
18824__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x2)))
18825void svstnt1_vnum_u64_x2(svcount_t, uint64_t *, int64_t, svuint64x2_t);
18826__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x2)))
18827void svstnt1_vnum_f64_x2(svcount_t, float64_t *, int64_t, svfloat64x2_t);
18828__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x2)))
18829void svstnt1_vnum_s64_x2(svcount_t, int64_t *, int64_t, svint64x2_t);
18830__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x2)))
18831void svstnt1_vnum_u16_x2(svcount_t, uint16_t *, int64_t, svuint16x2_t);
18832__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x2)))
18833void svstnt1_vnum_bf16_x2(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
18834__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x2)))
18835void svstnt1_vnum_f16_x2(svcount_t, float16_t *, int64_t, svfloat16x2_t);
18836__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x2)))
18837void svstnt1_vnum_s16_x2(svcount_t, int16_t *, int64_t, svint16x2_t);
18838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x2)))
18839void svstnt1_vnum_u32_x2(svcount_t, uint32_t *, int64_t, svuint32x2_t);
18840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x2)))
18841void svstnt1_vnum_f32_x2(svcount_t, float32_t *, int64_t, svfloat32x2_t);
18842__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x2)))
18843void svstnt1_vnum_s32_x2(svcount_t, int32_t *, int64_t, svint32x2_t);
18844__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x4)))
18845void svstnt1_vnum_u8_x4(svcount_t, uint8_t *, int64_t, svuint8x4_t);
18846__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x4)))
18847void svstnt1_vnum_s8_x4(svcount_t, int8_t *, int64_t, svint8x4_t);
18848__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x4)))
18849void svstnt1_vnum_mf8_x4(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
18850__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x4)))
18851void svstnt1_vnum_u64_x4(svcount_t, uint64_t *, int64_t, svuint64x4_t);
18852__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x4)))
18853void svstnt1_vnum_f64_x4(svcount_t, float64_t *, int64_t, svfloat64x4_t);
18854__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x4)))
18855void svstnt1_vnum_s64_x4(svcount_t, int64_t *, int64_t, svint64x4_t);
18856__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x4)))
18857void svstnt1_vnum_u16_x4(svcount_t, uint16_t *, int64_t, svuint16x4_t);
18858__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x4)))
18859void svstnt1_vnum_bf16_x4(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
18860__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x4)))
18861void svstnt1_vnum_f16_x4(svcount_t, float16_t *, int64_t, svfloat16x4_t);
18862__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x4)))
18863void svstnt1_vnum_s16_x4(svcount_t, int16_t *, int64_t, svint16x4_t);
18864__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x4)))
18865void svstnt1_vnum_u32_x4(svcount_t, uint32_t *, int64_t, svuint32x4_t);
18866__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x4)))
18867void svstnt1_vnum_f32_x4(svcount_t, float32_t *, int64_t, svfloat32x4_t);
18868__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x4)))
18869void svstnt1_vnum_s32_x4(svcount_t, int32_t *, int64_t, svint32x4_t);
18870__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_s64)))
18871svcount_t svwhilege_c8_s64(int64_t, int64_t, uint64_t);
18872__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_s64)))
18873svcount_t svwhilege_c32_s64(int64_t, int64_t, uint64_t);
18874__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_s64)))
18875svcount_t svwhilege_c64_s64(int64_t, int64_t, uint64_t);
18876__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_s64)))
18877svcount_t svwhilege_c16_s64(int64_t, int64_t, uint64_t);
18878__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_u64)))
18879svcount_t svwhilege_c8_u64(uint64_t, uint64_t, uint64_t);
18880__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_u64)))
18881svcount_t svwhilege_c32_u64(uint64_t, uint64_t, uint64_t);
18882__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_u64)))
18883svcount_t svwhilege_c64_u64(uint64_t, uint64_t, uint64_t);
18884__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_u64)))
18885svcount_t svwhilege_c16_u64(uint64_t, uint64_t, uint64_t);
18886__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_s64)))
18887svcount_t svwhilegt_c8_s64(int64_t, int64_t, uint64_t);
18888__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_s64)))
18889svcount_t svwhilegt_c32_s64(int64_t, int64_t, uint64_t);
18890__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_s64)))
18891svcount_t svwhilegt_c64_s64(int64_t, int64_t, uint64_t);
18892__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_s64)))
18893svcount_t svwhilegt_c16_s64(int64_t, int64_t, uint64_t);
18894__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_u64)))
18895svcount_t svwhilegt_c8_u64(uint64_t, uint64_t, uint64_t);
18896__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_u64)))
18897svcount_t svwhilegt_c32_u64(uint64_t, uint64_t, uint64_t);
18898__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_u64)))
18899svcount_t svwhilegt_c64_u64(uint64_t, uint64_t, uint64_t);
18900__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_u64)))
18901svcount_t svwhilegt_c16_u64(uint64_t, uint64_t, uint64_t);
18902__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_s64)))
18903svcount_t svwhilele_c8_s64(int64_t, int64_t, uint64_t);
18904__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_s64)))
18905svcount_t svwhilele_c32_s64(int64_t, int64_t, uint64_t);
18906__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_s64)))
18907svcount_t svwhilele_c64_s64(int64_t, int64_t, uint64_t);
18908__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_s64)))
18909svcount_t svwhilele_c16_s64(int64_t, int64_t, uint64_t);
18910__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_u64)))
18911svcount_t svwhilele_c8_u64(uint64_t, uint64_t, uint64_t);
18912__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_u64)))
18913svcount_t svwhilele_c32_u64(uint64_t, uint64_t, uint64_t);
18914__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_u64)))
18915svcount_t svwhilele_c64_u64(uint64_t, uint64_t, uint64_t);
18916__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_u64)))
18917svcount_t svwhilele_c16_u64(uint64_t, uint64_t, uint64_t);
18918__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_u64)))
18919svcount_t svwhilelt_c8_u64(uint64_t, uint64_t, uint64_t);
18920__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_u64)))
18921svcount_t svwhilelt_c32_u64(uint64_t, uint64_t, uint64_t);
18922__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_u64)))
18923svcount_t svwhilelt_c64_u64(uint64_t, uint64_t, uint64_t);
18924__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_u64)))
18925svcount_t svwhilelt_c16_u64(uint64_t, uint64_t, uint64_t);
18926__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_s64)))
18927svcount_t svwhilelt_c8_s64(int64_t, int64_t, uint64_t);
18928__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_s64)))
18929svcount_t svwhilelt_c32_s64(int64_t, int64_t, uint64_t);
18930__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_s64)))
18931svcount_t svwhilelt_c64_s64(int64_t, int64_t, uint64_t);
18932__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_s64)))
18933svcount_t svwhilelt_c16_s64(int64_t, int64_t, uint64_t);
18934__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x2)))
18935svuint8x2_t svld1_x2(svcount_t, uint8_t const *);
18936__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x2)))
18937svint8x2_t svld1_x2(svcount_t, int8_t const *);
18938__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x2)))
18939svmfloat8x2_t svld1_x2(svcount_t, mfloat8_t const *);
18940__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x2)))
18941svuint64x2_t svld1_x2(svcount_t, uint64_t const *);
18942__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x2)))
18943svfloat64x2_t svld1_x2(svcount_t, float64_t const *);
18944__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x2)))
18945svint64x2_t svld1_x2(svcount_t, int64_t const *);
18946__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x2)))
18947svuint16x2_t svld1_x2(svcount_t, uint16_t const *);
18948__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x2)))
18949svbfloat16x2_t svld1_x2(svcount_t, bfloat16_t const *);
18950__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x2)))
18951svfloat16x2_t svld1_x2(svcount_t, float16_t const *);
18952__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x2)))
18953svint16x2_t svld1_x2(svcount_t, int16_t const *);
18954__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x2)))
18955svuint32x2_t svld1_x2(svcount_t, uint32_t const *);
18956__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x2)))
18957svfloat32x2_t svld1_x2(svcount_t, float32_t const *);
18958__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x2)))
18959svint32x2_t svld1_x2(svcount_t, int32_t const *);
18960__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u8_x4)))
18961svuint8x4_t svld1_x4(svcount_t, uint8_t const *);
18962__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s8_x4)))
18963svint8x4_t svld1_x4(svcount_t, int8_t const *);
18964__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_mf8_x4)))
18965svmfloat8x4_t svld1_x4(svcount_t, mfloat8_t const *);
18966__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u64_x4)))
18967svuint64x4_t svld1_x4(svcount_t, uint64_t const *);
18968__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f64_x4)))
18969svfloat64x4_t svld1_x4(svcount_t, float64_t const *);
18970__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s64_x4)))
18971svint64x4_t svld1_x4(svcount_t, int64_t const *);
18972__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u16_x4)))
18973svuint16x4_t svld1_x4(svcount_t, uint16_t const *);
18974__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_bf16_x4)))
18975svbfloat16x4_t svld1_x4(svcount_t, bfloat16_t const *);
18976__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f16_x4)))
18977svfloat16x4_t svld1_x4(svcount_t, float16_t const *);
18978__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s16_x4)))
18979svint16x4_t svld1_x4(svcount_t, int16_t const *);
18980__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_u32_x4)))
18981svuint32x4_t svld1_x4(svcount_t, uint32_t const *);
18982__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_f32_x4)))
18983svfloat32x4_t svld1_x4(svcount_t, float32_t const *);
18984__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_s32_x4)))
18985svint32x4_t svld1_x4(svcount_t, int32_t const *);
18986__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x2)))
18987svuint8x2_t svld1_vnum_x2(svcount_t, uint8_t const *, int64_t);
18988__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x2)))
18989svint8x2_t svld1_vnum_x2(svcount_t, int8_t const *, int64_t);
18990__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x2)))
18991svmfloat8x2_t svld1_vnum_x2(svcount_t, mfloat8_t const *, int64_t);
18992__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x2)))
18993svuint64x2_t svld1_vnum_x2(svcount_t, uint64_t const *, int64_t);
18994__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x2)))
18995svfloat64x2_t svld1_vnum_x2(svcount_t, float64_t const *, int64_t);
18996__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x2)))
18997svint64x2_t svld1_vnum_x2(svcount_t, int64_t const *, int64_t);
18998__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x2)))
18999svuint16x2_t svld1_vnum_x2(svcount_t, uint16_t const *, int64_t);
19000__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x2)))
19001svbfloat16x2_t svld1_vnum_x2(svcount_t, bfloat16_t const *, int64_t);
19002__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x2)))
19003svfloat16x2_t svld1_vnum_x2(svcount_t, float16_t const *, int64_t);
19004__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x2)))
19005svint16x2_t svld1_vnum_x2(svcount_t, int16_t const *, int64_t);
19006__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x2)))
19007svuint32x2_t svld1_vnum_x2(svcount_t, uint32_t const *, int64_t);
19008__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x2)))
19009svfloat32x2_t svld1_vnum_x2(svcount_t, float32_t const *, int64_t);
19010__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x2)))
19011svint32x2_t svld1_vnum_x2(svcount_t, int32_t const *, int64_t);
19012__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u8_x4)))
19013svuint8x4_t svld1_vnum_x4(svcount_t, uint8_t const *, int64_t);
19014__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s8_x4)))
19015svint8x4_t svld1_vnum_x4(svcount_t, int8_t const *, int64_t);
19016__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_mf8_x4)))
19017svmfloat8x4_t svld1_vnum_x4(svcount_t, mfloat8_t const *, int64_t);
19018__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u64_x4)))
19019svuint64x4_t svld1_vnum_x4(svcount_t, uint64_t const *, int64_t);
19020__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f64_x4)))
19021svfloat64x4_t svld1_vnum_x4(svcount_t, float64_t const *, int64_t);
19022__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s64_x4)))
19023svint64x4_t svld1_vnum_x4(svcount_t, int64_t const *, int64_t);
19024__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u16_x4)))
19025svuint16x4_t svld1_vnum_x4(svcount_t, uint16_t const *, int64_t);
19026__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_bf16_x4)))
19027svbfloat16x4_t svld1_vnum_x4(svcount_t, bfloat16_t const *, int64_t);
19028__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f16_x4)))
19029svfloat16x4_t svld1_vnum_x4(svcount_t, float16_t const *, int64_t);
19030__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s16_x4)))
19031svint16x4_t svld1_vnum_x4(svcount_t, int16_t const *, int64_t);
19032__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_u32_x4)))
19033svuint32x4_t svld1_vnum_x4(svcount_t, uint32_t const *, int64_t);
19034__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_f32_x4)))
19035svfloat32x4_t svld1_vnum_x4(svcount_t, float32_t const *, int64_t);
19036__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svld1_vnum_s32_x4)))
19037svint32x4_t svld1_vnum_x4(svcount_t, int32_t const *, int64_t);
19038__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x2)))
19039svuint8x2_t svldnt1_x2(svcount_t, uint8_t const *);
19040__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x2)))
19041svint8x2_t svldnt1_x2(svcount_t, int8_t const *);
19042__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x2)))
19043svmfloat8x2_t svldnt1_x2(svcount_t, mfloat8_t const *);
19044__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x2)))
19045svuint64x2_t svldnt1_x2(svcount_t, uint64_t const *);
19046__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x2)))
19047svfloat64x2_t svldnt1_x2(svcount_t, float64_t const *);
19048__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x2)))
19049svint64x2_t svldnt1_x2(svcount_t, int64_t const *);
19050__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x2)))
19051svuint16x2_t svldnt1_x2(svcount_t, uint16_t const *);
19052__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x2)))
19053svbfloat16x2_t svldnt1_x2(svcount_t, bfloat16_t const *);
19054__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x2)))
19055svfloat16x2_t svldnt1_x2(svcount_t, float16_t const *);
19056__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x2)))
19057svint16x2_t svldnt1_x2(svcount_t, int16_t const *);
19058__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x2)))
19059svuint32x2_t svldnt1_x2(svcount_t, uint32_t const *);
19060__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x2)))
19061svfloat32x2_t svldnt1_x2(svcount_t, float32_t const *);
19062__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x2)))
19063svint32x2_t svldnt1_x2(svcount_t, int32_t const *);
19064__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u8_x4)))
19065svuint8x4_t svldnt1_x4(svcount_t, uint8_t const *);
19066__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s8_x4)))
19067svint8x4_t svldnt1_x4(svcount_t, int8_t const *);
19068__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_mf8_x4)))
19069svmfloat8x4_t svldnt1_x4(svcount_t, mfloat8_t const *);
19070__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u64_x4)))
19071svuint64x4_t svldnt1_x4(svcount_t, uint64_t const *);
19072__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f64_x4)))
19073svfloat64x4_t svldnt1_x4(svcount_t, float64_t const *);
19074__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s64_x4)))
19075svint64x4_t svldnt1_x4(svcount_t, int64_t const *);
19076__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u16_x4)))
19077svuint16x4_t svldnt1_x4(svcount_t, uint16_t const *);
19078__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_bf16_x4)))
19079svbfloat16x4_t svldnt1_x4(svcount_t, bfloat16_t const *);
19080__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f16_x4)))
19081svfloat16x4_t svldnt1_x4(svcount_t, float16_t const *);
19082__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s16_x4)))
19083svint16x4_t svldnt1_x4(svcount_t, int16_t const *);
19084__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_u32_x4)))
19085svuint32x4_t svldnt1_x4(svcount_t, uint32_t const *);
19086__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_f32_x4)))
19087svfloat32x4_t svldnt1_x4(svcount_t, float32_t const *);
19088__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_s32_x4)))
19089svint32x4_t svldnt1_x4(svcount_t, int32_t const *);
19090__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x2)))
19091svuint8x2_t svldnt1_vnum_x2(svcount_t, uint8_t const *, int64_t);
19092__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x2)))
19093svint8x2_t svldnt1_vnum_x2(svcount_t, int8_t const *, int64_t);
19094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x2)))
19095svmfloat8x2_t svldnt1_vnum_x2(svcount_t, mfloat8_t const *, int64_t);
19096__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x2)))
19097svuint64x2_t svldnt1_vnum_x2(svcount_t, uint64_t const *, int64_t);
19098__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x2)))
19099svfloat64x2_t svldnt1_vnum_x2(svcount_t, float64_t const *, int64_t);
19100__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x2)))
19101svint64x2_t svldnt1_vnum_x2(svcount_t, int64_t const *, int64_t);
19102__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x2)))
19103svuint16x2_t svldnt1_vnum_x2(svcount_t, uint16_t const *, int64_t);
19104__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x2)))
19105svbfloat16x2_t svldnt1_vnum_x2(svcount_t, bfloat16_t const *, int64_t);
19106__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x2)))
19107svfloat16x2_t svldnt1_vnum_x2(svcount_t, float16_t const *, int64_t);
19108__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x2)))
19109svint16x2_t svldnt1_vnum_x2(svcount_t, int16_t const *, int64_t);
19110__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x2)))
19111svuint32x2_t svldnt1_vnum_x2(svcount_t, uint32_t const *, int64_t);
19112__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x2)))
19113svfloat32x2_t svldnt1_vnum_x2(svcount_t, float32_t const *, int64_t);
19114__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x2)))
19115svint32x2_t svldnt1_vnum_x2(svcount_t, int32_t const *, int64_t);
19116__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u8_x4)))
19117svuint8x4_t svldnt1_vnum_x4(svcount_t, uint8_t const *, int64_t);
19118__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s8_x4)))
19119svint8x4_t svldnt1_vnum_x4(svcount_t, int8_t const *, int64_t);
19120__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_mf8_x4)))
19121svmfloat8x4_t svldnt1_vnum_x4(svcount_t, mfloat8_t const *, int64_t);
19122__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u64_x4)))
19123svuint64x4_t svldnt1_vnum_x4(svcount_t, uint64_t const *, int64_t);
19124__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f64_x4)))
19125svfloat64x4_t svldnt1_vnum_x4(svcount_t, float64_t const *, int64_t);
19126__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s64_x4)))
19127svint64x4_t svldnt1_vnum_x4(svcount_t, int64_t const *, int64_t);
19128__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u16_x4)))
19129svuint16x4_t svldnt1_vnum_x4(svcount_t, uint16_t const *, int64_t);
19130__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_bf16_x4)))
19131svbfloat16x4_t svldnt1_vnum_x4(svcount_t, bfloat16_t const *, int64_t);
19132__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f16_x4)))
19133svfloat16x4_t svldnt1_vnum_x4(svcount_t, float16_t const *, int64_t);
19134__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s16_x4)))
19135svint16x4_t svldnt1_vnum_x4(svcount_t, int16_t const *, int64_t);
19136__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_u32_x4)))
19137svuint32x4_t svldnt1_vnum_x4(svcount_t, uint32_t const *, int64_t);
19138__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_f32_x4)))
19139svfloat32x4_t svldnt1_vnum_x4(svcount_t, float32_t const *, int64_t);
19140__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svldnt1_vnum_s32_x4)))
19141svint32x4_t svldnt1_vnum_x4(svcount_t, int32_t const *, int64_t);
19142__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_b)))
19143svbool_t svreinterpret(svcount_t);
19144__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svreinterpret_c)))
19145svcount_t svreinterpret(svbool_t);
19146__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x2)))
19147void svst1(svcount_t, uint8_t *, svuint8x2_t);
19148__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x2)))
19149void svst1(svcount_t, int8_t *, svint8x2_t);
19150__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x2)))
19151void svst1(svcount_t, mfloat8_t *, svmfloat8x2_t);
19152__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x2)))
19153void svst1(svcount_t, uint64_t *, svuint64x2_t);
19154__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x2)))
19155void svst1(svcount_t, float64_t *, svfloat64x2_t);
19156__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x2)))
19157void svst1(svcount_t, int64_t *, svint64x2_t);
19158__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x2)))
19159void svst1(svcount_t, uint16_t *, svuint16x2_t);
19160__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x2)))
19161void svst1(svcount_t, bfloat16_t *, svbfloat16x2_t);
19162__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x2)))
19163void svst1(svcount_t, float16_t *, svfloat16x2_t);
19164__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x2)))
19165void svst1(svcount_t, int16_t *, svint16x2_t);
19166__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x2)))
19167void svst1(svcount_t, uint32_t *, svuint32x2_t);
19168__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x2)))
19169void svst1(svcount_t, float32_t *, svfloat32x2_t);
19170__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x2)))
19171void svst1(svcount_t, int32_t *, svint32x2_t);
19172__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u8_x4)))
19173void svst1(svcount_t, uint8_t *, svuint8x4_t);
19174__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s8_x4)))
19175void svst1(svcount_t, int8_t *, svint8x4_t);
19176__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_mf8_x4)))
19177void svst1(svcount_t, mfloat8_t *, svmfloat8x4_t);
19178__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u64_x4)))
19179void svst1(svcount_t, uint64_t *, svuint64x4_t);
19180__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f64_x4)))
19181void svst1(svcount_t, float64_t *, svfloat64x4_t);
19182__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s64_x4)))
19183void svst1(svcount_t, int64_t *, svint64x4_t);
19184__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u16_x4)))
19185void svst1(svcount_t, uint16_t *, svuint16x4_t);
19186__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_bf16_x4)))
19187void svst1(svcount_t, bfloat16_t *, svbfloat16x4_t);
19188__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f16_x4)))
19189void svst1(svcount_t, float16_t *, svfloat16x4_t);
19190__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s16_x4)))
19191void svst1(svcount_t, int16_t *, svint16x4_t);
19192__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_u32_x4)))
19193void svst1(svcount_t, uint32_t *, svuint32x4_t);
19194__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_f32_x4)))
19195void svst1(svcount_t, float32_t *, svfloat32x4_t);
19196__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_s32_x4)))
19197void svst1(svcount_t, int32_t *, svint32x4_t);
19198__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x2)))
19199void svst1_vnum(svcount_t, uint8_t *, int64_t, svuint8x2_t);
19200__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x2)))
19201void svst1_vnum(svcount_t, int8_t *, int64_t, svint8x2_t);
19202__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x2)))
19203void svst1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
19204__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x2)))
19205void svst1_vnum(svcount_t, uint64_t *, int64_t, svuint64x2_t);
19206__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x2)))
19207void svst1_vnum(svcount_t, float64_t *, int64_t, svfloat64x2_t);
19208__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x2)))
19209void svst1_vnum(svcount_t, int64_t *, int64_t, svint64x2_t);
19210__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x2)))
19211void svst1_vnum(svcount_t, uint16_t *, int64_t, svuint16x2_t);
19212__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x2)))
19213void svst1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
19214__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x2)))
19215void svst1_vnum(svcount_t, float16_t *, int64_t, svfloat16x2_t);
19216__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x2)))
19217void svst1_vnum(svcount_t, int16_t *, int64_t, svint16x2_t);
19218__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x2)))
19219void svst1_vnum(svcount_t, uint32_t *, int64_t, svuint32x2_t);
19220__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x2)))
19221void svst1_vnum(svcount_t, float32_t *, int64_t, svfloat32x2_t);
19222__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x2)))
19223void svst1_vnum(svcount_t, int32_t *, int64_t, svint32x2_t);
19224__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u8_x4)))
19225void svst1_vnum(svcount_t, uint8_t *, int64_t, svuint8x4_t);
19226__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s8_x4)))
19227void svst1_vnum(svcount_t, int8_t *, int64_t, svint8x4_t);
19228__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_mf8_x4)))
19229void svst1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
19230__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u64_x4)))
19231void svst1_vnum(svcount_t, uint64_t *, int64_t, svuint64x4_t);
19232__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f64_x4)))
19233void svst1_vnum(svcount_t, float64_t *, int64_t, svfloat64x4_t);
19234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s64_x4)))
19235void svst1_vnum(svcount_t, int64_t *, int64_t, svint64x4_t);
19236__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u16_x4)))
19237void svst1_vnum(svcount_t, uint16_t *, int64_t, svuint16x4_t);
19238__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_bf16_x4)))
19239void svst1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
19240__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f16_x4)))
19241void svst1_vnum(svcount_t, float16_t *, int64_t, svfloat16x4_t);
19242__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s16_x4)))
19243void svst1_vnum(svcount_t, int16_t *, int64_t, svint16x4_t);
19244__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_u32_x4)))
19245void svst1_vnum(svcount_t, uint32_t *, int64_t, svuint32x4_t);
19246__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_f32_x4)))
19247void svst1_vnum(svcount_t, float32_t *, int64_t, svfloat32x4_t);
19248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svst1_vnum_s32_x4)))
19249void svst1_vnum(svcount_t, int32_t *, int64_t, svint32x4_t);
19250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x2)))
19251void svstnt1(svcount_t, uint8_t *, svuint8x2_t);
19252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x2)))
19253void svstnt1(svcount_t, int8_t *, svint8x2_t);
19254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x2)))
19255void svstnt1(svcount_t, mfloat8_t *, svmfloat8x2_t);
19256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x2)))
19257void svstnt1(svcount_t, uint64_t *, svuint64x2_t);
19258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x2)))
19259void svstnt1(svcount_t, float64_t *, svfloat64x2_t);
19260__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x2)))
19261void svstnt1(svcount_t, int64_t *, svint64x2_t);
19262__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x2)))
19263void svstnt1(svcount_t, uint16_t *, svuint16x2_t);
19264__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x2)))
19265void svstnt1(svcount_t, bfloat16_t *, svbfloat16x2_t);
19266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x2)))
19267void svstnt1(svcount_t, float16_t *, svfloat16x2_t);
19268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x2)))
19269void svstnt1(svcount_t, int16_t *, svint16x2_t);
19270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x2)))
19271void svstnt1(svcount_t, uint32_t *, svuint32x2_t);
19272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x2)))
19273void svstnt1(svcount_t, float32_t *, svfloat32x2_t);
19274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x2)))
19275void svstnt1(svcount_t, int32_t *, svint32x2_t);
19276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u8_x4)))
19277void svstnt1(svcount_t, uint8_t *, svuint8x4_t);
19278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s8_x4)))
19279void svstnt1(svcount_t, int8_t *, svint8x4_t);
19280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_mf8_x4)))
19281void svstnt1(svcount_t, mfloat8_t *, svmfloat8x4_t);
19282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u64_x4)))
19283void svstnt1(svcount_t, uint64_t *, svuint64x4_t);
19284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f64_x4)))
19285void svstnt1(svcount_t, float64_t *, svfloat64x4_t);
19286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s64_x4)))
19287void svstnt1(svcount_t, int64_t *, svint64x4_t);
19288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u16_x4)))
19289void svstnt1(svcount_t, uint16_t *, svuint16x4_t);
19290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_bf16_x4)))
19291void svstnt1(svcount_t, bfloat16_t *, svbfloat16x4_t);
19292__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f16_x4)))
19293void svstnt1(svcount_t, float16_t *, svfloat16x4_t);
19294__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s16_x4)))
19295void svstnt1(svcount_t, int16_t *, svint16x4_t);
19296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_u32_x4)))
19297void svstnt1(svcount_t, uint32_t *, svuint32x4_t);
19298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_f32_x4)))
19299void svstnt1(svcount_t, float32_t *, svfloat32x4_t);
19300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_s32_x4)))
19301void svstnt1(svcount_t, int32_t *, svint32x4_t);
19302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x2)))
19303void svstnt1_vnum(svcount_t, uint8_t *, int64_t, svuint8x2_t);
19304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x2)))
19305void svstnt1_vnum(svcount_t, int8_t *, int64_t, svint8x2_t);
19306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x2)))
19307void svstnt1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x2_t);
19308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x2)))
19309void svstnt1_vnum(svcount_t, uint64_t *, int64_t, svuint64x2_t);
19310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x2)))
19311void svstnt1_vnum(svcount_t, float64_t *, int64_t, svfloat64x2_t);
19312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x2)))
19313void svstnt1_vnum(svcount_t, int64_t *, int64_t, svint64x2_t);
19314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x2)))
19315void svstnt1_vnum(svcount_t, uint16_t *, int64_t, svuint16x2_t);
19316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x2)))
19317void svstnt1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x2_t);
19318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x2)))
19319void svstnt1_vnum(svcount_t, float16_t *, int64_t, svfloat16x2_t);
19320__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x2)))
19321void svstnt1_vnum(svcount_t, int16_t *, int64_t, svint16x2_t);
19322__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x2)))
19323void svstnt1_vnum(svcount_t, uint32_t *, int64_t, svuint32x2_t);
19324__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x2)))
19325void svstnt1_vnum(svcount_t, float32_t *, int64_t, svfloat32x2_t);
19326__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x2)))
19327void svstnt1_vnum(svcount_t, int32_t *, int64_t, svint32x2_t);
19328__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u8_x4)))
19329void svstnt1_vnum(svcount_t, uint8_t *, int64_t, svuint8x4_t);
19330__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s8_x4)))
19331void svstnt1_vnum(svcount_t, int8_t *, int64_t, svint8x4_t);
19332__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_mf8_x4)))
19333void svstnt1_vnum(svcount_t, mfloat8_t *, int64_t, svmfloat8x4_t);
19334__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u64_x4)))
19335void svstnt1_vnum(svcount_t, uint64_t *, int64_t, svuint64x4_t);
19336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f64_x4)))
19337void svstnt1_vnum(svcount_t, float64_t *, int64_t, svfloat64x4_t);
19338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s64_x4)))
19339void svstnt1_vnum(svcount_t, int64_t *, int64_t, svint64x4_t);
19340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u16_x4)))
19341void svstnt1_vnum(svcount_t, uint16_t *, int64_t, svuint16x4_t);
19342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_bf16_x4)))
19343void svstnt1_vnum(svcount_t, bfloat16_t *, int64_t, svbfloat16x4_t);
19344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f16_x4)))
19345void svstnt1_vnum(svcount_t, float16_t *, int64_t, svfloat16x4_t);
19346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s16_x4)))
19347void svstnt1_vnum(svcount_t, int16_t *, int64_t, svint16x4_t);
19348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_u32_x4)))
19349void svstnt1_vnum(svcount_t, uint32_t *, int64_t, svuint32x4_t);
19350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_f32_x4)))
19351void svstnt1_vnum(svcount_t, float32_t *, int64_t, svfloat32x4_t);
19352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svstnt1_vnum_s32_x4)))
19353void svstnt1_vnum(svcount_t, int32_t *, int64_t, svint32x4_t);
19354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_s64)))
19355svcount_t svwhilege_c8(int64_t, int64_t, uint64_t);
19356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_s64)))
19357svcount_t svwhilege_c32(int64_t, int64_t, uint64_t);
19358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_s64)))
19359svcount_t svwhilege_c64(int64_t, int64_t, uint64_t);
19360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_s64)))
19361svcount_t svwhilege_c16(int64_t, int64_t, uint64_t);
19362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c8_u64)))
19363svcount_t svwhilege_c8(uint64_t, uint64_t, uint64_t);
19364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c32_u64)))
19365svcount_t svwhilege_c32(uint64_t, uint64_t, uint64_t);
19366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c64_u64)))
19367svcount_t svwhilege_c64(uint64_t, uint64_t, uint64_t);
19368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilege_c16_u64)))
19369svcount_t svwhilege_c16(uint64_t, uint64_t, uint64_t);
19370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_s64)))
19371svcount_t svwhilegt_c8(int64_t, int64_t, uint64_t);
19372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_s64)))
19373svcount_t svwhilegt_c32(int64_t, int64_t, uint64_t);
19374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_s64)))
19375svcount_t svwhilegt_c64(int64_t, int64_t, uint64_t);
19376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_s64)))
19377svcount_t svwhilegt_c16(int64_t, int64_t, uint64_t);
19378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c8_u64)))
19379svcount_t svwhilegt_c8(uint64_t, uint64_t, uint64_t);
19380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c32_u64)))
19381svcount_t svwhilegt_c32(uint64_t, uint64_t, uint64_t);
19382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c64_u64)))
19383svcount_t svwhilegt_c64(uint64_t, uint64_t, uint64_t);
19384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilegt_c16_u64)))
19385svcount_t svwhilegt_c16(uint64_t, uint64_t, uint64_t);
19386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_s64)))
19387svcount_t svwhilele_c8(int64_t, int64_t, uint64_t);
19388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_s64)))
19389svcount_t svwhilele_c32(int64_t, int64_t, uint64_t);
19390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_s64)))
19391svcount_t svwhilele_c64(int64_t, int64_t, uint64_t);
19392__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_s64)))
19393svcount_t svwhilele_c16(int64_t, int64_t, uint64_t);
19394__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c8_u64)))
19395svcount_t svwhilele_c8(uint64_t, uint64_t, uint64_t);
19396__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c32_u64)))
19397svcount_t svwhilele_c32(uint64_t, uint64_t, uint64_t);
19398__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c64_u64)))
19399svcount_t svwhilele_c64(uint64_t, uint64_t, uint64_t);
19400__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilele_c16_u64)))
19401svcount_t svwhilele_c16(uint64_t, uint64_t, uint64_t);
19402__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_u64)))
19403svcount_t svwhilelt_c8(uint64_t, uint64_t, uint64_t);
19404__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_u64)))
19405svcount_t svwhilelt_c32(uint64_t, uint64_t, uint64_t);
19406__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_u64)))
19407svcount_t svwhilelt_c64(uint64_t, uint64_t, uint64_t);
19408__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_u64)))
19409svcount_t svwhilelt_c16(uint64_t, uint64_t, uint64_t);
19410__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c8_s64)))
19411svcount_t svwhilelt_c8(int64_t, int64_t, uint64_t);
19412__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c32_s64)))
19413svcount_t svwhilelt_c32(int64_t, int64_t, uint64_t);
19414__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_s64)))
19415svcount_t svwhilelt_c64(int64_t, int64_t, uint64_t);
19416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_s64)))
19417svcount_t svwhilelt_c16(int64_t, int64_t, uint64_t);
19062__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f64_m)))19418__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f64_m)))
19063svfloat64_t svabd_n_f64_m(svbool_t, svfloat64_t, float64_t);19419svfloat64_t svabd_n_f64_m(svbool_t, svfloat64_t, float64_t);
19064__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f32_m)))19420__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f32_m)))
...@@ -31877,6 +32233,30 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpa_f32)))...@@ -31877,6 +32233,30 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpa_f32)))
31877svfloat32_t svexpa(svuint32_t);32233svfloat32_t svexpa(svuint32_t);
31878__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpa_f16)))32234__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpa_f16)))
31879svfloat16_t svexpa(svuint16_t);32235svfloat16_t svexpa(svuint16_t);
32236__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u32)))
32237svuint32_t svcompact_u32(svbool_t, svuint32_t);
32238__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u64)))
32239svuint64_t svcompact_u64(svbool_t, svuint64_t);
32240__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f64)))
32241svfloat64_t svcompact_f64(svbool_t, svfloat64_t);
32242__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f32)))
32243svfloat32_t svcompact_f32(svbool_t, svfloat32_t);
32244__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s32)))
32245svint32_t svcompact_s32(svbool_t, svint32_t);
32246__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s64)))
32247svint64_t svcompact_s64(svbool_t, svint64_t);
32248__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u32)))
32249svuint32_t svcompact(svbool_t, svuint32_t);
32250__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_u64)))
32251svuint64_t svcompact(svbool_t, svuint64_t);
32252__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f64)))
32253svfloat64_t svcompact(svbool_t, svfloat64_t);
32254__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_f32)))
32255svfloat32_t svcompact(svbool_t, svfloat32_t);
32256__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s32)))
32257svint32_t svcompact(svbool_t, svint32_t);
32258__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcompact_s64)))
32259svint64_t svcompact(svbool_t, svint64_t);
31880#define svcvtnt_bf16_x svcvtnt_bf16_m32260#define svcvtnt_bf16_x svcvtnt_bf16_m
31881#define svcvtnt_bf16_f32_x svcvtnt_bf16_f32_m32261#define svcvtnt_bf16_f32_x svcvtnt_bf16_f32_m
31882#define svcvtnt_f16_x svcvtnt_f16_m32262#define svcvtnt_f16_x svcvtnt_f16_m
lib/include/avx10_2_512bf16intrin.h+19-12
...@@ -21,9 +21,15 @@ typedef __bf16 __m512bh_u __attribute__((__vector_size__(64), __aligned__(1)));...@@ -21,9 +21,15 @@ typedef __bf16 __m512bh_u __attribute__((__vector_size__(64), __aligned__(1)));
2121
22/* Define the default attributes for the functions in this file. */22/* Define the default attributes for the functions in this file. */
23#define __DEFAULT_FN_ATTRS512 \23#define __DEFAULT_FN_ATTRS512 \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-512"), \24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
25 __min_vector_width__(512)))25 __min_vector_width__(512)))
2626
27#if defined(__cplusplus) && (__cplusplus >= 201103L)
28#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
29#else
30#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
31#endif
32
27static __inline __m512bh __DEFAULT_FN_ATTRS512 _mm512_setzero_pbh(void) {33static __inline __m512bh __DEFAULT_FN_ATTRS512 _mm512_setzero_pbh(void) {
28 return __builtin_bit_cast(__m512bh, _mm512_setzero_ps());34 return __builtin_bit_cast(__m512bh, _mm512_setzero_ps());
29}35}
...@@ -167,13 +173,13 @@ _mm512_mask_blend_pbh(__mmask32 __U, __m512bh __A, __m512bh __W) {...@@ -167,13 +173,13 @@ _mm512_mask_blend_pbh(__mmask32 __U, __m512bh __A, __m512bh __W) {
167 (__v32bf)__A);173 (__v32bf)__A);
168}174}
169175
170static __inline__ __m512bh __DEFAULT_FN_ATTRS512176static __inline__ __m512bh __DEFAULT_FN_ATTRS512_CONSTEXPR
171_mm512_permutex2var_pbh(__m512bh __A, __m512i __I, __m512bh __B) {177_mm512_permutex2var_pbh(__m512bh __A, __m512i __I, __m512bh __B) {
172 return (__m512bh)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,178 return (__m512bh)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,
173 (__v32hi)__B);179 (__v32hi)__B);
174}180}
175181
176static __inline__ __m512bh __DEFAULT_FN_ATTRS512182static __inline__ __m512bh __DEFAULT_FN_ATTRS512_CONSTEXPR
177_mm512_permutexvar_pbh(__m512i __A, __m512bh __B) {183_mm512_permutexvar_pbh(__m512i __A, __m512bh __B) {
178 return (__m512bh)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A);184 return (__m512bh)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A);
179}185}
...@@ -423,7 +429,7 @@ _mm512_maskz_rsqrt_pbh(__mmask32 __U, __m512bh __A) {...@@ -423,7 +429,7 @@ _mm512_maskz_rsqrt_pbh(__mmask32 __U, __m512bh __A) {
423 (__v32bf)_mm512_setzero_pbh(), (__mmask32)(__U)))429 (__v32bf)_mm512_setzero_pbh(), (__mmask32)(__U)))
424430
425static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_sqrt_pbh(__m512bh __A) {431static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_sqrt_pbh(__m512bh __A) {
426 return (__m512bh)__builtin_ia32_vsqrtbf16512((__v32bf)__A);432 return __builtin_elementwise_sqrt(__A);
427}433}
428434
429static __inline__ __m512bh __DEFAULT_FN_ATTRS512435static __inline__ __m512bh __DEFAULT_FN_ATTRS512
...@@ -441,8 +447,8 @@ _mm512_maskz_sqrt_pbh(__mmask32 __U, __m512bh __A) {...@@ -441,8 +447,8 @@ _mm512_maskz_sqrt_pbh(__mmask32 __U, __m512bh __A) {
441447
442static __inline__ __m512bh __DEFAULT_FN_ATTRS512448static __inline__ __m512bh __DEFAULT_FN_ATTRS512
443_mm512_fmadd_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {449_mm512_fmadd_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {
444 return (__m512bh)__builtin_ia32_vfmaddbf16512((__v32bf)__A, (__v32bf)__B,450 return (__m512bh)__builtin_elementwise_fma((__v32bf)__A, (__v32bf)__B,
445 (__v32bf)__C);451 (__v32bf)__C);
446}452}
447453
448static __inline__ __m512bh __DEFAULT_FN_ATTRS512454static __inline__ __m512bh __DEFAULT_FN_ATTRS512
...@@ -469,8 +475,8 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fmadd_pbh(...@@ -469,8 +475,8 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fmadd_pbh(
469475
470static __inline__ __m512bh __DEFAULT_FN_ATTRS512476static __inline__ __m512bh __DEFAULT_FN_ATTRS512
471_mm512_fmsub_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {477_mm512_fmsub_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {
472 return (__m512bh)__builtin_ia32_vfmaddbf16512((__v32bf)__A, (__v32bf)__B,478 return (__m512bh)__builtin_elementwise_fma((__v32bf)__A, (__v32bf)__B,
473 -(__v32bf)__C);479 -(__v32bf)__C);
474}480}
475481
476static __inline__ __m512bh __DEFAULT_FN_ATTRS512482static __inline__ __m512bh __DEFAULT_FN_ATTRS512
...@@ -497,8 +503,8 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fmsub_pbh(...@@ -497,8 +503,8 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fmsub_pbh(
497503
498static __inline__ __m512bh __DEFAULT_FN_ATTRS512504static __inline__ __m512bh __DEFAULT_FN_ATTRS512
499_mm512_fnmadd_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {505_mm512_fnmadd_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {
500 return (__m512bh)__builtin_ia32_vfmaddbf16512((__v32bf)__A, -(__v32bf)__B,506 return (__m512bh)__builtin_elementwise_fma((__v32bf)__A, -(__v32bf)__B,
501 (__v32bf)__C);507 (__v32bf)__C);
502}508}
503509
504static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_mask_fnmadd_pbh(510static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_mask_fnmadd_pbh(
...@@ -527,8 +533,8 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fnmadd_pbh(...@@ -527,8 +533,8 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fnmadd_pbh(
527533
528static __inline__ __m512bh __DEFAULT_FN_ATTRS512534static __inline__ __m512bh __DEFAULT_FN_ATTRS512
529_mm512_fnmsub_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {535_mm512_fnmsub_pbh(__m512bh __A, __m512bh __B, __m512bh __C) {
530 return (__m512bh)__builtin_ia32_vfmaddbf16512((__v32bf)__A, -(__v32bf)__B,536 return (__m512bh)__builtin_elementwise_fma((__v32bf)__A, -(__v32bf)__B,
531 -(__v32bf)__C);537 -(__v32bf)__C);
532}538}
533539
534static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_mask_fnmsub_pbh(540static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_mask_fnmsub_pbh(
...@@ -555,6 +561,7 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fnmsub_pbh(...@@ -555,6 +561,7 @@ static __inline__ __m512bh __DEFAULT_FN_ATTRS512 _mm512_maskz_fnmsub_pbh(
555 (__v32bf)_mm512_setzero_pbh());561 (__v32bf)_mm512_setzero_pbh());
556}562}
557563
564#undef __DEFAULT_FN_ATTRS512_CONSTEXPR
558#undef __DEFAULT_FN_ATTRS512565#undef __DEFAULT_FN_ATTRS512
559566
560#endif567#endif
lib/include/avx10_2_512convertintrin.h+1-1
...@@ -18,7 +18,7 @@...@@ -18,7 +18,7 @@
1818
19/* Define the default attributes for the functions in this file. */19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS512 \20#define __DEFAULT_FN_ATTRS512 \
21 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-512"), \21 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
22 __min_vector_width__(512)))22 __min_vector_width__(512)))
2323
24static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_cvtx2ps_ph(__m512 __A,24static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_cvtx2ps_ph(__m512 __A,
lib/include/avx10_2_512niintrin.h+31-31
...@@ -17,7 +17,7 @@...@@ -17,7 +17,7 @@
17#define __AVX10_2_512NIINTRIN_H17#define __AVX10_2_512NIINTRIN_H
1818
19#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-512"), \20 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
21 __min_vector_width__(512)))21 __min_vector_width__(512)))
2222
23/* VNNI FP16 */23/* VNNI FP16 */
...@@ -64,8 +64,8 @@ static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_dpph_ps(__mmask16 __U,...@@ -64,8 +64,8 @@ static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_dpph_ps(__mmask16 __U,
64static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbssd_epi32(__m512i __W,64static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbssd_epi32(__m512i __W,
65 __m512i __A,65 __m512i __A,
66 __m512i __B) {66 __m512i __B) {
67 return (__m512i)__builtin_ia32_vpdpbssd512((__v16si)__W, (__v16si)__A,67 return (__m512i)__builtin_ia32_vpdpbssd512((__v16si)__W, (__v64qi)__A,
68 (__v16si)__B);68 (__v64qi)__B);
69}69}
7070
71static __inline__ __m512i __DEFAULT_FN_ATTRS71static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -84,8 +84,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbssd_epi32(...@@ -84,8 +84,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbssd_epi32(
84static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbssds_epi32(__m512i __W,84static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbssds_epi32(__m512i __W,
85 __m512i __A,85 __m512i __A,
86 __m512i __B) {86 __m512i __B) {
87 return (__m512i)__builtin_ia32_vpdpbssds512((__v16si)__W, (__v16si)__A,87 return (__m512i)__builtin_ia32_vpdpbssds512((__v16si)__W, (__v64qi)__A,
88 (__v16si)__B);88 (__v64qi)__B);
89}89}
9090
91static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbssds_epi32(91static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbssds_epi32(
...@@ -104,8 +104,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbssds_epi32(...@@ -104,8 +104,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbssds_epi32(
104static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbsud_epi32(__m512i __W,104static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbsud_epi32(__m512i __W,
105 __m512i __A,105 __m512i __A,
106 __m512i __B) {106 __m512i __B) {
107 return (__m512i)__builtin_ia32_vpdpbsud512((__v16si)__W, (__v16si)__A,107 return (__m512i)__builtin_ia32_vpdpbsud512((__v16si)__W, (__v64qi)__A,
108 (__v16si)__B);108 (__v64qu)__B);
109}109}
110110
111static __inline__ __m512i __DEFAULT_FN_ATTRS111static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -124,8 +124,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbsud_epi32(...@@ -124,8 +124,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbsud_epi32(
124static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbsuds_epi32(__m512i __W,124static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbsuds_epi32(__m512i __W,
125 __m512i __A,125 __m512i __A,
126 __m512i __B) {126 __m512i __B) {
127 return (__m512i)__builtin_ia32_vpdpbsuds512((__v16si)__W, (__v16si)__A,127 return (__m512i)__builtin_ia32_vpdpbsuds512((__v16si)__W, (__v64qi)__A,
128 (__v16si)__B);128 (__v64qu)__B);
129}129}
130130
131static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbsuds_epi32(131static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbsuds_epi32(
...@@ -144,8 +144,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbsuds_epi32(...@@ -144,8 +144,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbsuds_epi32(
144static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbuud_epi32(__m512i __W,144static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbuud_epi32(__m512i __W,
145 __m512i __A,145 __m512i __A,
146 __m512i __B) {146 __m512i __B) {
147 return (__m512i)__builtin_ia32_vpdpbuud512((__v16si)__W, (__v16si)__A,147 return (__m512i)__builtin_ia32_vpdpbuud512((__v16si)__W, (__v64qu)__A,
148 (__v16si)__B);148 (__v64qu)__B);
149}149}
150150
151static __inline__ __m512i __DEFAULT_FN_ATTRS151static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -164,8 +164,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbuud_epi32(...@@ -164,8 +164,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbuud_epi32(
164static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbuuds_epi32(__m512i __W,164static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbuuds_epi32(__m512i __W,
165 __m512i __A,165 __m512i __A,
166 __m512i __B) {166 __m512i __B) {
167 return (__m512i)__builtin_ia32_vpdpbuuds512((__v16si)__W, (__v16si)__A,167 return (__m512i)__builtin_ia32_vpdpbuuds512((__v16si)__W, (__v64qu)__A,
168 (__v16si)__B);168 (__v64qu)__B);
169}169}
170170
171static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbuuds_epi32(171static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbuuds_epi32(
...@@ -185,8 +185,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbuuds_epi32(...@@ -185,8 +185,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbuuds_epi32(
185static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwsud_epi32(__m512i __A,185static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwsud_epi32(__m512i __A,
186 __m512i __B,186 __m512i __B,
187 __m512i __C) {187 __m512i __C) {
188 return (__m512i)__builtin_ia32_vpdpwsud512((__v16si)__A, (__v16si)__B,188 return (__m512i)__builtin_ia32_vpdpwsud512((__v16si)__A, (__v32hi)__B,
189 (__v16si)__C);189 (__v32hu)__C);
190}190}
191191
192static __inline__ __m512i __DEFAULT_FN_ATTRS192static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -197,7 +197,7 @@ _mm512_mask_dpwsud_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {...@@ -197,7 +197,7 @@ _mm512_mask_dpwsud_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
197}197}
198198
199static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsud_epi32(199static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsud_epi32(
200 __m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {200 __mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
201 return (__m512i)__builtin_ia32_selectd_512(201 return (__m512i)__builtin_ia32_selectd_512(
202 (__mmask16)__U, (__v16si)_mm512_dpwsud_epi32(__A, __B, __C),202 (__mmask16)__U, (__v16si)_mm512_dpwsud_epi32(__A, __B, __C),
203 (__v16si)_mm512_setzero_si512());203 (__v16si)_mm512_setzero_si512());
...@@ -206,8 +206,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsud_epi32(...@@ -206,8 +206,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsud_epi32(
206static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwsuds_epi32(__m512i __A,206static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwsuds_epi32(__m512i __A,
207 __m512i __B,207 __m512i __B,
208 __m512i __C) {208 __m512i __C) {
209 return (__m512i)__builtin_ia32_vpdpwsuds512((__v16si)__A, (__v16si)__B,209 return (__m512i)__builtin_ia32_vpdpwsuds512((__v16si)__A, (__v32hi)__B,
210 (__v16si)__C);210 (__v32hu)__C);
211}211}
212212
213static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwsuds_epi32(213static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwsuds_epi32(
...@@ -218,7 +218,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwsuds_epi32(...@@ -218,7 +218,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwsuds_epi32(
218}218}
219219
220static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsuds_epi32(220static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsuds_epi32(
221 __m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {221 __mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
222 return (__m512i)__builtin_ia32_selectd_512(222 return (__m512i)__builtin_ia32_selectd_512(
223 (__mmask16)__U, (__v16si)_mm512_dpwsuds_epi32(__A, __B, __C),223 (__mmask16)__U, (__v16si)_mm512_dpwsuds_epi32(__A, __B, __C),
224 (__v16si)_mm512_setzero_si512());224 (__v16si)_mm512_setzero_si512());
...@@ -227,8 +227,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsuds_epi32(...@@ -227,8 +227,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsuds_epi32(
227static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwusd_epi32(__m512i __A,227static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwusd_epi32(__m512i __A,
228 __m512i __B,228 __m512i __B,
229 __m512i __C) {229 __m512i __C) {
230 return (__m512i)__builtin_ia32_vpdpwusd512((__v16si)__A, (__v16si)__B,230 return (__m512i)__builtin_ia32_vpdpwusd512((__v16si)__A, (__v32hu)__B,
231 (__v16si)__C);231 (__v32hi)__C);
232}232}
233233
234static __inline__ __m512i __DEFAULT_FN_ATTRS234static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -239,7 +239,7 @@ _mm512_mask_dpwusd_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {...@@ -239,7 +239,7 @@ _mm512_mask_dpwusd_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
239}239}
240240
241static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusd_epi32(241static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusd_epi32(
242 __m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {242 __mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
243 return (__m512i)__builtin_ia32_selectd_512(243 return (__m512i)__builtin_ia32_selectd_512(
244 (__mmask16)__U, (__v16si)_mm512_dpwusd_epi32(__A, __B, __C),244 (__mmask16)__U, (__v16si)_mm512_dpwusd_epi32(__A, __B, __C),
245 (__v16si)_mm512_setzero_si512());245 (__v16si)_mm512_setzero_si512());
...@@ -248,8 +248,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusd_epi32(...@@ -248,8 +248,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusd_epi32(
248static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwusds_epi32(__m512i __A,248static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwusds_epi32(__m512i __A,
249 __m512i __B,249 __m512i __B,
250 __m512i __C) {250 __m512i __C) {
251 return (__m512i)__builtin_ia32_vpdpwusds512((__v16si)__A, (__v16si)__B,251 return (__m512i)__builtin_ia32_vpdpwusds512((__v16si)__A, (__v32hu)__B,
252 (__v16si)__C);252 (__v32hi)__C);
253}253}
254254
255static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwusds_epi32(255static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwusds_epi32(
...@@ -260,7 +260,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwusds_epi32(...@@ -260,7 +260,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwusds_epi32(
260}260}
261261
262static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusds_epi32(262static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusds_epi32(
263 __m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {263 __mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
264 return (__m512i)__builtin_ia32_selectd_512(264 return (__m512i)__builtin_ia32_selectd_512(
265 (__mmask16)__U, (__v16si)_mm512_dpwusds_epi32(__A, __B, __C),265 (__mmask16)__U, (__v16si)_mm512_dpwusds_epi32(__A, __B, __C),
266 (__v16si)_mm512_setzero_si512());266 (__v16si)_mm512_setzero_si512());
...@@ -269,8 +269,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusds_epi32(...@@ -269,8 +269,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusds_epi32(
269static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwuud_epi32(__m512i __A,269static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwuud_epi32(__m512i __A,
270 __m512i __B,270 __m512i __B,
271 __m512i __C) {271 __m512i __C) {
272 return (__m512i)__builtin_ia32_vpdpwuud512((__v16si)__A, (__v16si)__B,272 return (__m512i)__builtin_ia32_vpdpwuud512((__v16si)__A, (__v32hu)__B,
273 (__v16si)__C);273 (__v32hu)__C);
274}274}
275275
276static __inline__ __m512i __DEFAULT_FN_ATTRS276static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -281,7 +281,7 @@ _mm512_mask_dpwuud_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {...@@ -281,7 +281,7 @@ _mm512_mask_dpwuud_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
281}281}
282282
283static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuud_epi32(283static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuud_epi32(
284 __m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {284 __mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
285 return (__m512i)__builtin_ia32_selectd_512(285 return (__m512i)__builtin_ia32_selectd_512(
286 (__mmask16)__U, (__v16si)_mm512_dpwuud_epi32(__A, __B, __C),286 (__mmask16)__U, (__v16si)_mm512_dpwuud_epi32(__A, __B, __C),
287 (__v16si)_mm512_setzero_si512());287 (__v16si)_mm512_setzero_si512());
...@@ -290,8 +290,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuud_epi32(...@@ -290,8 +290,8 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuud_epi32(
290static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwuuds_epi32(__m512i __A,290static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwuuds_epi32(__m512i __A,
291 __m512i __B,291 __m512i __B,
292 __m512i __C) {292 __m512i __C) {
293 return (__m512i)__builtin_ia32_vpdpwuuds512((__v16si)__A, (__v16si)__B,293 return (__m512i)__builtin_ia32_vpdpwuuds512((__v16si)__A, (__v32hu)__B,
294 (__v16si)__C);294 (__v32hu)__C);
295}295}
296296
297static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwuuds_epi32(297static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwuuds_epi32(
...@@ -302,7 +302,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwuuds_epi32(...@@ -302,7 +302,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwuuds_epi32(
302}302}
303303
304static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuuds_epi32(304static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuuds_epi32(
305 __m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {305 __mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
306 return (__m512i)__builtin_ia32_selectd_512(306 return (__m512i)__builtin_ia32_selectd_512(
307 (__mmask16)__U, (__v16si)_mm512_dpwuuds_epi32(__A, __B, __C),307 (__mmask16)__U, (__v16si)_mm512_dpwuuds_epi32(__A, __B, __C),
308 (__v16si)_mm512_setzero_si512());308 (__v16si)_mm512_setzero_si512());
lib/include/avx10_2_512satcvtdsintrin.h+1-1
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
1616
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS \18#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-512"), \19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
20 __min_vector_width__(512)))20 __min_vector_width__(512)))
2121
22// 512 bit : Double -> Int22// 512 bit : Double -> Int
lib/include/avx10_2bf16intrin.h+54-45
...@@ -21,12 +21,20 @@ typedef __bf16 __m256bh_u __attribute__((__vector_size__(32), __aligned__(1)));...@@ -21,12 +21,20 @@ typedef __bf16 __m256bh_u __attribute__((__vector_size__(32), __aligned__(1)));
2121
22/* Define the default attributes for the functions in this file. */22/* Define the default attributes for the functions in this file. */
23#define __DEFAULT_FN_ATTRS256 \23#define __DEFAULT_FN_ATTRS256 \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
25 __min_vector_width__(256)))25 __min_vector_width__(256)))
26#define __DEFAULT_FN_ATTRS128 \26#define __DEFAULT_FN_ATTRS128 \
27 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \27 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
28 __min_vector_width__(128)))28 __min_vector_width__(128)))
2929
30#if defined(__cplusplus) && (__cplusplus >= 201103L)
31#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
32#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
33#else
34#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
35#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
36#endif
37
30static __inline __m256bh __DEFAULT_FN_ATTRS256 _mm256_setzero_pbh(void) {38static __inline __m256bh __DEFAULT_FN_ATTRS256 _mm256_setzero_pbh(void) {
31 return __builtin_bit_cast(__m256bh, _mm256_setzero_ps());39 return __builtin_bit_cast(__m256bh, _mm256_setzero_ps());
32}40}
...@@ -213,12 +221,12 @@ static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_move_sbh(__m128bh __a,...@@ -213,12 +221,12 @@ static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_move_sbh(__m128bh __a,
213 return __a;221 return __a;
214}222}
215223
216static __inline__ __m128bh __DEFAULT_FN_ATTRS128224static __inline__ __m128bh __DEFAULT_FN_ATTRS128_CONSTEXPR
217_mm_mask_move_sbh(__m128bh __W, __mmask8 __U, __m128bh __A, __m128bh __B) {225_mm_mask_move_sbh(__m128bh __W, __mmask8 __U, __m128bh __A, __m128bh __B) {
218 return __builtin_ia32_selectsbf_128(__U, _mm_move_sbh(__A, __B), __W);226 return __builtin_ia32_selectsbf_128(__U, _mm_move_sbh(__A, __B), __W);
219}227}
220228
221static __inline__ __m128bh __DEFAULT_FN_ATTRS128229static __inline__ __m128bh __DEFAULT_FN_ATTRS128_CONSTEXPR
222_mm_maskz_move_sbh(__mmask8 __U, __m128bh __A, __m128bh __B) {230_mm_maskz_move_sbh(__mmask8 __U, __m128bh __A, __m128bh __B) {
223 return __builtin_ia32_selectsbf_128(__U, _mm_move_sbh(__A, __B),231 return __builtin_ia32_selectsbf_128(__U, _mm_move_sbh(__A, __B),
224 _mm_setzero_pbh());232 _mm_setzero_pbh());
...@@ -287,24 +295,24 @@ _mm256_mask_blend_pbh(__mmask16 __U, __m256bh __A, __m256bh __W) {...@@ -287,24 +295,24 @@ _mm256_mask_blend_pbh(__mmask16 __U, __m256bh __A, __m256bh __W) {
287 (__v16bf)__A);295 (__v16bf)__A);
288}296}
289297
290static __inline__ __m128bh __DEFAULT_FN_ATTRS128298static __inline__ __m128bh __DEFAULT_FN_ATTRS128_CONSTEXPR
291_mm_permutex2var_pbh(__m128bh __A, __m128i __I, __m128bh __B) {299_mm_permutex2var_pbh(__m128bh __A, __m128i __I, __m128bh __B) {
292 return (__m128bh)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,300 return (__m128bh)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,
293 (__v8hi)__B);301 (__v8hi)__B);
294}302}
295303
296static __inline__ __m256bh __DEFAULT_FN_ATTRS256304static __inline__ __m256bh __DEFAULT_FN_ATTRS256_CONSTEXPR
297_mm256_permutex2var_pbh(__m256bh __A, __m256i __I, __m256bh __B) {305_mm256_permutex2var_pbh(__m256bh __A, __m256i __I, __m256bh __B) {
298 return (__m256bh)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,306 return (__m256bh)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,
299 (__v16hi)__B);307 (__v16hi)__B);
300}308}
301309
302static __inline__ __m128bh __DEFAULT_FN_ATTRS128310static __inline__ __m128bh __DEFAULT_FN_ATTRS128_CONSTEXPR
303_mm_permutexvar_pbh(__m128i __A, __m128bh __B) {311_mm_permutexvar_pbh(__m128i __A, __m128bh __B) {
304 return (__m128bh)__builtin_ia32_permvarhi128((__v8hi)__B, (__v8hi)__A);312 return (__m128bh)__builtin_ia32_permvarhi128((__v8hi)__B, (__v8hi)__A);
305}313}
306314
307static __inline__ __m256bh __DEFAULT_FN_ATTRS256315static __inline__ __m256bh __DEFAULT_FN_ATTRS256_CONSTEXPR
308_mm256_permutexvar_pbh(__m256i __A, __m256bh __B) {316_mm256_permutexvar_pbh(__m256i __A, __m256bh __B) {
309 return (__m256bh)__builtin_ia32_permvarhi256((__v16hi)__B, (__v16hi)__A);317 return (__m256bh)__builtin_ia32_permvarhi256((__v16hi)__B, (__v16hi)__A);
310}318}
...@@ -519,34 +527,34 @@ _mm_maskz_min_pbh(__mmask8 __U, __m128bh __A, __m128bh __B) {...@@ -519,34 +527,34 @@ _mm_maskz_min_pbh(__mmask8 __U, __m128bh __A, __m128bh __B) {
519 (__mmask8)__U, (__v8bf)_mm_min_pbh(__A, __B), (__v8bf)_mm_setzero_pbh());527 (__mmask8)__U, (__v8bf)_mm_min_pbh(__A, __B), (__v8bf)_mm_setzero_pbh());
520}528}
521529
522static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comieq_sbh(__m128bh A,530static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comieq_sbh(__m128bh __A,
523 __m128bh B) {531 __m128bh __B) {
524 return __builtin_ia32_vcomisbf16eq((__v8bf)A, (__v8bf)B);532 return __builtin_ia32_vcomisbf16eq((__v8bf)__A, (__v8bf)__B);
525}533}
526534
527static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comilt_sbh(__m128bh A,535static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comilt_sbh(__m128bh __A,
528 __m128bh B) {536 __m128bh __B) {
529 return __builtin_ia32_vcomisbf16lt((__v8bf)A, (__v8bf)B);537 return __builtin_ia32_vcomisbf16lt((__v8bf)__A, (__v8bf)__B);
530}538}
531539
532static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comile_sbh(__m128bh A,540static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comile_sbh(__m128bh __A,
533 __m128bh B) {541 __m128bh __B) {
534 return __builtin_ia32_vcomisbf16le((__v8bf)A, (__v8bf)B);542 return __builtin_ia32_vcomisbf16le((__v8bf)__A, (__v8bf)__B);
535}543}
536544
537static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comigt_sbh(__m128bh A,545static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comigt_sbh(__m128bh __A,
538 __m128bh B) {546 __m128bh __B) {
539 return __builtin_ia32_vcomisbf16gt((__v8bf)A, (__v8bf)B);547 return __builtin_ia32_vcomisbf16gt((__v8bf)__A, (__v8bf)__B);
540}548}
541549
542static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comige_sbh(__m128bh A,550static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comige_sbh(__m128bh __A,
543 __m128bh B) {551 __m128bh __B) {
544 return __builtin_ia32_vcomisbf16ge((__v8bf)A, (__v8bf)B);552 return __builtin_ia32_vcomisbf16ge((__v8bf)__A, (__v8bf)__B);
545}553}
546554
547static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comineq_sbh(__m128bh A,555static __inline__ int __DEFAULT_FN_ATTRS128 _mm_comineq_sbh(__m128bh __A,
548 __m128bh B) {556 __m128bh __B) {
549 return __builtin_ia32_vcomisbf16neq((__v8bf)A, (__v8bf)B);557 return __builtin_ia32_vcomisbf16neq((__v8bf)__A, (__v8bf)__B);
550}558}
551559
552#define _mm256_cmp_pbh_mask(__A, __B, __P) \560#define _mm256_cmp_pbh_mask(__A, __B, __P) \
...@@ -818,7 +826,7 @@ _mm_maskz_rsqrt_pbh(__mmask8 __U, __m128bh __A) {...@@ -818,7 +826,7 @@ _mm_maskz_rsqrt_pbh(__mmask8 __U, __m128bh __A) {
818 (__v8bf)_mm_setzero_pbh(), (__mmask8)(__U)))826 (__v8bf)_mm_setzero_pbh(), (__mmask8)(__U)))
819827
820static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_sqrt_pbh(__m256bh __A) {828static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_sqrt_pbh(__m256bh __A) {
821 return (__m256bh)__builtin_ia32_vsqrtbf16256((__v16bf)__A);829 return __builtin_elementwise_sqrt(__A);
822}830}
823831
824static __inline__ __m256bh __DEFAULT_FN_ATTRS256832static __inline__ __m256bh __DEFAULT_FN_ATTRS256
...@@ -835,7 +843,7 @@ _mm256_maskz_sqrt_pbh(__mmask16 __U, __m256bh __A) {...@@ -835,7 +843,7 @@ _mm256_maskz_sqrt_pbh(__mmask16 __U, __m256bh __A) {
835}843}
836844
837static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_sqrt_pbh(__m128bh __A) {845static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_sqrt_pbh(__m128bh __A) {
838 return (__m128bh)__builtin_ia32_vsqrtbf16((__v8bf)__A);846 return __builtin_elementwise_sqrt(__A);
839}847}
840848
841static __inline__ __m128bh __DEFAULT_FN_ATTRS128849static __inline__ __m128bh __DEFAULT_FN_ATTRS128
...@@ -852,8 +860,8 @@ _mm_maskz_sqrt_pbh(__mmask8 __U, __m128bh __A) {...@@ -852,8 +860,8 @@ _mm_maskz_sqrt_pbh(__mmask8 __U, __m128bh __A) {
852860
853static __inline__ __m256bh __DEFAULT_FN_ATTRS256861static __inline__ __m256bh __DEFAULT_FN_ATTRS256
854_mm256_fmadd_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {862_mm256_fmadd_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {
855 return (__m256bh)__builtin_ia32_vfmaddbf16256((__v16bf)__A, (__v16bf)__B,863 return (__m256bh)__builtin_elementwise_fma((__v16bf)__A, (__v16bf)__B,
856 (__v16bf)__C);864 (__v16bf)__C);
857}865}
858866
859static __inline__ __m256bh __DEFAULT_FN_ATTRS256867static __inline__ __m256bh __DEFAULT_FN_ATTRS256
...@@ -880,8 +888,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fmadd_pbh(...@@ -880,8 +888,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fmadd_pbh(
880888
881static __inline__ __m256bh __DEFAULT_FN_ATTRS256889static __inline__ __m256bh __DEFAULT_FN_ATTRS256
882_mm256_fmsub_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {890_mm256_fmsub_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {
883 return (__m256bh)__builtin_ia32_vfmaddbf16256((__v16bf)__A, (__v16bf)__B,891 return (__m256bh)__builtin_elementwise_fma((__v16bf)__A, (__v16bf)__B,
884 -(__v16bf)__C);892 -(__v16bf)__C);
885}893}
886894
887static __inline__ __m256bh __DEFAULT_FN_ATTRS256895static __inline__ __m256bh __DEFAULT_FN_ATTRS256
...@@ -908,8 +916,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fmsub_pbh(...@@ -908,8 +916,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fmsub_pbh(
908916
909static __inline__ __m256bh __DEFAULT_FN_ATTRS256917static __inline__ __m256bh __DEFAULT_FN_ATTRS256
910_mm256_fnmadd_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {918_mm256_fnmadd_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {
911 return (__m256bh)__builtin_ia32_vfmaddbf16256((__v16bf)__A, -(__v16bf)__B,919 return (__m256bh)__builtin_elementwise_fma((__v16bf)__A, -(__v16bf)__B,
912 (__v16bf)__C);920 (__v16bf)__C);
913}921}
914922
915static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_mask_fnmadd_pbh(923static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_mask_fnmadd_pbh(
...@@ -938,8 +946,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fnmadd_pbh(...@@ -938,8 +946,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fnmadd_pbh(
938946
939static __inline__ __m256bh __DEFAULT_FN_ATTRS256947static __inline__ __m256bh __DEFAULT_FN_ATTRS256
940_mm256_fnmsub_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {948_mm256_fnmsub_pbh(__m256bh __A, __m256bh __B, __m256bh __C) {
941 return (__m256bh)__builtin_ia32_vfmaddbf16256((__v16bf)__A, -(__v16bf)__B,949 return (__m256bh)__builtin_elementwise_fma((__v16bf)__A, -(__v16bf)__B,
942 -(__v16bf)__C);950 -(__v16bf)__C);
943}951}
944952
945static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_mask_fnmsub_pbh(953static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_mask_fnmsub_pbh(
...@@ -969,8 +977,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fnmsub_pbh(...@@ -969,8 +977,8 @@ static __inline__ __m256bh __DEFAULT_FN_ATTRS256 _mm256_maskz_fnmsub_pbh(
969static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fmadd_pbh(__m128bh __A,977static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fmadd_pbh(__m128bh __A,
970 __m128bh __B,978 __m128bh __B,
971 __m128bh __C) {979 __m128bh __C) {
972 return (__m128bh)__builtin_ia32_vfmaddbf16128((__v8bf)__A, (__v8bf)__B,980 return (__m128bh)__builtin_elementwise_fma((__v8bf)__A, (__v8bf)__B,
973 (__v8bf)__C);981 (__v8bf)__C);
974}982}
975983
976static __inline__ __m128bh __DEFAULT_FN_ATTRS128984static __inline__ __m128bh __DEFAULT_FN_ATTRS128
...@@ -997,8 +1005,8 @@ _mm_maskz_fmadd_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {...@@ -997,8 +1005,8 @@ _mm_maskz_fmadd_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {
997static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fmsub_pbh(__m128bh __A,1005static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fmsub_pbh(__m128bh __A,
998 __m128bh __B,1006 __m128bh __B,
999 __m128bh __C) {1007 __m128bh __C) {
1000 return (__m128bh)__builtin_ia32_vfmaddbf16128((__v8bf)__A, (__v8bf)__B,1008 return (__m128bh)__builtin_elementwise_fma((__v8bf)__A, (__v8bf)__B,
1001 -(__v8bf)__C);1009 -(__v8bf)__C);
1002}1010}
10031011
1004static __inline__ __m128bh __DEFAULT_FN_ATTRS1281012static __inline__ __m128bh __DEFAULT_FN_ATTRS128
...@@ -1025,8 +1033,8 @@ _mm_maskz_fmsub_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {...@@ -1025,8 +1033,8 @@ _mm_maskz_fmsub_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {
1025static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fnmadd_pbh(__m128bh __A,1033static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fnmadd_pbh(__m128bh __A,
1026 __m128bh __B,1034 __m128bh __B,
1027 __m128bh __C) {1035 __m128bh __C) {
1028 return (__m128bh)__builtin_ia32_vfmaddbf16128((__v8bf)__A, -(__v8bf)__B,1036 return (__m128bh)__builtin_elementwise_fma((__v8bf)__A, -(__v8bf)__B,
1029 (__v8bf)__C);1037 (__v8bf)__C);
1030}1038}
10311039
1032static __inline__ __m128bh __DEFAULT_FN_ATTRS1281040static __inline__ __m128bh __DEFAULT_FN_ATTRS128
...@@ -1053,8 +1061,8 @@ _mm_maskz_fnmadd_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {...@@ -1053,8 +1061,8 @@ _mm_maskz_fnmadd_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {
1053static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fnmsub_pbh(__m128bh __A,1061static __inline__ __m128bh __DEFAULT_FN_ATTRS128 _mm_fnmsub_pbh(__m128bh __A,
1054 __m128bh __B,1062 __m128bh __B,
1055 __m128bh __C) {1063 __m128bh __C) {
1056 return (__m128bh)__builtin_ia32_vfmaddbf16128((__v8bf)__A, -(__v8bf)__B,1064 return (__m128bh)__builtin_elementwise_fma((__v8bf)__A, -(__v8bf)__B,
1057 -(__v8bf)__C);1065 -(__v8bf)__C);
1058}1066}
10591067
1060static __inline__ __m128bh __DEFAULT_FN_ATTRS1281068static __inline__ __m128bh __DEFAULT_FN_ATTRS128
...@@ -1080,6 +1088,7 @@ _mm_maskz_fnmsub_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {...@@ -1080,6 +1088,7 @@ _mm_maskz_fnmsub_pbh(__mmask8 __U, __m128bh __A, __m128bh __B, __m128bh __C) {
10801088
1081#undef __DEFAULT_FN_ATTRS1281089#undef __DEFAULT_FN_ATTRS128
1082#undef __DEFAULT_FN_ATTRS2561090#undef __DEFAULT_FN_ATTRS256
10831091#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
1092#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
1084#endif1093#endif
1085#endif1094#endif
lib/include/avx10_2convertintrin.h+2-2
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
1818
19/* Define the default attributes for the functions in this file. */19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS128 \20#define __DEFAULT_FN_ATTRS128 \
21 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \21 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
22 __min_vector_width__(128)))22 __min_vector_width__(128)))
23#define __DEFAULT_FN_ATTRS256 \23#define __DEFAULT_FN_ATTRS256 \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
25 __min_vector_width__(256)))25 __min_vector_width__(256)))
2626
27// clang-format off27// clang-format off
lib/include/avx10_2copyintrin.h+1-1
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
1616
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
20 __min_vector_width__(128)))20 __min_vector_width__(128)))
2121
22/// Constructs a 128-bit integer vector, setting the lower 32 bits to the22/// Constructs a 128-bit integer vector, setting the lower 32 bits to the
lib/include/avx10_2niintrin.h+14-14
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16#define __AVX10_2NIINTRIN_H16#define __AVX10_2NIINTRIN_H
1717
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
20 __min_vector_width__(128)))20 __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 \21#define __DEFAULT_FN_ATTRS256 \
22 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \22 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
23 __min_vector_width__(256)))23 __min_vector_width__(256)))
2424
25/* VNNI FP16 */25/* VNNI FP16 */
...@@ -253,7 +253,7 @@ _mm_mask_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {...@@ -253,7 +253,7 @@ _mm_mask_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
253}253}
254254
255static __inline__ __m128i __DEFAULT_FN_ATTRS128255static __inline__ __m128i __DEFAULT_FN_ATTRS128
256_mm_maskz_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {256_mm_maskz_dpwsud_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
257 return (__m128i)__builtin_ia32_selectd_128(257 return (__m128i)__builtin_ia32_selectd_128(
258 (__mmask8)__U, (__v4si)_mm_dpwsud_epi32(__A, __B, __C),258 (__mmask8)__U, (__v4si)_mm_dpwsud_epi32(__A, __B, __C),
259 (__v4si)_mm_setzero_si128());259 (__v4si)_mm_setzero_si128());
...@@ -266,7 +266,7 @@ _mm256_mask_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {...@@ -266,7 +266,7 @@ _mm256_mask_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {
266}266}
267267
268static __inline__ __m256i __DEFAULT_FN_ATTRS256268static __inline__ __m256i __DEFAULT_FN_ATTRS256
269_mm256_maskz_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {269_mm256_maskz_dpwsud_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) {
270 return (__m256i)__builtin_ia32_selectd_256(270 return (__m256i)__builtin_ia32_selectd_256(
271 (__mmask8)__U, (__v8si)_mm256_dpwsud_epi32(__A, __B, __C),271 (__mmask8)__U, (__v8si)_mm256_dpwsud_epi32(__A, __B, __C),
272 (__v8si)_mm256_setzero_si256());272 (__v8si)_mm256_setzero_si256());
...@@ -279,7 +279,7 @@ _mm_mask_dpwsuds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {...@@ -279,7 +279,7 @@ _mm_mask_dpwsuds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
279}279}
280280
281static __inline__ __m128i __DEFAULT_FN_ATTRS128281static __inline__ __m128i __DEFAULT_FN_ATTRS128
282_mm_maskz_dpwsuds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {282_mm_maskz_dpwsuds_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
283 return (__m128i)__builtin_ia32_selectd_128(283 return (__m128i)__builtin_ia32_selectd_128(
284 (__mmask8)__U, (__v4si)_mm_dpwsuds_epi32(__A, __B, __C),284 (__mmask8)__U, (__v4si)_mm_dpwsuds_epi32(__A, __B, __C),
285 (__v4si)_mm_setzero_si128());285 (__v4si)_mm_setzero_si128());
...@@ -292,7 +292,7 @@ _mm256_mask_dpwsuds_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {...@@ -292,7 +292,7 @@ _mm256_mask_dpwsuds_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {
292}292}
293293
294static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwsuds_epi32(294static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwsuds_epi32(
295 __m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {295 __mmask8 __U, __m256i __A, __m256i __B, __m256i __C) {
296 return (__m256i)__builtin_ia32_selectd_256(296 return (__m256i)__builtin_ia32_selectd_256(
297 (__mmask8)__U, (__v8si)_mm256_dpwsuds_epi32(__A, __B, __C),297 (__mmask8)__U, (__v8si)_mm256_dpwsuds_epi32(__A, __B, __C),
298 (__v8si)_mm256_setzero_si256());298 (__v8si)_mm256_setzero_si256());
...@@ -305,7 +305,7 @@ _mm_mask_dpwusd_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {...@@ -305,7 +305,7 @@ _mm_mask_dpwusd_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
305}305}
306306
307static __inline__ __m128i __DEFAULT_FN_ATTRS128307static __inline__ __m128i __DEFAULT_FN_ATTRS128
308_mm_maskz_dpwusd_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {308_mm_maskz_dpwusd_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
309 return (__m128i)__builtin_ia32_selectd_128(309 return (__m128i)__builtin_ia32_selectd_128(
310 (__mmask8)__U, (__v4si)_mm_dpwusd_epi32(__A, __B, __C),310 (__mmask8)__U, (__v4si)_mm_dpwusd_epi32(__A, __B, __C),
311 (__v4si)_mm_setzero_si128());311 (__v4si)_mm_setzero_si128());
...@@ -318,7 +318,7 @@ _mm256_mask_dpwusd_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {...@@ -318,7 +318,7 @@ _mm256_mask_dpwusd_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {
318}318}
319319
320static __inline__ __m256i __DEFAULT_FN_ATTRS256320static __inline__ __m256i __DEFAULT_FN_ATTRS256
321_mm256_maskz_dpwusd_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {321_mm256_maskz_dpwusd_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) {
322 return (__m256i)__builtin_ia32_selectd_256(322 return (__m256i)__builtin_ia32_selectd_256(
323 (__mmask8)__U, (__v8si)_mm256_dpwusd_epi32(__A, __B, __C),323 (__mmask8)__U, (__v8si)_mm256_dpwusd_epi32(__A, __B, __C),
324 (__v8si)_mm256_setzero_si256());324 (__v8si)_mm256_setzero_si256());
...@@ -331,7 +331,7 @@ _mm_mask_dpwusds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {...@@ -331,7 +331,7 @@ _mm_mask_dpwusds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
331}331}
332332
333static __inline__ __m128i __DEFAULT_FN_ATTRS128333static __inline__ __m128i __DEFAULT_FN_ATTRS128
334_mm_maskz_dpwusds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {334_mm_maskz_dpwusds_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
335 return (__m128i)__builtin_ia32_selectd_128(335 return (__m128i)__builtin_ia32_selectd_128(
336 (__mmask8)__U, (__v4si)_mm_dpwusds_epi32(__A, __B, __C),336 (__mmask8)__U, (__v4si)_mm_dpwusds_epi32(__A, __B, __C),
337 (__v4si)_mm_setzero_si128());337 (__v4si)_mm_setzero_si128());
...@@ -344,7 +344,7 @@ _mm256_mask_dpwusds_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {...@@ -344,7 +344,7 @@ _mm256_mask_dpwusds_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {
344}344}
345345
346static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwusds_epi32(346static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwusds_epi32(
347 __m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {347 __mmask8 __U, __m256i __A, __m256i __B, __m256i __C) {
348 return (__m256i)__builtin_ia32_selectd_256(348 return (__m256i)__builtin_ia32_selectd_256(
349 (__mmask8)__U, (__v8si)_mm256_dpwusds_epi32(__A, __B, __C),349 (__mmask8)__U, (__v8si)_mm256_dpwusds_epi32(__A, __B, __C),
350 (__v8si)_mm256_setzero_si256());350 (__v8si)_mm256_setzero_si256());
...@@ -357,7 +357,7 @@ _mm_mask_dpwuud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {...@@ -357,7 +357,7 @@ _mm_mask_dpwuud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
357}357}
358358
359static __inline__ __m128i __DEFAULT_FN_ATTRS128359static __inline__ __m128i __DEFAULT_FN_ATTRS128
360_mm_maskz_dpwuud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {360_mm_maskz_dpwuud_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
361 return (__m128i)__builtin_ia32_selectd_128(361 return (__m128i)__builtin_ia32_selectd_128(
362 (__mmask8)__U, (__v4si)_mm_dpwuud_epi32(__A, __B, __C),362 (__mmask8)__U, (__v4si)_mm_dpwuud_epi32(__A, __B, __C),
363 (__v4si)_mm_setzero_si128());363 (__v4si)_mm_setzero_si128());
...@@ -370,7 +370,7 @@ _mm256_mask_dpwuud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {...@@ -370,7 +370,7 @@ _mm256_mask_dpwuud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {
370}370}
371371
372static __inline__ __m256i __DEFAULT_FN_ATTRS256372static __inline__ __m256i __DEFAULT_FN_ATTRS256
373_mm256_maskz_dpwuud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {373_mm256_maskz_dpwuud_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) {
374 return (__m256i)__builtin_ia32_selectd_256(374 return (__m256i)__builtin_ia32_selectd_256(
375 (__mmask8)__U, (__v8si)_mm256_dpwuud_epi32(__A, __B, __C),375 (__mmask8)__U, (__v8si)_mm256_dpwuud_epi32(__A, __B, __C),
376 (__v8si)_mm256_setzero_si256());376 (__v8si)_mm256_setzero_si256());
...@@ -383,7 +383,7 @@ _mm_mask_dpwuuds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {...@@ -383,7 +383,7 @@ _mm_mask_dpwuuds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
383}383}
384384
385static __inline__ __m128i __DEFAULT_FN_ATTRS128385static __inline__ __m128i __DEFAULT_FN_ATTRS128
386_mm_maskz_dpwuuds_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {386_mm_maskz_dpwuuds_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
387 return (__m128i)__builtin_ia32_selectd_128(387 return (__m128i)__builtin_ia32_selectd_128(
388 (__mmask8)__U, (__v4si)_mm_dpwuuds_epi32(__A, __B, __C),388 (__mmask8)__U, (__v4si)_mm_dpwuuds_epi32(__A, __B, __C),
389 (__v4si)_mm_setzero_si128());389 (__v4si)_mm_setzero_si128());
...@@ -396,7 +396,7 @@ _mm256_mask_dpwuuds_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {...@@ -396,7 +396,7 @@ _mm256_mask_dpwuuds_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {
396}396}
397397
398static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwuuds_epi32(398static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwuuds_epi32(
399 __m256i __A, __mmask8 __U, __m256i __B, __m256i __C) {399 __mmask8 __U, __m256i __A, __m256i __B, __m256i __C) {
400 return (__m256i)__builtin_ia32_selectd_256(400 return (__m256i)__builtin_ia32_selectd_256(
401 (__mmask8)__U, (__v8si)_mm256_dpwuuds_epi32(__A, __B, __C),401 (__mmask8)__U, (__v8si)_mm256_dpwuuds_epi32(__A, __B, __C),
402 (__v8si)_mm256_setzero_si256());402 (__v8si)_mm256_setzero_si256());
lib/include/avx10_2satcvtdsintrin.h+2-2
...@@ -17,11 +17,11 @@...@@ -17,11 +17,11 @@
1717
18/* Define the default attributes for the functions in this file. */18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS256 \19#define __DEFAULT_FN_ATTRS256 \
20 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \20 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
21 __min_vector_width__(256)))21 __min_vector_width__(256)))
2222
23#define __DEFAULT_FN_ATTRS128 \23#define __DEFAULT_FN_ATTRS128 \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"), \24 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \
25 __min_vector_width__(128)))25 __min_vector_width__(128)))
2626
27#define _mm_cvtts_roundsd_i32(__A, __R) \27#define _mm_cvtts_roundsd_i32(__A, __R) \
lib/include/avx2intrin.h+275-377
...@@ -15,20 +15,19 @@...@@ -15,20 +15,19 @@
15#define __AVX2INTRIN_H15#define __AVX2INTRIN_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(__EVEX512__) && !defined(__AVX10_1_512__)
19#define __DEFAULT_FN_ATTRS256 \
20 __attribute__((__always_inline__, __nodebug__, \
21 __target__("avx2,no-evex512"), __min_vector_width__(256)))
22#define __DEFAULT_FN_ATTRS128 \
23 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx2,no-evex512"), __min_vector_width__(128)))
25#else
26#define __DEFAULT_FN_ATTRS256 \18#define __DEFAULT_FN_ATTRS256 \
27 __attribute__((__always_inline__, __nodebug__, __target__("avx2"), \19 __attribute__((__always_inline__, __nodebug__, __target__("avx2"), \
28 __min_vector_width__(256)))20 __min_vector_width__(256)))
29#define __DEFAULT_FN_ATTRS128 \21#define __DEFAULT_FN_ATTRS128 \
30 __attribute__((__always_inline__, __nodebug__, __target__("avx2"), \22 __attribute__((__always_inline__, __nodebug__, __target__("avx2"), \
31 __min_vector_width__(128)))23 __min_vector_width__(128)))
24
25#if defined(__cplusplus) && (__cplusplus >= 201103L)
26#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
27#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
28#else
29#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
30#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
32#endif31#endif
3332
34/* SSE4 Multiple Packed Sums of Absolute Difference. */33/* SSE4 Multiple Packed Sums of Absolute Difference. */
...@@ -104,10 +103,9 @@...@@ -104,10 +103,9 @@
104/// \param __a103/// \param __a
105/// A 256-bit integer vector.104/// A 256-bit integer vector.
106/// \returns A 256-bit integer vector containing the result.105/// \returns A 256-bit integer vector containing the result.
107static __inline__ __m256i __DEFAULT_FN_ATTRS256106static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
108_mm256_abs_epi8(__m256i __a)107_mm256_abs_epi8(__m256i __a) {
109{108 return (__m256i)__builtin_elementwise_abs((__v32qs)__a);
110 return (__m256i)__builtin_elementwise_abs((__v32qs)__a);
111}109}
112110
113/// Computes the absolute value of each signed 16-bit element in the 256-bit111/// Computes the absolute value of each signed 16-bit element in the 256-bit
...@@ -121,10 +119,9 @@ _mm256_abs_epi8(__m256i __a)...@@ -121,10 +119,9 @@ _mm256_abs_epi8(__m256i __a)
121/// \param __a119/// \param __a
122/// A 256-bit vector of [16 x i16].120/// A 256-bit vector of [16 x i16].
123/// \returns A 256-bit vector of [16 x i16] containing the result.121/// \returns A 256-bit vector of [16 x i16] containing the result.
124static __inline__ __m256i __DEFAULT_FN_ATTRS256122static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
125_mm256_abs_epi16(__m256i __a)123_mm256_abs_epi16(__m256i __a) {
126{124 return (__m256i)__builtin_elementwise_abs((__v16hi)__a);
127 return (__m256i)__builtin_elementwise_abs((__v16hi)__a);
128}125}
129126
130/// Computes the absolute value of each signed 32-bit element in the 256-bit127/// Computes the absolute value of each signed 32-bit element in the 256-bit
...@@ -138,10 +135,9 @@ _mm256_abs_epi16(__m256i __a)...@@ -138,10 +135,9 @@ _mm256_abs_epi16(__m256i __a)
138/// \param __a135/// \param __a
139/// A 256-bit vector of [8 x i32].136/// A 256-bit vector of [8 x i32].
140/// \returns A 256-bit vector of [8 x i32] containing the result.137/// \returns A 256-bit vector of [8 x i32] containing the result.
141static __inline__ __m256i __DEFAULT_FN_ATTRS256138static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
142_mm256_abs_epi32(__m256i __a)139_mm256_abs_epi32(__m256i __a) {
143{140 return (__m256i)__builtin_elementwise_abs((__v8si)__a);
144 return (__m256i)__builtin_elementwise_abs((__v8si)__a);
145}141}
146142
147/// Converts the elements of two 256-bit vectors of [16 x i16] to 8-bit143/// Converts the elements of two 256-bit vectors of [16 x i16] to 8-bit
...@@ -169,9 +165,8 @@ _mm256_abs_epi32(__m256i __a)...@@ -169,9 +165,8 @@ _mm256_abs_epi32(__m256i __a)
169/// A 256-bit vector of [16 x i16] used to generate result[127:64] and165/// A 256-bit vector of [16 x i16] used to generate result[127:64] and
170/// result[255:192].166/// result[255:192].
171/// \returns A 256-bit integer vector containing the result.167/// \returns A 256-bit integer vector containing the result.
172static __inline__ __m256i __DEFAULT_FN_ATTRS256168static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
173_mm256_packs_epi16(__m256i __a, __m256i __b)169_mm256_packs_epi16(__m256i __a, __m256i __b) {
174{
175 return (__m256i)__builtin_ia32_packsswb256((__v16hi)__a, (__v16hi)__b);170 return (__m256i)__builtin_ia32_packsswb256((__v16hi)__a, (__v16hi)__b);
176}171}
177172
...@@ -201,9 +196,8 @@ _mm256_packs_epi16(__m256i __a, __m256i __b)...@@ -201,9 +196,8 @@ _mm256_packs_epi16(__m256i __a, __m256i __b)
201/// A 256-bit vector of [8 x i32] used to generate result[127:64] and196/// A 256-bit vector of [8 x i32] used to generate result[127:64] and
202/// result[255:192].197/// result[255:192].
203/// \returns A 256-bit vector of [16 x i16] containing the result.198/// \returns A 256-bit vector of [16 x i16] containing the result.
204static __inline__ __m256i __DEFAULT_FN_ATTRS256199static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
205_mm256_packs_epi32(__m256i __a, __m256i __b)200_mm256_packs_epi32(__m256i __a, __m256i __b) {
206{
207 return (__m256i)__builtin_ia32_packssdw256((__v8si)__a, (__v8si)__b);201 return (__m256i)__builtin_ia32_packssdw256((__v8si)__a, (__v8si)__b);
208}202}
209203
...@@ -232,9 +226,8 @@ _mm256_packs_epi32(__m256i __a, __m256i __b)...@@ -232,9 +226,8 @@ _mm256_packs_epi32(__m256i __a, __m256i __b)
232/// A 256-bit vector of [16 x i16] used to generate result[127:64] and226/// A 256-bit vector of [16 x i16] used to generate result[127:64] and
233/// result[255:192].227/// result[255:192].
234/// \returns A 256-bit integer vector containing the result.228/// \returns A 256-bit integer vector containing the result.
235static __inline__ __m256i __DEFAULT_FN_ATTRS256229static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
236_mm256_packus_epi16(__m256i __a, __m256i __b)230_mm256_packus_epi16(__m256i __a, __m256i __b) {
237{
238 return (__m256i)__builtin_ia32_packuswb256((__v16hi)__a, (__v16hi)__b);231 return (__m256i)__builtin_ia32_packuswb256((__v16hi)__a, (__v16hi)__b);
239}232}
240233
...@@ -264,9 +257,8 @@ _mm256_packus_epi16(__m256i __a, __m256i __b)...@@ -264,9 +257,8 @@ _mm256_packus_epi16(__m256i __a, __m256i __b)
264/// A 256-bit vector of [8 x i32] used to generate result[127:64] and257/// A 256-bit vector of [8 x i32] used to generate result[127:64] and
265/// result[255:192].258/// result[255:192].
266/// \returns A 256-bit vector of [16 x i16] containing the result.259/// \returns A 256-bit vector of [16 x i16] containing the result.
267static __inline__ __m256i __DEFAULT_FN_ATTRS256260static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
268_mm256_packus_epi32(__m256i __V1, __m256i __V2)261_mm256_packus_epi32(__m256i __V1, __m256i __V2) {
269{
270 return (__m256i) __builtin_ia32_packusdw256((__v8si)__V1, (__v8si)__V2);262 return (__m256i) __builtin_ia32_packusdw256((__v8si)__V1, (__v8si)__V2);
271}263}
272264
...@@ -283,9 +275,8 @@ _mm256_packus_epi32(__m256i __V1, __m256i __V2)...@@ -283,9 +275,8 @@ _mm256_packus_epi32(__m256i __V1, __m256i __V2)
283/// \param __b275/// \param __b
284/// A 256-bit integer vector containing one of the source operands.276/// A 256-bit integer vector containing one of the source operands.
285/// \returns A 256-bit integer vector containing the sums.277/// \returns A 256-bit integer vector containing the sums.
286static __inline__ __m256i __DEFAULT_FN_ATTRS256278static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
287_mm256_add_epi8(__m256i __a, __m256i __b)279_mm256_add_epi8(__m256i __a, __m256i __b) {
288{
289 return (__m256i)((__v32qu)__a + (__v32qu)__b);280 return (__m256i)((__v32qu)__a + (__v32qu)__b);
290}281}
291282
...@@ -302,9 +293,8 @@ _mm256_add_epi8(__m256i __a, __m256i __b)...@@ -302,9 +293,8 @@ _mm256_add_epi8(__m256i __a, __m256i __b)
302/// \param __b293/// \param __b
303/// A 256-bit vector of [16 x i16] containing one of the source operands.294/// A 256-bit vector of [16 x i16] containing one of the source operands.
304/// \returns A 256-bit vector of [16 x i16] containing the sums.295/// \returns A 256-bit vector of [16 x i16] containing the sums.
305static __inline__ __m256i __DEFAULT_FN_ATTRS256296static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
306_mm256_add_epi16(__m256i __a, __m256i __b)297_mm256_add_epi16(__m256i __a, __m256i __b) {
307{
308 return (__m256i)((__v16hu)__a + (__v16hu)__b);298 return (__m256i)((__v16hu)__a + (__v16hu)__b);
309}299}
310300
...@@ -321,9 +311,8 @@ _mm256_add_epi16(__m256i __a, __m256i __b)...@@ -321,9 +311,8 @@ _mm256_add_epi16(__m256i __a, __m256i __b)
321/// \param __b311/// \param __b
322/// A 256-bit vector of [8 x i32] containing one of the source operands.312/// A 256-bit vector of [8 x i32] containing one of the source operands.
323/// \returns A 256-bit vector of [8 x i32] containing the sums.313/// \returns A 256-bit vector of [8 x i32] containing the sums.
324static __inline__ __m256i __DEFAULT_FN_ATTRS256314static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
325_mm256_add_epi32(__m256i __a, __m256i __b)315_mm256_add_epi32(__m256i __a, __m256i __b) {
326{
327 return (__m256i)((__v8su)__a + (__v8su)__b);316 return (__m256i)((__v8su)__a + (__v8su)__b);
328}317}
329318
...@@ -340,9 +329,8 @@ _mm256_add_epi32(__m256i __a, __m256i __b)...@@ -340,9 +329,8 @@ _mm256_add_epi32(__m256i __a, __m256i __b)
340/// \param __b329/// \param __b
341/// A 256-bit vector of [4 x i64] containing one of the source operands.330/// A 256-bit vector of [4 x i64] containing one of the source operands.
342/// \returns A 256-bit vector of [4 x i64] containing the sums.331/// \returns A 256-bit vector of [4 x i64] containing the sums.
343static __inline__ __m256i __DEFAULT_FN_ATTRS256332static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
344_mm256_add_epi64(__m256i __a, __m256i __b)333_mm256_add_epi64(__m256i __a, __m256i __b) {
345{
346 return (__m256i)((__v4du)__a + (__v4du)__b);334 return (__m256i)((__v4du)__a + (__v4du)__b);
347}335}
348336
...@@ -359,9 +347,8 @@ _mm256_add_epi64(__m256i __a, __m256i __b)...@@ -359,9 +347,8 @@ _mm256_add_epi64(__m256i __a, __m256i __b)
359/// \param __b347/// \param __b
360/// A 256-bit integer vector containing one of the source operands.348/// A 256-bit integer vector containing one of the source operands.
361/// \returns A 256-bit integer vector containing the sums.349/// \returns A 256-bit integer vector containing the sums.
362static __inline__ __m256i __DEFAULT_FN_ATTRS256350static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
363_mm256_adds_epi8(__m256i __a, __m256i __b)351_mm256_adds_epi8(__m256i __a, __m256i __b) {
364{
365 return (__m256i)__builtin_elementwise_add_sat((__v32qs)__a, (__v32qs)__b);352 return (__m256i)__builtin_elementwise_add_sat((__v32qs)__a, (__v32qs)__b);
366}353}
367354
...@@ -377,9 +364,8 @@ _mm256_adds_epi8(__m256i __a, __m256i __b)...@@ -377,9 +364,8 @@ _mm256_adds_epi8(__m256i __a, __m256i __b)
377/// \param __b364/// \param __b
378/// A 256-bit vector of [16 x i16] containing one of the source operands.365/// A 256-bit vector of [16 x i16] containing one of the source operands.
379/// \returns A 256-bit vector of [16 x i16] containing the sums.366/// \returns A 256-bit vector of [16 x i16] containing the sums.
380static __inline__ __m256i __DEFAULT_FN_ATTRS256367static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
381_mm256_adds_epi16(__m256i __a, __m256i __b)368_mm256_adds_epi16(__m256i __a, __m256i __b) {
382{
383 return (__m256i)__builtin_elementwise_add_sat((__v16hi)__a, (__v16hi)__b);369 return (__m256i)__builtin_elementwise_add_sat((__v16hi)__a, (__v16hi)__b);
384}370}
385371
...@@ -396,9 +382,8 @@ _mm256_adds_epi16(__m256i __a, __m256i __b)...@@ -396,9 +382,8 @@ _mm256_adds_epi16(__m256i __a, __m256i __b)
396/// \param __b382/// \param __b
397/// A 256-bit integer vector containing one of the source operands.383/// A 256-bit integer vector containing one of the source operands.
398/// \returns A 256-bit integer vector containing the sums.384/// \returns A 256-bit integer vector containing the sums.
399static __inline__ __m256i __DEFAULT_FN_ATTRS256385static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
400_mm256_adds_epu8(__m256i __a, __m256i __b)386_mm256_adds_epu8(__m256i __a, __m256i __b) {
401{
402 return (__m256i)__builtin_elementwise_add_sat((__v32qu)__a, (__v32qu)__b);387 return (__m256i)__builtin_elementwise_add_sat((__v32qu)__a, (__v32qu)__b);
403}388}
404389
...@@ -414,9 +399,8 @@ _mm256_adds_epu8(__m256i __a, __m256i __b)...@@ -414,9 +399,8 @@ _mm256_adds_epu8(__m256i __a, __m256i __b)
414/// \param __b399/// \param __b
415/// A 256-bit vector of [16 x i16] containing one of the source operands.400/// A 256-bit vector of [16 x i16] containing one of the source operands.
416/// \returns A 256-bit vector of [16 x i16] containing the sums.401/// \returns A 256-bit vector of [16 x i16] containing the sums.
417static __inline__ __m256i __DEFAULT_FN_ATTRS256402static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
418_mm256_adds_epu16(__m256i __a, __m256i __b)403_mm256_adds_epu16(__m256i __a, __m256i __b) {
419{
420 return (__m256i)__builtin_elementwise_add_sat((__v16hu)__a, (__v16hu)__b);404 return (__m256i)__builtin_elementwise_add_sat((__v16hu)__a, (__v16hu)__b);
421}405}
422406
...@@ -460,7 +444,7 @@ _mm256_adds_epu16(__m256i __a, __m256i __b)...@@ -460,7 +444,7 @@ _mm256_adds_epu16(__m256i __a, __m256i __b)
460/// \param __b444/// \param __b
461/// A 256-bit integer vector.445/// A 256-bit integer vector.
462/// \returns A 256-bit integer vector containing the result.446/// \returns A 256-bit integer vector containing the result.
463static __inline__ __m256i __DEFAULT_FN_ATTRS256447static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
464_mm256_and_si256(__m256i __a, __m256i __b)448_mm256_and_si256(__m256i __a, __m256i __b)
465{449{
466 return (__m256i)((__v4du)__a & (__v4du)__b);450 return (__m256i)((__v4du)__a & (__v4du)__b);
...@@ -478,7 +462,7 @@ _mm256_and_si256(__m256i __a, __m256i __b)...@@ -478,7 +462,7 @@ _mm256_and_si256(__m256i __a, __m256i __b)
478/// \param __b462/// \param __b
479/// A 256-bit integer vector.463/// A 256-bit integer vector.
480/// \returns A 256-bit integer vector containing the result.464/// \returns A 256-bit integer vector containing the result.
481static __inline__ __m256i __DEFAULT_FN_ATTRS256465static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
482_mm256_andnot_si256(__m256i __a, __m256i __b)466_mm256_andnot_si256(__m256i __a, __m256i __b)
483{467{
484 return (__m256i)(~(__v4du)__a & (__v4du)__b);468 return (__m256i)(~(__v4du)__a & (__v4du)__b);
...@@ -504,10 +488,9 @@ _mm256_andnot_si256(__m256i __a, __m256i __b)...@@ -504,10 +488,9 @@ _mm256_andnot_si256(__m256i __a, __m256i __b)
504/// \param __b488/// \param __b
505/// A 256-bit integer vector.489/// A 256-bit integer vector.
506/// \returns A 256-bit integer vector containing the result.490/// \returns A 256-bit integer vector containing the result.
507static __inline__ __m256i __DEFAULT_FN_ATTRS256491static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
508_mm256_avg_epu8(__m256i __a, __m256i __b)492_mm256_avg_epu8(__m256i __a, __m256i __b) {
509{493 return (__m256i)__builtin_ia32_pavgb256((__v32qu)__a, (__v32qu)__b);
510 return (__m256i)__builtin_ia32_pavgb256((__v32qi)__a, (__v32qi)__b);
511}494}
512495
513/// Computes the averages of the corresponding unsigned 16-bit integers in496/// Computes the averages of the corresponding unsigned 16-bit integers in
...@@ -530,10 +513,9 @@ _mm256_avg_epu8(__m256i __a, __m256i __b)...@@ -530,10 +513,9 @@ _mm256_avg_epu8(__m256i __a, __m256i __b)
530/// \param __b513/// \param __b
531/// A 256-bit vector of [16 x i16].514/// A 256-bit vector of [16 x i16].
532/// \returns A 256-bit vector of [16 x i16] containing the result.515/// \returns A 256-bit vector of [16 x i16] containing the result.
533static __inline__ __m256i __DEFAULT_FN_ATTRS256516static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
534_mm256_avg_epu16(__m256i __a, __m256i __b)517_mm256_avg_epu16(__m256i __a, __m256i __b) {
535{518 return (__m256i)__builtin_ia32_pavgw256((__v16hu)__a, (__v16hu)__b);
536 return (__m256i)__builtin_ia32_pavgw256((__v16hi)__a, (__v16hi)__b);
537}519}
538520
539/// Merges 8-bit integer values from either of the two 256-bit vectors521/// Merges 8-bit integer values from either of the two 256-bit vectors
...@@ -565,9 +547,8 @@ _mm256_avg_epu16(__m256i __a, __m256i __b)...@@ -565,9 +547,8 @@ _mm256_avg_epu16(__m256i __a, __m256i __b)
565/// is 0, the byte is copied from \a __V1; otherwise, it is copied from547/// is 0, the byte is copied from \a __V1; otherwise, it is copied from
566/// \a __V2.548/// \a __V2.
567/// \returns A 256-bit integer vector containing the result.549/// \returns A 256-bit integer vector containing the result.
568static __inline__ __m256i __DEFAULT_FN_ATTRS256550static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
569_mm256_blendv_epi8(__m256i __V1, __m256i __V2, __m256i __M)551_mm256_blendv_epi8(__m256i __V1, __m256i __V2, __m256i __M) {
570{
571 return (__m256i)__builtin_ia32_pblendvb256((__v32qi)__V1, (__v32qi)__V2,552 return (__m256i)__builtin_ia32_pblendvb256((__v32qi)__V1, (__v32qi)__V2,
572 (__v32qi)__M);553 (__v32qi)__M);
573}554}
...@@ -633,7 +614,7 @@ _mm256_blendv_epi8(__m256i __V1, __m256i __V2, __m256i __M)...@@ -633,7 +614,7 @@ _mm256_blendv_epi8(__m256i __V1, __m256i __V2, __m256i __M)
633/// \param __b614/// \param __b
634/// A 256-bit integer vector containing one of the inputs.615/// A 256-bit integer vector containing one of the inputs.
635/// \returns A 256-bit integer vector containing the result.616/// \returns A 256-bit integer vector containing the result.
636static __inline__ __m256i __DEFAULT_FN_ATTRS256617static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
637_mm256_cmpeq_epi8(__m256i __a, __m256i __b)618_mm256_cmpeq_epi8(__m256i __a, __m256i __b)
638{619{
639 return (__m256i)((__v32qi)__a == (__v32qi)__b);620 return (__m256i)((__v32qi)__a == (__v32qi)__b);
...@@ -659,7 +640,7 @@ _mm256_cmpeq_epi8(__m256i __a, __m256i __b)...@@ -659,7 +640,7 @@ _mm256_cmpeq_epi8(__m256i __a, __m256i __b)
659/// \param __b640/// \param __b
660/// A 256-bit vector of [16 x i16] containing one of the inputs.641/// A 256-bit vector of [16 x i16] containing one of the inputs.
661/// \returns A 256-bit vector of [16 x i16] containing the result.642/// \returns A 256-bit vector of [16 x i16] containing the result.
662static __inline__ __m256i __DEFAULT_FN_ATTRS256643static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
663_mm256_cmpeq_epi16(__m256i __a, __m256i __b)644_mm256_cmpeq_epi16(__m256i __a, __m256i __b)
664{645{
665 return (__m256i)((__v16hi)__a == (__v16hi)__b);646 return (__m256i)((__v16hi)__a == (__v16hi)__b);
...@@ -685,7 +666,7 @@ _mm256_cmpeq_epi16(__m256i __a, __m256i __b)...@@ -685,7 +666,7 @@ _mm256_cmpeq_epi16(__m256i __a, __m256i __b)
685/// \param __b666/// \param __b
686/// A 256-bit vector of [8 x i32] containing one of the inputs.667/// A 256-bit vector of [8 x i32] containing one of the inputs.
687/// \returns A 256-bit vector of [8 x i32] containing the result.668/// \returns A 256-bit vector of [8 x i32] containing the result.
688static __inline__ __m256i __DEFAULT_FN_ATTRS256669static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
689_mm256_cmpeq_epi32(__m256i __a, __m256i __b)670_mm256_cmpeq_epi32(__m256i __a, __m256i __b)
690{671{
691 return (__m256i)((__v8si)__a == (__v8si)__b);672 return (__m256i)((__v8si)__a == (__v8si)__b);
...@@ -711,7 +692,7 @@ _mm256_cmpeq_epi32(__m256i __a, __m256i __b)...@@ -711,7 +692,7 @@ _mm256_cmpeq_epi32(__m256i __a, __m256i __b)
711/// \param __b692/// \param __b
712/// A 256-bit vector of [4 x i64] containing one of the inputs.693/// A 256-bit vector of [4 x i64] containing one of the inputs.
713/// \returns A 256-bit vector of [4 x i64] containing the result.694/// \returns A 256-bit vector of [4 x i64] containing the result.
714static __inline__ __m256i __DEFAULT_FN_ATTRS256695static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
715_mm256_cmpeq_epi64(__m256i __a, __m256i __b)696_mm256_cmpeq_epi64(__m256i __a, __m256i __b)
716{697{
717 return (__m256i)((__v4di)__a == (__v4di)__b);698 return (__m256i)((__v4di)__a == (__v4di)__b);
...@@ -737,7 +718,7 @@ _mm256_cmpeq_epi64(__m256i __a, __m256i __b)...@@ -737,7 +718,7 @@ _mm256_cmpeq_epi64(__m256i __a, __m256i __b)
737/// \param __b718/// \param __b
738/// A 256-bit integer vector containing one of the inputs.719/// A 256-bit integer vector containing one of the inputs.
739/// \returns A 256-bit integer vector containing the result.720/// \returns A 256-bit integer vector containing the result.
740static __inline__ __m256i __DEFAULT_FN_ATTRS256721static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
741_mm256_cmpgt_epi8(__m256i __a, __m256i __b)722_mm256_cmpgt_epi8(__m256i __a, __m256i __b)
742{723{
743 /* This function always performs a signed comparison, but __v32qi is a char724 /* This function always performs a signed comparison, but __v32qi is a char
...@@ -765,7 +746,7 @@ _mm256_cmpgt_epi8(__m256i __a, __m256i __b)...@@ -765,7 +746,7 @@ _mm256_cmpgt_epi8(__m256i __a, __m256i __b)
765/// \param __b746/// \param __b
766/// A 256-bit vector of [16 x i16] containing one of the inputs.747/// A 256-bit vector of [16 x i16] containing one of the inputs.
767/// \returns A 256-bit vector of [16 x i16] containing the result.748/// \returns A 256-bit vector of [16 x i16] containing the result.
768static __inline__ __m256i __DEFAULT_FN_ATTRS256749static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
769_mm256_cmpgt_epi16(__m256i __a, __m256i __b)750_mm256_cmpgt_epi16(__m256i __a, __m256i __b)
770{751{
771 return (__m256i)((__v16hi)__a > (__v16hi)__b);752 return (__m256i)((__v16hi)__a > (__v16hi)__b);
...@@ -791,7 +772,7 @@ _mm256_cmpgt_epi16(__m256i __a, __m256i __b)...@@ -791,7 +772,7 @@ _mm256_cmpgt_epi16(__m256i __a, __m256i __b)
791/// \param __b772/// \param __b
792/// A 256-bit vector of [8 x i32] containing one of the inputs.773/// A 256-bit vector of [8 x i32] containing one of the inputs.
793/// \returns A 256-bit vector of [8 x i32] containing the result.774/// \returns A 256-bit vector of [8 x i32] containing the result.
794static __inline__ __m256i __DEFAULT_FN_ATTRS256775static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
795_mm256_cmpgt_epi32(__m256i __a, __m256i __b)776_mm256_cmpgt_epi32(__m256i __a, __m256i __b)
796{777{
797 return (__m256i)((__v8si)__a > (__v8si)__b);778 return (__m256i)((__v8si)__a > (__v8si)__b);
...@@ -817,7 +798,7 @@ _mm256_cmpgt_epi32(__m256i __a, __m256i __b)...@@ -817,7 +798,7 @@ _mm256_cmpgt_epi32(__m256i __a, __m256i __b)
817/// \param __b798/// \param __b
818/// A 256-bit vector of [4 x i64] containing one of the inputs.799/// A 256-bit vector of [4 x i64] containing one of the inputs.
819/// \returns A 256-bit vector of [4 x i64] containing the result.800/// \returns A 256-bit vector of [4 x i64] containing the result.
820static __inline__ __m256i __DEFAULT_FN_ATTRS256801static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
821_mm256_cmpgt_epi64(__m256i __a, __m256i __b)802_mm256_cmpgt_epi64(__m256i __a, __m256i __b)
822{803{
823 return (__m256i)((__v4di)__a > (__v4di)__b);804 return (__m256i)((__v4di)__a > (__v4di)__b);
...@@ -853,10 +834,9 @@ _mm256_cmpgt_epi64(__m256i __a, __m256i __b)...@@ -853,10 +834,9 @@ _mm256_cmpgt_epi64(__m256i __a, __m256i __b)
853/// \param __b834/// \param __b
854/// A 256-bit vector of [16 x i16] containing one of the source operands.835/// A 256-bit vector of [16 x i16] containing one of the source operands.
855/// \returns A 256-bit vector of [16 x i16] containing the sums.836/// \returns A 256-bit vector of [16 x i16] containing the sums.
856static __inline__ __m256i __DEFAULT_FN_ATTRS256837static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
857_mm256_hadd_epi16(__m256i __a, __m256i __b)838_mm256_hadd_epi16(__m256i __a, __m256i __b) {
858{839 return (__m256i)__builtin_ia32_phaddw256((__v16hi)__a, (__v16hi)__b);
859 return (__m256i)__builtin_ia32_phaddw256((__v16hi)__a, (__v16hi)__b);
860}840}
861841
862/// Horizontally adds the adjacent pairs of 32-bit integers from two 256-bit842/// Horizontally adds the adjacent pairs of 32-bit integers from two 256-bit
...@@ -885,10 +865,9 @@ _mm256_hadd_epi16(__m256i __a, __m256i __b)...@@ -885,10 +865,9 @@ _mm256_hadd_epi16(__m256i __a, __m256i __b)
885/// \param __b865/// \param __b
886/// A 256-bit vector of [8 x i32] containing one of the source operands.866/// A 256-bit vector of [8 x i32] containing one of the source operands.
887/// \returns A 256-bit vector of [8 x i32] containing the sums.867/// \returns A 256-bit vector of [8 x i32] containing the sums.
888static __inline__ __m256i __DEFAULT_FN_ATTRS256868static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
889_mm256_hadd_epi32(__m256i __a, __m256i __b)869_mm256_hadd_epi32(__m256i __a, __m256i __b) {
890{870 return (__m256i)__builtin_ia32_phaddd256((__v8si)__a, (__v8si)__b);
891 return (__m256i)__builtin_ia32_phaddd256((__v8si)__a, (__v8si)__b);
892}871}
893872
894/// Horizontally adds the adjacent pairs of 16-bit integers from two 256-bit873/// Horizontally adds the adjacent pairs of 16-bit integers from two 256-bit
...@@ -920,10 +899,9 @@ _mm256_hadd_epi32(__m256i __a, __m256i __b)...@@ -920,10 +899,9 @@ _mm256_hadd_epi32(__m256i __a, __m256i __b)
920/// \param __b899/// \param __b
921/// A 256-bit vector of [16 x i16] containing one of the source operands.900/// A 256-bit vector of [16 x i16] containing one of the source operands.
922/// \returns A 256-bit vector of [16 x i16] containing the sums.901/// \returns A 256-bit vector of [16 x i16] containing the sums.
923static __inline__ __m256i __DEFAULT_FN_ATTRS256902static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
924_mm256_hadds_epi16(__m256i __a, __m256i __b)903_mm256_hadds_epi16(__m256i __a, __m256i __b) {
925{904 return (__m256i)__builtin_ia32_phaddsw256((__v16hi)__a, (__v16hi)__b);
926 return (__m256i)__builtin_ia32_phaddsw256((__v16hi)__a, (__v16hi)__b);
927}905}
928906
929/// Horizontally subtracts adjacent pairs of 16-bit integers from two 256-bit907/// Horizontally subtracts adjacent pairs of 16-bit integers from two 256-bit
...@@ -956,10 +934,9 @@ _mm256_hadds_epi16(__m256i __a, __m256i __b)...@@ -956,10 +934,9 @@ _mm256_hadds_epi16(__m256i __a, __m256i __b)
956/// \param __b934/// \param __b
957/// A 256-bit vector of [16 x i16] containing one of the source operands.935/// A 256-bit vector of [16 x i16] containing one of the source operands.
958/// \returns A 256-bit vector of [16 x i16] containing the differences.936/// \returns A 256-bit vector of [16 x i16] containing the differences.
959static __inline__ __m256i __DEFAULT_FN_ATTRS256937static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
960_mm256_hsub_epi16(__m256i __a, __m256i __b)938_mm256_hsub_epi16(__m256i __a, __m256i __b) {
961{939 return (__m256i)__builtin_ia32_phsubw256((__v16hi)__a, (__v16hi)__b);
962 return (__m256i)__builtin_ia32_phsubw256((__v16hi)__a, (__v16hi)__b);
963}940}
964941
965/// Horizontally subtracts adjacent pairs of 32-bit integers from two 256-bit942/// Horizontally subtracts adjacent pairs of 32-bit integers from two 256-bit
...@@ -988,10 +965,9 @@ _mm256_hsub_epi16(__m256i __a, __m256i __b)...@@ -988,10 +965,9 @@ _mm256_hsub_epi16(__m256i __a, __m256i __b)
988/// \param __b965/// \param __b
989/// A 256-bit vector of [8 x i32] containing one of the source operands.966/// A 256-bit vector of [8 x i32] containing one of the source operands.
990/// \returns A 256-bit vector of [8 x i32] containing the differences.967/// \returns A 256-bit vector of [8 x i32] containing the differences.
991static __inline__ __m256i __DEFAULT_FN_ATTRS256968static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
992_mm256_hsub_epi32(__m256i __a, __m256i __b)969_mm256_hsub_epi32(__m256i __a, __m256i __b) {
993{970 return (__m256i)__builtin_ia32_phsubd256((__v8si)__a, (__v8si)__b);
994 return (__m256i)__builtin_ia32_phsubd256((__v8si)__a, (__v8si)__b);
995}971}
996972
997/// Horizontally subtracts adjacent pairs of 16-bit integers from two 256-bit973/// Horizontally subtracts adjacent pairs of 16-bit integers from two 256-bit
...@@ -1024,10 +1000,9 @@ _mm256_hsub_epi32(__m256i __a, __m256i __b)...@@ -1024,10 +1000,9 @@ _mm256_hsub_epi32(__m256i __a, __m256i __b)
1024/// \param __b1000/// \param __b
1025/// A 256-bit vector of [16 x i16] containing one of the source operands.1001/// A 256-bit vector of [16 x i16] containing one of the source operands.
1026/// \returns A 256-bit vector of [16 x i16] containing the differences.1002/// \returns A 256-bit vector of [16 x i16] containing the differences.
1027static __inline__ __m256i __DEFAULT_FN_ATTRS2561003static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1028_mm256_hsubs_epi16(__m256i __a, __m256i __b)1004_mm256_hsubs_epi16(__m256i __a, __m256i __b) {
1029{1005 return (__m256i)__builtin_ia32_phsubsw256((__v16hi)__a, (__v16hi)__b);
1030 return (__m256i)__builtin_ia32_phsubsw256((__v16hi)__a, (__v16hi)__b);
1031}1006}
10321007
1033/// Multiplies each unsigned byte from the 256-bit integer vector in \a __a1008/// Multiplies each unsigned byte from the 256-bit integer vector in \a __a
...@@ -1054,10 +1029,9 @@ _mm256_hsubs_epi16(__m256i __a, __m256i __b)...@@ -1054,10 +1029,9 @@ _mm256_hsubs_epi16(__m256i __a, __m256i __b)
1054/// \param __b1029/// \param __b
1055/// A 256-bit vector containing one of the source operands.1030/// A 256-bit vector containing one of the source operands.
1056/// \returns A 256-bit vector of [16 x i16] containing the result.1031/// \returns A 256-bit vector of [16 x i16] containing the result.
1057static __inline__ __m256i __DEFAULT_FN_ATTRS2561032static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1058_mm256_maddubs_epi16(__m256i __a, __m256i __b)1033_mm256_maddubs_epi16(__m256i __a, __m256i __b) {
1059{1034 return (__m256i)__builtin_ia32_pmaddubsw256((__v32qi)__a, (__v32qi)__b);
1060 return (__m256i)__builtin_ia32_pmaddubsw256((__v32qi)__a, (__v32qi)__b);
1061}1035}
10621036
1063/// Multiplies corresponding 16-bit elements of two 256-bit vectors of1037/// Multiplies corresponding 16-bit elements of two 256-bit vectors of
...@@ -1086,9 +1060,8 @@ _mm256_maddubs_epi16(__m256i __a, __m256i __b)...@@ -1086,9 +1060,8 @@ _mm256_maddubs_epi16(__m256i __a, __m256i __b)
1086/// \param __b1060/// \param __b
1087/// A 256-bit vector of [16 x i16] containing one of the source operands.1061/// A 256-bit vector of [16 x i16] containing one of the source operands.
1088/// \returns A 256-bit vector of [8 x i32] containing the result.1062/// \returns A 256-bit vector of [8 x i32] containing the result.
1089static __inline__ __m256i __DEFAULT_FN_ATTRS2561063static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1090_mm256_madd_epi16(__m256i __a, __m256i __b)1064_mm256_madd_epi16(__m256i __a, __m256i __b) {
1091{
1092 return (__m256i)__builtin_ia32_pmaddwd256((__v16hi)__a, (__v16hi)__b);1065 return (__m256i)__builtin_ia32_pmaddwd256((__v16hi)__a, (__v16hi)__b);
1093}1066}
10941067
...@@ -1105,9 +1078,8 @@ _mm256_madd_epi16(__m256i __a, __m256i __b)...@@ -1105,9 +1078,8 @@ _mm256_madd_epi16(__m256i __a, __m256i __b)
1105/// \param __b1078/// \param __b
1106/// A 256-bit integer vector.1079/// A 256-bit integer vector.
1107/// \returns A 256-bit integer vector containing the result.1080/// \returns A 256-bit integer vector containing the result.
1108static __inline__ __m256i __DEFAULT_FN_ATTRS2561081static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1109_mm256_max_epi8(__m256i __a, __m256i __b)1082_mm256_max_epi8(__m256i __a, __m256i __b) {
1110{
1111 return (__m256i)__builtin_elementwise_max((__v32qs)__a, (__v32qs)__b);1083 return (__m256i)__builtin_elementwise_max((__v32qs)__a, (__v32qs)__b);
1112}1084}
11131085
...@@ -1124,9 +1096,8 @@ _mm256_max_epi8(__m256i __a, __m256i __b)...@@ -1124,9 +1096,8 @@ _mm256_max_epi8(__m256i __a, __m256i __b)
1124/// \param __b1096/// \param __b
1125/// A 256-bit vector of [16 x i16].1097/// A 256-bit vector of [16 x i16].
1126/// \returns A 256-bit vector of [16 x i16] containing the result.1098/// \returns A 256-bit vector of [16 x i16] containing the result.
1127static __inline__ __m256i __DEFAULT_FN_ATTRS2561099static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1128_mm256_max_epi16(__m256i __a, __m256i __b)1100_mm256_max_epi16(__m256i __a, __m256i __b) {
1129{
1130 return (__m256i)__builtin_elementwise_max((__v16hi)__a, (__v16hi)__b);1101 return (__m256i)__builtin_elementwise_max((__v16hi)__a, (__v16hi)__b);
1131}1102}
11321103
...@@ -1143,9 +1114,8 @@ _mm256_max_epi16(__m256i __a, __m256i __b)...@@ -1143,9 +1114,8 @@ _mm256_max_epi16(__m256i __a, __m256i __b)
1143/// \param __b1114/// \param __b
1144/// A 256-bit vector of [8 x i32].1115/// A 256-bit vector of [8 x i32].
1145/// \returns A 256-bit vector of [8 x i32] containing the result.1116/// \returns A 256-bit vector of [8 x i32] containing the result.
1146static __inline__ __m256i __DEFAULT_FN_ATTRS2561117static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1147_mm256_max_epi32(__m256i __a, __m256i __b)1118_mm256_max_epi32(__m256i __a, __m256i __b) {
1148{
1149 return (__m256i)__builtin_elementwise_max((__v8si)__a, (__v8si)__b);1119 return (__m256i)__builtin_elementwise_max((__v8si)__a, (__v8si)__b);
1150}1120}
11511121
...@@ -1162,9 +1132,8 @@ _mm256_max_epi32(__m256i __a, __m256i __b)...@@ -1162,9 +1132,8 @@ _mm256_max_epi32(__m256i __a, __m256i __b)
1162/// \param __b1132/// \param __b
1163/// A 256-bit integer vector.1133/// A 256-bit integer vector.
1164/// \returns A 256-bit integer vector containing the result.1134/// \returns A 256-bit integer vector containing the result.
1165static __inline__ __m256i __DEFAULT_FN_ATTRS2561135static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1166_mm256_max_epu8(__m256i __a, __m256i __b)1136_mm256_max_epu8(__m256i __a, __m256i __b) {
1167{
1168 return (__m256i)__builtin_elementwise_max((__v32qu)__a, (__v32qu)__b);1137 return (__m256i)__builtin_elementwise_max((__v32qu)__a, (__v32qu)__b);
1169}1138}
11701139
...@@ -1181,9 +1150,8 @@ _mm256_max_epu8(__m256i __a, __m256i __b)...@@ -1181,9 +1150,8 @@ _mm256_max_epu8(__m256i __a, __m256i __b)
1181/// \param __b1150/// \param __b
1182/// A 256-bit vector of [16 x i16].1151/// A 256-bit vector of [16 x i16].
1183/// \returns A 256-bit vector of [16 x i16] containing the result.1152/// \returns A 256-bit vector of [16 x i16] containing the result.
1184static __inline__ __m256i __DEFAULT_FN_ATTRS2561153static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1185_mm256_max_epu16(__m256i __a, __m256i __b)1154_mm256_max_epu16(__m256i __a, __m256i __b) {
1186{
1187 return (__m256i)__builtin_elementwise_max((__v16hu)__a, (__v16hu)__b);1155 return (__m256i)__builtin_elementwise_max((__v16hu)__a, (__v16hu)__b);
1188}1156}
11891157
...@@ -1200,9 +1168,8 @@ _mm256_max_epu16(__m256i __a, __m256i __b)...@@ -1200,9 +1168,8 @@ _mm256_max_epu16(__m256i __a, __m256i __b)
1200/// \param __b1168/// \param __b
1201/// A 256-bit vector of [8 x i32].1169/// A 256-bit vector of [8 x i32].
1202/// \returns A 256-bit vector of [8 x i32] containing the result.1170/// \returns A 256-bit vector of [8 x i32] containing the result.
1203static __inline__ __m256i __DEFAULT_FN_ATTRS2561171static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1204_mm256_max_epu32(__m256i __a, __m256i __b)1172_mm256_max_epu32(__m256i __a, __m256i __b) {
1205{
1206 return (__m256i)__builtin_elementwise_max((__v8su)__a, (__v8su)__b);1173 return (__m256i)__builtin_elementwise_max((__v8su)__a, (__v8su)__b);
1207}1174}
12081175
...@@ -1219,9 +1186,8 @@ _mm256_max_epu32(__m256i __a, __m256i __b)...@@ -1219,9 +1186,8 @@ _mm256_max_epu32(__m256i __a, __m256i __b)
1219/// \param __b1186/// \param __b
1220/// A 256-bit integer vector.1187/// A 256-bit integer vector.
1221/// \returns A 256-bit integer vector containing the result.1188/// \returns A 256-bit integer vector containing the result.
1222static __inline__ __m256i __DEFAULT_FN_ATTRS2561189static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1223_mm256_min_epi8(__m256i __a, __m256i __b)1190_mm256_min_epi8(__m256i __a, __m256i __b) {
1224{
1225 return (__m256i)__builtin_elementwise_min((__v32qs)__a, (__v32qs)__b);1191 return (__m256i)__builtin_elementwise_min((__v32qs)__a, (__v32qs)__b);
1226}1192}
12271193
...@@ -1238,9 +1204,8 @@ _mm256_min_epi8(__m256i __a, __m256i __b)...@@ -1238,9 +1204,8 @@ _mm256_min_epi8(__m256i __a, __m256i __b)
1238/// \param __b1204/// \param __b
1239/// A 256-bit vector of [16 x i16].1205/// A 256-bit vector of [16 x i16].
1240/// \returns A 256-bit vector of [16 x i16] containing the result.1206/// \returns A 256-bit vector of [16 x i16] containing the result.
1241static __inline__ __m256i __DEFAULT_FN_ATTRS2561207static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1242_mm256_min_epi16(__m256i __a, __m256i __b)1208_mm256_min_epi16(__m256i __a, __m256i __b) {
1243{
1244 return (__m256i)__builtin_elementwise_min((__v16hi)__a, (__v16hi)__b);1209 return (__m256i)__builtin_elementwise_min((__v16hi)__a, (__v16hi)__b);
1245}1210}
12461211
...@@ -1257,9 +1222,8 @@ _mm256_min_epi16(__m256i __a, __m256i __b)...@@ -1257,9 +1222,8 @@ _mm256_min_epi16(__m256i __a, __m256i __b)
1257/// \param __b1222/// \param __b
1258/// A 256-bit vector of [8 x i32].1223/// A 256-bit vector of [8 x i32].
1259/// \returns A 256-bit vector of [8 x i32] containing the result.1224/// \returns A 256-bit vector of [8 x i32] containing the result.
1260static __inline__ __m256i __DEFAULT_FN_ATTRS2561225static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1261_mm256_min_epi32(__m256i __a, __m256i __b)1226_mm256_min_epi32(__m256i __a, __m256i __b) {
1262{
1263 return (__m256i)__builtin_elementwise_min((__v8si)__a, (__v8si)__b);1227 return (__m256i)__builtin_elementwise_min((__v8si)__a, (__v8si)__b);
1264}1228}
12651229
...@@ -1276,9 +1240,8 @@ _mm256_min_epi32(__m256i __a, __m256i __b)...@@ -1276,9 +1240,8 @@ _mm256_min_epi32(__m256i __a, __m256i __b)
1276/// \param __b1240/// \param __b
1277/// A 256-bit integer vector.1241/// A 256-bit integer vector.
1278/// \returns A 256-bit integer vector containing the result.1242/// \returns A 256-bit integer vector containing the result.
1279static __inline__ __m256i __DEFAULT_FN_ATTRS2561243static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1280_mm256_min_epu8(__m256i __a, __m256i __b)1244_mm256_min_epu8(__m256i __a, __m256i __b) {
1281{
1282 return (__m256i)__builtin_elementwise_min((__v32qu)__a, (__v32qu)__b);1245 return (__m256i)__builtin_elementwise_min((__v32qu)__a, (__v32qu)__b);
1283}1246}
12841247
...@@ -1295,9 +1258,8 @@ _mm256_min_epu8(__m256i __a, __m256i __b)...@@ -1295,9 +1258,8 @@ _mm256_min_epu8(__m256i __a, __m256i __b)
1295/// \param __b1258/// \param __b
1296/// A 256-bit vector of [16 x i16].1259/// A 256-bit vector of [16 x i16].
1297/// \returns A 256-bit vector of [16 x i16] containing the result.1260/// \returns A 256-bit vector of [16 x i16] containing the result.
1298static __inline__ __m256i __DEFAULT_FN_ATTRS2561261static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1299_mm256_min_epu16(__m256i __a, __m256i __b)1262_mm256_min_epu16(__m256i __a, __m256i __b) {
1300{
1301 return (__m256i)__builtin_elementwise_min((__v16hu)__a, (__v16hu)__b);1263 return (__m256i)__builtin_elementwise_min((__v16hu)__a, (__v16hu)__b);
1302}1264}
13031265
...@@ -1314,9 +1276,8 @@ _mm256_min_epu16(__m256i __a, __m256i __b)...@@ -1314,9 +1276,8 @@ _mm256_min_epu16(__m256i __a, __m256i __b)
1314/// \param __b1276/// \param __b
1315/// A 256-bit vector of [8 x i32].1277/// A 256-bit vector of [8 x i32].
1316/// \returns A 256-bit vector of [8 x i32] containing the result.1278/// \returns A 256-bit vector of [8 x i32] containing the result.
1317static __inline__ __m256i __DEFAULT_FN_ATTRS2561279static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1318_mm256_min_epu32(__m256i __a, __m256i __b)1280_mm256_min_epu32(__m256i __a, __m256i __b) {
1319{
1320 return (__m256i)__builtin_elementwise_min((__v8su)__a, (__v8su)__b);1281 return (__m256i)__builtin_elementwise_min((__v8su)__a, (__v8su)__b);
1321}1282}
13221283
...@@ -1337,9 +1298,8 @@ _mm256_min_epu32(__m256i __a, __m256i __b)...@@ -1337,9 +1298,8 @@ _mm256_min_epu32(__m256i __a, __m256i __b)
1337/// \param __a1298/// \param __a
1338/// A 256-bit integer vector containing the source bytes.1299/// A 256-bit integer vector containing the source bytes.
1339/// \returns The 32-bit integer mask.1300/// \returns The 32-bit integer mask.
1340static __inline__ int __DEFAULT_FN_ATTRS2561301static __inline__ int __DEFAULT_FN_ATTRS256_CONSTEXPR
1341_mm256_movemask_epi8(__m256i __a)1302_mm256_movemask_epi8(__m256i __a) {
1342{
1343 return __builtin_ia32_pmovmskb256((__v32qi)__a);1303 return __builtin_ia32_pmovmskb256((__v32qi)__a);
1344}1304}
13451305
...@@ -1363,9 +1323,8 @@ _mm256_movemask_epi8(__m256i __a)...@@ -1363,9 +1323,8 @@ _mm256_movemask_epi8(__m256i __a)
1363/// A 128-bit integer vector containing the source bytes.1323/// A 128-bit integer vector containing the source bytes.
1364/// \returns A 256-bit vector of [16 x i16] containing the sign-extended1324/// \returns A 256-bit vector of [16 x i16] containing the sign-extended
1365/// values.1325/// values.
1366static __inline__ __m256i __DEFAULT_FN_ATTRS2561326static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1367_mm256_cvtepi8_epi16(__m128i __V)1327_mm256_cvtepi8_epi16(__m128i __V) {
1368{
1369 /* This function always performs a signed extension, but __v16qi is a char1328 /* This function always performs a signed extension, but __v16qi is a char
1370 which may be signed or unsigned, so use __v16qs. */1329 which may be signed or unsigned, so use __v16qs. */
1371 return (__m256i)__builtin_convertvector((__v16qs)__V, __v16hi);1330 return (__m256i)__builtin_convertvector((__v16qs)__V, __v16hi);
...@@ -1391,9 +1350,8 @@ _mm256_cvtepi8_epi16(__m128i __V)...@@ -1391,9 +1350,8 @@ _mm256_cvtepi8_epi16(__m128i __V)
1391/// A 128-bit integer vector containing the source bytes.1350/// A 128-bit integer vector containing the source bytes.
1392/// \returns A 256-bit vector of [8 x i32] containing the sign-extended1351/// \returns A 256-bit vector of [8 x i32] containing the sign-extended
1393/// values.1352/// values.
1394static __inline__ __m256i __DEFAULT_FN_ATTRS2561353static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1395_mm256_cvtepi8_epi32(__m128i __V)1354_mm256_cvtepi8_epi32(__m128i __V) {
1396{
1397 /* This function always performs a signed extension, but __v16qi is a char1355 /* This function always performs a signed extension, but __v16qi is a char
1398 which may be signed or unsigned, so use __v16qs. */1356 which may be signed or unsigned, so use __v16qs. */
1399 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si);1357 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si);
...@@ -1418,9 +1376,8 @@ _mm256_cvtepi8_epi32(__m128i __V)...@@ -1418,9 +1376,8 @@ _mm256_cvtepi8_epi32(__m128i __V)
1418/// A 128-bit integer vector containing the source bytes.1376/// A 128-bit integer vector containing the source bytes.
1419/// \returns A 256-bit vector of [4 x i64] containing the sign-extended1377/// \returns A 256-bit vector of [4 x i64] containing the sign-extended
1420/// values.1378/// values.
1421static __inline__ __m256i __DEFAULT_FN_ATTRS2561379static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1422_mm256_cvtepi8_epi64(__m128i __V)1380_mm256_cvtepi8_epi64(__m128i __V) {
1423{
1424 /* This function always performs a signed extension, but __v16qi is a char1381 /* This function always performs a signed extension, but __v16qi is a char
1425 which may be signed or unsigned, so use __v16qs. */1382 which may be signed or unsigned, so use __v16qs. */
1426 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3), __v4di);1383 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3), __v4di);
...@@ -1446,9 +1403,8 @@ _mm256_cvtepi8_epi64(__m128i __V)...@@ -1446,9 +1403,8 @@ _mm256_cvtepi8_epi64(__m128i __V)
1446/// A 128-bit vector of [8 x i16] containing the source values.1403/// A 128-bit vector of [8 x i16] containing the source values.
1447/// \returns A 256-bit vector of [8 x i32] containing the sign-extended1404/// \returns A 256-bit vector of [8 x i32] containing the sign-extended
1448/// values.1405/// values.
1449static __inline__ __m256i __DEFAULT_FN_ATTRS2561406static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1450_mm256_cvtepi16_epi32(__m128i __V)1407_mm256_cvtepi16_epi32(__m128i __V) {
1451{
1452 return (__m256i)__builtin_convertvector((__v8hi)__V, __v8si);1408 return (__m256i)__builtin_convertvector((__v8hi)__V, __v8si);
1453}1409}
14541410
...@@ -1471,9 +1427,8 @@ _mm256_cvtepi16_epi32(__m128i __V)...@@ -1471,9 +1427,8 @@ _mm256_cvtepi16_epi32(__m128i __V)
1471/// A 128-bit vector of [8 x i16] containing the source values.1427/// A 128-bit vector of [8 x i16] containing the source values.
1472/// \returns A 256-bit vector of [4 x i64] containing the sign-extended1428/// \returns A 256-bit vector of [4 x i64] containing the sign-extended
1473/// values.1429/// values.
1474static __inline__ __m256i __DEFAULT_FN_ATTRS2561430static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1475_mm256_cvtepi16_epi64(__m128i __V)1431_mm256_cvtepi16_epi64(__m128i __V) {
1476{
1477 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4di);1432 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4di);
1478}1433}
14791434
...@@ -1496,9 +1451,8 @@ _mm256_cvtepi16_epi64(__m128i __V)...@@ -1496,9 +1451,8 @@ _mm256_cvtepi16_epi64(__m128i __V)
1496/// A 128-bit vector of [4 x i32] containing the source values.1451/// A 128-bit vector of [4 x i32] containing the source values.
1497/// \returns A 256-bit vector of [4 x i64] containing the sign-extended1452/// \returns A 256-bit vector of [4 x i64] containing the sign-extended
1498/// values.1453/// values.
1499static __inline__ __m256i __DEFAULT_FN_ATTRS2561454static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1500_mm256_cvtepi32_epi64(__m128i __V)1455_mm256_cvtepi32_epi64(__m128i __V) {
1501{
1502 return (__m256i)__builtin_convertvector((__v4si)__V, __v4di);1456 return (__m256i)__builtin_convertvector((__v4si)__V, __v4di);
1503}1457}
15041458
...@@ -1522,9 +1476,8 @@ _mm256_cvtepi32_epi64(__m128i __V)...@@ -1522,9 +1476,8 @@ _mm256_cvtepi32_epi64(__m128i __V)
1522/// A 128-bit integer vector containing the source bytes.1476/// A 128-bit integer vector containing the source bytes.
1523/// \returns A 256-bit vector of [16 x i16] containing the zero-extended1477/// \returns A 256-bit vector of [16 x i16] containing the zero-extended
1524/// values.1478/// values.
1525static __inline__ __m256i __DEFAULT_FN_ATTRS2561479static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1526_mm256_cvtepu8_epi16(__m128i __V)1480_mm256_cvtepu8_epi16(__m128i __V) {
1527{
1528 return (__m256i)__builtin_convertvector((__v16qu)__V, __v16hi);1481 return (__m256i)__builtin_convertvector((__v16qu)__V, __v16hi);
1529}1482}
15301483
...@@ -1548,9 +1501,8 @@ _mm256_cvtepu8_epi16(__m128i __V)...@@ -1548,9 +1501,8 @@ _mm256_cvtepu8_epi16(__m128i __V)
1548/// A 128-bit integer vector containing the source bytes.1501/// A 128-bit integer vector containing the source bytes.
1549/// \returns A 256-bit vector of [8 x i32] containing the zero-extended1502/// \returns A 256-bit vector of [8 x i32] containing the zero-extended
1550/// values.1503/// values.
1551static __inline__ __m256i __DEFAULT_FN_ATTRS2561504static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1552_mm256_cvtepu8_epi32(__m128i __V)1505_mm256_cvtepu8_epi32(__m128i __V) {
1553{
1554 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si);1506 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si);
1555}1507}
15561508
...@@ -1573,9 +1525,8 @@ _mm256_cvtepu8_epi32(__m128i __V)...@@ -1573,9 +1525,8 @@ _mm256_cvtepu8_epi32(__m128i __V)
1573/// A 128-bit integer vector containing the source bytes.1525/// A 128-bit integer vector containing the source bytes.
1574/// \returns A 256-bit vector of [4 x i64] containing the zero-extended1526/// \returns A 256-bit vector of [4 x i64] containing the zero-extended
1575/// values.1527/// values.
1576static __inline__ __m256i __DEFAULT_FN_ATTRS2561528static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1577_mm256_cvtepu8_epi64(__m128i __V)1529_mm256_cvtepu8_epi64(__m128i __V) {
1578{
1579 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4di);1530 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4di);
1580}1531}
15811532
...@@ -1599,9 +1550,8 @@ _mm256_cvtepu8_epi64(__m128i __V)...@@ -1599,9 +1550,8 @@ _mm256_cvtepu8_epi64(__m128i __V)
1599/// A 128-bit vector of [8 x i16] containing the source values.1550/// A 128-bit vector of [8 x i16] containing the source values.
1600/// \returns A 256-bit vector of [8 x i32] containing the zero-extended1551/// \returns A 256-bit vector of [8 x i32] containing the zero-extended
1601/// values.1552/// values.
1602static __inline__ __m256i __DEFAULT_FN_ATTRS2561553static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1603_mm256_cvtepu16_epi32(__m128i __V)1554_mm256_cvtepu16_epi32(__m128i __V) {
1604{
1605 return (__m256i)__builtin_convertvector((__v8hu)__V, __v8si);1555 return (__m256i)__builtin_convertvector((__v8hu)__V, __v8si);
1606}1556}
16071557
...@@ -1624,9 +1574,8 @@ _mm256_cvtepu16_epi32(__m128i __V)...@@ -1624,9 +1574,8 @@ _mm256_cvtepu16_epi32(__m128i __V)
1624/// A 128-bit vector of [8 x i16] containing the source values.1574/// A 128-bit vector of [8 x i16] containing the source values.
1625/// \returns A 256-bit vector of [4 x i64] containing the zero-extended1575/// \returns A 256-bit vector of [4 x i64] containing the zero-extended
1626/// values.1576/// values.
1627static __inline__ __m256i __DEFAULT_FN_ATTRS2561577static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1628_mm256_cvtepu16_epi64(__m128i __V)1578_mm256_cvtepu16_epi64(__m128i __V) {
1629{
1630 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4di);1579 return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4di);
1631}1580}
16321581
...@@ -1649,9 +1598,8 @@ _mm256_cvtepu16_epi64(__m128i __V)...@@ -1649,9 +1598,8 @@ _mm256_cvtepu16_epi64(__m128i __V)
1649/// A 128-bit vector of [4 x i32] containing the source values.1598/// A 128-bit vector of [4 x i32] containing the source values.
1650/// \returns A 256-bit vector of [4 x i64] containing the zero-extended1599/// \returns A 256-bit vector of [4 x i64] containing the zero-extended
1651/// values.1600/// values.
1652static __inline__ __m256i __DEFAULT_FN_ATTRS2561601static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1653_mm256_cvtepu32_epi64(__m128i __V)1602_mm256_cvtepu32_epi64(__m128i __V) {
1654{
1655 return (__m256i)__builtin_convertvector((__v4su)__V, __v4di);1603 return (__m256i)__builtin_convertvector((__v4su)__V, __v4di);
1656}1604}
16571605
...@@ -1675,9 +1623,8 @@ _mm256_cvtepu32_epi64(__m128i __V)...@@ -1675,9 +1623,8 @@ _mm256_cvtepu32_epi64(__m128i __V)
1675/// \param __b1623/// \param __b
1676/// A 256-bit vector of [8 x i32] containing one of the source operands.1624/// A 256-bit vector of [8 x i32] containing one of the source operands.
1677/// \returns A 256-bit vector of [4 x i64] containing the products.1625/// \returns A 256-bit vector of [4 x i64] containing the products.
1678static __inline__ __m256i __DEFAULT_FN_ATTRS2561626static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1679_mm256_mul_epi32(__m256i __a, __m256i __b)1627_mm256_mul_epi32(__m256i __a, __m256i __b) {
1680{
1681 return (__m256i)__builtin_ia32_pmuldq256((__v8si)__a, (__v8si)__b);1628 return (__m256i)__builtin_ia32_pmuldq256((__v8si)__a, (__v8si)__b);
1682}1629}
16831630
...@@ -1702,9 +1649,8 @@ _mm256_mul_epi32(__m256i __a, __m256i __b)...@@ -1702,9 +1649,8 @@ _mm256_mul_epi32(__m256i __a, __m256i __b)
1702/// \param __b1649/// \param __b
1703/// A 256-bit vector of [16 x i16] containing one of the source operands.1650/// A 256-bit vector of [16 x i16] containing one of the source operands.
1704/// \returns A 256-bit vector of [16 x i16] containing the rounded products.1651/// \returns A 256-bit vector of [16 x i16] containing the rounded products.
1705static __inline__ __m256i __DEFAULT_FN_ATTRS2561652static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1706_mm256_mulhrs_epi16(__m256i __a, __m256i __b)1653_mm256_mulhrs_epi16(__m256i __a, __m256i __b) {
1707{
1708 return (__m256i)__builtin_ia32_pmulhrsw256((__v16hi)__a, (__v16hi)__b);1654 return (__m256i)__builtin_ia32_pmulhrsw256((__v16hi)__a, (__v16hi)__b);
1709}1655}
17101656
...@@ -1721,10 +1667,9 @@ _mm256_mulhrs_epi16(__m256i __a, __m256i __b)...@@ -1721,10 +1667,9 @@ _mm256_mulhrs_epi16(__m256i __a, __m256i __b)
1721/// \param __b1667/// \param __b
1722/// A 256-bit vector of [16 x i16] containing one of the source operands.1668/// A 256-bit vector of [16 x i16] containing one of the source operands.
1723/// \returns A 256-bit vector of [16 x i16] containing the products.1669/// \returns A 256-bit vector of [16 x i16] containing the products.
1724static __inline__ __m256i __DEFAULT_FN_ATTRS2561670static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1725_mm256_mulhi_epu16(__m256i __a, __m256i __b)1671_mm256_mulhi_epu16(__m256i __a, __m256i __b) {
1726{1672 return (__m256i)__builtin_ia32_pmulhuw256((__v16hu)__a, (__v16hu)__b);
1727 return (__m256i)__builtin_ia32_pmulhuw256((__v16hi)__a, (__v16hi)__b);
1728}1673}
17291674
1730/// Multiplies signed 16-bit integer elements of two 256-bit vectors of1675/// Multiplies signed 16-bit integer elements of two 256-bit vectors of
...@@ -1740,7 +1685,7 @@ _mm256_mulhi_epu16(__m256i __a, __m256i __b)...@@ -1740,7 +1685,7 @@ _mm256_mulhi_epu16(__m256i __a, __m256i __b)
1740/// \param __b1685/// \param __b
1741/// A 256-bit vector of [16 x i16] containing one of the source operands.1686/// A 256-bit vector of [16 x i16] containing one of the source operands.
1742/// \returns A 256-bit vector of [16 x i16] containing the products.1687/// \returns A 256-bit vector of [16 x i16] containing the products.
1743static __inline__ __m256i __DEFAULT_FN_ATTRS2561688static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1744_mm256_mulhi_epi16(__m256i __a, __m256i __b)1689_mm256_mulhi_epi16(__m256i __a, __m256i __b)
1745{1690{
1746 return (__m256i)__builtin_ia32_pmulhw256((__v16hi)__a, (__v16hi)__b);1691 return (__m256i)__builtin_ia32_pmulhw256((__v16hi)__a, (__v16hi)__b);
...@@ -1759,7 +1704,7 @@ _mm256_mulhi_epi16(__m256i __a, __m256i __b)...@@ -1759,7 +1704,7 @@ _mm256_mulhi_epi16(__m256i __a, __m256i __b)
1759/// \param __b1704/// \param __b
1760/// A 256-bit vector of [16 x i16] containing one of the source operands.1705/// A 256-bit vector of [16 x i16] containing one of the source operands.
1761/// \returns A 256-bit vector of [16 x i16] containing the products.1706/// \returns A 256-bit vector of [16 x i16] containing the products.
1762static __inline__ __m256i __DEFAULT_FN_ATTRS2561707static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1763_mm256_mullo_epi16(__m256i __a, __m256i __b)1708_mm256_mullo_epi16(__m256i __a, __m256i __b)
1764{1709{
1765 return (__m256i)((__v16hu)__a * (__v16hu)__b);1710 return (__m256i)((__v16hu)__a * (__v16hu)__b);
...@@ -1778,9 +1723,8 @@ _mm256_mullo_epi16(__m256i __a, __m256i __b)...@@ -1778,9 +1723,8 @@ _mm256_mullo_epi16(__m256i __a, __m256i __b)
1778/// \param __b1723/// \param __b
1779/// A 256-bit vector of [8 x i32] containing one of the source operands.1724/// A 256-bit vector of [8 x i32] containing one of the source operands.
1780/// \returns A 256-bit vector of [8 x i32] containing the products.1725/// \returns A 256-bit vector of [8 x i32] containing the products.
1781static __inline__ __m256i __DEFAULT_FN_ATTRS2561726static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1782_mm256_mullo_epi32 (__m256i __a, __m256i __b)1727_mm256_mullo_epi32(__m256i __a, __m256i __b) {
1783{
1784 return (__m256i)((__v8su)__a * (__v8su)__b);1728 return (__m256i)((__v8su)__a * (__v8su)__b);
1785}1729}
17861730
...@@ -1804,9 +1748,8 @@ _mm256_mullo_epi32 (__m256i __a, __m256i __b)...@@ -1804,9 +1748,8 @@ _mm256_mullo_epi32 (__m256i __a, __m256i __b)
1804/// \param __b1748/// \param __b
1805/// A 256-bit vector of [8 x i32] containing one of the source operands.1749/// A 256-bit vector of [8 x i32] containing one of the source operands.
1806/// \returns A 256-bit vector of [4 x i64] containing the products.1750/// \returns A 256-bit vector of [4 x i64] containing the products.
1807static __inline__ __m256i __DEFAULT_FN_ATTRS2561751static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1808_mm256_mul_epu32(__m256i __a, __m256i __b)1752_mm256_mul_epu32(__m256i __a, __m256i __b) {
1809{
1810 return __builtin_ia32_pmuludq256((__v8si)__a, (__v8si)__b);1753 return __builtin_ia32_pmuludq256((__v8si)__a, (__v8si)__b);
1811}1754}
18121755
...@@ -1822,7 +1765,7 @@ _mm256_mul_epu32(__m256i __a, __m256i __b)...@@ -1822,7 +1765,7 @@ _mm256_mul_epu32(__m256i __a, __m256i __b)
1822/// \param __b1765/// \param __b
1823/// A 256-bit integer vector.1766/// A 256-bit integer vector.
1824/// \returns A 256-bit integer vector containing the result.1767/// \returns A 256-bit integer vector containing the result.
1825static __inline__ __m256i __DEFAULT_FN_ATTRS2561768static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1826_mm256_or_si256(__m256i __a, __m256i __b)1769_mm256_or_si256(__m256i __a, __m256i __b)
1827{1770{
1828 return (__m256i)((__v4du)__a | (__v4du)__b);1771 return (__m256i)((__v4du)__a | (__v4du)__b);
...@@ -1906,9 +1849,8 @@ _mm256_sad_epu8(__m256i __a, __m256i __b)...@@ -1906,9 +1849,8 @@ _mm256_sad_epu8(__m256i __a, __m256i __b)
1906/// control byte specify the index (within the same 128-bit half) of \a __a1849/// control byte specify the index (within the same 128-bit half) of \a __a
1907/// to copy to the result byte.1850/// to copy to the result byte.
1908/// \returns A 256-bit integer vector containing the result.1851/// \returns A 256-bit integer vector containing the result.
1909static __inline__ __m256i __DEFAULT_FN_ATTRS2561852static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1910_mm256_shuffle_epi8(__m256i __a, __m256i __b)1853_mm256_shuffle_epi8(__m256i __a, __m256i __b) {
1911{
1912 return (__m256i)__builtin_ia32_pshufb256((__v32qi)__a, (__v32qi)__b);1854 return (__m256i)__builtin_ia32_pshufb256((__v32qi)__a, (__v32qi)__b);
1913}1855}
19141856
...@@ -2033,10 +1975,9 @@ _mm256_shuffle_epi8(__m256i __a, __m256i __b)...@@ -2033,10 +1975,9 @@ _mm256_shuffle_epi8(__m256i __a, __m256i __b)
2033/// \param __b1975/// \param __b
2034/// A 256-bit integer vector].1976/// A 256-bit integer vector].
2035/// \returns A 256-bit integer vector containing the result.1977/// \returns A 256-bit integer vector containing the result.
2036static __inline__ __m256i __DEFAULT_FN_ATTRS2561978static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2037_mm256_sign_epi8(__m256i __a, __m256i __b)1979_mm256_sign_epi8(__m256i __a, __m256i __b) {
2038{1980 return (__m256i)__builtin_ia32_psignb256((__v32qi)__a, (__v32qi)__b);
2039 return (__m256i)__builtin_ia32_psignb256((__v32qi)__a, (__v32qi)__b);
2040}1981}
20411982
2042/// Sets each element of the result to the corresponding element of the1983/// Sets each element of the result to the corresponding element of the
...@@ -2054,10 +1995,9 @@ _mm256_sign_epi8(__m256i __a, __m256i __b)...@@ -2054,10 +1995,9 @@ _mm256_sign_epi8(__m256i __a, __m256i __b)
2054/// \param __b1995/// \param __b
2055/// A 256-bit vector of [16 x i16].1996/// A 256-bit vector of [16 x i16].
2056/// \returns A 256-bit vector of [16 x i16] containing the result.1997/// \returns A 256-bit vector of [16 x i16] containing the result.
2057static __inline__ __m256i __DEFAULT_FN_ATTRS2561998static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2058_mm256_sign_epi16(__m256i __a, __m256i __b)1999_mm256_sign_epi16(__m256i __a, __m256i __b) {
2059{2000 return (__m256i)__builtin_ia32_psignw256((__v16hi)__a, (__v16hi)__b);
2060 return (__m256i)__builtin_ia32_psignw256((__v16hi)__a, (__v16hi)__b);
2061}2001}
20622002
2063/// Sets each element of the result to the corresponding element of the2003/// Sets each element of the result to the corresponding element of the
...@@ -2075,10 +2015,9 @@ _mm256_sign_epi16(__m256i __a, __m256i __b)...@@ -2075,10 +2015,9 @@ _mm256_sign_epi16(__m256i __a, __m256i __b)
2075/// \param __b2015/// \param __b
2076/// A 256-bit vector of [8 x i32].2016/// A 256-bit vector of [8 x i32].
2077/// \returns A 256-bit vector of [8 x i32] containing the result.2017/// \returns A 256-bit vector of [8 x i32] containing the result.
2078static __inline__ __m256i __DEFAULT_FN_ATTRS2562018static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2079_mm256_sign_epi32(__m256i __a, __m256i __b)2019_mm256_sign_epi32(__m256i __a, __m256i __b) {
2080{2020 return (__m256i)__builtin_ia32_psignd256((__v8si)__a, (__v8si)__b);
2081 return (__m256i)__builtin_ia32_psignd256((__v8si)__a, (__v8si)__b);
2082}2021}
20832022
2084/// Shifts each 128-bit half of the 256-bit integer vector \a a left by2023/// Shifts each 128-bit half of the 256-bit integer vector \a a left by
...@@ -2098,8 +2037,9 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)...@@ -2098,8 +2037,9 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)
2098/// \param imm2037/// \param imm
2099/// An unsigned immediate value specifying the shift count (in bytes).2038/// An unsigned immediate value specifying the shift count (in bytes).
2100/// \returns A 256-bit integer vector containing the result.2039/// \returns A 256-bit integer vector containing the result.
2101#define _mm256_slli_si256(a, imm) \2040#define _mm256_slli_si256(a, imm) \
2102 ((__m256i)__builtin_ia32_pslldqi256_byteshift((__v4di)(__m256i)(a), (int)(imm)))2041 ((__m256i)__builtin_ia32_pslldqi256_byteshift((__v32qi)(__m256i)(a), \
2042 (int)(imm)))
21032043
2104/// Shifts each 128-bit half of the 256-bit integer vector \a a left by2044/// Shifts each 128-bit half of the 256-bit integer vector \a a left by
2105/// \a imm bytes, shifting in zero bytes, and returns the result. If \a imm2045/// \a imm bytes, shifting in zero bytes, and returns the result. If \a imm
...@@ -2118,8 +2058,9 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)...@@ -2118,8 +2058,9 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)
2118/// \param imm2058/// \param imm
2119/// An unsigned immediate value specifying the shift count (in bytes).2059/// An unsigned immediate value specifying the shift count (in bytes).
2120/// \returns A 256-bit integer vector containing the result.2060/// \returns A 256-bit integer vector containing the result.
2121#define _mm256_bslli_epi128(a, imm) \2061#define _mm256_bslli_epi128(a, imm) \
2122 ((__m256i)__builtin_ia32_pslldqi256_byteshift((__v4di)(__m256i)(a), (int)(imm)))2062 ((__m256i)__builtin_ia32_pslldqi256_byteshift((__v32qi)(__m256i)(a), \
2063 (int)(imm)))
21232064
2124/// Shifts each 16-bit element of the 256-bit vector of [16 x i16] in \a __a2065/// Shifts each 16-bit element of the 256-bit vector of [16 x i16] in \a __a
2125/// left by \a __count bits, shifting in zero bits, and returns the result.2066/// left by \a __count bits, shifting in zero bits, and returns the result.
...@@ -2134,9 +2075,8 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)...@@ -2134,9 +2075,8 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)
2134/// \param __count2075/// \param __count
2135/// An unsigned integer value specifying the shift count (in bits).2076/// An unsigned integer value specifying the shift count (in bits).
2136/// \returns A 256-bit vector of [16 x i16] containing the result.2077/// \returns A 256-bit vector of [16 x i16] containing the result.
2137static __inline__ __m256i __DEFAULT_FN_ATTRS2562078static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2138_mm256_slli_epi16(__m256i __a, int __count)2079_mm256_slli_epi16(__m256i __a, int __count) {
2139{
2140 return (__m256i)__builtin_ia32_psllwi256((__v16hi)__a, __count);2080 return (__m256i)__builtin_ia32_psllwi256((__v16hi)__a, __count);
2141}2081}
21422082
...@@ -2155,9 +2095,8 @@ _mm256_slli_epi16(__m256i __a, int __count)...@@ -2155,9 +2095,8 @@ _mm256_slli_epi16(__m256i __a, int __count)
2155/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2095/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2156/// shift count (in bits). The upper element is ignored.2096/// shift count (in bits). The upper element is ignored.
2157/// \returns A 256-bit vector of [16 x i16] containing the result.2097/// \returns A 256-bit vector of [16 x i16] containing the result.
2158static __inline__ __m256i __DEFAULT_FN_ATTRS2562098static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2159_mm256_sll_epi16(__m256i __a, __m128i __count)2099_mm256_sll_epi16(__m256i __a, __m128i __count) {
2160{
2161 return (__m256i)__builtin_ia32_psllw256((__v16hi)__a, (__v8hi)__count);2100 return (__m256i)__builtin_ia32_psllw256((__v16hi)__a, (__v8hi)__count);
2162}2101}
21632102
...@@ -2174,9 +2113,8 @@ _mm256_sll_epi16(__m256i __a, __m128i __count)...@@ -2174,9 +2113,8 @@ _mm256_sll_epi16(__m256i __a, __m128i __count)
2174/// \param __count2113/// \param __count
2175/// An unsigned integer value specifying the shift count (in bits).2114/// An unsigned integer value specifying the shift count (in bits).
2176/// \returns A 256-bit vector of [8 x i32] containing the result.2115/// \returns A 256-bit vector of [8 x i32] containing the result.
2177static __inline__ __m256i __DEFAULT_FN_ATTRS2562116static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2178_mm256_slli_epi32(__m256i __a, int __count)2117_mm256_slli_epi32(__m256i __a, int __count) {
2179{
2180 return (__m256i)__builtin_ia32_pslldi256((__v8si)__a, __count);2118 return (__m256i)__builtin_ia32_pslldi256((__v8si)__a, __count);
2181}2119}
21822120
...@@ -2195,9 +2133,8 @@ _mm256_slli_epi32(__m256i __a, int __count)...@@ -2195,9 +2133,8 @@ _mm256_slli_epi32(__m256i __a, int __count)
2195/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2133/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2196/// shift count (in bits). The upper element is ignored.2134/// shift count (in bits). The upper element is ignored.
2197/// \returns A 256-bit vector of [8 x i32] containing the result.2135/// \returns A 256-bit vector of [8 x i32] containing the result.
2198static __inline__ __m256i __DEFAULT_FN_ATTRS2562136static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2199_mm256_sll_epi32(__m256i __a, __m128i __count)2137_mm256_sll_epi32(__m256i __a, __m128i __count) {
2200{
2201 return (__m256i)__builtin_ia32_pslld256((__v8si)__a, (__v4si)__count);2138 return (__m256i)__builtin_ia32_pslld256((__v8si)__a, (__v4si)__count);
2202}2139}
22032140
...@@ -2214,9 +2151,8 @@ _mm256_sll_epi32(__m256i __a, __m128i __count)...@@ -2214,9 +2151,8 @@ _mm256_sll_epi32(__m256i __a, __m128i __count)
2214/// \param __count2151/// \param __count
2215/// An unsigned integer value specifying the shift count (in bits).2152/// An unsigned integer value specifying the shift count (in bits).
2216/// \returns A 256-bit vector of [4 x i64] containing the result.2153/// \returns A 256-bit vector of [4 x i64] containing the result.
2217static __inline__ __m256i __DEFAULT_FN_ATTRS2562154static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2218_mm256_slli_epi64(__m256i __a, int __count)2155_mm256_slli_epi64(__m256i __a, int __count) {
2219{
2220 return __builtin_ia32_psllqi256((__v4di)__a, __count);2156 return __builtin_ia32_psllqi256((__v4di)__a, __count);
2221}2157}
22222158
...@@ -2235,9 +2171,8 @@ _mm256_slli_epi64(__m256i __a, int __count)...@@ -2235,9 +2171,8 @@ _mm256_slli_epi64(__m256i __a, int __count)
2235/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2171/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2236/// shift count (in bits). The upper element is ignored.2172/// shift count (in bits). The upper element is ignored.
2237/// \returns A 256-bit vector of [4 x i64] containing the result.2173/// \returns A 256-bit vector of [4 x i64] containing the result.
2238static __inline__ __m256i __DEFAULT_FN_ATTRS2562174static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2239_mm256_sll_epi64(__m256i __a, __m128i __count)2175_mm256_sll_epi64(__m256i __a, __m128i __count) {
2240{
2241 return __builtin_ia32_psllq256((__v4di)__a, __count);2176 return __builtin_ia32_psllq256((__v4di)__a, __count);
2242}2177}
22432178
...@@ -2255,9 +2190,8 @@ _mm256_sll_epi64(__m256i __a, __m128i __count)...@@ -2255,9 +2190,8 @@ _mm256_sll_epi64(__m256i __a, __m128i __count)
2255/// \param __count2190/// \param __count
2256/// An unsigned integer value specifying the shift count (in bits).2191/// An unsigned integer value specifying the shift count (in bits).
2257/// \returns A 256-bit vector of [16 x i16] containing the result.2192/// \returns A 256-bit vector of [16 x i16] containing the result.
2258static __inline__ __m256i __DEFAULT_FN_ATTRS2562193static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2259_mm256_srai_epi16(__m256i __a, int __count)2194_mm256_srai_epi16(__m256i __a, int __count) {
2260{
2261 return (__m256i)__builtin_ia32_psrawi256((__v16hi)__a, __count);2195 return (__m256i)__builtin_ia32_psrawi256((__v16hi)__a, __count);
2262}2196}
22632197
...@@ -2277,9 +2211,8 @@ _mm256_srai_epi16(__m256i __a, int __count)...@@ -2277,9 +2211,8 @@ _mm256_srai_epi16(__m256i __a, int __count)
2277/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2211/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2278/// shift count (in bits). The upper element is ignored.2212/// shift count (in bits). The upper element is ignored.
2279/// \returns A 256-bit vector of [16 x i16] containing the result.2213/// \returns A 256-bit vector of [16 x i16] containing the result.
2280static __inline__ __m256i __DEFAULT_FN_ATTRS2562214static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2281_mm256_sra_epi16(__m256i __a, __m128i __count)2215_mm256_sra_epi16(__m256i __a, __m128i __count) {
2282{
2283 return (__m256i)__builtin_ia32_psraw256((__v16hi)__a, (__v8hi)__count);2216 return (__m256i)__builtin_ia32_psraw256((__v16hi)__a, (__v8hi)__count);
2284}2217}
22852218
...@@ -2297,9 +2230,8 @@ _mm256_sra_epi16(__m256i __a, __m128i __count)...@@ -2297,9 +2230,8 @@ _mm256_sra_epi16(__m256i __a, __m128i __count)
2297/// \param __count2230/// \param __count
2298/// An unsigned integer value specifying the shift count (in bits).2231/// An unsigned integer value specifying the shift count (in bits).
2299/// \returns A 256-bit vector of [8 x i32] containing the result.2232/// \returns A 256-bit vector of [8 x i32] containing the result.
2300static __inline__ __m256i __DEFAULT_FN_ATTRS2562233static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2301_mm256_srai_epi32(__m256i __a, int __count)2234_mm256_srai_epi32(__m256i __a, int __count) {
2302{
2303 return (__m256i)__builtin_ia32_psradi256((__v8si)__a, __count);2235 return (__m256i)__builtin_ia32_psradi256((__v8si)__a, __count);
2304}2236}
23052237
...@@ -2319,9 +2251,8 @@ _mm256_srai_epi32(__m256i __a, int __count)...@@ -2319,9 +2251,8 @@ _mm256_srai_epi32(__m256i __a, int __count)
2319/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2251/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2320/// shift count (in bits). The upper element is ignored.2252/// shift count (in bits). The upper element is ignored.
2321/// \returns A 256-bit vector of [8 x i32] containing the result.2253/// \returns A 256-bit vector of [8 x i32] containing the result.
2322static __inline__ __m256i __DEFAULT_FN_ATTRS2562254static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2323_mm256_sra_epi32(__m256i __a, __m128i __count)2255_mm256_sra_epi32(__m256i __a, __m128i __count) {
2324{
2325 return (__m256i)__builtin_ia32_psrad256((__v8si)__a, (__v4si)__count);2256 return (__m256i)__builtin_ia32_psrad256((__v8si)__a, (__v4si)__count);
2326}2257}
23272258
...@@ -2342,8 +2273,9 @@ _mm256_sra_epi32(__m256i __a, __m128i __count)...@@ -2342,8 +2273,9 @@ _mm256_sra_epi32(__m256i __a, __m128i __count)
2342/// \param imm2273/// \param imm
2343/// An unsigned immediate value specifying the shift count (in bytes).2274/// An unsigned immediate value specifying the shift count (in bytes).
2344/// \returns A 256-bit integer vector containing the result.2275/// \returns A 256-bit integer vector containing the result.
2345#define _mm256_srli_si256(a, imm) \2276#define _mm256_srli_si256(a, imm) \
2346 ((__m256i)__builtin_ia32_psrldqi256_byteshift((__m256i)(a), (int)(imm)))2277 ((__m256i)__builtin_ia32_psrldqi256_byteshift((__v32qi)(__m256i)(a), \
2278 (int)(imm)))
23472279
2348/// Shifts each 128-bit half of the 256-bit integer vector in \a a right by2280/// Shifts each 128-bit half of the 256-bit integer vector in \a a right by
2349/// \a imm bytes, shifting in zero bytes, and returns the result. If2281/// \a imm bytes, shifting in zero bytes, and returns the result. If
...@@ -2362,8 +2294,9 @@ _mm256_sra_epi32(__m256i __a, __m128i __count)...@@ -2362,8 +2294,9 @@ _mm256_sra_epi32(__m256i __a, __m128i __count)
2362/// \param imm2294/// \param imm
2363/// An unsigned immediate value specifying the shift count (in bytes).2295/// An unsigned immediate value specifying the shift count (in bytes).
2364/// \returns A 256-bit integer vector containing the result.2296/// \returns A 256-bit integer vector containing the result.
2365#define _mm256_bsrli_epi128(a, imm) \2297#define _mm256_bsrli_epi128(a, imm) \
2366 ((__m256i)__builtin_ia32_psrldqi256_byteshift((__m256i)(a), (int)(imm)))2298 ((__m256i)__builtin_ia32_psrldqi256_byteshift((__v32qi)(__m256i)(a), \
2299 (int)(imm)))
23672300
2368/// Shifts each 16-bit element of the 256-bit vector of [16 x i16] in \a __a2301/// Shifts each 16-bit element of the 256-bit vector of [16 x i16] in \a __a
2369/// right by \a __count bits, shifting in zero bits, and returns the result.2302/// right by \a __count bits, shifting in zero bits, and returns the result.
...@@ -2378,9 +2311,8 @@ _mm256_sra_epi32(__m256i __a, __m128i __count)...@@ -2378,9 +2311,8 @@ _mm256_sra_epi32(__m256i __a, __m128i __count)
2378/// \param __count2311/// \param __count
2379/// An unsigned integer value specifying the shift count (in bits).2312/// An unsigned integer value specifying the shift count (in bits).
2380/// \returns A 256-bit vector of [16 x i16] containing the result.2313/// \returns A 256-bit vector of [16 x i16] containing the result.
2381static __inline__ __m256i __DEFAULT_FN_ATTRS2562314static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2382_mm256_srli_epi16(__m256i __a, int __count)2315_mm256_srli_epi16(__m256i __a, int __count) {
2383{
2384 return (__m256i)__builtin_ia32_psrlwi256((__v16hi)__a, __count);2316 return (__m256i)__builtin_ia32_psrlwi256((__v16hi)__a, __count);
2385}2317}
23862318
...@@ -2399,9 +2331,8 @@ _mm256_srli_epi16(__m256i __a, int __count)...@@ -2399,9 +2331,8 @@ _mm256_srli_epi16(__m256i __a, int __count)
2399/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2331/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2400/// shift count (in bits). The upper element is ignored.2332/// shift count (in bits). The upper element is ignored.
2401/// \returns A 256-bit vector of [16 x i16] containing the result.2333/// \returns A 256-bit vector of [16 x i16] containing the result.
2402static __inline__ __m256i __DEFAULT_FN_ATTRS2562334static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2403_mm256_srl_epi16(__m256i __a, __m128i __count)2335_mm256_srl_epi16(__m256i __a, __m128i __count) {
2404{
2405 return (__m256i)__builtin_ia32_psrlw256((__v16hi)__a, (__v8hi)__count);2336 return (__m256i)__builtin_ia32_psrlw256((__v16hi)__a, (__v8hi)__count);
2406}2337}
24072338
...@@ -2418,9 +2349,8 @@ _mm256_srl_epi16(__m256i __a, __m128i __count)...@@ -2418,9 +2349,8 @@ _mm256_srl_epi16(__m256i __a, __m128i __count)
2418/// \param __count2349/// \param __count
2419/// An unsigned integer value specifying the shift count (in bits).2350/// An unsigned integer value specifying the shift count (in bits).
2420/// \returns A 256-bit vector of [8 x i32] containing the result.2351/// \returns A 256-bit vector of [8 x i32] containing the result.
2421static __inline__ __m256i __DEFAULT_FN_ATTRS2562352static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2422_mm256_srli_epi32(__m256i __a, int __count)2353_mm256_srli_epi32(__m256i __a, int __count) {
2423{
2424 return (__m256i)__builtin_ia32_psrldi256((__v8si)__a, __count);2354 return (__m256i)__builtin_ia32_psrldi256((__v8si)__a, __count);
2425}2355}
24262356
...@@ -2439,9 +2369,8 @@ _mm256_srli_epi32(__m256i __a, int __count)...@@ -2439,9 +2369,8 @@ _mm256_srli_epi32(__m256i __a, int __count)
2439/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2369/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2440/// shift count (in bits). The upper element is ignored.2370/// shift count (in bits). The upper element is ignored.
2441/// \returns A 256-bit vector of [8 x i32] containing the result.2371/// \returns A 256-bit vector of [8 x i32] containing the result.
2442static __inline__ __m256i __DEFAULT_FN_ATTRS2562372static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2443_mm256_srl_epi32(__m256i __a, __m128i __count)2373_mm256_srl_epi32(__m256i __a, __m128i __count) {
2444{
2445 return (__m256i)__builtin_ia32_psrld256((__v8si)__a, (__v4si)__count);2374 return (__m256i)__builtin_ia32_psrld256((__v8si)__a, (__v4si)__count);
2446}2375}
24472376
...@@ -2458,9 +2387,8 @@ _mm256_srl_epi32(__m256i __a, __m128i __count)...@@ -2458,9 +2387,8 @@ _mm256_srl_epi32(__m256i __a, __m128i __count)
2458/// \param __count2387/// \param __count
2459/// An unsigned integer value specifying the shift count (in bits).2388/// An unsigned integer value specifying the shift count (in bits).
2460/// \returns A 256-bit vector of [4 x i64] containing the result.2389/// \returns A 256-bit vector of [4 x i64] containing the result.
2461static __inline__ __m256i __DEFAULT_FN_ATTRS2562390static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2462_mm256_srli_epi64(__m256i __a, int __count)2391_mm256_srli_epi64(__m256i __a, int __count) {
2463{
2464 return __builtin_ia32_psrlqi256((__v4di)__a, __count);2392 return __builtin_ia32_psrlqi256((__v4di)__a, __count);
2465}2393}
24662394
...@@ -2479,9 +2407,8 @@ _mm256_srli_epi64(__m256i __a, int __count)...@@ -2479,9 +2407,8 @@ _mm256_srli_epi64(__m256i __a, int __count)
2479/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned2407/// A 128-bit vector of [2 x i64] whose lower element gives the unsigned
2480/// shift count (in bits). The upper element is ignored.2408/// shift count (in bits). The upper element is ignored.
2481/// \returns A 256-bit vector of [4 x i64] containing the result.2409/// \returns A 256-bit vector of [4 x i64] containing the result.
2482static __inline__ __m256i __DEFAULT_FN_ATTRS2562410static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2483_mm256_srl_epi64(__m256i __a, __m128i __count)2411_mm256_srl_epi64(__m256i __a, __m128i __count) {
2484{
2485 return __builtin_ia32_psrlq256((__v4di)__a, __count);2412 return __builtin_ia32_psrlq256((__v4di)__a, __count);
2486}2413}
24872414
...@@ -2506,9 +2433,8 @@ _mm256_srl_epi64(__m256i __a, __m128i __count)...@@ -2506,9 +2433,8 @@ _mm256_srl_epi64(__m256i __a, __m128i __count)
2506/// \param __b2433/// \param __b
2507/// A 256-bit integer vector containing the subtrahends.2434/// A 256-bit integer vector containing the subtrahends.
2508/// \returns A 256-bit integer vector containing the differences.2435/// \returns A 256-bit integer vector containing the differences.
2509static __inline__ __m256i __DEFAULT_FN_ATTRS2562436static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2510_mm256_sub_epi8(__m256i __a, __m256i __b)2437_mm256_sub_epi8(__m256i __a, __m256i __b) {
2511{
2512 return (__m256i)((__v32qu)__a - (__v32qu)__b);2438 return (__m256i)((__v32qu)__a - (__v32qu)__b);
2513}2439}
25142440
...@@ -2533,9 +2459,8 @@ _mm256_sub_epi8(__m256i __a, __m256i __b)...@@ -2533,9 +2459,8 @@ _mm256_sub_epi8(__m256i __a, __m256i __b)
2533/// \param __b2459/// \param __b
2534/// A 256-bit vector of [16 x i16] containing the subtrahends.2460/// A 256-bit vector of [16 x i16] containing the subtrahends.
2535/// \returns A 256-bit vector of [16 x i16] containing the differences.2461/// \returns A 256-bit vector of [16 x i16] containing the differences.
2536static __inline__ __m256i __DEFAULT_FN_ATTRS2562462static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2537_mm256_sub_epi16(__m256i __a, __m256i __b)2463_mm256_sub_epi16(__m256i __a, __m256i __b) {
2538{
2539 return (__m256i)((__v16hu)__a - (__v16hu)__b);2464 return (__m256i)((__v16hu)__a - (__v16hu)__b);
2540}2465}
25412466
...@@ -2559,9 +2484,8 @@ _mm256_sub_epi16(__m256i __a, __m256i __b)...@@ -2559,9 +2484,8 @@ _mm256_sub_epi16(__m256i __a, __m256i __b)
2559/// \param __b2484/// \param __b
2560/// A 256-bit vector of [8 x i32] containing the subtrahends.2485/// A 256-bit vector of [8 x i32] containing the subtrahends.
2561/// \returns A 256-bit vector of [8 x i32] containing the differences.2486/// \returns A 256-bit vector of [8 x i32] containing the differences.
2562static __inline__ __m256i __DEFAULT_FN_ATTRS2562487static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2563_mm256_sub_epi32(__m256i __a, __m256i __b)2488_mm256_sub_epi32(__m256i __a, __m256i __b) {
2564{
2565 return (__m256i)((__v8su)__a - (__v8su)__b);2489 return (__m256i)((__v8su)__a - (__v8su)__b);
2566}2490}
25672491
...@@ -2585,9 +2509,8 @@ _mm256_sub_epi32(__m256i __a, __m256i __b)...@@ -2585,9 +2509,8 @@ _mm256_sub_epi32(__m256i __a, __m256i __b)
2585/// \param __b2509/// \param __b
2586/// A 256-bit vector of [4 x i64] containing the subtrahends.2510/// A 256-bit vector of [4 x i64] containing the subtrahends.
2587/// \returns A 256-bit vector of [4 x i64] containing the differences.2511/// \returns A 256-bit vector of [4 x i64] containing the differences.
2588static __inline__ __m256i __DEFAULT_FN_ATTRS2562512static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2589_mm256_sub_epi64(__m256i __a, __m256i __b)2513_mm256_sub_epi64(__m256i __a, __m256i __b) {
2590{
2591 return (__m256i)((__v4du)__a - (__v4du)__b);2514 return (__m256i)((__v4du)__a - (__v4du)__b);
2592}2515}
25932516
...@@ -2611,9 +2534,8 @@ _mm256_sub_epi64(__m256i __a, __m256i __b)...@@ -2611,9 +2534,8 @@ _mm256_sub_epi64(__m256i __a, __m256i __b)
2611/// \param __b2534/// \param __b
2612/// A 256-bit integer vector containing the subtrahends.2535/// A 256-bit integer vector containing the subtrahends.
2613/// \returns A 256-bit integer vector containing the differences.2536/// \returns A 256-bit integer vector containing the differences.
2614static __inline__ __m256i __DEFAULT_FN_ATTRS2562537static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2615_mm256_subs_epi8(__m256i __a, __m256i __b)2538_mm256_subs_epi8(__m256i __a, __m256i __b) {
2616{
2617 return (__m256i)__builtin_elementwise_sub_sat((__v32qs)__a, (__v32qs)__b);2539 return (__m256i)__builtin_elementwise_sub_sat((__v32qs)__a, (__v32qs)__b);
2618}2540}
26192541
...@@ -2637,9 +2559,8 @@ _mm256_subs_epi8(__m256i __a, __m256i __b)...@@ -2637,9 +2559,8 @@ _mm256_subs_epi8(__m256i __a, __m256i __b)
2637/// \param __b2559/// \param __b
2638/// A 256-bit vector of [16 x i16] containing the subtrahends.2560/// A 256-bit vector of [16 x i16] containing the subtrahends.
2639/// \returns A 256-bit vector of [16 x i16] containing the differences.2561/// \returns A 256-bit vector of [16 x i16] containing the differences.
2640static __inline__ __m256i __DEFAULT_FN_ATTRS2562562static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2641_mm256_subs_epi16(__m256i __a, __m256i __b)2563_mm256_subs_epi16(__m256i __a, __m256i __b) {
2642{
2643 return (__m256i)__builtin_elementwise_sub_sat((__v16hi)__a, (__v16hi)__b);2564 return (__m256i)__builtin_elementwise_sub_sat((__v16hi)__a, (__v16hi)__b);
2644}2565}
26452566
...@@ -2664,9 +2585,8 @@ _mm256_subs_epi16(__m256i __a, __m256i __b)...@@ -2664,9 +2585,8 @@ _mm256_subs_epi16(__m256i __a, __m256i __b)
2664/// \param __b2585/// \param __b
2665/// A 256-bit integer vector containing the subtrahends.2586/// A 256-bit integer vector containing the subtrahends.
2666/// \returns A 256-bit integer vector containing the differences.2587/// \returns A 256-bit integer vector containing the differences.
2667static __inline__ __m256i __DEFAULT_FN_ATTRS2562588static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2668_mm256_subs_epu8(__m256i __a, __m256i __b)2589_mm256_subs_epu8(__m256i __a, __m256i __b) {
2669{
2670 return (__m256i)__builtin_elementwise_sub_sat((__v32qu)__a, (__v32qu)__b);2590 return (__m256i)__builtin_elementwise_sub_sat((__v32qu)__a, (__v32qu)__b);
2671}2591}
26722592
...@@ -2690,9 +2610,8 @@ _mm256_subs_epu8(__m256i __a, __m256i __b)...@@ -2690,9 +2610,8 @@ _mm256_subs_epu8(__m256i __a, __m256i __b)
2690/// \param __b2610/// \param __b
2691/// A 256-bit vector of [16 x i16] containing the subtrahends.2611/// A 256-bit vector of [16 x i16] containing the subtrahends.
2692/// \returns A 256-bit vector of [16 x i16] containing the differences.2612/// \returns A 256-bit vector of [16 x i16] containing the differences.
2693static __inline__ __m256i __DEFAULT_FN_ATTRS2562613static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2694_mm256_subs_epu16(__m256i __a, __m256i __b)2614_mm256_subs_epu16(__m256i __a, __m256i __b) {
2695{
2696 return (__m256i)__builtin_elementwise_sub_sat((__v16hu)__a, (__v16hu)__b);2615 return (__m256i)__builtin_elementwise_sub_sat((__v16hu)__a, (__v16hu)__b);
2697}2616}
26982617
...@@ -2724,9 +2643,8 @@ _mm256_subs_epu16(__m256i __a, __m256i __b)...@@ -2724,9 +2643,8 @@ _mm256_subs_epu16(__m256i __a, __m256i __b)
2724/// A 256-bit integer vector used as the source for the odd-numbered bytes2643/// A 256-bit integer vector used as the source for the odd-numbered bytes
2725/// of the result.2644/// of the result.
2726/// \returns A 256-bit integer vector containing the result.2645/// \returns A 256-bit integer vector containing the result.
2727static __inline__ __m256i __DEFAULT_FN_ATTRS2562646static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2728_mm256_unpackhi_epi8(__m256i __a, __m256i __b)2647_mm256_unpackhi_epi8(__m256i __a, __m256i __b) {
2729{
2730 return (__m256i)__builtin_shufflevector((__v32qi)__a, (__v32qi)__b, 8, 32+8, 9, 32+9, 10, 32+10, 11, 32+11, 12, 32+12, 13, 32+13, 14, 32+14, 15, 32+15, 24, 32+24, 25, 32+25, 26, 32+26, 27, 32+27, 28, 32+28, 29, 32+29, 30, 32+30, 31, 32+31);2648 return (__m256i)__builtin_shufflevector((__v32qi)__a, (__v32qi)__b, 8, 32+8, 9, 32+9, 10, 32+10, 11, 32+11, 12, 32+12, 13, 32+13, 14, 32+14, 15, 32+15, 24, 32+24, 25, 32+25, 26, 32+26, 27, 32+27, 28, 32+28, 29, 32+29, 30, 32+30, 31, 32+31);
2731}2649}
27322650
...@@ -2759,9 +2677,8 @@ _mm256_unpackhi_epi8(__m256i __a, __m256i __b)...@@ -2759,9 +2677,8 @@ _mm256_unpackhi_epi8(__m256i __a, __m256i __b)
2759/// A 256-bit vector of [16 x i16] used as the source for the odd-numbered2677/// A 256-bit vector of [16 x i16] used as the source for the odd-numbered
2760/// elements of the result.2678/// elements of the result.
2761/// \returns A 256-bit vector of [16 x i16] containing the result.2679/// \returns A 256-bit vector of [16 x i16] containing the result.
2762static __inline__ __m256i __DEFAULT_FN_ATTRS2562680static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2763_mm256_unpackhi_epi16(__m256i __a, __m256i __b)2681_mm256_unpackhi_epi16(__m256i __a, __m256i __b) {
2764{
2765 return (__m256i)__builtin_shufflevector((__v16hi)__a, (__v16hi)__b, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15);2682 return (__m256i)__builtin_shufflevector((__v16hi)__a, (__v16hi)__b, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15);
2766}2683}
27672684
...@@ -2793,9 +2710,8 @@ _mm256_unpackhi_epi16(__m256i __a, __m256i __b)...@@ -2793,9 +2710,8 @@ _mm256_unpackhi_epi16(__m256i __a, __m256i __b)
2793/// A 256-bit vector of [8 x i32] used as the source for the odd-numbered2710/// A 256-bit vector of [8 x i32] used as the source for the odd-numbered
2794/// elements of the result.2711/// elements of the result.
2795/// \returns A 256-bit vector of [8 x i32] containing the result.2712/// \returns A 256-bit vector of [8 x i32] containing the result.
2796static __inline__ __m256i __DEFAULT_FN_ATTRS2562713static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2797_mm256_unpackhi_epi32(__m256i __a, __m256i __b)2714_mm256_unpackhi_epi32(__m256i __a, __m256i __b) {
2798{
2799 return (__m256i)__builtin_shufflevector((__v8si)__a, (__v8si)__b, 2, 8+2, 3, 8+3, 6, 8+6, 7, 8+7);2715 return (__m256i)__builtin_shufflevector((__v8si)__a, (__v8si)__b, 2, 8+2, 3, 8+3, 6, 8+6, 7, 8+7);
2800}2716}
28012717
...@@ -2823,9 +2739,8 @@ _mm256_unpackhi_epi32(__m256i __a, __m256i __b)...@@ -2823,9 +2739,8 @@ _mm256_unpackhi_epi32(__m256i __a, __m256i __b)
2823/// A 256-bit vector of [4 x i64] used as the source for the odd-numbered2739/// A 256-bit vector of [4 x i64] used as the source for the odd-numbered
2824/// elements of the result.2740/// elements of the result.
2825/// \returns A 256-bit vector of [4 x i64] containing the result.2741/// \returns A 256-bit vector of [4 x i64] containing the result.
2826static __inline__ __m256i __DEFAULT_FN_ATTRS2562742static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2827_mm256_unpackhi_epi64(__m256i __a, __m256i __b)2743_mm256_unpackhi_epi64(__m256i __a, __m256i __b) {
2828{
2829 return (__m256i)__builtin_shufflevector((__v4di)__a, (__v4di)__b, 1, 4+1, 3, 4+3);2744 return (__m256i)__builtin_shufflevector((__v4di)__a, (__v4di)__b, 1, 4+1, 3, 4+3);
2830}2745}
28312746
...@@ -2857,9 +2772,8 @@ _mm256_unpackhi_epi64(__m256i __a, __m256i __b)...@@ -2857,9 +2772,8 @@ _mm256_unpackhi_epi64(__m256i __a, __m256i __b)
2857/// A 256-bit integer vector used as the source for the odd-numbered bytes2772/// A 256-bit integer vector used as the source for the odd-numbered bytes
2858/// of the result.2773/// of the result.
2859/// \returns A 256-bit integer vector containing the result.2774/// \returns A 256-bit integer vector containing the result.
2860static __inline__ __m256i __DEFAULT_FN_ATTRS2562775static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2861_mm256_unpacklo_epi8(__m256i __a, __m256i __b)2776_mm256_unpacklo_epi8(__m256i __a, __m256i __b) {
2862{
2863 return (__m256i)__builtin_shufflevector((__v32qi)__a, (__v32qi)__b, 0, 32+0, 1, 32+1, 2, 32+2, 3, 32+3, 4, 32+4, 5, 32+5, 6, 32+6, 7, 32+7, 16, 32+16, 17, 32+17, 18, 32+18, 19, 32+19, 20, 32+20, 21, 32+21, 22, 32+22, 23, 32+23);2777 return (__m256i)__builtin_shufflevector((__v32qi)__a, (__v32qi)__b, 0, 32+0, 1, 32+1, 2, 32+2, 3, 32+3, 4, 32+4, 5, 32+5, 6, 32+6, 7, 32+7, 16, 32+16, 17, 32+17, 18, 32+18, 19, 32+19, 20, 32+20, 21, 32+21, 22, 32+22, 23, 32+23);
2864}2778}
28652779
...@@ -2892,9 +2806,8 @@ _mm256_unpacklo_epi8(__m256i __a, __m256i __b)...@@ -2892,9 +2806,8 @@ _mm256_unpacklo_epi8(__m256i __a, __m256i __b)
2892/// A 256-bit vector of [16 x i16] used as the source for the odd-numbered2806/// A 256-bit vector of [16 x i16] used as the source for the odd-numbered
2893/// elements of the result.2807/// elements of the result.
2894/// \returns A 256-bit vector of [16 x i16] containing the result.2808/// \returns A 256-bit vector of [16 x i16] containing the result.
2895static __inline__ __m256i __DEFAULT_FN_ATTRS2562809static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2896_mm256_unpacklo_epi16(__m256i __a, __m256i __b)2810_mm256_unpacklo_epi16(__m256i __a, __m256i __b) {
2897{
2898 return (__m256i)__builtin_shufflevector((__v16hi)__a, (__v16hi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11);2811 return (__m256i)__builtin_shufflevector((__v16hi)__a, (__v16hi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11);
2899}2812}
29002813
...@@ -2926,9 +2839,8 @@ _mm256_unpacklo_epi16(__m256i __a, __m256i __b)...@@ -2926,9 +2839,8 @@ _mm256_unpacklo_epi16(__m256i __a, __m256i __b)
2926/// A 256-bit vector of [8 x i32] used as the source for the odd-numbered2839/// A 256-bit vector of [8 x i32] used as the source for the odd-numbered
2927/// elements of the result.2840/// elements of the result.
2928/// \returns A 256-bit vector of [8 x i32] containing the result.2841/// \returns A 256-bit vector of [8 x i32] containing the result.
2929static __inline__ __m256i __DEFAULT_FN_ATTRS2562842static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2930_mm256_unpacklo_epi32(__m256i __a, __m256i __b)2843_mm256_unpacklo_epi32(__m256i __a, __m256i __b) {
2931{
2932 return (__m256i)__builtin_shufflevector((__v8si)__a, (__v8si)__b, 0, 8+0, 1, 8+1, 4, 8+4, 5, 8+5);2844 return (__m256i)__builtin_shufflevector((__v8si)__a, (__v8si)__b, 0, 8+0, 1, 8+1, 4, 8+4, 5, 8+5);
2933}2845}
29342846
...@@ -2956,9 +2868,8 @@ _mm256_unpacklo_epi32(__m256i __a, __m256i __b)...@@ -2956,9 +2868,8 @@ _mm256_unpacklo_epi32(__m256i __a, __m256i __b)
2956/// A 256-bit vector of [4 x i64] used as the source for the odd-numbered2868/// A 256-bit vector of [4 x i64] used as the source for the odd-numbered
2957/// elements of the result.2869/// elements of the result.
2958/// \returns A 256-bit vector of [4 x i64] containing the result.2870/// \returns A 256-bit vector of [4 x i64] containing the result.
2959static __inline__ __m256i __DEFAULT_FN_ATTRS2562871static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2960_mm256_unpacklo_epi64(__m256i __a, __m256i __b)2872_mm256_unpacklo_epi64(__m256i __a, __m256i __b) {
2961{
2962 return (__m256i)__builtin_shufflevector((__v4di)__a, (__v4di)__b, 0, 4+0, 2, 4+2);2873 return (__m256i)__builtin_shufflevector((__v4di)__a, (__v4di)__b, 0, 4+0, 2, 4+2);
2963}2874}
29642875
...@@ -2974,7 +2885,7 @@ _mm256_unpacklo_epi64(__m256i __a, __m256i __b)...@@ -2974,7 +2885,7 @@ _mm256_unpacklo_epi64(__m256i __a, __m256i __b)
2974/// \param __b2885/// \param __b
2975/// A 256-bit integer vector.2886/// A 256-bit integer vector.
2976/// \returns A 256-bit integer vector containing the result.2887/// \returns A 256-bit integer vector containing the result.
2977static __inline__ __m256i __DEFAULT_FN_ATTRS2562888static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2978_mm256_xor_si256(__m256i __a, __m256i __b)2889_mm256_xor_si256(__m256i __a, __m256i __b)
2979{2890{
2980 return (__m256i)((__v4du)__a ^ (__v4du)__b);2891 return (__m256i)((__v4du)__a ^ (__v4du)__b);
...@@ -3009,9 +2920,8 @@ _mm256_stream_load_si256(const void *__V)...@@ -3009,9 +2920,8 @@ _mm256_stream_load_si256(const void *__V)
3009/// \param __X2920/// \param __X
3010/// A 128-bit vector of [4 x float] whose low element will be broadcast.2921/// A 128-bit vector of [4 x float] whose low element will be broadcast.
3011/// \returns A 128-bit vector of [4 x float] containing the result.2922/// \returns A 128-bit vector of [4 x float] containing the result.
3012static __inline__ __m128 __DEFAULT_FN_ATTRS1282923static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3013_mm_broadcastss_ps(__m128 __X)2924_mm_broadcastss_ps(__m128 __X) {
3014{
3015 return (__m128)__builtin_shufflevector((__v4sf)__X, (__v4sf)__X, 0, 0, 0, 0);2925 return (__m128)__builtin_shufflevector((__v4sf)__X, (__v4sf)__X, 0, 0, 0, 0);
3016}2926}
30172927
...@@ -3026,9 +2936,8 @@ _mm_broadcastss_ps(__m128 __X)...@@ -3026,9 +2936,8 @@ _mm_broadcastss_ps(__m128 __X)
3026/// \param __a2936/// \param __a
3027/// A 128-bit vector of [2 x double] whose low element will be broadcast.2937/// A 128-bit vector of [2 x double] whose low element will be broadcast.
3028/// \returns A 128-bit vector of [2 x double] containing the result.2938/// \returns A 128-bit vector of [2 x double] containing the result.
3029static __inline__ __m128d __DEFAULT_FN_ATTRS1282939static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3030_mm_broadcastsd_pd(__m128d __a)2940_mm_broadcastsd_pd(__m128d __a) {
3031{
3032 return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);2941 return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);
3033}2942}
30342943
...@@ -3043,9 +2952,8 @@ _mm_broadcastsd_pd(__m128d __a)...@@ -3043,9 +2952,8 @@ _mm_broadcastsd_pd(__m128d __a)
3043/// \param __X2952/// \param __X
3044/// A 128-bit vector of [4 x float] whose low element will be broadcast.2953/// A 128-bit vector of [4 x float] whose low element will be broadcast.
3045/// \returns A 256-bit vector of [8 x float] containing the result.2954/// \returns A 256-bit vector of [8 x float] containing the result.
3046static __inline__ __m256 __DEFAULT_FN_ATTRS2562955static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3047_mm256_broadcastss_ps(__m128 __X)2956_mm256_broadcastss_ps(__m128 __X) {
3048{
3049 return (__m256)__builtin_shufflevector((__v4sf)__X, (__v4sf)__X, 0, 0, 0, 0, 0, 0, 0, 0);2957 return (__m256)__builtin_shufflevector((__v4sf)__X, (__v4sf)__X, 0, 0, 0, 0, 0, 0, 0, 0);
3050}2958}
30512959
...@@ -3060,9 +2968,8 @@ _mm256_broadcastss_ps(__m128 __X)...@@ -3060,9 +2968,8 @@ _mm256_broadcastss_ps(__m128 __X)
3060/// \param __X2968/// \param __X
3061/// A 128-bit vector of [2 x double] whose low element will be broadcast.2969/// A 128-bit vector of [2 x double] whose low element will be broadcast.
3062/// \returns A 256-bit vector of [4 x double] containing the result.2970/// \returns A 256-bit vector of [4 x double] containing the result.
3063static __inline__ __m256d __DEFAULT_FN_ATTRS2562971static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3064_mm256_broadcastsd_pd(__m128d __X)2972_mm256_broadcastsd_pd(__m128d __X) {
3065{
3066 return (__m256d)__builtin_shufflevector((__v2df)__X, (__v2df)__X, 0, 0, 0, 0);2973 return (__m256d)__builtin_shufflevector((__v2df)__X, (__v2df)__X, 0, 0, 0, 0);
3067}2974}
30682975
...@@ -3076,9 +2983,8 @@ _mm256_broadcastsd_pd(__m128d __X)...@@ -3076,9 +2983,8 @@ _mm256_broadcastsd_pd(__m128d __X)
3076/// \param __X2983/// \param __X
3077/// A 128-bit integer vector to be broadcast.2984/// A 128-bit integer vector to be broadcast.
3078/// \returns A 256-bit integer vector containing the result.2985/// \returns A 256-bit integer vector containing the result.
3079static __inline__ __m256i __DEFAULT_FN_ATTRS2562986static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3080_mm256_broadcastsi128_si256(__m128i __X)2987_mm256_broadcastsi128_si256(__m128i __X) {
3081{
3082 return (__m256i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 1, 0, 1);2988 return (__m256i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 1, 0, 1);
3083}2989}
30842990
...@@ -3168,9 +3074,8 @@ _mm256_broadcastsi128_si256(__m128i __X)...@@ -3168,9 +3074,8 @@ _mm256_broadcastsi128_si256(__m128i __X)
3168/// \param __X3074/// \param __X
3169/// A 128-bit integer vector whose low byte will be broadcast.3075/// A 128-bit integer vector whose low byte will be broadcast.
3170/// \returns A 256-bit integer vector containing the result.3076/// \returns A 256-bit integer vector containing the result.
3171static __inline__ __m256i __DEFAULT_FN_ATTRS2563077static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3172_mm256_broadcastb_epi8(__m128i __X)3078_mm256_broadcastb_epi8(__m128i __X) {
3173{
3174 return (__m256i)__builtin_shufflevector((__v16qi)__X, (__v16qi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);3079 return (__m256i)__builtin_shufflevector((__v16qi)__X, (__v16qi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
3175}3080}
31763081
...@@ -3184,9 +3089,8 @@ _mm256_broadcastb_epi8(__m128i __X)...@@ -3184,9 +3089,8 @@ _mm256_broadcastb_epi8(__m128i __X)
3184/// \param __X3089/// \param __X
3185/// A 128-bit vector of [8 x i16] whose low element will be broadcast.3090/// A 128-bit vector of [8 x i16] whose low element will be broadcast.
3186/// \returns A 256-bit vector of [16 x i16] containing the result.3091/// \returns A 256-bit vector of [16 x i16] containing the result.
3187static __inline__ __m256i __DEFAULT_FN_ATTRS2563092static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3188_mm256_broadcastw_epi16(__m128i __X)3093_mm256_broadcastw_epi16(__m128i __X) {
3189{
3190 return (__m256i)__builtin_shufflevector((__v8hi)__X, (__v8hi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);3094 return (__m256i)__builtin_shufflevector((__v8hi)__X, (__v8hi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
3191}3095}
31923096
...@@ -3200,9 +3104,8 @@ _mm256_broadcastw_epi16(__m128i __X)...@@ -3200,9 +3104,8 @@ _mm256_broadcastw_epi16(__m128i __X)
3200/// \param __X3104/// \param __X
3201/// A 128-bit vector of [4 x i32] whose low element will be broadcast.3105/// A 128-bit vector of [4 x i32] whose low element will be broadcast.
3202/// \returns A 256-bit vector of [8 x i32] containing the result.3106/// \returns A 256-bit vector of [8 x i32] containing the result.
3203static __inline__ __m256i __DEFAULT_FN_ATTRS2563107static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3204_mm256_broadcastd_epi32(__m128i __X)3108_mm256_broadcastd_epi32(__m128i __X) {
3205{
3206 return (__m256i)__builtin_shufflevector((__v4si)__X, (__v4si)__X, 0, 0, 0, 0, 0, 0, 0, 0);3109 return (__m256i)__builtin_shufflevector((__v4si)__X, (__v4si)__X, 0, 0, 0, 0, 0, 0, 0, 0);
3207}3110}
32083111
...@@ -3216,9 +3119,8 @@ _mm256_broadcastd_epi32(__m128i __X)...@@ -3216,9 +3119,8 @@ _mm256_broadcastd_epi32(__m128i __X)
3216/// \param __X3119/// \param __X
3217/// A 128-bit vector of [2 x i64] whose low element will be broadcast.3120/// A 128-bit vector of [2 x i64] whose low element will be broadcast.
3218/// \returns A 256-bit vector of [4 x i64] containing the result.3121/// \returns A 256-bit vector of [4 x i64] containing the result.
3219static __inline__ __m256i __DEFAULT_FN_ATTRS2563122static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3220_mm256_broadcastq_epi64(__m128i __X)3123_mm256_broadcastq_epi64(__m128i __X) {
3221{
3222 return (__m256i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 0, 0, 0);3124 return (__m256i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 0, 0, 0);
3223}3125}
32243126
...@@ -3232,9 +3134,8 @@ _mm256_broadcastq_epi64(__m128i __X)...@@ -3232,9 +3134,8 @@ _mm256_broadcastq_epi64(__m128i __X)
3232/// \param __X3134/// \param __X
3233/// A 128-bit integer vector whose low byte will be broadcast.3135/// A 128-bit integer vector whose low byte will be broadcast.
3234/// \returns A 128-bit integer vector containing the result.3136/// \returns A 128-bit integer vector containing the result.
3235static __inline__ __m128i __DEFAULT_FN_ATTRS1283137static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3236_mm_broadcastb_epi8(__m128i __X)3138_mm_broadcastb_epi8(__m128i __X) {
3237{
3238 return (__m128i)__builtin_shufflevector((__v16qi)__X, (__v16qi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);3139 return (__m128i)__builtin_shufflevector((__v16qi)__X, (__v16qi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
3239}3140}
32403141
...@@ -3248,9 +3149,8 @@ _mm_broadcastb_epi8(__m128i __X)...@@ -3248,9 +3149,8 @@ _mm_broadcastb_epi8(__m128i __X)
3248/// \param __X3149/// \param __X
3249/// A 128-bit vector of [8 x i16] whose low element will be broadcast.3150/// A 128-bit vector of [8 x i16] whose low element will be broadcast.
3250/// \returns A 128-bit vector of [8 x i16] containing the result.3151/// \returns A 128-bit vector of [8 x i16] containing the result.
3251static __inline__ __m128i __DEFAULT_FN_ATTRS1283152static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3252_mm_broadcastw_epi16(__m128i __X)3153_mm_broadcastw_epi16(__m128i __X) {
3253{
3254 return (__m128i)__builtin_shufflevector((__v8hi)__X, (__v8hi)__X, 0, 0, 0, 0, 0, 0, 0, 0);3154 return (__m128i)__builtin_shufflevector((__v8hi)__X, (__v8hi)__X, 0, 0, 0, 0, 0, 0, 0, 0);
3255}3155}
32563156
...@@ -3264,9 +3164,8 @@ _mm_broadcastw_epi16(__m128i __X)...@@ -3264,9 +3164,8 @@ _mm_broadcastw_epi16(__m128i __X)
3264/// \param __X3164/// \param __X
3265/// A 128-bit vector of [4 x i32] whose low element will be broadcast.3165/// A 128-bit vector of [4 x i32] whose low element will be broadcast.
3266/// \returns A 128-bit vector of [4 x i32] containing the result.3166/// \returns A 128-bit vector of [4 x i32] containing the result.
3267static __inline__ __m128i __DEFAULT_FN_ATTRS1283167static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3268_mm_broadcastd_epi32(__m128i __X)3168_mm_broadcastd_epi32(__m128i __X) {
3269{
3270 return (__m128i)__builtin_shufflevector((__v4si)__X, (__v4si)__X, 0, 0, 0, 0);3169 return (__m128i)__builtin_shufflevector((__v4si)__X, (__v4si)__X, 0, 0, 0, 0);
3271}3170}
32723171
...@@ -3280,9 +3179,8 @@ _mm_broadcastd_epi32(__m128i __X)...@@ -3280,9 +3179,8 @@ _mm_broadcastd_epi32(__m128i __X)
3280/// \param __X3179/// \param __X
3281/// A 128-bit vector of [2 x i64] whose low element will be broadcast.3180/// A 128-bit vector of [2 x i64] whose low element will be broadcast.
3282/// \returns A 128-bit vector of [2 x i64] containing the result.3181/// \returns A 128-bit vector of [2 x i64] containing the result.
3283static __inline__ __m128i __DEFAULT_FN_ATTRS1283182static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3284_mm_broadcastq_epi64(__m128i __X)3183_mm_broadcastq_epi64(__m128i __X) {
3285{
3286 return (__m128i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 0);3184 return (__m128i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 0);
3287}3185}
32883186
...@@ -3308,9 +3206,8 @@ _mm_broadcastq_epi64(__m128i __X)...@@ -3308,9 +3206,8 @@ _mm_broadcastq_epi64(__m128i __X)
3308/// A 256-bit vector of [8 x i32] containing indexes of values to use from3206/// A 256-bit vector of [8 x i32] containing indexes of values to use from
3309/// \a __a.3207/// \a __a.
3310/// \returns A 256-bit vector of [8 x i32] containing the result.3208/// \returns A 256-bit vector of [8 x i32] containing the result.
3311static __inline__ __m256i __DEFAULT_FN_ATTRS2563209static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3312_mm256_permutevar8x32_epi32(__m256i __a, __m256i __b)3210_mm256_permutevar8x32_epi32(__m256i __a, __m256i __b) {
3313{
3314 return (__m256i)__builtin_ia32_permvarsi256((__v8si)__a, (__v8si)__b);3211 return (__m256i)__builtin_ia32_permvarsi256((__v8si)__a, (__v8si)__b);
3315}3212}
33163213
...@@ -3366,9 +3263,8 @@ _mm256_permutevar8x32_epi32(__m256i __a, __m256i __b)...@@ -3366,9 +3263,8 @@ _mm256_permutevar8x32_epi32(__m256i __a, __m256i __b)
3366/// A 256-bit vector of [8 x i32] containing indexes of values to use from3263/// A 256-bit vector of [8 x i32] containing indexes of values to use from
3367/// \a __a.3264/// \a __a.
3368/// \returns A 256-bit vector of [8 x float] containing the result.3265/// \returns A 256-bit vector of [8 x float] containing the result.
3369static __inline__ __m256 __DEFAULT_FN_ATTRS2563266static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3370_mm256_permutevar8x32_ps(__m256 __a, __m256i __b)3267_mm256_permutevar8x32_ps(__m256 __a, __m256i __b) {
3371{
3372 return (__m256)__builtin_ia32_permvarsf256((__v8sf)__a, (__v8si)__b);3268 return (__m256)__builtin_ia32_permvarsf256((__v8sf)__a, (__v8si)__b);
3373}3269}
33743270
...@@ -3756,7 +3652,7 @@ _mm_maskstore_epi64(long long *__X, __m128i __M, __m128i __Y)...@@ -3756,7 +3652,7 @@ _mm_maskstore_epi64(long long *__X, __m128i __M, __m128i __Y)
3756/// A 256-bit vector of [8 x i32] containing the unsigned shift counts (in3652/// A 256-bit vector of [8 x i32] containing the unsigned shift counts (in
3757/// bits).3653/// bits).
3758/// \returns A 256-bit vector of [8 x i32] containing the result.3654/// \returns A 256-bit vector of [8 x i32] containing the result.
3759static __inline__ __m256i __DEFAULT_FN_ATTRS2563655static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3760_mm256_sllv_epi32(__m256i __X, __m256i __Y)3656_mm256_sllv_epi32(__m256i __X, __m256i __Y)
3761{3657{
3762 return (__m256i)__builtin_ia32_psllv8si((__v8si)__X, (__v8si)__Y);3658 return (__m256i)__builtin_ia32_psllv8si((__v8si)__X, (__v8si)__Y);
...@@ -3778,7 +3674,7 @@ _mm256_sllv_epi32(__m256i __X, __m256i __Y)...@@ -3778,7 +3674,7 @@ _mm256_sllv_epi32(__m256i __X, __m256i __Y)
3778/// A 128-bit vector of [4 x i32] containing the unsigned shift counts (in3674/// A 128-bit vector of [4 x i32] containing the unsigned shift counts (in
3779/// bits).3675/// bits).
3780/// \returns A 128-bit vector of [4 x i32] containing the result.3676/// \returns A 128-bit vector of [4 x i32] containing the result.
3781static __inline__ __m128i __DEFAULT_FN_ATTRS1283677static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3782_mm_sllv_epi32(__m128i __X, __m128i __Y)3678_mm_sllv_epi32(__m128i __X, __m128i __Y)
3783{3679{
3784 return (__m128i)__builtin_ia32_psllv4si((__v4si)__X, (__v4si)__Y);3680 return (__m128i)__builtin_ia32_psllv4si((__v4si)__X, (__v4si)__Y);
...@@ -3800,7 +3696,7 @@ _mm_sllv_epi32(__m128i __X, __m128i __Y)...@@ -3800,7 +3696,7 @@ _mm_sllv_epi32(__m128i __X, __m128i __Y)
3800/// A 256-bit vector of [4 x i64] containing the unsigned shift counts (in3696/// A 256-bit vector of [4 x i64] containing the unsigned shift counts (in
3801/// bits).3697/// bits).
3802/// \returns A 256-bit vector of [4 x i64] containing the result.3698/// \returns A 256-bit vector of [4 x i64] containing the result.
3803static __inline__ __m256i __DEFAULT_FN_ATTRS2563699static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3804_mm256_sllv_epi64(__m256i __X, __m256i __Y)3700_mm256_sllv_epi64(__m256i __X, __m256i __Y)
3805{3701{
3806 return (__m256i)__builtin_ia32_psllv4di((__v4di)__X, (__v4di)__Y);3702 return (__m256i)__builtin_ia32_psllv4di((__v4di)__X, (__v4di)__Y);
...@@ -3822,7 +3718,7 @@ _mm256_sllv_epi64(__m256i __X, __m256i __Y)...@@ -3822,7 +3718,7 @@ _mm256_sllv_epi64(__m256i __X, __m256i __Y)
3822/// A 128-bit vector of [2 x i64] containing the unsigned shift counts (in3718/// A 128-bit vector of [2 x i64] containing the unsigned shift counts (in
3823/// bits).3719/// bits).
3824/// \returns A 128-bit vector of [2 x i64] containing the result.3720/// \returns A 128-bit vector of [2 x i64] containing the result.
3825static __inline__ __m128i __DEFAULT_FN_ATTRS1283721static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3826_mm_sllv_epi64(__m128i __X, __m128i __Y)3722_mm_sllv_epi64(__m128i __X, __m128i __Y)
3827{3723{
3828 return (__m128i)__builtin_ia32_psllv2di((__v2di)__X, (__v2di)__Y);3724 return (__m128i)__builtin_ia32_psllv2di((__v2di)__X, (__v2di)__Y);
...@@ -3845,7 +3741,7 @@ _mm_sllv_epi64(__m128i __X, __m128i __Y)...@@ -3845,7 +3741,7 @@ _mm_sllv_epi64(__m128i __X, __m128i __Y)
3845/// A 256-bit vector of [8 x i32] containing the unsigned shift counts (in3741/// A 256-bit vector of [8 x i32] containing the unsigned shift counts (in
3846/// bits).3742/// bits).
3847/// \returns A 256-bit vector of [8 x i32] containing the result.3743/// \returns A 256-bit vector of [8 x i32] containing the result.
3848static __inline__ __m256i __DEFAULT_FN_ATTRS2563744static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3849_mm256_srav_epi32(__m256i __X, __m256i __Y)3745_mm256_srav_epi32(__m256i __X, __m256i __Y)
3850{3746{
3851 return (__m256i)__builtin_ia32_psrav8si((__v8si)__X, (__v8si)__Y);3747 return (__m256i)__builtin_ia32_psrav8si((__v8si)__X, (__v8si)__Y);
...@@ -3868,7 +3764,7 @@ _mm256_srav_epi32(__m256i __X, __m256i __Y)...@@ -3868,7 +3764,7 @@ _mm256_srav_epi32(__m256i __X, __m256i __Y)
3868/// A 128-bit vector of [4 x i32] containing the unsigned shift counts (in3764/// A 128-bit vector of [4 x i32] containing the unsigned shift counts (in
3869/// bits).3765/// bits).
3870/// \returns A 128-bit vector of [4 x i32] containing the result.3766/// \returns A 128-bit vector of [4 x i32] containing the result.
3871static __inline__ __m128i __DEFAULT_FN_ATTRS1283767static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3872_mm_srav_epi32(__m128i __X, __m128i __Y)3768_mm_srav_epi32(__m128i __X, __m128i __Y)
3873{3769{
3874 return (__m128i)__builtin_ia32_psrav4si((__v4si)__X, (__v4si)__Y);3770 return (__m128i)__builtin_ia32_psrav4si((__v4si)__X, (__v4si)__Y);
...@@ -3890,7 +3786,7 @@ _mm_srav_epi32(__m128i __X, __m128i __Y)...@@ -3890,7 +3786,7 @@ _mm_srav_epi32(__m128i __X, __m128i __Y)
3890/// A 256-bit vector of [8 x i32] containing the unsigned shift counts (in3786/// A 256-bit vector of [8 x i32] containing the unsigned shift counts (in
3891/// bits).3787/// bits).
3892/// \returns A 256-bit vector of [8 x i32] containing the result.3788/// \returns A 256-bit vector of [8 x i32] containing the result.
3893static __inline__ __m256i __DEFAULT_FN_ATTRS2563789static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3894_mm256_srlv_epi32(__m256i __X, __m256i __Y)3790_mm256_srlv_epi32(__m256i __X, __m256i __Y)
3895{3791{
3896 return (__m256i)__builtin_ia32_psrlv8si((__v8si)__X, (__v8si)__Y);3792 return (__m256i)__builtin_ia32_psrlv8si((__v8si)__X, (__v8si)__Y);
...@@ -3912,7 +3808,7 @@ _mm256_srlv_epi32(__m256i __X, __m256i __Y)...@@ -3912,7 +3808,7 @@ _mm256_srlv_epi32(__m256i __X, __m256i __Y)
3912/// A 128-bit vector of [4 x i32] containing the unsigned shift counts (in3808/// A 128-bit vector of [4 x i32] containing the unsigned shift counts (in
3913/// bits).3809/// bits).
3914/// \returns A 128-bit vector of [4 x i32] containing the result.3810/// \returns A 128-bit vector of [4 x i32] containing the result.
3915static __inline__ __m128i __DEFAULT_FN_ATTRS1283811static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3916_mm_srlv_epi32(__m128i __X, __m128i __Y)3812_mm_srlv_epi32(__m128i __X, __m128i __Y)
3917{3813{
3918 return (__m128i)__builtin_ia32_psrlv4si((__v4si)__X, (__v4si)__Y);3814 return (__m128i)__builtin_ia32_psrlv4si((__v4si)__X, (__v4si)__Y);
...@@ -3934,7 +3830,7 @@ _mm_srlv_epi32(__m128i __X, __m128i __Y)...@@ -3934,7 +3830,7 @@ _mm_srlv_epi32(__m128i __X, __m128i __Y)
3934/// A 256-bit vector of [4 x i64] containing the unsigned shift counts (in3830/// A 256-bit vector of [4 x i64] containing the unsigned shift counts (in
3935/// bits).3831/// bits).
3936/// \returns A 256-bit vector of [4 x i64] containing the result.3832/// \returns A 256-bit vector of [4 x i64] containing the result.
3937static __inline__ __m256i __DEFAULT_FN_ATTRS2563833static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3938_mm256_srlv_epi64(__m256i __X, __m256i __Y)3834_mm256_srlv_epi64(__m256i __X, __m256i __Y)
3939{3835{
3940 return (__m256i)__builtin_ia32_psrlv4di((__v4di)__X, (__v4di)__Y);3836 return (__m256i)__builtin_ia32_psrlv4di((__v4di)__X, (__v4di)__Y);
...@@ -3956,7 +3852,7 @@ _mm256_srlv_epi64(__m256i __X, __m256i __Y)...@@ -3956,7 +3852,7 @@ _mm256_srlv_epi64(__m256i __X, __m256i __Y)
3956/// A 128-bit vector of [2 x i64] containing the unsigned shift counts (in3852/// A 128-bit vector of [2 x i64] containing the unsigned shift counts (in
3957/// bits).3853/// bits).
3958/// \returns A 128-bit vector of [2 x i64] containing the result.3854/// \returns A 128-bit vector of [2 x i64] containing the result.
3959static __inline__ __m128i __DEFAULT_FN_ATTRS1283855static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3960_mm_srlv_epi64(__m128i __X, __m128i __Y)3856_mm_srlv_epi64(__m128i __X, __m128i __Y)
3961{3857{
3962 return (__m128i)__builtin_ia32_psrlv2di((__v2di)__X, (__v2di)__Y);3858 return (__m128i)__builtin_ia32_psrlv2di((__v2di)__X, (__v2di)__Y);
...@@ -5289,5 +5185,7 @@ _mm_srlv_epi64(__m128i __X, __m128i __Y)...@@ -5289,5 +5185,7 @@ _mm_srlv_epi64(__m128i __X, __m128i __Y)
52895185
5290#undef __DEFAULT_FN_ATTRS2565186#undef __DEFAULT_FN_ATTRS256
5291#undef __DEFAULT_FN_ATTRS1285187#undef __DEFAULT_FN_ATTRS128
5188#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
5189#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
52925190
5293#endif /* __AVX2INTRIN_H */5191#endif /* __AVX2INTRIN_H */
lib/include/avx512bf16intrin.h+25-16
...@@ -19,12 +19,19 @@ typedef __bf16 __v32bf __attribute__((__vector_size__(64), __aligned__(64)));...@@ -19,12 +19,19 @@ typedef __bf16 __v32bf __attribute__((__vector_size__(64), __aligned__(64)));
19typedef __bf16 __m512bh __attribute__((__vector_size__(64), __aligned__(64)));19typedef __bf16 __m512bh __attribute__((__vector_size__(64), __aligned__(64)));
20typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));20typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));
2121
22#define __DEFAULT_FN_ATTRS512 \22#define __DEFAULT_FN_ATTRS512 \
23 __attribute__((__always_inline__, __nodebug__, __target__("avx512bf16,evex512"), \23 __attribute__((__always_inline__, __nodebug__, __target__("avx512bf16"), \
24 __min_vector_width__(512)))24 __min_vector_width__(512)))
25#define __DEFAULT_FN_ATTRS \25#define __DEFAULT_FN_ATTRS \
26 __attribute__((__always_inline__, __nodebug__, \26 __attribute__((__always_inline__, __nodebug__, __target__("avx512bf16")))
27 __target__("avx512bf16,no-evex512")))27
28#if defined(__cplusplus) && (__cplusplus >= 201103L)
29#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
30#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
31#else
32#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
33#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
34#endif
2835
29/// Convert One BF16 Data to One Single Float Data.36/// Convert One BF16 Data to One Single Float Data.
30///37///
...@@ -36,8 +43,8 @@ typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));...@@ -36,8 +43,8 @@ typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));
36/// A bfloat data.43/// A bfloat data.
37/// \returns A float data whose sign field and exponent field keep unchanged,44/// \returns A float data whose sign field and exponent field keep unchanged,
38/// and fraction field is extended to 23 bits.45/// and fraction field is extended to 23 bits.
39static __inline__ float __DEFAULT_FN_ATTRS _mm_cvtsbh_ss(__bf16 __A) {46static __inline__ float __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsbh_ss(__bf16 __A) {
40 return __builtin_ia32_cvtsbf162ss_32(__A);47 return (float)(__A);
41}48}
4249
43/// Convert Two Packed Single Data to One Packed BF16 Data.50/// Convert Two Packed Single Data to One Packed BF16 Data.
...@@ -236,9 +243,9 @@ _mm512_maskz_dpbf16_ps(__mmask16 __U, __m512 __D, __m512bh __A, __m512bh __B) {...@@ -236,9 +243,9 @@ _mm512_maskz_dpbf16_ps(__mmask16 __U, __m512 __D, __m512bh __A, __m512bh __B) {
236/// \param __A243/// \param __A
237/// A 256-bit vector of [16 x bfloat].244/// A 256-bit vector of [16 x bfloat].
238/// \returns A 512-bit vector of [16 x float] come from conversion of __A245/// \returns A 512-bit vector of [16 x float] come from conversion of __A
239static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_cvtpbh_ps(__m256bh __A) {246static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
240 return _mm512_castsi512_ps((__m512i)_mm512_slli_epi32(247_mm512_cvtpbh_ps(__m256bh __A) {
241 (__m512i)_mm512_cvtepi16_epi32((__m256i)__A), 16));248 return (__m512) __builtin_convertvector(__A, __v16sf);
242}249}
243250
244/// Convert Packed BF16 Data to Packed float Data using zeroing mask.251/// Convert Packed BF16 Data to Packed float Data using zeroing mask.
...@@ -251,10 +258,11 @@ static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_cvtpbh_ps(__m256bh __A) {...@@ -251,10 +258,11 @@ static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_cvtpbh_ps(__m256bh __A) {
251/// \param __A258/// \param __A
252/// A 256-bit vector of [16 x bfloat].259/// A 256-bit vector of [16 x bfloat].
253/// \returns A 512-bit vector of [16 x float] come from conversion of __A260/// \returns A 512-bit vector of [16 x float] come from conversion of __A
254static __inline__ __m512 __DEFAULT_FN_ATTRS512261static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
255_mm512_maskz_cvtpbh_ps(__mmask16 __U, __m256bh __A) {262_mm512_maskz_cvtpbh_ps(__mmask16 __U, __m256bh __A) {
256 return _mm512_castsi512_ps((__m512i)_mm512_slli_epi32(263 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
257 (__m512i)_mm512_maskz_cvtepi16_epi32((__mmask16)__U, (__m256i)__A), 16));264 (__v16sf)_mm512_cvtpbh_ps(__A),
265 (__v16sf)_mm512_setzero_ps());
258}266}
259267
260/// Convert Packed BF16 Data to Packed float Data using merging mask.268/// Convert Packed BF16 Data to Packed float Data using merging mask.
...@@ -269,15 +277,16 @@ _mm512_maskz_cvtpbh_ps(__mmask16 __U, __m256bh __A) {...@@ -269,15 +277,16 @@ _mm512_maskz_cvtpbh_ps(__mmask16 __U, __m256bh __A) {
269/// \param __A277/// \param __A
270/// A 256-bit vector of [16 x bfloat].278/// A 256-bit vector of [16 x bfloat].
271/// \returns A 512-bit vector of [16 x float] come from conversion of __A279/// \returns A 512-bit vector of [16 x float] come from conversion of __A
272static __inline__ __m512 __DEFAULT_FN_ATTRS512280static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
273_mm512_mask_cvtpbh_ps(__m512 __S, __mmask16 __U, __m256bh __A) {281_mm512_mask_cvtpbh_ps(__m512 __S, __mmask16 __U, __m256bh __A) {
274 return _mm512_castsi512_ps((__m512i)_mm512_mask_slli_epi32(282 return (__m512)__builtin_ia32_selectps_512(
275 (__m512i)__S, (__mmask16)__U,283 (__mmask16)__U, (__v16sf)_mm512_cvtpbh_ps(__A), (__v16sf)__S);
276 (__m512i)_mm512_cvtepi16_epi32((__m256i)__A), 16));
277}284}
278285
279#undef __DEFAULT_FN_ATTRS286#undef __DEFAULT_FN_ATTRS
287#undef __DEFAULT_FN_ATTRS_CONSTEXPR
280#undef __DEFAULT_FN_ATTRS512288#undef __DEFAULT_FN_ATTRS512
289#undef __DEFAULT_FN_ATTRS512_CONSTEXPR
281290
282#endif291#endif
283#endif292#endif
lib/include/avx512bitalgintrin.h+19-30
...@@ -15,53 +15,44 @@...@@ -15,53 +15,44 @@
15#define __AVX512BITALGINTRIN_H15#define __AVX512BITALGINTRIN_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)
18#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("avx512bitalg"), \
20 __target__("avx512bitalg,evex512"), \21 __min_vector_width__(512))) constexpr
22#else
23#define __DEFAULT_FN_ATTRS \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx512bitalg"), \
21 __min_vector_width__(512)))25 __min_vector_width__(512)))
26#endif
2227
23static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi16(__m512i __A) {
24_mm512_popcnt_epi16(__m512i __A)
25{
26 return (__m512i)__builtin_elementwise_popcount((__v32hu)__A);29 return (__m512i)__builtin_elementwise_popcount((__v32hu)__A);
27}30}
2831
29static __inline__ __m512i __DEFAULT_FN_ATTRS32static __inline__ __m512i __DEFAULT_FN_ATTRS
30_mm512_mask_popcnt_epi16(__m512i __A, __mmask32 __U, __m512i __B)33_mm512_mask_popcnt_epi16(__m512i __A, __mmask32 __U, __m512i __B) {
31{34 return (__m512i)__builtin_ia32_selectw_512(
32 return (__m512i) __builtin_ia32_selectw_512((__mmask32) __U,35 (__mmask32)__U, (__v32hi)_mm512_popcnt_epi16(__B), (__v32hi)__A);
33 (__v32hi) _mm512_popcnt_epi16(__B),
34 (__v32hi) __A);
35}36}
3637
37static __inline__ __m512i __DEFAULT_FN_ATTRS38static __inline__ __m512i __DEFAULT_FN_ATTRS
38_mm512_maskz_popcnt_epi16(__mmask32 __U, __m512i __B)39_mm512_maskz_popcnt_epi16(__mmask32 __U, __m512i __B) {
39{40 return _mm512_mask_popcnt_epi16((__m512i)_mm512_setzero_si512(), __U, __B);
40 return _mm512_mask_popcnt_epi16((__m512i) _mm512_setzero_si512(),
41 __U,
42 __B);
43}41}
4442
45static __inline__ __m512i __DEFAULT_FN_ATTRS43static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi8(__m512i __A) {
46_mm512_popcnt_epi8(__m512i __A)
47{
48 return (__m512i)__builtin_elementwise_popcount((__v64qu)__A);44 return (__m512i)__builtin_elementwise_popcount((__v64qu)__A);
49}45}
5046
51static __inline__ __m512i __DEFAULT_FN_ATTRS47static __inline__ __m512i __DEFAULT_FN_ATTRS
52_mm512_mask_popcnt_epi8(__m512i __A, __mmask64 __U, __m512i __B)48_mm512_mask_popcnt_epi8(__m512i __A, __mmask64 __U, __m512i __B) {
53{49 return (__m512i)__builtin_ia32_selectb_512(
54 return (__m512i) __builtin_ia32_selectb_512((__mmask64) __U,50 (__mmask64)__U, (__v64qi)_mm512_popcnt_epi8(__B), (__v64qi)__A);
55 (__v64qi) _mm512_popcnt_epi8(__B),
56 (__v64qi) __A);
57}51}
5852
59static __inline__ __m512i __DEFAULT_FN_ATTRS53static __inline__ __m512i __DEFAULT_FN_ATTRS
60_mm512_maskz_popcnt_epi8(__mmask64 __U, __m512i __B)54_mm512_maskz_popcnt_epi8(__mmask64 __U, __m512i __B) {
61{55 return _mm512_mask_popcnt_epi8((__m512i)_mm512_setzero_si512(), __U, __B);
62 return _mm512_mask_popcnt_epi8((__m512i) _mm512_setzero_si512(),
63 __U,
64 __B);
65}56}
6657
67static __inline__ __mmask64 __DEFAULT_FN_ATTRS58static __inline__ __mmask64 __DEFAULT_FN_ATTRS
...@@ -80,7 +71,5 @@ _mm512_bitshuffle_epi64_mask(__m512i __A, __m512i __B)...@@ -80,7 +71,5 @@ _mm512_bitshuffle_epi64_mask(__m512i __A, __m512i __B)
80 __B);71 __B);
81}72}
8273
83
84#undef __DEFAULT_FN_ATTRS74#undef __DEFAULT_FN_ATTRS
85
86#endif75#endif
lib/include/avx512bwintrin.h+386-505
...@@ -19,153 +19,150 @@ typedef unsigned long long __mmask64;...@@ -19,153 +19,150 @@ typedef unsigned long long __mmask64;
1919
20/* Define the default attributes for the functions in this file. */20/* Define the default attributes for the functions in this file. */
21#define __DEFAULT_FN_ATTRS512 \21#define __DEFAULT_FN_ATTRS512 \
22 __attribute__((__always_inline__, __nodebug__, \22 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"), \
23 __target__("avx512bw,evex512"), __min_vector_width__(512)))23 __min_vector_width__(512)))
24#define __DEFAULT_FN_ATTRS \24#define __DEFAULT_FN_ATTRS \
25 __attribute__((__always_inline__, __nodebug__, \25 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw")))
26 __target__("avx512bw,no-evex512")))26
27#if defined(__cplusplus) && (__cplusplus >= 201103L)
28#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
29#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
30#else
31#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
32#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
33#endif
2734
28static __inline __mmask32 __DEFAULT_FN_ATTRS35static __inline __mmask32
29_knot_mask32(__mmask32 __M)36 __DEFAULT_FN_ATTRS_CONSTEXPR _knot_mask32(__mmask32 __M) {
30{
31 return __builtin_ia32_knotsi(__M);37 return __builtin_ia32_knotsi(__M);
32}38}
3339
34static __inline __mmask64 __DEFAULT_FN_ATTRS _knot_mask64(__mmask64 __M) {40static __inline __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
41_knot_mask64(__mmask64 __M) {
35 return __builtin_ia32_knotdi(__M);42 return __builtin_ia32_knotdi(__M);
36}43}
3744
38static __inline__ __mmask32 __DEFAULT_FN_ATTRS45static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
39_kand_mask32(__mmask32 __A, __mmask32 __B)46_kand_mask32(__mmask32 __A, __mmask32 __B) {
40{
41 return (__mmask32)__builtin_ia32_kandsi((__mmask32)__A, (__mmask32)__B);47 return (__mmask32)__builtin_ia32_kandsi((__mmask32)__A, (__mmask32)__B);
42}48}
4349
44static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kand_mask64(__mmask64 __A,50static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
45 __mmask64 __B) {51_kand_mask64(__mmask64 __A, __mmask64 __B) {
46 return (__mmask64)__builtin_ia32_kanddi((__mmask64)__A, (__mmask64)__B);52 return (__mmask64)__builtin_ia32_kanddi((__mmask64)__A, (__mmask64)__B);
47}53}
4854
49static __inline__ __mmask32 __DEFAULT_FN_ATTRS55static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
50_kandn_mask32(__mmask32 __A, __mmask32 __B)56_kandn_mask32(__mmask32 __A, __mmask32 __B) {
51{
52 return (__mmask32)__builtin_ia32_kandnsi((__mmask32)__A, (__mmask32)__B);57 return (__mmask32)__builtin_ia32_kandnsi((__mmask32)__A, (__mmask32)__B);
53}58}
5459
55static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kandn_mask64(__mmask64 __A,60static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
56 __mmask64 __B) {61_kandn_mask64(__mmask64 __A, __mmask64 __B) {
57 return (__mmask64)__builtin_ia32_kandndi((__mmask64)__A, (__mmask64)__B);62 return (__mmask64)__builtin_ia32_kandndi((__mmask64)__A, (__mmask64)__B);
58}63}
5964
60static __inline__ __mmask32 __DEFAULT_FN_ATTRS65static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
61_kor_mask32(__mmask32 __A, __mmask32 __B)66_kor_mask32(__mmask32 __A, __mmask32 __B) {
62{
63 return (__mmask32)__builtin_ia32_korsi((__mmask32)__A, (__mmask32)__B);67 return (__mmask32)__builtin_ia32_korsi((__mmask32)__A, (__mmask32)__B);
64}68}
6569
66static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kor_mask64(__mmask64 __A,70static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
67 __mmask64 __B) {71_kor_mask64(__mmask64 __A, __mmask64 __B) {
68 return (__mmask64)__builtin_ia32_kordi((__mmask64)__A, (__mmask64)__B);72 return (__mmask64)__builtin_ia32_kordi((__mmask64)__A, (__mmask64)__B);
69}73}
7074
71static __inline__ __mmask32 __DEFAULT_FN_ATTRS75static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
72_kxnor_mask32(__mmask32 __A, __mmask32 __B)76_kxnor_mask32(__mmask32 __A, __mmask32 __B) {
73{
74 return (__mmask32)__builtin_ia32_kxnorsi((__mmask32)__A, (__mmask32)__B);77 return (__mmask32)__builtin_ia32_kxnorsi((__mmask32)__A, (__mmask32)__B);
75}78}
7679
77static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kxnor_mask64(__mmask64 __A,80static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
78 __mmask64 __B) {81_kxnor_mask64(__mmask64 __A, __mmask64 __B) {
79 return (__mmask64)__builtin_ia32_kxnordi((__mmask64)__A, (__mmask64)__B);82 return (__mmask64)__builtin_ia32_kxnordi((__mmask64)__A, (__mmask64)__B);
80}83}
8184
82static __inline__ __mmask32 __DEFAULT_FN_ATTRS85static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
83_kxor_mask32(__mmask32 __A, __mmask32 __B)86_kxor_mask32(__mmask32 __A, __mmask32 __B) {
84{
85 return (__mmask32)__builtin_ia32_kxorsi((__mmask32)__A, (__mmask32)__B);87 return (__mmask32)__builtin_ia32_kxorsi((__mmask32)__A, (__mmask32)__B);
86}88}
8789
88static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kxor_mask64(__mmask64 __A,90static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
89 __mmask64 __B) {91_kxor_mask64(__mmask64 __A, __mmask64 __B) {
90 return (__mmask64)__builtin_ia32_kxordi((__mmask64)__A, (__mmask64)__B);92 return (__mmask64)__builtin_ia32_kxordi((__mmask64)__A, (__mmask64)__B);
91}93}
9294
93static __inline__ unsigned char __DEFAULT_FN_ATTRS95static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
94_kortestc_mask32_u8(__mmask32 __A, __mmask32 __B)96_kortestc_mask32_u8(__mmask32 __A, __mmask32 __B) {
95{
96 return (unsigned char)__builtin_ia32_kortestcsi(__A, __B);97 return (unsigned char)__builtin_ia32_kortestcsi(__A, __B);
97}98}
9899
99static __inline__ unsigned char __DEFAULT_FN_ATTRS100static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
100_kortestz_mask32_u8(__mmask32 __A, __mmask32 __B)101_kortestz_mask32_u8(__mmask32 __A, __mmask32 __B) {
101{
102 return (unsigned char)__builtin_ia32_kortestzsi(__A, __B);102 return (unsigned char)__builtin_ia32_kortestzsi(__A, __B);
103}103}
104104
105static __inline__ unsigned char __DEFAULT_FN_ATTRS105static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
106_kortest_mask32_u8(__mmask32 __A, __mmask32 __B, unsigned char *__C) {106_kortest_mask32_u8(__mmask32 __A, __mmask32 __B, unsigned char *__C) {
107 *__C = (unsigned char)__builtin_ia32_kortestcsi(__A, __B);107 *__C = (unsigned char)__builtin_ia32_kortestcsi(__A, __B);
108 return (unsigned char)__builtin_ia32_kortestzsi(__A, __B);108 return (unsigned char)__builtin_ia32_kortestzsi(__A, __B);
109}109}
110110
111static __inline__ unsigned char __DEFAULT_FN_ATTRS111static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
112_kortestc_mask64_u8(__mmask64 __A, __mmask64 __B) {112_kortestc_mask64_u8(__mmask64 __A, __mmask64 __B) {
113 return (unsigned char)__builtin_ia32_kortestcdi(__A, __B);113 return (unsigned char)__builtin_ia32_kortestcdi(__A, __B);
114}114}
115115
116static __inline__ unsigned char __DEFAULT_FN_ATTRS116static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
117_kortestz_mask64_u8(__mmask64 __A, __mmask64 __B) {117_kortestz_mask64_u8(__mmask64 __A, __mmask64 __B) {
118 return (unsigned char)__builtin_ia32_kortestzdi(__A, __B);118 return (unsigned char)__builtin_ia32_kortestzdi(__A, __B);
119}119}
120120
121static __inline__ unsigned char __DEFAULT_FN_ATTRS121static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
122_kortest_mask64_u8(__mmask64 __A, __mmask64 __B, unsigned char *__C) {122_kortest_mask64_u8(__mmask64 __A, __mmask64 __B, unsigned char *__C) {
123 *__C = (unsigned char)__builtin_ia32_kortestcdi(__A, __B);123 *__C = (unsigned char)__builtin_ia32_kortestcdi(__A, __B);
124 return (unsigned char)__builtin_ia32_kortestzdi(__A, __B);124 return (unsigned char)__builtin_ia32_kortestzdi(__A, __B);
125}125}
126126
127static __inline__ unsigned char __DEFAULT_FN_ATTRS127static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
128_ktestc_mask32_u8(__mmask32 __A, __mmask32 __B)128_ktestc_mask32_u8(__mmask32 __A, __mmask32 __B) {
129{
130 return (unsigned char)__builtin_ia32_ktestcsi(__A, __B);129 return (unsigned char)__builtin_ia32_ktestcsi(__A, __B);
131}130}
132131
133static __inline__ unsigned char __DEFAULT_FN_ATTRS132static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
134_ktestz_mask32_u8(__mmask32 __A, __mmask32 __B)133_ktestz_mask32_u8(__mmask32 __A, __mmask32 __B) {
135{
136 return (unsigned char)__builtin_ia32_ktestzsi(__A, __B);134 return (unsigned char)__builtin_ia32_ktestzsi(__A, __B);
137}135}
138136
139static __inline__ unsigned char __DEFAULT_FN_ATTRS137static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
140_ktest_mask32_u8(__mmask32 __A, __mmask32 __B, unsigned char *__C) {138_ktest_mask32_u8(__mmask32 __A, __mmask32 __B, unsigned char *__C) {
141 *__C = (unsigned char)__builtin_ia32_ktestcsi(__A, __B);139 *__C = (unsigned char)__builtin_ia32_ktestcsi(__A, __B);
142 return (unsigned char)__builtin_ia32_ktestzsi(__A, __B);140 return (unsigned char)__builtin_ia32_ktestzsi(__A, __B);
143}141}
144142
145static __inline__ unsigned char __DEFAULT_FN_ATTRS143static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
146_ktestc_mask64_u8(__mmask64 __A, __mmask64 __B) {144_ktestc_mask64_u8(__mmask64 __A, __mmask64 __B) {
147 return (unsigned char)__builtin_ia32_ktestcdi(__A, __B);145 return (unsigned char)__builtin_ia32_ktestcdi(__A, __B);
148}146}
149147
150static __inline__ unsigned char __DEFAULT_FN_ATTRS148static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
151_ktestz_mask64_u8(__mmask64 __A, __mmask64 __B) {149_ktestz_mask64_u8(__mmask64 __A, __mmask64 __B) {
152 return (unsigned char)__builtin_ia32_ktestzdi(__A, __B);150 return (unsigned char)__builtin_ia32_ktestzdi(__A, __B);
153}151}
154152
155static __inline__ unsigned char __DEFAULT_FN_ATTRS153static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
156_ktest_mask64_u8(__mmask64 __A, __mmask64 __B, unsigned char *__C) {154_ktest_mask64_u8(__mmask64 __A, __mmask64 __B, unsigned char *__C) {
157 *__C = (unsigned char)__builtin_ia32_ktestcdi(__A, __B);155 *__C = (unsigned char)__builtin_ia32_ktestcdi(__A, __B);
158 return (unsigned char)__builtin_ia32_ktestzdi(__A, __B);156 return (unsigned char)__builtin_ia32_ktestzdi(__A, __B);
159}157}
160158
161static __inline__ __mmask32 __DEFAULT_FN_ATTRS159static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
162_kadd_mask32(__mmask32 __A, __mmask32 __B)160_kadd_mask32(__mmask32 __A, __mmask32 __B) {
163{
164 return (__mmask32)__builtin_ia32_kaddsi((__mmask32)__A, (__mmask32)__B);161 return (__mmask32)__builtin_ia32_kaddsi((__mmask32)__A, (__mmask32)__B);
165}162}
166163
167static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kadd_mask64(__mmask64 __A,164static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
168 __mmask64 __B) {165_kadd_mask64(__mmask64 __A, __mmask64 __B) {
169 return (__mmask64)__builtin_ia32_kadddi((__mmask64)__A, (__mmask64)__B);166 return (__mmask64)__builtin_ia32_kadddi((__mmask64)__A, (__mmask64)__B);
170}167}
171168
...@@ -181,22 +178,22 @@ static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kadd_mask64(__mmask64 __A,...@@ -181,22 +178,22 @@ static __inline__ __mmask64 __DEFAULT_FN_ATTRS _kadd_mask64(__mmask64 __A,
181#define _kshiftri_mask64(A, I) \178#define _kshiftri_mask64(A, I) \
182 ((__mmask64)__builtin_ia32_kshiftridi((__mmask64)(A), (unsigned int)(I)))179 ((__mmask64)__builtin_ia32_kshiftridi((__mmask64)(A), (unsigned int)(I)))
183180
184static __inline__ unsigned int __DEFAULT_FN_ATTRS181static __inline__ unsigned int
185_cvtmask32_u32(__mmask32 __A) {182 __DEFAULT_FN_ATTRS_CONSTEXPR _cvtmask32_u32(__mmask32 __A) {
186 return (unsigned int)__builtin_ia32_kmovd((__mmask32)__A);183 return (unsigned int)__builtin_ia32_kmovd((__mmask32)__A);
187}184}
188185
189static __inline__ unsigned long long __DEFAULT_FN_ATTRS186static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
190_cvtmask64_u64(__mmask64 __A) {187_cvtmask64_u64(__mmask64 __A) {
191 return (unsigned long long)__builtin_ia32_kmovq((__mmask64)__A);188 return (unsigned long long)__builtin_ia32_kmovq((__mmask64)__A);
192}189}
193190
194static __inline__ __mmask32 __DEFAULT_FN_ATTRS191static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
195_cvtu32_mask32(unsigned int __A) {192_cvtu32_mask32(unsigned int __A) {
196 return (__mmask32)__builtin_ia32_kmovd((__mmask32)__A);193 return (__mmask32)__builtin_ia32_kmovd((__mmask32)__A);
197}194}
198195
199static __inline__ __mmask64 __DEFAULT_FN_ATTRS196static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
200_cvtu64_mask64(unsigned long long __A) {197_cvtu64_mask64(unsigned long long __A) {
201 return (__mmask64)__builtin_ia32_kmovq((__mmask64)__A);198 return (__mmask64)__builtin_ia32_kmovq((__mmask64)__A);
202}199}
...@@ -362,168 +359,159 @@ static __inline__ void __DEFAULT_FN_ATTRS _store_mask64(__mmask64 *__A,...@@ -362,168 +359,159 @@ static __inline__ void __DEFAULT_FN_ATTRS _store_mask64(__mmask64 *__A,
362#define _mm512_mask_cmpneq_epu16_mask(k, A, B) \359#define _mm512_mask_cmpneq_epu16_mask(k, A, B) \
363 _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE)360 _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE)
364361
365static __inline__ __m512i __DEFAULT_FN_ATTRS512362static __inline__ __m512i
366_mm512_add_epi8 (__m512i __A, __m512i __B) {363 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_add_epi8(__m512i __A, __m512i __B) {
367 return (__m512i) ((__v64qu) __A + (__v64qu) __B);364 return (__m512i) ((__v64qu) __A + (__v64qu) __B);
368}365}
369366
370static __inline__ __m512i __DEFAULT_FN_ATTRS512367static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
371_mm512_mask_add_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {368_mm512_mask_add_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
372 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,369 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
373 (__v64qi)_mm512_add_epi8(__A, __B),370 (__v64qi)_mm512_add_epi8(__A, __B),
374 (__v64qi)__W);371 (__v64qi)__W);
375}372}
376373
377static __inline__ __m512i __DEFAULT_FN_ATTRS512374static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
378_mm512_maskz_add_epi8(__mmask64 __U, __m512i __A, __m512i __B) {375_mm512_maskz_add_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
379 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,376 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
380 (__v64qi)_mm512_add_epi8(__A, __B),377 (__v64qi)_mm512_add_epi8(__A, __B),
381 (__v64qi)_mm512_setzero_si512());378 (__v64qi)_mm512_setzero_si512());
382}379}
383380
384static __inline__ __m512i __DEFAULT_FN_ATTRS512381static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
385_mm512_sub_epi8 (__m512i __A, __m512i __B) {382_mm512_sub_epi8(__m512i __A, __m512i __B) {
386 return (__m512i) ((__v64qu) __A - (__v64qu) __B);383 return (__m512i) ((__v64qu) __A - (__v64qu) __B);
387}384}
388385
389static __inline__ __m512i __DEFAULT_FN_ATTRS512386static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
390_mm512_mask_sub_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {387_mm512_mask_sub_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
391 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,388 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
392 (__v64qi)_mm512_sub_epi8(__A, __B),389 (__v64qi)_mm512_sub_epi8(__A, __B),
393 (__v64qi)__W);390 (__v64qi)__W);
394}391}
395392
396static __inline__ __m512i __DEFAULT_FN_ATTRS512393static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
397_mm512_maskz_sub_epi8(__mmask64 __U, __m512i __A, __m512i __B) {394_mm512_maskz_sub_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
398 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,395 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
399 (__v64qi)_mm512_sub_epi8(__A, __B),396 (__v64qi)_mm512_sub_epi8(__A, __B),
400 (__v64qi)_mm512_setzero_si512());397 (__v64qi)_mm512_setzero_si512());
401}398}
402399
403static __inline__ __m512i __DEFAULT_FN_ATTRS512400static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
404_mm512_add_epi16 (__m512i __A, __m512i __B) {401_mm512_add_epi16(__m512i __A, __m512i __B) {
405 return (__m512i) ((__v32hu) __A + (__v32hu) __B);402 return (__m512i) ((__v32hu) __A + (__v32hu) __B);
406}403}
407404
408static __inline__ __m512i __DEFAULT_FN_ATTRS512405static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
409_mm512_mask_add_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {406_mm512_mask_add_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
410 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,407 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
411 (__v32hi)_mm512_add_epi16(__A, __B),408 (__v32hi)_mm512_add_epi16(__A, __B),
412 (__v32hi)__W);409 (__v32hi)__W);
413}410}
414411
415static __inline__ __m512i __DEFAULT_FN_ATTRS512412static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
416_mm512_maskz_add_epi16(__mmask32 __U, __m512i __A, __m512i __B) {413_mm512_maskz_add_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
417 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,414 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
418 (__v32hi)_mm512_add_epi16(__A, __B),415 (__v32hi)_mm512_add_epi16(__A, __B),
419 (__v32hi)_mm512_setzero_si512());416 (__v32hi)_mm512_setzero_si512());
420}417}
421418
422static __inline__ __m512i __DEFAULT_FN_ATTRS512419static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
423_mm512_sub_epi16 (__m512i __A, __m512i __B) {420_mm512_sub_epi16(__m512i __A, __m512i __B) {
424 return (__m512i) ((__v32hu) __A - (__v32hu) __B);421 return (__m512i) ((__v32hu) __A - (__v32hu) __B);
425}422}
426423
427static __inline__ __m512i __DEFAULT_FN_ATTRS512424static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
428_mm512_mask_sub_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {425_mm512_mask_sub_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
429 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,426 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
430 (__v32hi)_mm512_sub_epi16(__A, __B),427 (__v32hi)_mm512_sub_epi16(__A, __B),
431 (__v32hi)__W);428 (__v32hi)__W);
432}429}
433430
434static __inline__ __m512i __DEFAULT_FN_ATTRS512431static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
435_mm512_maskz_sub_epi16(__mmask32 __U, __m512i __A, __m512i __B) {432_mm512_maskz_sub_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
436 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,433 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
437 (__v32hi)_mm512_sub_epi16(__A, __B),434 (__v32hi)_mm512_sub_epi16(__A, __B),
438 (__v32hi)_mm512_setzero_si512());435 (__v32hi)_mm512_setzero_si512());
439}436}
440437
441static __inline__ __m512i __DEFAULT_FN_ATTRS512438static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
442_mm512_mullo_epi16 (__m512i __A, __m512i __B) {439_mm512_mullo_epi16 (__m512i __A, __m512i __B) {
443 return (__m512i) ((__v32hu) __A * (__v32hu) __B);440 return (__m512i) ((__v32hu) __A * (__v32hu) __B);
444}441}
445442
446static __inline__ __m512i __DEFAULT_FN_ATTRS512443static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
447_mm512_mask_mullo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {444_mm512_mask_mullo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
448 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,445 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
449 (__v32hi)_mm512_mullo_epi16(__A, __B),446 (__v32hi)_mm512_mullo_epi16(__A, __B),
450 (__v32hi)__W);447 (__v32hi)__W);
451}448}
452449
453static __inline__ __m512i __DEFAULT_FN_ATTRS512450static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
454_mm512_maskz_mullo_epi16(__mmask32 __U, __m512i __A, __m512i __B) {451_mm512_maskz_mullo_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
455 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,452 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
456 (__v32hi)_mm512_mullo_epi16(__A, __B),453 (__v32hi)_mm512_mullo_epi16(__A, __B),
457 (__v32hi)_mm512_setzero_si512());454 (__v32hi)_mm512_setzero_si512());
458}455}
459456
460static __inline__ __m512i __DEFAULT_FN_ATTRS512457static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
461_mm512_mask_blend_epi8 (__mmask64 __U, __m512i __A, __m512i __W)458_mm512_mask_blend_epi8(__mmask64 __U, __m512i __A, __m512i __W) {
462{
463 return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U,459 return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U,
464 (__v64qi) __W,460 (__v64qi) __W,
465 (__v64qi) __A);461 (__v64qi) __A);
466}462}
467463
468static __inline__ __m512i __DEFAULT_FN_ATTRS512464static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
469_mm512_mask_blend_epi16 (__mmask32 __U, __m512i __A, __m512i __W)465_mm512_mask_blend_epi16(__mmask32 __U, __m512i __A, __m512i __W) {
470{
471 return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U,466 return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U,
472 (__v32hi) __W,467 (__v32hi) __W,
473 (__v32hi) __A);468 (__v32hi) __A);
474}469}
475470
476static __inline__ __m512i __DEFAULT_FN_ATTRS512471static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
477_mm512_abs_epi8 (__m512i __A)472_mm512_abs_epi8(__m512i __A) {
478{
479 return (__m512i)__builtin_elementwise_abs((__v64qs)__A);473 return (__m512i)__builtin_elementwise_abs((__v64qs)__A);
480}474}
481475
482static __inline__ __m512i __DEFAULT_FN_ATTRS512476static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
483_mm512_mask_abs_epi8 (__m512i __W, __mmask64 __U, __m512i __A)477_mm512_mask_abs_epi8(__m512i __W, __mmask64 __U, __m512i __A) {
484{
485 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,478 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
486 (__v64qi)_mm512_abs_epi8(__A),479 (__v64qi)_mm512_abs_epi8(__A),
487 (__v64qi)__W);480 (__v64qi)__W);
488}481}
489482
490static __inline__ __m512i __DEFAULT_FN_ATTRS512483static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
491_mm512_maskz_abs_epi8 (__mmask64 __U, __m512i __A)484_mm512_maskz_abs_epi8(__mmask64 __U, __m512i __A) {
492{
493 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,485 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
494 (__v64qi)_mm512_abs_epi8(__A),486 (__v64qi)_mm512_abs_epi8(__A),
495 (__v64qi)_mm512_setzero_si512());487 (__v64qi)_mm512_setzero_si512());
496}488}
497489
498static __inline__ __m512i __DEFAULT_FN_ATTRS512490static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
499_mm512_abs_epi16 (__m512i __A)491_mm512_abs_epi16(__m512i __A) {
500{
501 return (__m512i)__builtin_elementwise_abs((__v32hi)__A);492 return (__m512i)__builtin_elementwise_abs((__v32hi)__A);
502}493}
503494
504static __inline__ __m512i __DEFAULT_FN_ATTRS512495static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
505_mm512_mask_abs_epi16 (__m512i __W, __mmask32 __U, __m512i __A)496_mm512_mask_abs_epi16(__m512i __W, __mmask32 __U, __m512i __A) {
506{
507 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,497 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
508 (__v32hi)_mm512_abs_epi16(__A),498 (__v32hi)_mm512_abs_epi16(__A),
509 (__v32hi)__W);499 (__v32hi)__W);
510}500}
511501
512static __inline__ __m512i __DEFAULT_FN_ATTRS512502static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
513_mm512_maskz_abs_epi16 (__mmask32 __U, __m512i __A)503_mm512_maskz_abs_epi16(__mmask32 __U, __m512i __A) {
514{
515 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,504 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
516 (__v32hi)_mm512_abs_epi16(__A),505 (__v32hi)_mm512_abs_epi16(__A),
517 (__v32hi)_mm512_setzero_si512());506 (__v32hi)_mm512_setzero_si512());
518}507}
519508
520static __inline__ __m512i __DEFAULT_FN_ATTRS512509static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
521_mm512_packs_epi32(__m512i __A, __m512i __B)510_mm512_packs_epi32(__m512i __A, __m512i __B) {
522{
523 return (__m512i)__builtin_ia32_packssdw512((__v16si)__A, (__v16si)__B);511 return (__m512i)__builtin_ia32_packssdw512((__v16si)__A, (__v16si)__B);
524}512}
525513
526static __inline__ __m512i __DEFAULT_FN_ATTRS512514static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
527_mm512_maskz_packs_epi32(__mmask32 __M, __m512i __A, __m512i __B)515_mm512_maskz_packs_epi32(__mmask32 __M, __m512i __A, __m512i __B)
528{516{
529 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,517 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
...@@ -531,21 +519,19 @@ _mm512_maskz_packs_epi32(__mmask32 __M, __m512i __A, __m512i __B)...@@ -531,21 +519,19 @@ _mm512_maskz_packs_epi32(__mmask32 __M, __m512i __A, __m512i __B)
531 (__v32hi)_mm512_setzero_si512());519 (__v32hi)_mm512_setzero_si512());
532}520}
533521
534static __inline__ __m512i __DEFAULT_FN_ATTRS512522static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
535_mm512_mask_packs_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)523_mm512_mask_packs_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) {
536{
537 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,524 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
538 (__v32hi)_mm512_packs_epi32(__A, __B),525 (__v32hi)_mm512_packs_epi32(__A, __B),
539 (__v32hi)__W);526 (__v32hi)__W);
540}527}
541528
542static __inline__ __m512i __DEFAULT_FN_ATTRS512529static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
543_mm512_packs_epi16(__m512i __A, __m512i __B)530_mm512_packs_epi16(__m512i __A, __m512i __B) {
544{
545 return (__m512i)__builtin_ia32_packsswb512((__v32hi)__A, (__v32hi) __B);531 return (__m512i)__builtin_ia32_packsswb512((__v32hi)__A, (__v32hi) __B);
546}532}
547533
548static __inline__ __m512i __DEFAULT_FN_ATTRS512534static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
549_mm512_mask_packs_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)535_mm512_mask_packs_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)
550{536{
551 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,537 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
...@@ -553,7 +539,7 @@ _mm512_mask_packs_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)...@@ -553,7 +539,7 @@ _mm512_mask_packs_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)
553 (__v64qi)__W);539 (__v64qi)__W);
554}540}
555541
556static __inline__ __m512i __DEFAULT_FN_ATTRS512542static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
557_mm512_maskz_packs_epi16(__mmask64 __M, __m512i __A, __m512i __B)543_mm512_maskz_packs_epi16(__mmask64 __M, __m512i __A, __m512i __B)
558{544{
559 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,545 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
...@@ -561,13 +547,12 @@ _mm512_maskz_packs_epi16(__mmask64 __M, __m512i __A, __m512i __B)...@@ -561,13 +547,12 @@ _mm512_maskz_packs_epi16(__mmask64 __M, __m512i __A, __m512i __B)
561 (__v64qi)_mm512_setzero_si512());547 (__v64qi)_mm512_setzero_si512());
562}548}
563549
564static __inline__ __m512i __DEFAULT_FN_ATTRS512550static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
565_mm512_packus_epi32(__m512i __A, __m512i __B)551_mm512_packus_epi32(__m512i __A, __m512i __B) {
566{
567 return (__m512i)__builtin_ia32_packusdw512((__v16si) __A, (__v16si) __B);552 return (__m512i)__builtin_ia32_packusdw512((__v16si) __A, (__v16si) __B);
568}553}
569554
570static __inline__ __m512i __DEFAULT_FN_ATTRS512555static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
571_mm512_maskz_packus_epi32(__mmask32 __M, __m512i __A, __m512i __B)556_mm512_maskz_packus_epi32(__mmask32 __M, __m512i __A, __m512i __B)
572{557{
573 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,558 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
...@@ -575,7 +560,7 @@ _mm512_maskz_packus_epi32(__mmask32 __M, __m512i __A, __m512i __B)...@@ -575,7 +560,7 @@ _mm512_maskz_packus_epi32(__mmask32 __M, __m512i __A, __m512i __B)
575 (__v32hi)_mm512_setzero_si512());560 (__v32hi)_mm512_setzero_si512());
576}561}
577562
578static __inline__ __m512i __DEFAULT_FN_ATTRS512563static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
579_mm512_mask_packus_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)564_mm512_mask_packus_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)
580{565{
581 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,566 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
...@@ -583,13 +568,12 @@ _mm512_mask_packus_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)...@@ -583,13 +568,12 @@ _mm512_mask_packus_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)
583 (__v32hi)__W);568 (__v32hi)__W);
584}569}
585570
586static __inline__ __m512i __DEFAULT_FN_ATTRS512571static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
587_mm512_packus_epi16(__m512i __A, __m512i __B)572_mm512_packus_epi16(__m512i __A, __m512i __B) {
588{
589 return (__m512i)__builtin_ia32_packuswb512((__v32hi) __A, (__v32hi) __B);573 return (__m512i)__builtin_ia32_packuswb512((__v32hi) __A, (__v32hi) __B);
590}574}
591575
592static __inline__ __m512i __DEFAULT_FN_ATTRS512576static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
593_mm512_mask_packus_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)577_mm512_mask_packus_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)
594{578{
595 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,579 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
...@@ -597,7 +581,7 @@ _mm512_mask_packus_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)...@@ -597,7 +581,7 @@ _mm512_mask_packus_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)
597 (__v64qi)__W);581 (__v64qi)__W);
598}582}
599583
600static __inline__ __m512i __DEFAULT_FN_ATTRS512584static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
601_mm512_maskz_packus_epi16(__mmask64 __M, __m512i __A, __m512i __B)585_mm512_maskz_packus_epi16(__mmask64 __M, __m512i __A, __m512i __B)
602{586{
603 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,587 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
...@@ -605,35 +589,31 @@ _mm512_maskz_packus_epi16(__mmask64 __M, __m512i __A, __m512i __B)...@@ -605,35 +589,31 @@ _mm512_maskz_packus_epi16(__mmask64 __M, __m512i __A, __m512i __B)
605 (__v64qi)_mm512_setzero_si512());589 (__v64qi)_mm512_setzero_si512());
606}590}
607591
608static __inline__ __m512i __DEFAULT_FN_ATTRS512592static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
609_mm512_adds_epi8 (__m512i __A, __m512i __B)593_mm512_adds_epi8(__m512i __A, __m512i __B) {
610{
611 return (__m512i)__builtin_elementwise_add_sat((__v64qs)__A, (__v64qs)__B);594 return (__m512i)__builtin_elementwise_add_sat((__v64qs)__A, (__v64qs)__B);
612}595}
613596
614static __inline__ __m512i __DEFAULT_FN_ATTRS512597static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
615_mm512_mask_adds_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)598_mm512_mask_adds_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
616{
617 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,599 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
618 (__v64qi)_mm512_adds_epi8(__A, __B),600 (__v64qi)_mm512_adds_epi8(__A, __B),
619 (__v64qi)__W);601 (__v64qi)__W);
620}602}
621603
622static __inline__ __m512i __DEFAULT_FN_ATTRS512604static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
623_mm512_maskz_adds_epi8 (__mmask64 __U, __m512i __A, __m512i __B)605_mm512_maskz_adds_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
624{
625 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,606 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
626 (__v64qi)_mm512_adds_epi8(__A, __B),607 (__v64qi)_mm512_adds_epi8(__A, __B),
627 (__v64qi)_mm512_setzero_si512());608 (__v64qi)_mm512_setzero_si512());
628}609}
629610
630static __inline__ __m512i __DEFAULT_FN_ATTRS512611static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
631_mm512_adds_epi16 (__m512i __A, __m512i __B)612_mm512_adds_epi16(__m512i __A, __m512i __B) {
632{
633 return (__m512i)__builtin_elementwise_add_sat((__v32hi)__A, (__v32hi)__B);613 return (__m512i)__builtin_elementwise_add_sat((__v32hi)__A, (__v32hi)__B);
634}614}
635615
636static __inline__ __m512i __DEFAULT_FN_ATTRS512616static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
637_mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)617_mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
638{618{
639 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,619 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -641,7 +621,7 @@ _mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)...@@ -641,7 +621,7 @@ _mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
641 (__v32hi)__W);621 (__v32hi)__W);
642}622}
643623
644static __inline__ __m512i __DEFAULT_FN_ATTRS512624static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
645_mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B)625_mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
646{626{
647 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,627 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -649,13 +629,12 @@ _mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B)...@@ -649,13 +629,12 @@ _mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
649 (__v32hi)_mm512_setzero_si512());629 (__v32hi)_mm512_setzero_si512());
650}630}
651631
652static __inline__ __m512i __DEFAULT_FN_ATTRS512632static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
653_mm512_adds_epu8 (__m512i __A, __m512i __B)633_mm512_adds_epu8(__m512i __A, __m512i __B) {
654{
655 return (__m512i)__builtin_elementwise_add_sat((__v64qu) __A, (__v64qu) __B);634 return (__m512i)__builtin_elementwise_add_sat((__v64qu) __A, (__v64qu) __B);
656}635}
657636
658static __inline__ __m512i __DEFAULT_FN_ATTRS512637static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
659_mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)638_mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)
660{639{
661 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,640 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
...@@ -663,7 +642,7 @@ _mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)...@@ -663,7 +642,7 @@ _mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)
663 (__v64qi)__W);642 (__v64qi)__W);
664}643}
665644
666static __inline__ __m512i __DEFAULT_FN_ATTRS512645static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
667_mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B)646_mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
668{647{
669 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,648 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
...@@ -671,280 +650,238 @@ _mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B)...@@ -671,280 +650,238 @@ _mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
671 (__v64qi)_mm512_setzero_si512());650 (__v64qi)_mm512_setzero_si512());
672}651}
673652
674static __inline__ __m512i __DEFAULT_FN_ATTRS512653static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
675_mm512_adds_epu16 (__m512i __A, __m512i __B)654_mm512_adds_epu16(__m512i __A, __m512i __B) {
676{
677 return (__m512i)__builtin_elementwise_add_sat((__v32hu) __A, (__v32hu) __B);655 return (__m512i)__builtin_elementwise_add_sat((__v32hu) __A, (__v32hu) __B);
678}656}
679657
680static __inline__ __m512i __DEFAULT_FN_ATTRS512658static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
681_mm512_mask_adds_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)659_mm512_mask_adds_epu16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
682{
683 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,660 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
684 (__v32hi)_mm512_adds_epu16(__A, __B),661 (__v32hi)_mm512_adds_epu16(__A, __B),
685 (__v32hi)__W);662 (__v32hi)__W);
686}663}
687664
688static __inline__ __m512i __DEFAULT_FN_ATTRS512665static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
689_mm512_maskz_adds_epu16 (__mmask32 __U, __m512i __A, __m512i __B)666_mm512_maskz_adds_epu16(__mmask32 __U, __m512i __A, __m512i __B) {
690{
691 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,667 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
692 (__v32hi)_mm512_adds_epu16(__A, __B),668 (__v32hi)_mm512_adds_epu16(__A, __B),
693 (__v32hi)_mm512_setzero_si512());669 (__v32hi)_mm512_setzero_si512());
694}670}
695671
696static __inline__ __m512i __DEFAULT_FN_ATTRS512672static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
697_mm512_avg_epu8 (__m512i __A, __m512i __B)673_mm512_avg_epu8(__m512i __A, __m512i __B) {
698{674 return (__m512i)__builtin_ia32_pavgb512((__v64qu)__A, (__v64qu)__B);
699 return (__m512i)__builtin_ia32_pavgb512((__v64qi)__A, (__v64qi)__B);
700}675}
701676
702static __inline__ __m512i __DEFAULT_FN_ATTRS512677static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
703_mm512_mask_avg_epu8 (__m512i __W, __mmask64 __U, __m512i __A,678_mm512_mask_avg_epu8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
704 __m512i __B)679 return (__m512i)__builtin_ia32_selectb_512(
705{680 (__mmask64)__U, (__v64qi)_mm512_avg_epu8(__A, __B), (__v64qi)__W);
706 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
707 (__v64qi)_mm512_avg_epu8(__A, __B),
708 (__v64qi)__W);
709}681}
710682
711static __inline__ __m512i __DEFAULT_FN_ATTRS512683static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
712_mm512_maskz_avg_epu8 (__mmask64 __U, __m512i __A, __m512i __B)684_mm512_maskz_avg_epu8(__mmask64 __U, __m512i __A, __m512i __B) {
713{
714 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,685 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
715 (__v64qi)_mm512_avg_epu8(__A, __B),686 (__v64qi)_mm512_avg_epu8(__A, __B),
716 (__v64qi)_mm512_setzero_si512());687 (__v64qi)_mm512_setzero_si512());
717}688}
718689
719static __inline__ __m512i __DEFAULT_FN_ATTRS512690static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
720_mm512_avg_epu16 (__m512i __A, __m512i __B)691_mm512_avg_epu16(__m512i __A, __m512i __B) {
721{692 return (__m512i)__builtin_ia32_pavgw512((__v32hu)__A, (__v32hu)__B);
722 return (__m512i)__builtin_ia32_pavgw512((__v32hi)__A, (__v32hi)__B);
723}693}
724694
725static __inline__ __m512i __DEFAULT_FN_ATTRS512695static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
726_mm512_mask_avg_epu16 (__m512i __W, __mmask32 __U, __m512i __A,696_mm512_mask_avg_epu16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
727 __m512i __B)697 return (__m512i)__builtin_ia32_selectw_512(
728{698 (__mmask32)__U, (__v32hi)_mm512_avg_epu16(__A, __B), (__v32hi)__W);
729 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
730 (__v32hi)_mm512_avg_epu16(__A, __B),
731 (__v32hi)__W);
732}699}
733700
734static __inline__ __m512i __DEFAULT_FN_ATTRS512701static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
735_mm512_maskz_avg_epu16 (__mmask32 __U, __m512i __A, __m512i __B)702_mm512_maskz_avg_epu16(__mmask32 __U, __m512i __A, __m512i __B) {
736{703 return (__m512i)__builtin_ia32_selectw_512(
737 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,704 (__mmask32)__U, (__v32hi)_mm512_avg_epu16(__A, __B),
738 (__v32hi)_mm512_avg_epu16(__A, __B),705 (__v32hi)_mm512_setzero_si512());
739 (__v32hi) _mm512_setzero_si512());
740}706}
741707
742static __inline__ __m512i __DEFAULT_FN_ATTRS512708static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
743_mm512_max_epi8 (__m512i __A, __m512i __B)709_mm512_max_epi8(__m512i __A, __m512i __B) {
744{
745 return (__m512i)__builtin_elementwise_max((__v64qs) __A, (__v64qs) __B);710 return (__m512i)__builtin_elementwise_max((__v64qs) __A, (__v64qs) __B);
746}711}
747712
748static __inline__ __m512i __DEFAULT_FN_ATTRS512713static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
749_mm512_maskz_max_epi8 (__mmask64 __M, __m512i __A, __m512i __B)714_mm512_maskz_max_epi8(__mmask64 __M, __m512i __A, __m512i __B) {
750{
751 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,715 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
752 (__v64qi)_mm512_max_epi8(__A, __B),716 (__v64qi)_mm512_max_epi8(__A, __B),
753 (__v64qi)_mm512_setzero_si512());717 (__v64qi)_mm512_setzero_si512());
754}718}
755719
756static __inline__ __m512i __DEFAULT_FN_ATTRS512720static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
757_mm512_mask_max_epi8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)721_mm512_mask_max_epi8(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) {
758{
759 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,722 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
760 (__v64qi)_mm512_max_epi8(__A, __B),723 (__v64qi)_mm512_max_epi8(__A, __B),
761 (__v64qi)__W);724 (__v64qi)__W);
762}725}
763726
764static __inline__ __m512i __DEFAULT_FN_ATTRS512727static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
765_mm512_max_epi16 (__m512i __A, __m512i __B)728_mm512_max_epi16(__m512i __A, __m512i __B) {
766{
767 return (__m512i)__builtin_elementwise_max((__v32hi) __A, (__v32hi) __B);729 return (__m512i)__builtin_elementwise_max((__v32hi) __A, (__v32hi) __B);
768}730}
769731
770static __inline__ __m512i __DEFAULT_FN_ATTRS512732static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
771_mm512_maskz_max_epi16 (__mmask32 __M, __m512i __A, __m512i __B)733_mm512_maskz_max_epi16(__mmask32 __M, __m512i __A, __m512i __B) {
772{
773 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,734 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
774 (__v32hi)_mm512_max_epi16(__A, __B),735 (__v32hi)_mm512_max_epi16(__A, __B),
775 (__v32hi)_mm512_setzero_si512());736 (__v32hi)_mm512_setzero_si512());
776}737}
777738
778static __inline__ __m512i __DEFAULT_FN_ATTRS512739static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
779_mm512_mask_max_epi16 (__m512i __W, __mmask32 __M, __m512i __A,740_mm512_mask_max_epi16(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) {
780 __m512i __B)
781{
782 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,741 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
783 (__v32hi)_mm512_max_epi16(__A, __B),742 (__v32hi)_mm512_max_epi16(__A, __B),
784 (__v32hi)__W);743 (__v32hi)__W);
785}744}
786745
787static __inline__ __m512i __DEFAULT_FN_ATTRS512746static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
788_mm512_max_epu8 (__m512i __A, __m512i __B)747_mm512_max_epu8(__m512i __A, __m512i __B) {
789{
790 return (__m512i)__builtin_elementwise_max((__v64qu)__A, (__v64qu)__B);748 return (__m512i)__builtin_elementwise_max((__v64qu)__A, (__v64qu)__B);
791}749}
792750
793static __inline__ __m512i __DEFAULT_FN_ATTRS512751static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
794_mm512_maskz_max_epu8 (__mmask64 __M, __m512i __A, __m512i __B)752_mm512_maskz_max_epu8(__mmask64 __M, __m512i __A, __m512i __B) {
795{
796 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,753 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
797 (__v64qi)_mm512_max_epu8(__A, __B),754 (__v64qi)_mm512_max_epu8(__A, __B),
798 (__v64qi)_mm512_setzero_si512());755 (__v64qi)_mm512_setzero_si512());
799}756}
800757
801static __inline__ __m512i __DEFAULT_FN_ATTRS512758static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
802_mm512_mask_max_epu8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)759_mm512_mask_max_epu8(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) {
803{
804 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,760 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
805 (__v64qi)_mm512_max_epu8(__A, __B),761 (__v64qi)_mm512_max_epu8(__A, __B),
806 (__v64qi)__W);762 (__v64qi)__W);
807}763}
808764
809static __inline__ __m512i __DEFAULT_FN_ATTRS512765static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
810_mm512_max_epu16 (__m512i __A, __m512i __B)766_mm512_max_epu16(__m512i __A, __m512i __B) {
811{
812 return (__m512i)__builtin_elementwise_max((__v32hu)__A, (__v32hu)__B);767 return (__m512i)__builtin_elementwise_max((__v32hu)__A, (__v32hu)__B);
813}768}
814769
815static __inline__ __m512i __DEFAULT_FN_ATTRS512770static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
816_mm512_maskz_max_epu16 (__mmask32 __M, __m512i __A, __m512i __B)771_mm512_maskz_max_epu16(__mmask32 __M, __m512i __A, __m512i __B) {
817{
818 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,772 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
819 (__v32hi)_mm512_max_epu16(__A, __B),773 (__v32hi)_mm512_max_epu16(__A, __B),
820 (__v32hi)_mm512_setzero_si512());774 (__v32hi)_mm512_setzero_si512());
821}775}
822776
823static __inline__ __m512i __DEFAULT_FN_ATTRS512777static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
824_mm512_mask_max_epu16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)778_mm512_mask_max_epu16(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) {
825{
826 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,779 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
827 (__v32hi)_mm512_max_epu16(__A, __B),780 (__v32hi)_mm512_max_epu16(__A, __B),
828 (__v32hi)__W);781 (__v32hi)__W);
829}782}
830783
831static __inline__ __m512i __DEFAULT_FN_ATTRS512784static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
832_mm512_min_epi8 (__m512i __A, __m512i __B)785_mm512_min_epi8(__m512i __A, __m512i __B) {
833{
834 return (__m512i)__builtin_elementwise_min((__v64qs) __A, (__v64qs) __B);786 return (__m512i)__builtin_elementwise_min((__v64qs) __A, (__v64qs) __B);
835}787}
836788
837static __inline__ __m512i __DEFAULT_FN_ATTRS512789static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
838_mm512_maskz_min_epi8 (__mmask64 __M, __m512i __A, __m512i __B)790_mm512_maskz_min_epi8(__mmask64 __M, __m512i __A, __m512i __B) {
839{
840 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,791 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
841 (__v64qi)_mm512_min_epi8(__A, __B),792 (__v64qi)_mm512_min_epi8(__A, __B),
842 (__v64qi)_mm512_setzero_si512());793 (__v64qi)_mm512_setzero_si512());
843}794}
844795
845static __inline__ __m512i __DEFAULT_FN_ATTRS512796static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
846_mm512_mask_min_epi8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)797_mm512_mask_min_epi8(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) {
847{
848 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,798 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
849 (__v64qi)_mm512_min_epi8(__A, __B),799 (__v64qi)_mm512_min_epi8(__A, __B),
850 (__v64qi)__W);800 (__v64qi)__W);
851}801}
852802
853static __inline__ __m512i __DEFAULT_FN_ATTRS512803static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
854_mm512_min_epi16 (__m512i __A, __m512i __B)804_mm512_min_epi16(__m512i __A, __m512i __B) {
855{
856 return (__m512i)__builtin_elementwise_min((__v32hi) __A, (__v32hi) __B);805 return (__m512i)__builtin_elementwise_min((__v32hi) __A, (__v32hi) __B);
857}806}
858807
859static __inline__ __m512i __DEFAULT_FN_ATTRS512808static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
860_mm512_maskz_min_epi16 (__mmask32 __M, __m512i __A, __m512i __B)809_mm512_maskz_min_epi16(__mmask32 __M, __m512i __A, __m512i __B) {
861{
862 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,810 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
863 (__v32hi)_mm512_min_epi16(__A, __B),811 (__v32hi)_mm512_min_epi16(__A, __B),
864 (__v32hi)_mm512_setzero_si512());812 (__v32hi)_mm512_setzero_si512());
865}813}
866814
867static __inline__ __m512i __DEFAULT_FN_ATTRS512815static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
868_mm512_mask_min_epi16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)816_mm512_mask_min_epi16(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) {
869{
870 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,817 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
871 (__v32hi)_mm512_min_epi16(__A, __B),818 (__v32hi)_mm512_min_epi16(__A, __B),
872 (__v32hi)__W);819 (__v32hi)__W);
873}820}
874821
875static __inline__ __m512i __DEFAULT_FN_ATTRS512822static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
876_mm512_min_epu8 (__m512i __A, __m512i __B)823_mm512_min_epu8(__m512i __A, __m512i __B) {
877{
878 return (__m512i)__builtin_elementwise_min((__v64qu)__A, (__v64qu)__B);824 return (__m512i)__builtin_elementwise_min((__v64qu)__A, (__v64qu)__B);
879}825}
880826
881static __inline__ __m512i __DEFAULT_FN_ATTRS512827static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
882_mm512_maskz_min_epu8 (__mmask64 __M, __m512i __A, __m512i __B)828_mm512_maskz_min_epu8(__mmask64 __M, __m512i __A, __m512i __B) {
883{
884 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,829 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
885 (__v64qi)_mm512_min_epu8(__A, __B),830 (__v64qi)_mm512_min_epu8(__A, __B),
886 (__v64qi)_mm512_setzero_si512());831 (__v64qi)_mm512_setzero_si512());
887}832}
888833
889static __inline__ __m512i __DEFAULT_FN_ATTRS512834static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
890_mm512_mask_min_epu8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B)835_mm512_mask_min_epu8(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) {
891{
892 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,836 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
893 (__v64qi)_mm512_min_epu8(__A, __B),837 (__v64qi)_mm512_min_epu8(__A, __B),
894 (__v64qi)__W);838 (__v64qi)__W);
895}839}
896840
897static __inline__ __m512i __DEFAULT_FN_ATTRS512841static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
898_mm512_min_epu16 (__m512i __A, __m512i __B)842_mm512_min_epu16(__m512i __A, __m512i __B) {
899{
900 return (__m512i)__builtin_elementwise_min((__v32hu)__A, (__v32hu)__B);843 return (__m512i)__builtin_elementwise_min((__v32hu)__A, (__v32hu)__B);
901}844}
902845
903static __inline__ __m512i __DEFAULT_FN_ATTRS512846static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
904_mm512_maskz_min_epu16 (__mmask32 __M, __m512i __A, __m512i __B)847_mm512_maskz_min_epu16(__mmask32 __M, __m512i __A, __m512i __B) {
905{
906 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,848 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
907 (__v32hi)_mm512_min_epu16(__A, __B),849 (__v32hi)_mm512_min_epu16(__A, __B),
908 (__v32hi)_mm512_setzero_si512());850 (__v32hi)_mm512_setzero_si512());
909}851}
910852
911static __inline__ __m512i __DEFAULT_FN_ATTRS512853static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
912_mm512_mask_min_epu16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B)854_mm512_mask_min_epu16(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) {
913{
914 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,855 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
915 (__v32hi)_mm512_min_epu16(__A, __B),856 (__v32hi)_mm512_min_epu16(__A, __B),
916 (__v32hi)__W);857 (__v32hi)__W);
917}858}
918859
919static __inline__ __m512i __DEFAULT_FN_ATTRS512860static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
920_mm512_shuffle_epi8(__m512i __A, __m512i __B)861_mm512_shuffle_epi8(__m512i __A, __m512i __B) {
921{
922 return (__m512i)__builtin_ia32_pshufb512((__v64qi)__A,(__v64qi)__B);862 return (__m512i)__builtin_ia32_pshufb512((__v64qi)__A,(__v64qi)__B);
923}863}
924864
925static __inline__ __m512i __DEFAULT_FN_ATTRS512865static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
926_mm512_mask_shuffle_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)866_mm512_mask_shuffle_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
927{
928 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,867 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
929 (__v64qi)_mm512_shuffle_epi8(__A, __B),868 (__v64qi)_mm512_shuffle_epi8(__A, __B),
930 (__v64qi)__W);869 (__v64qi)__W);
931}870}
932871
933static __inline__ __m512i __DEFAULT_FN_ATTRS512872static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
934_mm512_maskz_shuffle_epi8(__mmask64 __U, __m512i __A, __m512i __B)873_mm512_maskz_shuffle_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
935{
936 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,874 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
937 (__v64qi)_mm512_shuffle_epi8(__A, __B),875 (__v64qi)_mm512_shuffle_epi8(__A, __B),
938 (__v64qi)_mm512_setzero_si512());876 (__v64qi)_mm512_setzero_si512());
939}877}
940878
941static __inline__ __m512i __DEFAULT_FN_ATTRS512879static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
942_mm512_subs_epi8 (__m512i __A, __m512i __B)880_mm512_subs_epi8(__m512i __A, __m512i __B) {
943{
944 return (__m512i)__builtin_elementwise_sub_sat((__v64qs)__A, (__v64qs)__B);881 return (__m512i)__builtin_elementwise_sub_sat((__v64qs)__A, (__v64qs)__B);
945}882}
946883
947static __inline__ __m512i __DEFAULT_FN_ATTRS512884static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
948_mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)885_mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)
949{886{
950 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,887 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
...@@ -952,7 +889,7 @@ _mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)...@@ -952,7 +889,7 @@ _mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)
952 (__v64qi)__W);889 (__v64qi)__W);
953}890}
954891
955static __inline__ __m512i __DEFAULT_FN_ATTRS512892static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
956_mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B)893_mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
957{894{
958 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,895 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
...@@ -960,13 +897,12 @@ _mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B)...@@ -960,13 +897,12 @@ _mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
960 (__v64qi)_mm512_setzero_si512());897 (__v64qi)_mm512_setzero_si512());
961}898}
962899
963static __inline__ __m512i __DEFAULT_FN_ATTRS512900static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
964_mm512_subs_epi16 (__m512i __A, __m512i __B)901_mm512_subs_epi16(__m512i __A, __m512i __B) {
965{
966 return (__m512i)__builtin_elementwise_sub_sat((__v32hi)__A, (__v32hi)__B);902 return (__m512i)__builtin_elementwise_sub_sat((__v32hi)__A, (__v32hi)__B);
967}903}
968904
969static __inline__ __m512i __DEFAULT_FN_ATTRS512905static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
970_mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)906_mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
971{907{
972 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,908 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -974,7 +910,7 @@ _mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)...@@ -974,7 +910,7 @@ _mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
974 (__v32hi)__W);910 (__v32hi)__W);
975}911}
976912
977static __inline__ __m512i __DEFAULT_FN_ATTRS512913static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
978_mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)914_mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
979{915{
980 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,916 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -982,13 +918,12 @@ _mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)...@@ -982,13 +918,12 @@ _mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
982 (__v32hi)_mm512_setzero_si512());918 (__v32hi)_mm512_setzero_si512());
983}919}
984920
985static __inline__ __m512i __DEFAULT_FN_ATTRS512921static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
986_mm512_subs_epu8 (__m512i __A, __m512i __B)922_mm512_subs_epu8(__m512i __A, __m512i __B) {
987{
988 return (__m512i)__builtin_elementwise_sub_sat((__v64qu) __A, (__v64qu) __B);923 return (__m512i)__builtin_elementwise_sub_sat((__v64qu) __A, (__v64qu) __B);
989}924}
990925
991static __inline__ __m512i __DEFAULT_FN_ATTRS512926static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
992_mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)927_mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)
993{928{
994 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,929 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
...@@ -996,7 +931,7 @@ _mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)...@@ -996,7 +931,7 @@ _mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B)
996 (__v64qi)__W);931 (__v64qi)__W);
997}932}
998933
999static __inline__ __m512i __DEFAULT_FN_ATTRS512934static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1000_mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B)935_mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
1001{936{
1002 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,937 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
...@@ -1004,13 +939,12 @@ _mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B)...@@ -1004,13 +939,12 @@ _mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
1004 (__v64qi)_mm512_setzero_si512());939 (__v64qi)_mm512_setzero_si512());
1005}940}
1006941
1007static __inline__ __m512i __DEFAULT_FN_ATTRS512942static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1008_mm512_subs_epu16 (__m512i __A, __m512i __B)943_mm512_subs_epu16(__m512i __A, __m512i __B) {
1009{
1010 return (__m512i)__builtin_elementwise_sub_sat((__v32hu) __A, (__v32hu) __B);944 return (__m512i)__builtin_elementwise_sub_sat((__v32hu) __A, (__v32hu) __B);
1011}945}
1012946
1013static __inline__ __m512i __DEFAULT_FN_ATTRS512947static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1014_mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)948_mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1015{949{
1016 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,950 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1018,7 +952,7 @@ _mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)...@@ -1018,7 +952,7 @@ _mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1018 (__v32hi)__W);952 (__v32hi)__W);
1019}953}
1020954
1021static __inline__ __m512i __DEFAULT_FN_ATTRS512955static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1022_mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B)956_mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
1023{957{
1024 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,958 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1026,113 +960,97 @@ _mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B)...@@ -1026,113 +960,97 @@ _mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
1026 (__v32hi)_mm512_setzero_si512());960 (__v32hi)_mm512_setzero_si512());
1027}961}
1028962
1029static __inline__ __m512i __DEFAULT_FN_ATTRS512963static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1030_mm512_permutex2var_epi16(__m512i __A, __m512i __I, __m512i __B)964_mm512_permutex2var_epi16(__m512i __A, __m512i __I, __m512i __B) {
1031{
1032 return (__m512i)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,965 return (__m512i)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,
1033 (__v32hi)__B);966 (__v32hi)__B);
1034}967}
1035968
1036static __inline__ __m512i __DEFAULT_FN_ATTRS512969static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1037_mm512_mask_permutex2var_epi16(__m512i __A, __mmask32 __U, __m512i __I,970_mm512_mask_permutex2var_epi16(__m512i __A, __mmask32 __U, __m512i __I,
1038 __m512i __B)971 __m512i __B) {
1039{
1040 return (__m512i)__builtin_ia32_selectw_512(__U,972 return (__m512i)__builtin_ia32_selectw_512(__U,
1041 (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),973 (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),
1042 (__v32hi)__A);974 (__v32hi)__A);
1043}975}
1044976
1045static __inline__ __m512i __DEFAULT_FN_ATTRS512977static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1046_mm512_mask2_permutex2var_epi16(__m512i __A, __m512i __I, __mmask32 __U,978_mm512_mask2_permutex2var_epi16(__m512i __A, __m512i __I, __mmask32 __U,
1047 __m512i __B)979 __m512i __B) {
1048{
1049 return (__m512i)__builtin_ia32_selectw_512(__U,980 return (__m512i)__builtin_ia32_selectw_512(__U,
1050 (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),981 (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),
1051 (__v32hi)__I);982 (__v32hi)__I);
1052}983}
1053984
1054static __inline__ __m512i __DEFAULT_FN_ATTRS512985static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1055_mm512_maskz_permutex2var_epi16(__mmask32 __U, __m512i __A, __m512i __I,986_mm512_maskz_permutex2var_epi16(__mmask32 __U, __m512i __A, __m512i __I,
1056 __m512i __B)987 __m512i __B) {
1057{
1058 return (__m512i)__builtin_ia32_selectw_512(__U,988 return (__m512i)__builtin_ia32_selectw_512(__U,
1059 (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),989 (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),
1060 (__v32hi)_mm512_setzero_si512());990 (__v32hi)_mm512_setzero_si512());
1061}991}
1062992
1063static __inline__ __m512i __DEFAULT_FN_ATTRS512993static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1064_mm512_mulhrs_epi16(__m512i __A, __m512i __B)994_mm512_mulhrs_epi16(__m512i __A, __m512i __B) {
1065{
1066 return (__m512i)__builtin_ia32_pmulhrsw512((__v32hi)__A, (__v32hi)__B);995 return (__m512i)__builtin_ia32_pmulhrsw512((__v32hi)__A, (__v32hi)__B);
1067}996}
1068997
1069static __inline__ __m512i __DEFAULT_FN_ATTRS512998static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1070_mm512_mask_mulhrs_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)999_mm512_mask_mulhrs_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
1071{
1072 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1000 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1073 (__v32hi)_mm512_mulhrs_epi16(__A, __B),1001 (__v32hi)_mm512_mulhrs_epi16(__A, __B),
1074 (__v32hi)__W);1002 (__v32hi)__W);
1075}1003}
10761004
1077static __inline__ __m512i __DEFAULT_FN_ATTRS5121005static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1078_mm512_maskz_mulhrs_epi16(__mmask32 __U, __m512i __A, __m512i __B)1006_mm512_maskz_mulhrs_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
1079{
1080 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1007 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1081 (__v32hi)_mm512_mulhrs_epi16(__A, __B),1008 (__v32hi)_mm512_mulhrs_epi16(__A, __B),
1082 (__v32hi)_mm512_setzero_si512());1009 (__v32hi)_mm512_setzero_si512());
1083}1010}
10841011
1085static __inline__ __m512i __DEFAULT_FN_ATTRS5121012static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1086_mm512_mulhi_epi16(__m512i __A, __m512i __B)1013_mm512_mulhi_epi16(__m512i __A, __m512i __B) {
1087{1014 return (__m512i)__builtin_ia32_pmulhw512((__v32hi)__A, (__v32hi)__B);
1088 return (__m512i)__builtin_ia32_pmulhw512((__v32hi) __A, (__v32hi) __B);
1089}1015}
10901016
1091static __inline__ __m512i __DEFAULT_FN_ATTRS5121017static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1092_mm512_mask_mulhi_epi16(__m512i __W, __mmask32 __U, __m512i __A,1018_mm512_mask_mulhi_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
1093 __m512i __B)1019 return (__m512i)__builtin_ia32_selectw_512(
1094{1020 (__mmask32)__U, (__v32hi)_mm512_mulhi_epi16(__A, __B), (__v32hi)__W);
1095 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1096 (__v32hi)_mm512_mulhi_epi16(__A, __B),
1097 (__v32hi)__W);
1098}1021}
10991022
1100static __inline__ __m512i __DEFAULT_FN_ATTRS5121023static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1101_mm512_maskz_mulhi_epi16(__mmask32 __U, __m512i __A, __m512i __B)1024_mm512_maskz_mulhi_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
1102{1025 return (__m512i)__builtin_ia32_selectw_512(
1103 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1026 (__mmask32)__U, (__v32hi)_mm512_mulhi_epi16(__A, __B),
1104 (__v32hi)_mm512_mulhi_epi16(__A, __B),1027 (__v32hi)_mm512_setzero_si512());
1105 (__v32hi)_mm512_setzero_si512());
1106}1028}
11071029
1108static __inline__ __m512i __DEFAULT_FN_ATTRS5121030static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1109_mm512_mulhi_epu16(__m512i __A, __m512i __B)1031_mm512_mulhi_epu16(__m512i __A, __m512i __B) {
1110{1032 return (__m512i)__builtin_ia32_pmulhuw512((__v32hu)__A, (__v32hu)__B);
1111 return (__m512i)__builtin_ia32_pmulhuw512((__v32hi) __A, (__v32hi) __B);
1112}1033}
11131034
1114static __inline__ __m512i __DEFAULT_FN_ATTRS5121035static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1115_mm512_mask_mulhi_epu16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)1036_mm512_mask_mulhi_epu16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
1116{1037 return (__m512i)__builtin_ia32_selectw_512(
1117 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1038 (__mmask32)__U, (__v32hi)_mm512_mulhi_epu16(__A, __B), (__v32hi)__W);
1118 (__v32hi)_mm512_mulhi_epu16(__A, __B),
1119 (__v32hi)__W);
1120}1039}
11211040
1122static __inline__ __m512i __DEFAULT_FN_ATTRS5121041static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1123_mm512_maskz_mulhi_epu16 (__mmask32 __U, __m512i __A, __m512i __B)1042_mm512_maskz_mulhi_epu16(__mmask32 __U, __m512i __A, __m512i __B) {
1124{1043 return (__m512i)__builtin_ia32_selectw_512(
1125 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1044 (__mmask32)__U, (__v32hi)_mm512_mulhi_epu16(__A, __B),
1126 (__v32hi)_mm512_mulhi_epu16(__A, __B),1045 (__v32hi)_mm512_setzero_si512());
1127 (__v32hi)_mm512_setzero_si512());
1128}1046}
11291047
1130static __inline__ __m512i __DEFAULT_FN_ATTRS5121048static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1131_mm512_maddubs_epi16(__m512i __X, __m512i __Y) {1049_mm512_maddubs_epi16(__m512i __X, __m512i __Y) {
1132 return (__m512i)__builtin_ia32_pmaddubsw512((__v64qi)__X, (__v64qi)__Y);1050 return (__m512i)__builtin_ia32_pmaddubsw512((__v64qi)__X, (__v64qi)__Y);
1133}1051}
11341052
1135static __inline__ __m512i __DEFAULT_FN_ATTRS5121053static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1136_mm512_mask_maddubs_epi16(__m512i __W, __mmask32 __U, __m512i __X,1054_mm512_mask_maddubs_epi16(__m512i __W, __mmask32 __U, __m512i __X,
1137 __m512i __Y) {1055 __m512i __Y) {
1138 return (__m512i)__builtin_ia32_selectw_512((__mmask32) __U,1056 return (__m512i)__builtin_ia32_selectw_512((__mmask32) __U,
...@@ -1140,26 +1058,26 @@ _mm512_mask_maddubs_epi16(__m512i __W, __mmask32 __U, __m512i __X,...@@ -1140,26 +1058,26 @@ _mm512_mask_maddubs_epi16(__m512i __W, __mmask32 __U, __m512i __X,
1140 (__v32hi)__W);1058 (__v32hi)__W);
1141}1059}
11421060
1143static __inline__ __m512i __DEFAULT_FN_ATTRS5121061static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1144_mm512_maskz_maddubs_epi16(__mmask32 __U, __m512i __X, __m512i __Y) {1062_mm512_maskz_maddubs_epi16(__mmask32 __U, __m512i __X, __m512i __Y) {
1145 return (__m512i)__builtin_ia32_selectw_512((__mmask32) __U,1063 return (__m512i)__builtin_ia32_selectw_512((__mmask32) __U,
1146 (__v32hi)_mm512_maddubs_epi16(__X, __Y),1064 (__v32hi)_mm512_maddubs_epi16(__X, __Y),
1147 (__v32hi)_mm512_setzero_si512());1065 (__v32hi)_mm512_setzero_si512());
1148}1066}
11491067
1150static __inline__ __m512i __DEFAULT_FN_ATTRS5121068static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1151_mm512_madd_epi16(__m512i __A, __m512i __B) {1069_mm512_madd_epi16(__m512i __A, __m512i __B) {
1152 return (__m512i)__builtin_ia32_pmaddwd512((__v32hi)__A, (__v32hi)__B);1070 return (__m512i)__builtin_ia32_pmaddwd512((__v32hi)__A, (__v32hi)__B);
1153}1071}
11541072
1155static __inline__ __m512i __DEFAULT_FN_ATTRS5121073static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1156_mm512_mask_madd_epi16(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) {1074_mm512_mask_madd_epi16(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) {
1157 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,1075 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
1158 (__v16si)_mm512_madd_epi16(__A, __B),1076 (__v16si)_mm512_madd_epi16(__A, __B),
1159 (__v16si)__W);1077 (__v16si)__W);
1160}1078}
11611079
1162static __inline__ __m512i __DEFAULT_FN_ATTRS5121080static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1163_mm512_maskz_madd_epi16(__mmask16 __U, __m512i __A, __m512i __B) {1081_mm512_maskz_madd_epi16(__mmask16 __U, __m512i __A, __m512i __B) {
1164 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,1082 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
1165 (__v16si)_mm512_madd_epi16(__A, __B),1083 (__v16si)_mm512_madd_epi16(__A, __B),
...@@ -1247,7 +1165,7 @@ _mm512_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A)...@@ -1247,7 +1165,7 @@ _mm512_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A)
1247 __builtin_ia32_pmovuswb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M);1165 __builtin_ia32_pmovuswb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M);
1248}1166}
12491167
1250static __inline__ __m512i __DEFAULT_FN_ATTRS5121168static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1251_mm512_unpackhi_epi8(__m512i __A, __m512i __B) {1169_mm512_unpackhi_epi8(__m512i __A, __m512i __B) {
1252 return (__m512i)__builtin_shufflevector((__v64qi)__A, (__v64qi)__B,1170 return (__m512i)__builtin_shufflevector((__v64qi)__A, (__v64qi)__B,
1253 8, 64+8, 9, 64+9,1171 8, 64+8, 9, 64+9,
...@@ -1268,21 +1186,21 @@ _mm512_unpackhi_epi8(__m512i __A, __m512i __B) {...@@ -1268,21 +1186,21 @@ _mm512_unpackhi_epi8(__m512i __A, __m512i __B) {
1268 62, 64+62, 63, 64+63);1186 62, 64+62, 63, 64+63);
1269}1187}
12701188
1271static __inline__ __m512i __DEFAULT_FN_ATTRS5121189static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1272_mm512_mask_unpackhi_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {1190_mm512_mask_unpackhi_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
1273 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,1191 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
1274 (__v64qi)_mm512_unpackhi_epi8(__A, __B),1192 (__v64qi)_mm512_unpackhi_epi8(__A, __B),
1275 (__v64qi)__W);1193 (__v64qi)__W);
1276}1194}
12771195
1278static __inline__ __m512i __DEFAULT_FN_ATTRS5121196static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1279_mm512_maskz_unpackhi_epi8(__mmask64 __U, __m512i __A, __m512i __B) {1197_mm512_maskz_unpackhi_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
1280 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,1198 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
1281 (__v64qi)_mm512_unpackhi_epi8(__A, __B),1199 (__v64qi)_mm512_unpackhi_epi8(__A, __B),
1282 (__v64qi)_mm512_setzero_si512());1200 (__v64qi)_mm512_setzero_si512());
1283}1201}
12841202
1285static __inline__ __m512i __DEFAULT_FN_ATTRS5121203static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1286_mm512_unpackhi_epi16(__m512i __A, __m512i __B) {1204_mm512_unpackhi_epi16(__m512i __A, __m512i __B) {
1287 return (__m512i)__builtin_shufflevector((__v32hi)__A, (__v32hi)__B,1205 return (__m512i)__builtin_shufflevector((__v32hi)__A, (__v32hi)__B,
1288 4, 32+4, 5, 32+5,1206 4, 32+4, 5, 32+5,
...@@ -1295,21 +1213,21 @@ _mm512_unpackhi_epi16(__m512i __A, __m512i __B) {...@@ -1295,21 +1213,21 @@ _mm512_unpackhi_epi16(__m512i __A, __m512i __B) {
1295 30, 32+30, 31, 32+31);1213 30, 32+30, 31, 32+31);
1296}1214}
12971215
1298static __inline__ __m512i __DEFAULT_FN_ATTRS5121216static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1299_mm512_mask_unpackhi_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {1217_mm512_mask_unpackhi_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
1300 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1218 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1301 (__v32hi)_mm512_unpackhi_epi16(__A, __B),1219 (__v32hi)_mm512_unpackhi_epi16(__A, __B),
1302 (__v32hi)__W);1220 (__v32hi)__W);
1303}1221}
13041222
1305static __inline__ __m512i __DEFAULT_FN_ATTRS5121223static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1306_mm512_maskz_unpackhi_epi16(__mmask32 __U, __m512i __A, __m512i __B) {1224_mm512_maskz_unpackhi_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
1307 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1225 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1308 (__v32hi)_mm512_unpackhi_epi16(__A, __B),1226 (__v32hi)_mm512_unpackhi_epi16(__A, __B),
1309 (__v32hi)_mm512_setzero_si512());1227 (__v32hi)_mm512_setzero_si512());
1310}1228}
13111229
1312static __inline__ __m512i __DEFAULT_FN_ATTRS5121230static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1313_mm512_unpacklo_epi8(__m512i __A, __m512i __B) {1231_mm512_unpacklo_epi8(__m512i __A, __m512i __B) {
1314 return (__m512i)__builtin_shufflevector((__v64qi)__A, (__v64qi)__B,1232 return (__m512i)__builtin_shufflevector((__v64qi)__A, (__v64qi)__B,
1315 0, 64+0, 1, 64+1,1233 0, 64+0, 1, 64+1,
...@@ -1330,21 +1248,21 @@ _mm512_unpacklo_epi8(__m512i __A, __m512i __B) {...@@ -1330,21 +1248,21 @@ _mm512_unpacklo_epi8(__m512i __A, __m512i __B) {
1330 54, 64+54, 55, 64+55);1248 54, 64+54, 55, 64+55);
1331}1249}
13321250
1333static __inline__ __m512i __DEFAULT_FN_ATTRS5121251static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1334_mm512_mask_unpacklo_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {1252_mm512_mask_unpacklo_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {
1335 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,1253 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
1336 (__v64qi)_mm512_unpacklo_epi8(__A, __B),1254 (__v64qi)_mm512_unpacklo_epi8(__A, __B),
1337 (__v64qi)__W);1255 (__v64qi)__W);
1338}1256}
13391257
1340static __inline__ __m512i __DEFAULT_FN_ATTRS5121258static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1341_mm512_maskz_unpacklo_epi8(__mmask64 __U, __m512i __A, __m512i __B) {1259_mm512_maskz_unpacklo_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
1342 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,1260 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
1343 (__v64qi)_mm512_unpacklo_epi8(__A, __B),1261 (__v64qi)_mm512_unpacklo_epi8(__A, __B),
1344 (__v64qi)_mm512_setzero_si512());1262 (__v64qi)_mm512_setzero_si512());
1345}1263}
13461264
1347static __inline__ __m512i __DEFAULT_FN_ATTRS5121265static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1348_mm512_unpacklo_epi16(__m512i __A, __m512i __B) {1266_mm512_unpacklo_epi16(__m512i __A, __m512i __B) {
1349 return (__m512i)__builtin_shufflevector((__v32hi)__A, (__v32hi)__B,1267 return (__m512i)__builtin_shufflevector((__v32hi)__A, (__v32hi)__B,
1350 0, 32+0, 1, 32+1,1268 0, 32+0, 1, 32+1,
...@@ -1357,67 +1275,60 @@ _mm512_unpacklo_epi16(__m512i __A, __m512i __B) {...@@ -1357,67 +1275,60 @@ _mm512_unpacklo_epi16(__m512i __A, __m512i __B) {
1357 26, 32+26, 27, 32+27);1275 26, 32+26, 27, 32+27);
1358}1276}
13591277
1360static __inline__ __m512i __DEFAULT_FN_ATTRS5121278static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1361_mm512_mask_unpacklo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {1279_mm512_mask_unpacklo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
1362 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1280 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1363 (__v32hi)_mm512_unpacklo_epi16(__A, __B),1281 (__v32hi)_mm512_unpacklo_epi16(__A, __B),
1364 (__v32hi)__W);1282 (__v32hi)__W);
1365}1283}
13661284
1367static __inline__ __m512i __DEFAULT_FN_ATTRS5121285static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1368_mm512_maskz_unpacklo_epi16(__mmask32 __U, __m512i __A, __m512i __B) {1286_mm512_maskz_unpacklo_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
1369 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1287 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1370 (__v32hi)_mm512_unpacklo_epi16(__A, __B),1288 (__v32hi)_mm512_unpacklo_epi16(__A, __B),
1371 (__v32hi)_mm512_setzero_si512());1289 (__v32hi)_mm512_setzero_si512());
1372}1290}
13731291
1374static __inline__ __m512i __DEFAULT_FN_ATTRS5121292static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1375_mm512_cvtepi8_epi16(__m256i __A)1293_mm512_cvtepi8_epi16(__m256i __A) {
1376{
1377 /* This function always performs a signed extension, but __v32qi is a char1294 /* This function always performs a signed extension, but __v32qi is a char
1378 which may be signed or unsigned, so use __v32qs. */1295 which may be signed or unsigned, so use __v32qs. */
1379 return (__m512i)__builtin_convertvector((__v32qs)__A, __v32hi);1296 return (__m512i)__builtin_convertvector((__v32qs)__A, __v32hi);
1380}1297}
13811298
1382static __inline__ __m512i __DEFAULT_FN_ATTRS5121299static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1383_mm512_mask_cvtepi8_epi16(__m512i __W, __mmask32 __U, __m256i __A)1300_mm512_mask_cvtepi8_epi16(__m512i __W, __mmask32 __U, __m256i __A) {
1384{
1385 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1301 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1386 (__v32hi)_mm512_cvtepi8_epi16(__A),1302 (__v32hi)_mm512_cvtepi8_epi16(__A),
1387 (__v32hi)__W);1303 (__v32hi)__W);
1388}1304}
13891305
1390static __inline__ __m512i __DEFAULT_FN_ATTRS5121306static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1391_mm512_maskz_cvtepi8_epi16(__mmask32 __U, __m256i __A)1307_mm512_maskz_cvtepi8_epi16(__mmask32 __U, __m256i __A) {
1392{
1393 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1308 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1394 (__v32hi)_mm512_cvtepi8_epi16(__A),1309 (__v32hi)_mm512_cvtepi8_epi16(__A),
1395 (__v32hi)_mm512_setzero_si512());1310 (__v32hi)_mm512_setzero_si512());
1396}1311}
13971312
1398static __inline__ __m512i __DEFAULT_FN_ATTRS5121313static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1399_mm512_cvtepu8_epi16(__m256i __A)1314_mm512_cvtepu8_epi16(__m256i __A) {
1400{
1401 return (__m512i)__builtin_convertvector((__v32qu)__A, __v32hi);1315 return (__m512i)__builtin_convertvector((__v32qu)__A, __v32hi);
1402}1316}
14031317
1404static __inline__ __m512i __DEFAULT_FN_ATTRS5121318static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1405_mm512_mask_cvtepu8_epi16(__m512i __W, __mmask32 __U, __m256i __A)1319_mm512_mask_cvtepu8_epi16(__m512i __W, __mmask32 __U, __m256i __A) {
1406{
1407 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1320 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1408 (__v32hi)_mm512_cvtepu8_epi16(__A),1321 (__v32hi)_mm512_cvtepu8_epi16(__A),
1409 (__v32hi)__W);1322 (__v32hi)__W);
1410}1323}
14111324
1412static __inline__ __m512i __DEFAULT_FN_ATTRS5121325static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1413_mm512_maskz_cvtepu8_epi16(__mmask32 __U, __m256i __A)1326_mm512_maskz_cvtepu8_epi16(__mmask32 __U, __m256i __A) {
1414{
1415 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1327 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1416 (__v32hi)_mm512_cvtepu8_epi16(__A),1328 (__v32hi)_mm512_cvtepu8_epi16(__A),
1417 (__v32hi)_mm512_setzero_si512());1329 (__v32hi)_mm512_setzero_si512());
1418}1330}
14191331
1420
1421#define _mm512_shufflehi_epi16(A, imm) \1332#define _mm512_shufflehi_epi16(A, imm) \
1422 ((__m512i)__builtin_ia32_pshufhw512((__v32hi)(__m512i)(A), (int)(imm)))1333 ((__m512i)__builtin_ia32_pshufhw512((__v32hi)(__m512i)(A), (int)(imm)))
14231334
...@@ -1450,13 +1361,13 @@ _mm512_maskz_cvtepu8_epi16(__mmask32 __U, __m256i __A)...@@ -1450,13 +1361,13 @@ _mm512_maskz_cvtepu8_epi16(__mmask32 __U, __m256i __A)
1450 (imm)), \1361 (imm)), \
1451 (__v32hi)_mm512_setzero_si512()))1362 (__v32hi)_mm512_setzero_si512()))
14521363
1453static __inline__ __m512i __DEFAULT_FN_ATTRS5121364static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1454_mm512_sllv_epi16(__m512i __A, __m512i __B)1365_mm512_sllv_epi16(__m512i __A, __m512i __B)
1455{1366{
1456 return (__m512i)__builtin_ia32_psllv32hi((__v32hi) __A, (__v32hi) __B);1367 return (__m512i)__builtin_ia32_psllv32hi((__v32hi) __A, (__v32hi) __B);
1457}1368}
14581369
1459static __inline__ __m512i __DEFAULT_FN_ATTRS5121370static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1460_mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)1371_mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1461{1372{
1462 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1373 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1464,7 +1375,7 @@ _mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)...@@ -1464,7 +1375,7 @@ _mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1464 (__v32hi)__W);1375 (__v32hi)__W);
1465}1376}
14661377
1467static __inline__ __m512i __DEFAULT_FN_ATTRS5121378static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1468_mm512_maskz_sllv_epi16(__mmask32 __U, __m512i __A, __m512i __B)1379_mm512_maskz_sllv_epi16(__mmask32 __U, __m512i __A, __m512i __B)
1469{1380{
1470 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1381 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1472,61 +1383,56 @@ _mm512_maskz_sllv_epi16(__mmask32 __U, __m512i __A, __m512i __B)...@@ -1472,61 +1383,56 @@ _mm512_maskz_sllv_epi16(__mmask32 __U, __m512i __A, __m512i __B)
1472 (__v32hi)_mm512_setzero_si512());1383 (__v32hi)_mm512_setzero_si512());
1473}1384}
14741385
1475static __inline__ __m512i __DEFAULT_FN_ATTRS5121386static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1476_mm512_sll_epi16(__m512i __A, __m128i __B)1387_mm512_sll_epi16(__m512i __A, __m128i __B) {
1477{
1478 return (__m512i)__builtin_ia32_psllw512((__v32hi) __A, (__v8hi) __B);1388 return (__m512i)__builtin_ia32_psllw512((__v32hi) __A, (__v8hi) __B);
1479}1389}
14801390
1481static __inline__ __m512i __DEFAULT_FN_ATTRS5121391static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1482_mm512_mask_sll_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B)1392_mm512_mask_sll_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B) {
1483{
1484 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1393 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1485 (__v32hi)_mm512_sll_epi16(__A, __B),1394 (__v32hi)_mm512_sll_epi16(__A, __B),
1486 (__v32hi)__W);1395 (__v32hi)__W);
1487}1396}
14881397
1489static __inline__ __m512i __DEFAULT_FN_ATTRS5121398static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1490_mm512_maskz_sll_epi16(__mmask32 __U, __m512i __A, __m128i __B)1399_mm512_maskz_sll_epi16(__mmask32 __U, __m512i __A, __m128i __B) {
1491{
1492 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1400 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1493 (__v32hi)_mm512_sll_epi16(__A, __B),1401 (__v32hi)_mm512_sll_epi16(__A, __B),
1494 (__v32hi)_mm512_setzero_si512());1402 (__v32hi)_mm512_setzero_si512());
1495}1403}
14961404
1497static __inline__ __m512i __DEFAULT_FN_ATTRS5121405static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1498_mm512_slli_epi16(__m512i __A, unsigned int __B)1406_mm512_slli_epi16(__m512i __A, unsigned int __B) {
1499{
1500 return (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, (int)__B);1407 return (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, (int)__B);
1501}1408}
15021409
1503static __inline__ __m512i __DEFAULT_FN_ATTRS5121410static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1504_mm512_mask_slli_epi16(__m512i __W, __mmask32 __U, __m512i __A,1411_mm512_mask_slli_epi16(__m512i __W, __mmask32 __U, __m512i __A,
1505 unsigned int __B)1412 unsigned int __B) {
1506{
1507 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1413 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1508 (__v32hi)_mm512_slli_epi16(__A, __B),1414 (__v32hi)_mm512_slli_epi16(__A, __B),
1509 (__v32hi)__W);1415 (__v32hi)__W);
1510}1416}
15111417
1512static __inline__ __m512i __DEFAULT_FN_ATTRS5121418static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1513_mm512_maskz_slli_epi16(__mmask32 __U, __m512i __A, unsigned int __B)1419_mm512_maskz_slli_epi16(__mmask32 __U, __m512i __A, unsigned int __B) {
1514{
1515 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1420 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1516 (__v32hi)_mm512_slli_epi16(__A, __B),1421 (__v32hi)_mm512_slli_epi16(__A, __B),
1517 (__v32hi)_mm512_setzero_si512());1422 (__v32hi)_mm512_setzero_si512());
1518}1423}
15191424
1520#define _mm512_bslli_epi128(a, imm) \1425#define _mm512_bslli_epi128(a, imm) \
1521 ((__m512i)__builtin_ia32_pslldqi512_byteshift((__v8di)(__m512i)(a), (int)(imm)))1426 ((__m512i)__builtin_ia32_pslldqi512_byteshift((__v64qi)(__m512i)(a), \
1427 (int)(imm)))
15221428
1523static __inline__ __m512i __DEFAULT_FN_ATTRS5121429static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1524_mm512_srlv_epi16(__m512i __A, __m512i __B)1430_mm512_srlv_epi16(__m512i __A, __m512i __B)
1525{1431{
1526 return (__m512i)__builtin_ia32_psrlv32hi((__v32hi)__A, (__v32hi)__B);1432 return (__m512i)__builtin_ia32_psrlv32hi((__v32hi)__A, (__v32hi)__B);
1527}1433}
15281434
1529static __inline__ __m512i __DEFAULT_FN_ATTRS5121435static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1530_mm512_mask_srlv_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)1436_mm512_mask_srlv_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1531{1437{
1532 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1438 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1534,7 +1440,7 @@ _mm512_mask_srlv_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)...@@ -1534,7 +1440,7 @@ _mm512_mask_srlv_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1534 (__v32hi)__W);1440 (__v32hi)__W);
1535}1441}
15361442
1537static __inline__ __m512i __DEFAULT_FN_ATTRS5121443static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1538_mm512_maskz_srlv_epi16(__mmask32 __U, __m512i __A, __m512i __B)1444_mm512_maskz_srlv_epi16(__mmask32 __U, __m512i __A, __m512i __B)
1539{1445{
1540 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1446 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1542,13 +1448,13 @@ _mm512_maskz_srlv_epi16(__mmask32 __U, __m512i __A, __m512i __B)...@@ -1542,13 +1448,13 @@ _mm512_maskz_srlv_epi16(__mmask32 __U, __m512i __A, __m512i __B)
1542 (__v32hi)_mm512_setzero_si512());1448 (__v32hi)_mm512_setzero_si512());
1543}1449}
15441450
1545static __inline__ __m512i __DEFAULT_FN_ATTRS5121451static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1546_mm512_srav_epi16(__m512i __A, __m512i __B)1452_mm512_srav_epi16(__m512i __A, __m512i __B)
1547{1453{
1548 return (__m512i)__builtin_ia32_psrav32hi((__v32hi)__A, (__v32hi)__B);1454 return (__m512i)__builtin_ia32_psrav32hi((__v32hi)__A, (__v32hi)__B);
1549}1455}
15501456
1551static __inline__ __m512i __DEFAULT_FN_ATTRS5121457static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1552_mm512_mask_srav_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)1458_mm512_mask_srav_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1553{1459{
1554 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1460 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1556,7 +1462,7 @@ _mm512_mask_srav_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)...@@ -1556,7 +1462,7 @@ _mm512_mask_srav_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B)
1556 (__v32hi)__W);1462 (__v32hi)__W);
1557}1463}
15581464
1559static __inline__ __m512i __DEFAULT_FN_ATTRS5121465static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1560_mm512_maskz_srav_epi16(__mmask32 __U, __m512i __A, __m512i __B)1466_mm512_maskz_srav_epi16(__mmask32 __U, __m512i __A, __m512i __B)
1561{1467{
1562 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1468 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
...@@ -1564,100 +1470,89 @@ _mm512_maskz_srav_epi16(__mmask32 __U, __m512i __A, __m512i __B)...@@ -1564,100 +1470,89 @@ _mm512_maskz_srav_epi16(__mmask32 __U, __m512i __A, __m512i __B)
1564 (__v32hi)_mm512_setzero_si512());1470 (__v32hi)_mm512_setzero_si512());
1565}1471}
15661472
1567static __inline__ __m512i __DEFAULT_FN_ATTRS5121473static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1568_mm512_sra_epi16(__m512i __A, __m128i __B)1474_mm512_sra_epi16(__m512i __A, __m128i __B) {
1569{
1570 return (__m512i)__builtin_ia32_psraw512((__v32hi) __A, (__v8hi) __B);1475 return (__m512i)__builtin_ia32_psraw512((__v32hi) __A, (__v8hi) __B);
1571}1476}
15721477
1573static __inline__ __m512i __DEFAULT_FN_ATTRS5121478static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1574_mm512_mask_sra_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B)1479_mm512_mask_sra_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B) {
1575{
1576 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1480 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1577 (__v32hi)_mm512_sra_epi16(__A, __B),1481 (__v32hi)_mm512_sra_epi16(__A, __B),
1578 (__v32hi)__W);1482 (__v32hi)__W);
1579}1483}
15801484
1581static __inline__ __m512i __DEFAULT_FN_ATTRS5121485static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1582_mm512_maskz_sra_epi16(__mmask32 __U, __m512i __A, __m128i __B)1486_mm512_maskz_sra_epi16(__mmask32 __U, __m512i __A, __m128i __B) {
1583{
1584 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1487 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1585 (__v32hi)_mm512_sra_epi16(__A, __B),1488 (__v32hi)_mm512_sra_epi16(__A, __B),
1586 (__v32hi)_mm512_setzero_si512());1489 (__v32hi)_mm512_setzero_si512());
1587}1490}
15881491
1589static __inline__ __m512i __DEFAULT_FN_ATTRS5121492static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1590_mm512_srai_epi16(__m512i __A, unsigned int __B)1493_mm512_srai_epi16(__m512i __A, unsigned int __B) {
1591{
1592 return (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, (int)__B);1494 return (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, (int)__B);
1593}1495}
15941496
1595static __inline__ __m512i __DEFAULT_FN_ATTRS5121497static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1596_mm512_mask_srai_epi16(__m512i __W, __mmask32 __U, __m512i __A,1498_mm512_mask_srai_epi16(__m512i __W, __mmask32 __U, __m512i __A,
1597 unsigned int __B)1499 unsigned int __B) {
1598{
1599 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1500 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1600 (__v32hi)_mm512_srai_epi16(__A, __B),1501 (__v32hi)_mm512_srai_epi16(__A, __B),
1601 (__v32hi)__W);1502 (__v32hi)__W);
1602}1503}
16031504
1604static __inline__ __m512i __DEFAULT_FN_ATTRS5121505static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1605_mm512_maskz_srai_epi16(__mmask32 __U, __m512i __A, unsigned int __B)1506_mm512_maskz_srai_epi16(__mmask32 __U, __m512i __A, unsigned int __B) {
1606{
1607 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1507 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1608 (__v32hi)_mm512_srai_epi16(__A, __B),1508 (__v32hi)_mm512_srai_epi16(__A, __B),
1609 (__v32hi)_mm512_setzero_si512());1509 (__v32hi)_mm512_setzero_si512());
1610}1510}
16111511
1612static __inline__ __m512i __DEFAULT_FN_ATTRS5121512static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1613_mm512_srl_epi16(__m512i __A, __m128i __B)1513_mm512_srl_epi16(__m512i __A, __m128i __B) {
1614{
1615 return (__m512i)__builtin_ia32_psrlw512((__v32hi) __A, (__v8hi) __B);1514 return (__m512i)__builtin_ia32_psrlw512((__v32hi) __A, (__v8hi) __B);
1616}1515}
16171516
1618static __inline__ __m512i __DEFAULT_FN_ATTRS5121517static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1619_mm512_mask_srl_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B)1518_mm512_mask_srl_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B) {
1620{
1621 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1519 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1622 (__v32hi)_mm512_srl_epi16(__A, __B),1520 (__v32hi)_mm512_srl_epi16(__A, __B),
1623 (__v32hi)__W);1521 (__v32hi)__W);
1624}1522}
16251523
1626static __inline__ __m512i __DEFAULT_FN_ATTRS5121524static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1627_mm512_maskz_srl_epi16(__mmask32 __U, __m512i __A, __m128i __B)1525_mm512_maskz_srl_epi16(__mmask32 __U, __m512i __A, __m128i __B) {
1628{
1629 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1526 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1630 (__v32hi)_mm512_srl_epi16(__A, __B),1527 (__v32hi)_mm512_srl_epi16(__A, __B),
1631 (__v32hi)_mm512_setzero_si512());1528 (__v32hi)_mm512_setzero_si512());
1632}1529}
16331530
1634static __inline__ __m512i __DEFAULT_FN_ATTRS5121531static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1635_mm512_srli_epi16(__m512i __A, unsigned int __B)1532_mm512_srli_epi16(__m512i __A, unsigned int __B) {
1636{
1637 return (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, (int)__B);1533 return (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, (int)__B);
1638}1534}
16391535
1640static __inline__ __m512i __DEFAULT_FN_ATTRS5121536static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1641_mm512_mask_srli_epi16(__m512i __W, __mmask32 __U, __m512i __A,1537_mm512_mask_srli_epi16(__m512i __W, __mmask32 __U, __m512i __A,
1642 unsigned int __B)1538 unsigned int __B) {
1643{
1644 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1539 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1645 (__v32hi)_mm512_srli_epi16(__A, __B),1540 (__v32hi)_mm512_srli_epi16(__A, __B),
1646 (__v32hi)__W);1541 (__v32hi)__W);
1647}1542}
16481543
1649static __inline__ __m512i __DEFAULT_FN_ATTRS5121544static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1650_mm512_maskz_srli_epi16(__mmask32 __U, __m512i __A, int __B)1545_mm512_maskz_srli_epi16(__mmask32 __U, __m512i __A, int __B) {
1651{
1652 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,1546 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
1653 (__v32hi)_mm512_srli_epi16(__A, (unsigned int)__B),1547 (__v32hi)_mm512_srli_epi16(__A, (unsigned int)__B),
1654 (__v32hi)_mm512_setzero_si512());1548 (__v32hi)_mm512_setzero_si512());
1655}1549}
16561550
1657#define _mm512_bsrli_epi128(a, imm) \1551#define _mm512_bsrli_epi128(a, imm) \
1658 ((__m512i)__builtin_ia32_psrldqi512_byteshift((__v8di)(__m512i)(a), (int)(imm)))1552 ((__m512i)__builtin_ia32_psrldqi512_byteshift((__v64qi)(__m512i)(a), \
1553 (int)(imm)))
16591554
1660static __inline__ __m512i __DEFAULT_FN_ATTRS5121555static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1661_mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A)1556_mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A)
1662{1557{
1663 return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U,1558 return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U,
...@@ -1665,23 +1560,21 @@ _mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A)...@@ -1665,23 +1560,21 @@ _mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A)
1665 (__v32hi) __W);1560 (__v32hi) __W);
1666}1561}
16671562
1668static __inline__ __m512i __DEFAULT_FN_ATTRS5121563static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1669_mm512_maskz_mov_epi16 (__mmask32 __U, __m512i __A)1564_mm512_maskz_mov_epi16(__mmask32 __U, __m512i __A) {
1670{
1671 return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U,1565 return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U,
1672 (__v32hi) __A,1566 (__v32hi) __A,
1673 (__v32hi) _mm512_setzero_si512 ());1567 (__v32hi) _mm512_setzero_si512 ());
1674}1568}
16751569
1676static __inline__ __m512i __DEFAULT_FN_ATTRS5121570static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1677_mm512_mask_mov_epi8 (__m512i __W, __mmask64 __U, __m512i __A)1571_mm512_mask_mov_epi8(__m512i __W, __mmask64 __U, __m512i __A) {
1678{
1679 return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U,1572 return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U,
1680 (__v64qi) __A,1573 (__v64qi) __A,
1681 (__v64qi) __W);1574 (__v64qi) __W);
1682}1575}
16831576
1684static __inline__ __m512i __DEFAULT_FN_ATTRS5121577static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1685_mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A)1578_mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A)
1686{1579{
1687 return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U,1580 return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U,
...@@ -1689,7 +1582,7 @@ _mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A)...@@ -1689,7 +1582,7 @@ _mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A)
1689 (__v64qi) _mm512_setzero_si512 ());1582 (__v64qi) _mm512_setzero_si512 ());
1690}1583}
16911584
1692static __inline__ __m512i __DEFAULT_FN_ATTRS5121585static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1693_mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A)1586_mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A)
1694{1587{
1695 return (__m512i) __builtin_ia32_selectb_512(__M,1588 return (__m512i) __builtin_ia32_selectb_512(__M,
...@@ -1697,23 +1590,21 @@ _mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A)...@@ -1697,23 +1590,21 @@ _mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A)
1697 (__v64qi) __O);1590 (__v64qi) __O);
1698}1591}
16991592
1700static __inline__ __m512i __DEFAULT_FN_ATTRS5121593static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1701_mm512_maskz_set1_epi8 (__mmask64 __M, char __A)1594_mm512_maskz_set1_epi8(__mmask64 __M, char __A) {
1702{
1703 return (__m512i) __builtin_ia32_selectb_512(__M,1595 return (__m512i) __builtin_ia32_selectb_512(__M,
1704 (__v64qi) _mm512_set1_epi8(__A),1596 (__v64qi) _mm512_set1_epi8(__A),
1705 (__v64qi) _mm512_setzero_si512());1597 (__v64qi) _mm512_setzero_si512());
1706}1598}
17071599
1708static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_kunpackd(__mmask64 __A,1600static __inline__ __mmask64 __DEFAULT_FN_ATTRS_CONSTEXPR
1709 __mmask64 __B) {1601_mm512_kunpackd(__mmask64 __A, __mmask64 __B) {
1710 return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A,1602 return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A,
1711 (__mmask64) __B);1603 (__mmask64) __B);
1712}1604}
17131605
1714static __inline__ __mmask32 __DEFAULT_FN_ATTRS1606static __inline__ __mmask32 __DEFAULT_FN_ATTRS_CONSTEXPR
1715_mm512_kunpackw (__mmask32 __A, __mmask32 __B)1607_mm512_kunpackw(__mmask32 __A, __mmask32 __B) {
1716{
1717 return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A,1608 return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A,
1718 (__mmask32) __B);1609 (__mmask32) __B);
1719}1610}
...@@ -1859,33 +1750,28 @@ _mm512_mask_testn_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)...@@ -1859,33 +1750,28 @@ _mm512_mask_testn_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1859 _mm512_setzero_si512());1750 _mm512_setzero_si512());
1860}1751}
18611752
1862static __inline__ __mmask64 __DEFAULT_FN_ATTRS5121753static __inline__ __mmask64 __DEFAULT_FN_ATTRS512_CONSTEXPR
1863_mm512_movepi8_mask (__m512i __A)1754_mm512_movepi8_mask(__m512i __A) {
1864{
1865 return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A);1755 return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A);
1866}1756}
18671757
1868static __inline__ __mmask32 __DEFAULT_FN_ATTRS5121758static __inline__ __mmask32 __DEFAULT_FN_ATTRS512_CONSTEXPR
1869_mm512_movepi16_mask (__m512i __A)1759_mm512_movepi16_mask(__m512i __A) {
1870{
1871 return (__mmask32) __builtin_ia32_cvtw2mask512 ((__v32hi) __A);1760 return (__mmask32) __builtin_ia32_cvtw2mask512 ((__v32hi) __A);
1872}1761}
18731762
1874static __inline__ __m512i __DEFAULT_FN_ATTRS5121763static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1875_mm512_movm_epi8 (__mmask64 __A)1764_mm512_movm_epi8(__mmask64 __A) {
1876{
1877 return (__m512i) __builtin_ia32_cvtmask2b512 (__A);1765 return (__m512i) __builtin_ia32_cvtmask2b512 (__A);
1878}1766}
18791767
1880static __inline__ __m512i __DEFAULT_FN_ATTRS5121768static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1881_mm512_movm_epi16 (__mmask32 __A)1769_mm512_movm_epi16(__mmask32 __A) {
1882{
1883 return (__m512i) __builtin_ia32_cvtmask2w512 (__A);1770 return (__m512i) __builtin_ia32_cvtmask2w512 (__A);
1884}1771}
18851772
1886static __inline__ __m512i __DEFAULT_FN_ATTRS5121773static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1887_mm512_broadcastb_epi8 (__m128i __A)1774_mm512_broadcastb_epi8(__m128i __A) {
1888{
1889 return (__m512i)__builtin_shufflevector((__v16qi) __A, (__v16qi) __A,1775 return (__m512i)__builtin_shufflevector((__v16qi) __A, (__v16qi) __A,
1890 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1776 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1891 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1777 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -1893,7 +1779,7 @@ _mm512_broadcastb_epi8 (__m128i __A)...@@ -1893,7 +1779,7 @@ _mm512_broadcastb_epi8 (__m128i __A)
1893 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);1779 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1894}1780}
18951781
1896static __inline__ __m512i __DEFAULT_FN_ATTRS5121782static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1897_mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A)1783_mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A)
1898{1784{
1899 return (__m512i)__builtin_ia32_selectb_512(__M,1785 return (__m512i)__builtin_ia32_selectb_512(__M,
...@@ -1901,15 +1787,14 @@ _mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A)...@@ -1901,15 +1787,14 @@ _mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A)
1901 (__v64qi) __O);1787 (__v64qi) __O);
1902}1788}
19031789
1904static __inline__ __m512i __DEFAULT_FN_ATTRS5121790static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1905_mm512_maskz_broadcastb_epi8 (__mmask64 __M, __m128i __A)1791_mm512_maskz_broadcastb_epi8(__mmask64 __M, __m128i __A) {
1906{
1907 return (__m512i)__builtin_ia32_selectb_512(__M,1792 return (__m512i)__builtin_ia32_selectb_512(__M,
1908 (__v64qi) _mm512_broadcastb_epi8(__A),1793 (__v64qi) _mm512_broadcastb_epi8(__A),
1909 (__v64qi) _mm512_setzero_si512());1794 (__v64qi) _mm512_setzero_si512());
1910}1795}
19111796
1912static __inline__ __m512i __DEFAULT_FN_ATTRS5121797static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1913_mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A)1798_mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A)
1914{1799{
1915 return (__m512i) __builtin_ia32_selectw_512(__M,1800 return (__m512i) __builtin_ia32_selectw_512(__M,
...@@ -1917,23 +1802,21 @@ _mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A)...@@ -1917,23 +1802,21 @@ _mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A)
1917 (__v32hi) __O);1802 (__v32hi) __O);
1918}1803}
19191804
1920static __inline__ __m512i __DEFAULT_FN_ATTRS5121805static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1921_mm512_maskz_set1_epi16 (__mmask32 __M, short __A)1806_mm512_maskz_set1_epi16(__mmask32 __M, short __A) {
1922{
1923 return (__m512i) __builtin_ia32_selectw_512(__M,1807 return (__m512i) __builtin_ia32_selectw_512(__M,
1924 (__v32hi) _mm512_set1_epi16(__A),1808 (__v32hi) _mm512_set1_epi16(__A),
1925 (__v32hi) _mm512_setzero_si512());1809 (__v32hi) _mm512_setzero_si512());
1926}1810}
19271811
1928static __inline__ __m512i __DEFAULT_FN_ATTRS5121812static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1929_mm512_broadcastw_epi16 (__m128i __A)1813_mm512_broadcastw_epi16(__m128i __A) {
1930{
1931 return (__m512i)__builtin_shufflevector((__v8hi) __A, (__v8hi) __A,1814 return (__m512i)__builtin_shufflevector((__v8hi) __A, (__v8hi) __A,
1932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1815 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1933 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);1816 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1934}1817}
19351818
1936static __inline__ __m512i __DEFAULT_FN_ATTRS5121819static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1937_mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A)1820_mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A)
1938{1821{
1939 return (__m512i)__builtin_ia32_selectw_512(__M,1822 return (__m512i)__builtin_ia32_selectw_512(__M,
...@@ -1941,7 +1824,7 @@ _mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A)...@@ -1941,7 +1824,7 @@ _mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A)
1941 (__v32hi) __O);1824 (__v32hi) __O);
1942}1825}
19431826
1944static __inline__ __m512i __DEFAULT_FN_ATTRS5121827static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1945_mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A)1828_mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A)
1946{1829{
1947 return (__m512i)__builtin_ia32_selectw_512(__M,1830 return (__m512i)__builtin_ia32_selectw_512(__M,
...@@ -1949,25 +1832,21 @@ _mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A)...@@ -1949,25 +1832,21 @@ _mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A)
1949 (__v32hi) _mm512_setzero_si512());1832 (__v32hi) _mm512_setzero_si512());
1950}1833}
19511834
1952static __inline__ __m512i __DEFAULT_FN_ATTRS5121835static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1953_mm512_permutexvar_epi16 (__m512i __A, __m512i __B)1836_mm512_permutexvar_epi16(__m512i __A, __m512i __B) {
1954{
1955 return (__m512i)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A);1837 return (__m512i)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A);
1956}1838}
19571839
1958static __inline__ __m512i __DEFAULT_FN_ATTRS5121840static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1959_mm512_maskz_permutexvar_epi16 (__mmask32 __M, __m512i __A,1841_mm512_maskz_permutexvar_epi16(__mmask32 __M, __m512i __A, __m512i __B) {
1960 __m512i __B)
1961{
1962 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,1842 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
1963 (__v32hi)_mm512_permutexvar_epi16(__A, __B),1843 (__v32hi)_mm512_permutexvar_epi16(__A, __B),
1964 (__v32hi)_mm512_setzero_si512());1844 (__v32hi)_mm512_setzero_si512());
1965}1845}
19661846
1967static __inline__ __m512i __DEFAULT_FN_ATTRS5121847static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1968_mm512_mask_permutexvar_epi16 (__m512i __W, __mmask32 __M, __m512i __A,1848_mm512_mask_permutexvar_epi16(__m512i __W, __mmask32 __M, __m512i __A,
1969 __m512i __B)1849 __m512i __B) {
1970{
1971 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,1850 return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M,
1972 (__v32hi)_mm512_permutexvar_epi16(__A, __B),1851 (__v32hi)_mm512_permutexvar_epi16(__A, __B),
1973 (__v32hi)__W);1852 (__v32hi)__W);
...@@ -2010,5 +1889,7 @@ _mm512_sad_epu8 (__m512i __A, __m512i __B)...@@ -2010,5 +1889,7 @@ _mm512_sad_epu8 (__m512i __A, __m512i __B)
20101889
2011#undef __DEFAULT_FN_ATTRS5121890#undef __DEFAULT_FN_ATTRS512
2012#undef __DEFAULT_FN_ATTRS1891#undef __DEFAULT_FN_ATTRS
1892#undef __DEFAULT_FN_ATTRS512_CONSTEXPR
1893#undef __DEFAULT_FN_ATTRS_CONSTEXPR
20131894
2014#endif1895#endif
lib/include/avx512cdintrin.h+42-55
...@@ -15,109 +15,96 @@...@@ -15,109 +15,96 @@
15#define __AVX512CDINTRIN_H15#define __AVX512CDINTRIN_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)
18#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("avx512cd"), \
20 __target__("avx512cd,evex512"), __min_vector_width__(512)))21 __min_vector_width__(512))) constexpr
22#else
23#define __DEFAULT_FN_ATTRS \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx512cd"), \
25 __min_vector_width__(512)))
26#endif
2127
22static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS
23_mm512_conflict_epi64 (__m512i __A)29_mm512_conflict_epi64(__m512i __A) {
24{30 return (__m512i)__builtin_ia32_vpconflictdi_512((__v8di)__A);
25 return (__m512i) __builtin_ia32_vpconflictdi_512 ((__v8di) __A);
26}31}
2732
28static __inline__ __m512i __DEFAULT_FN_ATTRS33static __inline__ __m512i __DEFAULT_FN_ATTRS
29_mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A)34_mm512_mask_conflict_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
30{35 return (__m512i)__builtin_ia32_selectq_512(
31 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,36 (__mmask8)__U, (__v8di)_mm512_conflict_epi64(__A), (__v8di)__W);
32 (__v8di)_mm512_conflict_epi64(__A),
33 (__v8di)__W);
34}37}
3538
36static __inline__ __m512i __DEFAULT_FN_ATTRS39static __inline__ __m512i __DEFAULT_FN_ATTRS
37_mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A)40_mm512_maskz_conflict_epi64(__mmask8 __U, __m512i __A) {
38{
39 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,41 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
40 (__v8di)_mm512_conflict_epi64(__A),42 (__v8di)_mm512_conflict_epi64(__A),
41 (__v8di)_mm512_setzero_si512 ());43 (__v8di)_mm512_setzero_si512());
42}44}
4345
44static __inline__ __m512i __DEFAULT_FN_ATTRS46static __inline__ __m512i __DEFAULT_FN_ATTRS
45_mm512_conflict_epi32 (__m512i __A)47_mm512_conflict_epi32(__m512i __A) {
46{48 return (__m512i)__builtin_ia32_vpconflictsi_512((__v16si)__A);
47 return (__m512i) __builtin_ia32_vpconflictsi_512 ((__v16si) __A);
48}49}
4950
50static __inline__ __m512i __DEFAULT_FN_ATTRS51static __inline__ __m512i __DEFAULT_FN_ATTRS
51_mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A)52_mm512_mask_conflict_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
52{53 return (__m512i)__builtin_ia32_selectd_512(
53 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,54 (__mmask16)__U, (__v16si)_mm512_conflict_epi32(__A), (__v16si)__W);
54 (__v16si)_mm512_conflict_epi32(__A),
55 (__v16si)__W);
56}55}
5756
58static __inline__ __m512i __DEFAULT_FN_ATTRS57static __inline__ __m512i __DEFAULT_FN_ATTRS
59_mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A)58_mm512_maskz_conflict_epi32(__mmask16 __U, __m512i __A) {
60{59 return (__m512i)__builtin_ia32_selectd_512(
61 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,60 (__mmask16)__U, (__v16si)_mm512_conflict_epi32(__A),
62 (__v16si)_mm512_conflict_epi32(__A),61 (__v16si)_mm512_setzero_si512());
63 (__v16si)_mm512_setzero_si512());
64}62}
6563
66static __inline__ __m512i __DEFAULT_FN_ATTRS64static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_lzcnt_epi32(__m512i __A) {
67_mm512_lzcnt_epi32 (__m512i __A)65 return (__m512i)__builtin_elementwise_clzg((__v16si)__A,
68{66 (__v16si)_mm512_set1_epi32(32));
69 return (__m512i) __builtin_ia32_vplzcntd_512 ((__v16si) __A);
70}67}
7168
72static __inline__ __m512i __DEFAULT_FN_ATTRS69static __inline__ __m512i __DEFAULT_FN_ATTRS
73_mm512_mask_lzcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A)70_mm512_mask_lzcnt_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
74{71 return (__m512i)__builtin_ia32_selectd_512(
75 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,72 (__mmask16)__U, (__v16si)_mm512_lzcnt_epi32(__A), (__v16si)__W);
76 (__v16si)_mm512_lzcnt_epi32(__A),
77 (__v16si)__W);
78}73}
7974
80static __inline__ __m512i __DEFAULT_FN_ATTRS75static __inline__ __m512i __DEFAULT_FN_ATTRS
81_mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A)76_mm512_maskz_lzcnt_epi32(__mmask16 __U, __m512i __A) {
82{
83 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,77 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
84 (__v16si)_mm512_lzcnt_epi32(__A),78 (__v16si)_mm512_lzcnt_epi32(__A),
85 (__v16si)_mm512_setzero_si512());79 (__v16si)_mm512_setzero_si512());
86}80}
8781
88static __inline__ __m512i __DEFAULT_FN_ATTRS82static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_lzcnt_epi64(__m512i __A) {
89_mm512_lzcnt_epi64 (__m512i __A)83 return (__m512i)__builtin_elementwise_clzg(
90{84 (__v8di)__A, (__v8di)_mm512_set1_epi64((long long)64));
91 return (__m512i) __builtin_ia32_vplzcntq_512 ((__v8di) __A);
92}85}
9386
94static __inline__ __m512i __DEFAULT_FN_ATTRS87static __inline__ __m512i __DEFAULT_FN_ATTRS
95_mm512_mask_lzcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A)88_mm512_mask_lzcnt_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
96{89 return (__m512i)__builtin_ia32_selectq_512(
97 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,90 (__mmask8)__U, (__v8di)_mm512_lzcnt_epi64(__A), (__v8di)__W);
98 (__v8di)_mm512_lzcnt_epi64(__A),
99 (__v8di)__W);
100}91}
10192
102static __inline__ __m512i __DEFAULT_FN_ATTRS93static __inline__ __m512i __DEFAULT_FN_ATTRS
103_mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A)94_mm512_maskz_lzcnt_epi64(__mmask8 __U, __m512i __A) {
104{
105 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,95 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
106 (__v8di)_mm512_lzcnt_epi64(__A),96 (__v8di)_mm512_lzcnt_epi64(__A),
107 (__v8di)_mm512_setzero_si512());97 (__v8di)_mm512_setzero_si512());
108}98}
10999
110static __inline__ __m512i __DEFAULT_FN_ATTRS100static __inline__ __m512i __DEFAULT_FN_ATTRS
111_mm512_broadcastmb_epi64 (__mmask8 __A)101_mm512_broadcastmb_epi64(__mmask8 __A) {
112{102 return (__m512i)_mm512_set1_epi64((long long)__A);
113 return (__m512i) _mm512_set1_epi64((long long) __A);
114}103}
115104
116static __inline__ __m512i __DEFAULT_FN_ATTRS105static __inline__ __m512i __DEFAULT_FN_ATTRS
117_mm512_broadcastmw_epi32 (__mmask16 __A)106_mm512_broadcastmw_epi32(__mmask16 __A) {
118{107 return (__m512i)_mm512_set1_epi32((int)__A);
119 return (__m512i) _mm512_set1_epi32((int) __A);
120
121}108}
122109
123#undef __DEFAULT_FN_ATTRS110#undef __DEFAULT_FN_ATTRS
lib/include/avx512dqintrin.h+132-161
...@@ -15,110 +15,105 @@...@@ -15,110 +15,105 @@
15#define __AVX512DQINTRIN_H15#define __AVX512DQINTRIN_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#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512dq,evex512"), __min_vector_width__(512)))18#define __DEFAULT_FN_ATTRS512 \
19 __attribute__((__always_inline__, __nodebug__, __target__("avx512dq"), \
20 __min_vector_width__(512)))
19#define __DEFAULT_FN_ATTRS \21#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, \22 __attribute__((__always_inline__, __nodebug__, __target__("avx512dq")))
21 __target__("avx512dq,no-evex512")))23
24#if defined(__cplusplus) && (__cplusplus >= 201103L)
25#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
26#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
27#else
28#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
29#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
30#endif
2231
23static __inline __mmask8 __DEFAULT_FN_ATTRS32static __inline __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
24_knot_mask8(__mmask8 __M)33_knot_mask8(__mmask8 __M) {
25{
26 return __builtin_ia32_knotqi(__M);34 return __builtin_ia32_knotqi(__M);
27}35}
2836
29static __inline__ __mmask8 __DEFAULT_FN_ATTRS37static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
30_kand_mask8(__mmask8 __A, __mmask8 __B)38_kand_mask8(__mmask8 __A, __mmask8 __B) {
31{
32 return (__mmask8)__builtin_ia32_kandqi((__mmask8)__A, (__mmask8)__B);39 return (__mmask8)__builtin_ia32_kandqi((__mmask8)__A, (__mmask8)__B);
33}40}
3441
35static __inline__ __mmask8 __DEFAULT_FN_ATTRS42static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
36_kandn_mask8(__mmask8 __A, __mmask8 __B)43_kandn_mask8(__mmask8 __A, __mmask8 __B) {
37{
38 return (__mmask8)__builtin_ia32_kandnqi((__mmask8)__A, (__mmask8)__B);44 return (__mmask8)__builtin_ia32_kandnqi((__mmask8)__A, (__mmask8)__B);
39}45}
4046
41static __inline__ __mmask8 __DEFAULT_FN_ATTRS47static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
42_kor_mask8(__mmask8 __A, __mmask8 __B)48_kor_mask8(__mmask8 __A, __mmask8 __B) {
43{
44 return (__mmask8)__builtin_ia32_korqi((__mmask8)__A, (__mmask8)__B);49 return (__mmask8)__builtin_ia32_korqi((__mmask8)__A, (__mmask8)__B);
45}50}
4651
47static __inline__ __mmask8 __DEFAULT_FN_ATTRS52static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
48_kxnor_mask8(__mmask8 __A, __mmask8 __B)53_kxnor_mask8(__mmask8 __A, __mmask8 __B) {
49{
50 return (__mmask8)__builtin_ia32_kxnorqi((__mmask8)__A, (__mmask8)__B);54 return (__mmask8)__builtin_ia32_kxnorqi((__mmask8)__A, (__mmask8)__B);
51}55}
5256
53static __inline__ __mmask8 __DEFAULT_FN_ATTRS57static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
54_kxor_mask8(__mmask8 __A, __mmask8 __B)58_kxor_mask8(__mmask8 __A, __mmask8 __B) {
55{
56 return (__mmask8)__builtin_ia32_kxorqi((__mmask8)__A, (__mmask8)__B);59 return (__mmask8)__builtin_ia32_kxorqi((__mmask8)__A, (__mmask8)__B);
57}60}
5861
59static __inline__ unsigned char __DEFAULT_FN_ATTRS62static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
60_kortestc_mask8_u8(__mmask8 __A, __mmask8 __B)63_kortestc_mask8_u8(__mmask8 __A, __mmask8 __B) {
61{
62 return (unsigned char)__builtin_ia32_kortestcqi(__A, __B);64 return (unsigned char)__builtin_ia32_kortestcqi(__A, __B);
63}65}
6466
65static __inline__ unsigned char __DEFAULT_FN_ATTRS67static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
66_kortestz_mask8_u8(__mmask8 __A, __mmask8 __B)68_kortestz_mask8_u8(__mmask8 __A, __mmask8 __B) {
67{
68 return (unsigned char)__builtin_ia32_kortestzqi(__A, __B);69 return (unsigned char)__builtin_ia32_kortestzqi(__A, __B);
69}70}
7071
71static __inline__ unsigned char __DEFAULT_FN_ATTRS72static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
72_kortest_mask8_u8(__mmask8 __A, __mmask8 __B, unsigned char *__C) {73_kortest_mask8_u8(__mmask8 __A, __mmask8 __B, unsigned char *__C) {
73 *__C = (unsigned char)__builtin_ia32_kortestcqi(__A, __B);74 *__C = (unsigned char)__builtin_ia32_kortestcqi(__A, __B);
74 return (unsigned char)__builtin_ia32_kortestzqi(__A, __B);75 return (unsigned char)__builtin_ia32_kortestzqi(__A, __B);
75}76}
7677
77static __inline__ unsigned char __DEFAULT_FN_ATTRS78static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
78_ktestc_mask8_u8(__mmask8 __A, __mmask8 __B)79_ktestc_mask8_u8(__mmask8 __A, __mmask8 __B) {
79{
80 return (unsigned char)__builtin_ia32_ktestcqi(__A, __B);80 return (unsigned char)__builtin_ia32_ktestcqi(__A, __B);
81}81}
8282
83static __inline__ unsigned char __DEFAULT_FN_ATTRS83static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
84_ktestz_mask8_u8(__mmask8 __A, __mmask8 __B)84_ktestz_mask8_u8(__mmask8 __A, __mmask8 __B) {
85{
86 return (unsigned char)__builtin_ia32_ktestzqi(__A, __B);85 return (unsigned char)__builtin_ia32_ktestzqi(__A, __B);
87}86}
8887
89static __inline__ unsigned char __DEFAULT_FN_ATTRS88static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
90_ktest_mask8_u8(__mmask8 __A, __mmask8 __B, unsigned char *__C) {89_ktest_mask8_u8(__mmask8 __A, __mmask8 __B, unsigned char *__C) {
91 *__C = (unsigned char)__builtin_ia32_ktestcqi(__A, __B);90 *__C = (unsigned char)__builtin_ia32_ktestcqi(__A, __B);
92 return (unsigned char)__builtin_ia32_ktestzqi(__A, __B);91 return (unsigned char)__builtin_ia32_ktestzqi(__A, __B);
93}92}
9493
95static __inline__ unsigned char __DEFAULT_FN_ATTRS94static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
96_ktestc_mask16_u8(__mmask16 __A, __mmask16 __B)95_ktestc_mask16_u8(__mmask16 __A, __mmask16 __B) {
97{
98 return (unsigned char)__builtin_ia32_ktestchi(__A, __B);96 return (unsigned char)__builtin_ia32_ktestchi(__A, __B);
99}97}
10098
101static __inline__ unsigned char __DEFAULT_FN_ATTRS99static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
102_ktestz_mask16_u8(__mmask16 __A, __mmask16 __B)100_ktestz_mask16_u8(__mmask16 __A, __mmask16 __B) {
103{
104 return (unsigned char)__builtin_ia32_ktestzhi(__A, __B);101 return (unsigned char)__builtin_ia32_ktestzhi(__A, __B);
105}102}
106103
107static __inline__ unsigned char __DEFAULT_FN_ATTRS104static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
108_ktest_mask16_u8(__mmask16 __A, __mmask16 __B, unsigned char *__C) {105_ktest_mask16_u8(__mmask16 __A, __mmask16 __B, unsigned char *__C) {
109 *__C = (unsigned char)__builtin_ia32_ktestchi(__A, __B);106 *__C = (unsigned char)__builtin_ia32_ktestchi(__A, __B);
110 return (unsigned char)__builtin_ia32_ktestzhi(__A, __B);107 return (unsigned char)__builtin_ia32_ktestzhi(__A, __B);
111}108}
112109
113static __inline__ __mmask8 __DEFAULT_FN_ATTRS110static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
114_kadd_mask8(__mmask8 __A, __mmask8 __B)111_kadd_mask8(__mmask8 __A, __mmask8 __B) {
115{
116 return (__mmask8)__builtin_ia32_kaddqi((__mmask8)__A, (__mmask8)__B);112 return (__mmask8)__builtin_ia32_kaddqi((__mmask8)__A, (__mmask8)__B);
117}113}
118114
119static __inline__ __mmask16 __DEFAULT_FN_ATTRS115static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
120_kadd_mask16(__mmask16 __A, __mmask16 __B)116_kadd_mask16(__mmask16 __A, __mmask16 __B) {
121{
122 return (__mmask16)__builtin_ia32_kaddhi((__mmask16)__A, (__mmask16)__B);117 return (__mmask16)__builtin_ia32_kaddhi((__mmask16)__A, (__mmask16)__B);
123}118}
124119
...@@ -128,12 +123,12 @@ _kadd_mask16(__mmask16 __A, __mmask16 __B)...@@ -128,12 +123,12 @@ _kadd_mask16(__mmask16 __A, __mmask16 __B)
128#define _kshiftri_mask8(A, I) \123#define _kshiftri_mask8(A, I) \
129 ((__mmask8)__builtin_ia32_kshiftriqi((__mmask8)(A), (unsigned int)(I)))124 ((__mmask8)__builtin_ia32_kshiftriqi((__mmask8)(A), (unsigned int)(I)))
130125
131static __inline__ unsigned int __DEFAULT_FN_ATTRS126static __inline__ unsigned int
132_cvtmask8_u32(__mmask8 __A) {127 __DEFAULT_FN_ATTRS_CONSTEXPR _cvtmask8_u32(__mmask8 __A) {
133 return (unsigned int)__builtin_ia32_kmovb((__mmask8)__A);128 return (unsigned int)__builtin_ia32_kmovb((__mmask8)__A);
134}129}
135130
136static __inline__ __mmask8 __DEFAULT_FN_ATTRS131static __inline__ __mmask8 __DEFAULT_FN_ATTRS_CONSTEXPR
137_cvtu32_mask8(unsigned int __A) {132_cvtu32_mask8(unsigned int __A) {
138 return (__mmask8)__builtin_ia32_kmovb((__mmask8)__A);133 return (__mmask8)__builtin_ia32_kmovb((__mmask8)__A);
139}134}
...@@ -148,26 +143,26 @@ _store_mask8(__mmask8 *__A, __mmask8 __B) {...@@ -148,26 +143,26 @@ _store_mask8(__mmask8 *__A, __mmask8 __B) {
148 *(__mmask8 *)__A = __builtin_ia32_kmovb((__mmask8)__B);143 *(__mmask8 *)__A = __builtin_ia32_kmovb((__mmask8)__B);
149}144}
150145
151static __inline__ __m512i __DEFAULT_FN_ATTRS512146static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
152_mm512_mullo_epi64 (__m512i __A, __m512i __B) {147_mm512_mullo_epi64(__m512i __A, __m512i __B) {
153 return (__m512i) ((__v8du) __A * (__v8du) __B);148 return (__m512i) ((__v8du) __A * (__v8du) __B);
154}149}
155150
156static __inline__ __m512i __DEFAULT_FN_ATTRS512151static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
157_mm512_mask_mullo_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {152_mm512_mask_mullo_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {
158 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,153 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
159 (__v8di)_mm512_mullo_epi64(__A, __B),154 (__v8di)_mm512_mullo_epi64(__A, __B),
160 (__v8di)__W);155 (__v8di)__W);
161}156}
162157
163static __inline__ __m512i __DEFAULT_FN_ATTRS512158static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
164_mm512_maskz_mullo_epi64(__mmask8 __U, __m512i __A, __m512i __B) {159_mm512_maskz_mullo_epi64(__mmask8 __U, __m512i __A, __m512i __B) {
165 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,160 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
166 (__v8di)_mm512_mullo_epi64(__A, __B),161 (__v8di)_mm512_mullo_epi64(__A, __B),
167 (__v8di)_mm512_setzero_si512());162 (__v8di)_mm512_setzero_si512());
168}163}
169164
170static __inline__ __m512d __DEFAULT_FN_ATTRS512165static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
171_mm512_xor_pd(__m512d __A, __m512d __B) {166_mm512_xor_pd(__m512d __A, __m512d __B) {
172 return (__m512d)((__v8du)__A ^ (__v8du)__B);167 return (__m512d)((__v8du)__A ^ (__v8du)__B);
173}168}
...@@ -186,7 +181,7 @@ _mm512_maskz_xor_pd(__mmask8 __U, __m512d __A, __m512d __B) {...@@ -186,7 +181,7 @@ _mm512_maskz_xor_pd(__mmask8 __U, __m512d __A, __m512d __B) {
186 (__v8df)_mm512_setzero_pd());181 (__v8df)_mm512_setzero_pd());
187}182}
188183
189static __inline__ __m512 __DEFAULT_FN_ATTRS512184static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
190_mm512_xor_ps (__m512 __A, __m512 __B) {185_mm512_xor_ps (__m512 __A, __m512 __B) {
191 return (__m512)((__v16su)__A ^ (__v16su)__B);186 return (__m512)((__v16su)__A ^ (__v16su)__B);
192}187}
...@@ -205,7 +200,7 @@ _mm512_maskz_xor_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -205,7 +200,7 @@ _mm512_maskz_xor_ps(__mmask16 __U, __m512 __A, __m512 __B) {
205 (__v16sf)_mm512_setzero_ps());200 (__v16sf)_mm512_setzero_ps());
206}201}
207202
208static __inline__ __m512d __DEFAULT_FN_ATTRS512203static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
209_mm512_or_pd(__m512d __A, __m512d __B) {204_mm512_or_pd(__m512d __A, __m512d __B) {
210 return (__m512d)((__v8du)__A | (__v8du)__B);205 return (__m512d)((__v8du)__A | (__v8du)__B);
211}206}
...@@ -224,7 +219,7 @@ _mm512_maskz_or_pd(__mmask8 __U, __m512d __A, __m512d __B) {...@@ -224,7 +219,7 @@ _mm512_maskz_or_pd(__mmask8 __U, __m512d __A, __m512d __B) {
224 (__v8df)_mm512_setzero_pd());219 (__v8df)_mm512_setzero_pd());
225}220}
226221
227static __inline__ __m512 __DEFAULT_FN_ATTRS512222static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
228_mm512_or_ps(__m512 __A, __m512 __B) {223_mm512_or_ps(__m512 __A, __m512 __B) {
229 return (__m512)((__v16su)__A | (__v16su)__B);224 return (__m512)((__v16su)__A | (__v16su)__B);
230}225}
...@@ -243,7 +238,7 @@ _mm512_maskz_or_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -243,7 +238,7 @@ _mm512_maskz_or_ps(__mmask16 __U, __m512 __A, __m512 __B) {
243 (__v16sf)_mm512_setzero_ps());238 (__v16sf)_mm512_setzero_ps());
244}239}
245240
246static __inline__ __m512d __DEFAULT_FN_ATTRS512241static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
247_mm512_and_pd(__m512d __A, __m512d __B) {242_mm512_and_pd(__m512d __A, __m512d __B) {
248 return (__m512d)((__v8du)__A & (__v8du)__B);243 return (__m512d)((__v8du)__A & (__v8du)__B);
249}244}
...@@ -262,7 +257,7 @@ _mm512_maskz_and_pd(__mmask8 __U, __m512d __A, __m512d __B) {...@@ -262,7 +257,7 @@ _mm512_maskz_and_pd(__mmask8 __U, __m512d __A, __m512d __B) {
262 (__v8df)_mm512_setzero_pd());257 (__v8df)_mm512_setzero_pd());
263}258}
264259
265static __inline__ __m512 __DEFAULT_FN_ATTRS512260static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
266_mm512_and_ps(__m512 __A, __m512 __B) {261_mm512_and_ps(__m512 __A, __m512 __B) {
267 return (__m512)((__v16su)__A & (__v16su)__B);262 return (__m512)((__v16su)__A & (__v16su)__B);
268}263}
...@@ -281,7 +276,7 @@ _mm512_maskz_and_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -281,7 +276,7 @@ _mm512_maskz_and_ps(__mmask16 __U, __m512 __A, __m512 __B) {
281 (__v16sf)_mm512_setzero_ps());276 (__v16sf)_mm512_setzero_ps());
282}277}
283278
284static __inline__ __m512d __DEFAULT_FN_ATTRS512279static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
285_mm512_andnot_pd(__m512d __A, __m512d __B) {280_mm512_andnot_pd(__m512d __A, __m512d __B) {
286 return (__m512d)(~(__v8du)__A & (__v8du)__B);281 return (__m512d)(~(__v8du)__A & (__v8du)__B);
287}282}
...@@ -300,7 +295,7 @@ _mm512_maskz_andnot_pd(__mmask8 __U, __m512d __A, __m512d __B) {...@@ -300,7 +295,7 @@ _mm512_maskz_andnot_pd(__mmask8 __U, __m512d __A, __m512d __B) {
300 (__v8df)_mm512_setzero_pd());295 (__v8df)_mm512_setzero_pd());
301}296}
302297
303static __inline__ __m512 __DEFAULT_FN_ATTRS512298static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
304_mm512_andnot_ps(__m512 __A, __m512 __B) {299_mm512_andnot_ps(__m512 __A, __m512 __B) {
305 return (__m512)(~(__v16su)__A & (__v16su)__B);300 return (__m512)(~(__v16su)__A & (__v16su)__B);
306}301}
...@@ -475,21 +470,20 @@ _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) {...@@ -475,21 +470,20 @@ _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) {
475 (__v8di)_mm512_setzero_si512(), \470 (__v8di)_mm512_setzero_si512(), \
476 (__mmask8)(U), (int)(R)))471 (__mmask8)(U), (int)(R)))
477472
478473static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
479static __inline__ __m512d __DEFAULT_FN_ATTRS512474_mm512_cvtepi64_pd(__m512i __A) {
480_mm512_cvtepi64_pd (__m512i __A) {
481 return (__m512d)__builtin_convertvector((__v8di)__A, __v8df);475 return (__m512d)__builtin_convertvector((__v8di)__A, __v8df);
482}476}
483477
484static __inline__ __m512d __DEFAULT_FN_ATTRS512478static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
485_mm512_mask_cvtepi64_pd (__m512d __W, __mmask8 __U, __m512i __A) {479_mm512_mask_cvtepi64_pd(__m512d __W, __mmask8 __U, __m512i __A) {
486 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,480 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
487 (__v8df)_mm512_cvtepi64_pd(__A),481 (__v8df)_mm512_cvtepi64_pd(__A),
488 (__v8df)__W);482 (__v8df)__W);
489}483}
490484
491static __inline__ __m512d __DEFAULT_FN_ATTRS512485static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
492_mm512_maskz_cvtepi64_pd (__mmask8 __U, __m512i __A) {486_mm512_maskz_cvtepi64_pd(__mmask8 __U, __m512i __A) {
493 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,487 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
494 (__v8df)_mm512_cvtepi64_pd(__A),488 (__v8df)_mm512_cvtepi64_pd(__A),
495 (__v8df)_mm512_setzero_pd());489 (__v8df)_mm512_setzero_pd());
...@@ -706,20 +700,20 @@ _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) {...@@ -706,20 +700,20 @@ _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) {
706 (__v8di)_mm512_setzero_si512(), \700 (__v8di)_mm512_setzero_si512(), \
707 (__mmask8)(U), (int)(R)))701 (__mmask8)(U), (int)(R)))
708702
709static __inline__ __m512d __DEFAULT_FN_ATTRS512703static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
710_mm512_cvtepu64_pd (__m512i __A) {704_mm512_cvtepu64_pd(__m512i __A) {
711 return (__m512d)__builtin_convertvector((__v8du)__A, __v8df);705 return (__m512d)__builtin_convertvector((__v8du)__A, __v8df);
712}706}
713707
714static __inline__ __m512d __DEFAULT_FN_ATTRS512708static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
715_mm512_mask_cvtepu64_pd (__m512d __W, __mmask8 __U, __m512i __A) {709_mm512_mask_cvtepu64_pd(__m512d __W, __mmask8 __U, __m512i __A) {
716 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,710 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
717 (__v8df)_mm512_cvtepu64_pd(__A),711 (__v8df)_mm512_cvtepu64_pd(__A),
718 (__v8df)__W);712 (__v8df)__W);
719}713}
720714
721static __inline__ __m512d __DEFAULT_FN_ATTRS512715static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
722_mm512_maskz_cvtepu64_pd (__mmask8 __U, __m512i __A) {716_mm512_maskz_cvtepu64_pd(__mmask8 __U, __m512i __A) {
723 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,717 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
724 (__v8df)_mm512_cvtepu64_pd(__A),718 (__v8df)_mm512_cvtepu64_pd(__A),
725 (__v8df)_mm512_setzero_pd());719 (__v8df)_mm512_setzero_pd());
...@@ -1052,177 +1046,154 @@ _mm512_maskz_cvtepu64_ps (__mmask8 __U, __m512i __A) {...@@ -1052,177 +1046,154 @@ _mm512_maskz_cvtepu64_ps (__mmask8 __U, __m512i __A) {
1052 (__v2df)_mm_setzero_pd(), \1046 (__v2df)_mm_setzero_pd(), \
1053 (__mmask8)(U), (int)(C), (int)(R)))1047 (__mmask8)(U), (int)(C), (int)(R)))
10541048
1055static __inline__ __mmask16 __DEFAULT_FN_ATTRS5121049static __inline__ __mmask16
1056_mm512_movepi32_mask (__m512i __A)1050 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_movepi32_mask(__m512i __A) {
1057{
1058 return (__mmask16) __builtin_ia32_cvtd2mask512 ((__v16si) __A);1051 return (__mmask16) __builtin_ia32_cvtd2mask512 ((__v16si) __A);
1059}1052}
10601053
1061static __inline__ __m512i __DEFAULT_FN_ATTRS5121054static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1062_mm512_movm_epi32 (__mmask16 __A)1055_mm512_movm_epi32(__mmask16 __A) {
1063{
1064 return (__m512i) __builtin_ia32_cvtmask2d512 (__A);1056 return (__m512i) __builtin_ia32_cvtmask2d512 (__A);
1065}1057}
10661058
1067static __inline__ __m512i __DEFAULT_FN_ATTRS5121059static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1068_mm512_movm_epi64 (__mmask8 __A)1060_mm512_movm_epi64(__mmask8 __A) {
1069{
1070 return (__m512i) __builtin_ia32_cvtmask2q512 (__A);1061 return (__m512i) __builtin_ia32_cvtmask2q512 (__A);
1071}1062}
10721063
1073static __inline__ __mmask8 __DEFAULT_FN_ATTRS5121064static __inline__ __mmask8 __DEFAULT_FN_ATTRS512_CONSTEXPR
1074_mm512_movepi64_mask (__m512i __A)1065_mm512_movepi64_mask(__m512i __A) {
1075{
1076 return (__mmask8) __builtin_ia32_cvtq2mask512 ((__v8di) __A);1066 return (__mmask8) __builtin_ia32_cvtq2mask512 ((__v8di) __A);
1077}1067}
10781068
10791069static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1080static __inline__ __m512 __DEFAULT_FN_ATTRS5121070_mm512_broadcast_f32x2(__m128 __A) {
1081_mm512_broadcast_f32x2 (__m128 __A)
1082{
1083 return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,1071 return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,
1084 0, 1, 0, 1, 0, 1, 0, 1,1072 0, 1, 0, 1, 0, 1, 0, 1,
1085 0, 1, 0, 1, 0, 1, 0, 1);1073 0, 1, 0, 1, 0, 1, 0, 1);
1086}1074}
10871075
1088static __inline__ __m512 __DEFAULT_FN_ATTRS5121076static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1089_mm512_mask_broadcast_f32x2 (__m512 __O, __mmask16 __M, __m128 __A)1077_mm512_mask_broadcast_f32x2(__m512 __O, __mmask16 __M, __m128 __A) {
1090{
1091 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,1078 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
1092 (__v16sf)_mm512_broadcast_f32x2(__A),1079 (__v16sf)_mm512_broadcast_f32x2(__A),
1093 (__v16sf)__O);1080 (__v16sf)__O);
1094}1081}
10951082
1096static __inline__ __m512 __DEFAULT_FN_ATTRS5121083static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1097_mm512_maskz_broadcast_f32x2 (__mmask16 __M, __m128 __A)1084_mm512_maskz_broadcast_f32x2(__mmask16 __M, __m128 __A) {
1098{
1099 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,1085 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
1100 (__v16sf)_mm512_broadcast_f32x2(__A),1086 (__v16sf)_mm512_broadcast_f32x2(__A),
1101 (__v16sf)_mm512_setzero_ps());1087 (__v16sf)_mm512_setzero_ps());
1102}1088}
11031089
1104static __inline__ __m512 __DEFAULT_FN_ATTRS5121090static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1105_mm512_broadcast_f32x8(__m256 __A)1091_mm512_broadcast_f32x8(__m256 __A) {
1106{
1107 return (__m512)__builtin_shufflevector((__v8sf)__A, (__v8sf)__A,1092 return (__m512)__builtin_shufflevector((__v8sf)__A, (__v8sf)__A,
1108 0, 1, 2, 3, 4, 5, 6, 7,1093 0, 1, 2, 3, 4, 5, 6, 7,
1109 0, 1, 2, 3, 4, 5, 6, 7);1094 0, 1, 2, 3, 4, 5, 6, 7);
1110}1095}
11111096
1112static __inline__ __m512 __DEFAULT_FN_ATTRS5121097static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1113_mm512_mask_broadcast_f32x8(__m512 __O, __mmask16 __M, __m256 __A)1098_mm512_mask_broadcast_f32x8(__m512 __O, __mmask16 __M, __m256 __A) {
1114{
1115 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,1099 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
1116 (__v16sf)_mm512_broadcast_f32x8(__A),1100 (__v16sf)_mm512_broadcast_f32x8(__A),
1117 (__v16sf)__O);1101 (__v16sf)__O);
1118}1102}
11191103
1120static __inline__ __m512 __DEFAULT_FN_ATTRS5121104static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1121_mm512_maskz_broadcast_f32x8(__mmask16 __M, __m256 __A)1105_mm512_maskz_broadcast_f32x8(__mmask16 __M, __m256 __A) {
1122{
1123 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,1106 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
1124 (__v16sf)_mm512_broadcast_f32x8(__A),1107 (__v16sf)_mm512_broadcast_f32x8(__A),
1125 (__v16sf)_mm512_setzero_ps());1108 (__v16sf)_mm512_setzero_ps());
1126}1109}
11271110
1128static __inline__ __m512d __DEFAULT_FN_ATTRS5121111static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1129_mm512_broadcast_f64x2(__m128d __A)1112_mm512_broadcast_f64x2(__m128d __A) {
1130{
1131 return (__m512d)__builtin_shufflevector((__v2df)__A, (__v2df)__A,1113 return (__m512d)__builtin_shufflevector((__v2df)__A, (__v2df)__A,
1132 0, 1, 0, 1, 0, 1, 0, 1);1114 0, 1, 0, 1, 0, 1, 0, 1);
1133}1115}
11341116
1135static __inline__ __m512d __DEFAULT_FN_ATTRS5121117static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1136_mm512_mask_broadcast_f64x2(__m512d __O, __mmask8 __M, __m128d __A)1118_mm512_mask_broadcast_f64x2(__m512d __O, __mmask8 __M, __m128d __A) {
1137{
1138 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,1119 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,
1139 (__v8df)_mm512_broadcast_f64x2(__A),1120 (__v8df)_mm512_broadcast_f64x2(__A),
1140 (__v8df)__O);1121 (__v8df)__O);
1141}1122}
11421123
1143static __inline__ __m512d __DEFAULT_FN_ATTRS5121124static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1144_mm512_maskz_broadcast_f64x2(__mmask8 __M, __m128d __A)1125_mm512_maskz_broadcast_f64x2(__mmask8 __M, __m128d __A) {
1145{
1146 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,1126 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M,
1147 (__v8df)_mm512_broadcast_f64x2(__A),1127 (__v8df)_mm512_broadcast_f64x2(__A),
1148 (__v8df)_mm512_setzero_pd());1128 (__v8df)_mm512_setzero_pd());
1149}1129}
11501130
1151static __inline__ __m512i __DEFAULT_FN_ATTRS5121131static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1152_mm512_broadcast_i32x2 (__m128i __A)1132_mm512_broadcast_i32x2(__m128i __A) {
1153{
1154 return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,1133 return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
1155 0, 1, 0, 1, 0, 1, 0, 1,1134 0, 1, 0, 1, 0, 1, 0, 1,
1156 0, 1, 0, 1, 0, 1, 0, 1);1135 0, 1, 0, 1, 0, 1, 0, 1);
1157}1136}
11581137
1159static __inline__ __m512i __DEFAULT_FN_ATTRS5121138static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1160_mm512_mask_broadcast_i32x2 (__m512i __O, __mmask16 __M, __m128i __A)1139_mm512_mask_broadcast_i32x2(__m512i __O, __mmask16 __M, __m128i __A) {
1161{
1162 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1140 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1163 (__v16si)_mm512_broadcast_i32x2(__A),1141 (__v16si)_mm512_broadcast_i32x2(__A),
1164 (__v16si)__O);1142 (__v16si)__O);
1165}1143}
11661144
1167static __inline__ __m512i __DEFAULT_FN_ATTRS5121145static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1168_mm512_maskz_broadcast_i32x2 (__mmask16 __M, __m128i __A)1146_mm512_maskz_broadcast_i32x2(__mmask16 __M, __m128i __A) {
1169{
1170 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1147 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1171 (__v16si)_mm512_broadcast_i32x2(__A),1148 (__v16si)_mm512_broadcast_i32x2(__A),
1172 (__v16si)_mm512_setzero_si512());1149 (__v16si)_mm512_setzero_si512());
1173}1150}
11741151
1175static __inline__ __m512i __DEFAULT_FN_ATTRS5121152static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1176_mm512_broadcast_i32x8(__m256i __A)1153_mm512_broadcast_i32x8(__m256i __A) {
1177{
1178 return (__m512i)__builtin_shufflevector((__v8si)__A, (__v8si)__A,1154 return (__m512i)__builtin_shufflevector((__v8si)__A, (__v8si)__A,
1179 0, 1, 2, 3, 4, 5, 6, 7,1155 0, 1, 2, 3, 4, 5, 6, 7,
1180 0, 1, 2, 3, 4, 5, 6, 7);1156 0, 1, 2, 3, 4, 5, 6, 7);
1181}1157}
11821158
1183static __inline__ __m512i __DEFAULT_FN_ATTRS5121159static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1184_mm512_mask_broadcast_i32x8(__m512i __O, __mmask16 __M, __m256i __A)1160_mm512_mask_broadcast_i32x8(__m512i __O, __mmask16 __M, __m256i __A) {
1185{
1186 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1161 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1187 (__v16si)_mm512_broadcast_i32x8(__A),1162 (__v16si)_mm512_broadcast_i32x8(__A),
1188 (__v16si)__O);1163 (__v16si)__O);
1189}1164}
11901165
1191static __inline__ __m512i __DEFAULT_FN_ATTRS5121166static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1192_mm512_maskz_broadcast_i32x8(__mmask16 __M, __m256i __A)1167_mm512_maskz_broadcast_i32x8(__mmask16 __M, __m256i __A) {
1193{
1194 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1168 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1195 (__v16si)_mm512_broadcast_i32x8(__A),1169 (__v16si)_mm512_broadcast_i32x8(__A),
1196 (__v16si)_mm512_setzero_si512());1170 (__v16si)_mm512_setzero_si512());
1197}1171}
11981172
1199static __inline__ __m512i __DEFAULT_FN_ATTRS5121173static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1200_mm512_broadcast_i64x2(__m128i __A)1174_mm512_broadcast_i64x2(__m128i __A) {
1201{
1202 return (__m512i)__builtin_shufflevector((__v2di)__A, (__v2di)__A,1175 return (__m512i)__builtin_shufflevector((__v2di)__A, (__v2di)__A,
1203 0, 1, 0, 1, 0, 1, 0, 1);1176 0, 1, 0, 1, 0, 1, 0, 1);
1204}1177}
12051178
1206static __inline__ __m512i __DEFAULT_FN_ATTRS5121179static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1207_mm512_mask_broadcast_i64x2(__m512i __O, __mmask8 __M, __m128i __A)1180_mm512_mask_broadcast_i64x2(__m512i __O, __mmask8 __M, __m128i __A) {
1208{
1209 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1181 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1210 (__v8di)_mm512_broadcast_i64x2(__A),1182 (__v8di)_mm512_broadcast_i64x2(__A),
1211 (__v8di)__O);1183 (__v8di)__O);
1212}1184}
12131185
1214static __inline__ __m512i __DEFAULT_FN_ATTRS5121186static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1215_mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)1187_mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A) {
1216{
1217 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1188 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1218 (__v8di)_mm512_broadcast_i64x2(__A),1189 (__v8di)_mm512_broadcast_i64x2(__A),
1219 (__v8di)_mm512_setzero_si512());1190 (__v8di)_mm512_setzero_si512());
1220}1191}
12211192
1222#define _mm512_extractf32x8_ps(A, imm) \1193#define _mm512_extractf32x8_ps(A, imm) \
1223 ((__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \1194 ((__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \
1224 (__v8sf)_mm256_undefined_ps(), \1195 (__v8sf)_mm256_setzero_ps(), \
1225 (__mmask8)-1))1196 (__mmask8) - 1))
12261197
1227#define _mm512_mask_extractf32x8_ps(W, U, A, imm) \1198#define _mm512_mask_extractf32x8_ps(W, U, A, imm) \
1228 ((__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \1199 ((__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \
...@@ -1234,11 +1205,10 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)...@@ -1234,11 +1205,10 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)
1234 (__v8sf)_mm256_setzero_ps(), \1205 (__v8sf)_mm256_setzero_ps(), \
1235 (__mmask8)(U)))1206 (__mmask8)(U)))
12361207
1237#define _mm512_extractf64x2_pd(A, imm) \1208#define _mm512_extractf64x2_pd(A, imm) \
1238 ((__m128d)__builtin_ia32_extractf64x2_512_mask((__v8df)(__m512d)(A), \1209 ((__m128d)__builtin_ia32_extractf64x2_512_mask( \
1239 (int)(imm), \1210 (__v8df)(__m512d)(A), (int)(imm), (__v2df)_mm_setzero_pd(), \
1240 (__v2df)_mm_undefined_pd(), \1211 (__mmask8) - 1))
1241 (__mmask8)-1))
12421212
1243#define _mm512_mask_extractf64x2_pd(W, U, A, imm) \1213#define _mm512_mask_extractf64x2_pd(W, U, A, imm) \
1244 ((__m128d)__builtin_ia32_extractf64x2_512_mask((__v8df)(__m512d)(A), \1214 ((__m128d)__builtin_ia32_extractf64x2_512_mask((__v8df)(__m512d)(A), \
...@@ -1252,10 +1222,10 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)...@@ -1252,10 +1222,10 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)
1252 (__v2df)_mm_setzero_pd(), \1222 (__v2df)_mm_setzero_pd(), \
1253 (__mmask8)(U)))1223 (__mmask8)(U)))
12541224
1255#define _mm512_extracti32x8_epi32(A, imm) \1225#define _mm512_extracti32x8_epi32(A, imm) \
1256 ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \1226 ((__m256i)__builtin_ia32_extracti32x8_mask( \
1257 (__v8si)_mm256_undefined_si256(), \1227 (__v16si)(__m512i)(A), (int)(imm), (__v8si)_mm256_setzero_si256(), \
1258 (__mmask8)-1))1228 (__mmask8) - 1))
12591229
1260#define _mm512_mask_extracti32x8_epi32(W, U, A, imm) \1230#define _mm512_mask_extracti32x8_epi32(W, U, A, imm) \
1261 ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \1231 ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \
...@@ -1267,11 +1237,10 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)...@@ -1267,11 +1237,10 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)
1267 (__v8si)_mm256_setzero_si256(), \1237 (__v8si)_mm256_setzero_si256(), \
1268 (__mmask8)(U)))1238 (__mmask8)(U)))
12691239
1270#define _mm512_extracti64x2_epi64(A, imm) \1240#define _mm512_extracti64x2_epi64(A, imm) \
1271 ((__m128i)__builtin_ia32_extracti64x2_512_mask((__v8di)(__m512i)(A), \1241 ((__m128i)__builtin_ia32_extracti64x2_512_mask( \
1272 (int)(imm), \1242 (__v8di)(__m512i)(A), (int)(imm), (__v2di)_mm_setzero_si128(), \
1273 (__v2di)_mm_undefined_si128(), \1243 (__mmask8) - 1))
1274 (__mmask8)-1))
12751244
1276#define _mm512_mask_extracti64x2_epi64(W, U, A, imm) \1245#define _mm512_mask_extracti64x2_epi64(W, U, A, imm) \
1277 ((__m128i)__builtin_ia32_extracti64x2_512_mask((__v8di)(__m512i)(A), \1246 ((__m128i)__builtin_ia32_extracti64x2_512_mask((__v8di)(__m512i)(A), \
...@@ -1375,5 +1344,7 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)...@@ -1375,5 +1344,7 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A)
13751344
1376#undef __DEFAULT_FN_ATTRS5121345#undef __DEFAULT_FN_ATTRS512
1377#undef __DEFAULT_FN_ATTRS1346#undef __DEFAULT_FN_ATTRS
1347#undef __DEFAULT_FN_ATTRS512_CONSTEXPR
1348#undef __DEFAULT_FN_ATTRS_CONSTEXPR
13781349
1379#endif1350#endif
lib/include/avx512fintrin.h+1015-1424
...@@ -167,22 +167,23 @@ typedef enum...@@ -167,22 +167,23 @@ typedef enum
167} _MM_MANTISSA_SIGN_ENUM;167} _MM_MANTISSA_SIGN_ENUM;
168168
169/* Define the default attributes for the functions in this file. */169/* Define the default attributes for the functions in this file. */
170#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512f,evex512"), __min_vector_width__(512)))170#define __DEFAULT_FN_ATTRS512 \
171 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), \
172 __min_vector_width__(512)))
171#define __DEFAULT_FN_ATTRS128 \173#define __DEFAULT_FN_ATTRS128 \
172 __attribute__((__always_inline__, __nodebug__, \174 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), \
173 __target__("avx512f,no-evex512"), __min_vector_width__(128)))175 __min_vector_width__(128)))
174#define __DEFAULT_FN_ATTRS \176#define __DEFAULT_FN_ATTRS \
175 __attribute__((__always_inline__, __nodebug__, \177 __attribute__((__always_inline__, __nodebug__, __target__("avx512f")))
176 __target__("avx512f,no-evex512")))
177178
178#if defined(__cplusplus) && (__cplusplus >= 201103L)179#if defined(__cplusplus) && (__cplusplus >= 201103L)
179#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr180#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
180#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr181#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
181#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr182#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
182#else183#else
183#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS128184#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
184#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512185#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
185#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS186#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
186#endif187#endif
187188
188/* Create vectors with repeated elements */189/* Create vectors with repeated elements */
...@@ -206,9 +207,7 @@ _mm512_undefined(void)...@@ -206,9 +207,7 @@ _mm512_undefined(void)
206 return (__m512)__builtin_ia32_undef512();207 return (__m512)__builtin_ia32_undef512();
207}208}
208209
209static __inline__ __m512 __DEFAULT_FN_ATTRS512210static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_undefined_ps(void) {
210_mm512_undefined_ps(void)
211{
212 return (__m512)__builtin_ia32_undef512();211 return (__m512)__builtin_ia32_undef512();
213}212}
214213
...@@ -218,48 +217,40 @@ _mm512_undefined_epi32(void)...@@ -218,48 +217,40 @@ _mm512_undefined_epi32(void)
218 return (__m512i)__builtin_ia32_undef512();217 return (__m512i)__builtin_ia32_undef512();
219}218}
220219
221static __inline__ __m512i __DEFAULT_FN_ATTRS512220static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
222_mm512_broadcastd_epi32 (__m128i __A)221_mm512_broadcastd_epi32(__m128i __A) {
223{
224 return (__m512i)__builtin_shufflevector((__v4si) __A, (__v4si) __A,222 return (__m512i)__builtin_shufflevector((__v4si) __A, (__v4si) __A,
225 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
226}224}
227225
228static __inline__ __m512i __DEFAULT_FN_ATTRS512226static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
229_mm512_mask_broadcastd_epi32 (__m512i __O, __mmask16 __M, __m128i __A)227_mm512_mask_broadcastd_epi32(__m512i __O, __mmask16 __M, __m128i __A) {
230{
231 return (__m512i)__builtin_ia32_selectd_512(__M,228 return (__m512i)__builtin_ia32_selectd_512(__M,
232 (__v16si) _mm512_broadcastd_epi32(__A),229 (__v16si) _mm512_broadcastd_epi32(__A),
233 (__v16si) __O);230 (__v16si) __O);
234}231}
235232
236static __inline__ __m512i __DEFAULT_FN_ATTRS512233static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
237_mm512_maskz_broadcastd_epi32 (__mmask16 __M, __m128i __A)234_mm512_maskz_broadcastd_epi32(__mmask16 __M, __m128i __A) {
238{
239 return (__m512i)__builtin_ia32_selectd_512(__M,235 return (__m512i)__builtin_ia32_selectd_512(__M,
240 (__v16si) _mm512_broadcastd_epi32(__A),236 (__v16si) _mm512_broadcastd_epi32(__A),
241 (__v16si) _mm512_setzero_si512());237 (__v16si) _mm512_setzero_si512());
242}238}
243239
244static __inline__ __m512i __DEFAULT_FN_ATTRS512240static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
245_mm512_broadcastq_epi64 (__m128i __A)241_mm512_broadcastq_epi64(__m128i __A) {
246{
247 return (__m512i)__builtin_shufflevector((__v2di) __A, (__v2di) __A,242 return (__m512i)__builtin_shufflevector((__v2di) __A, (__v2di) __A,
248 0, 0, 0, 0, 0, 0, 0, 0);243 0, 0, 0, 0, 0, 0, 0, 0);
249}244}
250245
251static __inline__ __m512i __DEFAULT_FN_ATTRS512246static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
252_mm512_mask_broadcastq_epi64 (__m512i __O, __mmask8 __M, __m128i __A)247_mm512_mask_broadcastq_epi64(__m512i __O, __mmask8 __M, __m128i __A) {
253{248 return (__m512i)__builtin_ia32_selectq_512(
254 return (__m512i)__builtin_ia32_selectq_512(__M,249 __M, (__v8di)_mm512_broadcastq_epi64(__A), (__v8di)__O);
255 (__v8di) _mm512_broadcastq_epi64(__A),
256 (__v8di) __O);
257
258}250}
259251
260static __inline__ __m512i __DEFAULT_FN_ATTRS512252static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
261_mm512_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A)253_mm512_maskz_broadcastq_epi64(__mmask8 __M, __m128i __A) {
262{
263 return (__m512i)__builtin_ia32_selectq_512(__M,254 return (__m512i)__builtin_ia32_selectq_512(__M,
264 (__v8di) _mm512_broadcastq_epi64(__A),255 (__v8di) _mm512_broadcastq_epi64(__A),
265 (__v8di) _mm512_setzero_si512());256 (__v8di) _mm512_setzero_si512());
...@@ -277,20 +268,20 @@ _mm512_setzero_pd(void) {...@@ -277,20 +268,20 @@ _mm512_setzero_pd(void) {
277 return __extension__(__m512d){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};268 return __extension__(__m512d){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
278}269}
279270
280static __inline __m512 __DEFAULT_FN_ATTRS512271static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
281_mm512_set1_ps(float __w)272_mm512_set1_ps(float __w)
282{273{
283 return __extension__ (__m512){ __w, __w, __w, __w, __w, __w, __w, __w,274 return __extension__ (__m512){ __w, __w, __w, __w, __w, __w, __w, __w,
284 __w, __w, __w, __w, __w, __w, __w, __w };275 __w, __w, __w, __w, __w, __w, __w, __w };
285}276}
286277
287static __inline __m512d __DEFAULT_FN_ATTRS512278static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
288_mm512_set1_pd(double __w)279_mm512_set1_pd(double __w)
289{280{
290 return __extension__ (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w };281 return __extension__ (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w };
291}282}
292283
293static __inline __m512i __DEFAULT_FN_ATTRS512284static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
294_mm512_set1_epi8(char __w)285_mm512_set1_epi8(char __w)
295{286{
296 return __extension__ (__m512i)(__v64qi){287 return __extension__ (__m512i)(__v64qi){
...@@ -304,7 +295,7 @@ _mm512_set1_epi8(char __w)...@@ -304,7 +295,7 @@ _mm512_set1_epi8(char __w)
304 __w, __w, __w, __w, __w, __w, __w, __w };295 __w, __w, __w, __w, __w, __w, __w, __w };
305}296}
306297
307static __inline __m512i __DEFAULT_FN_ATTRS512298static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
308_mm512_set1_epi16(short __w)299_mm512_set1_epi16(short __w)
309{300{
310 return __extension__ (__m512i)(__v32hi){301 return __extension__ (__m512i)(__v32hi){
...@@ -314,7 +305,7 @@ _mm512_set1_epi16(short __w)...@@ -314,7 +305,7 @@ _mm512_set1_epi16(short __w)
314 __w, __w, __w, __w, __w, __w, __w, __w };305 __w, __w, __w, __w, __w, __w, __w, __w };
315}306}
316307
317static __inline __m512i __DEFAULT_FN_ATTRS512308static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
318_mm512_set1_epi32(int __s)309_mm512_set1_epi32(int __s)
319{310{
320 return __extension__ (__m512i)(__v16si){311 return __extension__ (__m512i)(__v16si){
...@@ -322,81 +313,80 @@ _mm512_set1_epi32(int __s)...@@ -322,81 +313,80 @@ _mm512_set1_epi32(int __s)
322 __s, __s, __s, __s, __s, __s, __s, __s };313 __s, __s, __s, __s, __s, __s, __s, __s };
323}314}
324315
325static __inline __m512i __DEFAULT_FN_ATTRS512316static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
326_mm512_maskz_set1_epi32(__mmask16 __M, int __A)317_mm512_maskz_set1_epi32(__mmask16 __M, int __A) {
327{
328 return (__m512i)__builtin_ia32_selectd_512(__M,318 return (__m512i)__builtin_ia32_selectd_512(__M,
329 (__v16si)_mm512_set1_epi32(__A),319 (__v16si)_mm512_set1_epi32(__A),
330 (__v16si)_mm512_setzero_si512());320 (__v16si)_mm512_setzero_si512());
331}321}
332322
333static __inline __m512i __DEFAULT_FN_ATTRS512323static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
334_mm512_set1_epi64(long long __d)324_mm512_set1_epi64(long long __d)
335{325{
336 return __extension__(__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d };326 return __extension__(__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d };
337}327}
338328
339static __inline __m512i __DEFAULT_FN_ATTRS512329static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
340_mm512_maskz_set1_epi64(__mmask8 __M, long long __A)330_mm512_maskz_set1_epi64(__mmask8 __M, long long __A) {
341{
342 return (__m512i)__builtin_ia32_selectq_512(__M,331 return (__m512i)__builtin_ia32_selectq_512(__M,
343 (__v8di)_mm512_set1_epi64(__A),332 (__v8di)_mm512_set1_epi64(__A),
344 (__v8di)_mm512_setzero_si512());333 (__v8di)_mm512_setzero_si512());
345}334}
346335
347static __inline__ __m512 __DEFAULT_FN_ATTRS512336static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
348_mm512_broadcastss_ps(__m128 __A)337_mm512_broadcastss_ps(__m128 __A) {
349{
350 return (__m512)__builtin_shufflevector((__v4sf) __A, (__v4sf) __A,338 return (__m512)__builtin_shufflevector((__v4sf) __A, (__v4sf) __A,
351 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
352}340}
353341
354static __inline __m512i __DEFAULT_FN_ATTRS512342static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
355_mm512_set4_epi32 (int __A, int __B, int __C, int __D)343_mm512_set4_epi32(int __A, int __B, int __C, int __D) {
356{
357 return __extension__ (__m512i)(__v16si)344 return __extension__ (__m512i)(__v16si)
358 { __D, __C, __B, __A, __D, __C, __B, __A,345 { __D, __C, __B, __A, __D, __C, __B, __A,
359 __D, __C, __B, __A, __D, __C, __B, __A };346 __D, __C, __B, __A, __D, __C, __B, __A };
360}347}
361348
362static __inline __m512i __DEFAULT_FN_ATTRS512349static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
363_mm512_set4_epi64 (long long __A, long long __B, long long __C,350_mm512_set4_epi64(long long __A, long long __B, long long __C, long long __D) {
364 long long __D)
365{
366 return __extension__ (__m512i) (__v8di)351 return __extension__ (__m512i) (__v8di)
367 { __D, __C, __B, __A, __D, __C, __B, __A };352 { __D, __C, __B, __A, __D, __C, __B, __A };
368}353}
369354
370static __inline __m512d __DEFAULT_FN_ATTRS512355static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
371_mm512_set4_pd (double __A, double __B, double __C, double __D)356_mm512_set4_pd(double __A, double __B, double __C, double __D) {
372{
373 return __extension__ (__m512d)357 return __extension__ (__m512d)
374 { __D, __C, __B, __A, __D, __C, __B, __A };358 { __D, __C, __B, __A, __D, __C, __B, __A };
375}359}
376360
377static __inline __m512 __DEFAULT_FN_ATTRS512361static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
378_mm512_set4_ps (float __A, float __B, float __C, float __D)362_mm512_set4_ps(float __A, float __B, float __C, float __D) {
379{
380 return __extension__ (__m512)363 return __extension__ (__m512)
381 { __D, __C, __B, __A, __D, __C, __B, __A,364 { __D, __C, __B, __A, __D, __C, __B, __A,
382 __D, __C, __B, __A, __D, __C, __B, __A };365 __D, __C, __B, __A, __D, __C, __B, __A };
383}366}
384367
385#define _mm512_setr4_epi32(e0,e1,e2,e3) \368static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
386 _mm512_set4_epi32((e3),(e2),(e1),(e0))369_mm512_setr4_epi32(int e0, int e1, int e2, int e3) {
370 return _mm512_set4_epi32(e3, e2, e1, e0);
371}
387372
388#define _mm512_setr4_epi64(e0,e1,e2,e3) \373static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
389 _mm512_set4_epi64((e3),(e2),(e1),(e0))374_mm512_setr4_epi64(long long e0, long long e1, long long e2, long long e3) {
375 return _mm512_set4_epi64(e3, e2, e1, e0);
376}
390377
391#define _mm512_setr4_pd(e0,e1,e2,e3) \378static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
392 _mm512_set4_pd((e3),(e2),(e1),(e0))379_mm512_setr4_pd(double e0, double e1, double e2, double e3) {
380 return _mm512_set4_pd(e3, e2, e1, e0);
381}
393382
394#define _mm512_setr4_ps(e0,e1,e2,e3) \383static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
395 _mm512_set4_ps((e3),(e2),(e1),(e0))384_mm512_setr4_ps(float e0, float e1, float e2, float e3) {
385 return _mm512_set4_ps(e3, e2, e1, e0);
386}
396387
397static __inline__ __m512d __DEFAULT_FN_ATTRS512388static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
398_mm512_broadcastsd_pd(__m128d __A)389_mm512_broadcastsd_pd(__m128d __A) {
399{
400 return (__m512d)__builtin_shufflevector((__v2df) __A, (__v2df) __A,390 return (__m512d)__builtin_shufflevector((__v2df) __A, (__v2df) __A,
401 0, 0, 0, 0, 0, 0, 0, 0);391 0, 0, 0, 0, 0, 0, 0, 0);
402}392}
...@@ -417,37 +407,36 @@ _mm512_castps256_ps512(__m256 __a)...@@ -417,37 +407,36 @@ _mm512_castps256_ps512(__m256 __a)
417 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);407 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
418}408}
419409
420static __inline __m128d __DEFAULT_FN_ATTRS512410static __inline __m128d __DEFAULT_FN_ATTRS512_CONSTEXPR
421_mm512_castpd512_pd128(__m512d __a)411_mm512_castpd512_pd128(__m512d __a)
422{412{
423 return __builtin_shufflevector(__a, __a, 0, 1);413 return __builtin_shufflevector(__a, __a, 0, 1);
424}414}
425415
426static __inline __m256d __DEFAULT_FN_ATTRS512416static __inline __m256d __DEFAULT_FN_ATTRS512_CONSTEXPR
427_mm512_castpd512_pd256 (__m512d __A)417_mm512_castpd512_pd256 (__m512d __A)
428{418{
429 return __builtin_shufflevector(__A, __A, 0, 1, 2, 3);419 return __builtin_shufflevector(__A, __A, 0, 1, 2, 3);
430}420}
431421
432static __inline __m128 __DEFAULT_FN_ATTRS512422static __inline __m128 __DEFAULT_FN_ATTRS512_CONSTEXPR
433_mm512_castps512_ps128(__m512 __a)423_mm512_castps512_ps128(__m512 __a)
434{424{
435 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3);425 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3);
436}426}
437427
438static __inline __m256 __DEFAULT_FN_ATTRS512428static __inline __m256 __DEFAULT_FN_ATTRS512_CONSTEXPR
439_mm512_castps512_ps256 (__m512 __A)429_mm512_castps512_ps256(__m512 __A) {
440{
441 return __builtin_shufflevector(__A, __A, 0, 1, 2, 3, 4, 5, 6, 7);430 return __builtin_shufflevector(__A, __A, 0, 1, 2, 3, 4, 5, 6, 7);
442}431}
443432
444static __inline __m512 __DEFAULT_FN_ATTRS512433static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
445_mm512_castpd_ps (__m512d __A)434_mm512_castpd_ps (__m512d __A)
446{435{
447 return (__m512) (__A);436 return (__m512) (__A);
448}437}
449438
450static __inline __m512i __DEFAULT_FN_ATTRS512439static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
451_mm512_castpd_si512 (__m512d __A)440_mm512_castpd_si512 (__m512d __A)
452{441{
453 return (__m512i) (__A);442 return (__m512i) (__A);
...@@ -462,13 +451,13 @@ _mm512_castpd128_pd512 (__m128d __A)...@@ -462,13 +451,13 @@ _mm512_castpd128_pd512 (__m128d __A)
462 __B, 0, 1, 2, 3, 4, 5, 6, 7);451 __B, 0, 1, 2, 3, 4, 5, 6, 7);
463}452}
464453
465static __inline __m512d __DEFAULT_FN_ATTRS512454static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
466_mm512_castps_pd (__m512 __A)455_mm512_castps_pd (__m512 __A)
467{456{
468 return (__m512d) (__A);457 return (__m512d) (__A);
469}458}
470459
471static __inline __m512i __DEFAULT_FN_ATTRS512460static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
472_mm512_castps_si512 (__m512 __A)461_mm512_castps_si512 (__m512 __A)
473{462{
474 return (__m512i) (__A);463 return (__m512i) (__A);
...@@ -498,39 +487,36 @@ _mm512_castsi256_si512 (__m256i __A)...@@ -498,39 +487,36 @@ _mm512_castsi256_si512 (__m256i __A)
498 return __builtin_shufflevector( __A, __builtin_nondeterministic_value(__A), 0, 1, 2, 3, 4, 5, 6, 7);487 return __builtin_shufflevector( __A, __builtin_nondeterministic_value(__A), 0, 1, 2, 3, 4, 5, 6, 7);
499}488}
500489
501static __inline __m512 __DEFAULT_FN_ATTRS512490static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
502_mm512_castsi512_ps (__m512i __A)491_mm512_castsi512_ps (__m512i __A)
503{492{
504 return (__m512) (__A);493 return (__m512) (__A);
505}494}
506495
507static __inline __m512d __DEFAULT_FN_ATTRS512496static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
508_mm512_castsi512_pd (__m512i __A)497_mm512_castsi512_pd (__m512i __A)
509{498{
510 return (__m512d) (__A);499 return (__m512d) (__A);
511}500}
512501
513static __inline __m128i __DEFAULT_FN_ATTRS512502static __inline __m128i __DEFAULT_FN_ATTRS512_CONSTEXPR
514_mm512_castsi512_si128 (__m512i __A)503_mm512_castsi512_si128 (__m512i __A)
515{504{
516 return (__m128i)__builtin_shufflevector(__A, __A , 0, 1);505 return (__m128i)__builtin_shufflevector(__A, __A , 0, 1);
517}506}
518507
519static __inline __m256i __DEFAULT_FN_ATTRS512508static __inline __m256i __DEFAULT_FN_ATTRS512_CONSTEXPR
520_mm512_castsi512_si256 (__m512i __A)509_mm512_castsi512_si256(__m512i __A) {
521{
522 return (__m256i)__builtin_shufflevector(__A, __A , 0, 1, 2, 3);510 return (__m256i)__builtin_shufflevector(__A, __A , 0, 1, 2, 3);
523}511}
524512
525static __inline__ __mmask16 __DEFAULT_FN_ATTRS513static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
526_mm512_int2mask(int __a)514_mm512_int2mask(int __a) {
527{
528 return (__mmask16)__a;515 return (__mmask16)__a;
529}516}
530517
531static __inline__ int __DEFAULT_FN_ATTRS518static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
532_mm512_mask2int(__mmask16 __a)519_mm512_mask2int(__mmask16 __a) {
533{
534 return (int)__a;520 return (int)__a;
535}521}
536522
...@@ -547,9 +533,8 @@ _mm512_mask2int(__mmask16 __a)...@@ -547,9 +533,8 @@ _mm512_mask2int(__mmask16 __a)
547/// A 128-bit vector of [2 x double].533/// A 128-bit vector of [2 x double].
548/// \returns A 512-bit floating-point vector of [8 x double]. The lower 128 bits534/// \returns A 512-bit floating-point vector of [8 x double]. The lower 128 bits
549/// contain the value of the parameter. The upper 384 bits are set to zero.535/// contain the value of the parameter. The upper 384 bits are set to zero.
550static __inline __m512d __DEFAULT_FN_ATTRS512536static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
551_mm512_zextpd128_pd512(__m128d __a)537_mm512_zextpd128_pd512(__m128d __a) {
552{
553 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3, 2, 3, 2, 3);538 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3, 2, 3, 2, 3);
554}539}
555540
...@@ -566,9 +551,8 @@ _mm512_zextpd128_pd512(__m128d __a)...@@ -566,9 +551,8 @@ _mm512_zextpd128_pd512(__m128d __a)
566/// A 256-bit vector of [4 x double].551/// A 256-bit vector of [4 x double].
567/// \returns A 512-bit floating-point vector of [8 x double]. The lower 256 bits552/// \returns A 512-bit floating-point vector of [8 x double]. The lower 256 bits
568/// contain the value of the parameter. The upper 256 bits are set to zero.553/// contain the value of the parameter. The upper 256 bits are set to zero.
569static __inline __m512d __DEFAULT_FN_ATTRS512554static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
570_mm512_zextpd256_pd512(__m256d __a)555_mm512_zextpd256_pd512(__m256d __a) {
571{
572 return __builtin_shufflevector((__v4df)__a, (__v4df)_mm256_setzero_pd(), 0, 1, 2, 3, 4, 5, 6, 7);556 return __builtin_shufflevector((__v4df)__a, (__v4df)_mm256_setzero_pd(), 0, 1, 2, 3, 4, 5, 6, 7);
573}557}
574558
...@@ -584,9 +568,8 @@ _mm512_zextpd256_pd512(__m256d __a)...@@ -584,9 +568,8 @@ _mm512_zextpd256_pd512(__m256d __a)
584/// A 128-bit vector of [4 x float].568/// A 128-bit vector of [4 x float].
585/// \returns A 512-bit floating-point vector of [16 x float]. The lower 128 bits569/// \returns A 512-bit floating-point vector of [16 x float]. The lower 128 bits
586/// contain the value of the parameter. The upper 384 bits are set to zero.570/// contain the value of the parameter. The upper 384 bits are set to zero.
587static __inline __m512 __DEFAULT_FN_ATTRS512571static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
588_mm512_zextps128_ps512(__m128 __a)572_mm512_zextps128_ps512(__m128 __a) {
589{
590 return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);573 return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
591}574}
592575
...@@ -602,9 +585,8 @@ _mm512_zextps128_ps512(__m128 __a)...@@ -602,9 +585,8 @@ _mm512_zextps128_ps512(__m128 __a)
602/// A 256-bit vector of [8 x float].585/// A 256-bit vector of [8 x float].
603/// \returns A 512-bit floating-point vector of [16 x float]. The lower 256 bits586/// \returns A 512-bit floating-point vector of [16 x float]. The lower 256 bits
604/// contain the value of the parameter. The upper 256 bits are set to zero.587/// contain the value of the parameter. The upper 256 bits are set to zero.
605static __inline __m512 __DEFAULT_FN_ATTRS512588static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
606_mm512_zextps256_ps512(__m256 __a)589_mm512_zextps256_ps512(__m256 __a) {
607{
608 return __builtin_shufflevector((__v8sf)__a, (__v8sf)_mm256_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);590 return __builtin_shufflevector((__v8sf)__a, (__v8sf)_mm256_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
609}591}
610592
...@@ -620,9 +602,8 @@ _mm512_zextps256_ps512(__m256 __a)...@@ -620,9 +602,8 @@ _mm512_zextps256_ps512(__m256 __a)
620/// A 128-bit integer vector.602/// A 128-bit integer vector.
621/// \returns A 512-bit integer vector. The lower 128 bits contain the value of603/// \returns A 512-bit integer vector. The lower 128 bits contain the value of
622/// the parameter. The upper 384 bits are set to zero.604/// the parameter. The upper 384 bits are set to zero.
623static __inline __m512i __DEFAULT_FN_ATTRS512605static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
624_mm512_zextsi128_si512(__m128i __a)606_mm512_zextsi128_si512(__m128i __a) {
625{
626 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3, 2, 3, 2, 3);607 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3, 2, 3, 2, 3);
627}608}
628609
...@@ -638,22 +619,20 @@ _mm512_zextsi128_si512(__m128i __a)...@@ -638,22 +619,20 @@ _mm512_zextsi128_si512(__m128i __a)
638/// A 256-bit integer vector.619/// A 256-bit integer vector.
639/// \returns A 512-bit integer vector. The lower 256 bits contain the value of620/// \returns A 512-bit integer vector. The lower 256 bits contain the value of
640/// the parameter. The upper 256 bits are set to zero.621/// the parameter. The upper 256 bits are set to zero.
641static __inline __m512i __DEFAULT_FN_ATTRS512622static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
642_mm512_zextsi256_si512(__m256i __a)623_mm512_zextsi256_si512(__m256i __a) {
643{
644 return __builtin_shufflevector((__v4di)__a, (__v4di)_mm256_setzero_si256(), 0, 1, 2, 3, 4, 5, 6, 7);624 return __builtin_shufflevector((__v4di)__a, (__v4di)_mm256_setzero_si256(), 0, 1, 2, 3, 4, 5, 6, 7);
645}625}
646626
647/* Bitwise operators */627/* Bitwise operators */
648static __inline__ __m512i __DEFAULT_FN_ATTRS512628static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
649_mm512_and_epi32(__m512i __a, __m512i __b)629_mm512_and_epi32(__m512i __a, __m512i __b)
650{630{
651 return (__m512i)((__v16su)__a & (__v16su)__b);631 return (__m512i)((__v16su)__a & (__v16su)__b);
652}632}
653633
654static __inline__ __m512i __DEFAULT_FN_ATTRS512634static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
655_mm512_mask_and_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b)635_mm512_mask_and_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b) {
656{
657 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k,636 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k,
658 (__v16si) _mm512_and_epi32(__a, __b),637 (__v16si) _mm512_and_epi32(__a, __b),
659 (__v16si) __src);638 (__v16si) __src);
...@@ -666,18 +645,16 @@ _mm512_maskz_and_epi32(__mmask16 __k, __m512i __a, __m512i __b)...@@ -666,18 +645,16 @@ _mm512_maskz_and_epi32(__mmask16 __k, __m512i __a, __m512i __b)
666 __k, __a, __b);645 __k, __a, __b);
667}646}
668647
669static __inline__ __m512i __DEFAULT_FN_ATTRS512648static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
670_mm512_and_epi64(__m512i __a, __m512i __b)649_mm512_and_epi64(__m512i __a, __m512i __b)
671{650{
672 return (__m512i)((__v8du)__a & (__v8du)__b);651 return (__m512i)((__v8du)__a & (__v8du)__b);
673}652}
674653
675static __inline__ __m512i __DEFAULT_FN_ATTRS512654static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
676_mm512_mask_and_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b)655_mm512_mask_and_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b) {
677{656 return (__m512i)__builtin_ia32_selectq_512(
678 return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __k,657 (__mmask8)__k, (__v8di)_mm512_and_epi64(__a, __b), (__v8di)__src);
679 (__v8di) _mm512_and_epi64(__a, __b),
680 (__v8di) __src);
681}658}
682659
683static __inline__ __m512i __DEFAULT_FN_ATTRS512660static __inline__ __m512i __DEFAULT_FN_ATTRS512
...@@ -687,13 +664,13 @@ _mm512_maskz_and_epi64(__mmask8 __k, __m512i __a, __m512i __b)...@@ -687,13 +664,13 @@ _mm512_maskz_and_epi64(__mmask8 __k, __m512i __a, __m512i __b)
687 __k, __a, __b);664 __k, __a, __b);
688}665}
689666
690static __inline__ __m512i __DEFAULT_FN_ATTRS512667static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
691_mm512_andnot_si512 (__m512i __A, __m512i __B)668_mm512_andnot_si512 (__m512i __A, __m512i __B)
692{669{
693 return (__m512i)(~(__v8du)__A & (__v8du)__B);670 return (__m512i)(~(__v8du)__A & (__v8du)__B);
694}671}
695672
696static __inline__ __m512i __DEFAULT_FN_ATTRS512673static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
697_mm512_andnot_epi32 (__m512i __A, __m512i __B)674_mm512_andnot_epi32 (__m512i __A, __m512i __B)
698{675{
699 return (__m512i)(~(__v16su)__A & (__v16su)__B);676 return (__m512i)(~(__v16su)__A & (__v16su)__B);
...@@ -714,7 +691,7 @@ _mm512_maskz_andnot_epi32(__mmask16 __U, __m512i __A, __m512i __B)...@@ -714,7 +691,7 @@ _mm512_maskz_andnot_epi32(__mmask16 __U, __m512i __A, __m512i __B)
714 __U, __A, __B);691 __U, __A, __B);
715}692}
716693
717static __inline__ __m512i __DEFAULT_FN_ATTRS512694static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
718_mm512_andnot_epi64(__m512i __A, __m512i __B)695_mm512_andnot_epi64(__m512i __A, __m512i __B)
719{696{
720 return (__m512i)(~(__v8du)__A & (__v8du)__B);697 return (__m512i)(~(__v8du)__A & (__v8du)__B);
...@@ -735,7 +712,7 @@ _mm512_maskz_andnot_epi64(__mmask8 __U, __m512i __A, __m512i __B)...@@ -735,7 +712,7 @@ _mm512_maskz_andnot_epi64(__mmask8 __U, __m512i __A, __m512i __B)
735 __U, __A, __B);712 __U, __A, __B);
736}713}
737714
738static __inline__ __m512i __DEFAULT_FN_ATTRS512715static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
739_mm512_or_epi32(__m512i __a, __m512i __b)716_mm512_or_epi32(__m512i __a, __m512i __b)
740{717{
741 return (__m512i)((__v16su)__a | (__v16su)__b);718 return (__m512i)((__v16su)__a | (__v16su)__b);
...@@ -755,7 +732,7 @@ _mm512_maskz_or_epi32(__mmask16 __k, __m512i __a, __m512i __b)...@@ -755,7 +732,7 @@ _mm512_maskz_or_epi32(__mmask16 __k, __m512i __a, __m512i __b)
755 return (__m512i)_mm512_mask_or_epi32(_mm512_setzero_si512(), __k, __a, __b);732 return (__m512i)_mm512_mask_or_epi32(_mm512_setzero_si512(), __k, __a, __b);
756}733}
757734
758static __inline__ __m512i __DEFAULT_FN_ATTRS512735static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
759_mm512_or_epi64(__m512i __a, __m512i __b)736_mm512_or_epi64(__m512i __a, __m512i __b)
760{737{
761 return (__m512i)((__v8du)__a | (__v8du)__b);738 return (__m512i)((__v8du)__a | (__v8du)__b);
...@@ -775,7 +752,7 @@ _mm512_maskz_or_epi64(__mmask8 __k, __m512i __a, __m512i __b)...@@ -775,7 +752,7 @@ _mm512_maskz_or_epi64(__mmask8 __k, __m512i __a, __m512i __b)
775 return (__m512i)_mm512_mask_or_epi64(_mm512_setzero_si512(), __k, __a, __b);752 return (__m512i)_mm512_mask_or_epi64(_mm512_setzero_si512(), __k, __a, __b);
776}753}
777754
778static __inline__ __m512i __DEFAULT_FN_ATTRS512755static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
779_mm512_xor_epi32(__m512i __a, __m512i __b)756_mm512_xor_epi32(__m512i __a, __m512i __b)
780{757{
781 return (__m512i)((__v16su)__a ^ (__v16su)__b);758 return (__m512i)((__v16su)__a ^ (__v16su)__b);
...@@ -795,7 +772,7 @@ _mm512_maskz_xor_epi32(__mmask16 __k, __m512i __a, __m512i __b)...@@ -795,7 +772,7 @@ _mm512_maskz_xor_epi32(__mmask16 __k, __m512i __a, __m512i __b)
795 return (__m512i)_mm512_mask_xor_epi32(_mm512_setzero_si512(), __k, __a, __b);772 return (__m512i)_mm512_mask_xor_epi32(_mm512_setzero_si512(), __k, __a, __b);
796}773}
797774
798static __inline__ __m512i __DEFAULT_FN_ATTRS512775static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
799_mm512_xor_epi64(__m512i __a, __m512i __b)776_mm512_xor_epi64(__m512i __a, __m512i __b)
800{777{
801 return (__m512i)((__v8du)__a ^ (__v8du)__b);778 return (__m512i)((__v8du)__a ^ (__v8du)__b);
...@@ -815,19 +792,19 @@ _mm512_maskz_xor_epi64(__mmask8 __k, __m512i __a, __m512i __b)...@@ -815,19 +792,19 @@ _mm512_maskz_xor_epi64(__mmask8 __k, __m512i __a, __m512i __b)
815 return (__m512i)_mm512_mask_xor_epi64(_mm512_setzero_si512(), __k, __a, __b);792 return (__m512i)_mm512_mask_xor_epi64(_mm512_setzero_si512(), __k, __a, __b);
816}793}
817794
818static __inline__ __m512i __DEFAULT_FN_ATTRS512795static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
819_mm512_and_si512(__m512i __a, __m512i __b)796_mm512_and_si512(__m512i __a, __m512i __b)
820{797{
821 return (__m512i)((__v8du)__a & (__v8du)__b);798 return (__m512i)((__v8du)__a & (__v8du)__b);
822}799}
823800
824static __inline__ __m512i __DEFAULT_FN_ATTRS512801static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
825_mm512_or_si512(__m512i __a, __m512i __b)802_mm512_or_si512(__m512i __a, __m512i __b)
826{803{
827 return (__m512i)((__v8du)__a | (__v8du)__b);804 return (__m512i)((__v8du)__a | (__v8du)__b);
828}805}
829806
830static __inline__ __m512i __DEFAULT_FN_ATTRS512807static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
831_mm512_xor_si512(__m512i __a, __m512i __b)808_mm512_xor_si512(__m512i __a, __m512i __b)
832{809{
833 return (__m512i)((__v8du)__a ^ (__v8du)__b);810 return (__m512i)((__v8du)__a ^ (__v8du)__b);
...@@ -835,125 +812,107 @@ _mm512_xor_si512(__m512i __a, __m512i __b)...@@ -835,125 +812,107 @@ _mm512_xor_si512(__m512i __a, __m512i __b)
835812
836/* Arithmetic */813/* Arithmetic */
837814
838static __inline __m512d __DEFAULT_FN_ATTRS512815static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
839_mm512_add_pd(__m512d __a, __m512d __b)816_mm512_add_pd(__m512d __a, __m512d __b) {
840{
841 return (__m512d)((__v8df)__a + (__v8df)__b);817 return (__m512d)((__v8df)__a + (__v8df)__b);
842}818}
843819
844static __inline __m512 __DEFAULT_FN_ATTRS512820static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
845_mm512_add_ps(__m512 __a, __m512 __b)821_mm512_add_ps(__m512 __a, __m512 __b) {
846{
847 return (__m512)((__v16sf)__a + (__v16sf)__b);822 return (__m512)((__v16sf)__a + (__v16sf)__b);
848}823}
849824
850static __inline __m512d __DEFAULT_FN_ATTRS512825static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
851_mm512_mul_pd(__m512d __a, __m512d __b)826_mm512_mul_pd(__m512d __a, __m512d __b) {
852{
853 return (__m512d)((__v8df)__a * (__v8df)__b);827 return (__m512d)((__v8df)__a * (__v8df)__b);
854}828}
855829
856static __inline __m512 __DEFAULT_FN_ATTRS512830static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
857_mm512_mul_ps(__m512 __a, __m512 __b)831_mm512_mul_ps(__m512 __a, __m512 __b) {
858{
859 return (__m512)((__v16sf)__a * (__v16sf)__b);832 return (__m512)((__v16sf)__a * (__v16sf)__b);
860}833}
861834
862static __inline __m512d __DEFAULT_FN_ATTRS512835static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
863_mm512_sub_pd(__m512d __a, __m512d __b)836_mm512_sub_pd(__m512d __a, __m512d __b) {
864{
865 return (__m512d)((__v8df)__a - (__v8df)__b);837 return (__m512d)((__v8df)__a - (__v8df)__b);
866}838}
867839
868static __inline __m512 __DEFAULT_FN_ATTRS512840static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
869_mm512_sub_ps(__m512 __a, __m512 __b)841_mm512_sub_ps(__m512 __a, __m512 __b) {
870{
871 return (__m512)((__v16sf)__a - (__v16sf)__b);842 return (__m512)((__v16sf)__a - (__v16sf)__b);
872}843}
873844
874static __inline__ __m512i __DEFAULT_FN_ATTRS512845static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
875_mm512_add_epi64 (__m512i __A, __m512i __B)846_mm512_add_epi64(__m512i __A, __m512i __B) {
876{
877 return (__m512i) ((__v8du) __A + (__v8du) __B);847 return (__m512i) ((__v8du) __A + (__v8du) __B);
878}848}
879849
880static __inline__ __m512i __DEFAULT_FN_ATTRS512850static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
881_mm512_mask_add_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)851_mm512_mask_add_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {
882{
883 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,852 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
884 (__v8di)_mm512_add_epi64(__A, __B),853 (__v8di)_mm512_add_epi64(__A, __B),
885 (__v8di)__W);854 (__v8di)__W);
886}855}
887856
888static __inline__ __m512i __DEFAULT_FN_ATTRS512857static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
889_mm512_maskz_add_epi64(__mmask8 __U, __m512i __A, __m512i __B)858_mm512_maskz_add_epi64(__mmask8 __U, __m512i __A, __m512i __B) {
890{
891 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,859 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
892 (__v8di)_mm512_add_epi64(__A, __B),860 (__v8di)_mm512_add_epi64(__A, __B),
893 (__v8di)_mm512_setzero_si512());861 (__v8di)_mm512_setzero_si512());
894}862}
895863
896static __inline__ __m512i __DEFAULT_FN_ATTRS512864static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
897_mm512_sub_epi64 (__m512i __A, __m512i __B)865_mm512_sub_epi64(__m512i __A, __m512i __B) {
898{
899 return (__m512i) ((__v8du) __A - (__v8du) __B);866 return (__m512i) ((__v8du) __A - (__v8du) __B);
900}867}
901868
902static __inline__ __m512i __DEFAULT_FN_ATTRS512869static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
903_mm512_mask_sub_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)870_mm512_mask_sub_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {
904{
905 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,871 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
906 (__v8di)_mm512_sub_epi64(__A, __B),872 (__v8di)_mm512_sub_epi64(__A, __B),
907 (__v8di)__W);873 (__v8di)__W);
908}874}
909875
910static __inline__ __m512i __DEFAULT_FN_ATTRS512876static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
911_mm512_maskz_sub_epi64(__mmask8 __U, __m512i __A, __m512i __B)877_mm512_maskz_sub_epi64(__mmask8 __U, __m512i __A, __m512i __B) {
912{
913 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,878 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
914 (__v8di)_mm512_sub_epi64(__A, __B),879 (__v8di)_mm512_sub_epi64(__A, __B),
915 (__v8di)_mm512_setzero_si512());880 (__v8di)_mm512_setzero_si512());
916}881}
917882
918static __inline__ __m512i __DEFAULT_FN_ATTRS512883static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
919_mm512_add_epi32 (__m512i __A, __m512i __B)884_mm512_add_epi32(__m512i __A, __m512i __B) {
920{
921 return (__m512i) ((__v16su) __A + (__v16su) __B);885 return (__m512i) ((__v16su) __A + (__v16su) __B);
922}886}
923887
924static __inline__ __m512i __DEFAULT_FN_ATTRS512888static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
925_mm512_mask_add_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)889_mm512_mask_add_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) {
926{
927 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,890 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
928 (__v16si)_mm512_add_epi32(__A, __B),891 (__v16si)_mm512_add_epi32(__A, __B),
929 (__v16si)__W);892 (__v16si)__W);
930}893}
931894
932static __inline__ __m512i __DEFAULT_FN_ATTRS512895static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
933_mm512_maskz_add_epi32 (__mmask16 __U, __m512i __A, __m512i __B)896_mm512_maskz_add_epi32(__mmask16 __U, __m512i __A, __m512i __B) {
934{
935 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,897 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
936 (__v16si)_mm512_add_epi32(__A, __B),898 (__v16si)_mm512_add_epi32(__A, __B),
937 (__v16si)_mm512_setzero_si512());899 (__v16si)_mm512_setzero_si512());
938}900}
939901
940static __inline__ __m512i __DEFAULT_FN_ATTRS512902static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
941_mm512_sub_epi32 (__m512i __A, __m512i __B)903_mm512_sub_epi32(__m512i __A, __m512i __B) {
942{
943 return (__m512i) ((__v16su) __A - (__v16su) __B);904 return (__m512i) ((__v16su) __A - (__v16su) __B);
944}905}
945906
946static __inline__ __m512i __DEFAULT_FN_ATTRS512907static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
947_mm512_mask_sub_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)908_mm512_mask_sub_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) {
948{
949 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,909 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
950 (__v16si)_mm512_sub_epi32(__A, __B),910 (__v16si)_mm512_sub_epi32(__A, __B),
951 (__v16si)__W);911 (__v16si)__W);
952}912}
953913
954static __inline__ __m512i __DEFAULT_FN_ATTRS512914static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
955_mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B)915_mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B) {
956{
957 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,916 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
958 (__v16si)_mm512_sub_epi32(__A, __B),917 (__v16si)_mm512_sub_epi32(__A, __B),
959 (__v16si)_mm512_setzero_si512());918 (__v16si)_mm512_setzero_si512());
...@@ -973,24 +932,21 @@ _mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B)...@@ -973,24 +932,21 @@ _mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B)
973 (__v8df)_mm512_max_round_pd((A), (B), (R)), \932 (__v8df)_mm512_max_round_pd((A), (B), (R)), \
974 (__v8df)_mm512_setzero_pd()))933 (__v8df)_mm512_setzero_pd()))
975934
976static __inline__ __m512d __DEFAULT_FN_ATTRS512935static __inline__ __m512d
977_mm512_max_pd(__m512d __A, __m512d __B)936 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_max_pd(__m512d __A, __m512d __B) {
978{
979 return (__m512d) __builtin_ia32_maxpd512((__v8df) __A, (__v8df) __B,937 return (__m512d) __builtin_ia32_maxpd512((__v8df) __A, (__v8df) __B,
980 _MM_FROUND_CUR_DIRECTION);938 _MM_FROUND_CUR_DIRECTION);
981}939}
982940
983static __inline__ __m512d __DEFAULT_FN_ATTRS512941static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
984_mm512_mask_max_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)942_mm512_mask_max_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
985{
986 return (__m512d)__builtin_ia32_selectpd_512(__U,943 return (__m512d)__builtin_ia32_selectpd_512(__U,
987 (__v8df)_mm512_max_pd(__A, __B),944 (__v8df)_mm512_max_pd(__A, __B),
988 (__v8df)__W);945 (__v8df)__W);
989}946}
990947
991static __inline__ __m512d __DEFAULT_FN_ATTRS512948static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
992_mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B)949_mm512_maskz_max_pd(__mmask8 __U, __m512d __A, __m512d __B) {
993{
994 return (__m512d)__builtin_ia32_selectpd_512(__U,950 return (__m512d)__builtin_ia32_selectpd_512(__U,
995 (__v8df)_mm512_max_pd(__A, __B),951 (__v8df)_mm512_max_pd(__A, __B),
996 (__v8df)_mm512_setzero_pd());952 (__v8df)_mm512_setzero_pd());
...@@ -1010,31 +966,30 @@ _mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B)...@@ -1010,31 +966,30 @@ _mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B)
1010 (__v16sf)_mm512_max_round_ps((A), (B), (R)), \966 (__v16sf)_mm512_max_round_ps((A), (B), (R)), \
1011 (__v16sf)_mm512_setzero_ps()))967 (__v16sf)_mm512_setzero_ps()))
1012968
1013static __inline__ __m512 __DEFAULT_FN_ATTRS512969static __inline__ __m512
1014_mm512_max_ps(__m512 __A, __m512 __B)970 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_max_ps(__m512 __A, __m512 __B) {
1015{
1016 return (__m512) __builtin_ia32_maxps512((__v16sf) __A, (__v16sf) __B,971 return (__m512) __builtin_ia32_maxps512((__v16sf) __A, (__v16sf) __B,
1017 _MM_FROUND_CUR_DIRECTION);972 _MM_FROUND_CUR_DIRECTION);
1018}973}
1019974
1020static __inline__ __m512 __DEFAULT_FN_ATTRS512975static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1021_mm512_mask_max_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)976_mm512_mask_max_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
1022{
1023 return (__m512)__builtin_ia32_selectps_512(__U,977 return (__m512)__builtin_ia32_selectps_512(__U,
1024 (__v16sf)_mm512_max_ps(__A, __B),978 (__v16sf)_mm512_max_ps(__A, __B),
1025 (__v16sf)__W);979 (__v16sf)__W);
1026}980}
1027981
1028static __inline__ __m512 __DEFAULT_FN_ATTRS512982static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1029_mm512_maskz_max_ps (__mmask16 __U, __m512 __A, __m512 __B)983_mm512_maskz_max_ps(__mmask16 __U, __m512 __A, __m512 __B) {
1030{
1031 return (__m512)__builtin_ia32_selectps_512(__U,984 return (__m512)__builtin_ia32_selectps_512(__U,
1032 (__v16sf)_mm512_max_ps(__A, __B),985 (__v16sf)_mm512_max_ps(__A, __B),
1033 (__v16sf)_mm512_setzero_ps());986 (__v16sf)_mm512_setzero_ps());
1034}987}
1035988
1036static __inline__ __m128 __DEFAULT_FN_ATTRS128989static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_max_ss(__m128 __W,
1037_mm_mask_max_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {990 __mmask8 __U,
991 __m128 __A,
992 __m128 __B) {
1038 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,993 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,
1039 (__v4sf) __B,994 (__v4sf) __B,
1040 (__v4sf) __W,995 (__v4sf) __W,
...@@ -1042,8 +997,9 @@ _mm_mask_max_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {...@@ -1042,8 +997,9 @@ _mm_mask_max_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
1042 _MM_FROUND_CUR_DIRECTION);997 _MM_FROUND_CUR_DIRECTION);
1043}998}
1044999
1045static __inline__ __m128 __DEFAULT_FN_ATTRS1281000static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_max_ss(__mmask8 __U,
1046_mm_maskz_max_ss(__mmask8 __U,__m128 __A, __m128 __B) {1001 __m128 __A,
1002 __m128 __B) {
1047 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,1003 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,
1048 (__v4sf) __B,1004 (__v4sf) __B,
1049 (__v4sf) _mm_setzero_ps (),1005 (__v4sf) _mm_setzero_ps (),
...@@ -1069,8 +1025,10 @@ _mm_maskz_max_ss(__mmask8 __U,__m128 __A, __m128 __B) {...@@ -1069,8 +1025,10 @@ _mm_maskz_max_ss(__mmask8 __U,__m128 __A, __m128 __B) {
1069 (__v4sf)_mm_setzero_ps(), \1025 (__v4sf)_mm_setzero_ps(), \
1070 (__mmask8)(U), (int)(R)))1026 (__mmask8)(U), (int)(R)))
10711027
1072static __inline__ __m128d __DEFAULT_FN_ATTRS1281028static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_max_sd(__m128d __W,
1073_mm_mask_max_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {1029 __mmask8 __U,
1030 __m128d __A,
1031 __m128d __B) {
1074 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,1032 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,
1075 (__v2df) __B,1033 (__v2df) __B,
1076 (__v2df) __W,1034 (__v2df) __W,
...@@ -1078,8 +1036,9 @@ _mm_mask_max_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {...@@ -1078,8 +1036,9 @@ _mm_mask_max_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
1078 _MM_FROUND_CUR_DIRECTION);1036 _MM_FROUND_CUR_DIRECTION);
1079}1037}
10801038
1081static __inline__ __m128d __DEFAULT_FN_ATTRS1281039static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_maskz_max_sd(__mmask8 __U,
1082_mm_maskz_max_sd(__mmask8 __U,__m128d __A, __m128d __B) {1040 __m128d __A,
1041 __m128d __B) {
1083 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,1042 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,
1084 (__v2df) __B,1043 (__v2df) __B,
1085 (__v2df) _mm_setzero_pd (),1044 (__v2df) _mm_setzero_pd (),
...@@ -1106,89 +1065,76 @@ _mm_maskz_max_sd(__mmask8 __U,__m128d __A, __m128d __B) {...@@ -1106,89 +1065,76 @@ _mm_maskz_max_sd(__mmask8 __U,__m128d __A, __m128d __B) {
1106 (__mmask8)(U), (int)(R)))1065 (__mmask8)(U), (int)(R)))
11071066
1108static __inline __m512i1067static __inline __m512i
1109__DEFAULT_FN_ATTRS5121068 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_max_epi32(__m512i __A, __m512i __B) {
1110_mm512_max_epi32(__m512i __A, __m512i __B)
1111{
1112 return (__m512i)__builtin_elementwise_max((__v16si)__A, (__v16si)__B);1069 return (__m512i)__builtin_elementwise_max((__v16si)__A, (__v16si)__B);
1113}1070}
11141071
1115static __inline__ __m512i __DEFAULT_FN_ATTRS5121072static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1116_mm512_mask_max_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)1073_mm512_mask_max_epi32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) {
1117{
1118 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1074 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1119 (__v16si)_mm512_max_epi32(__A, __B),1075 (__v16si)_mm512_max_epi32(__A, __B),
1120 (__v16si)__W);1076 (__v16si)__W);
1121}1077}
11221078
1123static __inline__ __m512i __DEFAULT_FN_ATTRS5121079static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1124_mm512_maskz_max_epi32 (__mmask16 __M, __m512i __A, __m512i __B)1080_mm512_maskz_max_epi32(__mmask16 __M, __m512i __A, __m512i __B) {
1125{
1126 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1081 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1127 (__v16si)_mm512_max_epi32(__A, __B),1082 (__v16si)_mm512_max_epi32(__A, __B),
1128 (__v16si)_mm512_setzero_si512());1083 (__v16si)_mm512_setzero_si512());
1129}1084}
11301085
1131static __inline __m512i __DEFAULT_FN_ATTRS5121086static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1132_mm512_max_epu32(__m512i __A, __m512i __B)1087_mm512_max_epu32(__m512i __A, __m512i __B) {
1133{
1134 return (__m512i)__builtin_elementwise_max((__v16su)__A, (__v16su)__B);1088 return (__m512i)__builtin_elementwise_max((__v16su)__A, (__v16su)__B);
1135}1089}
11361090
1137static __inline__ __m512i __DEFAULT_FN_ATTRS5121091static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1138_mm512_mask_max_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)1092_mm512_mask_max_epu32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) {
1139{
1140 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1093 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1141 (__v16si)_mm512_max_epu32(__A, __B),1094 (__v16si)_mm512_max_epu32(__A, __B),
1142 (__v16si)__W);1095 (__v16si)__W);
1143}1096}
11441097
1145static __inline__ __m512i __DEFAULT_FN_ATTRS5121098static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1146_mm512_maskz_max_epu32 (__mmask16 __M, __m512i __A, __m512i __B)1099_mm512_maskz_max_epu32(__mmask16 __M, __m512i __A, __m512i __B) {
1147{
1148 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1100 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1149 (__v16si)_mm512_max_epu32(__A, __B),1101 (__v16si)_mm512_max_epu32(__A, __B),
1150 (__v16si)_mm512_setzero_si512());1102 (__v16si)_mm512_setzero_si512());
1151}1103}
11521104
1153static __inline __m512i __DEFAULT_FN_ATTRS5121105static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1154_mm512_max_epi64(__m512i __A, __m512i __B)1106_mm512_max_epi64(__m512i __A, __m512i __B) {
1155{
1156 return (__m512i)__builtin_elementwise_max((__v8di)__A, (__v8di)__B);1107 return (__m512i)__builtin_elementwise_max((__v8di)__A, (__v8di)__B);
1157}1108}
11581109
1159static __inline__ __m512i __DEFAULT_FN_ATTRS5121110static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1160_mm512_mask_max_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)1111_mm512_mask_max_epi64(__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) {
1161{
1162 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1112 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1163 (__v8di)_mm512_max_epi64(__A, __B),1113 (__v8di)_mm512_max_epi64(__A, __B),
1164 (__v8di)__W);1114 (__v8di)__W);
1165}1115}
11661116
1167static __inline__ __m512i __DEFAULT_FN_ATTRS5121117static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1168_mm512_maskz_max_epi64 (__mmask8 __M, __m512i __A, __m512i __B)1118_mm512_maskz_max_epi64(__mmask8 __M, __m512i __A, __m512i __B) {
1169{
1170 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1119 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1171 (__v8di)_mm512_max_epi64(__A, __B),1120 (__v8di)_mm512_max_epi64(__A, __B),
1172 (__v8di)_mm512_setzero_si512());1121 (__v8di)_mm512_setzero_si512());
1173}1122}
11741123
1175static __inline __m512i __DEFAULT_FN_ATTRS5121124static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1176_mm512_max_epu64(__m512i __A, __m512i __B)1125_mm512_max_epu64(__m512i __A, __m512i __B) {
1177{
1178 return (__m512i)__builtin_elementwise_max((__v8du)__A, (__v8du)__B);1126 return (__m512i)__builtin_elementwise_max((__v8du)__A, (__v8du)__B);
1179}1127}
11801128
1181static __inline__ __m512i __DEFAULT_FN_ATTRS5121129static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1182_mm512_mask_max_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)1130_mm512_mask_max_epu64(__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) {
1183{
1184 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1131 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1185 (__v8di)_mm512_max_epu64(__A, __B),1132 (__v8di)_mm512_max_epu64(__A, __B),
1186 (__v8di)__W);1133 (__v8di)__W);
1187}1134}
11881135
1189static __inline__ __m512i __DEFAULT_FN_ATTRS5121136static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1190_mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B)1137_mm512_maskz_max_epu64(__mmask8 __M, __m512i __A, __m512i __B) {
1191{
1192 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1138 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1193 (__v8di)_mm512_max_epu64(__A, __B),1139 (__v8di)_mm512_max_epu64(__A, __B),
1194 (__v8di)_mm512_setzero_si512());1140 (__v8di)_mm512_setzero_si512());
...@@ -1208,24 +1154,21 @@ _mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B)...@@ -1208,24 +1154,21 @@ _mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B)
1208 (__v8df)_mm512_min_round_pd((A), (B), (R)), \1154 (__v8df)_mm512_min_round_pd((A), (B), (R)), \
1209 (__v8df)_mm512_setzero_pd()))1155 (__v8df)_mm512_setzero_pd()))
12101156
1211static __inline__ __m512d __DEFAULT_FN_ATTRS5121157static __inline__ __m512d
1212_mm512_min_pd(__m512d __A, __m512d __B)1158 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_min_pd(__m512d __A, __m512d __B) {
1213{
1214 return (__m512d) __builtin_ia32_minpd512((__v8df) __A, (__v8df) __B,1159 return (__m512d) __builtin_ia32_minpd512((__v8df) __A, (__v8df) __B,
1215 _MM_FROUND_CUR_DIRECTION);1160 _MM_FROUND_CUR_DIRECTION);
1216}1161}
12171162
1218static __inline__ __m512d __DEFAULT_FN_ATTRS5121163static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1219_mm512_mask_min_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)1164_mm512_mask_min_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
1220{
1221 return (__m512d)__builtin_ia32_selectpd_512(__U,1165 return (__m512d)__builtin_ia32_selectpd_512(__U,
1222 (__v8df)_mm512_min_pd(__A, __B),1166 (__v8df)_mm512_min_pd(__A, __B),
1223 (__v8df)__W);1167 (__v8df)__W);
1224}1168}
12251169
1226static __inline__ __m512d __DEFAULT_FN_ATTRS5121170static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1227_mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B)1171_mm512_maskz_min_pd(__mmask8 __U, __m512d __A, __m512d __B) {
1228{
1229 return (__m512d)__builtin_ia32_selectpd_512(__U,1172 return (__m512d)__builtin_ia32_selectpd_512(__U,
1230 (__v8df)_mm512_min_pd(__A, __B),1173 (__v8df)_mm512_min_pd(__A, __B),
1231 (__v8df)_mm512_setzero_pd());1174 (__v8df)_mm512_setzero_pd());
...@@ -1245,31 +1188,30 @@ _mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B)...@@ -1245,31 +1188,30 @@ _mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B)
1245 (__v16sf)_mm512_min_round_ps((A), (B), (R)), \1188 (__v16sf)_mm512_min_round_ps((A), (B), (R)), \
1246 (__v16sf)_mm512_setzero_ps()))1189 (__v16sf)_mm512_setzero_ps()))
12471190
1248static __inline__ __m512 __DEFAULT_FN_ATTRS5121191static __inline__ __m512
1249_mm512_min_ps(__m512 __A, __m512 __B)1192 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_min_ps(__m512 __A, __m512 __B) {
1250{
1251 return (__m512) __builtin_ia32_minps512((__v16sf) __A, (__v16sf) __B,1193 return (__m512) __builtin_ia32_minps512((__v16sf) __A, (__v16sf) __B,
1252 _MM_FROUND_CUR_DIRECTION);1194 _MM_FROUND_CUR_DIRECTION);
1253}1195}
12541196
1255static __inline__ __m512 __DEFAULT_FN_ATTRS5121197static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1256_mm512_mask_min_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)1198_mm512_mask_min_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
1257{
1258 return (__m512)__builtin_ia32_selectps_512(__U,1199 return (__m512)__builtin_ia32_selectps_512(__U,
1259 (__v16sf)_mm512_min_ps(__A, __B),1200 (__v16sf)_mm512_min_ps(__A, __B),
1260 (__v16sf)__W);1201 (__v16sf)__W);
1261}1202}
12621203
1263static __inline__ __m512 __DEFAULT_FN_ATTRS5121204static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1264_mm512_maskz_min_ps (__mmask16 __U, __m512 __A, __m512 __B)1205_mm512_maskz_min_ps(__mmask16 __U, __m512 __A, __m512 __B) {
1265{
1266 return (__m512)__builtin_ia32_selectps_512(__U,1206 return (__m512)__builtin_ia32_selectps_512(__U,
1267 (__v16sf)_mm512_min_ps(__A, __B),1207 (__v16sf)_mm512_min_ps(__A, __B),
1268 (__v16sf)_mm512_setzero_ps());1208 (__v16sf)_mm512_setzero_ps());
1269}1209}
12701210
1271static __inline__ __m128 __DEFAULT_FN_ATTRS1281211static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_min_ss(__m128 __W,
1272_mm_mask_min_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {1212 __mmask8 __U,
1213 __m128 __A,
1214 __m128 __B) {
1273 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,1215 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,
1274 (__v4sf) __B,1216 (__v4sf) __B,
1275 (__v4sf) __W,1217 (__v4sf) __W,
...@@ -1277,8 +1219,9 @@ _mm_mask_min_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {...@@ -1277,8 +1219,9 @@ _mm_mask_min_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
1277 _MM_FROUND_CUR_DIRECTION);1219 _MM_FROUND_CUR_DIRECTION);
1278}1220}
12791221
1280static __inline__ __m128 __DEFAULT_FN_ATTRS1281222static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_min_ss(__mmask8 __U,
1281_mm_maskz_min_ss(__mmask8 __U,__m128 __A, __m128 __B) {1223 __m128 __A,
1224 __m128 __B) {
1282 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,1225 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,
1283 (__v4sf) __B,1226 (__v4sf) __B,
1284 (__v4sf) _mm_setzero_ps (),1227 (__v4sf) _mm_setzero_ps (),
...@@ -1304,8 +1247,10 @@ _mm_maskz_min_ss(__mmask8 __U,__m128 __A, __m128 __B) {...@@ -1304,8 +1247,10 @@ _mm_maskz_min_ss(__mmask8 __U,__m128 __A, __m128 __B) {
1304 (__v4sf)_mm_setzero_ps(), \1247 (__v4sf)_mm_setzero_ps(), \
1305 (__mmask8)(U), (int)(R)))1248 (__mmask8)(U), (int)(R)))
13061249
1307static __inline__ __m128d __DEFAULT_FN_ATTRS1281250static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_min_sd(__m128d __W,
1308_mm_mask_min_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {1251 __mmask8 __U,
1252 __m128d __A,
1253 __m128d __B) {
1309 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,1254 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,
1310 (__v2df) __B,1255 (__v2df) __B,
1311 (__v2df) __W,1256 (__v2df) __W,
...@@ -1313,8 +1258,9 @@ _mm_mask_min_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {...@@ -1313,8 +1258,9 @@ _mm_mask_min_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
1313 _MM_FROUND_CUR_DIRECTION);1258 _MM_FROUND_CUR_DIRECTION);
1314}1259}
13151260
1316static __inline__ __m128d __DEFAULT_FN_ATTRS1281261static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_maskz_min_sd(__mmask8 __U,
1317_mm_maskz_min_sd(__mmask8 __U,__m128d __A, __m128d __B) {1262 __m128d __A,
1263 __m128d __B) {
1318 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,1264 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,
1319 (__v2df) __B,1265 (__v2df) __B,
1320 (__v2df) _mm_setzero_pd (),1266 (__v2df) _mm_setzero_pd (),
...@@ -1341,166 +1287,144 @@ _mm_maskz_min_sd(__mmask8 __U,__m128d __A, __m128d __B) {...@@ -1341,166 +1287,144 @@ _mm_maskz_min_sd(__mmask8 __U,__m128d __A, __m128d __B) {
1341 (__mmask8)(U), (int)(R)))1287 (__mmask8)(U), (int)(R)))
13421288
1343static __inline __m512i1289static __inline __m512i
1344__DEFAULT_FN_ATTRS5121290 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_min_epi32(__m512i __A, __m512i __B) {
1345_mm512_min_epi32(__m512i __A, __m512i __B)
1346{
1347 return (__m512i)__builtin_elementwise_min((__v16si)__A, (__v16si)__B);1291 return (__m512i)__builtin_elementwise_min((__v16si)__A, (__v16si)__B);
1348}1292}
13491293
1350static __inline__ __m512i __DEFAULT_FN_ATTRS5121294static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1351_mm512_mask_min_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)1295_mm512_mask_min_epi32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) {
1352{
1353 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1296 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1354 (__v16si)_mm512_min_epi32(__A, __B),1297 (__v16si)_mm512_min_epi32(__A, __B),
1355 (__v16si)__W);1298 (__v16si)__W);
1356}1299}
13571300
1358static __inline__ __m512i __DEFAULT_FN_ATTRS5121301static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1359_mm512_maskz_min_epi32 (__mmask16 __M, __m512i __A, __m512i __B)1302_mm512_maskz_min_epi32(__mmask16 __M, __m512i __A, __m512i __B) {
1360{
1361 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1303 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1362 (__v16si)_mm512_min_epi32(__A, __B),1304 (__v16si)_mm512_min_epi32(__A, __B),
1363 (__v16si)_mm512_setzero_si512());1305 (__v16si)_mm512_setzero_si512());
1364}1306}
13651307
1366static __inline __m512i __DEFAULT_FN_ATTRS5121308static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1367_mm512_min_epu32(__m512i __A, __m512i __B)1309_mm512_min_epu32(__m512i __A, __m512i __B) {
1368{
1369 return (__m512i)__builtin_elementwise_min((__v16su)__A, (__v16su)__B);1310 return (__m512i)__builtin_elementwise_min((__v16su)__A, (__v16su)__B);
1370}1311}
13711312
1372static __inline__ __m512i __DEFAULT_FN_ATTRS5121313static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1373_mm512_mask_min_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)1314_mm512_mask_min_epu32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) {
1374{
1375 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1315 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1376 (__v16si)_mm512_min_epu32(__A, __B),1316 (__v16si)_mm512_min_epu32(__A, __B),
1377 (__v16si)__W);1317 (__v16si)__W);
1378}1318}
13791319
1380static __inline__ __m512i __DEFAULT_FN_ATTRS5121320static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1381_mm512_maskz_min_epu32 (__mmask16 __M, __m512i __A, __m512i __B)1321_mm512_maskz_min_epu32(__mmask16 __M, __m512i __A, __m512i __B) {
1382{
1383 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1322 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1384 (__v16si)_mm512_min_epu32(__A, __B),1323 (__v16si)_mm512_min_epu32(__A, __B),
1385 (__v16si)_mm512_setzero_si512());1324 (__v16si)_mm512_setzero_si512());
1386}1325}
13871326
1388static __inline __m512i __DEFAULT_FN_ATTRS5121327static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1389_mm512_min_epi64(__m512i __A, __m512i __B)1328_mm512_min_epi64(__m512i __A, __m512i __B) {
1390{
1391 return (__m512i)__builtin_elementwise_min((__v8di)__A, (__v8di)__B);1329 return (__m512i)__builtin_elementwise_min((__v8di)__A, (__v8di)__B);
1392}1330}
13931331
1394static __inline__ __m512i __DEFAULT_FN_ATTRS5121332static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1395_mm512_mask_min_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)1333_mm512_mask_min_epi64(__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) {
1396{
1397 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1334 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1398 (__v8di)_mm512_min_epi64(__A, __B),1335 (__v8di)_mm512_min_epi64(__A, __B),
1399 (__v8di)__W);1336 (__v8di)__W);
1400}1337}
14011338
1402static __inline__ __m512i __DEFAULT_FN_ATTRS5121339static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1403_mm512_maskz_min_epi64 (__mmask8 __M, __m512i __A, __m512i __B)1340_mm512_maskz_min_epi64(__mmask8 __M, __m512i __A, __m512i __B) {
1404{
1405 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1341 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1406 (__v8di)_mm512_min_epi64(__A, __B),1342 (__v8di)_mm512_min_epi64(__A, __B),
1407 (__v8di)_mm512_setzero_si512());1343 (__v8di)_mm512_setzero_si512());
1408}1344}
14091345
1410static __inline __m512i __DEFAULT_FN_ATTRS5121346static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1411_mm512_min_epu64(__m512i __A, __m512i __B)1347_mm512_min_epu64(__m512i __A, __m512i __B) {
1412{
1413 return (__m512i)__builtin_elementwise_min((__v8du)__A, (__v8du)__B);1348 return (__m512i)__builtin_elementwise_min((__v8du)__A, (__v8du)__B);
1414}1349}
14151350
1416static __inline__ __m512i __DEFAULT_FN_ATTRS5121351static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1417_mm512_mask_min_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)1352_mm512_mask_min_epu64(__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) {
1418{
1419 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1353 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1420 (__v8di)_mm512_min_epu64(__A, __B),1354 (__v8di)_mm512_min_epu64(__A, __B),
1421 (__v8di)__W);1355 (__v8di)__W);
1422}1356}
14231357
1424static __inline__ __m512i __DEFAULT_FN_ATTRS5121358static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1425_mm512_maskz_min_epu64 (__mmask8 __M, __m512i __A, __m512i __B)1359_mm512_maskz_min_epu64(__mmask8 __M, __m512i __A, __m512i __B) {
1426{
1427 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1360 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1428 (__v8di)_mm512_min_epu64(__A, __B),1361 (__v8di)_mm512_min_epu64(__A, __B),
1429 (__v8di)_mm512_setzero_si512());1362 (__v8di)_mm512_setzero_si512());
1430}1363}
14311364
1432static __inline __m512i __DEFAULT_FN_ATTRS5121365static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1433_mm512_mul_epi32(__m512i __X, __m512i __Y)1366_mm512_mul_epi32(__m512i __X, __m512i __Y) {
1434{
1435 return (__m512i)__builtin_ia32_pmuldq512((__v16si)__X, (__v16si) __Y);1367 return (__m512i)__builtin_ia32_pmuldq512((__v16si)__X, (__v16si) __Y);
1436}1368}
14371369
1438static __inline __m512i __DEFAULT_FN_ATTRS5121370static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1439_mm512_mask_mul_epi32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)1371_mm512_mask_mul_epi32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) {
1440{
1441 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1372 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1442 (__v8di)_mm512_mul_epi32(__X, __Y),1373 (__v8di)_mm512_mul_epi32(__X, __Y),
1443 (__v8di)__W);1374 (__v8di)__W);
1444}1375}
14451376
1446static __inline __m512i __DEFAULT_FN_ATTRS5121377static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1447_mm512_maskz_mul_epi32(__mmask8 __M, __m512i __X, __m512i __Y)1378_mm512_maskz_mul_epi32(__mmask8 __M, __m512i __X, __m512i __Y) {
1448{
1449 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1379 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1450 (__v8di)_mm512_mul_epi32(__X, __Y),1380 (__v8di)_mm512_mul_epi32(__X, __Y),
1451 (__v8di)_mm512_setzero_si512 ());1381 (__v8di)_mm512_setzero_si512 ());
1452}1382}
14531383
1454static __inline __m512i __DEFAULT_FN_ATTRS5121384static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1455_mm512_mul_epu32(__m512i __X, __m512i __Y)1385_mm512_mul_epu32(__m512i __X, __m512i __Y) {
1456{
1457 return (__m512i)__builtin_ia32_pmuludq512((__v16si)__X, (__v16si)__Y);1386 return (__m512i)__builtin_ia32_pmuludq512((__v16si)__X, (__v16si)__Y);
1458}1387}
14591388
1460static __inline __m512i __DEFAULT_FN_ATTRS5121389static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1461_mm512_mask_mul_epu32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)1390_mm512_mask_mul_epu32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) {
1462{
1463 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1391 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1464 (__v8di)_mm512_mul_epu32(__X, __Y),1392 (__v8di)_mm512_mul_epu32(__X, __Y),
1465 (__v8di)__W);1393 (__v8di)__W);
1466}1394}
14671395
1468static __inline __m512i __DEFAULT_FN_ATTRS5121396static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1469_mm512_maskz_mul_epu32(__mmask8 __M, __m512i __X, __m512i __Y)1397_mm512_maskz_mul_epu32(__mmask8 __M, __m512i __X, __m512i __Y) {
1470{
1471 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,1398 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1472 (__v8di)_mm512_mul_epu32(__X, __Y),1399 (__v8di)_mm512_mul_epu32(__X, __Y),
1473 (__v8di)_mm512_setzero_si512 ());1400 (__v8di)_mm512_setzero_si512 ());
1474}1401}
14751402
1476static __inline __m512i __DEFAULT_FN_ATTRS5121403static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1477_mm512_mullo_epi32 (__m512i __A, __m512i __B)1404_mm512_mullo_epi32(__m512i __A, __m512i __B) {
1478{
1479 return (__m512i) ((__v16su) __A * (__v16su) __B);1405 return (__m512i) ((__v16su) __A * (__v16su) __B);
1480}1406}
14811407
1482static __inline __m512i __DEFAULT_FN_ATTRS5121408static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1483_mm512_maskz_mullo_epi32(__mmask16 __M, __m512i __A, __m512i __B)1409_mm512_maskz_mullo_epi32(__mmask16 __M, __m512i __A, __m512i __B) {
1484{
1485 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1410 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1486 (__v16si)_mm512_mullo_epi32(__A, __B),1411 (__v16si)_mm512_mullo_epi32(__A, __B),
1487 (__v16si)_mm512_setzero_si512());1412 (__v16si)_mm512_setzero_si512());
1488}1413}
14891414
1490static __inline __m512i __DEFAULT_FN_ATTRS5121415static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1491_mm512_mask_mullo_epi32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)1416_mm512_mask_mullo_epi32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) {
1492{
1493 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,1417 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1494 (__v16si)_mm512_mullo_epi32(__A, __B),1418 (__v16si)_mm512_mullo_epi32(__A, __B),
1495 (__v16si)__W);1419 (__v16si)__W);
1496}1420}
14971421
1498static __inline__ __m512i __DEFAULT_FN_ATTRS5121422static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1499_mm512_mullox_epi64 (__m512i __A, __m512i __B) {1423_mm512_mullox_epi64(__m512i __A, __m512i __B) {
1500 return (__m512i) ((__v8du) __A * (__v8du) __B);1424 return (__m512i) ((__v8du) __A * (__v8du) __B);
1501}1425}
15021426
1503static __inline__ __m512i __DEFAULT_FN_ATTRS5121427static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1504_mm512_mask_mullox_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {1428_mm512_mask_mullox_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {
1505 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,1429 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
1506 (__v8di)_mm512_mullox_epi64(__A, __B),1430 (__v8di)_mm512_mullox_epi64(__A, __B),
...@@ -1520,26 +1444,19 @@ _mm512_mask_mullox_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {...@@ -1520,26 +1444,19 @@ _mm512_mask_mullox_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {
1520 (__v8df)_mm512_sqrt_round_pd((A), (R)), \1444 (__v8df)_mm512_sqrt_round_pd((A), (R)), \
1521 (__v8df)_mm512_setzero_pd()))1445 (__v8df)_mm512_setzero_pd()))
15221446
1523static __inline__ __m512d __DEFAULT_FN_ATTRS5121447static __inline__ __m512d __DEFAULT_FN_ATTRS512 _mm512_sqrt_pd(__m512d __A) {
1524_mm512_sqrt_pd(__m512d __A)1448 return (__m512d)__builtin_elementwise_sqrt((__v8df)__A);
1525{
1526 return (__m512d)__builtin_ia32_sqrtpd512((__v8df)__A,
1527 _MM_FROUND_CUR_DIRECTION);
1528}1449}
15291450
1530static __inline__ __m512d __DEFAULT_FN_ATTRS5121451static __inline__ __m512d __DEFAULT_FN_ATTRS512
1531_mm512_mask_sqrt_pd (__m512d __W, __mmask8 __U, __m512d __A)1452_mm512_mask_sqrt_pd(__m512d __W, __mmask8 __U, __m512d __A) {
1532{1453 return (__m512d)__builtin_ia32_selectpd_512(__U, (__v8df)_mm512_sqrt_pd(__A),
1533 return (__m512d)__builtin_ia32_selectpd_512(__U,
1534 (__v8df)_mm512_sqrt_pd(__A),
1535 (__v8df)__W);1454 (__v8df)__W);
1536}1455}
15371456
1538static __inline__ __m512d __DEFAULT_FN_ATTRS5121457static __inline__ __m512d __DEFAULT_FN_ATTRS512
1539_mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A)1458_mm512_maskz_sqrt_pd(__mmask8 __U, __m512d __A) {
1540{1459 return (__m512d)__builtin_ia32_selectpd_512(__U, (__v8df)_mm512_sqrt_pd(__A),
1541 return (__m512d)__builtin_ia32_selectpd_512(__U,
1542 (__v8df)_mm512_sqrt_pd(__A),
1543 (__v8df)_mm512_setzero_pd());1460 (__v8df)_mm512_setzero_pd());
1544}1461}
15451462
...@@ -1556,26 +1473,19 @@ _mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A)...@@ -1556,26 +1473,19 @@ _mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A)
1556 (__v16sf)_mm512_sqrt_round_ps((A), (R)), \1473 (__v16sf)_mm512_sqrt_round_ps((A), (R)), \
1557 (__v16sf)_mm512_setzero_ps()))1474 (__v16sf)_mm512_setzero_ps()))
15581475
1559static __inline__ __m512 __DEFAULT_FN_ATTRS5121476static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_sqrt_ps(__m512 __A) {
1560_mm512_sqrt_ps(__m512 __A)1477 return (__m512)__builtin_elementwise_sqrt((__v16sf)__A);
1561{
1562 return (__m512)__builtin_ia32_sqrtps512((__v16sf)__A,
1563 _MM_FROUND_CUR_DIRECTION);
1564}1478}
15651479
1566static __inline__ __m512 __DEFAULT_FN_ATTRS5121480static __inline__ __m512 __DEFAULT_FN_ATTRS512
1567_mm512_mask_sqrt_ps(__m512 __W, __mmask16 __U, __m512 __A)1481_mm512_mask_sqrt_ps(__m512 __W, __mmask16 __U, __m512 __A) {
1568{1482 return (__m512)__builtin_ia32_selectps_512(__U, (__v16sf)_mm512_sqrt_ps(__A),
1569 return (__m512)__builtin_ia32_selectps_512(__U,
1570 (__v16sf)_mm512_sqrt_ps(__A),
1571 (__v16sf)__W);1483 (__v16sf)__W);
1572}1484}
15731485
1574static __inline__ __m512 __DEFAULT_FN_ATTRS5121486static __inline__ __m512 __DEFAULT_FN_ATTRS512
1575_mm512_maskz_sqrt_ps( __mmask16 __U, __m512 __A)1487_mm512_maskz_sqrt_ps(__mmask16 __U, __m512 __A) {
1576{1488 return (__m512)__builtin_ia32_selectps_512(__U, (__v16sf)_mm512_sqrt_ps(__A),
1577 return (__m512)__builtin_ia32_selectps_512(__U,
1578 (__v16sf)_mm512_sqrt_ps(__A),
1579 (__v16sf)_mm512_setzero_ps());1489 (__v16sf)_mm512_setzero_ps());
1580}1490}
15811491
...@@ -1866,58 +1776,52 @@ _mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A)...@@ -1866,58 +1776,52 @@ _mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A)
1866 _MM_FROUND_CUR_DIRECTION);1776 _MM_FROUND_CUR_DIRECTION);
1867}1777}
18681778
1869static __inline __m512i __DEFAULT_FN_ATTRS5121779static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1870_mm512_abs_epi64(__m512i __A)1780_mm512_abs_epi64(__m512i __A) {
1871{
1872 return (__m512i)__builtin_elementwise_abs((__v8di)__A);1781 return (__m512i)__builtin_elementwise_abs((__v8di)__A);
1873}1782}
18741783
1875static __inline__ __m512i __DEFAULT_FN_ATTRS5121784static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1876_mm512_mask_abs_epi64 (__m512i __W, __mmask8 __U, __m512i __A)1785_mm512_mask_abs_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
1877{
1878 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,1786 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
1879 (__v8di)_mm512_abs_epi64(__A),1787 (__v8di)_mm512_abs_epi64(__A),
1880 (__v8di)__W);1788 (__v8di)__W);
1881}1789}
18821790
1883static __inline__ __m512i __DEFAULT_FN_ATTRS5121791static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1884_mm512_maskz_abs_epi64 (__mmask8 __U, __m512i __A)1792_mm512_maskz_abs_epi64(__mmask8 __U, __m512i __A) {
1885{
1886 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,1793 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
1887 (__v8di)_mm512_abs_epi64(__A),1794 (__v8di)_mm512_abs_epi64(__A),
1888 (__v8di)_mm512_setzero_si512());1795 (__v8di)_mm512_setzero_si512());
1889}1796}
18901797
1891static __inline __m512i __DEFAULT_FN_ATTRS5121798static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1892_mm512_abs_epi32(__m512i __A)1799_mm512_abs_epi32(__m512i __A) {
1893{
1894 return (__m512i)__builtin_elementwise_abs((__v16si) __A);1800 return (__m512i)__builtin_elementwise_abs((__v16si) __A);
1895}1801}
18961802
1897static __inline__ __m512i __DEFAULT_FN_ATTRS5121803static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1898_mm512_mask_abs_epi32 (__m512i __W, __mmask16 __U, __m512i __A)1804_mm512_mask_abs_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
1899{
1900 return (__m512i)__builtin_ia32_selectd_512(__U,1805 return (__m512i)__builtin_ia32_selectd_512(__U,
1901 (__v16si)_mm512_abs_epi32(__A),1806 (__v16si)_mm512_abs_epi32(__A),
1902 (__v16si)__W);1807 (__v16si)__W);
1903}1808}
19041809
1905static __inline__ __m512i __DEFAULT_FN_ATTRS5121810static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
1906_mm512_maskz_abs_epi32 (__mmask16 __U, __m512i __A)1811_mm512_maskz_abs_epi32(__mmask16 __U, __m512i __A) {
1907{
1908 return (__m512i)__builtin_ia32_selectd_512(__U,1812 return (__m512i)__builtin_ia32_selectd_512(__U,
1909 (__v16si)_mm512_abs_epi32(__A),1813 (__v16si)_mm512_abs_epi32(__A),
1910 (__v16si)_mm512_setzero_si512());1814 (__v16si)_mm512_setzero_si512());
1911}1815}
19121816
1913static __inline__ __m128 __DEFAULT_FN_ATTRS1281817static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1914_mm_mask_add_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {1818_mm_mask_add_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
1915 __A = _mm_add_ss(__A, __B);1819 __A = _mm_add_ss(__A, __B);
1916 return __builtin_ia32_selectss_128(__U, __A, __W);1820 return __builtin_ia32_selectss_128(__U, __A, __W);
1917}1821}
19181822
1919static __inline__ __m128 __DEFAULT_FN_ATTRS1281823static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1920_mm_maskz_add_ss(__mmask8 __U,__m128 __A, __m128 __B) {1824_mm_maskz_add_ss(__mmask8 __U, __m128 __A, __m128 __B) {
1921 __A = _mm_add_ss(__A, __B);1825 __A = _mm_add_ss(__A, __B);
1922 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());1826 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
1923}1827}
...@@ -1940,14 +1844,14 @@ _mm_maskz_add_ss(__mmask8 __U,__m128 __A, __m128 __B) {...@@ -1940,14 +1844,14 @@ _mm_maskz_add_ss(__mmask8 __U,__m128 __A, __m128 __B) {
1940 (__v4sf)_mm_setzero_ps(), \1844 (__v4sf)_mm_setzero_ps(), \
1941 (__mmask8)(U), (int)(R)))1845 (__mmask8)(U), (int)(R)))
19421846
1943static __inline__ __m128d __DEFAULT_FN_ATTRS1281847static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1944_mm_mask_add_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {1848_mm_mask_add_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
1945 __A = _mm_add_sd(__A, __B);1849 __A = _mm_add_sd(__A, __B);
1946 return __builtin_ia32_selectsd_128(__U, __A, __W);1850 return __builtin_ia32_selectsd_128(__U, __A, __W);
1947}1851}
19481852
1949static __inline__ __m128d __DEFAULT_FN_ATTRS1281853static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1950_mm_maskz_add_sd(__mmask8 __U,__m128d __A, __m128d __B) {1854_mm_maskz_add_sd(__mmask8 __U, __m128d __A, __m128d __B) {
1951 __A = _mm_add_sd(__A, __B);1855 __A = _mm_add_sd(__A, __B);
1952 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());1856 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
1953}1857}
...@@ -1969,28 +1873,28 @@ _mm_maskz_add_sd(__mmask8 __U,__m128d __A, __m128d __B) {...@@ -1969,28 +1873,28 @@ _mm_maskz_add_sd(__mmask8 __U,__m128d __A, __m128d __B) {
1969 (__v2df)_mm_setzero_pd(), \1873 (__v2df)_mm_setzero_pd(), \
1970 (__mmask8)(U), (int)(R)))1874 (__mmask8)(U), (int)(R)))
19711875
1972static __inline__ __m512d __DEFAULT_FN_ATTRS5121876static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1973_mm512_mask_add_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {1877_mm512_mask_add_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
1974 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,1878 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
1975 (__v8df)_mm512_add_pd(__A, __B),1879 (__v8df)_mm512_add_pd(__A, __B),
1976 (__v8df)__W);1880 (__v8df)__W);
1977}1881}
19781882
1979static __inline__ __m512d __DEFAULT_FN_ATTRS5121883static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
1980_mm512_maskz_add_pd(__mmask8 __U, __m512d __A, __m512d __B) {1884_mm512_maskz_add_pd(__mmask8 __U, __m512d __A, __m512d __B) {
1981 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,1885 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
1982 (__v8df)_mm512_add_pd(__A, __B),1886 (__v8df)_mm512_add_pd(__A, __B),
1983 (__v8df)_mm512_setzero_pd());1887 (__v8df)_mm512_setzero_pd());
1984}1888}
19851889
1986static __inline__ __m512 __DEFAULT_FN_ATTRS5121890static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1987_mm512_mask_add_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {1891_mm512_mask_add_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
1988 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,1892 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
1989 (__v16sf)_mm512_add_ps(__A, __B),1893 (__v16sf)_mm512_add_ps(__A, __B),
1990 (__v16sf)__W);1894 (__v16sf)__W);
1991}1895}
19921896
1993static __inline__ __m512 __DEFAULT_FN_ATTRS5121897static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
1994_mm512_maskz_add_ps(__mmask16 __U, __m512 __A, __m512 __B) {1898_mm512_maskz_add_ps(__mmask16 __U, __m512 __A, __m512 __B) {
1995 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,1899 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
1996 (__v16sf)_mm512_add_ps(__A, __B),1900 (__v16sf)_mm512_add_ps(__A, __B),
...@@ -2025,14 +1929,14 @@ _mm512_maskz_add_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -2025,14 +1929,14 @@ _mm512_maskz_add_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2025 (__v16sf)_mm512_add_round_ps((A), (B), (R)), \1929 (__v16sf)_mm512_add_round_ps((A), (B), (R)), \
2026 (__v16sf)_mm512_setzero_ps()))1930 (__v16sf)_mm512_setzero_ps()))
20271931
2028static __inline__ __m128 __DEFAULT_FN_ATTRS1281932static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2029_mm_mask_sub_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {1933_mm_mask_sub_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2030 __A = _mm_sub_ss(__A, __B);1934 __A = _mm_sub_ss(__A, __B);
2031 return __builtin_ia32_selectss_128(__U, __A, __W);1935 return __builtin_ia32_selectss_128(__U, __A, __W);
2032}1936}
20331937
2034static __inline__ __m128 __DEFAULT_FN_ATTRS1281938static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2035_mm_maskz_sub_ss(__mmask8 __U,__m128 __A, __m128 __B) {1939_mm_maskz_sub_ss(__mmask8 __U, __m128 __A, __m128 __B) {
2036 __A = _mm_sub_ss(__A, __B);1940 __A = _mm_sub_ss(__A, __B);
2037 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());1941 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
2038}1942}
...@@ -2054,14 +1958,14 @@ _mm_maskz_sub_ss(__mmask8 __U,__m128 __A, __m128 __B) {...@@ -2054,14 +1958,14 @@ _mm_maskz_sub_ss(__mmask8 __U,__m128 __A, __m128 __B) {
2054 (__v4sf)_mm_setzero_ps(), \1958 (__v4sf)_mm_setzero_ps(), \
2055 (__mmask8)(U), (int)(R)))1959 (__mmask8)(U), (int)(R)))
20561960
2057static __inline__ __m128d __DEFAULT_FN_ATTRS1281961static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2058_mm_mask_sub_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {1962_mm_mask_sub_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2059 __A = _mm_sub_sd(__A, __B);1963 __A = _mm_sub_sd(__A, __B);
2060 return __builtin_ia32_selectsd_128(__U, __A, __W);1964 return __builtin_ia32_selectsd_128(__U, __A, __W);
2061}1965}
20621966
2063static __inline__ __m128d __DEFAULT_FN_ATTRS1281967static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2064_mm_maskz_sub_sd(__mmask8 __U,__m128d __A, __m128d __B) {1968_mm_maskz_sub_sd(__mmask8 __U, __m128d __A, __m128d __B) {
2065 __A = _mm_sub_sd(__A, __B);1969 __A = _mm_sub_sd(__A, __B);
2066 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());1970 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
2067}1971}
...@@ -2084,28 +1988,28 @@ _mm_maskz_sub_sd(__mmask8 __U,__m128d __A, __m128d __B) {...@@ -2084,28 +1988,28 @@ _mm_maskz_sub_sd(__mmask8 __U,__m128d __A, __m128d __B) {
2084 (__v2df)_mm_setzero_pd(), \1988 (__v2df)_mm_setzero_pd(), \
2085 (__mmask8)(U), (int)(R)))1989 (__mmask8)(U), (int)(R)))
20861990
2087static __inline__ __m512d __DEFAULT_FN_ATTRS5121991static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2088_mm512_mask_sub_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {1992_mm512_mask_sub_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
2089 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,1993 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2090 (__v8df)_mm512_sub_pd(__A, __B),1994 (__v8df)_mm512_sub_pd(__A, __B),
2091 (__v8df)__W);1995 (__v8df)__W);
2092}1996}
20931997
2094static __inline__ __m512d __DEFAULT_FN_ATTRS5121998static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2095_mm512_maskz_sub_pd(__mmask8 __U, __m512d __A, __m512d __B) {1999_mm512_maskz_sub_pd(__mmask8 __U, __m512d __A, __m512d __B) {
2096 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,2000 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2097 (__v8df)_mm512_sub_pd(__A, __B),2001 (__v8df)_mm512_sub_pd(__A, __B),
2098 (__v8df)_mm512_setzero_pd());2002 (__v8df)_mm512_setzero_pd());
2099}2003}
21002004
2101static __inline__ __m512 __DEFAULT_FN_ATTRS5122005static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2102_mm512_mask_sub_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {2006_mm512_mask_sub_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
2103 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,2007 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2104 (__v16sf)_mm512_sub_ps(__A, __B),2008 (__v16sf)_mm512_sub_ps(__A, __B),
2105 (__v16sf)__W);2009 (__v16sf)__W);
2106}2010}
21072011
2108static __inline__ __m512 __DEFAULT_FN_ATTRS5122012static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2109_mm512_maskz_sub_ps(__mmask16 __U, __m512 __A, __m512 __B) {2013_mm512_maskz_sub_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2110 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,2014 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2111 (__v16sf)_mm512_sub_ps(__A, __B),2015 (__v16sf)_mm512_sub_ps(__A, __B),
...@@ -2140,14 +2044,14 @@ _mm512_maskz_sub_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -2140,14 +2044,14 @@ _mm512_maskz_sub_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2140 (__v16sf)_mm512_sub_round_ps((A), (B), (R)), \2044 (__v16sf)_mm512_sub_round_ps((A), (B), (R)), \
2141 (__v16sf)_mm512_setzero_ps()))2045 (__v16sf)_mm512_setzero_ps()))
21422046
2143static __inline__ __m128 __DEFAULT_FN_ATTRS1282047static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2144_mm_mask_mul_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {2048_mm_mask_mul_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2145 __A = _mm_mul_ss(__A, __B);2049 __A = _mm_mul_ss(__A, __B);
2146 return __builtin_ia32_selectss_128(__U, __A, __W);2050 return __builtin_ia32_selectss_128(__U, __A, __W);
2147}2051}
21482052
2149static __inline__ __m128 __DEFAULT_FN_ATTRS1282053static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2150_mm_maskz_mul_ss(__mmask8 __U,__m128 __A, __m128 __B) {2054_mm_maskz_mul_ss(__mmask8 __U, __m128 __A, __m128 __B) {
2151 __A = _mm_mul_ss(__A, __B);2055 __A = _mm_mul_ss(__A, __B);
2152 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());2056 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
2153}2057}
...@@ -2169,14 +2073,14 @@ _mm_maskz_mul_ss(__mmask8 __U,__m128 __A, __m128 __B) {...@@ -2169,14 +2073,14 @@ _mm_maskz_mul_ss(__mmask8 __U,__m128 __A, __m128 __B) {
2169 (__v4sf)_mm_setzero_ps(), \2073 (__v4sf)_mm_setzero_ps(), \
2170 (__mmask8)(U), (int)(R)))2074 (__mmask8)(U), (int)(R)))
21712075
2172static __inline__ __m128d __DEFAULT_FN_ATTRS1282076static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2173_mm_mask_mul_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {2077_mm_mask_mul_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2174 __A = _mm_mul_sd(__A, __B);2078 __A = _mm_mul_sd(__A, __B);
2175 return __builtin_ia32_selectsd_128(__U, __A, __W);2079 return __builtin_ia32_selectsd_128(__U, __A, __W);
2176}2080}
21772081
2178static __inline__ __m128d __DEFAULT_FN_ATTRS1282082static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2179_mm_maskz_mul_sd(__mmask8 __U,__m128d __A, __m128d __B) {2083_mm_maskz_mul_sd(__mmask8 __U, __m128d __A, __m128d __B) {
2180 __A = _mm_mul_sd(__A, __B);2084 __A = _mm_mul_sd(__A, __B);
2181 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());2085 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
2182}2086}
...@@ -2199,28 +2103,28 @@ _mm_maskz_mul_sd(__mmask8 __U,__m128d __A, __m128d __B) {...@@ -2199,28 +2103,28 @@ _mm_maskz_mul_sd(__mmask8 __U,__m128d __A, __m128d __B) {
2199 (__v2df)_mm_setzero_pd(), \2103 (__v2df)_mm_setzero_pd(), \
2200 (__mmask8)(U), (int)(R)))2104 (__mmask8)(U), (int)(R)))
22012105
2202static __inline__ __m512d __DEFAULT_FN_ATTRS5122106static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2203_mm512_mask_mul_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {2107_mm512_mask_mul_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
2204 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,2108 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2205 (__v8df)_mm512_mul_pd(__A, __B),2109 (__v8df)_mm512_mul_pd(__A, __B),
2206 (__v8df)__W);2110 (__v8df)__W);
2207}2111}
22082112
2209static __inline__ __m512d __DEFAULT_FN_ATTRS5122113static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2210_mm512_maskz_mul_pd(__mmask8 __U, __m512d __A, __m512d __B) {2114_mm512_maskz_mul_pd(__mmask8 __U, __m512d __A, __m512d __B) {
2211 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,2115 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2212 (__v8df)_mm512_mul_pd(__A, __B),2116 (__v8df)_mm512_mul_pd(__A, __B),
2213 (__v8df)_mm512_setzero_pd());2117 (__v8df)_mm512_setzero_pd());
2214}2118}
22152119
2216static __inline__ __m512 __DEFAULT_FN_ATTRS5122120static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2217_mm512_mask_mul_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {2121_mm512_mask_mul_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
2218 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,2122 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2219 (__v16sf)_mm512_mul_ps(__A, __B),2123 (__v16sf)_mm512_mul_ps(__A, __B),
2220 (__v16sf)__W);2124 (__v16sf)__W);
2221}2125}
22222126
2223static __inline__ __m512 __DEFAULT_FN_ATTRS5122127static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2224_mm512_maskz_mul_ps(__mmask16 __U, __m512 __A, __m512 __B) {2128_mm512_maskz_mul_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2225 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,2129 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2226 (__v16sf)_mm512_mul_ps(__A, __B),2130 (__v16sf)_mm512_mul_ps(__A, __B),
...@@ -2255,14 +2159,14 @@ _mm512_maskz_mul_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -2255,14 +2159,14 @@ _mm512_maskz_mul_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2255 (__v16sf)_mm512_mul_round_ps((A), (B), (R)), \2159 (__v16sf)_mm512_mul_round_ps((A), (B), (R)), \
2256 (__v16sf)_mm512_setzero_ps()))2160 (__v16sf)_mm512_setzero_ps()))
22572161
2258static __inline__ __m128 __DEFAULT_FN_ATTRS1282162static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2259_mm_mask_div_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {2163_mm_mask_div_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2260 __A = _mm_div_ss(__A, __B);2164 __A = _mm_div_ss(__A, __B);
2261 return __builtin_ia32_selectss_128(__U, __A, __W);2165 return __builtin_ia32_selectss_128(__U, __A, __W);
2262}2166}
22632167
2264static __inline__ __m128 __DEFAULT_FN_ATTRS1282168static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2265_mm_maskz_div_ss(__mmask8 __U,__m128 __A, __m128 __B) {2169_mm_maskz_div_ss(__mmask8 __U, __m128 __A, __m128 __B) {
2266 __A = _mm_div_ss(__A, __B);2170 __A = _mm_div_ss(__A, __B);
2267 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());2171 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
2268}2172}
...@@ -2285,14 +2189,14 @@ _mm_maskz_div_ss(__mmask8 __U,__m128 __A, __m128 __B) {...@@ -2285,14 +2189,14 @@ _mm_maskz_div_ss(__mmask8 __U,__m128 __A, __m128 __B) {
2285 (__v4sf)_mm_setzero_ps(), \2189 (__v4sf)_mm_setzero_ps(), \
2286 (__mmask8)(U), (int)(R)))2190 (__mmask8)(U), (int)(R)))
22872191
2288static __inline__ __m128d __DEFAULT_FN_ATTRS1282192static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2289_mm_mask_div_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {2193_mm_mask_div_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2290 __A = _mm_div_sd(__A, __B);2194 __A = _mm_div_sd(__A, __B);
2291 return __builtin_ia32_selectsd_128(__U, __A, __W);2195 return __builtin_ia32_selectsd_128(__U, __A, __W);
2292}2196}
22932197
2294static __inline__ __m128d __DEFAULT_FN_ATTRS1282198static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2295_mm_maskz_div_sd(__mmask8 __U,__m128d __A, __m128d __B) {2199_mm_maskz_div_sd(__mmask8 __U, __m128d __A, __m128d __B) {
2296 __A = _mm_div_sd(__A, __B);2200 __A = _mm_div_sd(__A, __B);
2297 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());2201 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
2298}2202}
...@@ -2315,40 +2219,38 @@ _mm_maskz_div_sd(__mmask8 __U,__m128d __A, __m128d __B) {...@@ -2315,40 +2219,38 @@ _mm_maskz_div_sd(__mmask8 __U,__m128d __A, __m128d __B) {
2315 (__v2df)_mm_setzero_pd(), \2219 (__v2df)_mm_setzero_pd(), \
2316 (__mmask8)(U), (int)(R)))2220 (__mmask8)(U), (int)(R)))
23172221
2318static __inline __m512d __DEFAULT_FN_ATTRS5122222static __inline __m512d
2319_mm512_div_pd(__m512d __a, __m512d __b)2223 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_div_pd(__m512d __a, __m512d __b) {
2320{
2321 return (__m512d)((__v8df)__a/(__v8df)__b);2224 return (__m512d)((__v8df)__a/(__v8df)__b);
2322}2225}
23232226
2324static __inline__ __m512d __DEFAULT_FN_ATTRS5122227static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2325_mm512_mask_div_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {2228_mm512_mask_div_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
2326 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,2229 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2327 (__v8df)_mm512_div_pd(__A, __B),2230 (__v8df)_mm512_div_pd(__A, __B),
2328 (__v8df)__W);2231 (__v8df)__W);
2329}2232}
23302233
2331static __inline__ __m512d __DEFAULT_FN_ATTRS5122234static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2332_mm512_maskz_div_pd(__mmask8 __U, __m512d __A, __m512d __B) {2235_mm512_maskz_div_pd(__mmask8 __U, __m512d __A, __m512d __B) {
2333 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,2236 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2334 (__v8df)_mm512_div_pd(__A, __B),2237 (__v8df)_mm512_div_pd(__A, __B),
2335 (__v8df)_mm512_setzero_pd());2238 (__v8df)_mm512_setzero_pd());
2336}2239}
23372240
2338static __inline __m512 __DEFAULT_FN_ATTRS5122241static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2339_mm512_div_ps(__m512 __a, __m512 __b)2242_mm512_div_ps(__m512 __a, __m512 __b) {
2340{
2341 return (__m512)((__v16sf)__a/(__v16sf)__b);2243 return (__m512)((__v16sf)__a/(__v16sf)__b);
2342}2244}
23432245
2344static __inline__ __m512 __DEFAULT_FN_ATTRS5122246static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2345_mm512_mask_div_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {2247_mm512_mask_div_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
2346 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,2248 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2347 (__v16sf)_mm512_div_ps(__A, __B),2249 (__v16sf)_mm512_div_ps(__A, __B),
2348 (__v16sf)__W);2250 (__v16sf)__W);
2349}2251}
23502252
2351static __inline__ __m512 __DEFAULT_FN_ATTRS5122253static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2352_mm512_maskz_div_ps(__mmask16 __U, __m512 __A, __m512 __B) {2254_mm512_maskz_div_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2353 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,2255 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2354 (__v16sf)_mm512_div_ps(__A, __B),2256 (__v16sf)_mm512_div_ps(__A, __B),
...@@ -2530,125 +2432,104 @@ _mm512_maskz_div_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -2530,125 +2432,104 @@ _mm512_maskz_div_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2530 -(__v8df)(__m512d)(C), \2432 -(__v8df)(__m512d)(C), \
2531 (__mmask8)(U), (int)(R)))2433 (__mmask8)(U), (int)(R)))
25322434
2435static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2436_mm512_fmadd_pd(__m512d __A, __m512d __B, __m512d __C) {
2437 return (__m512d)__builtin_elementwise_fma((__v8df)__A, (__v8df)__B,
2438 (__v8df)__C);
2439}
25332440
2534static __inline__ __m512d __DEFAULT_FN_ATTRS5122441static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2535_mm512_fmadd_pd(__m512d __A, __m512d __B, __m512d __C)2442_mm512_mask_fmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
2536{2443 return (__m512d)__builtin_ia32_selectpd_512(
2537 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,2444 (__mmask8)__U, (__v8df)_mm512_fmadd_pd(__A, __B, __C), (__v8df)__A);
2538 (__v8df) __B,
2539 (__v8df) __C,
2540 (__mmask8) -1,
2541 _MM_FROUND_CUR_DIRECTION);
2542}2445}
25432446
2544static __inline__ __m512d __DEFAULT_FN_ATTRS5122447static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2545_mm512_mask_fmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)2448_mm512_mask3_fmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
2546{2449 return (__m512d)__builtin_ia32_selectpd_512(
2547 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,2450 (__mmask8)__U, (__v8df)_mm512_fmadd_pd(__A, __B, __C), (__v8df)__C);
2548 (__v8df) __B,
2549 (__v8df) __C,
2550 (__mmask8) __U,
2551 _MM_FROUND_CUR_DIRECTION);
2552}2451}
25532452
2554static __inline__ __m512d __DEFAULT_FN_ATTRS5122453static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2555_mm512_mask3_fmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)2454_mm512_maskz_fmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
2556{2455 return (__m512d)__builtin_ia32_selectpd_512(
2557 return (__m512d) __builtin_ia32_vfmaddpd512_mask3 ((__v8df) __A,2456 (__mmask8)__U, (__v8df)_mm512_fmadd_pd(__A, __B, __C),
2558 (__v8df) __B,2457 (__v8df)_mm512_setzero_pd());
2559 (__v8df) __C,
2560 (__mmask8) __U,
2561 _MM_FROUND_CUR_DIRECTION);
2562}2458}
25632459
2564static __inline__ __m512d __DEFAULT_FN_ATTRS5122460static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2565_mm512_maskz_fmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)2461_mm512_fmsub_pd(__m512d __A, __m512d __B, __m512d __C) {
2566{2462 return (__m512d)__builtin_elementwise_fma((__v8df)__A, (__v8df)__B,
2567 return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A,2463 -(__v8df)__C);
2568 (__v8df) __B,
2569 (__v8df) __C,
2570 (__mmask8) __U,
2571 _MM_FROUND_CUR_DIRECTION);
2572}2464}
25732465
2574static __inline__ __m512d __DEFAULT_FN_ATTRS5122466static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2575_mm512_fmsub_pd(__m512d __A, __m512d __B, __m512d __C)2467_mm512_mask_fmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
2576{2468 return (__m512d)__builtin_ia32_selectpd_512(
2577 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,2469 (__mmask8)__U, (__v8df)_mm512_fmsub_pd(__A, __B, __C), (__v8df)__A);
2578 (__v8df) __B,
2579 -(__v8df) __C,
2580 (__mmask8) -1,
2581 _MM_FROUND_CUR_DIRECTION);
2582}2470}
25832471
2584static __inline__ __m512d __DEFAULT_FN_ATTRS5122472static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2585_mm512_mask_fmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)2473_mm512_mask3_fmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
2586{2474 return (__m512d)__builtin_ia32_selectpd_512(
2587 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,2475 (__mmask8)__U, (__v8df)_mm512_fmsub_pd(__A, __B, __C), (__v8df)__C);
2588 (__v8df) __B,
2589 -(__v8df) __C,
2590 (__mmask8) __U,
2591 _MM_FROUND_CUR_DIRECTION);
2592}2476}
25932477
2594static __inline__ __m512d __DEFAULT_FN_ATTRS5122478static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2595_mm512_maskz_fmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)2479_mm512_maskz_fmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
2596{2480 return (__m512d)__builtin_ia32_selectpd_512(
2597 return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A,2481 (__mmask8)__U, (__v8df)_mm512_fmsub_pd(__A, __B, __C),
2598 (__v8df) __B,2482 (__v8df)_mm512_setzero_pd());
2599 -(__v8df) __C,
2600 (__mmask8) __U,
2601 _MM_FROUND_CUR_DIRECTION);
2602}2483}
26032484
2604static __inline__ __m512d __DEFAULT_FN_ATTRS5122485static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2605_mm512_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C)2486_mm512_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C) {
2606{2487 return (__m512d)__builtin_elementwise_fma(-(__v8df)__A, (__v8df)__B,
2607 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,2488 (__v8df)__C);
2608 -(__v8df) __B,
2609 (__v8df) __C,
2610 (__mmask8) -1,
2611 _MM_FROUND_CUR_DIRECTION);
2612}2489}
26132490
2614static __inline__ __m512d __DEFAULT_FN_ATTRS5122491static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2615_mm512_mask3_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)2492_mm512_mask_fnmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
2616{2493 return (__m512d)__builtin_ia32_selectpd_512(
2617 return (__m512d) __builtin_ia32_vfmaddpd512_mask3 (-(__v8df) __A,2494 (__mmask8)__U, (__v8df)_mm512_fnmadd_pd(__A, __B, __C), (__v8df)__A);
2618 (__v8df) __B,
2619 (__v8df) __C,
2620 (__mmask8) __U,
2621 _MM_FROUND_CUR_DIRECTION);
2622}2495}
26232496
2624static __inline__ __m512d __DEFAULT_FN_ATTRS5122497static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2625_mm512_maskz_fnmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)2498_mm512_mask3_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
2626{2499 return (__m512d)__builtin_ia32_selectpd_512(
2627 return (__m512d) __builtin_ia32_vfmaddpd512_maskz (-(__v8df) __A,2500 (__mmask8)__U, (__v8df)_mm512_fnmadd_pd(__A, __B, __C), (__v8df)__C);
2628 (__v8df) __B,
2629 (__v8df) __C,
2630 (__mmask8) __U,
2631 _MM_FROUND_CUR_DIRECTION);
2632}2501}
26332502
2634static __inline__ __m512d __DEFAULT_FN_ATTRS5122503static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2635_mm512_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C)2504_mm512_maskz_fnmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
2636{2505 return (__m512d)__builtin_ia32_selectpd_512(
2637 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,2506 (__mmask8)__U, (__v8df)_mm512_fnmadd_pd(__A, __B, __C),
2638 -(__v8df) __B,2507 (__v8df)_mm512_setzero_pd());
2639 -(__v8df) __C,
2640 (__mmask8) -1,
2641 _MM_FROUND_CUR_DIRECTION);
2642}2508}
26432509
2644static __inline__ __m512d __DEFAULT_FN_ATTRS5122510static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2645_mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)2511_mm512_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C) {
2646{2512 return (__m512d)__builtin_elementwise_fma(-(__v8df)__A, (__v8df)__B,
2647 return (__m512d) __builtin_ia32_vfmaddpd512_maskz (-(__v8df) __A,2513 -(__v8df)__C);
2648 (__v8df) __B,2514}
2649 -(__v8df) __C,2515
2650 (__mmask8) __U,2516static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2651 _MM_FROUND_CUR_DIRECTION);2517_mm512_mask_fnmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
2518 return (__m512d)__builtin_ia32_selectpd_512(
2519 (__mmask8)__U, (__v8df)_mm512_fnmsub_pd(__A, __B, __C), (__v8df)__A);
2520}
2521
2522static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2523_mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
2524 return (__m512d)__builtin_ia32_selectpd_512(
2525 (__mmask8)__U, (__v8df)_mm512_fnmsub_pd(__A, __B, __C), (__v8df)__C);
2526}
2527
2528static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
2529_mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
2530 return (__m512d)__builtin_ia32_selectpd_512(
2531 (__mmask8)__U, (__v8df)_mm512_fnmsub_pd(__A, __B, __C),
2532 (__v8df)_mm512_setzero_pd());
2652}2533}
26532534
2654#define _mm512_fmadd_round_ps(A, B, C, R) \2535#define _mm512_fmadd_round_ps(A, B, C, R) \
...@@ -2734,125 +2615,104 @@ _mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)...@@ -2734,125 +2615,104 @@ _mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2734 -(__v16sf)(__m512)(C), \2615 -(__v16sf)(__m512)(C), \
2735 (__mmask16)(U), (int)(R)))2616 (__mmask16)(U), (int)(R)))
27362617
2618static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2619_mm512_fmadd_ps(__m512 __A, __m512 __B, __m512 __C) {
2620 return (__m512)__builtin_elementwise_fma((__v16sf)__A, (__v16sf)__B,
2621 (__v16sf)__C);
2622}
27372623
2738static __inline__ __m512 __DEFAULT_FN_ATTRS5122624static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2739_mm512_fmadd_ps(__m512 __A, __m512 __B, __m512 __C)2625_mm512_mask_fmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
2740{2626 return (__m512)__builtin_ia32_selectps_512(
2741 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,2627 (__mmask16)__U, (__v16sf)_mm512_fmadd_ps(__A, __B, __C), (__v16sf)__A);
2742 (__v16sf) __B,
2743 (__v16sf) __C,
2744 (__mmask16) -1,
2745 _MM_FROUND_CUR_DIRECTION);
2746}2628}
27472629
2748static __inline__ __m512 __DEFAULT_FN_ATTRS5122630static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2749_mm512_mask_fmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)2631_mm512_mask3_fmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
2750{2632 return (__m512)__builtin_ia32_selectps_512(
2751 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,2633 (__mmask16)__U, (__v16sf)_mm512_fmadd_ps(__A, __B, __C), (__v16sf)__C);
2752 (__v16sf) __B,
2753 (__v16sf) __C,
2754 (__mmask16) __U,
2755 _MM_FROUND_CUR_DIRECTION);
2756}2634}
27572635
2758static __inline__ __m512 __DEFAULT_FN_ATTRS5122636static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2759_mm512_mask3_fmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)2637_mm512_maskz_fmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
2760{2638 return (__m512)__builtin_ia32_selectps_512(
2761 return (__m512) __builtin_ia32_vfmaddps512_mask3 ((__v16sf) __A,2639 (__mmask16)__U, (__v16sf)_mm512_fmadd_ps(__A, __B, __C),
2762 (__v16sf) __B,2640 (__v16sf)_mm512_setzero_ps());
2763 (__v16sf) __C,
2764 (__mmask16) __U,
2765 _MM_FROUND_CUR_DIRECTION);
2766}2641}
27672642
2768static __inline__ __m512 __DEFAULT_FN_ATTRS5122643static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2769_mm512_maskz_fmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)2644_mm512_fmsub_ps(__m512 __A, __m512 __B, __m512 __C) {
2770{2645 return (__m512)__builtin_elementwise_fma((__v16sf)__A, (__v16sf)__B,
2771 return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A,2646 -(__v16sf)__C);
2772 (__v16sf) __B,
2773 (__v16sf) __C,
2774 (__mmask16) __U,
2775 _MM_FROUND_CUR_DIRECTION);
2776}2647}
27772648
2778static __inline__ __m512 __DEFAULT_FN_ATTRS5122649static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2779_mm512_fmsub_ps(__m512 __A, __m512 __B, __m512 __C)2650_mm512_mask_fmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
2780{2651 return (__m512)__builtin_ia32_selectps_512(
2781 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,2652 (__mmask16)__U, (__v16sf)_mm512_fmsub_ps(__A, __B, __C), (__v16sf)__A);
2782 (__v16sf) __B,
2783 -(__v16sf) __C,
2784 (__mmask16) -1,
2785 _MM_FROUND_CUR_DIRECTION);
2786}2653}
27872654
2788static __inline__ __m512 __DEFAULT_FN_ATTRS5122655static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2789_mm512_mask_fmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)2656_mm512_mask3_fmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
2790{2657 return (__m512)__builtin_ia32_selectps_512(
2791 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,2658 (__mmask16)__U, (__v16sf)_mm512_fmsub_ps(__A, __B, __C), (__v16sf)__C);
2792 (__v16sf) __B,2659}
2793 -(__v16sf) __C,2660
2794 (__mmask16) __U,2661static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2795 _MM_FROUND_CUR_DIRECTION);2662_mm512_maskz_fmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
2663 return (__m512)__builtin_ia32_selectps_512(
2664 (__mmask16)__U, (__v16sf)_mm512_fmsub_ps(__A, __B, __C),
2665 (__v16sf)_mm512_setzero_ps());
2666}
2667
2668static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2669_mm512_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C) {
2670 return (__m512)__builtin_elementwise_fma(-(__v16sf)__A, (__v16sf)__B,
2671 (__v16sf)__C);
2796}2672}
27972673
2798static __inline__ __m512 __DEFAULT_FN_ATTRS5122674static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2799_mm512_maskz_fmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)2675_mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
2800{2676 return (__m512)__builtin_ia32_selectps_512(
2801 return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A,2677 (__mmask16)__U, (__v16sf)_mm512_fnmadd_ps(__A, __B, __C), (__v16sf)__A);
2802 (__v16sf) __B,
2803 -(__v16sf) __C,
2804 (__mmask16) __U,
2805 _MM_FROUND_CUR_DIRECTION);
2806}2678}
28072679
2808static __inline__ __m512 __DEFAULT_FN_ATTRS5122680static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2809_mm512_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C)2681_mm512_mask3_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
2810{2682 return (__m512)__builtin_ia32_selectps_512(
2811 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,2683 (__mmask16)__U, (__v16sf)_mm512_fnmadd_ps(__A, __B, __C), (__v16sf)__C);
2812 -(__v16sf) __B,
2813 (__v16sf) __C,
2814 (__mmask16) -1,
2815 _MM_FROUND_CUR_DIRECTION);
2816}2684}
28172685
2818static __inline__ __m512 __DEFAULT_FN_ATTRS5122686static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2819_mm512_mask3_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)2687_mm512_maskz_fnmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
2820{2688 return (__m512)__builtin_ia32_selectps_512(
2821 return (__m512) __builtin_ia32_vfmaddps512_mask3 (-(__v16sf) __A,2689 (__mmask16)__U, (__v16sf)_mm512_fnmadd_ps(__A, __B, __C),
2822 (__v16sf) __B,2690 (__v16sf)_mm512_setzero_ps());
2823 (__v16sf) __C,
2824 (__mmask16) __U,
2825 _MM_FROUND_CUR_DIRECTION);
2826}2691}
28272692
2828static __inline__ __m512 __DEFAULT_FN_ATTRS5122693static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2829_mm512_maskz_fnmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)2694_mm512_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C) {
2830{2695 return (__m512)__builtin_elementwise_fma(-(__v16sf)__A, (__v16sf)__B,
2831 return (__m512) __builtin_ia32_vfmaddps512_maskz (-(__v16sf) __A,2696 -(__v16sf)__C);
2832 (__v16sf) __B,
2833 (__v16sf) __C,
2834 (__mmask16) __U,
2835 _MM_FROUND_CUR_DIRECTION);
2836}2697}
28372698
2838static __inline__ __m512 __DEFAULT_FN_ATTRS5122699static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2839_mm512_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C)2700_mm512_mask_fnmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
2840{2701 return (__m512)__builtin_ia32_selectps_512(
2841 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,2702 (__mmask16)__U, (__v16sf)_mm512_fnmsub_ps(__A, __B, __C), (__v16sf)__A);
2842 -(__v16sf) __B,
2843 -(__v16sf) __C,
2844 (__mmask16) -1,
2845 _MM_FROUND_CUR_DIRECTION);
2846}2703}
28472704
2848static __inline__ __m512 __DEFAULT_FN_ATTRS5122705static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2849_mm512_maskz_fnmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)2706_mm512_mask3_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
2850{2707 return (__m512)__builtin_ia32_selectps_512(
2851 return (__m512) __builtin_ia32_vfmaddps512_maskz (-(__v16sf) __A,2708 (__mmask16)__U, (__v16sf)_mm512_fnmsub_ps(__A, __B, __C), (__v16sf)__C);
2852 (__v16sf) __B,2709}
2853 -(__v16sf) __C,2710
2854 (__mmask16) __U,2711static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
2855 _MM_FROUND_CUR_DIRECTION);2712_mm512_maskz_fnmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
2713 return (__m512)__builtin_ia32_selectps_512(
2714 (__mmask16)__U, (__v16sf)_mm512_fnmsub_ps(__A, __B, __C),
2715 (__v16sf)_mm512_setzero_ps());
2856}2716}
28572717
2858#define _mm512_fmaddsub_round_pd(A, B, C, R) \2718#define _mm512_fmaddsub_round_pd(A, B, C, R) \
...@@ -3099,33 +2959,12 @@ _mm512_maskz_fmsubadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)...@@ -3099,33 +2959,12 @@ _mm512_maskz_fmsubadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
3099 (__v8df)(__m512d)(C), \2959 (__v8df)(__m512d)(C), \
3100 (__mmask8)(U), (int)(R)))2960 (__mmask8)(U), (int)(R)))
31012961
3102
3103static __inline__ __m512d __DEFAULT_FN_ATTRS512
3104_mm512_mask3_fmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
3105{
3106 return (__m512d)__builtin_ia32_vfmsubpd512_mask3 ((__v8df) __A,
3107 (__v8df) __B,
3108 (__v8df) __C,
3109 (__mmask8) __U,
3110 _MM_FROUND_CUR_DIRECTION);
3111}
3112
3113#define _mm512_mask3_fmsub_round_ps(A, B, C, U, R) \2962#define _mm512_mask3_fmsub_round_ps(A, B, C, U, R) \
3114 ((__m512)__builtin_ia32_vfmsubps512_mask3((__v16sf)(__m512)(A), \2963 ((__m512)__builtin_ia32_vfmsubps512_mask3((__v16sf)(__m512)(A), \
3115 (__v16sf)(__m512)(B), \2964 (__v16sf)(__m512)(B), \
3116 (__v16sf)(__m512)(C), \2965 (__v16sf)(__m512)(C), \
3117 (__mmask16)(U), (int)(R)))2966 (__mmask16)(U), (int)(R)))
31182967
3119static __inline__ __m512 __DEFAULT_FN_ATTRS512
3120_mm512_mask3_fmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3121{
3122 return (__m512)__builtin_ia32_vfmsubps512_mask3 ((__v16sf) __A,
3123 (__v16sf) __B,
3124 (__v16sf) __C,
3125 (__mmask16) __U,
3126 _MM_FROUND_CUR_DIRECTION);
3127}
3128
3129#define _mm512_mask3_fmsubadd_round_pd(A, B, C, U, R) \2968#define _mm512_mask3_fmsubadd_round_pd(A, B, C, U, R) \
3130 ((__m512d)__builtin_ia32_vfmsubaddpd512_mask3((__v8df)(__m512d)(A), \2969 ((__m512d)__builtin_ia32_vfmsubaddpd512_mask3((__v8df)(__m512d)(A), \
3131 (__v8df)(__m512d)(B), \2970 (__v8df)(__m512d)(B), \
...@@ -3166,34 +3005,12 @@ _mm512_mask3_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)...@@ -3166,34 +3005,12 @@ _mm512_mask3_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3166 (__v8df)(__m512d)(C), \3005 (__v8df)(__m512d)(C), \
3167 (__mmask8)(U), (int)(R)))3006 (__mmask8)(U), (int)(R)))
31683007
3169
3170static __inline__ __m512d __DEFAULT_FN_ATTRS512
3171_mm512_mask_fnmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
3172{
3173 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
3174 -(__v8df) __B,
3175 (__v8df) __C,
3176 (__mmask8) __U,
3177 _MM_FROUND_CUR_DIRECTION);
3178}
3179
3180#define _mm512_mask_fnmadd_round_ps(A, U, B, C, R) \3008#define _mm512_mask_fnmadd_round_ps(A, U, B, C, R) \
3181 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \3009 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
3182 -(__v16sf)(__m512)(B), \3010 -(__v16sf)(__m512)(B), \
3183 (__v16sf)(__m512)(C), \3011 (__v16sf)(__m512)(C), \
3184 (__mmask16)(U), (int)(R)))3012 (__mmask16)(U), (int)(R)))
31853013
3186
3187static __inline__ __m512 __DEFAULT_FN_ATTRS512
3188_mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3189{
3190 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
3191 -(__v16sf) __B,
3192 (__v16sf) __C,
3193 (__mmask16) __U,
3194 _MM_FROUND_CUR_DIRECTION);
3195}
3196
3197#define _mm512_mask_fnmsub_round_pd(A, U, B, C, R) \3014#define _mm512_mask_fnmsub_round_pd(A, U, B, C, R) \
3198 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \3015 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
3199 -(__v8df)(__m512d)(B), \3016 -(__v8df)(__m512d)(B), \
...@@ -3207,27 +3024,6 @@ _mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)...@@ -3207,27 +3024,6 @@ _mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3207 (__v8df)(__m512d)(C), \3024 (__v8df)(__m512d)(C), \
3208 (__mmask8)(U), (int)(R)))3025 (__mmask8)(U), (int)(R)))
32093026
3210
3211static __inline__ __m512d __DEFAULT_FN_ATTRS512
3212_mm512_mask_fnmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
3213{
3214 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
3215 -(__v8df) __B,
3216 -(__v8df) __C,
3217 (__mmask8) __U,
3218 _MM_FROUND_CUR_DIRECTION);
3219}
3220
3221static __inline__ __m512d __DEFAULT_FN_ATTRS512
3222_mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
3223{
3224 return (__m512d) __builtin_ia32_vfmsubpd512_mask3 (-(__v8df) __A,
3225 (__v8df) __B,
3226 (__v8df) __C,
3227 (__mmask8) __U,
3228 _MM_FROUND_CUR_DIRECTION);
3229}
3230
3231#define _mm512_mask_fnmsub_round_ps(A, U, B, C, R) \3027#define _mm512_mask_fnmsub_round_ps(A, U, B, C, R) \
3232 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \3028 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
3233 -(__v16sf)(__m512)(B), \3029 -(__v16sf)(__m512)(B), \
...@@ -3241,94 +3037,63 @@ _mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)...@@ -3241,94 +3037,63 @@ _mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
3241 (__v16sf)(__m512)(C), \3037 (__v16sf)(__m512)(C), \
3242 (__mmask16)(U), (int)(R)))3038 (__mmask16)(U), (int)(R)))
32433039
3244
3245static __inline__ __m512 __DEFAULT_FN_ATTRS512
3246_mm512_mask_fnmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3247{
3248 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
3249 -(__v16sf) __B,
3250 -(__v16sf) __C,
3251 (__mmask16) __U,
3252 _MM_FROUND_CUR_DIRECTION);
3253}
3254
3255static __inline__ __m512 __DEFAULT_FN_ATTRS512
3256_mm512_mask3_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3257{
3258 return (__m512) __builtin_ia32_vfmsubps512_mask3 (-(__v16sf) __A,
3259 (__v16sf) __B,
3260 (__v16sf) __C,
3261 (__mmask16) __U,
3262 _MM_FROUND_CUR_DIRECTION);
3263}
3264
3265
3266
3267/* Vector permutations */3040/* Vector permutations */
32683041
3269static __inline __m512i __DEFAULT_FN_ATTRS5123042static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3270_mm512_permutex2var_epi32(__m512i __A, __m512i __I, __m512i __B)3043_mm512_permutex2var_epi32(__m512i __A, __m512i __I, __m512i __B) {
3271{
3272 return (__m512i)__builtin_ia32_vpermi2vard512((__v16si)__A, (__v16si) __I,3044 return (__m512i)__builtin_ia32_vpermi2vard512((__v16si)__A, (__v16si) __I,
3273 (__v16si) __B);3045 (__v16si) __B);
3274}3046}
32753047
3276static __inline__ __m512i __DEFAULT_FN_ATTRS5123048static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3277_mm512_mask_permutex2var_epi32(__m512i __A, __mmask16 __U, __m512i __I,3049_mm512_mask_permutex2var_epi32(__m512i __A, __mmask16 __U, __m512i __I,
3278 __m512i __B)3050 __m512i __B) {
3279{
3280 return (__m512i)__builtin_ia32_selectd_512(__U,3051 return (__m512i)__builtin_ia32_selectd_512(__U,
3281 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),3052 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
3282 (__v16si)__A);3053 (__v16si)__A);
3283}3054}
32843055
3285static __inline__ __m512i __DEFAULT_FN_ATTRS5123056static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3286_mm512_mask2_permutex2var_epi32(__m512i __A, __m512i __I, __mmask16 __U,3057_mm512_mask2_permutex2var_epi32(__m512i __A, __m512i __I, __mmask16 __U,
3287 __m512i __B)3058 __m512i __B) {
3288{
3289 return (__m512i)__builtin_ia32_selectd_512(__U,3059 return (__m512i)__builtin_ia32_selectd_512(__U,
3290 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),3060 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
3291 (__v16si)__I);3061 (__v16si)__I);
3292}3062}
32933063
3294static __inline__ __m512i __DEFAULT_FN_ATTRS5123064static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3295_mm512_maskz_permutex2var_epi32(__mmask16 __U, __m512i __A, __m512i __I,3065_mm512_maskz_permutex2var_epi32(__mmask16 __U, __m512i __A, __m512i __I,
3296 __m512i __B)3066 __m512i __B) {
3297{
3298 return (__m512i)__builtin_ia32_selectd_512(__U,3067 return (__m512i)__builtin_ia32_selectd_512(__U,
3299 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),3068 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
3300 (__v16si)_mm512_setzero_si512());3069 (__v16si)_mm512_setzero_si512());
3301}3070}
33023071
3303static __inline __m512i __DEFAULT_FN_ATTRS5123072static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3304_mm512_permutex2var_epi64(__m512i __A, __m512i __I, __m512i __B)3073_mm512_permutex2var_epi64(__m512i __A, __m512i __I, __m512i __B) {
3305{
3306 return (__m512i)__builtin_ia32_vpermi2varq512((__v8di)__A, (__v8di) __I,3074 return (__m512i)__builtin_ia32_vpermi2varq512((__v8di)__A, (__v8di) __I,
3307 (__v8di) __B);3075 (__v8di) __B);
3308}3076}
33093077
3310static __inline__ __m512i __DEFAULT_FN_ATTRS5123078static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3311_mm512_mask_permutex2var_epi64(__m512i __A, __mmask8 __U, __m512i __I,3079_mm512_mask_permutex2var_epi64(__m512i __A, __mmask8 __U, __m512i __I,
3312 __m512i __B)3080 __m512i __B) {
3313{
3314 return (__m512i)__builtin_ia32_selectq_512(__U,3081 return (__m512i)__builtin_ia32_selectq_512(__U,
3315 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),3082 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
3316 (__v8di)__A);3083 (__v8di)__A);
3317}3084}
33183085
3319static __inline__ __m512i __DEFAULT_FN_ATTRS5123086static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3320_mm512_mask2_permutex2var_epi64(__m512i __A, __m512i __I, __mmask8 __U,3087_mm512_mask2_permutex2var_epi64(__m512i __A, __m512i __I, __mmask8 __U,
3321 __m512i __B)3088 __m512i __B) {
3322{
3323 return (__m512i)__builtin_ia32_selectq_512(__U,3089 return (__m512i)__builtin_ia32_selectq_512(__U,
3324 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),3090 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
3325 (__v8di)__I);3091 (__v8di)__I);
3326}3092}
33273093
3328static __inline__ __m512i __DEFAULT_FN_ATTRS5123094static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3329_mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,3095_mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,
3330 __m512i __B)3096 __m512i __B) {
3331{
3332 return (__m512i)__builtin_ia32_selectq_512(__U,3097 return (__m512i)__builtin_ia32_selectq_512(__U,
3333 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),3098 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
3334 (__v8di)_mm512_setzero_si512());3099 (__v8di)_mm512_setzero_si512());
...@@ -3363,10 +3128,10 @@ _mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,...@@ -3363,10 +3128,10 @@ _mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,
3363 (__v16si)_mm512_setzero_si512()))3128 (__v16si)_mm512_setzero_si512()))
3364/* Vector Extract */3129/* Vector Extract */
33653130
3366#define _mm512_extractf64x4_pd(A, I) \3131#define _mm512_extractf64x4_pd(A, I) \
3367 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(I), \3132 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(I), \
3368 (__v4df)_mm256_undefined_pd(), \3133 (__v4df)_mm256_setzero_pd(), \
3369 (__mmask8)-1))3134 (__mmask8) - 1))
33703135
3371#define _mm512_mask_extractf64x4_pd(W, U, A, imm) \3136#define _mm512_mask_extractf64x4_pd(W, U, A, imm) \
3372 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(imm), \3137 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(imm), \
...@@ -3378,10 +3143,10 @@ _mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,...@@ -3378,10 +3143,10 @@ _mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,
3378 (__v4df)_mm256_setzero_pd(), \3143 (__v4df)_mm256_setzero_pd(), \
3379 (__mmask8)(U)))3144 (__mmask8)(U)))
33803145
3381#define _mm512_extractf32x4_ps(A, I) \3146#define _mm512_extractf32x4_ps(A, I) \
3382 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(I), \3147 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(I), \
3383 (__v4sf)_mm_undefined_ps(), \3148 (__v4sf)_mm_setzero_ps(), \
3384 (__mmask8)-1))3149 (__mmask8) - 1))
33853150
3386#define _mm512_mask_extractf32x4_ps(W, U, A, imm) \3151#define _mm512_mask_extractf32x4_ps(W, U, A, imm) \
3387 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(imm), \3152 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(imm), \
...@@ -3395,33 +3160,29 @@ _mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,...@@ -3395,33 +3160,29 @@ _mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,
33953160
3396/* Vector Blend */3161/* Vector Blend */
33973162
3398static __inline __m512d __DEFAULT_FN_ATTRS5123163static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3399_mm512_mask_blend_pd(__mmask8 __U, __m512d __A, __m512d __W)3164_mm512_mask_blend_pd(__mmask8 __U, __m512d __A, __m512d __W) {
3400{
3401 return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U,3165 return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U,
3402 (__v8df) __W,3166 (__v8df) __W,
3403 (__v8df) __A);3167 (__v8df) __A);
3404}3168}
34053169
3406static __inline __m512 __DEFAULT_FN_ATTRS5123170static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3407_mm512_mask_blend_ps(__mmask16 __U, __m512 __A, __m512 __W)3171_mm512_mask_blend_ps(__mmask16 __U, __m512 __A, __m512 __W) {
3408{
3409 return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U,3172 return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U,
3410 (__v16sf) __W,3173 (__v16sf) __W,
3411 (__v16sf) __A);3174 (__v16sf) __A);
3412}3175}
34133176
3414static __inline __m512i __DEFAULT_FN_ATTRS5123177static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3415_mm512_mask_blend_epi64(__mmask8 __U, __m512i __A, __m512i __W)3178_mm512_mask_blend_epi64(__mmask8 __U, __m512i __A, __m512i __W) {
3416{
3417 return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __U,3179 return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __U,
3418 (__v8di) __W,3180 (__v8di) __W,
3419 (__v8di) __A);3181 (__v8di) __A);
3420}3182}
34213183
3422static __inline __m512i __DEFAULT_FN_ATTRS5123184static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
3423_mm512_mask_blend_epi32(__mmask16 __U, __m512i __A, __m512i __W)3185_mm512_mask_blend_epi32(__mmask16 __U, __m512i __A, __m512i __W) {
3424{
3425 return (__m512i) __builtin_ia32_selectd_512 ((__mmask16) __U,3186 return (__m512i) __builtin_ia32_selectd_512 ((__mmask16) __U,
3426 (__v16si) __W,3187 (__v16si) __W,
3427 (__v16si) __A);3188 (__v16si) __A);
...@@ -3615,115 +3376,99 @@ _mm512_maskz_cvttps_epu32 (__mmask16 __U, __m512 __A)...@@ -3615,115 +3376,99 @@ _mm512_maskz_cvttps_epu32 (__mmask16 __U, __m512 __A)
3615 (__v16sf)_mm512_setzero_ps(), \3376 (__v16sf)_mm512_setzero_ps(), \
3616 (__mmask16)(U), (int)(R)))3377 (__mmask16)(U), (int)(R)))
36173378
3618static __inline__ __m512 __DEFAULT_FN_ATTRS5123379static __inline__ __m512
3619_mm512_cvtepu32_ps (__m512i __A)3380 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_cvtepu32_ps(__m512i __A) {
3620{
3621 return (__m512)__builtin_convertvector((__v16su)__A, __v16sf);3381 return (__m512)__builtin_convertvector((__v16su)__A, __v16sf);
3622}3382}
36233383
3624static __inline__ __m512 __DEFAULT_FN_ATTRS5123384static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3625_mm512_mask_cvtepu32_ps (__m512 __W, __mmask16 __U, __m512i __A)3385_mm512_mask_cvtepu32_ps(__m512 __W, __mmask16 __U, __m512i __A) {
3626{
3627 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,3386 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3628 (__v16sf)_mm512_cvtepu32_ps(__A),3387 (__v16sf)_mm512_cvtepu32_ps(__A),
3629 (__v16sf)__W);3388 (__v16sf)__W);
3630}3389}
36313390
3632static __inline__ __m512 __DEFAULT_FN_ATTRS5123391static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3633_mm512_maskz_cvtepu32_ps (__mmask16 __U, __m512i __A)3392_mm512_maskz_cvtepu32_ps(__mmask16 __U, __m512i __A) {
3634{
3635 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,3393 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3636 (__v16sf)_mm512_cvtepu32_ps(__A),3394 (__v16sf)_mm512_cvtepu32_ps(__A),
3637 (__v16sf)_mm512_setzero_ps());3395 (__v16sf)_mm512_setzero_ps());
3638}3396}
36393397
3640static __inline __m512d __DEFAULT_FN_ATTRS5123398static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3641_mm512_cvtepi32_pd(__m256i __A)3399_mm512_cvtepi32_pd(__m256i __A) {
3642{
3643 return (__m512d)__builtin_convertvector((__v8si)__A, __v8df);3400 return (__m512d)__builtin_convertvector((__v8si)__A, __v8df);
3644}3401}
36453402
3646static __inline__ __m512d __DEFAULT_FN_ATTRS5123403static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3647_mm512_mask_cvtepi32_pd (__m512d __W, __mmask8 __U, __m256i __A)3404_mm512_mask_cvtepi32_pd(__m512d __W, __mmask8 __U, __m256i __A) {
3648{
3649 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,3405 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3650 (__v8df)_mm512_cvtepi32_pd(__A),3406 (__v8df)_mm512_cvtepi32_pd(__A),
3651 (__v8df)__W);3407 (__v8df)__W);
3652}3408}
36533409
3654static __inline__ __m512d __DEFAULT_FN_ATTRS5123410static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3655_mm512_maskz_cvtepi32_pd (__mmask8 __U, __m256i __A)3411_mm512_maskz_cvtepi32_pd(__mmask8 __U, __m256i __A) {
3656{
3657 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,3412 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3658 (__v8df)_mm512_cvtepi32_pd(__A),3413 (__v8df)_mm512_cvtepi32_pd(__A),
3659 (__v8df)_mm512_setzero_pd());3414 (__v8df)_mm512_setzero_pd());
3660}3415}
36613416
3662static __inline__ __m512d __DEFAULT_FN_ATTRS5123417static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3663_mm512_cvtepi32lo_pd(__m512i __A)3418_mm512_cvtepi32lo_pd(__m512i __A) {
3664{
3665 return (__m512d) _mm512_cvtepi32_pd(_mm512_castsi512_si256(__A));3419 return (__m512d) _mm512_cvtepi32_pd(_mm512_castsi512_si256(__A));
3666}3420}
36673421
3668static __inline__ __m512d __DEFAULT_FN_ATTRS5123422static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3669_mm512_mask_cvtepi32lo_pd(__m512d __W, __mmask8 __U,__m512i __A)3423_mm512_mask_cvtepi32lo_pd(__m512d __W, __mmask8 __U, __m512i __A) {
3670{
3671 return (__m512d) _mm512_mask_cvtepi32_pd(__W, __U, _mm512_castsi512_si256(__A));3424 return (__m512d) _mm512_mask_cvtepi32_pd(__W, __U, _mm512_castsi512_si256(__A));
3672}3425}
36733426
3674static __inline__ __m512 __DEFAULT_FN_ATTRS5123427static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3675_mm512_cvtepi32_ps (__m512i __A)3428_mm512_cvtepi32_ps(__m512i __A) {
3676{
3677 return (__m512)__builtin_convertvector((__v16si)__A, __v16sf);3429 return (__m512)__builtin_convertvector((__v16si)__A, __v16sf);
3678}3430}
36793431
3680static __inline__ __m512 __DEFAULT_FN_ATTRS5123432static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3681_mm512_mask_cvtepi32_ps (__m512 __W, __mmask16 __U, __m512i __A)3433_mm512_mask_cvtepi32_ps(__m512 __W, __mmask16 __U, __m512i __A) {
3682{
3683 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,3434 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3684 (__v16sf)_mm512_cvtepi32_ps(__A),3435 (__v16sf)_mm512_cvtepi32_ps(__A),
3685 (__v16sf)__W);3436 (__v16sf)__W);
3686}3437}
36873438
3688static __inline__ __m512 __DEFAULT_FN_ATTRS5123439static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3689_mm512_maskz_cvtepi32_ps (__mmask16 __U, __m512i __A)3440_mm512_maskz_cvtepi32_ps(__mmask16 __U, __m512i __A) {
3690{
3691 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,3441 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3692 (__v16sf)_mm512_cvtepi32_ps(__A),3442 (__v16sf)_mm512_cvtepi32_ps(__A),
3693 (__v16sf)_mm512_setzero_ps());3443 (__v16sf)_mm512_setzero_ps());
3694}3444}
36953445
3696static __inline __m512d __DEFAULT_FN_ATTRS5123446static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3697_mm512_cvtepu32_pd(__m256i __A)3447_mm512_cvtepu32_pd(__m256i __A) {
3698{
3699 return (__m512d)__builtin_convertvector((__v8su)__A, __v8df);3448 return (__m512d)__builtin_convertvector((__v8su)__A, __v8df);
3700}3449}
37013450
3702static __inline__ __m512d __DEFAULT_FN_ATTRS5123451static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3703_mm512_mask_cvtepu32_pd (__m512d __W, __mmask8 __U, __m256i __A)3452_mm512_mask_cvtepu32_pd(__m512d __W, __mmask8 __U, __m256i __A) {
3704{
3705 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,3453 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3706 (__v8df)_mm512_cvtepu32_pd(__A),3454 (__v8df)_mm512_cvtepu32_pd(__A),
3707 (__v8df)__W);3455 (__v8df)__W);
3708}3456}
37093457
3710static __inline__ __m512d __DEFAULT_FN_ATTRS5123458static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3711_mm512_maskz_cvtepu32_pd (__mmask8 __U, __m256i __A)3459_mm512_maskz_cvtepu32_pd(__mmask8 __U, __m256i __A) {
3712{
3713 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,3460 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3714 (__v8df)_mm512_cvtepu32_pd(__A),3461 (__v8df)_mm512_cvtepu32_pd(__A),
3715 (__v8df)_mm512_setzero_pd());3462 (__v8df)_mm512_setzero_pd());
3716}3463}
37173464
3718static __inline__ __m512d __DEFAULT_FN_ATTRS5123465static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3719_mm512_cvtepu32lo_pd(__m512i __A)3466_mm512_cvtepu32lo_pd(__m512i __A) {
3720{
3721 return (__m512d) _mm512_cvtepu32_pd(_mm512_castsi512_si256(__A));3467 return (__m512d) _mm512_cvtepu32_pd(_mm512_castsi512_si256(__A));
3722}3468}
37233469
3724static __inline__ __m512d __DEFAULT_FN_ATTRS5123470static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
3725_mm512_mask_cvtepu32lo_pd(__m512d __W, __mmask8 __U,__m512i __A)3471_mm512_mask_cvtepu32lo_pd(__m512d __W, __mmask8 __U, __m512i __A) {
3726{
3727 return (__m512d) _mm512_mask_cvtepu32_pd(__W, __U, _mm512_castsi512_si256(__A));3472 return (__m512d) _mm512_mask_cvtepu32_pd(__W, __U, _mm512_castsi512_si256(__A));
3728}3473}
37293474
...@@ -3742,44 +3487,38 @@ _mm512_mask_cvtepu32lo_pd(__m512d __W, __mmask8 __U,__m512i __A)...@@ -3742,44 +3487,38 @@ _mm512_mask_cvtepu32lo_pd(__m512d __W, __mmask8 __U,__m512i __A)
3742 (__v8sf)_mm256_setzero_ps(), \3487 (__v8sf)_mm256_setzero_ps(), \
3743 (__mmask8)(U), (int)(R)))3488 (__mmask8)(U), (int)(R)))
37443489
3745static __inline__ __m256 __DEFAULT_FN_ATTRS5123490static __inline__ __m256
3746_mm512_cvtpd_ps (__m512d __A)3491 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_cvtpd_ps(__m512d __A) {
3747{3492 return (__m256)__builtin_ia32_cvtpd2ps512_mask(
3748 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,3493 (__v8df)__A, (__v8sf)_mm256_setzero_ps(), (__mmask8)-1,
3749 (__v8sf) _mm256_undefined_ps (),3494 _MM_FROUND_CUR_DIRECTION);
3750 (__mmask8) -1,
3751 _MM_FROUND_CUR_DIRECTION);
3752}3495}
37533496
3754static __inline__ __m256 __DEFAULT_FN_ATTRS5123497static __inline__ __m256 __DEFAULT_FN_ATTRS512_CONSTEXPR
3755_mm512_mask_cvtpd_ps (__m256 __W, __mmask8 __U, __m512d __A)3498_mm512_mask_cvtpd_ps(__m256 __W, __mmask8 __U, __m512d __A) {
3756{
3757 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,3499 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,
3758 (__v8sf) __W,3500 (__v8sf) __W,
3759 (__mmask8) __U,3501 (__mmask8) __U,
3760 _MM_FROUND_CUR_DIRECTION);3502 _MM_FROUND_CUR_DIRECTION);
3761}3503}
37623504
3763static __inline__ __m256 __DEFAULT_FN_ATTRS5123505static __inline__ __m256 __DEFAULT_FN_ATTRS512_CONSTEXPR
3764_mm512_maskz_cvtpd_ps (__mmask8 __U, __m512d __A)3506_mm512_maskz_cvtpd_ps(__mmask8 __U, __m512d __A) {
3765{
3766 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,3507 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,
3767 (__v8sf) _mm256_setzero_ps (),3508 (__v8sf) _mm256_setzero_ps (),
3768 (__mmask8) __U,3509 (__mmask8) __U,
3769 _MM_FROUND_CUR_DIRECTION);3510 _MM_FROUND_CUR_DIRECTION);
3770}3511}
37713512
3772static __inline__ __m512 __DEFAULT_FN_ATTRS5123513static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3773_mm512_cvtpd_pslo (__m512d __A)3514_mm512_cvtpd_pslo(__m512d __A) {
3774{
3775 return (__m512) __builtin_shufflevector((__v8sf) _mm512_cvtpd_ps(__A),3515 return (__m512) __builtin_shufflevector((__v8sf) _mm512_cvtpd_ps(__A),
3776 (__v8sf) _mm256_setzero_ps (),3516 (__v8sf) _mm256_setzero_ps (),
3777 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);3517 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
3778}3518}
37793519
3780static __inline__ __m512 __DEFAULT_FN_ATTRS5123520static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
3781_mm512_mask_cvtpd_pslo (__m512 __W, __mmask8 __U,__m512d __A)3521_mm512_mask_cvtpd_pslo(__m512 __W, __mmask8 __U, __m512d __A) {
3782{
3783 return (__m512) __builtin_shufflevector (3522 return (__m512) __builtin_shufflevector (
3784 (__v8sf) _mm512_mask_cvtpd_ps (_mm512_castps512_ps256(__W),3523 (__v8sf) _mm512_mask_cvtpd_ps (_mm512_castps512_ps256(__W),
3785 __U, __A),3524 __U, __A),
...@@ -4123,9 +3862,8 @@ _mm512_cvtss_f32(__m512 __a)...@@ -4123,9 +3862,8 @@ _mm512_cvtss_f32(__m512 __a)
41233862
4124/* Unpack and Interleave */3863/* Unpack and Interleave */
41253864
4126static __inline __m512d __DEFAULT_FN_ATTRS5123865static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
4127_mm512_unpackhi_pd(__m512d __a, __m512d __b)3866_mm512_unpackhi_pd(__m512d __a, __m512d __b) {
4128{
4129 return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b,3867 return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b,
4130 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);3868 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);
4131}3869}
...@@ -4146,9 +3884,8 @@ _mm512_maskz_unpackhi_pd(__mmask8 __U, __m512d __A, __m512d __B)...@@ -4146,9 +3884,8 @@ _mm512_maskz_unpackhi_pd(__mmask8 __U, __m512d __A, __m512d __B)
4146 (__v8df)_mm512_setzero_pd());3884 (__v8df)_mm512_setzero_pd());
4147}3885}
41483886
4149static __inline __m512d __DEFAULT_FN_ATTRS5123887static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
4150_mm512_unpacklo_pd(__m512d __a, __m512d __b)3888_mm512_unpacklo_pd(__m512d __a, __m512d __b) {
4151{
4152 return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b,3889 return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b,
4153 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);3890 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);
4154}3891}
...@@ -4169,9 +3906,8 @@ _mm512_maskz_unpacklo_pd (__mmask8 __U, __m512d __A, __m512d __B)...@@ -4169,9 +3906,8 @@ _mm512_maskz_unpacklo_pd (__mmask8 __U, __m512d __A, __m512d __B)
4169 (__v8df)_mm512_setzero_pd());3906 (__v8df)_mm512_setzero_pd());
4170}3907}
41713908
4172static __inline __m512 __DEFAULT_FN_ATTRS5123909static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
4173_mm512_unpackhi_ps(__m512 __a, __m512 __b)3910_mm512_unpackhi_ps(__m512 __a, __m512 __b) {
4174{
4175 return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b,3911 return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b,
4176 2, 18, 3, 19,3912 2, 18, 3, 19,
4177 2+4, 18+4, 3+4, 19+4,3913 2+4, 18+4, 3+4, 19+4,
...@@ -4195,9 +3931,8 @@ _mm512_maskz_unpackhi_ps (__mmask16 __U, __m512 __A, __m512 __B)...@@ -4195,9 +3931,8 @@ _mm512_maskz_unpackhi_ps (__mmask16 __U, __m512 __A, __m512 __B)
4195 (__v16sf)_mm512_setzero_ps());3931 (__v16sf)_mm512_setzero_ps());
4196}3932}
41973933
4198static __inline __m512 __DEFAULT_FN_ATTRS5123934static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
4199_mm512_unpacklo_ps(__m512 __a, __m512 __b)3935_mm512_unpacklo_ps(__m512 __a, __m512 __b) {
4200{
4201 return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b,3936 return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b,
4202 0, 16, 1, 17,3937 0, 16, 1, 17,
4203 0+4, 16+4, 1+4, 17+4,3938 0+4, 16+4, 1+4, 17+4,
...@@ -4221,9 +3956,8 @@ _mm512_maskz_unpacklo_ps (__mmask16 __U, __m512 __A, __m512 __B)...@@ -4221,9 +3956,8 @@ _mm512_maskz_unpacklo_ps (__mmask16 __U, __m512 __A, __m512 __B)
4221 (__v16sf)_mm512_setzero_ps());3956 (__v16sf)_mm512_setzero_ps());
4222}3957}
42233958
4224static __inline__ __m512i __DEFAULT_FN_ATTRS5123959static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4225_mm512_unpackhi_epi32(__m512i __A, __m512i __B)3960_mm512_unpackhi_epi32(__m512i __A, __m512i __B) {
4226{
4227 return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B,3961 return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B,
4228 2, 18, 3, 19,3962 2, 18, 3, 19,
4229 2+4, 18+4, 3+4, 19+4,3963 2+4, 18+4, 3+4, 19+4,
...@@ -4247,9 +3981,8 @@ _mm512_maskz_unpackhi_epi32(__mmask16 __U, __m512i __A, __m512i __B)...@@ -4247,9 +3981,8 @@ _mm512_maskz_unpackhi_epi32(__mmask16 __U, __m512i __A, __m512i __B)
4247 (__v16si)_mm512_setzero_si512());3981 (__v16si)_mm512_setzero_si512());
4248}3982}
42493983
4250static __inline__ __m512i __DEFAULT_FN_ATTRS5123984static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4251_mm512_unpacklo_epi32(__m512i __A, __m512i __B)3985_mm512_unpacklo_epi32(__m512i __A, __m512i __B) {
4252{
4253 return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B,3986 return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B,
4254 0, 16, 1, 17,3987 0, 16, 1, 17,
4255 0+4, 16+4, 1+4, 17+4,3988 0+4, 16+4, 1+4, 17+4,
...@@ -4273,9 +4006,8 @@ _mm512_maskz_unpacklo_epi32(__mmask16 __U, __m512i __A, __m512i __B)...@@ -4273,9 +4006,8 @@ _mm512_maskz_unpacklo_epi32(__mmask16 __U, __m512i __A, __m512i __B)
4273 (__v16si)_mm512_setzero_si512());4006 (__v16si)_mm512_setzero_si512());
4274}4007}
42754008
4276static __inline__ __m512i __DEFAULT_FN_ATTRS5124009static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4277_mm512_unpackhi_epi64(__m512i __A, __m512i __B)4010_mm512_unpackhi_epi64(__m512i __A, __m512i __B) {
4278{
4279 return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B,4011 return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B,
4280 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);4012 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);
4281}4013}
...@@ -4296,9 +4028,8 @@ _mm512_maskz_unpackhi_epi64(__mmask8 __U, __m512i __A, __m512i __B)...@@ -4296,9 +4028,8 @@ _mm512_maskz_unpackhi_epi64(__mmask8 __U, __m512i __A, __m512i __B)
4296 (__v8di)_mm512_setzero_si512());4028 (__v8di)_mm512_setzero_si512());
4297}4029}
42984030
4299static __inline__ __m512i __DEFAULT_FN_ATTRS5124031static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4300_mm512_unpacklo_epi64 (__m512i __A, __m512i __B)4032_mm512_unpacklo_epi64(__m512i __A, __m512i __B) {
4301{
4302 return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B,4033 return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B,
4303 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);4034 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);
4304}4035}
...@@ -4619,9 +4350,8 @@ _mm512_store_epi64 (void *__P, __m512i __A)...@@ -4619,9 +4350,8 @@ _mm512_store_epi64 (void *__P, __m512i __A)
46194350
4620/* Mask ops */4351/* Mask ops */
46214352
4622static __inline __mmask16 __DEFAULT_FN_ATTRS4353static __inline __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
4623_mm512_knot(__mmask16 __M)4354_mm512_knot(__mmask16 __M) {
4624{
4625 return __builtin_ia32_knothi(__M);4355 return __builtin_ia32_knothi(__M);
4626}4356}
46274357
...@@ -4727,237 +4457,207 @@ _mm512_knot(__mmask16 __M)...@@ -4727,237 +4457,207 @@ _mm512_knot(__mmask16 __M)
4727#define _mm512_mask_cmpneq_epu64_mask(k, A, B) \4457#define _mm512_mask_cmpneq_epu64_mask(k, A, B) \
4728 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE)4458 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE)
47294459
4730static __inline__ __m512i __DEFAULT_FN_ATTRS5124460static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4731_mm512_cvtepi8_epi32(__m128i __A)4461_mm512_cvtepi8_epi32(__m128i __A) {
4732{
4733 /* This function always performs a signed extension, but __v16qi is a char4462 /* This function always performs a signed extension, but __v16qi is a char
4734 which may be signed or unsigned, so use __v16qs. */4463 which may be signed or unsigned, so use __v16qs. */
4735 return (__m512i)__builtin_convertvector((__v16qs)__A, __v16si);4464 return (__m512i)__builtin_convertvector((__v16qs)__A, __v16si);
4736}4465}
47374466
4738static __inline__ __m512i __DEFAULT_FN_ATTRS5124467static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4739_mm512_mask_cvtepi8_epi32(__m512i __W, __mmask16 __U, __m128i __A)4468_mm512_mask_cvtepi8_epi32(__m512i __W, __mmask16 __U, __m128i __A) {
4740{
4741 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4469 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4742 (__v16si)_mm512_cvtepi8_epi32(__A),4470 (__v16si)_mm512_cvtepi8_epi32(__A),
4743 (__v16si)__W);4471 (__v16si)__W);
4744}4472}
47454473
4746static __inline__ __m512i __DEFAULT_FN_ATTRS5124474static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4747_mm512_maskz_cvtepi8_epi32(__mmask16 __U, __m128i __A)4475_mm512_maskz_cvtepi8_epi32(__mmask16 __U, __m128i __A) {
4748{
4749 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4476 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4750 (__v16si)_mm512_cvtepi8_epi32(__A),4477 (__v16si)_mm512_cvtepi8_epi32(__A),
4751 (__v16si)_mm512_setzero_si512());4478 (__v16si)_mm512_setzero_si512());
4752}4479}
47534480
4754static __inline__ __m512i __DEFAULT_FN_ATTRS5124481static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4755_mm512_cvtepi8_epi64(__m128i __A)4482_mm512_cvtepi8_epi64(__m128i __A) {
4756{
4757 /* This function always performs a signed extension, but __v16qi is a char4483 /* This function always performs a signed extension, but __v16qi is a char
4758 which may be signed or unsigned, so use __v16qs. */4484 which may be signed or unsigned, so use __v16qs. */
4759 return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__A, (__v16qs)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di);4485 return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__A, (__v16qs)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di);
4760}4486}
47614487
4762static __inline__ __m512i __DEFAULT_FN_ATTRS5124488static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4763_mm512_mask_cvtepi8_epi64(__m512i __W, __mmask8 __U, __m128i __A)4489_mm512_mask_cvtepi8_epi64(__m512i __W, __mmask8 __U, __m128i __A) {
4764{
4765 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4490 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4766 (__v8di)_mm512_cvtepi8_epi64(__A),4491 (__v8di)_mm512_cvtepi8_epi64(__A),
4767 (__v8di)__W);4492 (__v8di)__W);
4768}4493}
47694494
4770static __inline__ __m512i __DEFAULT_FN_ATTRS5124495static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4771_mm512_maskz_cvtepi8_epi64(__mmask8 __U, __m128i __A)4496_mm512_maskz_cvtepi8_epi64(__mmask8 __U, __m128i __A) {
4772{
4773 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4497 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4774 (__v8di)_mm512_cvtepi8_epi64(__A),4498 (__v8di)_mm512_cvtepi8_epi64(__A),
4775 (__v8di)_mm512_setzero_si512 ());4499 (__v8di)_mm512_setzero_si512 ());
4776}4500}
47774501
4778static __inline__ __m512i __DEFAULT_FN_ATTRS5124502static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4779_mm512_cvtepi32_epi64(__m256i __X)4503_mm512_cvtepi32_epi64(__m256i __X) {
4780{
4781 return (__m512i)__builtin_convertvector((__v8si)__X, __v8di);4504 return (__m512i)__builtin_convertvector((__v8si)__X, __v8di);
4782}4505}
47834506
4784static __inline__ __m512i __DEFAULT_FN_ATTRS5124507static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4785_mm512_mask_cvtepi32_epi64(__m512i __W, __mmask8 __U, __m256i __X)4508_mm512_mask_cvtepi32_epi64(__m512i __W, __mmask8 __U, __m256i __X) {
4786{
4787 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4509 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4788 (__v8di)_mm512_cvtepi32_epi64(__X),4510 (__v8di)_mm512_cvtepi32_epi64(__X),
4789 (__v8di)__W);4511 (__v8di)__W);
4790}4512}
47914513
4792static __inline__ __m512i __DEFAULT_FN_ATTRS5124514static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4793_mm512_maskz_cvtepi32_epi64(__mmask8 __U, __m256i __X)4515_mm512_maskz_cvtepi32_epi64(__mmask8 __U, __m256i __X) {
4794{
4795 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4516 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4796 (__v8di)_mm512_cvtepi32_epi64(__X),4517 (__v8di)_mm512_cvtepi32_epi64(__X),
4797 (__v8di)_mm512_setzero_si512());4518 (__v8di)_mm512_setzero_si512());
4798}4519}
47994520
4800static __inline__ __m512i __DEFAULT_FN_ATTRS5124521static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4801_mm512_cvtepi16_epi32(__m256i __A)4522_mm512_cvtepi16_epi32(__m256i __A) {
4802{
4803 return (__m512i)__builtin_convertvector((__v16hi)__A, __v16si);4523 return (__m512i)__builtin_convertvector((__v16hi)__A, __v16si);
4804}4524}
48054525
4806static __inline__ __m512i __DEFAULT_FN_ATTRS5124526static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4807_mm512_mask_cvtepi16_epi32(__m512i __W, __mmask16 __U, __m256i __A)4527_mm512_mask_cvtepi16_epi32(__m512i __W, __mmask16 __U, __m256i __A) {
4808{
4809 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4528 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4810 (__v16si)_mm512_cvtepi16_epi32(__A),4529 (__v16si)_mm512_cvtepi16_epi32(__A),
4811 (__v16si)__W);4530 (__v16si)__W);
4812}4531}
48134532
4814static __inline__ __m512i __DEFAULT_FN_ATTRS5124533static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4815_mm512_maskz_cvtepi16_epi32(__mmask16 __U, __m256i __A)4534_mm512_maskz_cvtepi16_epi32(__mmask16 __U, __m256i __A) {
4816{
4817 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4535 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4818 (__v16si)_mm512_cvtepi16_epi32(__A),4536 (__v16si)_mm512_cvtepi16_epi32(__A),
4819 (__v16si)_mm512_setzero_si512 ());4537 (__v16si)_mm512_setzero_si512 ());
4820}4538}
48214539
4822static __inline__ __m512i __DEFAULT_FN_ATTRS5124540static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4823_mm512_cvtepi16_epi64(__m128i __A)4541_mm512_cvtepi16_epi64(__m128i __A) {
4824{
4825 return (__m512i)__builtin_convertvector((__v8hi)__A, __v8di);4542 return (__m512i)__builtin_convertvector((__v8hi)__A, __v8di);
4826}4543}
48274544
4828static __inline__ __m512i __DEFAULT_FN_ATTRS5124545static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4829_mm512_mask_cvtepi16_epi64(__m512i __W, __mmask8 __U, __m128i __A)4546_mm512_mask_cvtepi16_epi64(__m512i __W, __mmask8 __U, __m128i __A) {
4830{
4831 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4547 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4832 (__v8di)_mm512_cvtepi16_epi64(__A),4548 (__v8di)_mm512_cvtepi16_epi64(__A),
4833 (__v8di)__W);4549 (__v8di)__W);
4834}4550}
48354551
4836static __inline__ __m512i __DEFAULT_FN_ATTRS5124552static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4837_mm512_maskz_cvtepi16_epi64(__mmask8 __U, __m128i __A)4553_mm512_maskz_cvtepi16_epi64(__mmask8 __U, __m128i __A) {
4838{
4839 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4554 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4840 (__v8di)_mm512_cvtepi16_epi64(__A),4555 (__v8di)_mm512_cvtepi16_epi64(__A),
4841 (__v8di)_mm512_setzero_si512());4556 (__v8di)_mm512_setzero_si512());
4842}4557}
48434558
4844static __inline__ __m512i __DEFAULT_FN_ATTRS5124559static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4845_mm512_cvtepu8_epi32(__m128i __A)4560_mm512_cvtepu8_epi32(__m128i __A) {
4846{
4847 return (__m512i)__builtin_convertvector((__v16qu)__A, __v16si);4561 return (__m512i)__builtin_convertvector((__v16qu)__A, __v16si);
4848}4562}
48494563
4850static __inline__ __m512i __DEFAULT_FN_ATTRS5124564static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4851_mm512_mask_cvtepu8_epi32(__m512i __W, __mmask16 __U, __m128i __A)4565_mm512_mask_cvtepu8_epi32(__m512i __W, __mmask16 __U, __m128i __A) {
4852{
4853 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4566 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4854 (__v16si)_mm512_cvtepu8_epi32(__A),4567 (__v16si)_mm512_cvtepu8_epi32(__A),
4855 (__v16si)__W);4568 (__v16si)__W);
4856}4569}
48574570
4858static __inline__ __m512i __DEFAULT_FN_ATTRS5124571static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4859_mm512_maskz_cvtepu8_epi32(__mmask16 __U, __m128i __A)4572_mm512_maskz_cvtepu8_epi32(__mmask16 __U, __m128i __A) {
4860{
4861 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4573 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4862 (__v16si)_mm512_cvtepu8_epi32(__A),4574 (__v16si)_mm512_cvtepu8_epi32(__A),
4863 (__v16si)_mm512_setzero_si512());4575 (__v16si)_mm512_setzero_si512());
4864}4576}
48654577
4866static __inline__ __m512i __DEFAULT_FN_ATTRS5124578static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4867_mm512_cvtepu8_epi64(__m128i __A)4579_mm512_cvtepu8_epi64(__m128i __A) {
4868{
4869 return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__A, (__v16qu)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di);4580 return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__A, (__v16qu)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di);
4870}4581}
48714582
4872static __inline__ __m512i __DEFAULT_FN_ATTRS5124583static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4873_mm512_mask_cvtepu8_epi64(__m512i __W, __mmask8 __U, __m128i __A)4584_mm512_mask_cvtepu8_epi64(__m512i __W, __mmask8 __U, __m128i __A) {
4874{
4875 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4585 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4876 (__v8di)_mm512_cvtepu8_epi64(__A),4586 (__v8di)_mm512_cvtepu8_epi64(__A),
4877 (__v8di)__W);4587 (__v8di)__W);
4878}4588}
48794589
4880static __inline__ __m512i __DEFAULT_FN_ATTRS5124590static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4881_mm512_maskz_cvtepu8_epi64(__mmask8 __U, __m128i __A)4591_mm512_maskz_cvtepu8_epi64(__mmask8 __U, __m128i __A) {
4882{
4883 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4592 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4884 (__v8di)_mm512_cvtepu8_epi64(__A),4593 (__v8di)_mm512_cvtepu8_epi64(__A),
4885 (__v8di)_mm512_setzero_si512());4594 (__v8di)_mm512_setzero_si512());
4886}4595}
48874596
4888static __inline__ __m512i __DEFAULT_FN_ATTRS5124597static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4889_mm512_cvtepu32_epi64(__m256i __X)4598_mm512_cvtepu32_epi64(__m256i __X) {
4890{
4891 return (__m512i)__builtin_convertvector((__v8su)__X, __v8di);4599 return (__m512i)__builtin_convertvector((__v8su)__X, __v8di);
4892}4600}
48934601
4894static __inline__ __m512i __DEFAULT_FN_ATTRS5124602static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4895_mm512_mask_cvtepu32_epi64(__m512i __W, __mmask8 __U, __m256i __X)4603_mm512_mask_cvtepu32_epi64(__m512i __W, __mmask8 __U, __m256i __X) {
4896{
4897 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4604 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4898 (__v8di)_mm512_cvtepu32_epi64(__X),4605 (__v8di)_mm512_cvtepu32_epi64(__X),
4899 (__v8di)__W);4606 (__v8di)__W);
4900}4607}
49014608
4902static __inline__ __m512i __DEFAULT_FN_ATTRS5124609static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4903_mm512_maskz_cvtepu32_epi64(__mmask8 __U, __m256i __X)4610_mm512_maskz_cvtepu32_epi64(__mmask8 __U, __m256i __X) {
4904{
4905 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4611 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4906 (__v8di)_mm512_cvtepu32_epi64(__X),4612 (__v8di)_mm512_cvtepu32_epi64(__X),
4907 (__v8di)_mm512_setzero_si512());4613 (__v8di)_mm512_setzero_si512());
4908}4614}
49094615
4910static __inline__ __m512i __DEFAULT_FN_ATTRS5124616static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4911_mm512_cvtepu16_epi32(__m256i __A)4617_mm512_cvtepu16_epi32(__m256i __A) {
4912{
4913 return (__m512i)__builtin_convertvector((__v16hu)__A, __v16si);4618 return (__m512i)__builtin_convertvector((__v16hu)__A, __v16si);
4914}4619}
49154620
4916static __inline__ __m512i __DEFAULT_FN_ATTRS5124621static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4917_mm512_mask_cvtepu16_epi32(__m512i __W, __mmask16 __U, __m256i __A)4622_mm512_mask_cvtepu16_epi32(__m512i __W, __mmask16 __U, __m256i __A) {
4918{
4919 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4623 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4920 (__v16si)_mm512_cvtepu16_epi32(__A),4624 (__v16si)_mm512_cvtepu16_epi32(__A),
4921 (__v16si)__W);4625 (__v16si)__W);
4922}4626}
49234627
4924static __inline__ __m512i __DEFAULT_FN_ATTRS5124628static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4925_mm512_maskz_cvtepu16_epi32(__mmask16 __U, __m256i __A)4629_mm512_maskz_cvtepu16_epi32(__mmask16 __U, __m256i __A) {
4926{
4927 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4630 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4928 (__v16si)_mm512_cvtepu16_epi32(__A),4631 (__v16si)_mm512_cvtepu16_epi32(__A),
4929 (__v16si)_mm512_setzero_si512());4632 (__v16si)_mm512_setzero_si512());
4930}4633}
49314634
4932static __inline__ __m512i __DEFAULT_FN_ATTRS5124635static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4933_mm512_cvtepu16_epi64(__m128i __A)4636_mm512_cvtepu16_epi64(__m128i __A) {
4934{
4935 return (__m512i)__builtin_convertvector((__v8hu)__A, __v8di);4637 return (__m512i)__builtin_convertvector((__v8hu)__A, __v8di);
4936}4638}
49374639
4938static __inline__ __m512i __DEFAULT_FN_ATTRS5124640static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4939_mm512_mask_cvtepu16_epi64(__m512i __W, __mmask8 __U, __m128i __A)4641_mm512_mask_cvtepu16_epi64(__m512i __W, __mmask8 __U, __m128i __A) {
4940{
4941 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4642 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4942 (__v8di)_mm512_cvtepu16_epi64(__A),4643 (__v8di)_mm512_cvtepu16_epi64(__A),
4943 (__v8di)__W);4644 (__v8di)__W);
4944}4645}
49454646
4946static __inline__ __m512i __DEFAULT_FN_ATTRS5124647static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4947_mm512_maskz_cvtepu16_epi64(__mmask8 __U, __m128i __A)4648_mm512_maskz_cvtepu16_epi64(__mmask8 __U, __m128i __A) {
4948{
4949 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4649 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4950 (__v8di)_mm512_cvtepu16_epi64(__A),4650 (__v8di)_mm512_cvtepu16_epi64(__A),
4951 (__v8di)_mm512_setzero_si512());4651 (__v8di)_mm512_setzero_si512());
4952}4652}
49534653
4954static __inline__ __m512i __DEFAULT_FN_ATTRS5124654static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4955_mm512_rorv_epi32 (__m512i __A, __m512i __B)4655_mm512_rorv_epi32 (__m512i __A, __m512i __B)
4956{4656{
4957 return (__m512i)__builtin_ia32_prorvd512((__v16si)__A, (__v16si)__B);4657 return (__m512i)__builtin_elementwise_fshr((__v16su)__A,(__v16su)__A, (__v16su)__B);
4958}4658}
49594659
4960static __inline__ __m512i __DEFAULT_FN_ATTRS5124660static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4961_mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)4661_mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
4962{4662{
4963 return (__m512i)__builtin_ia32_selectd_512(__U,4663 return (__m512i)__builtin_ia32_selectd_512(__U,
...@@ -4965,7 +4665,7 @@ _mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)...@@ -4965,7 +4665,7 @@ _mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
4965 (__v16si)__W);4665 (__v16si)__W);
4966}4666}
49674667
4968static __inline__ __m512i __DEFAULT_FN_ATTRS5124668static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4969_mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)4669_mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
4970{4670{
4971 return (__m512i)__builtin_ia32_selectd_512(__U,4671 return (__m512i)__builtin_ia32_selectd_512(__U,
...@@ -4973,13 +4673,13 @@ _mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)...@@ -4973,13 +4673,13 @@ _mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
4973 (__v16si)_mm512_setzero_si512());4673 (__v16si)_mm512_setzero_si512());
4974}4674}
49754675
4976static __inline__ __m512i __DEFAULT_FN_ATTRS5124676static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4977_mm512_rorv_epi64 (__m512i __A, __m512i __B)4677_mm512_rorv_epi64 (__m512i __A, __m512i __B)
4978{4678{
4979 return (__m512i)__builtin_ia32_prorvq512((__v8di)__A, (__v8di)__B);4679 return (__m512i)__builtin_elementwise_fshr((__v8du)__A, (__v8du)__A, (__v8du)__B);
4980}4680}
49814681
4982static __inline__ __m512i __DEFAULT_FN_ATTRS5124682static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4983_mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)4683_mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
4984{4684{
4985 return (__m512i)__builtin_ia32_selectq_512(__U,4685 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -4987,7 +4687,7 @@ _mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)...@@ -4987,7 +4687,7 @@ _mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
4987 (__v8di)__W);4687 (__v8di)__W);
4988}4688}
49894689
4990static __inline__ __m512i __DEFAULT_FN_ATTRS5124690static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
4991_mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)4691_mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)
4992{4692{
4993 return (__m512i)__builtin_ia32_selectq_512(__U,4693 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -5063,13 +4763,13 @@ _mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)...@@ -5063,13 +4763,13 @@ _mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)
5063 (__v8di)_mm512_rol_epi64((a), (b)), \4763 (__v8di)_mm512_rol_epi64((a), (b)), \
5064 (__v8di)_mm512_setzero_si512()))4764 (__v8di)_mm512_setzero_si512()))
50654765
5066static __inline__ __m512i __DEFAULT_FN_ATTRS5124766static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5067_mm512_rolv_epi32 (__m512i __A, __m512i __B)4767_mm512_rolv_epi32 (__m512i __A, __m512i __B)
5068{4768{
5069 return (__m512i)__builtin_ia32_prolvd512((__v16si)__A, (__v16si)__B);4769 return (__m512i)__builtin_elementwise_fshl((__v16su)__A, (__v16su)__A, (__v16su)__B);
5070}4770}
50714771
5072static __inline__ __m512i __DEFAULT_FN_ATTRS5124772static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5073_mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)4773_mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
5074{4774{
5075 return (__m512i)__builtin_ia32_selectd_512(__U,4775 return (__m512i)__builtin_ia32_selectd_512(__U,
...@@ -5077,7 +4777,7 @@ _mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)...@@ -5077,7 +4777,7 @@ _mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
5077 (__v16si)__W);4777 (__v16si)__W);
5078}4778}
50794779
5080static __inline__ __m512i __DEFAULT_FN_ATTRS5124780static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5081_mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)4781_mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
5082{4782{
5083 return (__m512i)__builtin_ia32_selectd_512(__U,4783 return (__m512i)__builtin_ia32_selectd_512(__U,
...@@ -5085,13 +4785,13 @@ _mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)...@@ -5085,13 +4785,13 @@ _mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
5085 (__v16si)_mm512_setzero_si512());4785 (__v16si)_mm512_setzero_si512());
5086}4786}
50874787
5088static __inline__ __m512i __DEFAULT_FN_ATTRS5124788static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5089_mm512_rolv_epi64 (__m512i __A, __m512i __B)4789_mm512_rolv_epi64 (__m512i __A, __m512i __B)
5090{4790{
5091 return (__m512i)__builtin_ia32_prolvq512((__v8di)__A, (__v8di)__B);4791 return (__m512i)__builtin_elementwise_fshl((__v8du)__A, (__v8du)__A, (__v8du)__B);
5092}4792}
50934793
5094static __inline__ __m512i __DEFAULT_FN_ATTRS5124794static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5095_mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)4795_mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
5096{4796{
5097 return (__m512i)__builtin_ia32_selectq_512(__U,4797 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -5099,7 +4799,7 @@ _mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)...@@ -5099,7 +4799,7 @@ _mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
5099 (__v8di)__W);4799 (__v8di)__W);
5100}4800}
51014801
5102static __inline__ __m512i __DEFAULT_FN_ATTRS5124802static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5103_mm512_maskz_rolv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)4803_mm512_maskz_rolv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)
5104{4804{
5105 return (__m512i)__builtin_ia32_selectq_512(__U,4805 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -5133,91 +4833,81 @@ _mm512_maskz_rolv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)...@@ -5133,91 +4833,81 @@ _mm512_maskz_rolv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)
5133 (__v8di)_mm512_ror_epi64((A), (B)), \4833 (__v8di)_mm512_ror_epi64((A), (B)), \
5134 (__v8di)_mm512_setzero_si512()))4834 (__v8di)_mm512_setzero_si512()))
51354835
5136static __inline__ __m512i __DEFAULT_FN_ATTRS5124836static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5137_mm512_slli_epi32(__m512i __A, unsigned int __B)4837_mm512_slli_epi32(__m512i __A, unsigned int __B) {
5138{
5139 return (__m512i)__builtin_ia32_pslldi512((__v16si)__A, (int)__B);4838 return (__m512i)__builtin_ia32_pslldi512((__v16si)__A, (int)__B);
5140}4839}
51414840
5142static __inline__ __m512i __DEFAULT_FN_ATTRS5124841static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5143_mm512_mask_slli_epi32(__m512i __W, __mmask16 __U, __m512i __A,4842_mm512_mask_slli_epi32(__m512i __W, __mmask16 __U, __m512i __A,
5144 unsigned int __B)4843 unsigned int __B) {
5145{
5146 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4844 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5147 (__v16si)_mm512_slli_epi32(__A, __B),4845 (__v16si)_mm512_slli_epi32(__A, __B),
5148 (__v16si)__W);4846 (__v16si)__W);
5149}4847}
51504848
5151static __inline__ __m512i __DEFAULT_FN_ATTRS5124849static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5152_mm512_maskz_slli_epi32(__mmask16 __U, __m512i __A, unsigned int __B) {4850_mm512_maskz_slli_epi32(__mmask16 __U, __m512i __A, unsigned int __B) {
5153 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4851 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5154 (__v16si)_mm512_slli_epi32(__A, __B),4852 (__v16si)_mm512_slli_epi32(__A, __B),
5155 (__v16si)_mm512_setzero_si512());4853 (__v16si)_mm512_setzero_si512());
5156}4854}
51574855
5158static __inline__ __m512i __DEFAULT_FN_ATTRS5124856static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5159_mm512_slli_epi64(__m512i __A, unsigned int __B)4857_mm512_slli_epi64(__m512i __A, unsigned int __B) {
5160{
5161 return (__m512i)__builtin_ia32_psllqi512((__v8di)__A, (int)__B);4858 return (__m512i)__builtin_ia32_psllqi512((__v8di)__A, (int)__B);
5162}4859}
51634860
5164static __inline__ __m512i __DEFAULT_FN_ATTRS5124861static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5165_mm512_mask_slli_epi64(__m512i __W, __mmask8 __U, __m512i __A, unsigned int __B)4862_mm512_mask_slli_epi64(__m512i __W, __mmask8 __U, __m512i __A,
5166{4863 unsigned int __B) {
5167 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4864 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5168 (__v8di)_mm512_slli_epi64(__A, __B),4865 (__v8di)_mm512_slli_epi64(__A, __B),
5169 (__v8di)__W);4866 (__v8di)__W);
5170}4867}
51714868
5172static __inline__ __m512i __DEFAULT_FN_ATTRS5124869static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5173_mm512_maskz_slli_epi64(__mmask8 __U, __m512i __A, unsigned int __B)4870_mm512_maskz_slli_epi64(__mmask8 __U, __m512i __A, unsigned int __B) {
5174{
5175 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4871 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5176 (__v8di)_mm512_slli_epi64(__A, __B),4872 (__v8di)_mm512_slli_epi64(__A, __B),
5177 (__v8di)_mm512_setzero_si512());4873 (__v8di)_mm512_setzero_si512());
5178}4874}
51794875
5180static __inline__ __m512i __DEFAULT_FN_ATTRS5124876static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5181_mm512_srli_epi32(__m512i __A, unsigned int __B)4877_mm512_srli_epi32(__m512i __A, unsigned int __B) {
5182{
5183 return (__m512i)__builtin_ia32_psrldi512((__v16si)__A, (int)__B);4878 return (__m512i)__builtin_ia32_psrldi512((__v16si)__A, (int)__B);
5184}4879}
51854880
5186static __inline__ __m512i __DEFAULT_FN_ATTRS5124881static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5187_mm512_mask_srli_epi32(__m512i __W, __mmask16 __U, __m512i __A,4882_mm512_mask_srli_epi32(__m512i __W, __mmask16 __U, __m512i __A,
5188 unsigned int __B)4883 unsigned int __B) {
5189{
5190 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4884 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5191 (__v16si)_mm512_srli_epi32(__A, __B),4885 (__v16si)_mm512_srli_epi32(__A, __B),
5192 (__v16si)__W);4886 (__v16si)__W);
5193}4887}
51944888
5195static __inline__ __m512i __DEFAULT_FN_ATTRS5124889static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5196_mm512_maskz_srli_epi32(__mmask16 __U, __m512i __A, unsigned int __B) {4890_mm512_maskz_srli_epi32(__mmask16 __U, __m512i __A, unsigned int __B) {
5197 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,4891 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5198 (__v16si)_mm512_srli_epi32(__A, __B),4892 (__v16si)_mm512_srli_epi32(__A, __B),
5199 (__v16si)_mm512_setzero_si512());4893 (__v16si)_mm512_setzero_si512());
5200}4894}
52014895
5202static __inline__ __m512i __DEFAULT_FN_ATTRS5124896static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5203_mm512_srli_epi64(__m512i __A, unsigned int __B)4897_mm512_srli_epi64(__m512i __A, unsigned int __B) {
5204{
5205 return (__m512i)__builtin_ia32_psrlqi512((__v8di)__A, (int)__B);4898 return (__m512i)__builtin_ia32_psrlqi512((__v8di)__A, (int)__B);
5206}4899}
52074900
5208static __inline__ __m512i __DEFAULT_FN_ATTRS5124901static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5209_mm512_mask_srli_epi64(__m512i __W, __mmask8 __U, __m512i __A,4902_mm512_mask_srli_epi64(__m512i __W, __mmask8 __U, __m512i __A,
5210 unsigned int __B)4903 unsigned int __B) {
5211{
5212 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4904 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5213 (__v8di)_mm512_srli_epi64(__A, __B),4905 (__v8di)_mm512_srli_epi64(__A, __B),
5214 (__v8di)__W);4906 (__v8di)__W);
5215}4907}
52164908
5217static __inline__ __m512i __DEFAULT_FN_ATTRS5124909static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5218_mm512_maskz_srli_epi64(__mmask8 __U, __m512i __A,4910_mm512_maskz_srli_epi64(__mmask8 __U, __m512i __A, unsigned int __B) {
5219 unsigned int __B)
5220{
5221 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,4911 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5222 (__v8di)_mm512_srli_epi64(__A, __B),4912 (__v8di)_mm512_srli_epi64(__A, __B),
5223 (__v8di)_mm512_setzero_si512());4913 (__v8di)_mm512_setzero_si512());
...@@ -5303,7 +4993,7 @@ _mm512_mask_store_epi64 (void *__P, __mmask8 __U, __m512i __A)...@@ -5303,7 +4993,7 @@ _mm512_mask_store_epi64 (void *__P, __mmask8 __U, __m512i __A)
5303 (__mmask8) __U);4993 (__mmask8) __U);
5304}4994}
53054995
5306static __inline__ __m512d __DEFAULT_FN_ATTRS5124996static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
5307_mm512_movedup_pd (__m512d __A)4997_mm512_movedup_pd (__m512d __A)
5308{4998{
5309 return (__m512d)__builtin_shufflevector((__v8df)__A, (__v8df)__A,4999 return (__m512d)__builtin_shufflevector((__v8df)__A, (__v8df)__A,
...@@ -5664,10 +5354,9 @@ _mm_maskz_getexp_ss (__mmask8 __U, __m128 __A, __m128 __B)...@@ -5664,10 +5354,9 @@ _mm_maskz_getexp_ss (__mmask8 __U, __m128 __A, __m128 __B)
5664 (int)(((D)<<2) | (C)), \5354 (int)(((D)<<2) | (C)), \
5665 (__v4sf)_mm_setzero_ps(), \5355 (__v4sf)_mm_setzero_ps(), \
5666 (__mmask8)(U), (int)(R)))5356 (__mmask8)(U), (int)(R)))
56675357
5668static __inline__ __mmask16 __DEFAULT_FN_ATTRS5358static __inline__ __mmask16
5669_mm512_kmov (__mmask16 __A)5359 __DEFAULT_FN_ATTRS_CONSTEXPR _mm512_kmov(__mmask16 __A) {
5670{
5671 return __A;5360 return __A;
5672}5361}
56735362
...@@ -5684,79 +5373,70 @@ _mm512_kmov (__mmask16 __A)...@@ -5684,79 +5373,70 @@ _mm512_kmov (__mmask16 __A)
5684 ((long long)__builtin_ia32_vcvtsd2si64((__v2df)(__m128d)(A), (int)(R)))5373 ((long long)__builtin_ia32_vcvtsd2si64((__v2df)(__m128d)(A), (int)(R)))
5685#endif5374#endif
56865375
5687static __inline__ __m512i __DEFAULT_FN_ATTRS5125376static __inline__ __m512i
5688_mm512_sll_epi32(__m512i __A, __m128i __B)5377 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_sll_epi32(__m512i __A, __m128i __B) {
5689{
5690 return (__m512i)__builtin_ia32_pslld512((__v16si) __A, (__v4si)__B);5378 return (__m512i)__builtin_ia32_pslld512((__v16si) __A, (__v4si)__B);
5691}5379}
56925380
5693static __inline__ __m512i __DEFAULT_FN_ATTRS5125381static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5694_mm512_mask_sll_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B)5382_mm512_mask_sll_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) {
5695{
5696 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5383 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5697 (__v16si)_mm512_sll_epi32(__A, __B),5384 (__v16si)_mm512_sll_epi32(__A, __B),
5698 (__v16si)__W);5385 (__v16si)__W);
5699}5386}
57005387
5701static __inline__ __m512i __DEFAULT_FN_ATTRS5125388static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5702_mm512_maskz_sll_epi32(__mmask16 __U, __m512i __A, __m128i __B)5389_mm512_maskz_sll_epi32(__mmask16 __U, __m512i __A, __m128i __B) {
5703{
5704 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5390 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5705 (__v16si)_mm512_sll_epi32(__A, __B),5391 (__v16si)_mm512_sll_epi32(__A, __B),
5706 (__v16si)_mm512_setzero_si512());5392 (__v16si)_mm512_setzero_si512());
5707}5393}
57085394
5709static __inline__ __m512i __DEFAULT_FN_ATTRS5125395static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5710_mm512_sll_epi64(__m512i __A, __m128i __B)5396_mm512_sll_epi64(__m512i __A, __m128i __B) {
5711{
5712 return (__m512i)__builtin_ia32_psllq512((__v8di)__A, (__v2di)__B);5397 return (__m512i)__builtin_ia32_psllq512((__v8di)__A, (__v2di)__B);
5713}5398}
57145399
5715static __inline__ __m512i __DEFAULT_FN_ATTRS5125400static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5716_mm512_mask_sll_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B)5401_mm512_mask_sll_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) {
5717{
5718 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5402 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5719 (__v8di)_mm512_sll_epi64(__A, __B),5403 (__v8di)_mm512_sll_epi64(__A, __B),
5720 (__v8di)__W);5404 (__v8di)__W);
5721}5405}
57225406
5723static __inline__ __m512i __DEFAULT_FN_ATTRS5125407static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5724_mm512_maskz_sll_epi64(__mmask8 __U, __m512i __A, __m128i __B)5408_mm512_maskz_sll_epi64(__mmask8 __U, __m512i __A, __m128i __B) {
5725{
5726 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5409 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5727 (__v8di)_mm512_sll_epi64(__A, __B),5410 (__v8di)_mm512_sll_epi64(__A, __B),
5728 (__v8di)_mm512_setzero_si512());5411 (__v8di)_mm512_setzero_si512());
5729}5412}
57305413
5731static __inline__ __m512i __DEFAULT_FN_ATTRS5125414static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5732_mm512_sllv_epi32(__m512i __X, __m512i __Y)5415_mm512_sllv_epi32(__m512i __X, __m512i __Y) {
5733{
5734 return (__m512i)__builtin_ia32_psllv16si((__v16si)__X, (__v16si)__Y);5416 return (__m512i)__builtin_ia32_psllv16si((__v16si)__X, (__v16si)__Y);
5735}5417}
57365418
5737static __inline__ __m512i __DEFAULT_FN_ATTRS5125419static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5738_mm512_mask_sllv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y)5420_mm512_mask_sllv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) {
5739{
5740 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5421 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5741 (__v16si)_mm512_sllv_epi32(__X, __Y),5422 (__v16si)_mm512_sllv_epi32(__X, __Y),
5742 (__v16si)__W);5423 (__v16si)__W);
5743}5424}
57445425
5745static __inline__ __m512i __DEFAULT_FN_ATTRS5125426static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5746_mm512_maskz_sllv_epi32(__mmask16 __U, __m512i __X, __m512i __Y)5427_mm512_maskz_sllv_epi32(__mmask16 __U, __m512i __X, __m512i __Y) {
5747{
5748 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5428 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5749 (__v16si)_mm512_sllv_epi32(__X, __Y),5429 (__v16si)_mm512_sllv_epi32(__X, __Y),
5750 (__v16si)_mm512_setzero_si512());5430 (__v16si)_mm512_setzero_si512());
5751}5431}
57525432
5753static __inline__ __m512i __DEFAULT_FN_ATTRS5125433static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5754_mm512_sllv_epi64(__m512i __X, __m512i __Y)5434_mm512_sllv_epi64(__m512i __X, __m512i __Y)
5755{5435{
5756 return (__m512i)__builtin_ia32_psllv8di((__v8di)__X, (__v8di)__Y);5436 return (__m512i)__builtin_ia32_psllv8di((__v8di)__X, (__v8di)__Y);
5757}5437}
57585438
5759static __inline__ __m512i __DEFAULT_FN_ATTRS5125439static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5760_mm512_mask_sllv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)5440_mm512_mask_sllv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)
5761{5441{
5762 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5442 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
...@@ -5764,7 +5444,7 @@ _mm512_mask_sllv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)...@@ -5764,7 +5444,7 @@ _mm512_mask_sllv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)
5764 (__v8di)__W);5444 (__v8di)__W);
5765}5445}
57665446
5767static __inline__ __m512i __DEFAULT_FN_ATTRS5125447static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5768_mm512_maskz_sllv_epi64(__mmask8 __U, __m512i __X, __m512i __Y)5448_mm512_maskz_sllv_epi64(__mmask8 __U, __m512i __X, __m512i __Y)
5769{5449{
5770 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5450 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
...@@ -5772,79 +5452,70 @@ _mm512_maskz_sllv_epi64(__mmask8 __U, __m512i __X, __m512i __Y)...@@ -5772,79 +5452,70 @@ _mm512_maskz_sllv_epi64(__mmask8 __U, __m512i __X, __m512i __Y)
5772 (__v8di)_mm512_setzero_si512());5452 (__v8di)_mm512_setzero_si512());
5773}5453}
57745454
5775static __inline__ __m512i __DEFAULT_FN_ATTRS5125455static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5776_mm512_sra_epi32(__m512i __A, __m128i __B)5456_mm512_sra_epi32(__m512i __A, __m128i __B) {
5777{
5778 return (__m512i)__builtin_ia32_psrad512((__v16si) __A, (__v4si)__B);5457 return (__m512i)__builtin_ia32_psrad512((__v16si) __A, (__v4si)__B);
5779}5458}
57805459
5781static __inline__ __m512i __DEFAULT_FN_ATTRS5125460static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5782_mm512_mask_sra_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B)5461_mm512_mask_sra_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) {
5783{
5784 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5462 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5785 (__v16si)_mm512_sra_epi32(__A, __B),5463 (__v16si)_mm512_sra_epi32(__A, __B),
5786 (__v16si)__W);5464 (__v16si)__W);
5787}5465}
57885466
5789static __inline__ __m512i __DEFAULT_FN_ATTRS5125467static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5790_mm512_maskz_sra_epi32(__mmask16 __U, __m512i __A, __m128i __B)5468_mm512_maskz_sra_epi32(__mmask16 __U, __m512i __A, __m128i __B) {
5791{
5792 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5469 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5793 (__v16si)_mm512_sra_epi32(__A, __B),5470 (__v16si)_mm512_sra_epi32(__A, __B),
5794 (__v16si)_mm512_setzero_si512());5471 (__v16si)_mm512_setzero_si512());
5795}5472}
57965473
5797static __inline__ __m512i __DEFAULT_FN_ATTRS5125474static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5798_mm512_sra_epi64(__m512i __A, __m128i __B)5475_mm512_sra_epi64(__m512i __A, __m128i __B) {
5799{
5800 return (__m512i)__builtin_ia32_psraq512((__v8di)__A, (__v2di)__B);5476 return (__m512i)__builtin_ia32_psraq512((__v8di)__A, (__v2di)__B);
5801}5477}
58025478
5803static __inline__ __m512i __DEFAULT_FN_ATTRS5125479static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5804_mm512_mask_sra_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B)5480_mm512_mask_sra_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) {
5805{
5806 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5481 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5807 (__v8di)_mm512_sra_epi64(__A, __B),5482 (__v8di)_mm512_sra_epi64(__A, __B),
5808 (__v8di)__W);5483 (__v8di)__W);
5809}5484}
58105485
5811static __inline__ __m512i __DEFAULT_FN_ATTRS5125486static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5812_mm512_maskz_sra_epi64(__mmask8 __U, __m512i __A, __m128i __B)5487_mm512_maskz_sra_epi64(__mmask8 __U, __m512i __A, __m128i __B) {
5813{
5814 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5488 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5815 (__v8di)_mm512_sra_epi64(__A, __B),5489 (__v8di)_mm512_sra_epi64(__A, __B),
5816 (__v8di)_mm512_setzero_si512());5490 (__v8di)_mm512_setzero_si512());
5817}5491}
58185492
5819static __inline__ __m512i __DEFAULT_FN_ATTRS5125493static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5820_mm512_srav_epi32(__m512i __X, __m512i __Y)5494_mm512_srav_epi32(__m512i __X, __m512i __Y) {
5821{
5822 return (__m512i)__builtin_ia32_psrav16si((__v16si)__X, (__v16si)__Y);5495 return (__m512i)__builtin_ia32_psrav16si((__v16si)__X, (__v16si)__Y);
5823}5496}
58245497
5825static __inline__ __m512i __DEFAULT_FN_ATTRS5125498static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5826_mm512_mask_srav_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y)5499_mm512_mask_srav_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) {
5827{
5828 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5500 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5829 (__v16si)_mm512_srav_epi32(__X, __Y),5501 (__v16si)_mm512_srav_epi32(__X, __Y),
5830 (__v16si)__W);5502 (__v16si)__W);
5831}5503}
58325504
5833static __inline__ __m512i __DEFAULT_FN_ATTRS5125505static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5834_mm512_maskz_srav_epi32(__mmask16 __U, __m512i __X, __m512i __Y)5506_mm512_maskz_srav_epi32(__mmask16 __U, __m512i __X, __m512i __Y) {
5835{
5836 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5507 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5837 (__v16si)_mm512_srav_epi32(__X, __Y),5508 (__v16si)_mm512_srav_epi32(__X, __Y),
5838 (__v16si)_mm512_setzero_si512());5509 (__v16si)_mm512_setzero_si512());
5839}5510}
58405511
5841static __inline__ __m512i __DEFAULT_FN_ATTRS5125512static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5842_mm512_srav_epi64(__m512i __X, __m512i __Y)5513_mm512_srav_epi64(__m512i __X, __m512i __Y)
5843{5514{
5844 return (__m512i)__builtin_ia32_psrav8di((__v8di)__X, (__v8di)__Y);5515 return (__m512i)__builtin_ia32_psrav8di((__v8di)__X, (__v8di)__Y);
5845}5516}
58465517
5847static __inline__ __m512i __DEFAULT_FN_ATTRS5125518static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5848_mm512_mask_srav_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)5519_mm512_mask_srav_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)
5849{5520{
5850 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5521 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
...@@ -5852,7 +5523,7 @@ _mm512_mask_srav_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)...@@ -5852,7 +5523,7 @@ _mm512_mask_srav_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)
5852 (__v8di)__W);5523 (__v8di)__W);
5853}5524}
58545525
5855static __inline__ __m512i __DEFAULT_FN_ATTRS5125526static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5856_mm512_maskz_srav_epi64(__mmask8 __U, __m512i __X, __m512i __Y)5527_mm512_maskz_srav_epi64(__mmask8 __U, __m512i __X, __m512i __Y)
5857{5528{
5858 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5529 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
...@@ -5860,79 +5531,70 @@ _mm512_maskz_srav_epi64(__mmask8 __U, __m512i __X, __m512i __Y)...@@ -5860,79 +5531,70 @@ _mm512_maskz_srav_epi64(__mmask8 __U, __m512i __X, __m512i __Y)
5860 (__v8di)_mm512_setzero_si512());5531 (__v8di)_mm512_setzero_si512());
5861}5532}
58625533
5863static __inline__ __m512i __DEFAULT_FN_ATTRS5125534static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5864_mm512_srl_epi32(__m512i __A, __m128i __B)5535_mm512_srl_epi32(__m512i __A, __m128i __B) {
5865{
5866 return (__m512i)__builtin_ia32_psrld512((__v16si) __A, (__v4si)__B);5536 return (__m512i)__builtin_ia32_psrld512((__v16si) __A, (__v4si)__B);
5867}5537}
58685538
5869static __inline__ __m512i __DEFAULT_FN_ATTRS5125539static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5870_mm512_mask_srl_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B)5540_mm512_mask_srl_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) {
5871{
5872 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5541 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5873 (__v16si)_mm512_srl_epi32(__A, __B),5542 (__v16si)_mm512_srl_epi32(__A, __B),
5874 (__v16si)__W);5543 (__v16si)__W);
5875}5544}
58765545
5877static __inline__ __m512i __DEFAULT_FN_ATTRS5125546static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5878_mm512_maskz_srl_epi32(__mmask16 __U, __m512i __A, __m128i __B)5547_mm512_maskz_srl_epi32(__mmask16 __U, __m512i __A, __m128i __B) {
5879{
5880 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5548 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5881 (__v16si)_mm512_srl_epi32(__A, __B),5549 (__v16si)_mm512_srl_epi32(__A, __B),
5882 (__v16si)_mm512_setzero_si512());5550 (__v16si)_mm512_setzero_si512());
5883}5551}
58845552
5885static __inline__ __m512i __DEFAULT_FN_ATTRS5125553static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5886_mm512_srl_epi64(__m512i __A, __m128i __B)5554_mm512_srl_epi64(__m512i __A, __m128i __B) {
5887{
5888 return (__m512i)__builtin_ia32_psrlq512((__v8di)__A, (__v2di)__B);5555 return (__m512i)__builtin_ia32_psrlq512((__v8di)__A, (__v2di)__B);
5889}5556}
58905557
5891static __inline__ __m512i __DEFAULT_FN_ATTRS5125558static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5892_mm512_mask_srl_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B)5559_mm512_mask_srl_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) {
5893{
5894 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5560 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5895 (__v8di)_mm512_srl_epi64(__A, __B),5561 (__v8di)_mm512_srl_epi64(__A, __B),
5896 (__v8di)__W);5562 (__v8di)__W);
5897}5563}
58985564
5899static __inline__ __m512i __DEFAULT_FN_ATTRS5125565static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5900_mm512_maskz_srl_epi64(__mmask8 __U, __m512i __A, __m128i __B)5566_mm512_maskz_srl_epi64(__mmask8 __U, __m512i __A, __m128i __B) {
5901{
5902 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5567 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
5903 (__v8di)_mm512_srl_epi64(__A, __B),5568 (__v8di)_mm512_srl_epi64(__A, __B),
5904 (__v8di)_mm512_setzero_si512());5569 (__v8di)_mm512_setzero_si512());
5905}5570}
59065571
5907static __inline__ __m512i __DEFAULT_FN_ATTRS5125572static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5908_mm512_srlv_epi32(__m512i __X, __m512i __Y)5573_mm512_srlv_epi32(__m512i __X, __m512i __Y) {
5909{
5910 return (__m512i)__builtin_ia32_psrlv16si((__v16si)__X, (__v16si)__Y);5574 return (__m512i)__builtin_ia32_psrlv16si((__v16si)__X, (__v16si)__Y);
5911}5575}
59125576
5913static __inline__ __m512i __DEFAULT_FN_ATTRS5125577static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5914_mm512_mask_srlv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y)5578_mm512_mask_srlv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) {
5915{
5916 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5579 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5917 (__v16si)_mm512_srlv_epi32(__X, __Y),5580 (__v16si)_mm512_srlv_epi32(__X, __Y),
5918 (__v16si)__W);5581 (__v16si)__W);
5919}5582}
59205583
5921static __inline__ __m512i __DEFAULT_FN_ATTRS5125584static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5922_mm512_maskz_srlv_epi32(__mmask16 __U, __m512i __X, __m512i __Y)5585_mm512_maskz_srlv_epi32(__mmask16 __U, __m512i __X, __m512i __Y) {
5923{
5924 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,5586 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
5925 (__v16si)_mm512_srlv_epi32(__X, __Y),5587 (__v16si)_mm512_srlv_epi32(__X, __Y),
5926 (__v16si)_mm512_setzero_si512());5588 (__v16si)_mm512_setzero_si512());
5927}5589}
59285590
5929static __inline__ __m512i __DEFAULT_FN_ATTRS5125591static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5930_mm512_srlv_epi64 (__m512i __X, __m512i __Y)5592_mm512_srlv_epi64 (__m512i __X, __m512i __Y)
5931{5593{
5932 return (__m512i)__builtin_ia32_psrlv8di((__v8di)__X, (__v8di)__Y);5594 return (__m512i)__builtin_ia32_psrlv8di((__v8di)__X, (__v8di)__Y);
5933}5595}
59345596
5935static __inline__ __m512i __DEFAULT_FN_ATTRS5125597static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5936_mm512_mask_srlv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)5598_mm512_mask_srlv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)
5937{5599{
5938 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5600 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
...@@ -5940,7 +5602,7 @@ _mm512_mask_srlv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)...@@ -5940,7 +5602,7 @@ _mm512_mask_srlv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y)
5940 (__v8di)__W);5602 (__v8di)__W);
5941}5603}
59425604
5943static __inline__ __m512i __DEFAULT_FN_ATTRS5125605static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
5944_mm512_maskz_srlv_epi64(__mmask8 __U, __m512i __X, __m512i __Y)5606_mm512_maskz_srlv_epi64(__mmask8 __U, __m512i __X, __m512i __Y)
5945{5607{
5946 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,5608 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
...@@ -6190,115 +5852,104 @@ _mm_cvttss_u64 (__m128 __A)...@@ -6190,115 +5852,104 @@ _mm_cvttss_u64 (__m128 __A)
6190 (__v16sf)_mm512_permute_ps((X), (C)), \5852 (__v16sf)_mm512_permute_ps((X), (C)), \
6191 (__v16sf)_mm512_setzero_ps()))5853 (__v16sf)_mm512_setzero_ps()))
61925854
6193static __inline__ __m512d __DEFAULT_FN_ATTRS5125855static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6194_mm512_permutevar_pd(__m512d __A, __m512i __C)5856_mm512_permutevar_pd(__m512d __A, __m512i __C) {
6195{
6196 return (__m512d)__builtin_ia32_vpermilvarpd512((__v8df)__A, (__v8di)__C);5857 return (__m512d)__builtin_ia32_vpermilvarpd512((__v8df)__A, (__v8di)__C);
6197}5858}
61985859
6199static __inline__ __m512d __DEFAULT_FN_ATTRS5125860static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6200_mm512_mask_permutevar_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512i __C)5861_mm512_mask_permutevar_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512i __C) {
6201{
6202 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,5862 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
6203 (__v8df)_mm512_permutevar_pd(__A, __C),5863 (__v8df)_mm512_permutevar_pd(__A, __C),
6204 (__v8df)__W);5864 (__v8df)__W);
6205}5865}
62065866
6207static __inline__ __m512d __DEFAULT_FN_ATTRS5125867static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6208_mm512_maskz_permutevar_pd(__mmask8 __U, __m512d __A, __m512i __C)5868_mm512_maskz_permutevar_pd(__mmask8 __U, __m512d __A, __m512i __C) {
6209{
6210 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,5869 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
6211 (__v8df)_mm512_permutevar_pd(__A, __C),5870 (__v8df)_mm512_permutevar_pd(__A, __C),
6212 (__v8df)_mm512_setzero_pd());5871 (__v8df)_mm512_setzero_pd());
6213}5872}
62145873
6215static __inline__ __m512 __DEFAULT_FN_ATTRS5125874static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6216_mm512_permutevar_ps(__m512 __A, __m512i __C)5875_mm512_permutevar_ps(__m512 __A, __m512i __C) {
6217{
6218 return (__m512)__builtin_ia32_vpermilvarps512((__v16sf)__A, (__v16si)__C);5876 return (__m512)__builtin_ia32_vpermilvarps512((__v16sf)__A, (__v16si)__C);
6219}5877}
62205878
6221static __inline__ __m512 __DEFAULT_FN_ATTRS5125879static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6222_mm512_mask_permutevar_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512i __C)5880_mm512_mask_permutevar_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512i __C) {
6223{
6224 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,5881 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
6225 (__v16sf)_mm512_permutevar_ps(__A, __C),5882 (__v16sf)_mm512_permutevar_ps(__A, __C),
6226 (__v16sf)__W);5883 (__v16sf)__W);
6227}5884}
62285885
6229static __inline__ __m512 __DEFAULT_FN_ATTRS5125886static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6230_mm512_maskz_permutevar_ps(__mmask16 __U, __m512 __A, __m512i __C)5887_mm512_maskz_permutevar_ps(__mmask16 __U, __m512 __A, __m512i __C) {
6231{
6232 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,5888 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
6233 (__v16sf)_mm512_permutevar_ps(__A, __C),5889 (__v16sf)_mm512_permutevar_ps(__A, __C),
6234 (__v16sf)_mm512_setzero_ps());5890 (__v16sf)_mm512_setzero_ps());
6235}5891}
62365892
6237static __inline __m512d __DEFAULT_FN_ATTRS5125893static __inline __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6238_mm512_permutex2var_pd(__m512d __A, __m512i __I, __m512d __B)5894_mm512_permutex2var_pd(__m512d __A, __m512i __I, __m512d __B) {
6239{
6240 return (__m512d)__builtin_ia32_vpermi2varpd512((__v8df)__A, (__v8di)__I,5895 return (__m512d)__builtin_ia32_vpermi2varpd512((__v8df)__A, (__v8di)__I,
6241 (__v8df)__B);5896 (__v8df)__B);
6242}5897}
62435898
6244static __inline__ __m512d __DEFAULT_FN_ATTRS5125899static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6245_mm512_mask_permutex2var_pd(__m512d __A, __mmask8 __U, __m512i __I, __m512d __B)5900_mm512_mask_permutex2var_pd(__m512d __A, __mmask8 __U, __m512i __I,
6246{5901 __m512d __B) {
6247 return (__m512d)__builtin_ia32_selectpd_512(__U,5902 return (__m512d)__builtin_ia32_selectpd_512(__U,
6248 (__v8df)_mm512_permutex2var_pd(__A, __I, __B),5903 (__v8df)_mm512_permutex2var_pd(__A, __I, __B),
6249 (__v8df)__A);5904 (__v8df)__A);
6250}5905}
62515906
6252static __inline__ __m512d __DEFAULT_FN_ATTRS5125907static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6253_mm512_mask2_permutex2var_pd(__m512d __A, __m512i __I, __mmask8 __U,5908_mm512_mask2_permutex2var_pd(__m512d __A, __m512i __I, __mmask8 __U,
6254 __m512d __B)5909 __m512d __B) {
6255{
6256 return (__m512d)__builtin_ia32_selectpd_512(__U,5910 return (__m512d)__builtin_ia32_selectpd_512(__U,
6257 (__v8df)_mm512_permutex2var_pd(__A, __I, __B),5911 (__v8df)_mm512_permutex2var_pd(__A, __I, __B),
6258 (__v8df)(__m512d)__I);5912 (__v8df)(__m512d)__I);
6259}5913}
62605914
6261static __inline__ __m512d __DEFAULT_FN_ATTRS5125915static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6262_mm512_maskz_permutex2var_pd(__mmask8 __U, __m512d __A, __m512i __I,5916_mm512_maskz_permutex2var_pd(__mmask8 __U, __m512d __A, __m512i __I,
6263 __m512d __B)5917 __m512d __B) {
6264{
6265 return (__m512d)__builtin_ia32_selectpd_512(__U,5918 return (__m512d)__builtin_ia32_selectpd_512(__U,
6266 (__v8df)_mm512_permutex2var_pd(__A, __I, __B),5919 (__v8df)_mm512_permutex2var_pd(__A, __I, __B),
6267 (__v8df)_mm512_setzero_pd());5920 (__v8df)_mm512_setzero_pd());
6268}5921}
62695922
6270static __inline __m512 __DEFAULT_FN_ATTRS5125923static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6271_mm512_permutex2var_ps(__m512 __A, __m512i __I, __m512 __B)5924_mm512_permutex2var_ps(__m512 __A, __m512i __I, __m512 __B) {
6272{
6273 return (__m512)__builtin_ia32_vpermi2varps512((__v16sf)__A, (__v16si)__I,5925 return (__m512)__builtin_ia32_vpermi2varps512((__v16sf)__A, (__v16si)__I,
6274 (__v16sf) __B);5926 (__v16sf) __B);
6275}5927}
62765928
6277static __inline__ __m512 __DEFAULT_FN_ATTRS5125929static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6278_mm512_mask_permutex2var_ps(__m512 __A, __mmask16 __U, __m512i __I, __m512 __B)5930_mm512_mask_permutex2var_ps(__m512 __A, __mmask16 __U, __m512i __I,
6279{5931 __m512 __B) {
6280 return (__m512)__builtin_ia32_selectps_512(__U,5932 return (__m512)__builtin_ia32_selectps_512(__U,
6281 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),5933 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),
6282 (__v16sf)__A);5934 (__v16sf)__A);
6283}5935}
62845936
6285static __inline__ __m512 __DEFAULT_FN_ATTRS5125937static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6286_mm512_mask2_permutex2var_ps(__m512 __A, __m512i __I, __mmask16 __U, __m512 __B)5938_mm512_mask2_permutex2var_ps(__m512 __A, __m512i __I, __mmask16 __U,
6287{5939 __m512 __B) {
6288 return (__m512)__builtin_ia32_selectps_512(__U,5940 return (__m512)__builtin_ia32_selectps_512(__U,
6289 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),5941 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),
6290 (__v16sf)(__m512)__I);5942 (__v16sf)(__m512)__I);
6291}5943}
62925944
6293static __inline__ __m512 __DEFAULT_FN_ATTRS5125945static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6294_mm512_maskz_permutex2var_ps(__mmask16 __U, __m512 __A, __m512i __I, __m512 __B)5946_mm512_maskz_permutex2var_ps(__mmask16 __U, __m512 __A, __m512i __I,
6295{5947 __m512 __B) {
6296 return (__m512)__builtin_ia32_selectps_512(__U,5948 return (__m512)__builtin_ia32_selectps_512(__U,
6297 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),5949 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),
6298 (__v16sf)_mm512_setzero_ps());5950 (__v16sf)_mm512_setzero_ps());
6299}5951}
63005952
6301
6302#define _mm512_cvtt_roundpd_epu32(A, R) \5953#define _mm512_cvtt_roundpd_epu32(A, R) \
6303 ((__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \5954 ((__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \
6304 (__v8si)_mm256_undefined_si256(), \5955 (__v8si)_mm256_undefined_si256(), \
...@@ -6622,46 +6273,41 @@ _mm_maskz_scalef_ss (__mmask8 __U, __m128 __A, __m128 __B)...@@ -6622,46 +6273,41 @@ _mm_maskz_scalef_ss (__mmask8 __U, __m128 __A, __m128 __B)
6622 (__mmask8)(U), \6273 (__mmask8)(U), \
6623 (int)(R)))6274 (int)(R)))
66246275
6625static __inline__ __m512i __DEFAULT_FN_ATTRS5126276static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6626_mm512_srai_epi32(__m512i __A, unsigned int __B)6277_mm512_srai_epi32(__m512i __A, unsigned int __B) {
6627{
6628 return (__m512i)__builtin_ia32_psradi512((__v16si)__A, (int)__B);6278 return (__m512i)__builtin_ia32_psradi512((__v16si)__A, (int)__B);
6629}6279}
66306280
6631static __inline__ __m512i __DEFAULT_FN_ATTRS5126281static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6632_mm512_mask_srai_epi32(__m512i __W, __mmask16 __U, __m512i __A,6282_mm512_mask_srai_epi32(__m512i __W, __mmask16 __U, __m512i __A,
6633 unsigned int __B)6283 unsigned int __B) {
6634{
6635 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,6284 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
6636 (__v16si)_mm512_srai_epi32(__A, __B),6285 (__v16si)_mm512_srai_epi32(__A, __B),
6637 (__v16si)__W);6286 (__v16si)__W);
6638}6287}
66396288
6640static __inline__ __m512i __DEFAULT_FN_ATTRS5126289static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6641_mm512_maskz_srai_epi32(__mmask16 __U, __m512i __A,6290_mm512_maskz_srai_epi32(__mmask16 __U, __m512i __A, unsigned int __B) {
6642 unsigned int __B) {
6643 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,6291 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
6644 (__v16si)_mm512_srai_epi32(__A, __B),6292 (__v16si)_mm512_srai_epi32(__A, __B),
6645 (__v16si)_mm512_setzero_si512());6293 (__v16si)_mm512_setzero_si512());
6646}6294}
66476295
6648static __inline__ __m512i __DEFAULT_FN_ATTRS5126296static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6649_mm512_srai_epi64(__m512i __A, unsigned int __B)6297_mm512_srai_epi64(__m512i __A, unsigned int __B) {
6650{
6651 return (__m512i)__builtin_ia32_psraqi512((__v8di)__A, (int)__B);6298 return (__m512i)__builtin_ia32_psraqi512((__v8di)__A, (int)__B);
6652}6299}
66536300
6654static __inline__ __m512i __DEFAULT_FN_ATTRS5126301static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6655_mm512_mask_srai_epi64(__m512i __W, __mmask8 __U, __m512i __A, unsigned int __B)6302_mm512_mask_srai_epi64(__m512i __W, __mmask8 __U, __m512i __A,
6656{6303 unsigned int __B) {
6657 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,6304 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
6658 (__v8di)_mm512_srai_epi64(__A, __B),6305 (__v8di)_mm512_srai_epi64(__A, __B),
6659 (__v8di)__W);6306 (__v8di)__W);
6660}6307}
66616308
6662static __inline__ __m512i __DEFAULT_FN_ATTRS5126309static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6663_mm512_maskz_srai_epi64(__mmask8 __U, __m512i __A, unsigned int __B)6310_mm512_maskz_srai_epi64(__mmask8 __U, __m512i __A, unsigned int __B) {
6664{
6665 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,6311 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
6666 (__v8di)_mm512_srai_epi64(__A, __B),6312 (__v8di)_mm512_srai_epi64(__A, __B),
6667 (__v8di)_mm512_setzero_si512());6313 (__v8di)_mm512_setzero_si512());
...@@ -6827,33 +6473,29 @@ _mm_maskz_sqrt_ss (__mmask8 __U, __m128 __A, __m128 __B)...@@ -6827,33 +6473,29 @@ _mm_maskz_sqrt_ss (__mmask8 __U, __m128 __A, __m128 __B)
6827 (__v4sf)_mm_setzero_ps(), \6473 (__v4sf)_mm_setzero_ps(), \
6828 (__mmask8)(U), (int)(R)))6474 (__mmask8)(U), (int)(R)))
68296475
6830static __inline__ __m512 __DEFAULT_FN_ATTRS5126476static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6831_mm512_broadcast_f32x4(__m128 __A)6477_mm512_broadcast_f32x4(__m128 __A) {
6832{
6833 return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,6478 return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,
6834 0, 1, 2, 3, 0, 1, 2, 3,6479 0, 1, 2, 3, 0, 1, 2, 3,
6835 0, 1, 2, 3, 0, 1, 2, 3);6480 0, 1, 2, 3, 0, 1, 2, 3);
6836}6481}
68376482
6838static __inline__ __m512 __DEFAULT_FN_ATTRS5126483static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6839_mm512_mask_broadcast_f32x4(__m512 __O, __mmask16 __M, __m128 __A)6484_mm512_mask_broadcast_f32x4(__m512 __O, __mmask16 __M, __m128 __A) {
6840{
6841 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,6485 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
6842 (__v16sf)_mm512_broadcast_f32x4(__A),6486 (__v16sf)_mm512_broadcast_f32x4(__A),
6843 (__v16sf)__O);6487 (__v16sf)__O);
6844}6488}
68456489
6846static __inline__ __m512 __DEFAULT_FN_ATTRS5126490static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6847_mm512_maskz_broadcast_f32x4(__mmask16 __M, __m128 __A)6491_mm512_maskz_broadcast_f32x4(__mmask16 __M, __m128 __A) {
6848{
6849 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,6492 return (__m512)__builtin_ia32_selectps_512((__mmask16)__M,
6850 (__v16sf)_mm512_broadcast_f32x4(__A),6493 (__v16sf)_mm512_broadcast_f32x4(__A),
6851 (__v16sf)_mm512_setzero_ps());6494 (__v16sf)_mm512_setzero_ps());
6852}6495}
68536496
6854static __inline__ __m512d __DEFAULT_FN_ATTRS5126497static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6855_mm512_broadcast_f64x4(__m256d __A)6498_mm512_broadcast_f64x4(__m256d __A) {
6856{
6857 return (__m512d)__builtin_shufflevector((__v4df)__A, (__v4df)__A,6499 return (__m512d)__builtin_shufflevector((__v4df)__A, (__v4df)__A,
6858 0, 1, 2, 3, 0, 1, 2, 3);6500 0, 1, 2, 3, 0, 1, 2, 3);
6859}6501}
...@@ -6874,33 +6516,29 @@ _mm512_maskz_broadcast_f64x4(__mmask8 __M, __m256d __A)...@@ -6874,33 +6516,29 @@ _mm512_maskz_broadcast_f64x4(__mmask8 __M, __m256d __A)
6874 (__v8df)_mm512_setzero_pd());6516 (__v8df)_mm512_setzero_pd());
6875}6517}
68766518
6877static __inline__ __m512i __DEFAULT_FN_ATTRS5126519static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6878_mm512_broadcast_i32x4(__m128i __A)6520_mm512_broadcast_i32x4(__m128i __A) {
6879{
6880 return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,6521 return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
6881 0, 1, 2, 3, 0, 1, 2, 3,6522 0, 1, 2, 3, 0, 1, 2, 3,
6882 0, 1, 2, 3, 0, 1, 2, 3);6523 0, 1, 2, 3, 0, 1, 2, 3);
6883}6524}
68846525
6885static __inline__ __m512i __DEFAULT_FN_ATTRS5126526static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6886_mm512_mask_broadcast_i32x4(__m512i __O, __mmask16 __M, __m128i __A)6527_mm512_mask_broadcast_i32x4(__m512i __O, __mmask16 __M, __m128i __A) {
6887{
6888 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,6528 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
6889 (__v16si)_mm512_broadcast_i32x4(__A),6529 (__v16si)_mm512_broadcast_i32x4(__A),
6890 (__v16si)__O);6530 (__v16si)__O);
6891}6531}
68926532
6893static __inline__ __m512i __DEFAULT_FN_ATTRS5126533static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6894_mm512_maskz_broadcast_i32x4(__mmask16 __M, __m128i __A)6534_mm512_maskz_broadcast_i32x4(__mmask16 __M, __m128i __A) {
6895{
6896 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,6535 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
6897 (__v16si)_mm512_broadcast_i32x4(__A),6536 (__v16si)_mm512_broadcast_i32x4(__A),
6898 (__v16si)_mm512_setzero_si512());6537 (__v16si)_mm512_setzero_si512());
6899}6538}
69006539
6901static __inline__ __m512i __DEFAULT_FN_ATTRS5126540static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
6902_mm512_broadcast_i64x4(__m256i __A)6541_mm512_broadcast_i64x4(__m256i __A) {
6903{
6904 return (__m512i)__builtin_shufflevector((__v4di)__A, (__v4di)__A,6542 return (__m512i)__builtin_shufflevector((__v4di)__A, (__v4di)__A,
6905 0, 1, 2, 3, 0, 1, 2, 3);6543 0, 1, 2, 3, 0, 1, 2, 3);
6906}6544}
...@@ -6921,33 +6559,29 @@ _mm512_maskz_broadcast_i64x4(__mmask8 __M, __m256i __A)...@@ -6921,33 +6559,29 @@ _mm512_maskz_broadcast_i64x4(__mmask8 __M, __m256i __A)
6921 (__v8di)_mm512_setzero_si512());6559 (__v8di)_mm512_setzero_si512());
6922}6560}
69236561
6924static __inline__ __m512d __DEFAULT_FN_ATTRS5126562static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6925_mm512_mask_broadcastsd_pd (__m512d __O, __mmask8 __M, __m128d __A)6563_mm512_mask_broadcastsd_pd(__m512d __O, __mmask8 __M, __m128d __A) {
6926{
6927 return (__m512d)__builtin_ia32_selectpd_512(__M,6564 return (__m512d)__builtin_ia32_selectpd_512(__M,
6928 (__v8df) _mm512_broadcastsd_pd(__A),6565 (__v8df) _mm512_broadcastsd_pd(__A),
6929 (__v8df) __O);6566 (__v8df) __O);
6930}6567}
69316568
6932static __inline__ __m512d __DEFAULT_FN_ATTRS5126569static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
6933_mm512_maskz_broadcastsd_pd (__mmask8 __M, __m128d __A)6570_mm512_maskz_broadcastsd_pd(__mmask8 __M, __m128d __A) {
6934{
6935 return (__m512d)__builtin_ia32_selectpd_512(__M,6571 return (__m512d)__builtin_ia32_selectpd_512(__M,
6936 (__v8df) _mm512_broadcastsd_pd(__A),6572 (__v8df) _mm512_broadcastsd_pd(__A),
6937 (__v8df) _mm512_setzero_pd());6573 (__v8df) _mm512_setzero_pd());
6938}6574}
69396575
6940static __inline__ __m512 __DEFAULT_FN_ATTRS5126576static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6941_mm512_mask_broadcastss_ps (__m512 __O, __mmask16 __M, __m128 __A)6577_mm512_mask_broadcastss_ps(__m512 __O, __mmask16 __M, __m128 __A) {
6942{
6943 return (__m512)__builtin_ia32_selectps_512(__M,6578 return (__m512)__builtin_ia32_selectps_512(__M,
6944 (__v16sf) _mm512_broadcastss_ps(__A),6579 (__v16sf) _mm512_broadcastss_ps(__A),
6945 (__v16sf) __O);6580 (__v16sf) __O);
6946}6581}
69476582
6948static __inline__ __m512 __DEFAULT_FN_ATTRS5126583static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
6949_mm512_maskz_broadcastss_ps (__mmask16 __M, __m128 __A)6584_mm512_maskz_broadcastss_ps(__mmask16 __M, __m128 __A) {
6950{
6951 return (__m512)__builtin_ia32_selectps_512(__M,6585 return (__m512)__builtin_ia32_selectps_512(__M,
6952 (__v16sf) _mm512_broadcastss_ps(__A),6586 (__v16sf) _mm512_broadcastss_ps(__A),
6953 (__v16sf) _mm512_setzero_ps());6587 (__v16sf) _mm512_setzero_ps());
...@@ -7391,10 +7025,10 @@ _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A)...@@ -7391,10 +7025,10 @@ _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A)
7391 __builtin_ia32_pmovqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M);7025 __builtin_ia32_pmovqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M);
7392}7026}
73937027
7394#define _mm512_extracti32x4_epi32(A, imm) \7028#define _mm512_extracti32x4_epi32(A, imm) \
7395 ((__m128i)__builtin_ia32_extracti32x4_mask((__v16si)(__m512i)(A), (int)(imm), \7029 ((__m128i)__builtin_ia32_extracti32x4_mask( \
7396 (__v4si)_mm_undefined_si128(), \7030 (__v16si)(__m512i)(A), (int)(imm), (__v4si)_mm_setzero_si128(), \
7397 (__mmask8)-1))7031 (__mmask8) - 1))
73987032
7399#define _mm512_mask_extracti32x4_epi32(W, U, A, imm) \7033#define _mm512_mask_extracti32x4_epi32(W, U, A, imm) \
7400 ((__m128i)__builtin_ia32_extracti32x4_mask((__v16si)(__m512i)(A), (int)(imm), \7034 ((__m128i)__builtin_ia32_extracti32x4_mask((__v16si)(__m512i)(A), (int)(imm), \
...@@ -7406,10 +7040,10 @@ _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A)...@@ -7406,10 +7040,10 @@ _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A)
7406 (__v4si)_mm_setzero_si128(), \7040 (__v4si)_mm_setzero_si128(), \
7407 (__mmask8)(U)))7041 (__mmask8)(U)))
74087042
7409#define _mm512_extracti64x4_epi64(A, imm) \7043#define _mm512_extracti64x4_epi64(A, imm) \
7410 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \7044 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \
7411 (__v4di)_mm256_undefined_si256(), \7045 (__v4di)_mm256_setzero_si256(), \
7412 (__mmask8)-1))7046 (__mmask8) - 1))
74137047
7414#define _mm512_mask_extracti64x4_epi64(W, U, A, imm) \7048#define _mm512_mask_extracti64x4_epi64(W, U, A, imm) \
7415 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \7049 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \
...@@ -8274,93 +7908,82 @@ _mm_mask3_fnmsub_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U)...@@ -8274,93 +7908,82 @@ _mm_mask3_fnmsub_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U)
8274 (__v8di)_mm512_permutex_epi64((X), (C)), \7908 (__v8di)_mm512_permutex_epi64((X), (C)), \
8275 (__v8di)_mm512_setzero_si512()))7909 (__v8di)_mm512_setzero_si512()))
82767910
8277static __inline__ __m512d __DEFAULT_FN_ATTRS5127911static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8278_mm512_permutexvar_pd (__m512i __X, __m512d __Y)7912_mm512_permutexvar_pd(__m512i __X, __m512d __Y) {
8279{
8280 return (__m512d)__builtin_ia32_permvardf512((__v8df) __Y, (__v8di) __X);7913 return (__m512d)__builtin_ia32_permvardf512((__v8df) __Y, (__v8di) __X);
8281}7914}
82827915
8283static __inline__ __m512d __DEFAULT_FN_ATTRS5127916static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8284_mm512_mask_permutexvar_pd (__m512d __W, __mmask8 __U, __m512i __X, __m512d __Y)7917_mm512_mask_permutexvar_pd(__m512d __W, __mmask8 __U, __m512i __X,
8285{7918 __m512d __Y) {
8286 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,7919 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
8287 (__v8df)_mm512_permutexvar_pd(__X, __Y),7920 (__v8df)_mm512_permutexvar_pd(__X, __Y),
8288 (__v8df)__W);7921 (__v8df)__W);
8289}7922}
82907923
8291static __inline__ __m512d __DEFAULT_FN_ATTRS5127924static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8292_mm512_maskz_permutexvar_pd (__mmask8 __U, __m512i __X, __m512d __Y)7925_mm512_maskz_permutexvar_pd(__mmask8 __U, __m512i __X, __m512d __Y) {
8293{
8294 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,7926 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
8295 (__v8df)_mm512_permutexvar_pd(__X, __Y),7927 (__v8df)_mm512_permutexvar_pd(__X, __Y),
8296 (__v8df)_mm512_setzero_pd());7928 (__v8df)_mm512_setzero_pd());
8297}7929}
82987930
8299static __inline__ __m512i __DEFAULT_FN_ATTRS5127931static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8300_mm512_permutexvar_epi64 (__m512i __X, __m512i __Y)7932_mm512_permutexvar_epi64(__m512i __X, __m512i __Y) {
8301{
8302 return (__m512i)__builtin_ia32_permvardi512((__v8di)__Y, (__v8di)__X);7933 return (__m512i)__builtin_ia32_permvardi512((__v8di)__Y, (__v8di)__X);
8303}7934}
83047935
8305static __inline__ __m512i __DEFAULT_FN_ATTRS5127936static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8306_mm512_maskz_permutexvar_epi64 (__mmask8 __M, __m512i __X, __m512i __Y)7937_mm512_maskz_permutexvar_epi64(__mmask8 __M, __m512i __X, __m512i __Y) {
8307{
8308 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,7938 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
8309 (__v8di)_mm512_permutexvar_epi64(__X, __Y),7939 (__v8di)_mm512_permutexvar_epi64(__X, __Y),
8310 (__v8di)_mm512_setzero_si512());7940 (__v8di)_mm512_setzero_si512());
8311}7941}
83127942
8313static __inline__ __m512i __DEFAULT_FN_ATTRS5127943static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8314_mm512_mask_permutexvar_epi64 (__m512i __W, __mmask8 __M, __m512i __X,7944_mm512_mask_permutexvar_epi64(__m512i __W, __mmask8 __M, __m512i __X,
8315 __m512i __Y)7945 __m512i __Y) {
8316{
8317 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,7946 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
8318 (__v8di)_mm512_permutexvar_epi64(__X, __Y),7947 (__v8di)_mm512_permutexvar_epi64(__X, __Y),
8319 (__v8di)__W);7948 (__v8di)__W);
8320}7949}
83217950
8322static __inline__ __m512 __DEFAULT_FN_ATTRS5127951static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8323_mm512_permutexvar_ps (__m512i __X, __m512 __Y)7952_mm512_permutexvar_ps(__m512i __X, __m512 __Y) {
8324{
8325 return (__m512)__builtin_ia32_permvarsf512((__v16sf)__Y, (__v16si)__X);7953 return (__m512)__builtin_ia32_permvarsf512((__v16sf)__Y, (__v16si)__X);
8326}7954}
83277955
8328static __inline__ __m512 __DEFAULT_FN_ATTRS5127956static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8329_mm512_mask_permutexvar_ps (__m512 __W, __mmask16 __U, __m512i __X, __m512 __Y)7957_mm512_mask_permutexvar_ps(__m512 __W, __mmask16 __U, __m512i __X, __m512 __Y) {
8330{
8331 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,7958 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
8332 (__v16sf)_mm512_permutexvar_ps(__X, __Y),7959 (__v16sf)_mm512_permutexvar_ps(__X, __Y),
8333 (__v16sf)__W);7960 (__v16sf)__W);
8334}7961}
83357962
8336static __inline__ __m512 __DEFAULT_FN_ATTRS5127963static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8337_mm512_maskz_permutexvar_ps (__mmask16 __U, __m512i __X, __m512 __Y)7964_mm512_maskz_permutexvar_ps(__mmask16 __U, __m512i __X, __m512 __Y) {
8338{
8339 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,7965 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
8340 (__v16sf)_mm512_permutexvar_ps(__X, __Y),7966 (__v16sf)_mm512_permutexvar_ps(__X, __Y),
8341 (__v16sf)_mm512_setzero_ps());7967 (__v16sf)_mm512_setzero_ps());
8342}7968}
83437969
8344static __inline__ __m512i __DEFAULT_FN_ATTRS5127970static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8345_mm512_permutexvar_epi32 (__m512i __X, __m512i __Y)7971_mm512_permutexvar_epi32(__m512i __X, __m512i __Y) {
8346{
8347 return (__m512i)__builtin_ia32_permvarsi512((__v16si)__Y, (__v16si)__X);7972 return (__m512i)__builtin_ia32_permvarsi512((__v16si)__Y, (__v16si)__X);
8348}7973}
83497974
8350#define _mm512_permutevar_epi32 _mm512_permutexvar_epi327975#define _mm512_permutevar_epi32 _mm512_permutexvar_epi32
83517976
8352static __inline__ __m512i __DEFAULT_FN_ATTRS5127977static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8353_mm512_maskz_permutexvar_epi32 (__mmask16 __M, __m512i __X, __m512i __Y)7978_mm512_maskz_permutexvar_epi32(__mmask16 __M, __m512i __X, __m512i __Y) {
8354{
8355 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,7979 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
8356 (__v16si)_mm512_permutexvar_epi32(__X, __Y),7980 (__v16si)_mm512_permutexvar_epi32(__X, __Y),
8357 (__v16si)_mm512_setzero_si512());7981 (__v16si)_mm512_setzero_si512());
8358}7982}
83597983
8360static __inline__ __m512i __DEFAULT_FN_ATTRS5127984static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8361_mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X,7985_mm512_mask_permutexvar_epi32(__m512i __W, __mmask16 __M, __m512i __X,
8362 __m512i __Y)7986 __m512i __Y) {
8363{
8364 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,7987 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
8365 (__v16si)_mm512_permutexvar_epi32(__X, __Y),7988 (__v16si)_mm512_permutexvar_epi32(__X, __Y),
8366 (__v16si)__W);7989 (__v16si)__W);
...@@ -8368,69 +7991,59 @@ _mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X,...@@ -8368,69 +7991,59 @@ _mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X,
83687991
8369#define _mm512_mask_permutevar_epi32 _mm512_mask_permutexvar_epi327992#define _mm512_mask_permutevar_epi32 _mm512_mask_permutexvar_epi32
83707993
8371static __inline__ __mmask16 __DEFAULT_FN_ATTRS7994static __inline__ __mmask16
8372_mm512_kand (__mmask16 __A, __mmask16 __B)7995 __DEFAULT_FN_ATTRS_CONSTEXPR _mm512_kand(__mmask16 __A, __mmask16 __B) {
8373{
8374 return (__mmask16) __builtin_ia32_kandhi ((__mmask16) __A, (__mmask16) __B);7996 return (__mmask16) __builtin_ia32_kandhi ((__mmask16) __A, (__mmask16) __B);
8375}7997}
83767998
8377static __inline__ __mmask16 __DEFAULT_FN_ATTRS7999static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
8378_mm512_kandn (__mmask16 __A, __mmask16 __B)8000_mm512_kandn(__mmask16 __A, __mmask16 __B) {
8379{
8380 return (__mmask16) __builtin_ia32_kandnhi ((__mmask16) __A, (__mmask16) __B);8001 return (__mmask16) __builtin_ia32_kandnhi ((__mmask16) __A, (__mmask16) __B);
8381}8002}
83828003
8383static __inline__ __mmask16 __DEFAULT_FN_ATTRS8004static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
8384_mm512_kor (__mmask16 __A, __mmask16 __B)8005_mm512_kor(__mmask16 __A, __mmask16 __B) {
8385{
8386 return (__mmask16) __builtin_ia32_korhi ((__mmask16) __A, (__mmask16) __B);8006 return (__mmask16) __builtin_ia32_korhi ((__mmask16) __A, (__mmask16) __B);
8387}8007}
83888008
8389static __inline__ int __DEFAULT_FN_ATTRS8009static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
8390_mm512_kortestc (__mmask16 __A, __mmask16 __B)8010_mm512_kortestc(__mmask16 __A, __mmask16 __B) {
8391{
8392 return __builtin_ia32_kortestchi ((__mmask16) __A, (__mmask16) __B);8011 return __builtin_ia32_kortestchi ((__mmask16) __A, (__mmask16) __B);
8393}8012}
83948013
8395static __inline__ int __DEFAULT_FN_ATTRS8014static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
8396_mm512_kortestz (__mmask16 __A, __mmask16 __B)8015_mm512_kortestz(__mmask16 __A, __mmask16 __B) {
8397{
8398 return __builtin_ia32_kortestzhi ((__mmask16) __A, (__mmask16) __B);8016 return __builtin_ia32_kortestzhi ((__mmask16) __A, (__mmask16) __B);
8399}8017}
84008018
8401static __inline__ unsigned char __DEFAULT_FN_ATTRS8019static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
8402_kortestc_mask16_u8(__mmask16 __A, __mmask16 __B)8020_kortestc_mask16_u8(__mmask16 __A, __mmask16 __B) {
8403{
8404 return (unsigned char)__builtin_ia32_kortestchi(__A, __B);8021 return (unsigned char)__builtin_ia32_kortestchi(__A, __B);
8405}8022}
84068023
8407static __inline__ unsigned char __DEFAULT_FN_ATTRS8024static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
8408_kortestz_mask16_u8(__mmask16 __A, __mmask16 __B)8025_kortestz_mask16_u8(__mmask16 __A, __mmask16 __B) {
8409{
8410 return (unsigned char)__builtin_ia32_kortestzhi(__A, __B);8026 return (unsigned char)__builtin_ia32_kortestzhi(__A, __B);
8411}8027}
84128028
8413static __inline__ unsigned char __DEFAULT_FN_ATTRS8029static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
8414_kortest_mask16_u8(__mmask16 __A, __mmask16 __B, unsigned char *__C) {8030_kortest_mask16_u8(__mmask16 __A, __mmask16 __B, unsigned char *__C) {
8415 *__C = (unsigned char)__builtin_ia32_kortestchi(__A, __B);8031 *__C = (unsigned char)__builtin_ia32_kortestchi(__A, __B);
8416 return (unsigned char)__builtin_ia32_kortestzhi(__A, __B);8032 return (unsigned char)__builtin_ia32_kortestzhi(__A, __B);
8417}8033}
84188034
8419static __inline__ __mmask16 __DEFAULT_FN_ATTRS8035static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
8420_mm512_kunpackb (__mmask16 __A, __mmask16 __B)8036_mm512_kunpackb(__mmask16 __A, __mmask16 __B) {
8421{
8422 return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B);8037 return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B);
8423}8038}
84248039
8425static __inline__ __mmask16 __DEFAULT_FN_ATTRS8040static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
8426_mm512_kxnor (__mmask16 __A, __mmask16 __B)8041_mm512_kxnor(__mmask16 __A, __mmask16 __B) {
8427{
8428 return (__mmask16) __builtin_ia32_kxnorhi ((__mmask16) __A, (__mmask16) __B);8042 return (__mmask16) __builtin_ia32_kxnorhi ((__mmask16) __A, (__mmask16) __B);
8429}8043}
84308044
8431static __inline__ __mmask16 __DEFAULT_FN_ATTRS8045static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
8432_mm512_kxor (__mmask16 __A, __mmask16 __B)8046_mm512_kxor(__mmask16 __A, __mmask16 __B) {
8433{
8434 return (__mmask16) __builtin_ia32_kxorhi ((__mmask16) __A, (__mmask16) __B);8047 return (__mmask16) __builtin_ia32_kxorhi ((__mmask16) __A, (__mmask16) __B);
8435}8048}
84368049
...@@ -8447,12 +8060,12 @@ _mm512_kxor (__mmask16 __A, __mmask16 __B)...@@ -8447,12 +8060,12 @@ _mm512_kxor (__mmask16 __A, __mmask16 __B)
8447#define _kshiftri_mask16(A, I) \8060#define _kshiftri_mask16(A, I) \
8448 ((__mmask16)__builtin_ia32_kshiftrihi((__mmask16)(A), (unsigned int)(I)))8061 ((__mmask16)__builtin_ia32_kshiftrihi((__mmask16)(A), (unsigned int)(I)))
84498062
8450static __inline__ unsigned int __DEFAULT_FN_ATTRS8063static __inline__ unsigned int
8451_cvtmask16_u32(__mmask16 __A) {8064 __DEFAULT_FN_ATTRS_CONSTEXPR _cvtmask16_u32(__mmask16 __A) {
8452 return (unsigned int)__builtin_ia32_kmovw((__mmask16)__A);8065 return (unsigned int)__builtin_ia32_kmovw((__mmask16)__A);
8453}8066}
84548067
8455static __inline__ __mmask16 __DEFAULT_FN_ATTRS8068static __inline__ __mmask16 __DEFAULT_FN_ATTRS_CONSTEXPR
8456_cvtu32_mask16(unsigned int __A) {8069_cvtu32_mask16(unsigned int __A) {
8457 return (__mmask16)__builtin_ia32_kmovw((__mmask16)__A);8070 return (__mmask16)__builtin_ia32_kmovw((__mmask16)__A);
8458}8071}
...@@ -8665,74 +8278,66 @@ _mm512_mask_testn_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B)...@@ -8665,74 +8278,66 @@ _mm512_mask_testn_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B)
8665 _mm512_setzero_si512());8278 _mm512_setzero_si512());
8666}8279}
86678280
8668static __inline__ __m512 __DEFAULT_FN_ATTRS5128281static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8669_mm512_movehdup_ps (__m512 __A)8282_mm512_movehdup_ps (__m512 __A)
8670{8283{
8671 return (__m512)__builtin_shufflevector((__v16sf)__A, (__v16sf)__A,8284 return (__m512)__builtin_shufflevector((__v16sf)__A, (__v16sf)__A,
8672 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15);8285 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15);
8673}8286}
86748287
8675static __inline__ __m512 __DEFAULT_FN_ATTRS5128288static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8676_mm512_mask_movehdup_ps (__m512 __W, __mmask16 __U, __m512 __A)8289_mm512_mask_movehdup_ps(__m512 __W, __mmask16 __U, __m512 __A) {
8677{
8678 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,8290 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
8679 (__v16sf)_mm512_movehdup_ps(__A),8291 (__v16sf)_mm512_movehdup_ps(__A),
8680 (__v16sf)__W);8292 (__v16sf)__W);
8681}8293}
86828294
8683static __inline__ __m512 __DEFAULT_FN_ATTRS5128295static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8684_mm512_maskz_movehdup_ps (__mmask16 __U, __m512 __A)8296_mm512_maskz_movehdup_ps(__mmask16 __U, __m512 __A) {
8685{
8686 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,8297 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
8687 (__v16sf)_mm512_movehdup_ps(__A),8298 (__v16sf)_mm512_movehdup_ps(__A),
8688 (__v16sf)_mm512_setzero_ps());8299 (__v16sf)_mm512_setzero_ps());
8689}8300}
86908301
8691static __inline__ __m512 __DEFAULT_FN_ATTRS5128302static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8692_mm512_moveldup_ps (__m512 __A)8303_mm512_moveldup_ps (__m512 __A)
8693{8304{
8694 return (__m512)__builtin_shufflevector((__v16sf)__A, (__v16sf)__A,8305 return (__m512)__builtin_shufflevector((__v16sf)__A, (__v16sf)__A,
8695 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14);8306 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14);
8696}8307}
86978308
8698static __inline__ __m512 __DEFAULT_FN_ATTRS5128309static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8699_mm512_mask_moveldup_ps (__m512 __W, __mmask16 __U, __m512 __A)8310_mm512_mask_moveldup_ps(__m512 __W, __mmask16 __U, __m512 __A) {
8700{
8701 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,8311 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
8702 (__v16sf)_mm512_moveldup_ps(__A),8312 (__v16sf)_mm512_moveldup_ps(__A),
8703 (__v16sf)__W);8313 (__v16sf)__W);
8704}8314}
87058315
8706static __inline__ __m512 __DEFAULT_FN_ATTRS5128316static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8707_mm512_maskz_moveldup_ps (__mmask16 __U, __m512 __A)8317_mm512_maskz_moveldup_ps(__mmask16 __U, __m512 __A) {
8708{
8709 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,8318 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
8710 (__v16sf)_mm512_moveldup_ps(__A),8319 (__v16sf)_mm512_moveldup_ps(__A),
8711 (__v16sf)_mm512_setzero_ps());8320 (__v16sf)_mm512_setzero_ps());
8712}8321}
87138322
8714static __inline__ __m128 __DEFAULT_FN_ATTRS1288323static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8715_mm_mask_move_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B)8324_mm_mask_move_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
8716{
8717 return __builtin_ia32_selectss_128(__U, _mm_move_ss(__A, __B), __W);8325 return __builtin_ia32_selectss_128(__U, _mm_move_ss(__A, __B), __W);
8718}8326}
87198327
8720static __inline__ __m128 __DEFAULT_FN_ATTRS1288328static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8721_mm_maskz_move_ss (__mmask8 __U, __m128 __A, __m128 __B)8329_mm_maskz_move_ss(__mmask8 __U, __m128 __A, __m128 __B) {
8722{
8723 return __builtin_ia32_selectss_128(__U, _mm_move_ss(__A, __B),8330 return __builtin_ia32_selectss_128(__U, _mm_move_ss(__A, __B),
8724 _mm_setzero_ps());8331 _mm_setzero_ps());
8725}8332}
87268333
8727static __inline__ __m128d __DEFAULT_FN_ATTRS1288334static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
8728_mm_mask_move_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B)8335_mm_mask_move_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
8729{
8730 return __builtin_ia32_selectsd_128(__U, _mm_move_sd(__A, __B), __W);8336 return __builtin_ia32_selectsd_128(__U, _mm_move_sd(__A, __B), __W);
8731}8337}
87328338
8733static __inline__ __m128d __DEFAULT_FN_ATTRS1288339static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
8734_mm_maskz_move_sd (__mmask8 __U, __m128d __A, __m128d __B)8340_mm_maskz_move_sd(__mmask8 __U, __m128d __A, __m128d __B) {
8735{
8736 return __builtin_ia32_selectsd_128(__U, _mm_move_sd(__A, __B),8341 return __builtin_ia32_selectsd_128(__U, _mm_move_sd(__A, __B),
8737 _mm_setzero_pd());8342 _mm_setzero_pd());
8738}8343}
...@@ -8941,70 +8546,57 @@ _mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A)...@@ -8941,70 +8546,57 @@ _mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A)
8941 (__v8df)_mm512_setzero_pd(), \8546 (__v8df)_mm512_setzero_pd(), \
8942 (__mmask8)(U), (int)(R)))8547 (__mmask8)(U), (int)(R)))
89438548
8944static __inline__ __m512d __DEFAULT_FN_ATTRS5128549static __inline__ __m512d
8945_mm512_cvtps_pd (__m256 __A)8550 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_cvtps_pd(__m256 __A) {
8946{
8947 return (__m512d) __builtin_convertvector((__v8sf)__A, __v8df);8551 return (__m512d) __builtin_convertvector((__v8sf)__A, __v8df);
8948}8552}
89498553
8950static __inline__ __m512d __DEFAULT_FN_ATTRS5128554static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8951_mm512_mask_cvtps_pd (__m512d __W, __mmask8 __U, __m256 __A)8555_mm512_mask_cvtps_pd(__m512d __W, __mmask8 __U, __m256 __A) {
8952{
8953 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,8556 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
8954 (__v8df)_mm512_cvtps_pd(__A),8557 (__v8df)_mm512_cvtps_pd(__A),
8955 (__v8df)__W);8558 (__v8df)__W);
8956}8559}
89578560
8958static __inline__ __m512d __DEFAULT_FN_ATTRS5128561static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8959_mm512_maskz_cvtps_pd (__mmask8 __U, __m256 __A)8562_mm512_maskz_cvtps_pd(__mmask8 __U, __m256 __A) {
8960{
8961 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,8563 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
8962 (__v8df)_mm512_cvtps_pd(__A),8564 (__v8df)_mm512_cvtps_pd(__A),
8963 (__v8df)_mm512_setzero_pd());8565 (__v8df)_mm512_setzero_pd());
8964}8566}
89658567
8966static __inline__ __m512d __DEFAULT_FN_ATTRS5128568static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8967_mm512_cvtpslo_pd (__m512 __A)8569_mm512_cvtpslo_pd(__m512 __A) {
8968{
8969 return (__m512d) _mm512_cvtps_pd(_mm512_castps512_ps256(__A));8570 return (__m512d) _mm512_cvtps_pd(_mm512_castps512_ps256(__A));
8970}8571}
89718572
8972static __inline__ __m512d __DEFAULT_FN_ATTRS5128573static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8973_mm512_mask_cvtpslo_pd (__m512d __W, __mmask8 __U, __m512 __A)8574_mm512_mask_cvtpslo_pd(__m512d __W, __mmask8 __U, __m512 __A) {
8974{
8975 return (__m512d) _mm512_mask_cvtps_pd(__W, __U, _mm512_castps512_ps256(__A));8575 return (__m512d) _mm512_mask_cvtps_pd(__W, __U, _mm512_castps512_ps256(__A));
8976}8576}
89778577
8978static __inline__ __m512d __DEFAULT_FN_ATTRS5128578static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8979_mm512_mask_mov_pd (__m512d __W, __mmask8 __U, __m512d __A)8579_mm512_mask_mov_pd(__m512d __W, __mmask8 __U, __m512d __A) {
8980{8580 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)__A,
8981 return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U,8581 (__v8df)__W);
8982 (__v8df) __A,
8983 (__v8df) __W);
8984}8582}
89858583
8986static __inline__ __m512d __DEFAULT_FN_ATTRS5128584static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8987_mm512_maskz_mov_pd (__mmask8 __U, __m512d __A)8585_mm512_maskz_mov_pd(__mmask8 __U, __m512d __A) {
8988{8586 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)__A,
8989 return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U,8587 (__v8df)_mm512_setzero_pd());
8990 (__v8df) __A,
8991 (__v8df) _mm512_setzero_pd ());
8992}8588}
89938589
8994static __inline__ __m512 __DEFAULT_FN_ATTRS5128590static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8995_mm512_mask_mov_ps (__m512 __W, __mmask16 __U, __m512 __A)8591_mm512_mask_mov_ps(__m512 __W, __mmask16 __U, __m512 __A) {
8996{8592 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)__A,
8997 return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U,8593 (__v16sf)__W);
8998 (__v16sf) __A,
8999 (__v16sf) __W);
9000}8594}
90018595
9002static __inline__ __m512 __DEFAULT_FN_ATTRS5128596static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
9003_mm512_maskz_mov_ps (__mmask16 __U, __m512 __A)8597_mm512_maskz_mov_ps(__mmask16 __U, __m512 __A) {
9004{8598 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)__A,
9005 return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U,8599 (__v16sf)_mm512_setzero_ps());
9006 (__v16sf) __A,
9007 (__v16sf) _mm512_setzero_ps ());
9008}8600}
90098601
9010static __inline__ void __DEFAULT_FN_ATTRS5128602static __inline__ void __DEFAULT_FN_ATTRS512
...@@ -9053,18 +8645,16 @@ _mm512_mask_compressstoreu_epi32 (void *__P, __mmask16 __U, __m512i __A)...@@ -9053,18 +8645,16 @@ _mm512_mask_compressstoreu_epi32 (void *__P, __mmask16 __U, __m512i __A)
9053 (__v4sf)_mm_setzero_ps(), \8645 (__v4sf)_mm_setzero_ps(), \
9054 (__mmask8)(U), (int)(R)))8646 (__mmask8)(U), (int)(R)))
90558647
9056static __inline__ __m128 __DEFAULT_FN_ATTRS1288648static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
9057_mm_mask_cvtsd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128d __B)8649_mm_mask_cvtsd_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128d __B) {
9058{
9059 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)__A,8650 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)__A,
9060 (__v2df)__B,8651 (__v2df)__B,
9061 (__v4sf)__W,8652 (__v4sf)__W,
9062 (__mmask8)__U, _MM_FROUND_CUR_DIRECTION);8653 (__mmask8)__U, _MM_FROUND_CUR_DIRECTION);
9063}8654}
90648655
9065static __inline__ __m128 __DEFAULT_FN_ATTRS1288656static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
9066_mm_maskz_cvtsd_ss (__mmask8 __U, __m128 __A, __m128d __B)8657_mm_maskz_cvtsd_ss(__mmask8 __U, __m128 __A, __m128d __B) {
9067{
9068 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)__A,8658 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)__A,
9069 (__v2df)__B,8659 (__v2df)__B,
9070 (__v4sf)_mm_setzero_ps(),8660 (__v4sf)_mm_setzero_ps(),
...@@ -9188,34 +8778,32 @@ _mm_cvtu64_ss (__m128 __A, unsigned long long __B)...@@ -9188,34 +8778,32 @@ _mm_cvtu64_ss (__m128 __A, unsigned long long __B)
9188}8778}
9189#endif8779#endif
91908780
9191static __inline__ __m512i __DEFAULT_FN_ATTRS5128781static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
9192_mm512_mask_set1_epi32 (__m512i __O, __mmask16 __M, int __A)8782_mm512_mask_set1_epi32(__m512i __O, __mmask16 __M, int __A) {
9193{
9194 return (__m512i) __builtin_ia32_selectd_512(__M,8783 return (__m512i) __builtin_ia32_selectd_512(__M,
9195 (__v16si) _mm512_set1_epi32(__A),8784 (__v16si) _mm512_set1_epi32(__A),
9196 (__v16si) __O);8785 (__v16si) __O);
9197}8786}
91988787
9199static __inline__ __m512i __DEFAULT_FN_ATTRS5128788static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
9200_mm512_mask_set1_epi64 (__m512i __O, __mmask8 __M, long long __A)8789_mm512_mask_set1_epi64(__m512i __O, __mmask8 __M, long long __A) {
9201{
9202 return (__m512i) __builtin_ia32_selectq_512(__M,8790 return (__m512i) __builtin_ia32_selectq_512(__M,
9203 (__v8di) _mm512_set1_epi64(__A),8791 (__v8di) _mm512_set1_epi64(__A),
9204 (__v8di) __O);8792 (__v8di) __O);
9205}8793}
92068794
9207static __inline __m512i __DEFAULT_FN_ATTRS5128795static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_set_epi8(
9208_mm512_set_epi8 (char __e63, char __e62, char __e61, char __e60, char __e59,8796 char __e63, char __e62, char __e61, char __e60, char __e59, char __e58,
9209 char __e58, char __e57, char __e56, char __e55, char __e54, char __e53,8797 char __e57, char __e56, char __e55, char __e54, char __e53, char __e52,
9210 char __e52, char __e51, char __e50, char __e49, char __e48, char __e47,8798 char __e51, char __e50, char __e49, char __e48, char __e47, char __e46,
9211 char __e46, char __e45, char __e44, char __e43, char __e42, char __e41,8799 char __e45, char __e44, char __e43, char __e42, char __e41, char __e40,
9212 char __e40, char __e39, char __e38, char __e37, char __e36, char __e35,8800 char __e39, char __e38, char __e37, char __e36, char __e35, char __e34,
9213 char __e34, char __e33, char __e32, char __e31, char __e30, char __e29,8801 char __e33, char __e32, char __e31, char __e30, char __e29, char __e28,
9214 char __e28, char __e27, char __e26, char __e25, char __e24, char __e23,8802 char __e27, char __e26, char __e25, char __e24, char __e23, char __e22,
9215 char __e22, char __e21, char __e20, char __e19, char __e18, char __e17,8803 char __e21, char __e20, char __e19, char __e18, char __e17, char __e16,
9216 char __e16, char __e15, char __e14, char __e13, char __e12, char __e11,8804 char __e15, char __e14, char __e13, char __e12, char __e11, char __e10,
9217 char __e10, char __e9, char __e8, char __e7, char __e6, char __e5,8805 char __e9, char __e8, char __e7, char __e6, char __e5, char __e4, char __e3,
9218 char __e4, char __e3, char __e2, char __e1, char __e0) {8806 char __e2, char __e1, char __e0) {
92198807
9220 return __extension__ (__m512i)(__v64qi)8808 return __extension__ (__m512i)(__v64qi)
9221 {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7,8809 {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7,
...@@ -9228,14 +8816,13 @@ _mm512_set_epi8 (char __e63, char __e62, char __e61, char __e60, char __e59,...@@ -9228,14 +8816,13 @@ _mm512_set_epi8 (char __e63, char __e62, char __e61, char __e60, char __e59,
9228 __e56, __e57, __e58, __e59, __e60, __e61, __e62, __e63};8816 __e56, __e57, __e58, __e59, __e60, __e61, __e62, __e63};
9229}8817}
92308818
9231static __inline __m512i __DEFAULT_FN_ATTRS5128819static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_set_epi16(
9232_mm512_set_epi16(short __e31, short __e30, short __e29, short __e28,8820 short __e31, short __e30, short __e29, short __e28, short __e27,
9233 short __e27, short __e26, short __e25, short __e24, short __e23,8821 short __e26, short __e25, short __e24, short __e23, short __e22,
9234 short __e22, short __e21, short __e20, short __e19, short __e18,8822 short __e21, short __e20, short __e19, short __e18, short __e17,
9235 short __e17, short __e16, short __e15, short __e14, short __e13,8823 short __e16, short __e15, short __e14, short __e13, short __e12,
9236 short __e12, short __e11, short __e10, short __e9, short __e8,8824 short __e11, short __e10, short __e9, short __e8, short __e7, short __e6,
9237 short __e7, short __e6, short __e5, short __e4, short __e3,8825 short __e5, short __e4, short __e3, short __e2, short __e1, short __e0) {
9238 short __e2, short __e1, short __e0) {
9239 return __extension__ (__m512i)(__v32hi)8826 return __extension__ (__m512i)(__v32hi)
9240 {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7,8827 {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7,
9241 __e8, __e9, __e10, __e11, __e12, __e13, __e14, __e15,8828 __e8, __e9, __e10, __e11, __e12, __e13, __e14, __e15,
...@@ -9243,81 +8830,81 @@ _mm512_set_epi16(short __e31, short __e30, short __e29, short __e28,...@@ -9243,81 +8830,81 @@ _mm512_set_epi16(short __e31, short __e30, short __e29, short __e28,
9243 __e24, __e25, __e26, __e27, __e28, __e29, __e30, __e31 };8830 __e24, __e25, __e26, __e27, __e28, __e29, __e30, __e31 };
9244}8831}
92458832
9246static __inline __m512i __DEFAULT_FN_ATTRS5128833static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_set_epi32(
9247_mm512_set_epi32 (int __A, int __B, int __C, int __D,8834 int __A, int __B, int __C, int __D, int __E, int __F, int __G, int __H,
9248 int __E, int __F, int __G, int __H,8835 int __I, int __J, int __K, int __L, int __M, int __N, int __O, int __P) {
9249 int __I, int __J, int __K, int __L,
9250 int __M, int __N, int __O, int __P)
9251{
9252 return __extension__ (__m512i)(__v16si)8836 return __extension__ (__m512i)(__v16si)
9253 { __P, __O, __N, __M, __L, __K, __J, __I,8837 { __P, __O, __N, __M, __L, __K, __J, __I,
9254 __H, __G, __F, __E, __D, __C, __B, __A };8838 __H, __G, __F, __E, __D, __C, __B, __A };
9255}8839}
92568840
9257#define _mm512_setr_epi32(e0,e1,e2,e3,e4,e5,e6,e7, \8841static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_setr_epi32(
9258 e8,e9,e10,e11,e12,e13,e14,e15) \8842 int e0, int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8,
9259 _mm512_set_epi32((e15),(e14),(e13),(e12),(e11),(e10),(e9),(e8),(e7),(e6), \8843 int e9, int e10, int e11, int e12, int e13, int e14, int e15) {
9260 (e5),(e4),(e3),(e2),(e1),(e0))8844 return _mm512_set_epi32(e15, e14, e13, e12, e11, e10, e9, e8, e7, e6, e5, e4,
8845 e3, e2, e1, e0);
8846}
92618847
9262static __inline__ __m512i __DEFAULT_FN_ATTRS5128848static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
9263_mm512_set_epi64 (long long __A, long long __B, long long __C,8849_mm512_set_epi64(long long __A, long long __B, long long __C, long long __D,
9264 long long __D, long long __E, long long __F,8850 long long __E, long long __F, long long __G, long long __H) {
9265 long long __G, long long __H)
9266{
9267 return __extension__ (__m512i) (__v8di)8851 return __extension__ (__m512i) (__v8di)
9268 { __H, __G, __F, __E, __D, __C, __B, __A };8852 { __H, __G, __F, __E, __D, __C, __B, __A };
9269}8853}
92708854
9271#define _mm512_setr_epi64(e0,e1,e2,e3,e4,e5,e6,e7) \8855static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
9272 _mm512_set_epi64((e7),(e6),(e5),(e4),(e3),(e2),(e1),(e0))8856_mm512_setr_epi64(long long e0, long long e1, long long e2, long long e3,
8857 long long e4, long long e5, long long e6, long long e7) {
8858 return _mm512_set_epi64(e7, e6, e5, e4, e3, e2, e1, e0);
8859}
92738860
9274static __inline__ __m512d __DEFAULT_FN_ATTRS5128861static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
9275_mm512_set_pd (double __A, double __B, double __C, double __D,8862_mm512_set_pd(double __A, double __B, double __C, double __D, double __E,
9276 double __E, double __F, double __G, double __H)8863 double __F, double __G, double __H) {
9277{
9278 return __extension__ (__m512d)8864 return __extension__ (__m512d)
9279 { __H, __G, __F, __E, __D, __C, __B, __A };8865 { __H, __G, __F, __E, __D, __C, __B, __A };
9280}8866}
92818867
9282#define _mm512_setr_pd(e0,e1,e2,e3,e4,e5,e6,e7) \8868static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
9283 _mm512_set_pd((e7),(e6),(e5),(e4),(e3),(e2),(e1),(e0))8869_mm512_setr_pd(double e0, double e1, double e2, double e3, double e4, double e5,
8870 double e6, double e7) {
8871 return _mm512_set_pd(e7, e6, e5, e4, e3, e2, e1, e0);
8872}
92848873
9285static __inline__ __m512 __DEFAULT_FN_ATTRS5128874static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
9286_mm512_set_ps (float __A, float __B, float __C, float __D,8875_mm512_set_ps(float __A, float __B, float __C, float __D, float __E, float __F,
9287 float __E, float __F, float __G, float __H,8876 float __G, float __H, float __I, float __J, float __K, float __L,
9288 float __I, float __J, float __K, float __L,8877 float __M, float __N, float __O, float __P) {
9289 float __M, float __N, float __O, float __P)
9290{
9291 return __extension__ (__m512)8878 return __extension__ (__m512)
9292 { __P, __O, __N, __M, __L, __K, __J, __I,8879 { __P, __O, __N, __M, __L, __K, __J, __I,
9293 __H, __G, __F, __E, __D, __C, __B, __A };8880 __H, __G, __F, __E, __D, __C, __B, __A };
9294}8881}
92958882
9296#define _mm512_setr_ps(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15) \8883static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
9297 _mm512_set_ps((e15),(e14),(e13),(e12),(e11),(e10),(e9),(e8),(e7),(e6),(e5), \8884_mm512_setr_ps(float e0, float e1, float e2, float e3, float e4, float e5,
9298 (e4),(e3),(e2),(e1),(e0))8885 float e6, float e7, float e8, float e9, float e10, float e11,
8886 float e12, float e13, float e14, float e15) {
8887 return _mm512_set_ps(e15, e14, e13, e12, e11, e10, e9, e8, e7, e6, e5, e4, e3,
8888 e2, e1, e0);
8889}
92998890
9300static __inline__ __m512 __DEFAULT_FN_ATTRS5128891static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
9301_mm512_abs_ps(__m512 __A)8892_mm512_abs_ps(__m512 __A) {
9302{
9303 return (__m512)_mm512_and_epi32(_mm512_set1_epi32(0x7FFFFFFF),(__m512i)__A) ;8893 return (__m512)_mm512_and_epi32(_mm512_set1_epi32(0x7FFFFFFF),(__m512i)__A) ;
9304}8894}
93058895
9306static __inline__ __m512 __DEFAULT_FN_ATTRS5128896static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
9307_mm512_mask_abs_ps(__m512 __W, __mmask16 __K, __m512 __A)8897_mm512_mask_abs_ps(__m512 __W, __mmask16 __K, __m512 __A) {
9308{
9309 return (__m512)_mm512_mask_and_epi32((__m512i)__W, __K, _mm512_set1_epi32(0x7FFFFFFF),(__m512i)__A) ;8898 return (__m512)_mm512_mask_and_epi32((__m512i)__W, __K, _mm512_set1_epi32(0x7FFFFFFF),(__m512i)__A) ;
9310}8899}
93118900
9312static __inline__ __m512d __DEFAULT_FN_ATTRS5128901static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
9313_mm512_abs_pd(__m512d __A)8902_mm512_abs_pd(__m512d __A) {
9314{
9315 return (__m512d)_mm512_and_epi64(_mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di)__A) ;8903 return (__m512d)_mm512_and_epi64(_mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di)__A) ;
9316}8904}
93178905
9318static __inline__ __m512d __DEFAULT_FN_ATTRS5128906static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
9319_mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A)8907_mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A) {
9320{
9321 return (__m512d)_mm512_mask_and_epi64((__v8di)__W, __K, _mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di)__A);8908 return (__m512d)_mm512_mask_and_epi64((__v8di)__W, __K, _mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di)__A);
9322}8909}
93238910
...@@ -9337,19 +8924,23 @@ _mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A)...@@ -9337,19 +8924,23 @@ _mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A)
9337 * This takes log2(n) steps where n is the number of elements in the vector.8924 * This takes log2(n) steps where n is the number of elements in the vector.
9338 */8925 */
93398926
9340static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_add_epi64(__m512i __W) {8927static __inline__ long long __DEFAULT_FN_ATTRS512_CONSTEXPR
8928_mm512_reduce_add_epi64(__m512i __W) {
9341 return __builtin_reduce_add((__v8di)__W);8929 return __builtin_reduce_add((__v8di)__W);
9342}8930}
93438931
9344static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_mul_epi64(__m512i __W) {8932static __inline__ long long __DEFAULT_FN_ATTRS512_CONSTEXPR
8933_mm512_reduce_mul_epi64(__m512i __W) {
9345 return __builtin_reduce_mul((__v8di)__W);8934 return __builtin_reduce_mul((__v8di)__W);
9346}8935}
93478936
9348static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_and_epi64(__m512i __W) {8937static __inline__ long long __DEFAULT_FN_ATTRS512_CONSTEXPR
8938_mm512_reduce_and_epi64(__m512i __W) {
9349 return __builtin_reduce_and((__v8di)__W);8939 return __builtin_reduce_and((__v8di)__W);
9350}8940}
93518941
9352static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_or_epi64(__m512i __W) {8942static __inline__ long long __DEFAULT_FN_ATTRS512_CONSTEXPR
8943_mm512_reduce_or_epi64(__m512i __W) {
9353 return __builtin_reduce_or((__v8di)__W);8944 return __builtin_reduce_or((__v8di)__W);
9354}8945}
93558946
...@@ -9400,22 +8991,22 @@ _mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W) {...@@ -9400,22 +8991,22 @@ _mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W) {
9400 return __builtin_ia32_reduce_fmul_pd512(1.0, __W);8991 return __builtin_ia32_reduce_fmul_pd512(1.0, __W);
9401}8992}
94028993
9403static __inline__ int __DEFAULT_FN_ATTRS5128994static __inline__ int __DEFAULT_FN_ATTRS512_CONSTEXPR
9404_mm512_reduce_add_epi32(__m512i __W) {8995_mm512_reduce_add_epi32(__m512i __W) {
9405 return __builtin_reduce_add((__v16si)__W);8996 return __builtin_reduce_add((__v16si)__W);
9406}8997}
94078998
9408static __inline__ int __DEFAULT_FN_ATTRS5128999static __inline__ int __DEFAULT_FN_ATTRS512_CONSTEXPR
9409_mm512_reduce_mul_epi32(__m512i __W) {9000_mm512_reduce_mul_epi32(__m512i __W) {
9410 return __builtin_reduce_mul((__v16si)__W);9001 return __builtin_reduce_mul((__v16si)__W);
9411}9002}
94129003
9413static __inline__ int __DEFAULT_FN_ATTRS5129004static __inline__ int __DEFAULT_FN_ATTRS512_CONSTEXPR
9414_mm512_reduce_and_epi32(__m512i __W) {9005_mm512_reduce_and_epi32(__m512i __W) {
9415 return __builtin_reduce_and((__v16si)__W);9006 return __builtin_reduce_and((__v16si)__W);
9416}9007}
94179008
9418static __inline__ int __DEFAULT_FN_ATTRS5129009static __inline__ int __DEFAULT_FN_ATTRS512_CONSTEXPR
9419_mm512_reduce_or_epi32(__m512i __W) {9010_mm512_reduce_or_epi32(__m512i __W) {
9420 return __builtin_reduce_or((__v16si)__W);9011 return __builtin_reduce_or((__v16si)__W);
9421}9012}
...@@ -9466,22 +9057,22 @@ _mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) {...@@ -9466,22 +9057,22 @@ _mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) {
9466 return __builtin_ia32_reduce_fmul_ps512(1.0f, __W);9057 return __builtin_ia32_reduce_fmul_ps512(1.0f, __W);
9467}9058}
94689059
9469static __inline__ long long __DEFAULT_FN_ATTRS5129060static __inline__ long long __DEFAULT_FN_ATTRS512_CONSTEXPR
9470_mm512_reduce_max_epi64(__m512i __V) {9061_mm512_reduce_max_epi64(__m512i __V) {
9471 return __builtin_reduce_max((__v8di)__V);9062 return __builtin_reduce_max((__v8di)__V);
9472}9063}
94739064
9474static __inline__ unsigned long long __DEFAULT_FN_ATTRS5129065static __inline__ unsigned long long __DEFAULT_FN_ATTRS512_CONSTEXPR
9475_mm512_reduce_max_epu64(__m512i __V) {9066_mm512_reduce_max_epu64(__m512i __V) {
9476 return __builtin_reduce_max((__v8du)__V);9067 return __builtin_reduce_max((__v8du)__V);
9477}9068}
94789069
9479static __inline__ long long __DEFAULT_FN_ATTRS5129070static __inline__ long long __DEFAULT_FN_ATTRS512_CONSTEXPR
9480_mm512_reduce_min_epi64(__m512i __V) {9071_mm512_reduce_min_epi64(__m512i __V) {
9481 return __builtin_reduce_min((__v8di)__V);9072 return __builtin_reduce_min((__v8di)__V);
9482}9073}
94839074
9484static __inline__ unsigned long long __DEFAULT_FN_ATTRS5129075static __inline__ unsigned long long __DEFAULT_FN_ATTRS512_CONSTEXPR
9485_mm512_reduce_min_epu64(__m512i __V) {9076_mm512_reduce_min_epu64(__m512i __V) {
9486 return __builtin_reduce_min((__v8du)__V);9077 return __builtin_reduce_min((__v8du)__V);
9487}9078}
...@@ -9509,22 +9100,22 @@ _mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) {...@@ -9509,22 +9100,22 @@ _mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) {
9509 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(-1LL), __M, __V);9100 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(-1LL), __M, __V);
9510 return __builtin_reduce_min((__v8du)__V);9101 return __builtin_reduce_min((__v8du)__V);
9511}9102}
9512static __inline__ int __DEFAULT_FN_ATTRS5129103static __inline__ int __DEFAULT_FN_ATTRS512_CONSTEXPR
9513_mm512_reduce_max_epi32(__m512i __V) {9104_mm512_reduce_max_epi32(__m512i __V) {
9514 return __builtin_reduce_max((__v16si)__V);9105 return __builtin_reduce_max((__v16si)__V);
9515}9106}
95169107
9517static __inline__ unsigned int __DEFAULT_FN_ATTRS5129108static __inline__ unsigned int __DEFAULT_FN_ATTRS512_CONSTEXPR
9518_mm512_reduce_max_epu32(__m512i __V) {9109_mm512_reduce_max_epu32(__m512i __V) {
9519 return __builtin_reduce_max((__v16su)__V);9110 return __builtin_reduce_max((__v16su)__V);
9520}9111}
95219112
9522static __inline__ int __DEFAULT_FN_ATTRS5129113static __inline__ int __DEFAULT_FN_ATTRS512_CONSTEXPR
9523_mm512_reduce_min_epi32(__m512i __V) {9114_mm512_reduce_min_epi32(__m512i __V) {
9524 return __builtin_reduce_min((__v16si)__V);9115 return __builtin_reduce_min((__v16si)__V);
9525}9116}
95269117
9527static __inline__ unsigned int __DEFAULT_FN_ATTRS5129118static __inline__ unsigned int __DEFAULT_FN_ATTRS512_CONSTEXPR
9528_mm512_reduce_min_epu32(__m512i __V) {9119_mm512_reduce_min_epu32(__m512i __V) {
9529 return __builtin_reduce_min((__v16su)__V);9120 return __builtin_reduce_min((__v16su)__V);
9530}9121}
lib/include/avx512fp16intrin.h+112-110
...@@ -22,26 +22,36 @@ typedef _Float16 __m512h_u __attribute__((__vector_size__(64), __aligned__(1)));...@@ -22,26 +22,36 @@ typedef _Float16 __m512h_u __attribute__((__vector_size__(64), __aligned__(1)));
2222
23/* Define the default attributes for the functions in this file. */23/* Define the default attributes for the functions in this file. */
24#define __DEFAULT_FN_ATTRS512 \24#define __DEFAULT_FN_ATTRS512 \
25 __attribute__((__always_inline__, __nodebug__, \25 __attribute__((__always_inline__, __nodebug__, __target__("avx512fp16"), \
26 __target__("avx512fp16,evex512"), __min_vector_width__(512)))26 __min_vector_width__(512)))
27#define __DEFAULT_FN_ATTRS256 \27#define __DEFAULT_FN_ATTRS256 \
28 __attribute__((__always_inline__, __nodebug__, \28 __attribute__((__always_inline__, __nodebug__, __target__("avx512fp16"), \
29 __target__("avx512fp16,no-evex512"), \
30 __min_vector_width__(256)))29 __min_vector_width__(256)))
31#define __DEFAULT_FN_ATTRS128 \30#define __DEFAULT_FN_ATTRS128 \
32 __attribute__((__always_inline__, __nodebug__, \31 __attribute__((__always_inline__, __nodebug__, __target__("avx512fp16"), \
33 __target__("avx512fp16,no-evex512"), \
34 __min_vector_width__(128)))32 __min_vector_width__(128)))
3533
36static __inline__ _Float16 __DEFAULT_FN_ATTRS512 _mm512_cvtsh_h(__m512h __a) {34#if defined(__cplusplus) && (__cplusplus >= 201103L)
35#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
36#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
37#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
38#else
39#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
40#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
41#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
42#endif
43
44static __inline__ _Float16 __DEFAULT_FN_ATTRS512_CONSTEXPR
45_mm512_cvtsh_h(__m512h __a) {
37 return __a[0];46 return __a[0];
38}47}
3948
40static __inline __m128h __DEFAULT_FN_ATTRS128 _mm_setzero_ph(void) {49static __inline __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_setzero_ph(void) {
41 return (__m128h){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};50 return (__m128h){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
42}51}
4352
44static __inline __m256h __DEFAULT_FN_ATTRS256 _mm256_setzero_ph(void) {53static __inline __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
54_mm256_setzero_ph(void) {
45 return (__m256h){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,55 return (__m256h){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
46 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};56 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
47}57}
...@@ -50,7 +60,8 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_undefined_ph(void) {...@@ -50,7 +60,8 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_undefined_ph(void) {
50 return (__m256h)__builtin_ia32_undef256();60 return (__m256h)__builtin_ia32_undef256();
51}61}
5262
53static __inline __m512h __DEFAULT_FN_ATTRS512 _mm512_setzero_ph(void) {63static __inline __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
64_mm512_setzero_ph(void) {
54 return (__m512h){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,65 return (__m512h){0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
55 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,66 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
56 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};67 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
...@@ -64,14 +75,15 @@ static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_undefined_ph(void) {...@@ -64,14 +75,15 @@ static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_undefined_ph(void) {
64 return (__m512h)__builtin_ia32_undef512();75 return (__m512h)__builtin_ia32_undef512();
65}76}
6677
67static __inline __m512h __DEFAULT_FN_ATTRS512 _mm512_set1_ph(_Float16 __h) {78static __inline __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
79_mm512_set1_ph(_Float16 __h) {
68 return (__m512h)(__v32hf){__h, __h, __h, __h, __h, __h, __h, __h,80 return (__m512h)(__v32hf){__h, __h, __h, __h, __h, __h, __h, __h,
69 __h, __h, __h, __h, __h, __h, __h, __h,81 __h, __h, __h, __h, __h, __h, __h, __h,
70 __h, __h, __h, __h, __h, __h, __h, __h,82 __h, __h, __h, __h, __h, __h, __h, __h,
71 __h, __h, __h, __h, __h, __h, __h, __h};83 __h, __h, __h, __h, __h, __h, __h, __h};
72}84}
7385
74static __inline __m512h __DEFAULT_FN_ATTRS51286static __inline __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
75_mm512_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,87_mm512_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,
76 _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8,88 _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8,
77 _Float16 __h9, _Float16 __h10, _Float16 __h11, _Float16 __h12,89 _Float16 __h9, _Float16 __h10, _Float16 __h11, _Float16 __h12,
...@@ -87,106 +99,111 @@ _mm512_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,...@@ -87,106 +99,111 @@ _mm512_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,
87 __h4, __h3, __h2, __h1};99 __h4, __h3, __h2, __h1};
88}100}
89101
90#define _mm512_setr_ph(h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, \102static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_setr_ph(
91 h14, h15, h16, h17, h18, h19, h20, h21, h22, h23, h24, \103 _Float16 e0, _Float16 e1, _Float16 e2, _Float16 e3, _Float16 e4,
92 h25, h26, h27, h28, h29, h30, h31, h32) \104 _Float16 e5, _Float16 e6, _Float16 e7, _Float16 e8, _Float16 e9,
93 _mm512_set_ph((h32), (h31), (h30), (h29), (h28), (h27), (h26), (h25), (h24), \105 _Float16 e10, _Float16 e11, _Float16 e12, _Float16 e13, _Float16 e14,
94 (h23), (h22), (h21), (h20), (h19), (h18), (h17), (h16), (h15), \106 _Float16 e15, _Float16 e16, _Float16 e17, _Float16 e18, _Float16 e19,
95 (h14), (h13), (h12), (h11), (h10), (h9), (h8), (h7), (h6), \107 _Float16 e20, _Float16 e21, _Float16 e22, _Float16 e23, _Float16 e24,
96 (h5), (h4), (h3), (h2), (h1))108 _Float16 e25, _Float16 e26, _Float16 e27, _Float16 e28, _Float16 e29,
109 _Float16 e30, _Float16 e31) {
110 return _mm512_set_ph(e31, e30, e29, e28, e27, e26, e25, e24, e23, e22, e21,
111 e20, e19, e18, e17, e16, e15, e14, e13, e12, e11, e10,
112 e9, e8, e7, e6, e5, e4, e3, e2, e1, e0);
113}
97114
98static __inline __m512h __DEFAULT_FN_ATTRS512115static __inline __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
99_mm512_set1_pch(_Float16 _Complex __h) {116_mm512_set1_pch(_Float16 _Complex __h) {
100 return (__m512h)_mm512_set1_ps(__builtin_bit_cast(float, __h));117 return (__m512h)_mm512_set1_ps(__builtin_bit_cast(float, __h));
101}118}
102119
103static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_castph_ps(__m128h __a) {120static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_castph_ps(__m128h __a) {
104 return (__m128)__a;121 return (__m128)__a;
105}122}
106123
107static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_castph_ps(__m256h __a) {124static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR _mm256_castph_ps(__m256h __a) {
108 return (__m256)__a;125 return (__m256)__a;
109}126}
110127
111static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_castph_ps(__m512h __a) {128static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_castph_ps(__m512h __a) {
112 return (__m512)__a;129 return (__m512)__a;
113}130}
114131
115static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_castph_pd(__m128h __a) {132static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_castph_pd(__m128h __a) {
116 return (__m128d)__a;133 return (__m128d)__a;
117}134}
118135
119static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_castph_pd(__m256h __a) {136static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR _mm256_castph_pd(__m256h __a) {
120 return (__m256d)__a;137 return (__m256d)__a;
121}138}
122139
123static __inline__ __m512d __DEFAULT_FN_ATTRS512 _mm512_castph_pd(__m512h __a) {140static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_castph_pd(__m512h __a) {
124 return (__m512d)__a;141 return (__m512d)__a;
125}142}
126143
127static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_castph_si128(__m128h __a) {144static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_castph_si128(__m128h __a) {
128 return (__m128i)__a;145 return (__m128i)__a;
129}146}
130147
131static __inline__ __m256i __DEFAULT_FN_ATTRS256148static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
132_mm256_castph_si256(__m256h __a) {149_mm256_castph_si256(__m256h __a) {
133 return (__m256i)__a;150 return (__m256i)__a;
134}151}
135152
136static __inline__ __m512i __DEFAULT_FN_ATTRS512153static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
137_mm512_castph_si512(__m512h __a) {154_mm512_castph_si512(__m512h __a) {
138 return (__m512i)__a;155 return (__m512i)__a;
139}156}
140157
141static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_castps_ph(__m128 __a) {158static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_castps_ph(__m128 __a) {
142 return (__m128h)__a;159 return (__m128h)__a;
143}160}
144161
145static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_castps_ph(__m256 __a) {162static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR _mm256_castps_ph(__m256 __a) {
146 return (__m256h)__a;163 return (__m256h)__a;
147}164}
148165
149static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_castps_ph(__m512 __a) {166static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_castps_ph(__m512 __a) {
150 return (__m512h)__a;167 return (__m512h)__a;
151}168}
152169
153static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_castpd_ph(__m128d __a) {170static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_castpd_ph(__m128d __a) {
154 return (__m128h)__a;171 return (__m128h)__a;
155}172}
156173
157static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_castpd_ph(__m256d __a) {174static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR _mm256_castpd_ph(__m256d __a) {
158 return (__m256h)__a;175 return (__m256h)__a;
159}176}
160177
161static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_castpd_ph(__m512d __a) {178static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_castpd_ph(__m512d __a) {
162 return (__m512h)__a;179 return (__m512h)__a;
163}180}
164181
165static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_castsi128_ph(__m128i __a) {182static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_castsi128_ph(__m128i __a) {
166 return (__m128h)__a;183 return (__m128h)__a;
167}184}
168185
169static __inline__ __m256h __DEFAULT_FN_ATTRS256186static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
170_mm256_castsi256_ph(__m256i __a) {187_mm256_castsi256_ph(__m256i __a) {
171 return (__m256h)__a;188 return (__m256h)__a;
172}189}
173190
174static __inline__ __m512h __DEFAULT_FN_ATTRS512191static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
175_mm512_castsi512_ph(__m512i __a) {192_mm512_castsi512_ph(__m512i __a) {
176 return (__m512h)__a;193 return (__m512h)__a;
177}194}
178195
179static __inline__ __m128h __DEFAULT_FN_ATTRS256196static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
180_mm256_castph256_ph128(__m256h __a) {197_mm256_castph256_ph128(__m256h __a) {
181 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7);198 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7);
182}199}
183200
184static __inline__ __m128h __DEFAULT_FN_ATTRS512201static __inline__ __m128h __DEFAULT_FN_ATTRS512_CONSTEXPR
185_mm512_castph512_ph128(__m512h __a) {202_mm512_castph512_ph128(__m512h __a) {
186 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7);203 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7);
187}204}
188205
189static __inline__ __m256h __DEFAULT_FN_ATTRS512206static __inline__ __m256h __DEFAULT_FN_ATTRS512_CONSTEXPR
190_mm512_castph512_ph256(__m512h __a) {207_mm512_castph512_ph256(__m512h __a) {
191 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,208 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
192 12, 13, 14, 15);209 12, 13, 14, 15);
...@@ -229,7 +246,7 @@ _mm512_castph256_ph512(__m256h __a) {...@@ -229,7 +246,7 @@ _mm512_castph256_ph512(__m256h __a) {
229/// A 128-bit vector of [8 x half].246/// A 128-bit vector of [8 x half].
230/// \returns A 512-bit floating-point vector of [16 x half]. The lower 128 bits247/// \returns A 512-bit floating-point vector of [16 x half]. The lower 128 bits
231/// contain the value of the parameter. The upper 384 bits are set to zero.248/// contain the value of the parameter. The upper 384 bits are set to zero.
232static __inline__ __m256h __DEFAULT_FN_ATTRS256249static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
233_mm256_zextph128_ph256(__m128h __a) {250_mm256_zextph128_ph256(__m128h __a) {
234 return __builtin_shufflevector(__a, (__v8hf)_mm_setzero_ph(), 0, 1, 2, 3, 4,251 return __builtin_shufflevector(__a, (__v8hf)_mm_setzero_ph(), 0, 1, 2, 3, 4,
235 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);252 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
...@@ -248,7 +265,7 @@ _mm256_zextph128_ph256(__m128h __a) {...@@ -248,7 +265,7 @@ _mm256_zextph128_ph256(__m128h __a) {
248/// A 128-bit vector of [8 x half].265/// A 128-bit vector of [8 x half].
249/// \returns A 512-bit floating-point vector of [32 x half]. The lower 128 bits266/// \returns A 512-bit floating-point vector of [32 x half]. The lower 128 bits
250/// contain the value of the parameter. The upper 384 bits are set to zero.267/// contain the value of the parameter. The upper 384 bits are set to zero.
251static __inline__ __m512h __DEFAULT_FN_ATTRS512268static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
252_mm512_zextph128_ph512(__m128h __a) {269_mm512_zextph128_ph512(__m128h __a) {
253 return __builtin_shufflevector(270 return __builtin_shufflevector(
254 __a, (__v8hf)_mm_setzero_ph(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,271 __a, (__v8hf)_mm_setzero_ph(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
...@@ -268,7 +285,7 @@ _mm512_zextph128_ph512(__m128h __a) {...@@ -268,7 +285,7 @@ _mm512_zextph128_ph512(__m128h __a) {
268/// A 256-bit vector of [16 x half].285/// A 256-bit vector of [16 x half].
269/// \returns A 512-bit floating-point vector of [32 x half]. The lower 256 bits286/// \returns A 512-bit floating-point vector of [32 x half]. The lower 256 bits
270/// contain the value of the parameter. The upper 256 bits are set to zero.287/// contain the value of the parameter. The upper 256 bits are set to zero.
271static __inline__ __m512h __DEFAULT_FN_ATTRS512288static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
272_mm512_zextph256_ph512(__m256h __a) {289_mm512_zextph256_ph512(__m256h __a) {
273 return __builtin_shufflevector(__a, (__v16hf)_mm256_setzero_ph(), 0, 1, 2, 3,290 return __builtin_shufflevector(__a, (__v16hf)_mm256_setzero_ph(), 0, 1, 2, 3,
274 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,291 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
...@@ -482,19 +499,19 @@ _mm512_maskz_div_ph(__mmask32 __U, __m512h __A, __m512h __B) {...@@ -482,19 +499,19 @@ _mm512_maskz_div_ph(__mmask32 __U, __m512h __A, __m512h __B) {
482 (__mmask32)(U), (__v32hf)_mm512_div_round_ph((A), (B), (R)), \499 (__mmask32)(U), (__v32hf)_mm512_div_round_ph((A), (B), (R)), \
483 (__v32hf)_mm512_setzero_ph()))500 (__v32hf)_mm512_setzero_ph()))
484501
485static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_min_ph(__m512h __A,502static __inline__ __m512h
486 __m512h __B) {503 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_min_ph(__m512h __A, __m512h __B) {
487 return (__m512h)__builtin_ia32_minph512((__v32hf)__A, (__v32hf)__B,504 return (__m512h)__builtin_ia32_minph512((__v32hf)__A, (__v32hf)__B,
488 _MM_FROUND_CUR_DIRECTION);505 _MM_FROUND_CUR_DIRECTION);
489}506}
490507
491static __inline__ __m512h __DEFAULT_FN_ATTRS512508static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
492_mm512_mask_min_ph(__m512h __W, __mmask32 __U, __m512h __A, __m512h __B) {509_mm512_mask_min_ph(__m512h __W, __mmask32 __U, __m512h __A, __m512h __B) {
493 return (__m512h)__builtin_ia32_selectph_512(510 return (__m512h)__builtin_ia32_selectph_512(
494 (__mmask32)__U, (__v32hf)_mm512_min_ph(__A, __B), (__v32hf)__W);511 (__mmask32)__U, (__v32hf)_mm512_min_ph(__A, __B), (__v32hf)__W);
495}512}
496513
497static __inline__ __m512h __DEFAULT_FN_ATTRS512514static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
498_mm512_maskz_min_ph(__mmask32 __U, __m512h __A, __m512h __B) {515_mm512_maskz_min_ph(__mmask32 __U, __m512h __A, __m512h __B) {
499 return (__m512h)__builtin_ia32_selectph_512((__mmask32)__U,516 return (__m512h)__builtin_ia32_selectph_512((__mmask32)__U,
500 (__v32hf)_mm512_min_ph(__A, __B),517 (__v32hf)_mm512_min_ph(__A, __B),
...@@ -515,19 +532,19 @@ _mm512_maskz_min_ph(__mmask32 __U, __m512h __A, __m512h __B) {...@@ -515,19 +532,19 @@ _mm512_maskz_min_ph(__mmask32 __U, __m512h __A, __m512h __B) {
515 (__mmask32)(U), (__v32hf)_mm512_min_round_ph((A), (B), (R)), \532 (__mmask32)(U), (__v32hf)_mm512_min_round_ph((A), (B), (R)), \
516 (__v32hf)_mm512_setzero_ph()))533 (__v32hf)_mm512_setzero_ph()))
517534
518static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_max_ph(__m512h __A,535static __inline__ __m512h
519 __m512h __B) {536 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_max_ph(__m512h __A, __m512h __B) {
520 return (__m512h)__builtin_ia32_maxph512((__v32hf)__A, (__v32hf)__B,537 return (__m512h)__builtin_ia32_maxph512((__v32hf)__A, (__v32hf)__B,
521 _MM_FROUND_CUR_DIRECTION);538 _MM_FROUND_CUR_DIRECTION);
522}539}
523540
524static __inline__ __m512h __DEFAULT_FN_ATTRS512541static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
525_mm512_mask_max_ph(__m512h __W, __mmask32 __U, __m512h __A, __m512h __B) {542_mm512_mask_max_ph(__m512h __W, __mmask32 __U, __m512h __A, __m512h __B) {
526 return (__m512h)__builtin_ia32_selectph_512(543 return (__m512h)__builtin_ia32_selectph_512(
527 (__mmask32)__U, (__v32hf)_mm512_max_ph(__A, __B), (__v32hf)__W);544 (__mmask32)__U, (__v32hf)_mm512_max_ph(__A, __B), (__v32hf)__W);
528}545}
529546
530static __inline__ __m512h __DEFAULT_FN_ATTRS512547static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
531_mm512_maskz_max_ph(__mmask32 __U, __m512h __A, __m512h __B) {548_mm512_maskz_max_ph(__mmask32 __U, __m512h __A, __m512h __B) {
532 return (__m512h)__builtin_ia32_selectph_512((__mmask32)__U,549 return (__m512h)__builtin_ia32_selectph_512((__mmask32)__U,
533 (__v32hf)_mm512_max_ph(__A, __B),550 (__v32hf)_mm512_max_ph(__A, __B),
...@@ -548,7 +565,8 @@ _mm512_maskz_max_ph(__mmask32 __U, __m512h __A, __m512h __B) {...@@ -548,7 +565,8 @@ _mm512_maskz_max_ph(__mmask32 __U, __m512h __A, __m512h __B) {
548 (__mmask32)(U), (__v32hf)_mm512_max_round_ph((A), (B), (R)), \565 (__mmask32)(U), (__v32hf)_mm512_max_round_ph((A), (B), (R)), \
549 (__v32hf)_mm512_setzero_ph()))566 (__v32hf)_mm512_setzero_ph()))
550567
551static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_abs_ph(__m512h __A) {568static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
569_mm512_abs_ph(__m512h __A) {
552 return (__m512h)_mm512_and_epi32(_mm512_set1_epi32(0x7FFF7FFF), (__m512i)__A);570 return (__m512h)_mm512_and_epi32(_mm512_set1_epi32(0x7FFF7FFF), (__m512i)__A);
553}571}
554572
...@@ -570,23 +588,20 @@ _mm512_maskz_conj_pch(__mmask16 __U, __m512h __A) {...@@ -570,23 +588,20 @@ _mm512_maskz_conj_pch(__mmask16 __U, __m512h __A) {
570 (__v16sf)_mm512_setzero_ps());588 (__v16sf)_mm512_setzero_ps());
571}589}
572590
573static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_add_sh(__m128h __A,591static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
574 __m128h __B) {592_mm_add_sh(__m128h __A, __m128h __B) {
575 __A[0] += __B[0];593 __A[0] += __B[0];
576 return __A;594 return __A;
577}595}
578596
579static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_add_sh(__m128h __W,597static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
580 __mmask8 __U,598_mm_mask_add_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
581 __m128h __A,
582 __m128h __B) {
583 __A = _mm_add_sh(__A, __B);599 __A = _mm_add_sh(__A, __B);
584 return __builtin_ia32_selectsh_128(__U, __A, __W);600 return __builtin_ia32_selectsh_128(__U, __A, __W);
585}601}
586602
587static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_add_sh(__mmask8 __U,603static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
588 __m128h __A,604_mm_maskz_add_sh(__mmask8 __U, __m128h __A, __m128h __B) {
589 __m128h __B) {
590 __A = _mm_add_sh(__A, __B);605 __A = _mm_add_sh(__A, __B);
591 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());606 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());
592}607}
...@@ -606,23 +621,20 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_add_sh(__mmask8 __U,...@@ -606,23 +621,20 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_add_sh(__mmask8 __U,
606 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \621 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \
607 (__mmask8)(U), (int)(R)))622 (__mmask8)(U), (int)(R)))
608623
609static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_sub_sh(__m128h __A,624static __inline__ __m128h
610 __m128h __B) {625 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_sub_sh(__m128h __A, __m128h __B) {
611 __A[0] -= __B[0];626 __A[0] -= __B[0];
612 return __A;627 return __A;
613}628}
614629
615static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_sub_sh(__m128h __W,630static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
616 __mmask8 __U,631_mm_mask_sub_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
617 __m128h __A,
618 __m128h __B) {
619 __A = _mm_sub_sh(__A, __B);632 __A = _mm_sub_sh(__A, __B);
620 return __builtin_ia32_selectsh_128(__U, __A, __W);633 return __builtin_ia32_selectsh_128(__U, __A, __W);
621}634}
622635
623static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_sub_sh(__mmask8 __U,636static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
624 __m128h __A,637_mm_maskz_sub_sh(__mmask8 __U, __m128h __A, __m128h __B) {
625 __m128h __B) {
626 __A = _mm_sub_sh(__A, __B);638 __A = _mm_sub_sh(__A, __B);
627 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());639 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());
628}640}
...@@ -642,23 +654,20 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_sub_sh(__mmask8 __U,...@@ -642,23 +654,20 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_sub_sh(__mmask8 __U,
642 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \654 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \
643 (__mmask8)(U), (int)(R)))655 (__mmask8)(U), (int)(R)))
644656
645static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mul_sh(__m128h __A,657static __inline__ __m128h
646 __m128h __B) {658 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_mul_sh(__m128h __A, __m128h __B) {
647 __A[0] *= __B[0];659 __A[0] *= __B[0];
648 return __A;660 return __A;
649}661}
650662
651static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_mul_sh(__m128h __W,663static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
652 __mmask8 __U,664_mm_mask_mul_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
653 __m128h __A,
654 __m128h __B) {
655 __A = _mm_mul_sh(__A, __B);665 __A = _mm_mul_sh(__A, __B);
656 return __builtin_ia32_selectsh_128(__U, __A, __W);666 return __builtin_ia32_selectsh_128(__U, __A, __W);
657}667}
658668
659static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_mul_sh(__mmask8 __U,669static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
660 __m128h __A,670_mm_maskz_mul_sh(__mmask8 __U, __m128h __A, __m128h __B) {
661 __m128h __B) {
662 __A = _mm_mul_sh(__A, __B);671 __A = _mm_mul_sh(__A, __B);
663 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());672 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());
664}673}
...@@ -678,23 +687,20 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_mul_sh(__mmask8 __U,...@@ -678,23 +687,20 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_mul_sh(__mmask8 __U,
678 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \687 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \
679 (__mmask8)(U), (int)(R)))688 (__mmask8)(U), (int)(R)))
680689
681static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_div_sh(__m128h __A,690static __inline__ __m128h
682 __m128h __B) {691 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_div_sh(__m128h __A, __m128h __B) {
683 __A[0] /= __B[0];692 __A[0] /= __B[0];
684 return __A;693 return __A;
685}694}
686695
687static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_div_sh(__m128h __W,696static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
688 __mmask8 __U,697_mm_mask_div_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
689 __m128h __A,
690 __m128h __B) {
691 __A = _mm_div_sh(__A, __B);698 __A = _mm_div_sh(__A, __B);
692 return __builtin_ia32_selectsh_128(__U, __A, __W);699 return __builtin_ia32_selectsh_128(__U, __A, __W);
693}700}
694701
695static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_div_sh(__mmask8 __U,702static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
696 __m128h __A,703_mm_maskz_div_sh(__mmask8 __U, __m128h __A, __m128h __B) {
697 __m128h __B) {
698 __A = _mm_div_sh(__A, __B);704 __A = _mm_div_sh(__A, __B);
699 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());705 return __builtin_ia32_selectsh_128(__U, __A, _mm_setzero_ph());
700}706}
...@@ -942,22 +948,19 @@ static __inline__ void __DEFAULT_FN_ATTRS128 _mm_storeu_ph(void *__P,...@@ -942,22 +948,19 @@ static __inline__ void __DEFAULT_FN_ATTRS128 _mm_storeu_ph(void *__P,
942}948}
943949
944// moves with vmovsh:950// moves with vmovsh:
945static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_move_sh(__m128h __a,951static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
946 __m128h __b) {952_mm_move_sh(__m128h __a, __m128h __b) {
947 __a[0] = __b[0];953 __a[0] = __b[0];
948 return __a;954 return __a;
949}955}
950956
951static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_move_sh(__m128h __W,957static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
952 __mmask8 __U,958_mm_mask_move_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
953 __m128h __A,
954 __m128h __B) {
955 return __builtin_ia32_selectsh_128(__U, _mm_move_sh(__A, __B), __W);959 return __builtin_ia32_selectsh_128(__U, _mm_move_sh(__A, __B), __W);
956}960}
957961
958static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_move_sh(__mmask8 __U,962static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
959 __m128h __A,963_mm_maskz_move_sh(__mmask8 __U, __m128h __A, __m128h __B) {
960 __m128h __B) {
961 return __builtin_ia32_selectsh_128(__U, _mm_move_sh(__A, __B),964 return __builtin_ia32_selectsh_128(__U, _mm_move_sh(__A, __B),
962 _mm_setzero_ph());965 _mm_setzero_ph());
963}966}
...@@ -1383,24 +1386,20 @@ _mm_maskz_scalef_sh(__mmask8 __U, __m128h __A, __m128h __B) {...@@ -1383,24 +1386,20 @@ _mm_maskz_scalef_sh(__mmask8 __U, __m128h __A, __m128h __B) {
1383 (__v32hf)_mm512_setzero_ph()))1386 (__v32hf)_mm512_setzero_ph()))
13841387
1385static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_sqrt_ph(__m512h __A) {1388static __inline__ __m512h __DEFAULT_FN_ATTRS512 _mm512_sqrt_ph(__m512h __A) {
1386 return (__m512h)__builtin_ia32_sqrtph512((__v32hf)__A,1389 return (__m512h)__builtin_elementwise_sqrt((__v32hf)__A);
1387 _MM_FROUND_CUR_DIRECTION);
1388}1390}
13891391
1390static __inline__ __m512h __DEFAULT_FN_ATTRS5121392static __inline__ __m512h __DEFAULT_FN_ATTRS512
1391_mm512_mask_sqrt_ph(__m512h __W, __mmask32 __U, __m512h __A) {1393_mm512_mask_sqrt_ph(__m512h __W, __mmask32 __U, __m512h __A) {
1392 return (__m512h)__builtin_ia32_selectph_512(1394 return (__m512h)__builtin_ia32_selectph_512(
1393 (__mmask32)(__U),1395 (__mmask32)(__U), (__v32hf)_mm512_sqrt_ph(__A), (__v32hf)(__m512h)(__W));
1394 (__v32hf)__builtin_ia32_sqrtph512((__A), (_MM_FROUND_CUR_DIRECTION)),
1395 (__v32hf)(__m512h)(__W));
1396}1396}
13971397
1398static __inline__ __m512h __DEFAULT_FN_ATTRS5121398static __inline__ __m512h __DEFAULT_FN_ATTRS512
1399_mm512_maskz_sqrt_ph(__mmask32 __U, __m512h __A) {1399_mm512_maskz_sqrt_ph(__mmask32 __U, __m512h __A) {
1400 return (__m512h)__builtin_ia32_selectph_512(1400 return (__m512h)__builtin_ia32_selectph_512((__mmask32)(__U),
1401 (__mmask32)(__U),1401 (__v32hf)_mm512_sqrt_ph(__A),
1402 (__v32hf)__builtin_ia32_sqrtph512((__A), (_MM_FROUND_CUR_DIRECTION)),1402 (__v32hf)_mm512_setzero_ph());
1403 (__v32hf)_mm512_setzero_ph());
1404}1403}
14051404
1406#define _mm_sqrt_round_sh(A, B, R) \1405#define _mm_sqrt_round_sh(A, B, R) \
...@@ -3292,19 +3291,19 @@ _mm512_reduce_min_ph(__m512h __V) {...@@ -3292,19 +3291,19 @@ _mm512_reduce_min_ph(__m512h __V) {
3292 return __builtin_ia32_reduce_fmin_ph512(__V);3291 return __builtin_ia32_reduce_fmin_ph512(__V);
3293}3292}
32943293
3295static __inline__ __m512h __DEFAULT_FN_ATTRS5123294static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
3296_mm512_mask_blend_ph(__mmask32 __U, __m512h __A, __m512h __W) {3295_mm512_mask_blend_ph(__mmask32 __U, __m512h __A, __m512h __W) {
3297 return (__m512h)__builtin_ia32_selectph_512((__mmask32)__U, (__v32hf)__W,3296 return (__m512h)__builtin_ia32_selectph_512((__mmask32)__U, (__v32hf)__W,
3298 (__v32hf)__A);3297 (__v32hf)__A);
3299}3298}
33003299
3301static __inline__ __m512h __DEFAULT_FN_ATTRS5123300static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
3302_mm512_permutex2var_ph(__m512h __A, __m512i __I, __m512h __B) {3301_mm512_permutex2var_ph(__m512h __A, __m512i __I, __m512h __B) {
3303 return (__m512h)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,3302 return (__m512h)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,
3304 (__v32hi)__B);3303 (__v32hi)__B);
3305}3304}
33063305
3307static __inline__ __m512h __DEFAULT_FN_ATTRS5123306static __inline__ __m512h __DEFAULT_FN_ATTRS512_CONSTEXPR
3308_mm512_permutexvar_ph(__m512i __A, __m512h __B) {3307_mm512_permutexvar_ph(__m512i __A, __m512h __B) {
3309 return (__m512h)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A);3308 return (__m512h)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A);
3310}3309}
...@@ -3348,6 +3347,9 @@ _mm512_permutexvar_ph(__m512i __A, __m512h __B) {...@@ -3348,6 +3347,9 @@ _mm512_permutexvar_ph(__m512i __A, __m512h __B) {
3348#undef __DEFAULT_FN_ATTRS1283347#undef __DEFAULT_FN_ATTRS128
3349#undef __DEFAULT_FN_ATTRS2563348#undef __DEFAULT_FN_ATTRS256
3350#undef __DEFAULT_FN_ATTRS5123349#undef __DEFAULT_FN_ATTRS512
3350#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
3351#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
3352#undef __DEFAULT_FN_ATTRS512_CONSTEXPR
33513353
3352#endif3354#endif
3353#endif3355#endif
lib/include/avx512ifmaintrin.h+32-34
...@@ -15,54 +15,52 @@...@@ -15,54 +15,52 @@
15#define __IFMAINTRIN_H15#define __IFMAINTRIN_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)
18#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), \
20 __target__("avx512ifma,evex512"), __min_vector_width__(512)))21 __min_vector_width__(512))) constexpr
22#else
23#define __DEFAULT_FN_ATTRS \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), \
25 __min_vector_width__(512)))
26#endif
2127
22static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS
23_mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z)29_mm512_madd52hi_epu64(__m512i __X, __m512i __Y, __m512i __Z) {
24{30 return (__m512i)__builtin_ia32_vpmadd52huq512((__v8di)__X, (__v8di)__Y,
25 return (__m512i)__builtin_ia32_vpmadd52huq512((__v8di) __X, (__v8di) __Y,31 (__v8di)__Z);
26 (__v8di) __Z);
27}32}
2833
29static __inline__ __m512i __DEFAULT_FN_ATTRS34static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_madd52hi_epu64(
30_mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)35 __m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) {
31{36 return (__m512i)__builtin_ia32_selectq_512(
32 return (__m512i)__builtin_ia32_selectq_512(__M,37 __M, (__v8di)_mm512_madd52hi_epu64(__W, __X, __Y), (__v8di)__W);
33 (__v8di)_mm512_madd52hi_epu64(__W, __X, __Y),
34 (__v8di)__W);
35}38}
3639
37static __inline__ __m512i __DEFAULT_FN_ATTRS40static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_madd52hi_epu64(
38_mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)41 __mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) {
39{42 return (__m512i)__builtin_ia32_selectq_512(
40 return (__m512i)__builtin_ia32_selectq_512(__M,43 __M, (__v8di)_mm512_madd52hi_epu64(__X, __Y, __Z),
41 (__v8di)_mm512_madd52hi_epu64(__X, __Y, __Z),44 (__v8di)_mm512_setzero_si512());
42 (__v8di)_mm512_setzero_si512());
43}45}
4446
45static __inline__ __m512i __DEFAULT_FN_ATTRS47static __inline__ __m512i __DEFAULT_FN_ATTRS
46_mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z)48_mm512_madd52lo_epu64(__m512i __X, __m512i __Y, __m512i __Z) {
47{49 return (__m512i)__builtin_ia32_vpmadd52luq512((__v8di)__X, (__v8di)__Y,
48 return (__m512i)__builtin_ia32_vpmadd52luq512((__v8di) __X, (__v8di) __Y,50 (__v8di)__Z);
49 (__v8di) __Z);
50}51}
5152
52static __inline__ __m512i __DEFAULT_FN_ATTRS53static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_madd52lo_epu64(
53_mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)54 __m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) {
54{55 return (__m512i)__builtin_ia32_selectq_512(
55 return (__m512i)__builtin_ia32_selectq_512(__M,56 __M, (__v8di)_mm512_madd52lo_epu64(__W, __X, __Y), (__v8di)__W);
56 (__v8di)_mm512_madd52lo_epu64(__W, __X, __Y),
57 (__v8di)__W);
58}57}
5958
60static __inline__ __m512i __DEFAULT_FN_ATTRS59static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_madd52lo_epu64(
61_mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)60 __mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) {
62{61 return (__m512i)__builtin_ia32_selectq_512(
63 return (__m512i)__builtin_ia32_selectq_512(__M,62 __M, (__v8di)_mm512_madd52lo_epu64(__X, __Y, __Z),
64 (__v8di)_mm512_madd52lo_epu64(__X, __Y, __Z),63 (__v8di)_mm512_setzero_si512());
65 (__v8di)_mm512_setzero_si512());
66}64}
6765
68#undef __DEFAULT_FN_ATTRS66#undef __DEFAULT_FN_ATTRS
lib/include/avx512ifmavlintrin.h+73-46
...@@ -8,22 +8,35 @@...@@ -8,22 +8,35 @@
8 *===-----------------------------------------------------------------------===8 *===-----------------------------------------------------------------------===
9 */9 */
10#ifndef __IMMINTRIN_H10#ifndef __IMMINTRIN_H
11#error "Never use <avx512ifmavlintrin.h> directly; include <immintrin.h> instead."11#error \
12 "Never use <avx512ifmavlintrin.h> directly; include <immintrin.h> instead."
12#endif13#endif
1314
14#ifndef __IFMAVLINTRIN_H15#ifndef __IFMAVLINTRIN_H
15#define __IFMAVLINTRIN_H16#define __IFMAVLINTRIN_H
1617
17/* Define the default attributes for the functions in this file. */18/* Define the default attributes for the functions in this file. */
19#if defined(__cplusplus) && (__cplusplus >= 201103L)
18#define __DEFAULT_FN_ATTRS128 \20#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \21 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512ifma,avx512vl,no-evex512"), \22 __target__("avx512ifma,avx512vl"), \
23 __min_vector_width__(128))) constexpr
24#define __DEFAULT_FN_ATTRS256 \
25 __attribute__((__always_inline__, __nodebug__, \
26 __target__("avx512ifma,avx512vl"), \
27 __min_vector_width__(256))) constexpr
28#else
29#define __DEFAULT_FN_ATTRS128 \
30 __attribute__((__always_inline__, __nodebug__, \
31 __target__("avx512ifma,avx512vl"), \
21 __min_vector_width__(128)))32 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \33#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \34 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512ifma,avx512vl,no-evex512"), \35 __target__("avx512ifma,avx512vl"), \
25 __min_vector_width__(256)))36 __min_vector_width__(256)))
37#endif
2638
39#if !(defined(__AVXIFMA__) || defined(__AVX512IFMA__))
27#define _mm_madd52hi_epu64(X, Y, Z) \40#define _mm_madd52hi_epu64(X, Y, Z) \
28 ((__m128i)__builtin_ia32_vpmadd52huq128((__v2di)(X), (__v2di)(Y), \41 ((__m128i)__builtin_ia32_vpmadd52huq128((__v2di)(X), (__v2di)(Y), \
29 (__v2di)(Z)))42 (__v2di)(Z)))
...@@ -39,71 +52,85 @@...@@ -39,71 +52,85 @@
39#define _mm256_madd52lo_epu64(X, Y, Z) \52#define _mm256_madd52lo_epu64(X, Y, Z) \
40 ((__m256i)__builtin_ia32_vpmadd52luq256((__v4di)(X), (__v4di)(Y), \53 ((__m256i)__builtin_ia32_vpmadd52luq256((__v4di)(X), (__v4di)(Y), \
41 (__v4di)(Z)))54 (__v4di)(Z)))
55#endif
4256
57#if defined(__AVX512IFMA__)
43static __inline__ __m128i __DEFAULT_FN_ATTRS12858static __inline__ __m128i __DEFAULT_FN_ATTRS128
44_mm_mask_madd52hi_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)59_mm_madd52hi_epu64(__m128i __X, __m128i __Y, __m128i __Z) {
45{60 return (__m128i)__builtin_ia32_vpmadd52huq128((__v2di)__X, (__v2di)__Y,
46 return (__m128i)__builtin_ia32_selectq_128(__M,61 (__v2di)__Z);
47 (__v2di)_mm_madd52hi_epu64(__W, __X, __Y),62}
48 (__v2di)__W);63
64static __inline__ __m256i __DEFAULT_FN_ATTRS256
65_mm256_madd52hi_epu64(__m256i __X, __m256i __Y, __m256i __Z) {
66 return (__m256i)__builtin_ia32_vpmadd52huq256((__v4di)__X, (__v4di)__Y,
67 (__v4di)__Z);
49}68}
5069
51static __inline__ __m128i __DEFAULT_FN_ATTRS12870static __inline__ __m128i __DEFAULT_FN_ATTRS128
52_mm_maskz_madd52hi_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)71_mm_madd52lo_epu64(__m128i __X, __m128i __Y, __m128i __Z) {
53{72 return (__m128i)__builtin_ia32_vpmadd52luq128((__v2di)__X, (__v2di)__Y,
54 return (__m128i)__builtin_ia32_selectq_128(__M,73 (__v2di)__Z);
55 (__v2di)_mm_madd52hi_epu64(__X, __Y, __Z),
56 (__v2di)_mm_setzero_si128());
57}74}
5875
59static __inline__ __m256i __DEFAULT_FN_ATTRS25676static __inline__ __m256i __DEFAULT_FN_ATTRS256
60_mm256_mask_madd52hi_epu64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)77_mm256_madd52lo_epu64(__m256i __X, __m256i __Y, __m256i __Z) {
61{78 return (__m256i)__builtin_ia32_vpmadd52luq256((__v4di)__X, (__v4di)__Y,
62 return (__m256i)__builtin_ia32_selectq_256(__M,79 (__v4di)__Z);
63 (__v4di)_mm256_madd52hi_epu64(__W, __X, __Y),
64 (__v4di)__W);
65}80}
81#endif
6682
67static __inline__ __m256i __DEFAULT_FN_ATTRS25683static __inline__ __m128i __DEFAULT_FN_ATTRS128
68_mm256_maskz_madd52hi_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)84_mm_mask_madd52hi_epu64(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) {
69{85 return (__m128i)__builtin_ia32_selectq_128(
70 return (__m256i)__builtin_ia32_selectq_256(__M,86 __M, (__v2di)__builtin_ia32_vpmadd52huq128(__W, __X, __Y), (__v2di)__W);
71 (__v4di)_mm256_madd52hi_epu64(__X, __Y, __Z),
72 (__v4di)_mm256_setzero_si256());
73}87}
7488
75static __inline__ __m128i __DEFAULT_FN_ATTRS12889static __inline__ __m128i __DEFAULT_FN_ATTRS128
76_mm_mask_madd52lo_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)90_mm_maskz_madd52hi_epu64(__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z) {
77{91 return (__m128i)__builtin_ia32_selectq_128(
78 return (__m128i)__builtin_ia32_selectq_128(__M,92 __M, (__v2di)__builtin_ia32_vpmadd52huq128(__X, __Y, __Z),
79 (__v2di)_mm_madd52lo_epu64(__W, __X, __Y),93 (__v2di)_mm_setzero_si128());
80 (__v2di)__W);94}
95
96static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_madd52hi_epu64(
97 __m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) {
98 return (__m256i)__builtin_ia32_selectq_256(
99 __M, (__v4di)__builtin_ia32_vpmadd52huq256(__W, __X, __Y), (__v4di)__W);
100}
101
102static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_madd52hi_epu64(
103 __mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z) {
104 return (__m256i)__builtin_ia32_selectq_256(
105 __M, (__v4di)__builtin_ia32_vpmadd52huq256(__X, __Y, __Z),
106 (__v4di)_mm256_setzero_si256());
81}107}
82108
83static __inline__ __m128i __DEFAULT_FN_ATTRS128109static __inline__ __m128i __DEFAULT_FN_ATTRS128
84_mm_maskz_madd52lo_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)110_mm_mask_madd52lo_epu64(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) {
85{111 return (__m128i)__builtin_ia32_selectq_128(
86 return (__m128i)__builtin_ia32_selectq_128(__M,112 __M, (__v2di)__builtin_ia32_vpmadd52luq128(__W, __X, __Y), (__v2di)__W);
87 (__v2di)_mm_madd52lo_epu64(__X, __Y, __Z),
88 (__v2di)_mm_setzero_si128());
89}113}
90114
91static __inline__ __m256i __DEFAULT_FN_ATTRS256115static __inline__ __m128i __DEFAULT_FN_ATTRS128
92_mm256_mask_madd52lo_epu64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)116_mm_maskz_madd52lo_epu64(__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z) {
93{117 return (__m128i)__builtin_ia32_selectq_128(
94 return (__m256i)__builtin_ia32_selectq_256(__M,118 __M, (__v2di)__builtin_ia32_vpmadd52luq128(__X, __Y, __Z),
95 (__v4di)_mm256_madd52lo_epu64(__W, __X, __Y),119 (__v2di)_mm_setzero_si128());
96 (__v4di)__W);
97}120}
98121
99static __inline__ __m256i __DEFAULT_FN_ATTRS256122static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_madd52lo_epu64(
100_mm256_maskz_madd52lo_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)123 __m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) {
101{124 return (__m256i)__builtin_ia32_selectq_256(
102 return (__m256i)__builtin_ia32_selectq_256(__M,125 __M, (__v4di)__builtin_ia32_vpmadd52luq256(__W, __X, __Y), (__v4di)__W);
103 (__v4di)_mm256_madd52lo_epu64(__X, __Y, __Z),
104 (__v4di)_mm256_setzero_si256());
105}126}
106127
128static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_madd52lo_epu64(
129 __mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z) {
130 return (__m256i)__builtin_ia32_selectq_256(
131 __M, (__v4di)__builtin_ia32_vpmadd52luq256(__X, __Y, __Z),
132 (__v4di)_mm256_setzero_si256());
133}
107134
108#undef __DEFAULT_FN_ATTRS128135#undef __DEFAULT_FN_ATTRS128
109#undef __DEFAULT_FN_ATTRS256136#undef __DEFAULT_FN_ATTRS256
lib/include/avx512vbmi2intrin.h+43-32
...@@ -15,8 +15,15 @@...@@ -15,8 +15,15 @@
15#define __AVX512VBMI2INTRIN_H15#define __AVX512VBMI2INTRIN_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#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi2,evex512"), __min_vector_width__(512)))18#define __DEFAULT_FN_ATTRS \
1919 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi2"), \
20 __min_vector_width__(512)))
21
22#if defined(__cplusplus) && (__cplusplus >= 201103L)
23#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
24#else
25#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
26#endif
2027
21static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS
22_mm512_mask_compress_epi16(__m512i __S, __mmask32 __U, __m512i __D)29_mm512_mask_compress_epi16(__m512i __S, __mmask32 __U, __m512i __D)
...@@ -212,14 +219,14 @@ _mm512_maskz_expandloadu_epi8(__mmask64 __U, void const *__P)...@@ -212,14 +219,14 @@ _mm512_maskz_expandloadu_epi8(__mmask64 __U, void const *__P)
212 (__v32hi)_mm512_shrdi_epi16((A), (B), (I)), \219 (__v32hi)_mm512_shrdi_epi16((A), (B), (I)), \
213 (__v32hi)_mm512_setzero_si512()))220 (__v32hi)_mm512_setzero_si512()))
214221
215static __inline__ __m512i __DEFAULT_FN_ATTRS222static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
216_mm512_shldv_epi64(__m512i __A, __m512i __B, __m512i __C)223_mm512_shldv_epi64(__m512i __A, __m512i __B, __m512i __C)
217{224{
218 return (__m512i)__builtin_ia32_vpshldvq512((__v8di)__A, (__v8di)__B,225 return (__m512i)__builtin_elementwise_fshl((__v8du)__A, (__v8du)__B,
219 (__v8di)__C);226 (__v8du)__C);
220}227}
221228
222static __inline__ __m512i __DEFAULT_FN_ATTRS229static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
223_mm512_mask_shldv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)230_mm512_mask_shldv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)
224{231{
225 return (__m512i)__builtin_ia32_selectq_512(__U,232 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -227,7 +234,7 @@ _mm512_mask_shldv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)...@@ -227,7 +234,7 @@ _mm512_mask_shldv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)
227 (__v8di)__A);234 (__v8di)__A);
228}235}
229236
230static __inline__ __m512i __DEFAULT_FN_ATTRS237static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
231_mm512_maskz_shldv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)238_mm512_maskz_shldv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)
232{239{
233 return (__m512i)__builtin_ia32_selectq_512(__U,240 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -235,14 +242,14 @@ _mm512_maskz_shldv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)...@@ -235,14 +242,14 @@ _mm512_maskz_shldv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)
235 (__v8di)_mm512_setzero_si512());242 (__v8di)_mm512_setzero_si512());
236}243}
237244
238static __inline__ __m512i __DEFAULT_FN_ATTRS245static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
239_mm512_shldv_epi32(__m512i __A, __m512i __B, __m512i __C)246_mm512_shldv_epi32(__m512i __A, __m512i __B, __m512i __C)
240{247{
241 return (__m512i)__builtin_ia32_vpshldvd512((__v16si)__A, (__v16si)__B,248 return (__m512i)__builtin_elementwise_fshl((__v16su)__A, (__v16su)__B,
242 (__v16si)__C);249 (__v16su)__C);
243}250}
244251
245static __inline__ __m512i __DEFAULT_FN_ATTRS252static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
246_mm512_mask_shldv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)253_mm512_mask_shldv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)
247{254{
248 return (__m512i)__builtin_ia32_selectd_512(__U,255 return (__m512i)__builtin_ia32_selectd_512(__U,
...@@ -250,7 +257,7 @@ _mm512_mask_shldv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)...@@ -250,7 +257,7 @@ _mm512_mask_shldv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)
250 (__v16si)__A);257 (__v16si)__A);
251}258}
252259
253static __inline__ __m512i __DEFAULT_FN_ATTRS260static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
254_mm512_maskz_shldv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)261_mm512_maskz_shldv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)
255{262{
256 return (__m512i)__builtin_ia32_selectd_512(__U,263 return (__m512i)__builtin_ia32_selectd_512(__U,
...@@ -258,14 +265,14 @@ _mm512_maskz_shldv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)...@@ -258,14 +265,14 @@ _mm512_maskz_shldv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)
258 (__v16si)_mm512_setzero_si512());265 (__v16si)_mm512_setzero_si512());
259}266}
260267
261static __inline__ __m512i __DEFAULT_FN_ATTRS268static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
262_mm512_shldv_epi16(__m512i __A, __m512i __B, __m512i __C)269_mm512_shldv_epi16(__m512i __A, __m512i __B, __m512i __C)
263{270{
264 return (__m512i)__builtin_ia32_vpshldvw512((__v32hi)__A, (__v32hi)__B,271 return (__m512i)__builtin_elementwise_fshl((__v32hu)__A, (__v32hu)__B,
265 (__v32hi)__C);272 (__v32hu)__C);
266}273}
267274
268static __inline__ __m512i __DEFAULT_FN_ATTRS275static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
269_mm512_mask_shldv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)276_mm512_mask_shldv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)
270{277{
271 return (__m512i)__builtin_ia32_selectw_512(__U,278 return (__m512i)__builtin_ia32_selectw_512(__U,
...@@ -273,7 +280,7 @@ _mm512_mask_shldv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)...@@ -273,7 +280,7 @@ _mm512_mask_shldv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)
273 (__v32hi)__A);280 (__v32hi)__A);
274}281}
275282
276static __inline__ __m512i __DEFAULT_FN_ATTRS283static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
277_mm512_maskz_shldv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)284_mm512_maskz_shldv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)
278{285{
279 return (__m512i)__builtin_ia32_selectw_512(__U,286 return (__m512i)__builtin_ia32_selectw_512(__U,
...@@ -281,14 +288,15 @@ _mm512_maskz_shldv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)...@@ -281,14 +288,15 @@ _mm512_maskz_shldv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)
281 (__v32hi)_mm512_setzero_si512());288 (__v32hi)_mm512_setzero_si512());
282}289}
283290
284static __inline__ __m512i __DEFAULT_FN_ATTRS291static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
285_mm512_shrdv_epi64(__m512i __A, __m512i __B, __m512i __C)292_mm512_shrdv_epi64(__m512i __A, __m512i __B, __m512i __C)
286{293{
287 return (__m512i)__builtin_ia32_vpshrdvq512((__v8di)__A, (__v8di)__B,294 // Ops __A and __B are swapped.
288 (__v8di)__C);295 return (__m512i)__builtin_elementwise_fshr((__v8du)__B, (__v8du)__A,
296 (__v8du)__C);
289}297}
290298
291static __inline__ __m512i __DEFAULT_FN_ATTRS299static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
292_mm512_mask_shrdv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)300_mm512_mask_shrdv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)
293{301{
294 return (__m512i)__builtin_ia32_selectq_512(__U,302 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -296,7 +304,7 @@ _mm512_mask_shrdv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)...@@ -296,7 +304,7 @@ _mm512_mask_shrdv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)
296 (__v8di)__A);304 (__v8di)__A);
297}305}
298306
299static __inline__ __m512i __DEFAULT_FN_ATTRS307static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
300_mm512_maskz_shrdv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)308_mm512_maskz_shrdv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)
301{309{
302 return (__m512i)__builtin_ia32_selectq_512(__U,310 return (__m512i)__builtin_ia32_selectq_512(__U,
...@@ -304,14 +312,15 @@ _mm512_maskz_shrdv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)...@@ -304,14 +312,15 @@ _mm512_maskz_shrdv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)
304 (__v8di)_mm512_setzero_si512());312 (__v8di)_mm512_setzero_si512());
305}313}
306314
307static __inline__ __m512i __DEFAULT_FN_ATTRS315static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
308_mm512_shrdv_epi32(__m512i __A, __m512i __B, __m512i __C)316_mm512_shrdv_epi32(__m512i __A, __m512i __B, __m512i __C)
309{317{
310 return (__m512i)__builtin_ia32_vpshrdvd512((__v16si)__A, (__v16si)__B,318 // Ops __A and __B are swapped.
311 (__v16si)__C);319 return (__m512i)__builtin_elementwise_fshr((__v16su)__B, (__v16su)__A,
320 (__v16su)__C);
312}321}
313322
314static __inline__ __m512i __DEFAULT_FN_ATTRS323static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
315_mm512_mask_shrdv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)324_mm512_mask_shrdv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)
316{325{
317 return (__m512i) __builtin_ia32_selectd_512(__U,326 return (__m512i) __builtin_ia32_selectd_512(__U,
...@@ -319,7 +328,7 @@ _mm512_mask_shrdv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)...@@ -319,7 +328,7 @@ _mm512_mask_shrdv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)
319 (__v16si)__A);328 (__v16si)__A);
320}329}
321330
322static __inline__ __m512i __DEFAULT_FN_ATTRS331static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
323_mm512_maskz_shrdv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)332_mm512_maskz_shrdv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)
324{333{
325 return (__m512i) __builtin_ia32_selectd_512(__U,334 return (__m512i) __builtin_ia32_selectd_512(__U,
...@@ -327,14 +336,15 @@ _mm512_maskz_shrdv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)...@@ -327,14 +336,15 @@ _mm512_maskz_shrdv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)
327 (__v16si)_mm512_setzero_si512());336 (__v16si)_mm512_setzero_si512());
328}337}
329338
330static __inline__ __m512i __DEFAULT_FN_ATTRS339static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
331_mm512_shrdv_epi16(__m512i __A, __m512i __B, __m512i __C)340_mm512_shrdv_epi16(__m512i __A, __m512i __B, __m512i __C)
332{341{
333 return (__m512i)__builtin_ia32_vpshrdvw512((__v32hi)__A, (__v32hi)__B,342 // Ops __A and __B are swapped.
334 (__v32hi)__C);343 return (__m512i)__builtin_elementwise_fshr((__v32hu)__B, (__v32hu)__A,
344 (__v32hu)__C);
335}345}
336346
337static __inline__ __m512i __DEFAULT_FN_ATTRS347static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
338_mm512_mask_shrdv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)348_mm512_mask_shrdv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)
339{349{
340 return (__m512i)__builtin_ia32_selectw_512(__U,350 return (__m512i)__builtin_ia32_selectw_512(__U,
...@@ -342,7 +352,7 @@ _mm512_mask_shrdv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)...@@ -342,7 +352,7 @@ _mm512_mask_shrdv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)
342 (__v32hi)__A);352 (__v32hi)__A);
343}353}
344354
345static __inline__ __m512i __DEFAULT_FN_ATTRS355static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
346_mm512_maskz_shrdv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)356_mm512_maskz_shrdv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)
347{357{
348 return (__m512i)__builtin_ia32_selectw_512(__U,358 return (__m512i)__builtin_ia32_selectw_512(__U,
...@@ -352,6 +362,7 @@ _mm512_maskz_shrdv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)...@@ -352,6 +362,7 @@ _mm512_maskz_shrdv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)
352362
353363
354#undef __DEFAULT_FN_ATTRS364#undef __DEFAULT_FN_ATTRS
365#undef __DEFAULT_FN_ATTRS_CONSTEXPR
355366
356#endif367#endif
357368
lib/include/avx512vbmiintrin.h+19-27
...@@ -15,63 +15,57 @@...@@ -15,63 +15,57 @@
15#define __VBMIINTRIN_H15#define __VBMIINTRIN_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)
18#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi"), \
20 __target__("avx512vbmi,evex512"), __min_vector_width__(512)))21 __min_vector_width__(512))) constexpr
22#else
23#define __DEFAULT_FN_ATTRS \
24 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi"), \
25 __min_vector_width__(512)))
26#endif
2127
22static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS
23_mm512_permutex2var_epi8(__m512i __A, __m512i __I, __m512i __B)29_mm512_permutex2var_epi8(__m512i __A, __m512i __I, __m512i __B) {
24{
25 return (__m512i)__builtin_ia32_vpermi2varqi512((__v64qi)__A, (__v64qi)__I,30 return (__m512i)__builtin_ia32_vpermi2varqi512((__v64qi)__A, (__v64qi)__I,
26 (__v64qi) __B);31 (__v64qi) __B);
27}32}
2833
29static __inline__ __m512i __DEFAULT_FN_ATTRS34static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_epi8(
30_mm512_mask_permutex2var_epi8(__m512i __A, __mmask64 __U, __m512i __I,35 __m512i __A, __mmask64 __U, __m512i __I, __m512i __B) {
31 __m512i __B)
32{
33 return (__m512i)__builtin_ia32_selectb_512(__U,36 return (__m512i)__builtin_ia32_selectb_512(__U,
34 (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),37 (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
35 (__v64qi)__A);38 (__v64qi)__A);
36}39}
3740
38static __inline__ __m512i __DEFAULT_FN_ATTRS41static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_epi8(
39_mm512_mask2_permutex2var_epi8(__m512i __A, __m512i __I, __mmask64 __U,42 __m512i __A, __m512i __I, __mmask64 __U, __m512i __B) {
40 __m512i __B)
41{
42 return (__m512i)__builtin_ia32_selectb_512(__U,43 return (__m512i)__builtin_ia32_selectb_512(__U,
43 (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),44 (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
44 (__v64qi)__I);45 (__v64qi)__I);
45}46}
4647
47static __inline__ __m512i __DEFAULT_FN_ATTRS48static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_epi8(
48_mm512_maskz_permutex2var_epi8(__mmask64 __U, __m512i __A, __m512i __I,49 __mmask64 __U, __m512i __A, __m512i __I, __m512i __B) {
49 __m512i __B)
50{
51 return (__m512i)__builtin_ia32_selectb_512(__U,50 return (__m512i)__builtin_ia32_selectb_512(__U,
52 (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),51 (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
53 (__v64qi)_mm512_setzero_si512());52 (__v64qi)_mm512_setzero_si512());
54}53}
5554
56static __inline__ __m512i __DEFAULT_FN_ATTRS55static __inline__ __m512i __DEFAULT_FN_ATTRS
57_mm512_permutexvar_epi8 (__m512i __A, __m512i __B)56_mm512_permutexvar_epi8(__m512i __A, __m512i __B) {
58{
59 return (__m512i)__builtin_ia32_permvarqi512((__v64qi) __B, (__v64qi) __A);57 return (__m512i)__builtin_ia32_permvarqi512((__v64qi) __B, (__v64qi) __A);
60}58}
6159
62static __inline__ __m512i __DEFAULT_FN_ATTRS60static __inline__ __m512i __DEFAULT_FN_ATTRS
63_mm512_maskz_permutexvar_epi8 (__mmask64 __M, __m512i __A,61_mm512_maskz_permutexvar_epi8(__mmask64 __M, __m512i __A, __m512i __B) {
64 __m512i __B)
65{
66 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,62 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
67 (__v64qi)_mm512_permutexvar_epi8(__A, __B),63 (__v64qi)_mm512_permutexvar_epi8(__A, __B),
68 (__v64qi)_mm512_setzero_si512());64 (__v64qi)_mm512_setzero_si512());
69}65}
7066
71static __inline__ __m512i __DEFAULT_FN_ATTRS67static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_epi8(
72_mm512_mask_permutexvar_epi8 (__m512i __W, __mmask64 __M, __m512i __A,68 __m512i __W, __mmask64 __M, __m512i __A, __m512i __B) {
73 __m512i __B)
74{
75 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,69 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
76 (__v64qi)_mm512_permutexvar_epi8(__A, __B),70 (__v64qi)_mm512_permutexvar_epi8(__A, __B),
77 (__v64qi)__W);71 (__v64qi)__W);
...@@ -100,7 +94,5 @@ _mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y)...@@ -100,7 +94,5 @@ _mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y)
100 (__v64qi)_mm512_setzero_si512());94 (__v64qi)_mm512_setzero_si512());
101}95}
10296
103
104#undef __DEFAULT_FN_ATTRS97#undef __DEFAULT_FN_ATTRS
105
106#endif98#endif
lib/include/avx512vbmivlintrin.h+35-49
...@@ -15,126 +15,114 @@...@@ -15,126 +15,114 @@
15#define __VBMIVLINTRIN_H15#define __VBMIVLINTRIN_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)
18#define __DEFAULT_FN_ATTRS128 \19#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vbmi,avx512vl,no-evex512"), \21 __target__("avx512vbmi,avx512vl"), \
22 __min_vector_width__(128))) constexpr
23#define __DEFAULT_FN_ATTRS256 \
24 __attribute__((__always_inline__, __nodebug__, \
25 __target__("avx512vbmi,avx512vl"), \
26 __min_vector_width__(256))) constexpr
27#else
28#define __DEFAULT_FN_ATTRS128 \
29 __attribute__((__always_inline__, __nodebug__, \
30 __target__("avx512vbmi,avx512vl"), \
21 __min_vector_width__(128)))31 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \32#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \33 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vbmi,avx512vl,no-evex512"), \34 __target__("avx512vbmi,avx512vl"), \
25 __min_vector_width__(256)))35 __min_vector_width__(256)))
36#endif
2637
27static __inline__ __m128i __DEFAULT_FN_ATTRS12838static __inline__ __m128i __DEFAULT_FN_ATTRS128
28_mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B)39_mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B) {
29{
30 return (__m128i)__builtin_ia32_vpermi2varqi128((__v16qi)__A,40 return (__m128i)__builtin_ia32_vpermi2varqi128((__v16qi)__A,
31 (__v16qi)__I,41 (__v16qi)__I,
32 (__v16qi)__B);42 (__v16qi)__B);
33}43}
3444
35static __inline__ __m128i __DEFAULT_FN_ATTRS12845static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_permutex2var_epi8(
36_mm_mask_permutex2var_epi8(__m128i __A, __mmask16 __U, __m128i __I,46 __m128i __A, __mmask16 __U, __m128i __I, __m128i __B) {
37 __m128i __B)
38{
39 return (__m128i)__builtin_ia32_selectb_128(__U,47 return (__m128i)__builtin_ia32_selectb_128(__U,
40 (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),48 (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
41 (__v16qi)__A);49 (__v16qi)__A);
42}50}
4351
44static __inline__ __m128i __DEFAULT_FN_ATTRS12852static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask2_permutex2var_epi8(
45_mm_mask2_permutex2var_epi8(__m128i __A, __m128i __I, __mmask16 __U,53 __m128i __A, __m128i __I, __mmask16 __U, __m128i __B) {
46 __m128i __B)
47{
48 return (__m128i)__builtin_ia32_selectb_128(__U,54 return (__m128i)__builtin_ia32_selectb_128(__U,
49 (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),55 (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
50 (__v16qi)__I);56 (__v16qi)__I);
51}57}
5258
53static __inline__ __m128i __DEFAULT_FN_ATTRS12859static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_permutex2var_epi8(
54_mm_maskz_permutex2var_epi8(__mmask16 __U, __m128i __A, __m128i __I,60 __mmask16 __U, __m128i __A, __m128i __I, __m128i __B) {
55 __m128i __B)
56{
57 return (__m128i)__builtin_ia32_selectb_128(__U,61 return (__m128i)__builtin_ia32_selectb_128(__U,
58 (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),62 (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
59 (__v16qi)_mm_setzero_si128());63 (__v16qi)_mm_setzero_si128());
60}64}
6165
62static __inline__ __m256i __DEFAULT_FN_ATTRS25666static __inline__ __m256i __DEFAULT_FN_ATTRS256
63_mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B)67_mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B) {
64{
65 return (__m256i)__builtin_ia32_vpermi2varqi256((__v32qi)__A, (__v32qi)__I,68 return (__m256i)__builtin_ia32_vpermi2varqi256((__v32qi)__A, (__v32qi)__I,
66 (__v32qi)__B);69 (__v32qi)__B);
67}70}
6871
69static __inline__ __m256i __DEFAULT_FN_ATTRS25672static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_permutex2var_epi8(
70_mm256_mask_permutex2var_epi8(__m256i __A, __mmask32 __U, __m256i __I,73 __m256i __A, __mmask32 __U, __m256i __I, __m256i __B) {
71 __m256i __B)
72{
73 return (__m256i)__builtin_ia32_selectb_256(__U,74 return (__m256i)__builtin_ia32_selectb_256(__U,
74 (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),75 (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
75 (__v32qi)__A);76 (__v32qi)__A);
76}77}
7778
78static __inline__ __m256i __DEFAULT_FN_ATTRS25679static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask2_permutex2var_epi8(
79_mm256_mask2_permutex2var_epi8(__m256i __A, __m256i __I, __mmask32 __U,80 __m256i __A, __m256i __I, __mmask32 __U, __m256i __B) {
80 __m256i __B)
81{
82 return (__m256i)__builtin_ia32_selectb_256(__U,81 return (__m256i)__builtin_ia32_selectb_256(__U,
83 (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),82 (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
84 (__v32qi)__I);83 (__v32qi)__I);
85}84}
8685
87static __inline__ __m256i __DEFAULT_FN_ATTRS25686static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_permutex2var_epi8(
88_mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I,87 __mmask32 __U, __m256i __A, __m256i __I, __m256i __B) {
89 __m256i __B)
90{
91 return (__m256i)__builtin_ia32_selectb_256(__U,88 return (__m256i)__builtin_ia32_selectb_256(__U,
92 (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),89 (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
93 (__v32qi)_mm256_setzero_si256());90 (__v32qi)_mm256_setzero_si256());
94}91}
9592
96static __inline__ __m128i __DEFAULT_FN_ATTRS12893static __inline__ __m128i __DEFAULT_FN_ATTRS128
97_mm_permutexvar_epi8 (__m128i __A, __m128i __B)94_mm_permutexvar_epi8(__m128i __A, __m128i __B) {
98{
99 return (__m128i)__builtin_ia32_permvarqi128((__v16qi)__B, (__v16qi)__A);95 return (__m128i)__builtin_ia32_permvarqi128((__v16qi)__B, (__v16qi)__A);
100}96}
10197
102static __inline__ __m128i __DEFAULT_FN_ATTRS12898static __inline__ __m128i __DEFAULT_FN_ATTRS128
103_mm_maskz_permutexvar_epi8 (__mmask16 __M, __m128i __A, __m128i __B)99_mm_maskz_permutexvar_epi8(__mmask16 __M, __m128i __A, __m128i __B) {
104{
105 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,100 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
106 (__v16qi)_mm_permutexvar_epi8(__A, __B),101 (__v16qi)_mm_permutexvar_epi8(__A, __B),
107 (__v16qi)_mm_setzero_si128());102 (__v16qi)_mm_setzero_si128());
108}103}
109104
110static __inline__ __m128i __DEFAULT_FN_ATTRS128105static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_permutexvar_epi8(
111_mm_mask_permutexvar_epi8 (__m128i __W, __mmask16 __M, __m128i __A,106 __m128i __W, __mmask16 __M, __m128i __A, __m128i __B) {
112 __m128i __B)
113{
114 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,107 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
115 (__v16qi)_mm_permutexvar_epi8(__A, __B),108 (__v16qi)_mm_permutexvar_epi8(__A, __B),
116 (__v16qi)__W);109 (__v16qi)__W);
117}110}
118111
119static __inline__ __m256i __DEFAULT_FN_ATTRS256112static __inline__ __m256i __DEFAULT_FN_ATTRS256
120_mm256_permutexvar_epi8 (__m256i __A, __m256i __B)113_mm256_permutexvar_epi8(__m256i __A, __m256i __B) {
121{
122 return (__m256i)__builtin_ia32_permvarqi256((__v32qi) __B, (__v32qi) __A);114 return (__m256i)__builtin_ia32_permvarqi256((__v32qi) __B, (__v32qi) __A);
123}115}
124116
125static __inline__ __m256i __DEFAULT_FN_ATTRS256117static __inline__ __m256i __DEFAULT_FN_ATTRS256
126_mm256_maskz_permutexvar_epi8 (__mmask32 __M, __m256i __A,118_mm256_maskz_permutexvar_epi8(__mmask32 __M, __m256i __A, __m256i __B) {
127 __m256i __B)
128{
129 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,119 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
130 (__v32qi)_mm256_permutexvar_epi8(__A, __B),120 (__v32qi)_mm256_permutexvar_epi8(__A, __B),
131 (__v32qi)_mm256_setzero_si256());121 (__v32qi)_mm256_setzero_si256());
132}122}
133123
134static __inline__ __m256i __DEFAULT_FN_ATTRS256124static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_permutexvar_epi8(
135_mm256_mask_permutexvar_epi8 (__m256i __W, __mmask32 __M, __m256i __A,125 __m256i __W, __mmask32 __M, __m256i __A, __m256i __B) {
136 __m256i __B)
137{
138 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,126 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
139 (__v32qi)_mm256_permutexvar_epi8(__A, __B),127 (__v32qi)_mm256_permutexvar_epi8(__A, __B),
140 (__v32qi)__W);128 (__v32qi)__W);
...@@ -186,8 +174,6 @@ _mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y)...@@ -186,8 +174,6 @@ _mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y)
186 (__v32qi)_mm256_setzero_si256());174 (__v32qi)_mm256_setzero_si256());
187}175}
188176
189
190#undef __DEFAULT_FN_ATTRS128177#undef __DEFAULT_FN_ATTRS128
191#undef __DEFAULT_FN_ATTRS256178#undef __DEFAULT_FN_ATTRS256
192
193#endif179#endif
lib/include/avx512vlbf16intrin.h+32-22
...@@ -17,13 +17,21 @@...@@ -17,13 +17,21 @@
1717
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512bf16,no-evex512"), \20 __target__("avx512vl,avx512bf16"), \
21 __min_vector_width__(128)))21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \23 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512bf16,no-evex512"), \24 __target__("avx512vl,avx512bf16"), \
25 __min_vector_width__(256)))25 __min_vector_width__(256)))
2626
27#if defined(__cplusplus) && (__cplusplus >= 201103L)
28#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
29#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
30#else
31#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
32#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
33#endif
34
27/// Convert Two Packed Single Data to One Packed BF16 Data.35/// Convert Two Packed Single Data to One Packed BF16 Data.
28///36///
29/// \headerfile <x86intrin.h>37/// \headerfile <x86intrin.h>
...@@ -421,9 +429,10 @@ static __inline__ __bf16 __DEFAULT_FN_ATTRS128 _mm_cvtness_sbh(float __A) {...@@ -421,9 +429,10 @@ static __inline__ __bf16 __DEFAULT_FN_ATTRS128 _mm_cvtness_sbh(float __A) {
421/// \param __A429/// \param __A
422/// A 128-bit vector of [4 x bfloat].430/// A 128-bit vector of [4 x bfloat].
423/// \returns A 128-bit vector of [4 x float] come from conversion of __A431/// \returns A 128-bit vector of [4 x float] come from conversion of __A
424static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_cvtpbh_ps(__m128bh __A) {432static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
425 return _mm_castsi128_ps(433_mm_cvtpbh_ps(__m128bh __A) {
426 (__m128i)_mm_slli_epi32((__m128i)_mm_cvtepi16_epi32((__m128i)__A), 16));434 return (__m128)_mm256_castps256_ps128(
435 (__m256) __builtin_convertvector(__A, __v8sf));
427}436}
428437
429/// Convert Packed BF16 Data to Packed float Data.438/// Convert Packed BF16 Data to Packed float Data.
...@@ -433,9 +442,9 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_cvtpbh_ps(__m128bh __A) {...@@ -433,9 +442,9 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_cvtpbh_ps(__m128bh __A) {
433/// \param __A442/// \param __A
434/// A 128-bit vector of [8 x bfloat].443/// A 128-bit vector of [8 x bfloat].
435/// \returns A 256-bit vector of [8 x float] come from conversion of __A444/// \returns A 256-bit vector of [8 x float] come from conversion of __A
436static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_cvtpbh_ps(__m128bh __A) {445static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
437 return _mm256_castsi256_ps((__m256i)_mm256_slli_epi32(446_mm256_cvtpbh_ps(__m128bh __A) {
438 (__m256i)_mm256_cvtepi16_epi32((__m128i)__A), 16));447 return (__m256) __builtin_convertvector(__A, __v8sf);
439}448}
440449
441/// Convert Packed BF16 Data to Packed float Data using zeroing mask.450/// Convert Packed BF16 Data to Packed float Data using zeroing mask.
...@@ -448,10 +457,10 @@ static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_cvtpbh_ps(__m128bh __A) {...@@ -448,10 +457,10 @@ static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_cvtpbh_ps(__m128bh __A) {
448/// \param __A457/// \param __A
449/// A 128-bit vector of [4 x bfloat].458/// A 128-bit vector of [4 x bfloat].
450/// \returns A 128-bit vector of [4 x float] come from conversion of __A459/// \returns A 128-bit vector of [4 x float] come from conversion of __A
451static __inline__ __m128 __DEFAULT_FN_ATTRS128460static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
452_mm_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {461_mm_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {
453 return _mm_castsi128_ps((__m128i)_mm_slli_epi32(462 return (__m128)__builtin_ia32_selectps_128(
454 (__m128i)_mm_maskz_cvtepi16_epi32((__mmask8)__U, (__m128i)__A), 16));463 (__mmask8)__U, (__v4sf)_mm_cvtpbh_ps(__A), (__v4sf)_mm_setzero_ps());
455}464}
456465
457/// Convert Packed BF16 Data to Packed float Data using zeroing mask.466/// Convert Packed BF16 Data to Packed float Data using zeroing mask.
...@@ -464,10 +473,11 @@ _mm_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {...@@ -464,10 +473,11 @@ _mm_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {
464/// \param __A473/// \param __A
465/// A 128-bit vector of [8 x bfloat].474/// A 128-bit vector of [8 x bfloat].
466/// \returns A 256-bit vector of [8 x float] come from conversion of __A475/// \returns A 256-bit vector of [8 x float] come from conversion of __A
467static __inline__ __m256 __DEFAULT_FN_ATTRS256476static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
468_mm256_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {477_mm256_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {
469 return _mm256_castsi256_ps((__m256i)_mm256_slli_epi32(478 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
470 (__m256i)_mm256_maskz_cvtepi16_epi32((__mmask8)__U, (__m128i)__A), 16));479 (__v8sf)_mm256_cvtpbh_ps(__A),
480 (__v8sf)_mm256_setzero_ps());
471}481}
472482
473/// Convert Packed BF16 Data to Packed float Data using merging mask.483/// Convert Packed BF16 Data to Packed float Data using merging mask.
...@@ -483,11 +493,10 @@ _mm256_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {...@@ -483,11 +493,10 @@ _mm256_maskz_cvtpbh_ps(__mmask8 __U, __m128bh __A) {
483/// \param __A493/// \param __A
484/// A 128-bit vector of [4 x bfloat].494/// A 128-bit vector of [4 x bfloat].
485/// \returns A 128-bit vector of [4 x float] come from conversion of __A495/// \returns A 128-bit vector of [4 x float] come from conversion of __A
486static __inline__ __m128 __DEFAULT_FN_ATTRS128496static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
487_mm_mask_cvtpbh_ps(__m128 __S, __mmask8 __U, __m128bh __A) {497_mm_mask_cvtpbh_ps(__m128 __S, __mmask8 __U, __m128bh __A) {
488 return _mm_castsi128_ps((__m128i)_mm_mask_slli_epi32(498 return (__m128)__builtin_ia32_selectps_128(
489 (__m128i)__S, (__mmask8)__U, (__m128i)_mm_cvtepi16_epi32((__m128i)__A),499 (__mmask8)__U, (__v4sf)_mm_cvtpbh_ps(__A), (__v4sf)__S);
490 16));
491}500}
492501
493/// Convert Packed BF16 Data to Packed float Data using merging mask.502/// Convert Packed BF16 Data to Packed float Data using merging mask.
...@@ -503,15 +512,16 @@ _mm_mask_cvtpbh_ps(__m128 __S, __mmask8 __U, __m128bh __A) {...@@ -503,15 +512,16 @@ _mm_mask_cvtpbh_ps(__m128 __S, __mmask8 __U, __m128bh __A) {
503/// \param __A512/// \param __A
504/// A 128-bit vector of [8 x bfloat].513/// A 128-bit vector of [8 x bfloat].
505/// \returns A 256-bit vector of [8 x float] come from conversion of __A514/// \returns A 256-bit vector of [8 x float] come from conversion of __A
506static __inline__ __m256 __DEFAULT_FN_ATTRS256515static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
507_mm256_mask_cvtpbh_ps(__m256 __S, __mmask8 __U, __m128bh __A) {516_mm256_mask_cvtpbh_ps(__m256 __S, __mmask8 __U, __m128bh __A) {
508 return _mm256_castsi256_ps((__m256i)_mm256_mask_slli_epi32(517 return (__m256)__builtin_ia32_selectps_256(
509 (__m256i)__S, (__mmask8)__U, (__m256i)_mm256_cvtepi16_epi32((__m128i)__A),518 (__mmask8)__U, (__v8sf)_mm256_cvtpbh_ps(__A), (__v8sf)__S);
510 16));
511}519}
512520
513#undef __DEFAULT_FN_ATTRS128521#undef __DEFAULT_FN_ATTRS128
514#undef __DEFAULT_FN_ATTRS256522#undef __DEFAULT_FN_ATTRS256
523#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
524#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
515525
516#endif526#endif
517#endif527#endif
lib/include/avx512vlbitalgintrin.h+37-53
...@@ -15,101 +15,86 @@...@@ -15,101 +15,86 @@
15#define __AVX512VLBITALGINTRIN_H15#define __AVX512VLBITALGINTRIN_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)
18#define __DEFAULT_FN_ATTRS128 \19#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512bitalg,no-evex512"), \21 __target__("avx512vl,avx512bitalg"), \
22 __min_vector_width__(128))) constexpr
23#define __DEFAULT_FN_ATTRS256 \
24 __attribute__((__always_inline__, __nodebug__, \
25 __target__("avx512vl,avx512bitalg"), \
26 __min_vector_width__(256))) constexpr
27#else
28#define __DEFAULT_FN_ATTRS128 \
29 __attribute__((__always_inline__, __nodebug__, \
30 __target__("avx512vl,avx512bitalg"), \
21 __min_vector_width__(128)))31 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \32#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \33 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512bitalg,no-evex512"), \34 __target__("avx512vl,avx512bitalg"), \
25 __min_vector_width__(256)))35 __min_vector_width__(256)))
36#endif
2637
27static __inline__ __m256i __DEFAULT_FN_ATTRS25638static __inline__ __m256i __DEFAULT_FN_ATTRS256
28_mm256_popcnt_epi16(__m256i __A)39_mm256_popcnt_epi16(__m256i __A) {
29{
30 return (__m256i)__builtin_elementwise_popcount((__v16hu)__A);40 return (__m256i)__builtin_elementwise_popcount((__v16hu)__A);
31}41}
3242
33static __inline__ __m256i __DEFAULT_FN_ATTRS25643static __inline__ __m256i __DEFAULT_FN_ATTRS256
34_mm256_mask_popcnt_epi16(__m256i __A, __mmask16 __U, __m256i __B)44_mm256_mask_popcnt_epi16(__m256i __A, __mmask16 __U, __m256i __B) {
35{45 return (__m256i)__builtin_ia32_selectw_256(
36 return (__m256i) __builtin_ia32_selectw_256((__mmask16) __U,46 (__mmask16)__U, (__v16hi)_mm256_popcnt_epi16(__B), (__v16hi)__A);
37 (__v16hi) _mm256_popcnt_epi16(__B),
38 (__v16hi) __A);
39}47}
4048
41static __inline__ __m256i __DEFAULT_FN_ATTRS25649static __inline__ __m256i __DEFAULT_FN_ATTRS256
42_mm256_maskz_popcnt_epi16(__mmask16 __U, __m256i __B)50_mm256_maskz_popcnt_epi16(__mmask16 __U, __m256i __B) {
43{51 return _mm256_mask_popcnt_epi16((__m256i)_mm256_setzero_si256(), __U, __B);
44 return _mm256_mask_popcnt_epi16((__m256i) _mm256_setzero_si256(),
45 __U,
46 __B);
47}52}
4853
49static __inline__ __m128i __DEFAULT_FN_ATTRS12854static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_popcnt_epi16(__m128i __A) {
50_mm_popcnt_epi16(__m128i __A)
51{
52 return (__m128i)__builtin_elementwise_popcount((__v8hu)__A);55 return (__m128i)__builtin_elementwise_popcount((__v8hu)__A);
53}56}
5457
55static __inline__ __m128i __DEFAULT_FN_ATTRS12858static __inline__ __m128i __DEFAULT_FN_ATTRS128
56_mm_mask_popcnt_epi16(__m128i __A, __mmask8 __U, __m128i __B)59_mm_mask_popcnt_epi16(__m128i __A, __mmask8 __U, __m128i __B) {
57{60 return (__m128i)__builtin_ia32_selectw_128(
58 return (__m128i) __builtin_ia32_selectw_128((__mmask8) __U,61 (__mmask8)__U, (__v8hi)_mm_popcnt_epi16(__B), (__v8hi)__A);
59 (__v8hi) _mm_popcnt_epi16(__B),
60 (__v8hi) __A);
61}62}
6263
63static __inline__ __m128i __DEFAULT_FN_ATTRS12864static __inline__ __m128i __DEFAULT_FN_ATTRS128
64_mm_maskz_popcnt_epi16(__mmask8 __U, __m128i __B)65_mm_maskz_popcnt_epi16(__mmask8 __U, __m128i __B) {
65{66 return _mm_mask_popcnt_epi16((__m128i)_mm_setzero_si128(), __U, __B);
66 return _mm_mask_popcnt_epi16((__m128i) _mm_setzero_si128(),
67 __U,
68 __B);
69}67}
7068
71static __inline__ __m256i __DEFAULT_FN_ATTRS25669static __inline__ __m256i __DEFAULT_FN_ATTRS256
72_mm256_popcnt_epi8(__m256i __A)70_mm256_popcnt_epi8(__m256i __A) {
73{
74 return (__m256i)__builtin_elementwise_popcount((__v32qu)__A);71 return (__m256i)__builtin_elementwise_popcount((__v32qu)__A);
75}72}
7673
77static __inline__ __m256i __DEFAULT_FN_ATTRS25674static __inline__ __m256i __DEFAULT_FN_ATTRS256
78_mm256_mask_popcnt_epi8(__m256i __A, __mmask32 __U, __m256i __B)75_mm256_mask_popcnt_epi8(__m256i __A, __mmask32 __U, __m256i __B) {
79{76 return (__m256i)__builtin_ia32_selectb_256(
80 return (__m256i) __builtin_ia32_selectb_256((__mmask32) __U,77 (__mmask32)__U, (__v32qi)_mm256_popcnt_epi8(__B), (__v32qi)__A);
81 (__v32qi) _mm256_popcnt_epi8(__B),
82 (__v32qi) __A);
83}78}
8479
85static __inline__ __m256i __DEFAULT_FN_ATTRS25680static __inline__ __m256i __DEFAULT_FN_ATTRS256
86_mm256_maskz_popcnt_epi8(__mmask32 __U, __m256i __B)81_mm256_maskz_popcnt_epi8(__mmask32 __U, __m256i __B) {
87{82 return _mm256_mask_popcnt_epi8((__m256i)_mm256_setzero_si256(), __U, __B);
88 return _mm256_mask_popcnt_epi8((__m256i) _mm256_setzero_si256(),
89 __U,
90 __B);
91}83}
9284
93static __inline__ __m128i __DEFAULT_FN_ATTRS12885static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_popcnt_epi8(__m128i __A) {
94_mm_popcnt_epi8(__m128i __A)
95{
96 return (__m128i)__builtin_elementwise_popcount((__v16qu)__A);86 return (__m128i)__builtin_elementwise_popcount((__v16qu)__A);
97}87}
9888
99static __inline__ __m128i __DEFAULT_FN_ATTRS12889static __inline__ __m128i __DEFAULT_FN_ATTRS128
100_mm_mask_popcnt_epi8(__m128i __A, __mmask16 __U, __m128i __B)90_mm_mask_popcnt_epi8(__m128i __A, __mmask16 __U, __m128i __B) {
101{91 return (__m128i)__builtin_ia32_selectb_128(
102 return (__m128i) __builtin_ia32_selectb_128((__mmask16) __U,92 (__mmask16)__U, (__v16qi)_mm_popcnt_epi8(__B), (__v16qi)__A);
103 (__v16qi) _mm_popcnt_epi8(__B),
104 (__v16qi) __A);
105}93}
10694
107static __inline__ __m128i __DEFAULT_FN_ATTRS12895static __inline__ __m128i __DEFAULT_FN_ATTRS128
108_mm_maskz_popcnt_epi8(__mmask16 __U, __m128i __B)96_mm_maskz_popcnt_epi8(__mmask16 __U, __m128i __B) {
109{97 return _mm_mask_popcnt_epi8((__m128i)_mm_setzero_si128(), __U, __B);
110 return _mm_mask_popcnt_epi8((__m128i) _mm_setzero_si128(),
111 __U,
112 __B);
113}98}
11499
115static __inline__ __mmask32 __DEFAULT_FN_ATTRS256100static __inline__ __mmask32 __DEFAULT_FN_ATTRS256
...@@ -147,5 +132,4 @@ _mm_bitshuffle_epi64_mask(__m128i __A, __m128i __B)...@@ -147,5 +132,4 @@ _mm_bitshuffle_epi64_mask(__m128i __A, __m128i __B)
147132
148#undef __DEFAULT_FN_ATTRS128133#undef __DEFAULT_FN_ATTRS128
149#undef __DEFAULT_FN_ATTRS256134#undef __DEFAULT_FN_ATTRS256
150
151#endif135#endif
lib/include/avx512vlbwintrin.h+470-573
...@@ -17,12 +17,18 @@...@@ -17,12 +17,18 @@
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512bw,no-evex512"), \20 __target__("avx512vl,avx512bw"), __min_vector_width__(128)))
21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \21#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \22 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512bw,no-evex512"), \23 __target__("avx512vl,avx512bw"), __min_vector_width__(256)))
25 __min_vector_width__(256)))24
25#if defined(__cplusplus) && (__cplusplus >= 201103L)
26#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
27#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
28#else
29#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
30#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
31#endif
2632
27/* Integer compare */33/* Integer compare */
2834
...@@ -306,250 +312,238 @@...@@ -306,250 +312,238 @@
306#define _mm256_mask_cmpneq_epu16_mask(k, A, B) \312#define _mm256_mask_cmpneq_epu16_mask(k, A, B) \
307 _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE)313 _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE)
308314
309static __inline__ __m256i __DEFAULT_FN_ATTRS256315static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
310_mm256_mask_add_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B){316_mm256_mask_add_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {
311 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,317 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
312 (__v32qi)_mm256_add_epi8(__A, __B),318 (__v32qi)_mm256_add_epi8(__A, __B),
313 (__v32qi)__W);319 (__v32qi)__W);
314}320}
315321
316static __inline__ __m256i __DEFAULT_FN_ATTRS256322static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
317_mm256_maskz_add_epi8(__mmask32 __U, __m256i __A, __m256i __B) {323_mm256_maskz_add_epi8(__mmask32 __U, __m256i __A, __m256i __B) {
318 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,324 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
319 (__v32qi)_mm256_add_epi8(__A, __B),325 (__v32qi)_mm256_add_epi8(__A, __B),
320 (__v32qi)_mm256_setzero_si256());326 (__v32qi)_mm256_setzero_si256());
321}327}
322328
323static __inline__ __m256i __DEFAULT_FN_ATTRS256329static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
324_mm256_mask_add_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {330_mm256_mask_add_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
325 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,331 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
326 (__v16hi)_mm256_add_epi16(__A, __B),332 (__v16hi)_mm256_add_epi16(__A, __B),
327 (__v16hi)__W);333 (__v16hi)__W);
328}334}
329335
330static __inline__ __m256i __DEFAULT_FN_ATTRS256336static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
331_mm256_maskz_add_epi16(__mmask16 __U, __m256i __A, __m256i __B) {337_mm256_maskz_add_epi16(__mmask16 __U, __m256i __A, __m256i __B) {
332 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,338 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
333 (__v16hi)_mm256_add_epi16(__A, __B),339 (__v16hi)_mm256_add_epi16(__A, __B),
334 (__v16hi)_mm256_setzero_si256());340 (__v16hi)_mm256_setzero_si256());
335}341}
336342
337static __inline__ __m256i __DEFAULT_FN_ATTRS256343static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
338_mm256_mask_sub_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {344_mm256_mask_sub_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {
339 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,345 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
340 (__v32qi)_mm256_sub_epi8(__A, __B),346 (__v32qi)_mm256_sub_epi8(__A, __B),
341 (__v32qi)__W);347 (__v32qi)__W);
342}348}
343349
344static __inline__ __m256i __DEFAULT_FN_ATTRS256350static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
345_mm256_maskz_sub_epi8(__mmask32 __U, __m256i __A, __m256i __B) {351_mm256_maskz_sub_epi8(__mmask32 __U, __m256i __A, __m256i __B) {
346 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,352 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
347 (__v32qi)_mm256_sub_epi8(__A, __B),353 (__v32qi)_mm256_sub_epi8(__A, __B),
348 (__v32qi)_mm256_setzero_si256());354 (__v32qi)_mm256_setzero_si256());
349}355}
350356
351static __inline__ __m256i __DEFAULT_FN_ATTRS256357static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
352_mm256_mask_sub_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {358_mm256_mask_sub_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
353 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,359 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
354 (__v16hi)_mm256_sub_epi16(__A, __B),360 (__v16hi)_mm256_sub_epi16(__A, __B),
355 (__v16hi)__W);361 (__v16hi)__W);
356}362}
357363
358static __inline__ __m256i __DEFAULT_FN_ATTRS256364static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
359_mm256_maskz_sub_epi16(__mmask16 __U, __m256i __A, __m256i __B) {365_mm256_maskz_sub_epi16(__mmask16 __U, __m256i __A, __m256i __B) {
360 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,366 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
361 (__v16hi)_mm256_sub_epi16(__A, __B),367 (__v16hi)_mm256_sub_epi16(__A, __B),
362 (__v16hi)_mm256_setzero_si256());368 (__v16hi)_mm256_setzero_si256());
363}369}
364370
365static __inline__ __m128i __DEFAULT_FN_ATTRS128371static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
366_mm_mask_add_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {372_mm_mask_add_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {
367 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,373 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
368 (__v16qi)_mm_add_epi8(__A, __B),374 (__v16qi)_mm_add_epi8(__A, __B),
369 (__v16qi)__W);375 (__v16qi)__W);
370}376}
371377
372static __inline__ __m128i __DEFAULT_FN_ATTRS128378static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
373_mm_maskz_add_epi8(__mmask16 __U, __m128i __A, __m128i __B) {379_mm_maskz_add_epi8(__mmask16 __U, __m128i __A, __m128i __B) {
374 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,380 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
375 (__v16qi)_mm_add_epi8(__A, __B),381 (__v16qi)_mm_add_epi8(__A, __B),
376 (__v16qi)_mm_setzero_si128());382 (__v16qi)_mm_setzero_si128());
377}383}
378384
379static __inline__ __m128i __DEFAULT_FN_ATTRS128385static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
380_mm_mask_add_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {386_mm_mask_add_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
381 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,387 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
382 (__v8hi)_mm_add_epi16(__A, __B),388 (__v8hi)_mm_add_epi16(__A, __B),
383 (__v8hi)__W);389 (__v8hi)__W);
384}390}
385391
386static __inline__ __m128i __DEFAULT_FN_ATTRS128392static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
387_mm_maskz_add_epi16(__mmask8 __U, __m128i __A, __m128i __B) {393_mm_maskz_add_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
388 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,394 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
389 (__v8hi)_mm_add_epi16(__A, __B),395 (__v8hi)_mm_add_epi16(__A, __B),
390 (__v8hi)_mm_setzero_si128());396 (__v8hi)_mm_setzero_si128());
391}397}
392398
393static __inline__ __m128i __DEFAULT_FN_ATTRS128399static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
394_mm_mask_sub_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {400_mm_mask_sub_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {
395 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,401 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
396 (__v16qi)_mm_sub_epi8(__A, __B),402 (__v16qi)_mm_sub_epi8(__A, __B),
397 (__v16qi)__W);403 (__v16qi)__W);
398}404}
399405
400static __inline__ __m128i __DEFAULT_FN_ATTRS128406static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
401_mm_maskz_sub_epi8(__mmask16 __U, __m128i __A, __m128i __B) {407_mm_maskz_sub_epi8(__mmask16 __U, __m128i __A, __m128i __B) {
402 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,408 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
403 (__v16qi)_mm_sub_epi8(__A, __B),409 (__v16qi)_mm_sub_epi8(__A, __B),
404 (__v16qi)_mm_setzero_si128());410 (__v16qi)_mm_setzero_si128());
405}411}
406412
407static __inline__ __m128i __DEFAULT_FN_ATTRS128413static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
408_mm_mask_sub_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {414_mm_mask_sub_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
409 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,415 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
410 (__v8hi)_mm_sub_epi16(__A, __B),416 (__v8hi)_mm_sub_epi16(__A, __B),
411 (__v8hi)__W);417 (__v8hi)__W);
412}418}
413419
414static __inline__ __m128i __DEFAULT_FN_ATTRS128420static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
415_mm_maskz_sub_epi16(__mmask8 __U, __m128i __A, __m128i __B) {421_mm_maskz_sub_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
416 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,422 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
417 (__v8hi)_mm_sub_epi16(__A, __B),423 (__v8hi)_mm_sub_epi16(__A, __B),
418 (__v8hi)_mm_setzero_si128());424 (__v8hi)_mm_setzero_si128());
419}425}
420426
421static __inline__ __m256i __DEFAULT_FN_ATTRS256427static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
422_mm256_mask_mullo_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {428_mm256_mask_mullo_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
423 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,429 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
424 (__v16hi)_mm256_mullo_epi16(__A, __B),430 (__v16hi)_mm256_mullo_epi16(__A, __B),
425 (__v16hi)__W);431 (__v16hi)__W);
426}432}
427433
428static __inline__ __m256i __DEFAULT_FN_ATTRS256434static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
429_mm256_maskz_mullo_epi16(__mmask16 __U, __m256i __A, __m256i __B) {435_mm256_maskz_mullo_epi16(__mmask16 __U, __m256i __A, __m256i __B) {
430 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,436 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
431 (__v16hi)_mm256_mullo_epi16(__A, __B),437 (__v16hi)_mm256_mullo_epi16(__A, __B),
432 (__v16hi)_mm256_setzero_si256());438 (__v16hi)_mm256_setzero_si256());
433}439}
434440
435static __inline__ __m128i __DEFAULT_FN_ATTRS128441static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
436_mm_mask_mullo_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {442_mm_mask_mullo_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
437 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,443 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
438 (__v8hi)_mm_mullo_epi16(__A, __B),444 (__v8hi)_mm_mullo_epi16(__A, __B),
439 (__v8hi)__W);445 (__v8hi)__W);
440}446}
441447
442static __inline__ __m128i __DEFAULT_FN_ATTRS128448static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
443_mm_maskz_mullo_epi16(__mmask8 __U, __m128i __A, __m128i __B) {449_mm_maskz_mullo_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
444 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,450 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
445 (__v8hi)_mm_mullo_epi16(__A, __B),451 (__v8hi)_mm_mullo_epi16(__A, __B),
446 (__v8hi)_mm_setzero_si128());452 (__v8hi)_mm_setzero_si128());
447}453}
448454
449static __inline__ __m128i __DEFAULT_FN_ATTRS128455static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
450_mm_mask_blend_epi8 (__mmask16 __U, __m128i __A, __m128i __W)456_mm_mask_blend_epi8(__mmask16 __U, __m128i __A, __m128i __W) {
451{
452 return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U,457 return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U,
453 (__v16qi) __W,458 (__v16qi) __W,
454 (__v16qi) __A);459 (__v16qi) __A);
455}460}
456461
457static __inline__ __m256i __DEFAULT_FN_ATTRS256462static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
458_mm256_mask_blend_epi8 (__mmask32 __U, __m256i __A, __m256i __W)463_mm256_mask_blend_epi8(__mmask32 __U, __m256i __A, __m256i __W) {
459{
460 return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U,464 return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U,
461 (__v32qi) __W,465 (__v32qi) __W,
462 (__v32qi) __A);466 (__v32qi) __A);
463}467}
464468
465static __inline__ __m128i __DEFAULT_FN_ATTRS128469static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
466_mm_mask_blend_epi16 (__mmask8 __U, __m128i __A, __m128i __W)470_mm_mask_blend_epi16(__mmask8 __U, __m128i __A, __m128i __W) {
467{
468 return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U,471 return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U,
469 (__v8hi) __W,472 (__v8hi) __W,
470 (__v8hi) __A);473 (__v8hi) __A);
471}474}
472475
473static __inline__ __m256i __DEFAULT_FN_ATTRS256476static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
474_mm256_mask_blend_epi16 (__mmask16 __U, __m256i __A, __m256i __W)477_mm256_mask_blend_epi16(__mmask16 __U, __m256i __A, __m256i __W) {
475{
476 return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U,478 return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U,
477 (__v16hi) __W,479 (__v16hi) __W,
478 (__v16hi) __A);480 (__v16hi) __A);
479}481}
480482
481static __inline__ __m128i __DEFAULT_FN_ATTRS128483static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
482_mm_mask_abs_epi8(__m128i __W, __mmask16 __U, __m128i __A)484_mm_mask_abs_epi8(__m128i __W, __mmask16 __U, __m128i __A) {
483{
484 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,485 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
485 (__v16qi)_mm_abs_epi8(__A),486 (__v16qi)_mm_abs_epi8(__A),
486 (__v16qi)__W);487 (__v16qi)__W);
487}488}
488489
489static __inline__ __m128i __DEFAULT_FN_ATTRS128490static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
490_mm_maskz_abs_epi8(__mmask16 __U, __m128i __A)491_mm_maskz_abs_epi8(__mmask16 __U, __m128i __A) {
491{
492 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,492 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
493 (__v16qi)_mm_abs_epi8(__A),493 (__v16qi)_mm_abs_epi8(__A),
494 (__v16qi)_mm_setzero_si128());494 (__v16qi)_mm_setzero_si128());
495}495}
496496
497static __inline__ __m256i __DEFAULT_FN_ATTRS256497static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
498_mm256_mask_abs_epi8(__m256i __W, __mmask32 __U, __m256i __A)498_mm256_mask_abs_epi8(__m256i __W, __mmask32 __U, __m256i __A) {
499{
500 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,499 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
501 (__v32qi)_mm256_abs_epi8(__A),500 (__v32qi)_mm256_abs_epi8(__A),
502 (__v32qi)__W);501 (__v32qi)__W);
503}502}
504503
505static __inline__ __m256i __DEFAULT_FN_ATTRS256504static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
506_mm256_maskz_abs_epi8 (__mmask32 __U, __m256i __A)505_mm256_maskz_abs_epi8(__mmask32 __U, __m256i __A) {
507{
508 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,506 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
509 (__v32qi)_mm256_abs_epi8(__A),507 (__v32qi)_mm256_abs_epi8(__A),
510 (__v32qi)_mm256_setzero_si256());508 (__v32qi)_mm256_setzero_si256());
511}509}
512510
513static __inline__ __m128i __DEFAULT_FN_ATTRS128511static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
514_mm_mask_abs_epi16(__m128i __W, __mmask8 __U, __m128i __A)512_mm_mask_abs_epi16(__m128i __W, __mmask8 __U, __m128i __A) {
515{
516 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,513 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
517 (__v8hi)_mm_abs_epi16(__A),514 (__v8hi)_mm_abs_epi16(__A),
518 (__v8hi)__W);515 (__v8hi)__W);
519}516}
520517
521static __inline__ __m128i __DEFAULT_FN_ATTRS128518static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
522_mm_maskz_abs_epi16(__mmask8 __U, __m128i __A)519_mm_maskz_abs_epi16(__mmask8 __U, __m128i __A) {
523{
524 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,520 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
525 (__v8hi)_mm_abs_epi16(__A),521 (__v8hi)_mm_abs_epi16(__A),
526 (__v8hi)_mm_setzero_si128());522 (__v8hi)_mm_setzero_si128());
527}523}
528524
529static __inline__ __m256i __DEFAULT_FN_ATTRS256525static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
530_mm256_mask_abs_epi16(__m256i __W, __mmask16 __U, __m256i __A)526_mm256_mask_abs_epi16(__m256i __W, __mmask16 __U, __m256i __A) {
531{
532 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,527 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
533 (__v16hi)_mm256_abs_epi16(__A),528 (__v16hi)_mm256_abs_epi16(__A),
534 (__v16hi)__W);529 (__v16hi)__W);
535}530}
536531
537static __inline__ __m256i __DEFAULT_FN_ATTRS256532static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
538_mm256_maskz_abs_epi16(__mmask16 __U, __m256i __A)533_mm256_maskz_abs_epi16(__mmask16 __U, __m256i __A) {
539{
540 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,534 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
541 (__v16hi)_mm256_abs_epi16(__A),535 (__v16hi)_mm256_abs_epi16(__A),
542 (__v16hi)_mm256_setzero_si256());536 (__v16hi)_mm256_setzero_si256());
543}537}
544538
545static __inline__ __m128i __DEFAULT_FN_ATTRS128539static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
546_mm_maskz_packs_epi32(__mmask8 __M, __m128i __A, __m128i __B) {540_mm_maskz_packs_epi32(__mmask8 __M, __m128i __A, __m128i __B) {
547 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,541 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
548 (__v8hi)_mm_packs_epi32(__A, __B),542 (__v8hi)_mm_packs_epi32(__A, __B),
549 (__v8hi)_mm_setzero_si128());543 (__v8hi)_mm_setzero_si128());
550}544}
551545
552static __inline__ __m128i __DEFAULT_FN_ATTRS128546static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
553_mm_mask_packs_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)547_mm_mask_packs_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)
554{548{
555 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,549 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
...@@ -557,7 +551,7 @@ _mm_mask_packs_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)...@@ -557,7 +551,7 @@ _mm_mask_packs_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)
557 (__v8hi)__W);551 (__v8hi)__W);
558}552}
559553
560static __inline__ __m256i __DEFAULT_FN_ATTRS256554static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
561_mm256_maskz_packs_epi32(__mmask16 __M, __m256i __A, __m256i __B)555_mm256_maskz_packs_epi32(__mmask16 __M, __m256i __A, __m256i __B)
562{556{
563 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,557 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
...@@ -565,7 +559,7 @@ _mm256_maskz_packs_epi32(__mmask16 __M, __m256i __A, __m256i __B)...@@ -565,7 +559,7 @@ _mm256_maskz_packs_epi32(__mmask16 __M, __m256i __A, __m256i __B)
565 (__v16hi)_mm256_setzero_si256());559 (__v16hi)_mm256_setzero_si256());
566}560}
567561
568static __inline__ __m256i __DEFAULT_FN_ATTRS256562static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
569_mm256_mask_packs_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)563_mm256_mask_packs_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)
570{564{
571 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,565 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
...@@ -573,7 +567,7 @@ _mm256_mask_packs_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)...@@ -573,7 +567,7 @@ _mm256_mask_packs_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)
573 (__v16hi)__W);567 (__v16hi)__W);
574}568}
575569
576static __inline__ __m128i __DEFAULT_FN_ATTRS128570static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
577_mm_maskz_packs_epi16(__mmask16 __M, __m128i __A, __m128i __B)571_mm_maskz_packs_epi16(__mmask16 __M, __m128i __A, __m128i __B)
578{572{
579 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,573 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
...@@ -581,7 +575,7 @@ _mm_maskz_packs_epi16(__mmask16 __M, __m128i __A, __m128i __B)...@@ -581,7 +575,7 @@ _mm_maskz_packs_epi16(__mmask16 __M, __m128i __A, __m128i __B)
581 (__v16qi)_mm_setzero_si128());575 (__v16qi)_mm_setzero_si128());
582}576}
583577
584static __inline__ __m128i __DEFAULT_FN_ATTRS128578static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
585_mm_mask_packs_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)579_mm_mask_packs_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)
586{580{
587 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,581 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
...@@ -589,7 +583,7 @@ _mm_mask_packs_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)...@@ -589,7 +583,7 @@ _mm_mask_packs_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)
589 (__v16qi)__W);583 (__v16qi)__W);
590}584}
591585
592static __inline__ __m256i __DEFAULT_FN_ATTRS256586static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
593_mm256_maskz_packs_epi16(__mmask32 __M, __m256i __A, __m256i __B)587_mm256_maskz_packs_epi16(__mmask32 __M, __m256i __A, __m256i __B)
594{588{
595 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,589 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
...@@ -597,7 +591,7 @@ _mm256_maskz_packs_epi16(__mmask32 __M, __m256i __A, __m256i __B)...@@ -597,7 +591,7 @@ _mm256_maskz_packs_epi16(__mmask32 __M, __m256i __A, __m256i __B)
597 (__v32qi)_mm256_setzero_si256());591 (__v32qi)_mm256_setzero_si256());
598}592}
599593
600static __inline__ __m256i __DEFAULT_FN_ATTRS256594static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
601_mm256_mask_packs_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)595_mm256_mask_packs_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)
602{596{
603 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,597 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
...@@ -605,7 +599,7 @@ _mm256_mask_packs_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)...@@ -605,7 +599,7 @@ _mm256_mask_packs_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)
605 (__v32qi)__W);599 (__v32qi)__W);
606}600}
607601
608static __inline__ __m128i __DEFAULT_FN_ATTRS128602static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
609_mm_maskz_packus_epi32(__mmask8 __M, __m128i __A, __m128i __B)603_mm_maskz_packus_epi32(__mmask8 __M, __m128i __A, __m128i __B)
610{604{
611 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,605 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
...@@ -613,7 +607,7 @@ _mm_maskz_packus_epi32(__mmask8 __M, __m128i __A, __m128i __B)...@@ -613,7 +607,7 @@ _mm_maskz_packus_epi32(__mmask8 __M, __m128i __A, __m128i __B)
613 (__v8hi)_mm_setzero_si128());607 (__v8hi)_mm_setzero_si128());
614}608}
615609
616static __inline__ __m128i __DEFAULT_FN_ATTRS128610static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
617_mm_mask_packus_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)611_mm_mask_packus_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)
618{612{
619 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,613 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
...@@ -621,7 +615,7 @@ _mm_mask_packus_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)...@@ -621,7 +615,7 @@ _mm_mask_packus_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)
621 (__v8hi)__W);615 (__v8hi)__W);
622}616}
623617
624static __inline__ __m256i __DEFAULT_FN_ATTRS256618static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
625_mm256_maskz_packus_epi32(__mmask16 __M, __m256i __A, __m256i __B)619_mm256_maskz_packus_epi32(__mmask16 __M, __m256i __A, __m256i __B)
626{620{
627 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,621 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
...@@ -629,7 +623,7 @@ _mm256_maskz_packus_epi32(__mmask16 __M, __m256i __A, __m256i __B)...@@ -629,7 +623,7 @@ _mm256_maskz_packus_epi32(__mmask16 __M, __m256i __A, __m256i __B)
629 (__v16hi)_mm256_setzero_si256());623 (__v16hi)_mm256_setzero_si256());
630}624}
631625
632static __inline__ __m256i __DEFAULT_FN_ATTRS256626static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
633_mm256_mask_packus_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)627_mm256_mask_packus_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)
634{628{
635 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,629 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
...@@ -637,7 +631,7 @@ _mm256_mask_packus_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)...@@ -637,7 +631,7 @@ _mm256_mask_packus_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)
637 (__v16hi)__W);631 (__v16hi)__W);
638}632}
639633
640static __inline__ __m128i __DEFAULT_FN_ATTRS128634static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
641_mm_maskz_packus_epi16(__mmask16 __M, __m128i __A, __m128i __B)635_mm_maskz_packus_epi16(__mmask16 __M, __m128i __A, __m128i __B)
642{636{
643 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,637 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
...@@ -645,7 +639,7 @@ _mm_maskz_packus_epi16(__mmask16 __M, __m128i __A, __m128i __B)...@@ -645,7 +639,7 @@ _mm_maskz_packus_epi16(__mmask16 __M, __m128i __A, __m128i __B)
645 (__v16qi)_mm_setzero_si128());639 (__v16qi)_mm_setzero_si128());
646}640}
647641
648static __inline__ __m128i __DEFAULT_FN_ATTRS128642static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
649_mm_mask_packus_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)643_mm_mask_packus_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)
650{644{
651 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,645 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
...@@ -653,7 +647,7 @@ _mm_mask_packus_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)...@@ -653,7 +647,7 @@ _mm_mask_packus_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)
653 (__v16qi)__W);647 (__v16qi)__W);
654}648}
655649
656static __inline__ __m256i __DEFAULT_FN_ATTRS256650static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
657_mm256_maskz_packus_epi16(__mmask32 __M, __m256i __A, __m256i __B)651_mm256_maskz_packus_epi16(__mmask32 __M, __m256i __A, __m256i __B)
658{652{
659 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,653 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
...@@ -661,7 +655,7 @@ _mm256_maskz_packus_epi16(__mmask32 __M, __m256i __A, __m256i __B)...@@ -661,7 +655,7 @@ _mm256_maskz_packus_epi16(__mmask32 __M, __m256i __A, __m256i __B)
661 (__v32qi)_mm256_setzero_si256());655 (__v32qi)_mm256_setzero_si256());
662}656}
663657
664static __inline__ __m256i __DEFAULT_FN_ATTRS256658static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
665_mm256_mask_packus_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)659_mm256_mask_packus_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)
666{660{
667 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,661 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
...@@ -669,7 +663,7 @@ _mm256_mask_packus_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)...@@ -669,7 +663,7 @@ _mm256_mask_packus_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)
669 (__v32qi)__W);663 (__v32qi)__W);
670}664}
671665
672static __inline__ __m128i __DEFAULT_FN_ATTRS128666static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
673_mm_mask_adds_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)667_mm_mask_adds_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
674{668{
675 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,669 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -677,7 +671,7 @@ _mm_mask_adds_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)...@@ -677,7 +671,7 @@ _mm_mask_adds_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
677 (__v16qi)__W);671 (__v16qi)__W);
678}672}
679673
680static __inline__ __m128i __DEFAULT_FN_ATTRS128674static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
681_mm_maskz_adds_epi8(__mmask16 __U, __m128i __A, __m128i __B)675_mm_maskz_adds_epi8(__mmask16 __U, __m128i __A, __m128i __B)
682{676{
683 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,677 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -685,7 +679,7 @@ _mm_maskz_adds_epi8(__mmask16 __U, __m128i __A, __m128i __B)...@@ -685,7 +679,7 @@ _mm_maskz_adds_epi8(__mmask16 __U, __m128i __A, __m128i __B)
685 (__v16qi)_mm_setzero_si128());679 (__v16qi)_mm_setzero_si128());
686}680}
687681
688static __inline__ __m256i __DEFAULT_FN_ATTRS256682static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
689_mm256_mask_adds_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)683_mm256_mask_adds_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
690{684{
691 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,685 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -693,7 +687,7 @@ _mm256_mask_adds_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)...@@ -693,7 +687,7 @@ _mm256_mask_adds_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
693 (__v32qi)__W);687 (__v32qi)__W);
694}688}
695689
696static __inline__ __m256i __DEFAULT_FN_ATTRS256690static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
697_mm256_maskz_adds_epi8(__mmask32 __U, __m256i __A, __m256i __B)691_mm256_maskz_adds_epi8(__mmask32 __U, __m256i __A, __m256i __B)
698{692{
699 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,693 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -701,7 +695,7 @@ _mm256_maskz_adds_epi8(__mmask32 __U, __m256i __A, __m256i __B)...@@ -701,7 +695,7 @@ _mm256_maskz_adds_epi8(__mmask32 __U, __m256i __A, __m256i __B)
701 (__v32qi)_mm256_setzero_si256());695 (__v32qi)_mm256_setzero_si256());
702}696}
703697
704static __inline__ __m128i __DEFAULT_FN_ATTRS128698static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
705_mm_mask_adds_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)699_mm_mask_adds_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
706{700{
707 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,701 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -709,7 +703,7 @@ _mm_mask_adds_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -709,7 +703,7 @@ _mm_mask_adds_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
709 (__v8hi)__W);703 (__v8hi)__W);
710}704}
711705
712static __inline__ __m128i __DEFAULT_FN_ATTRS128706static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
713_mm_maskz_adds_epi16(__mmask8 __U, __m128i __A, __m128i __B)707_mm_maskz_adds_epi16(__mmask8 __U, __m128i __A, __m128i __B)
714{708{
715 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,709 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -717,7 +711,7 @@ _mm_maskz_adds_epi16(__mmask8 __U, __m128i __A, __m128i __B)...@@ -717,7 +711,7 @@ _mm_maskz_adds_epi16(__mmask8 __U, __m128i __A, __m128i __B)
717 (__v8hi)_mm_setzero_si128());711 (__v8hi)_mm_setzero_si128());
718}712}
719713
720static __inline__ __m256i __DEFAULT_FN_ATTRS256714static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
721_mm256_mask_adds_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)715_mm256_mask_adds_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
722{716{
723 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,717 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -725,7 +719,7 @@ _mm256_mask_adds_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)...@@ -725,7 +719,7 @@ _mm256_mask_adds_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
725 (__v16hi)__W);719 (__v16hi)__W);
726}720}
727721
728static __inline__ __m256i __DEFAULT_FN_ATTRS256722static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
729_mm256_maskz_adds_epi16(__mmask16 __U, __m256i __A, __m256i __B)723_mm256_maskz_adds_epi16(__mmask16 __U, __m256i __A, __m256i __B)
730{724{
731 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,725 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -733,7 +727,7 @@ _mm256_maskz_adds_epi16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -733,7 +727,7 @@ _mm256_maskz_adds_epi16(__mmask16 __U, __m256i __A, __m256i __B)
733 (__v16hi)_mm256_setzero_si256());727 (__v16hi)_mm256_setzero_si256());
734}728}
735729
736static __inline__ __m128i __DEFAULT_FN_ATTRS128730static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
737_mm_mask_adds_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)731_mm_mask_adds_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
738{732{
739 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,733 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -741,7 +735,7 @@ _mm_mask_adds_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)...@@ -741,7 +735,7 @@ _mm_mask_adds_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
741 (__v16qi)__W);735 (__v16qi)__W);
742}736}
743737
744static __inline__ __m128i __DEFAULT_FN_ATTRS128738static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
745_mm_maskz_adds_epu8(__mmask16 __U, __m128i __A, __m128i __B)739_mm_maskz_adds_epu8(__mmask16 __U, __m128i __A, __m128i __B)
746{740{
747 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,741 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -749,7 +743,7 @@ _mm_maskz_adds_epu8(__mmask16 __U, __m128i __A, __m128i __B)...@@ -749,7 +743,7 @@ _mm_maskz_adds_epu8(__mmask16 __U, __m128i __A, __m128i __B)
749 (__v16qi)_mm_setzero_si128());743 (__v16qi)_mm_setzero_si128());
750}744}
751745
752static __inline__ __m256i __DEFAULT_FN_ATTRS256746static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
753_mm256_mask_adds_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)747_mm256_mask_adds_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
754{748{
755 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,749 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -757,7 +751,7 @@ _mm256_mask_adds_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)...@@ -757,7 +751,7 @@ _mm256_mask_adds_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
757 (__v32qi)__W);751 (__v32qi)__W);
758}752}
759753
760static __inline__ __m256i __DEFAULT_FN_ATTRS256754static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
761_mm256_maskz_adds_epu8(__mmask32 __U, __m256i __A, __m256i __B)755_mm256_maskz_adds_epu8(__mmask32 __U, __m256i __A, __m256i __B)
762{756{
763 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,757 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -765,7 +759,7 @@ _mm256_maskz_adds_epu8(__mmask32 __U, __m256i __A, __m256i __B)...@@ -765,7 +759,7 @@ _mm256_maskz_adds_epu8(__mmask32 __U, __m256i __A, __m256i __B)
765 (__v32qi)_mm256_setzero_si256());759 (__v32qi)_mm256_setzero_si256());
766}760}
767761
768static __inline__ __m128i __DEFAULT_FN_ATTRS128762static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
769_mm_mask_adds_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)763_mm_mask_adds_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
770{764{
771 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,765 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -773,7 +767,7 @@ _mm_mask_adds_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -773,7 +767,7 @@ _mm_mask_adds_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
773 (__v8hi)__W);767 (__v8hi)__W);
774}768}
775769
776static __inline__ __m128i __DEFAULT_FN_ATTRS128770static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
777_mm_maskz_adds_epu16(__mmask8 __U, __m128i __A, __m128i __B)771_mm_maskz_adds_epu16(__mmask8 __U, __m128i __A, __m128i __B)
778{772{
779 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,773 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -781,7 +775,7 @@ _mm_maskz_adds_epu16(__mmask8 __U, __m128i __A, __m128i __B)...@@ -781,7 +775,7 @@ _mm_maskz_adds_epu16(__mmask8 __U, __m128i __A, __m128i __B)
781 (__v8hi)_mm_setzero_si128());775 (__v8hi)_mm_setzero_si128());
782}776}
783777
784static __inline__ __m256i __DEFAULT_FN_ATTRS256778static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
785_mm256_mask_adds_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)779_mm256_mask_adds_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
786{780{
787 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,781 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -789,7 +783,7 @@ _mm256_mask_adds_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)...@@ -789,7 +783,7 @@ _mm256_mask_adds_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
789 (__v16hi)__W);783 (__v16hi)__W);
790}784}
791785
792static __inline__ __m256i __DEFAULT_FN_ATTRS256786static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
793_mm256_maskz_adds_epu16(__mmask16 __U, __m256i __A, __m256i __B)787_mm256_maskz_adds_epu16(__mmask16 __U, __m256i __A, __m256i __B)
794{788{
795 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,789 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -797,359 +791,311 @@ _mm256_maskz_adds_epu16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -797,359 +791,311 @@ _mm256_maskz_adds_epu16(__mmask16 __U, __m256i __A, __m256i __B)
797 (__v16hi)_mm256_setzero_si256());791 (__v16hi)_mm256_setzero_si256());
798}792}
799793
800static __inline__ __m128i __DEFAULT_FN_ATTRS128794static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
801_mm_mask_avg_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)795_mm_mask_avg_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {
802{796 return (__m128i)__builtin_ia32_selectb_128(
803 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,797 (__mmask16)__U, (__v16qi)_mm_avg_epu8(__A, __B), (__v16qi)__W);
804 (__v16qi)_mm_avg_epu8(__A, __B),
805 (__v16qi)__W);
806}798}
807799
808static __inline__ __m128i __DEFAULT_FN_ATTRS128800static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
809_mm_maskz_avg_epu8(__mmask16 __U, __m128i __A, __m128i __B)801_mm_maskz_avg_epu8(__mmask16 __U, __m128i __A, __m128i __B) {
810{
811 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,802 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
812 (__v16qi)_mm_avg_epu8(__A, __B),803 (__v16qi)_mm_avg_epu8(__A, __B),
813 (__v16qi)_mm_setzero_si128());804 (__v16qi)_mm_setzero_si128());
814}805}
815806
816static __inline__ __m256i __DEFAULT_FN_ATTRS256807static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
817_mm256_mask_avg_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)808_mm256_mask_avg_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {
818{809 return (__m256i)__builtin_ia32_selectb_256(
819 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,810 (__mmask32)__U, (__v32qi)_mm256_avg_epu8(__A, __B), (__v32qi)__W);
820 (__v32qi)_mm256_avg_epu8(__A, __B),
821 (__v32qi)__W);
822}811}
823812
824static __inline__ __m256i __DEFAULT_FN_ATTRS256813static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
825_mm256_maskz_avg_epu8(__mmask32 __U, __m256i __A, __m256i __B)814_mm256_maskz_avg_epu8(__mmask32 __U, __m256i __A, __m256i __B) {
826{
827 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,815 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
828 (__v32qi)_mm256_avg_epu8(__A, __B),816 (__v32qi)_mm256_avg_epu8(__A, __B),
829 (__v32qi)_mm256_setzero_si256());817 (__v32qi)_mm256_setzero_si256());
830}818}
831819
832static __inline__ __m128i __DEFAULT_FN_ATTRS128820static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
833_mm_mask_avg_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)821_mm_mask_avg_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
834{822 return (__m128i)__builtin_ia32_selectw_128(
835 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,823 (__mmask8)__U, (__v8hi)_mm_avg_epu16(__A, __B), (__v8hi)__W);
836 (__v8hi)_mm_avg_epu16(__A, __B),
837 (__v8hi)__W);
838}824}
839825
840static __inline__ __m128i __DEFAULT_FN_ATTRS128826static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
841_mm_maskz_avg_epu16(__mmask8 __U, __m128i __A, __m128i __B)827_mm_maskz_avg_epu16(__mmask8 __U, __m128i __A, __m128i __B) {
842{
843 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,828 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
844 (__v8hi)_mm_avg_epu16(__A, __B),829 (__v8hi)_mm_avg_epu16(__A, __B),
845 (__v8hi)_mm_setzero_si128());830 (__v8hi)_mm_setzero_si128());
846}831}
847832
848static __inline__ __m256i __DEFAULT_FN_ATTRS256833static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
849_mm256_mask_avg_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)834_mm256_mask_avg_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
850{835 return (__m256i)__builtin_ia32_selectw_256(
851 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,836 (__mmask16)__U, (__v16hi)_mm256_avg_epu16(__A, __B), (__v16hi)__W);
852 (__v16hi)_mm256_avg_epu16(__A, __B),
853 (__v16hi)__W);
854}837}
855838
856static __inline__ __m256i __DEFAULT_FN_ATTRS256839static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
857_mm256_maskz_avg_epu16(__mmask16 __U, __m256i __A, __m256i __B)840_mm256_maskz_avg_epu16(__mmask16 __U, __m256i __A, __m256i __B) {
858{841 return (__m256i)__builtin_ia32_selectw_256(
859 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,842 (__mmask16)__U, (__v16hi)_mm256_avg_epu16(__A, __B),
860 (__v16hi)_mm256_avg_epu16(__A, __B),843 (__v16hi)_mm256_setzero_si256());
861 (__v16hi)_mm256_setzero_si256());
862}844}
863845
864static __inline__ __m128i __DEFAULT_FN_ATTRS128846static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
865_mm_maskz_max_epi8(__mmask16 __M, __m128i __A, __m128i __B)847_mm_maskz_max_epi8(__mmask16 __M, __m128i __A, __m128i __B) {
866{
867 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,848 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
868 (__v16qi)_mm_max_epi8(__A, __B),849 (__v16qi)_mm_max_epi8(__A, __B),
869 (__v16qi)_mm_setzero_si128());850 (__v16qi)_mm_setzero_si128());
870}851}
871852
872static __inline__ __m128i __DEFAULT_FN_ATTRS128853static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
873_mm_mask_max_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)854_mm_mask_max_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) {
874{
875 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,855 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
876 (__v16qi)_mm_max_epi8(__A, __B),856 (__v16qi)_mm_max_epi8(__A, __B),
877 (__v16qi)__W);857 (__v16qi)__W);
878}858}
879859
880static __inline__ __m256i __DEFAULT_FN_ATTRS256860static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
881_mm256_maskz_max_epi8(__mmask32 __M, __m256i __A, __m256i __B)861_mm256_maskz_max_epi8(__mmask32 __M, __m256i __A, __m256i __B) {
882{
883 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,862 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
884 (__v32qi)_mm256_max_epi8(__A, __B),863 (__v32qi)_mm256_max_epi8(__A, __B),
885 (__v32qi)_mm256_setzero_si256());864 (__v32qi)_mm256_setzero_si256());
886}865}
887866
888static __inline__ __m256i __DEFAULT_FN_ATTRS256867static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
889_mm256_mask_max_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)868_mm256_mask_max_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) {
890{
891 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,869 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
892 (__v32qi)_mm256_max_epi8(__A, __B),870 (__v32qi)_mm256_max_epi8(__A, __B),
893 (__v32qi)__W);871 (__v32qi)__W);
894}872}
895873
896static __inline__ __m128i __DEFAULT_FN_ATTRS128874static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
897_mm_maskz_max_epi16(__mmask8 __M, __m128i __A, __m128i __B)875_mm_maskz_max_epi16(__mmask8 __M, __m128i __A, __m128i __B) {
898{
899 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,876 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
900 (__v8hi)_mm_max_epi16(__A, __B),877 (__v8hi)_mm_max_epi16(__A, __B),
901 (__v8hi)_mm_setzero_si128());878 (__v8hi)_mm_setzero_si128());
902}879}
903880
904static __inline__ __m128i __DEFAULT_FN_ATTRS128881static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
905_mm_mask_max_epi16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)882_mm_mask_max_epi16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
906{
907 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,883 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
908 (__v8hi)_mm_max_epi16(__A, __B),884 (__v8hi)_mm_max_epi16(__A, __B),
909 (__v8hi)__W);885 (__v8hi)__W);
910}886}
911887
912static __inline__ __m256i __DEFAULT_FN_ATTRS256888static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
913_mm256_maskz_max_epi16(__mmask16 __M, __m256i __A, __m256i __B)889_mm256_maskz_max_epi16(__mmask16 __M, __m256i __A, __m256i __B) {
914{
915 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,890 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
916 (__v16hi)_mm256_max_epi16(__A, __B),891 (__v16hi)_mm256_max_epi16(__A, __B),
917 (__v16hi)_mm256_setzero_si256());892 (__v16hi)_mm256_setzero_si256());
918}893}
919894
920static __inline__ __m256i __DEFAULT_FN_ATTRS256895static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
921_mm256_mask_max_epi16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)896_mm256_mask_max_epi16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) {
922{
923 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,897 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
924 (__v16hi)_mm256_max_epi16(__A, __B),898 (__v16hi)_mm256_max_epi16(__A, __B),
925 (__v16hi)__W);899 (__v16hi)__W);
926}900}
927901
928static __inline__ __m128i __DEFAULT_FN_ATTRS128902static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
929_mm_maskz_max_epu8(__mmask16 __M, __m128i __A, __m128i __B)903_mm_maskz_max_epu8(__mmask16 __M, __m128i __A, __m128i __B) {
930{
931 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,904 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
932 (__v16qi)_mm_max_epu8(__A, __B),905 (__v16qi)_mm_max_epu8(__A, __B),
933 (__v16qi)_mm_setzero_si128());906 (__v16qi)_mm_setzero_si128());
934}907}
935908
936static __inline__ __m128i __DEFAULT_FN_ATTRS128909static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
937_mm_mask_max_epu8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)910_mm_mask_max_epu8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) {
938{
939 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,911 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
940 (__v16qi)_mm_max_epu8(__A, __B),912 (__v16qi)_mm_max_epu8(__A, __B),
941 (__v16qi)__W);913 (__v16qi)__W);
942}914}
943915
944static __inline__ __m256i __DEFAULT_FN_ATTRS256916static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
945_mm256_maskz_max_epu8 (__mmask32 __M, __m256i __A, __m256i __B)917_mm256_maskz_max_epu8(__mmask32 __M, __m256i __A, __m256i __B) {
946{
947 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,918 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
948 (__v32qi)_mm256_max_epu8(__A, __B),919 (__v32qi)_mm256_max_epu8(__A, __B),
949 (__v32qi)_mm256_setzero_si256());920 (__v32qi)_mm256_setzero_si256());
950}921}
951922
952static __inline__ __m256i __DEFAULT_FN_ATTRS256923static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
953_mm256_mask_max_epu8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)924_mm256_mask_max_epu8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) {
954{
955 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,925 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
956 (__v32qi)_mm256_max_epu8(__A, __B),926 (__v32qi)_mm256_max_epu8(__A, __B),
957 (__v32qi)__W);927 (__v32qi)__W);
958}928}
959929
960static __inline__ __m128i __DEFAULT_FN_ATTRS128930static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
961_mm_maskz_max_epu16(__mmask8 __M, __m128i __A, __m128i __B)931_mm_maskz_max_epu16(__mmask8 __M, __m128i __A, __m128i __B) {
962{
963 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,932 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
964 (__v8hi)_mm_max_epu16(__A, __B),933 (__v8hi)_mm_max_epu16(__A, __B),
965 (__v8hi)_mm_setzero_si128());934 (__v8hi)_mm_setzero_si128());
966}935}
967936
968static __inline__ __m128i __DEFAULT_FN_ATTRS128937static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
969_mm_mask_max_epu16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)938_mm_mask_max_epu16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
970{
971 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,939 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
972 (__v8hi)_mm_max_epu16(__A, __B),940 (__v8hi)_mm_max_epu16(__A, __B),
973 (__v8hi)__W);941 (__v8hi)__W);
974}942}
975943
976static __inline__ __m256i __DEFAULT_FN_ATTRS256944static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
977_mm256_maskz_max_epu16(__mmask16 __M, __m256i __A, __m256i __B)945_mm256_maskz_max_epu16(__mmask16 __M, __m256i __A, __m256i __B) {
978{
979 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,946 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
980 (__v16hi)_mm256_max_epu16(__A, __B),947 (__v16hi)_mm256_max_epu16(__A, __B),
981 (__v16hi)_mm256_setzero_si256());948 (__v16hi)_mm256_setzero_si256());
982}949}
983950
984static __inline__ __m256i __DEFAULT_FN_ATTRS256951static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
985_mm256_mask_max_epu16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)952_mm256_mask_max_epu16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) {
986{
987 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,953 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
988 (__v16hi)_mm256_max_epu16(__A, __B),954 (__v16hi)_mm256_max_epu16(__A, __B),
989 (__v16hi)__W);955 (__v16hi)__W);
990}956}
991957
992static __inline__ __m128i __DEFAULT_FN_ATTRS128958static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
993_mm_maskz_min_epi8(__mmask16 __M, __m128i __A, __m128i __B)959_mm_maskz_min_epi8(__mmask16 __M, __m128i __A, __m128i __B) {
994{
995 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,960 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
996 (__v16qi)_mm_min_epi8(__A, __B),961 (__v16qi)_mm_min_epi8(__A, __B),
997 (__v16qi)_mm_setzero_si128());962 (__v16qi)_mm_setzero_si128());
998}963}
999964
1000static __inline__ __m128i __DEFAULT_FN_ATTRS128965static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1001_mm_mask_min_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)966_mm_mask_min_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) {
1002{
1003 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,967 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
1004 (__v16qi)_mm_min_epi8(__A, __B),968 (__v16qi)_mm_min_epi8(__A, __B),
1005 (__v16qi)__W);969 (__v16qi)__W);
1006}970}
1007971
1008static __inline__ __m256i __DEFAULT_FN_ATTRS256972static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1009_mm256_maskz_min_epi8(__mmask32 __M, __m256i __A, __m256i __B)973_mm256_maskz_min_epi8(__mmask32 __M, __m256i __A, __m256i __B) {
1010{
1011 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,974 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
1012 (__v32qi)_mm256_min_epi8(__A, __B),975 (__v32qi)_mm256_min_epi8(__A, __B),
1013 (__v32qi)_mm256_setzero_si256());976 (__v32qi)_mm256_setzero_si256());
1014}977}
1015978
1016static __inline__ __m256i __DEFAULT_FN_ATTRS256979static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1017_mm256_mask_min_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)980_mm256_mask_min_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) {
1018{
1019 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,981 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
1020 (__v32qi)_mm256_min_epi8(__A, __B),982 (__v32qi)_mm256_min_epi8(__A, __B),
1021 (__v32qi)__W);983 (__v32qi)__W);
1022}984}
1023985
1024static __inline__ __m128i __DEFAULT_FN_ATTRS128986static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1025_mm_maskz_min_epi16(__mmask8 __M, __m128i __A, __m128i __B)987_mm_maskz_min_epi16(__mmask8 __M, __m128i __A, __m128i __B) {
1026{
1027 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,988 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
1028 (__v8hi)_mm_min_epi16(__A, __B),989 (__v8hi)_mm_min_epi16(__A, __B),
1029 (__v8hi)_mm_setzero_si128());990 (__v8hi)_mm_setzero_si128());
1030}991}
1031992
1032static __inline__ __m128i __DEFAULT_FN_ATTRS128993static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1033_mm_mask_min_epi16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)994_mm_mask_min_epi16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
1034{
1035 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,995 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
1036 (__v8hi)_mm_min_epi16(__A, __B),996 (__v8hi)_mm_min_epi16(__A, __B),
1037 (__v8hi)__W);997 (__v8hi)__W);
1038}998}
1039999
1040static __inline__ __m256i __DEFAULT_FN_ATTRS2561000static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1041_mm256_maskz_min_epi16(__mmask16 __M, __m256i __A, __m256i __B)1001_mm256_maskz_min_epi16(__mmask16 __M, __m256i __A, __m256i __B) {
1042{
1043 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,1002 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
1044 (__v16hi)_mm256_min_epi16(__A, __B),1003 (__v16hi)_mm256_min_epi16(__A, __B),
1045 (__v16hi)_mm256_setzero_si256());1004 (__v16hi)_mm256_setzero_si256());
1046}1005}
10471006
1048static __inline__ __m256i __DEFAULT_FN_ATTRS2561007static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1049_mm256_mask_min_epi16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)1008_mm256_mask_min_epi16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) {
1050{
1051 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,1009 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
1052 (__v16hi)_mm256_min_epi16(__A, __B),1010 (__v16hi)_mm256_min_epi16(__A, __B),
1053 (__v16hi)__W);1011 (__v16hi)__W);
1054}1012}
10551013
1056static __inline__ __m128i __DEFAULT_FN_ATTRS1281014static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1057_mm_maskz_min_epu8(__mmask16 __M, __m128i __A, __m128i __B)1015_mm_maskz_min_epu8(__mmask16 __M, __m128i __A, __m128i __B) {
1058{
1059 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,1016 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
1060 (__v16qi)_mm_min_epu8(__A, __B),1017 (__v16qi)_mm_min_epu8(__A, __B),
1061 (__v16qi)_mm_setzero_si128());1018 (__v16qi)_mm_setzero_si128());
1062}1019}
10631020
1064static __inline__ __m128i __DEFAULT_FN_ATTRS1281021static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1065_mm_mask_min_epu8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)1022_mm_mask_min_epu8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) {
1066{
1067 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,1023 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
1068 (__v16qi)_mm_min_epu8(__A, __B),1024 (__v16qi)_mm_min_epu8(__A, __B),
1069 (__v16qi)__W);1025 (__v16qi)__W);
1070}1026}
10711027
1072static __inline__ __m256i __DEFAULT_FN_ATTRS2561028static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1073_mm256_maskz_min_epu8 (__mmask32 __M, __m256i __A, __m256i __B)1029_mm256_maskz_min_epu8(__mmask32 __M, __m256i __A, __m256i __B) {
1074{
1075 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,1030 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
1076 (__v32qi)_mm256_min_epu8(__A, __B),1031 (__v32qi)_mm256_min_epu8(__A, __B),
1077 (__v32qi)_mm256_setzero_si256());1032 (__v32qi)_mm256_setzero_si256());
1078}1033}
10791034
1080static __inline__ __m256i __DEFAULT_FN_ATTRS2561035static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1081_mm256_mask_min_epu8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)1036_mm256_mask_min_epu8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) {
1082{
1083 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,1037 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
1084 (__v32qi)_mm256_min_epu8(__A, __B),1038 (__v32qi)_mm256_min_epu8(__A, __B),
1085 (__v32qi)__W);1039 (__v32qi)__W);
1086}1040}
10871041
1088static __inline__ __m128i __DEFAULT_FN_ATTRS1281042static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1089_mm_maskz_min_epu16(__mmask8 __M, __m128i __A, __m128i __B)1043_mm_maskz_min_epu16(__mmask8 __M, __m128i __A, __m128i __B) {
1090{
1091 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,1044 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
1092 (__v8hi)_mm_min_epu16(__A, __B),1045 (__v8hi)_mm_min_epu16(__A, __B),
1093 (__v8hi)_mm_setzero_si128());1046 (__v8hi)_mm_setzero_si128());
1094}1047}
10951048
1096static __inline__ __m128i __DEFAULT_FN_ATTRS1281049static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1097_mm_mask_min_epu16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)1050_mm_mask_min_epu16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
1098{
1099 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,1051 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
1100 (__v8hi)_mm_min_epu16(__A, __B),1052 (__v8hi)_mm_min_epu16(__A, __B),
1101 (__v8hi)__W);1053 (__v8hi)__W);
1102}1054}
11031055
1104static __inline__ __m256i __DEFAULT_FN_ATTRS2561056static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1105_mm256_maskz_min_epu16(__mmask16 __M, __m256i __A, __m256i __B)1057_mm256_maskz_min_epu16(__mmask16 __M, __m256i __A, __m256i __B) {
1106{
1107 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,1058 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
1108 (__v16hi)_mm256_min_epu16(__A, __B),1059 (__v16hi)_mm256_min_epu16(__A, __B),
1109 (__v16hi)_mm256_setzero_si256());1060 (__v16hi)_mm256_setzero_si256());
1110}1061}
11111062
1112static __inline__ __m256i __DEFAULT_FN_ATTRS2561063static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1113_mm256_mask_min_epu16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B)1064_mm256_mask_min_epu16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) {
1114{
1115 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,1065 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
1116 (__v16hi)_mm256_min_epu16(__A, __B),1066 (__v16hi)_mm256_min_epu16(__A, __B),
1117 (__v16hi)__W);1067 (__v16hi)__W);
1118}1068}
11191069
1120static __inline__ __m128i __DEFAULT_FN_ATTRS1281070static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1121_mm_mask_shuffle_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)1071_mm_mask_shuffle_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {
1122{
1123 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1072 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
1124 (__v16qi)_mm_shuffle_epi8(__A, __B),1073 (__v16qi)_mm_shuffle_epi8(__A, __B),
1125 (__v16qi)__W);1074 (__v16qi)__W);
1126}1075}
11271076
1128static __inline__ __m128i __DEFAULT_FN_ATTRS1281077static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1129_mm_maskz_shuffle_epi8(__mmask16 __U, __m128i __A, __m128i __B)1078_mm_maskz_shuffle_epi8(__mmask16 __U, __m128i __A, __m128i __B) {
1130{
1131 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1079 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
1132 (__v16qi)_mm_shuffle_epi8(__A, __B),1080 (__v16qi)_mm_shuffle_epi8(__A, __B),
1133 (__v16qi)_mm_setzero_si128());1081 (__v16qi)_mm_setzero_si128());
1134}1082}
11351083
1136static __inline__ __m256i __DEFAULT_FN_ATTRS2561084static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1137_mm256_mask_shuffle_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)1085_mm256_mask_shuffle_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {
1138{
1139 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1086 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
1140 (__v32qi)_mm256_shuffle_epi8(__A, __B),1087 (__v32qi)_mm256_shuffle_epi8(__A, __B),
1141 (__v32qi)__W);1088 (__v32qi)__W);
1142}1089}
11431090
1144static __inline__ __m256i __DEFAULT_FN_ATTRS2561091static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1145_mm256_maskz_shuffle_epi8(__mmask32 __U, __m256i __A, __m256i __B)1092_mm256_maskz_shuffle_epi8(__mmask32 __U, __m256i __A, __m256i __B) {
1146{
1147 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1093 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
1148 (__v32qi)_mm256_shuffle_epi8(__A, __B),1094 (__v32qi)_mm256_shuffle_epi8(__A, __B),
1149 (__v32qi)_mm256_setzero_si256());1095 (__v32qi)_mm256_setzero_si256());
1150}1096}
11511097
1152static __inline__ __m128i __DEFAULT_FN_ATTRS1281098static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1153_mm_mask_subs_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)1099_mm_mask_subs_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
1154{1100{
1155 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1101 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -1157,7 +1103,7 @@ _mm_mask_subs_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)...@@ -1157,7 +1103,7 @@ _mm_mask_subs_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
1157 (__v16qi)__W);1103 (__v16qi)__W);
1158}1104}
11591105
1160static __inline__ __m128i __DEFAULT_FN_ATTRS1281106static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1161_mm_maskz_subs_epi8(__mmask16 __U, __m128i __A, __m128i __B)1107_mm_maskz_subs_epi8(__mmask16 __U, __m128i __A, __m128i __B)
1162{1108{
1163 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1109 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -1165,7 +1111,7 @@ _mm_maskz_subs_epi8(__mmask16 __U, __m128i __A, __m128i __B)...@@ -1165,7 +1111,7 @@ _mm_maskz_subs_epi8(__mmask16 __U, __m128i __A, __m128i __B)
1165 (__v16qi)_mm_setzero_si128());1111 (__v16qi)_mm_setzero_si128());
1166}1112}
11671113
1168static __inline__ __m256i __DEFAULT_FN_ATTRS2561114static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1169_mm256_mask_subs_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)1115_mm256_mask_subs_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
1170{1116{
1171 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1117 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -1173,7 +1119,7 @@ _mm256_mask_subs_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)...@@ -1173,7 +1119,7 @@ _mm256_mask_subs_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
1173 (__v32qi)__W);1119 (__v32qi)__W);
1174}1120}
11751121
1176static __inline__ __m256i __DEFAULT_FN_ATTRS2561122static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1177_mm256_maskz_subs_epi8(__mmask32 __U, __m256i __A, __m256i __B)1123_mm256_maskz_subs_epi8(__mmask32 __U, __m256i __A, __m256i __B)
1178{1124{
1179 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1125 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -1181,7 +1127,7 @@ _mm256_maskz_subs_epi8(__mmask32 __U, __m256i __A, __m256i __B)...@@ -1181,7 +1127,7 @@ _mm256_maskz_subs_epi8(__mmask32 __U, __m256i __A, __m256i __B)
1181 (__v32qi)_mm256_setzero_si256());1127 (__v32qi)_mm256_setzero_si256());
1182}1128}
11831129
1184static __inline__ __m128i __DEFAULT_FN_ATTRS1281130static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1185_mm_mask_subs_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)1131_mm_mask_subs_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
1186{1132{
1187 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1133 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1189,7 +1135,7 @@ _mm_mask_subs_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -1189,7 +1135,7 @@ _mm_mask_subs_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
1189 (__v8hi)__W);1135 (__v8hi)__W);
1190}1136}
11911137
1192static __inline__ __m128i __DEFAULT_FN_ATTRS1281138static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1193_mm_maskz_subs_epi16(__mmask8 __U, __m128i __A, __m128i __B)1139_mm_maskz_subs_epi16(__mmask8 __U, __m128i __A, __m128i __B)
1194{1140{
1195 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1141 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1197,7 +1143,7 @@ _mm_maskz_subs_epi16(__mmask8 __U, __m128i __A, __m128i __B)...@@ -1197,7 +1143,7 @@ _mm_maskz_subs_epi16(__mmask8 __U, __m128i __A, __m128i __B)
1197 (__v8hi)_mm_setzero_si128());1143 (__v8hi)_mm_setzero_si128());
1198}1144}
11991145
1200static __inline__ __m256i __DEFAULT_FN_ATTRS2561146static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1201_mm256_mask_subs_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)1147_mm256_mask_subs_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
1202{1148{
1203 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1149 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1205,7 +1151,7 @@ _mm256_mask_subs_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)...@@ -1205,7 +1151,7 @@ _mm256_mask_subs_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
1205 (__v16hi)__W);1151 (__v16hi)__W);
1206}1152}
12071153
1208static __inline__ __m256i __DEFAULT_FN_ATTRS2561154static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1209_mm256_maskz_subs_epi16(__mmask16 __U, __m256i __A, __m256i __B)1155_mm256_maskz_subs_epi16(__mmask16 __U, __m256i __A, __m256i __B)
1210{1156{
1211 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1157 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1213,7 +1159,7 @@ _mm256_maskz_subs_epi16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -1213,7 +1159,7 @@ _mm256_maskz_subs_epi16(__mmask16 __U, __m256i __A, __m256i __B)
1213 (__v16hi)_mm256_setzero_si256());1159 (__v16hi)_mm256_setzero_si256());
1214}1160}
12151161
1216static __inline__ __m128i __DEFAULT_FN_ATTRS1281162static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1217_mm_mask_subs_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)1163_mm_mask_subs_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
1218{1164{
1219 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1165 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -1221,7 +1167,7 @@ _mm_mask_subs_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)...@@ -1221,7 +1167,7 @@ _mm_mask_subs_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B)
1221 (__v16qi)__W);1167 (__v16qi)__W);
1222}1168}
12231169
1224static __inline__ __m128i __DEFAULT_FN_ATTRS1281170static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1225_mm_maskz_subs_epu8(__mmask16 __U, __m128i __A, __m128i __B)1171_mm_maskz_subs_epu8(__mmask16 __U, __m128i __A, __m128i __B)
1226{1172{
1227 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1173 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
...@@ -1229,7 +1175,7 @@ _mm_maskz_subs_epu8(__mmask16 __U, __m128i __A, __m128i __B)...@@ -1229,7 +1175,7 @@ _mm_maskz_subs_epu8(__mmask16 __U, __m128i __A, __m128i __B)
1229 (__v16qi)_mm_setzero_si128());1175 (__v16qi)_mm_setzero_si128());
1230}1176}
12311177
1232static __inline__ __m256i __DEFAULT_FN_ATTRS2561178static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1233_mm256_mask_subs_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)1179_mm256_mask_subs_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
1234{1180{
1235 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1181 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -1237,7 +1183,7 @@ _mm256_mask_subs_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)...@@ -1237,7 +1183,7 @@ _mm256_mask_subs_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B)
1237 (__v32qi)__W);1183 (__v32qi)__W);
1238}1184}
12391185
1240static __inline__ __m256i __DEFAULT_FN_ATTRS2561186static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1241_mm256_maskz_subs_epu8(__mmask32 __U, __m256i __A, __m256i __B)1187_mm256_maskz_subs_epu8(__mmask32 __U, __m256i __A, __m256i __B)
1242{1188{
1243 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1189 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
...@@ -1245,7 +1191,7 @@ _mm256_maskz_subs_epu8(__mmask32 __U, __m256i __A, __m256i __B)...@@ -1245,7 +1191,7 @@ _mm256_maskz_subs_epu8(__mmask32 __U, __m256i __A, __m256i __B)
1245 (__v32qi)_mm256_setzero_si256());1191 (__v32qi)_mm256_setzero_si256());
1246}1192}
12471193
1248static __inline__ __m128i __DEFAULT_FN_ATTRS1281194static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1249_mm_mask_subs_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)1195_mm_mask_subs_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
1250{1196{
1251 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1197 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1253,7 +1199,7 @@ _mm_mask_subs_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -1253,7 +1199,7 @@ _mm_mask_subs_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
1253 (__v8hi)__W);1199 (__v8hi)__W);
1254}1200}
12551201
1256static __inline__ __m128i __DEFAULT_FN_ATTRS1281202static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1257_mm_maskz_subs_epu16(__mmask8 __U, __m128i __A, __m128i __B)1203_mm_maskz_subs_epu16(__mmask8 __U, __m128i __A, __m128i __B)
1258{1204{
1259 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1205 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1261,7 +1207,7 @@ _mm_maskz_subs_epu16(__mmask8 __U, __m128i __A, __m128i __B)...@@ -1261,7 +1207,7 @@ _mm_maskz_subs_epu16(__mmask8 __U, __m128i __A, __m128i __B)
1261 (__v8hi)_mm_setzero_si128());1207 (__v8hi)_mm_setzero_si128());
1262}1208}
12631209
1264static __inline__ __m256i __DEFAULT_FN_ATTRS2561210static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1265_mm256_mask_subs_epu16(__m256i __W, __mmask16 __U, __m256i __A,1211_mm256_mask_subs_epu16(__m256i __W, __mmask16 __U, __m256i __A,
1266 __m256i __B) {1212 __m256i __B) {
1267 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1213 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1269,7 +1215,7 @@ _mm256_mask_subs_epu16(__m256i __W, __mmask16 __U, __m256i __A,...@@ -1269,7 +1215,7 @@ _mm256_mask_subs_epu16(__m256i __W, __mmask16 __U, __m256i __A,
1269 (__v16hi)__W);1215 (__v16hi)__W);
1270}1216}
12711217
1272static __inline__ __m256i __DEFAULT_FN_ATTRS2561218static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1273_mm256_maskz_subs_epu16(__mmask16 __U, __m256i __A, __m256i __B)1219_mm256_maskz_subs_epu16(__mmask16 __U, __m256i __A, __m256i __B)
1274{1220{
1275 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1221 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1277,89 +1223,81 @@ _mm256_maskz_subs_epu16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -1277,89 +1223,81 @@ _mm256_maskz_subs_epu16(__mmask16 __U, __m256i __A, __m256i __B)
1277 (__v16hi)_mm256_setzero_si256());1223 (__v16hi)_mm256_setzero_si256());
1278}1224}
12791225
1280static __inline__ __m128i __DEFAULT_FN_ATTRS1281226static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1281_mm_permutex2var_epi16(__m128i __A, __m128i __I, __m128i __B)1227_mm_permutex2var_epi16(__m128i __A, __m128i __I, __m128i __B) {
1282{
1283 return (__m128i)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,1228 return (__m128i)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,
1284 (__v8hi) __B);1229 (__v8hi) __B);
1285}1230}
12861231
1287static __inline__ __m128i __DEFAULT_FN_ATTRS1281232static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1288_mm_mask_permutex2var_epi16(__m128i __A, __mmask8 __U, __m128i __I,1233_mm_mask_permutex2var_epi16(__m128i __A, __mmask8 __U, __m128i __I,
1289 __m128i __B)1234 __m128i __B) {
1290{
1291 return (__m128i)__builtin_ia32_selectw_128(__U,1235 return (__m128i)__builtin_ia32_selectw_128(__U,
1292 (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),1236 (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),
1293 (__v8hi)__A);1237 (__v8hi)__A);
1294}1238}
12951239
1296static __inline__ __m128i __DEFAULT_FN_ATTRS1281240static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1297_mm_mask2_permutex2var_epi16(__m128i __A, __m128i __I, __mmask8 __U,1241_mm_mask2_permutex2var_epi16(__m128i __A, __m128i __I, __mmask8 __U,
1298 __m128i __B)1242 __m128i __B) {
1299{
1300 return (__m128i)__builtin_ia32_selectw_128(__U,1243 return (__m128i)__builtin_ia32_selectw_128(__U,
1301 (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),1244 (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),
1302 (__v8hi)__I);1245 (__v8hi)__I);
1303}1246}
13041247
1305static __inline__ __m128i __DEFAULT_FN_ATTRS1281248static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1306_mm_maskz_permutex2var_epi16 (__mmask8 __U, __m128i __A, __m128i __I,1249_mm_maskz_permutex2var_epi16(__mmask8 __U, __m128i __A, __m128i __I,
1307 __m128i __B)1250 __m128i __B) {
1308{
1309 return (__m128i)__builtin_ia32_selectw_128(__U,1251 return (__m128i)__builtin_ia32_selectw_128(__U,
1310 (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),1252 (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),
1311 (__v8hi)_mm_setzero_si128());1253 (__v8hi)_mm_setzero_si128());
1312}1254}
13131255
1314static __inline__ __m256i __DEFAULT_FN_ATTRS2561256static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1315_mm256_permutex2var_epi16(__m256i __A, __m256i __I, __m256i __B)1257_mm256_permutex2var_epi16(__m256i __A, __m256i __I, __m256i __B) {
1316{
1317 return (__m256i)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,1258 return (__m256i)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,
1318 (__v16hi)__B);1259 (__v16hi)__B);
1319}1260}
13201261
1321static __inline__ __m256i __DEFAULT_FN_ATTRS2561262static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1322_mm256_mask_permutex2var_epi16(__m256i __A, __mmask16 __U, __m256i __I,1263_mm256_mask_permutex2var_epi16(__m256i __A, __mmask16 __U, __m256i __I,
1323 __m256i __B)1264 __m256i __B) {
1324{
1325 return (__m256i)__builtin_ia32_selectw_256(__U,1265 return (__m256i)__builtin_ia32_selectw_256(__U,
1326 (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),1266 (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),
1327 (__v16hi)__A);1267 (__v16hi)__A);
1328}1268}
13291269
1330static __inline__ __m256i __DEFAULT_FN_ATTRS2561270static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1331_mm256_mask2_permutex2var_epi16(__m256i __A, __m256i __I, __mmask16 __U,1271_mm256_mask2_permutex2var_epi16(__m256i __A, __m256i __I, __mmask16 __U,
1332 __m256i __B)1272 __m256i __B) {
1333{
1334 return (__m256i)__builtin_ia32_selectw_256(__U,1273 return (__m256i)__builtin_ia32_selectw_256(__U,
1335 (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),1274 (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),
1336 (__v16hi)__I);1275 (__v16hi)__I);
1337}1276}
13381277
1339static __inline__ __m256i __DEFAULT_FN_ATTRS2561278static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1340_mm256_maskz_permutex2var_epi16 (__mmask16 __U, __m256i __A, __m256i __I,1279_mm256_maskz_permutex2var_epi16(__mmask16 __U, __m256i __A, __m256i __I,
1341 __m256i __B)1280 __m256i __B) {
1342{
1343 return (__m256i)__builtin_ia32_selectw_256(__U,1281 return (__m256i)__builtin_ia32_selectw_256(__U,
1344 (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),1282 (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),
1345 (__v16hi)_mm256_setzero_si256());1283 (__v16hi)_mm256_setzero_si256());
1346}1284}
13471285
1348static __inline__ __m128i __DEFAULT_FN_ATTRS1281286static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1349_mm_mask_maddubs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) {1287_mm_mask_maddubs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) {
1350 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1288 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1351 (__v8hi)_mm_maddubs_epi16(__X, __Y),1289 (__v8hi)_mm_maddubs_epi16(__X, __Y),
1352 (__v8hi)__W);1290 (__v8hi)__W);
1353}1291}
13541292
1355static __inline__ __m128i __DEFAULT_FN_ATTRS1281293static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1356_mm_maskz_maddubs_epi16(__mmask8 __U, __m128i __X, __m128i __Y) {1294_mm_maskz_maddubs_epi16(__mmask8 __U, __m128i __X, __m128i __Y) {
1357 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1295 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1358 (__v8hi)_mm_maddubs_epi16(__X, __Y),1296 (__v8hi)_mm_maddubs_epi16(__X, __Y),
1359 (__v8hi)_mm_setzero_si128());1297 (__v8hi)_mm_setzero_si128());
1360}1298}
13611299
1362static __inline__ __m256i __DEFAULT_FN_ATTRS2561300static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1363_mm256_mask_maddubs_epi16(__m256i __W, __mmask16 __U, __m256i __X,1301_mm256_mask_maddubs_epi16(__m256i __W, __mmask16 __U, __m256i __X,
1364 __m256i __Y) {1302 __m256i __Y) {
1365 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1303 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1367,35 +1305,35 @@ _mm256_mask_maddubs_epi16(__m256i __W, __mmask16 __U, __m256i __X,...@@ -1367,35 +1305,35 @@ _mm256_mask_maddubs_epi16(__m256i __W, __mmask16 __U, __m256i __X,
1367 (__v16hi)__W);1305 (__v16hi)__W);
1368}1306}
13691307
1370static __inline__ __m256i __DEFAULT_FN_ATTRS2561308static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1371_mm256_maskz_maddubs_epi16(__mmask16 __U, __m256i __X, __m256i __Y) {1309_mm256_maskz_maddubs_epi16(__mmask16 __U, __m256i __X, __m256i __Y) {
1372 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1310 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1373 (__v16hi)_mm256_maddubs_epi16(__X, __Y),1311 (__v16hi)_mm256_maddubs_epi16(__X, __Y),
1374 (__v16hi)_mm256_setzero_si256());1312 (__v16hi)_mm256_setzero_si256());
1375}1313}
13761314
1377static __inline__ __m128i __DEFAULT_FN_ATTRS1281315static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1378_mm_mask_madd_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {1316_mm_mask_madd_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
1379 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,1317 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
1380 (__v4si)_mm_madd_epi16(__A, __B),1318 (__v4si)_mm_madd_epi16(__A, __B),
1381 (__v4si)__W);1319 (__v4si)__W);
1382}1320}
13831321
1384static __inline__ __m128i __DEFAULT_FN_ATTRS1281322static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1385_mm_maskz_madd_epi16(__mmask8 __U, __m128i __A, __m128i __B) {1323_mm_maskz_madd_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
1386 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,1324 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
1387 (__v4si)_mm_madd_epi16(__A, __B),1325 (__v4si)_mm_madd_epi16(__A, __B),
1388 (__v4si)_mm_setzero_si128());1326 (__v4si)_mm_setzero_si128());
1389}1327}
13901328
1391static __inline__ __m256i __DEFAULT_FN_ATTRS2561329static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1392_mm256_mask_madd_epi16(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {1330_mm256_mask_madd_epi16(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {
1393 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,1331 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
1394 (__v8si)_mm256_madd_epi16(__A, __B),1332 (__v8si)_mm256_madd_epi16(__A, __B),
1395 (__v8si)__W);1333 (__v8si)__W);
1396}1334}
13971335
1398static __inline__ __m256i __DEFAULT_FN_ATTRS2561336static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1399_mm256_maskz_madd_epi16(__mmask8 __U, __m256i __A, __m256i __B) {1337_mm256_maskz_madd_epi16(__mmask8 __U, __m256i __A, __m256i __B) {
1400 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,1338 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
1401 (__v8si)_mm256_madd_epi16(__A, __B),1339 (__v8si)_mm256_madd_epi16(__A, __B),
...@@ -1486,8 +1424,8 @@ _mm256_maskz_cvtusepi16_epi8 (__mmask16 __M, __m256i __A) {...@@ -1486,8 +1424,8 @@ _mm256_maskz_cvtusepi16_epi8 (__mmask16 __M, __m256i __A) {
1486 __M);1424 __M);
1487}1425}
14881426
1489static __inline__ __m128i __DEFAULT_FN_ATTRS1281427static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1490_mm_cvtepi16_epi8 (__m128i __A) {1428_mm_cvtepi16_epi8(__m128i __A) {
1491 return (__m128i)__builtin_shufflevector(1429 return (__m128i)__builtin_shufflevector(
1492 __builtin_convertvector((__v8hi)__A, __v8qi),1430 __builtin_convertvector((__v8hi)__A, __v8qi),
1493 (__v8qi){0, 0, 0, 0, 0, 0, 0, 0}, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,1431 (__v8qi){0, 0, 0, 0, 0, 0, 0, 0}, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
...@@ -1527,20 +1465,20 @@ _mm_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A)...@@ -1527,20 +1465,20 @@ _mm_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A)
1527 __builtin_ia32_pmovuswb128mem_mask ((__v16qi *) __P, (__v8hi) __A, __M);1465 __builtin_ia32_pmovuswb128mem_mask ((__v16qi *) __P, (__v8hi) __A, __M);
1528}1466}
15291467
1530static __inline__ __m128i __DEFAULT_FN_ATTRS2561468static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
1531_mm256_cvtepi16_epi8 (__m256i __A) {1469_mm256_cvtepi16_epi8(__m256i __A) {
1532 return (__m128i)__builtin_convertvector((__v16hi) __A, __v16qi);1470 return (__m128i)__builtin_convertvector((__v16hi) __A, __v16qi);
1533}1471}
15341472
1535static __inline__ __m128i __DEFAULT_FN_ATTRS2561473static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
1536_mm256_mask_cvtepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) {1474_mm256_mask_cvtepi16_epi8(__m128i __O, __mmask16 __M, __m256i __A) {
1537 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,1475 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
1538 (__v16qi)_mm256_cvtepi16_epi8(__A),1476 (__v16qi)_mm256_cvtepi16_epi8(__A),
1539 (__v16qi)__O);1477 (__v16qi)__O);
1540}1478}
15411479
1542static __inline__ __m128i __DEFAULT_FN_ATTRS2561480static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
1543_mm256_maskz_cvtepi16_epi8 (__mmask16 __M, __m256i __A) {1481_mm256_maskz_cvtepi16_epi8(__mmask16 __M, __m256i __A) {
1544 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,1482 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
1545 (__v16qi)_mm256_cvtepi16_epi8(__A),1483 (__v16qi)_mm256_cvtepi16_epi8(__A),
1546 (__v16qi)_mm_setzero_si128());1484 (__v16qi)_mm_setzero_si128());
...@@ -1564,203 +1502,198 @@ _mm256_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask16 __M, __m256i __A)...@@ -1564,203 +1502,198 @@ _mm256_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask16 __M, __m256i __A)
1564 __builtin_ia32_pmovuswb256mem_mask ((__v16qi*) __P, (__v16hi) __A, __M);1502 __builtin_ia32_pmovuswb256mem_mask ((__v16qi*) __P, (__v16hi) __A, __M);
1565}1503}
15661504
1567static __inline__ __m128i __DEFAULT_FN_ATTRS1281505static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1568_mm_mask_mulhrs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) {1506_mm_mask_mulhrs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) {
1569 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1507 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1570 (__v8hi)_mm_mulhrs_epi16(__X, __Y),1508 (__v8hi)_mm_mulhrs_epi16(__X, __Y),
1571 (__v8hi)__W);1509 (__v8hi)__W);
1572}1510}
15731511
1574static __inline__ __m128i __DEFAULT_FN_ATTRS1281512static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1575_mm_maskz_mulhrs_epi16(__mmask8 __U, __m128i __X, __m128i __Y) {1513_mm_maskz_mulhrs_epi16(__mmask8 __U, __m128i __X, __m128i __Y) {
1576 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1514 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1577 (__v8hi)_mm_mulhrs_epi16(__X, __Y),1515 (__v8hi)_mm_mulhrs_epi16(__X, __Y),
1578 (__v8hi)_mm_setzero_si128());1516 (__v8hi)_mm_setzero_si128());
1579}1517}
15801518
1581static __inline__ __m256i __DEFAULT_FN_ATTRS2561519static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1582_mm256_mask_mulhrs_epi16(__m256i __W, __mmask16 __U, __m256i __X, __m256i __Y) {1520_mm256_mask_mulhrs_epi16(__m256i __W, __mmask16 __U, __m256i __X, __m256i __Y) {
1583 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1521 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1584 (__v16hi)_mm256_mulhrs_epi16(__X, __Y),1522 (__v16hi)_mm256_mulhrs_epi16(__X, __Y),
1585 (__v16hi)__W);1523 (__v16hi)__W);
1586}1524}
15871525
1588static __inline__ __m256i __DEFAULT_FN_ATTRS2561526static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1589_mm256_maskz_mulhrs_epi16(__mmask16 __U, __m256i __X, __m256i __Y) {1527_mm256_maskz_mulhrs_epi16(__mmask16 __U, __m256i __X, __m256i __Y) {
1590 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1528 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1591 (__v16hi)_mm256_mulhrs_epi16(__X, __Y),1529 (__v16hi)_mm256_mulhrs_epi16(__X, __Y),
1592 (__v16hi)_mm256_setzero_si256());1530 (__v16hi)_mm256_setzero_si256());
1593}1531}
15941532
1595static __inline__ __m128i __DEFAULT_FN_ATTRS1281533static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1596_mm_mask_mulhi_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {1534_mm_mask_mulhi_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
1597 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1535 return (__m128i)__builtin_ia32_selectw_128(
1598 (__v8hi)_mm_mulhi_epu16(__A, __B),1536 (__mmask8)__U, (__v8hi)_mm_mulhi_epu16(__A, __B), (__v8hi)__W);
1599 (__v8hi)__W);
1600}1537}
16011538
1602static __inline__ __m128i __DEFAULT_FN_ATTRS1281539static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1603_mm_maskz_mulhi_epu16(__mmask8 __U, __m128i __A, __m128i __B) {1540_mm_maskz_mulhi_epu16(__mmask8 __U, __m128i __A, __m128i __B) {
1604 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1541 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1605 (__v8hi)_mm_mulhi_epu16(__A, __B),1542 (__v8hi)_mm_mulhi_epu16(__A, __B),
1606 (__v8hi)_mm_setzero_si128());1543 (__v8hi)_mm_setzero_si128());
1607}1544}
16081545
1609static __inline__ __m256i __DEFAULT_FN_ATTRS2561546static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1610_mm256_mask_mulhi_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {1547_mm256_mask_mulhi_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
1611 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1548 return (__m256i)__builtin_ia32_selectw_256(
1612 (__v16hi)_mm256_mulhi_epu16(__A, __B),1549 (__mmask16)__U, (__v16hi)_mm256_mulhi_epu16(__A, __B), (__v16hi)__W);
1613 (__v16hi)__W);
1614}1550}
16151551
1616static __inline__ __m256i __DEFAULT_FN_ATTRS2561552static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1617_mm256_maskz_mulhi_epu16(__mmask16 __U, __m256i __A, __m256i __B) {1553_mm256_maskz_mulhi_epu16(__mmask16 __U, __m256i __A, __m256i __B) {
1618 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1554 return (__m256i)__builtin_ia32_selectw_256(
1619 (__v16hi)_mm256_mulhi_epu16(__A, __B),1555 (__mmask16)__U, (__v16hi)_mm256_mulhi_epu16(__A, __B),
1620 (__v16hi)_mm256_setzero_si256());1556 (__v16hi)_mm256_setzero_si256());
1621}1557}
16221558
1623static __inline__ __m128i __DEFAULT_FN_ATTRS1281559static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1624_mm_mask_mulhi_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {1560_mm_mask_mulhi_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
1625 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1561 return (__m128i)__builtin_ia32_selectw_128(
1626 (__v8hi)_mm_mulhi_epi16(__A, __B),1562 (__mmask8)__U, (__v8hi)_mm_mulhi_epi16(__A, __B), (__v8hi)__W);
1627 (__v8hi)__W);
1628}1563}
16291564
1630static __inline__ __m128i __DEFAULT_FN_ATTRS1281565static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1631_mm_maskz_mulhi_epi16(__mmask8 __U, __m128i __A, __m128i __B) {1566_mm_maskz_mulhi_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
1632 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1567 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1633 (__v8hi)_mm_mulhi_epi16(__A, __B),1568 (__v8hi)_mm_mulhi_epi16(__A, __B),
1634 (__v8hi)_mm_setzero_si128());1569 (__v8hi)_mm_setzero_si128());
1635}1570}
16361571
1637static __inline__ __m256i __DEFAULT_FN_ATTRS2561572static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1638_mm256_mask_mulhi_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {1573_mm256_mask_mulhi_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
1639 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1574 return (__m256i)__builtin_ia32_selectw_256(
1640 (__v16hi)_mm256_mulhi_epi16(__A, __B),1575 (__mmask16)__U, (__v16hi)_mm256_mulhi_epi16(__A, __B), (__v16hi)__W);
1641 (__v16hi)__W);
1642}1576}
16431577
1644static __inline__ __m256i __DEFAULT_FN_ATTRS2561578static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1645_mm256_maskz_mulhi_epi16(__mmask16 __U, __m256i __A, __m256i __B) {1579_mm256_maskz_mulhi_epi16(__mmask16 __U, __m256i __A, __m256i __B) {
1646 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1580 return (__m256i)__builtin_ia32_selectw_256(
1647 (__v16hi)_mm256_mulhi_epi16(__A, __B),1581 (__mmask16)__U, (__v16hi)_mm256_mulhi_epi16(__A, __B),
1648 (__v16hi)_mm256_setzero_si256());1582 (__v16hi)_mm256_setzero_si256());
1649}1583}
16501584
1651static __inline__ __m128i __DEFAULT_FN_ATTRS1281585static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1652_mm_mask_unpackhi_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {1586_mm_mask_unpackhi_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {
1653 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1587 return (__m128i)__builtin_ia32_selectb_128(
1654 (__v16qi)_mm_unpackhi_epi8(__A, __B),1588 (__mmask16)__U, (__v16qi)_mm_unpackhi_epi8(__A, __B), (__v16qi)__W);
1655 (__v16qi)__W);
1656}1589}
16571590
1658static __inline__ __m128i __DEFAULT_FN_ATTRS1281591static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1659_mm_maskz_unpackhi_epi8(__mmask16 __U, __m128i __A, __m128i __B) {1592_mm_maskz_unpackhi_epi8(__mmask16 __U, __m128i __A, __m128i __B) {
1660 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1593 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
1661 (__v16qi)_mm_unpackhi_epi8(__A, __B),1594 (__v16qi)_mm_unpackhi_epi8(__A, __B),
1662 (__v16qi)_mm_setzero_si128());1595 (__v16qi)_mm_setzero_si128());
1663}1596}
16641597
1665static __inline__ __m256i __DEFAULT_FN_ATTRS2561598static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1666_mm256_mask_unpackhi_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {1599_mm256_mask_unpackhi_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {
1667 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1600 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
1668 (__v32qi)_mm256_unpackhi_epi8(__A, __B),1601 (__v32qi)_mm256_unpackhi_epi8(__A, __B),
1669 (__v32qi)__W);1602 (__v32qi)__W);
1670}1603}
16711604
1672static __inline__ __m256i __DEFAULT_FN_ATTRS2561605static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1673_mm256_maskz_unpackhi_epi8(__mmask32 __U, __m256i __A, __m256i __B) {1606_mm256_maskz_unpackhi_epi8(__mmask32 __U, __m256i __A, __m256i __B) {
1674 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1607 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
1675 (__v32qi)_mm256_unpackhi_epi8(__A, __B),1608 (__v32qi)_mm256_unpackhi_epi8(__A, __B),
1676 (__v32qi)_mm256_setzero_si256());1609 (__v32qi)_mm256_setzero_si256());
1677}1610}
16781611
1679static __inline__ __m128i __DEFAULT_FN_ATTRS1281612static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1680_mm_mask_unpackhi_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {1613_mm_mask_unpackhi_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
1681 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1614 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1682 (__v8hi)_mm_unpackhi_epi16(__A, __B),1615 (__v8hi)_mm_unpackhi_epi16(__A, __B),
1683 (__v8hi)__W);1616 (__v8hi)__W);
1684}1617}
16851618
1686static __inline__ __m128i __DEFAULT_FN_ATTRS1281619static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1687_mm_maskz_unpackhi_epi16(__mmask8 __U, __m128i __A, __m128i __B) {1620_mm_maskz_unpackhi_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
1688 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1621 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1689 (__v8hi)_mm_unpackhi_epi16(__A, __B),1622 (__v8hi)_mm_unpackhi_epi16(__A, __B),
1690 (__v8hi) _mm_setzero_si128());1623 (__v8hi) _mm_setzero_si128());
1691}1624}
16921625
1693static __inline__ __m256i __DEFAULT_FN_ATTRS2561626static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1694_mm256_mask_unpackhi_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {1627_mm256_mask_unpackhi_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
1695 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1628 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1696 (__v16hi)_mm256_unpackhi_epi16(__A, __B),1629 (__v16hi)_mm256_unpackhi_epi16(__A, __B),
1697 (__v16hi)__W);1630 (__v16hi)__W);
1698}1631}
16991632
1700static __inline__ __m256i __DEFAULT_FN_ATTRS2561633static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1701_mm256_maskz_unpackhi_epi16(__mmask16 __U, __m256i __A, __m256i __B) {1634_mm256_maskz_unpackhi_epi16(__mmask16 __U, __m256i __A, __m256i __B) {
1702 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1635 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1703 (__v16hi)_mm256_unpackhi_epi16(__A, __B),1636 (__v16hi)_mm256_unpackhi_epi16(__A, __B),
1704 (__v16hi)_mm256_setzero_si256());1637 (__v16hi)_mm256_setzero_si256());
1705}1638}
17061639
1707static __inline__ __m128i __DEFAULT_FN_ATTRS1281640static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1708_mm_mask_unpacklo_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {1641_mm_mask_unpacklo_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {
1709 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1642 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
1710 (__v16qi)_mm_unpacklo_epi8(__A, __B),1643 (__v16qi)_mm_unpacklo_epi8(__A, __B),
1711 (__v16qi)__W);1644 (__v16qi)__W);
1712}1645}
17131646
1714static __inline__ __m128i __DEFAULT_FN_ATTRS1281647static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1715_mm_maskz_unpacklo_epi8(__mmask16 __U, __m128i __A, __m128i __B) {1648_mm_maskz_unpacklo_epi8(__mmask16 __U, __m128i __A, __m128i __B) {
1716 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,1649 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
1717 (__v16qi)_mm_unpacklo_epi8(__A, __B),1650 (__v16qi)_mm_unpacklo_epi8(__A, __B),
1718 (__v16qi)_mm_setzero_si128());1651 (__v16qi)_mm_setzero_si128());
1719}1652}
17201653
1721static __inline__ __m256i __DEFAULT_FN_ATTRS2561654static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1722_mm256_mask_unpacklo_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {1655_mm256_mask_unpacklo_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {
1723 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1656 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
1724 (__v32qi)_mm256_unpacklo_epi8(__A, __B),1657 (__v32qi)_mm256_unpacklo_epi8(__A, __B),
1725 (__v32qi)__W);1658 (__v32qi)__W);
1726}1659}
17271660
1728static __inline__ __m256i __DEFAULT_FN_ATTRS2561661static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1729_mm256_maskz_unpacklo_epi8(__mmask32 __U, __m256i __A, __m256i __B) {1662_mm256_maskz_unpacklo_epi8(__mmask32 __U, __m256i __A, __m256i __B) {
1730 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,1663 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
1731 (__v32qi)_mm256_unpacklo_epi8(__A, __B),1664 (__v32qi)_mm256_unpacklo_epi8(__A, __B),
1732 (__v32qi)_mm256_setzero_si256());1665 (__v32qi)_mm256_setzero_si256());
1733}1666}
17341667
1735static __inline__ __m128i __DEFAULT_FN_ATTRS1281668static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1736_mm_mask_unpacklo_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {1669_mm_mask_unpacklo_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
1737 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1670 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1738 (__v8hi)_mm_unpacklo_epi16(__A, __B),1671 (__v8hi)_mm_unpacklo_epi16(__A, __B),
1739 (__v8hi)__W);1672 (__v8hi)__W);
1740}1673}
17411674
1742static __inline__ __m128i __DEFAULT_FN_ATTRS1281675static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1743_mm_maskz_unpacklo_epi16(__mmask8 __U, __m128i __A, __m128i __B) {1676_mm_maskz_unpacklo_epi16(__mmask8 __U, __m128i __A, __m128i __B) {
1744 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1677 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
1745 (__v8hi)_mm_unpacklo_epi16(__A, __B),1678 (__v8hi)_mm_unpacklo_epi16(__A, __B),
1746 (__v8hi) _mm_setzero_si128());1679 (__v8hi) _mm_setzero_si128());
1747}1680}
17481681
1749static __inline__ __m256i __DEFAULT_FN_ATTRS2561682static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1750_mm256_mask_unpacklo_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {1683_mm256_mask_unpacklo_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {
1751 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1684 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1752 (__v16hi)_mm256_unpacklo_epi16(__A, __B),1685 (__v16hi)_mm256_unpacklo_epi16(__A, __B),
1753 (__v16hi)__W);1686 (__v16hi)__W);
1754}1687}
17551688
1756static __inline__ __m256i __DEFAULT_FN_ATTRS2561689static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1757_mm256_maskz_unpacklo_epi16(__mmask16 __U, __m256i __A, __m256i __B) {1690_mm256_maskz_unpacklo_epi16(__mmask16 __U, __m256i __A, __m256i __B) {
1758 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1691 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1759 (__v16hi)_mm256_unpacklo_epi16(__A, __B),1692 (__v16hi)_mm256_unpacklo_epi16(__A, __B),
1760 (__v16hi)_mm256_setzero_si256());1693 (__v16hi)_mm256_setzero_si256());
1761}1694}
17621695
1763static __inline__ __m128i __DEFAULT_FN_ATTRS1281696static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1764_mm_mask_cvtepi8_epi16(__m128i __W, __mmask8 __U, __m128i __A)1697_mm_mask_cvtepi8_epi16(__m128i __W, __mmask8 __U, __m128i __A)
1765{1698{
1766 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1699 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1768,7 +1701,7 @@ _mm_mask_cvtepi8_epi16(__m128i __W, __mmask8 __U, __m128i __A)...@@ -1768,7 +1701,7 @@ _mm_mask_cvtepi8_epi16(__m128i __W, __mmask8 __U, __m128i __A)
1768 (__v8hi)__W);1701 (__v8hi)__W);
1769}1702}
17701703
1771static __inline__ __m128i __DEFAULT_FN_ATTRS1281704static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1772_mm_maskz_cvtepi8_epi16(__mmask8 __U, __m128i __A)1705_mm_maskz_cvtepi8_epi16(__mmask8 __U, __m128i __A)
1773{1706{
1774 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1707 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1776,7 +1709,7 @@ _mm_maskz_cvtepi8_epi16(__mmask8 __U, __m128i __A)...@@ -1776,7 +1709,7 @@ _mm_maskz_cvtepi8_epi16(__mmask8 __U, __m128i __A)
1776 (__v8hi)_mm_setzero_si128());1709 (__v8hi)_mm_setzero_si128());
1777}1710}
17781711
1779static __inline__ __m256i __DEFAULT_FN_ATTRS2561712static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1780_mm256_mask_cvtepi8_epi16(__m256i __W, __mmask16 __U, __m128i __A)1713_mm256_mask_cvtepi8_epi16(__m256i __W, __mmask16 __U, __m128i __A)
1781{1714{
1782 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1715 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1784,7 +1717,7 @@ _mm256_mask_cvtepi8_epi16(__m256i __W, __mmask16 __U, __m128i __A)...@@ -1784,7 +1717,7 @@ _mm256_mask_cvtepi8_epi16(__m256i __W, __mmask16 __U, __m128i __A)
1784 (__v16hi)__W);1717 (__v16hi)__W);
1785}1718}
17861719
1787static __inline__ __m256i __DEFAULT_FN_ATTRS2561720static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1788_mm256_maskz_cvtepi8_epi16(__mmask16 __U, __m128i __A)1721_mm256_maskz_cvtepi8_epi16(__mmask16 __U, __m128i __A)
1789{1722{
1790 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1723 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1793,7 +1726,7 @@ _mm256_maskz_cvtepi8_epi16(__mmask16 __U, __m128i __A)...@@ -1793,7 +1726,7 @@ _mm256_maskz_cvtepi8_epi16(__mmask16 __U, __m128i __A)
1793}1726}
17941727
17951728
1796static __inline__ __m128i __DEFAULT_FN_ATTRS1281729static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1797_mm_mask_cvtepu8_epi16(__m128i __W, __mmask8 __U, __m128i __A)1730_mm_mask_cvtepu8_epi16(__m128i __W, __mmask8 __U, __m128i __A)
1798{1731{
1799 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1732 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1801,7 +1734,7 @@ _mm_mask_cvtepu8_epi16(__m128i __W, __mmask8 __U, __m128i __A)...@@ -1801,7 +1734,7 @@ _mm_mask_cvtepu8_epi16(__m128i __W, __mmask8 __U, __m128i __A)
1801 (__v8hi)__W);1734 (__v8hi)__W);
1802}1735}
18031736
1804static __inline__ __m128i __DEFAULT_FN_ATTRS1281737static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1805_mm_maskz_cvtepu8_epi16(__mmask8 __U, __m128i __A)1738_mm_maskz_cvtepu8_epi16(__mmask8 __U, __m128i __A)
1806{1739{
1807 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1740 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1809,7 +1742,7 @@ _mm_maskz_cvtepu8_epi16(__mmask8 __U, __m128i __A)...@@ -1809,7 +1742,7 @@ _mm_maskz_cvtepu8_epi16(__mmask8 __U, __m128i __A)
1809 (__v8hi)_mm_setzero_si128());1742 (__v8hi)_mm_setzero_si128());
1810}1743}
18111744
1812static __inline__ __m256i __DEFAULT_FN_ATTRS2561745static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1813_mm256_mask_cvtepu8_epi16(__m256i __W, __mmask16 __U, __m128i __A)1746_mm256_mask_cvtepu8_epi16(__m256i __W, __mmask16 __U, __m128i __A)
1814{1747{
1815 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1748 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1817,7 +1750,7 @@ _mm256_mask_cvtepu8_epi16(__m256i __W, __mmask16 __U, __m128i __A)...@@ -1817,7 +1750,7 @@ _mm256_mask_cvtepu8_epi16(__m256i __W, __mmask16 __U, __m128i __A)
1817 (__v16hi)__W);1750 (__v16hi)__W);
1818}1751}
18191752
1820static __inline__ __m256i __DEFAULT_FN_ATTRS2561753static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1821_mm256_maskz_cvtepu8_epi16 (__mmask16 __U, __m128i __A)1754_mm256_maskz_cvtepu8_epi16 (__mmask16 __U, __m128i __A)
1822{1755{
1823 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1756 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1868,13 +1801,13 @@ _mm256_maskz_cvtepu8_epi16 (__mmask16 __U, __m128i __A)...@@ -1868,13 +1801,13 @@ _mm256_maskz_cvtepu8_epi16 (__mmask16 __U, __m128i __A)
1868 (imm)), \1801 (imm)), \
1869 (__v16hi)_mm256_setzero_si256()))1802 (__v16hi)_mm256_setzero_si256()))
18701803
1871static __inline__ __m256i __DEFAULT_FN_ATTRS2561804static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1872_mm256_sllv_epi16(__m256i __A, __m256i __B)1805_mm256_sllv_epi16(__m256i __A, __m256i __B)
1873{1806{
1874 return (__m256i)__builtin_ia32_psllv16hi((__v16hi)__A, (__v16hi)__B);1807 return (__m256i)__builtin_ia32_psllv16hi((__v16hi)__A, (__v16hi)__B);
1875}1808}
18761809
1877static __inline__ __m256i __DEFAULT_FN_ATTRS2561810static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1878_mm256_mask_sllv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)1811_mm256_mask_sllv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
1879{1812{
1880 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1813 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1882,7 +1815,7 @@ _mm256_mask_sllv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)...@@ -1882,7 +1815,7 @@ _mm256_mask_sllv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
1882 (__v16hi)__W);1815 (__v16hi)__W);
1883}1816}
18841817
1885static __inline__ __m256i __DEFAULT_FN_ATTRS2561818static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1886_mm256_maskz_sllv_epi16(__mmask16 __U, __m256i __A, __m256i __B)1819_mm256_maskz_sllv_epi16(__mmask16 __U, __m256i __A, __m256i __B)
1887{1820{
1888 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1821 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1890,13 +1823,13 @@ _mm256_maskz_sllv_epi16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -1890,13 +1823,13 @@ _mm256_maskz_sllv_epi16(__mmask16 __U, __m256i __A, __m256i __B)
1890 (__v16hi)_mm256_setzero_si256());1823 (__v16hi)_mm256_setzero_si256());
1891}1824}
18921825
1893static __inline__ __m128i __DEFAULT_FN_ATTRS1281826static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1894_mm_sllv_epi16(__m128i __A, __m128i __B)1827_mm_sllv_epi16(__m128i __A, __m128i __B)
1895{1828{
1896 return (__m128i)__builtin_ia32_psllv8hi((__v8hi)__A, (__v8hi)__B);1829 return (__m128i)__builtin_ia32_psllv8hi((__v8hi)__A, (__v8hi)__B);
1897}1830}
18981831
1899static __inline__ __m128i __DEFAULT_FN_ATTRS1281832static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1900_mm_mask_sllv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)1833_mm_mask_sllv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
1901{1834{
1902 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1835 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1904,7 +1837,7 @@ _mm_mask_sllv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -1904,7 +1837,7 @@ _mm_mask_sllv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
1904 (__v8hi)__W);1837 (__v8hi)__W);
1905}1838}
19061839
1907static __inline__ __m128i __DEFAULT_FN_ATTRS1281840static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1908_mm_maskz_sllv_epi16(__mmask8 __U, __m128i __A, __m128i __B)1841_mm_maskz_sllv_epi16(__mmask8 __U, __m128i __A, __m128i __B)
1909{1842{
1910 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1843 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1944,7 +1877,7 @@ _mm256_maskz_sll_epi16(__mmask16 __U, __m256i __A, __m128i __B)...@@ -1944,7 +1877,7 @@ _mm256_maskz_sll_epi16(__mmask16 __U, __m256i __A, __m128i __B)
1944 (__v16hi)_mm256_setzero_si256());1877 (__v16hi)_mm256_setzero_si256());
1945}1878}
19461879
1947static __inline__ __m128i __DEFAULT_FN_ATTRS1281880static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1948_mm_mask_slli_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B)1881_mm_mask_slli_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B)
1949{1882{
1950 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1883 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1952,7 +1885,7 @@ _mm_mask_slli_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B)...@@ -1952,7 +1885,7 @@ _mm_mask_slli_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B)
1952 (__v8hi)__W);1885 (__v8hi)__W);
1953}1886}
19541887
1955static __inline__ __m128i __DEFAULT_FN_ATTRS1281888static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1956_mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, unsigned int __B)1889_mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, unsigned int __B)
1957{1890{
1958 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1891 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -1960,30 +1893,28 @@ _mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, unsigned int __B)...@@ -1960,30 +1893,28 @@ _mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, unsigned int __B)
1960 (__v8hi)_mm_setzero_si128());1893 (__v8hi)_mm_setzero_si128());
1961}1894}
19621895
1963static __inline__ __m256i __DEFAULT_FN_ATTRS2561896static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1964_mm256_mask_slli_epi16(__m256i __W, __mmask16 __U, __m256i __A,1897_mm256_mask_slli_epi16(__m256i __W, __mmask16 __U, __m256i __A,
1965 unsigned int __B)1898 unsigned int __B) {
1966{
1967 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1899 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1968 (__v16hi)_mm256_slli_epi16(__A, (int)__B),1900 (__v16hi)_mm256_slli_epi16(__A, (int)__B),
1969 (__v16hi)__W);1901 (__v16hi)__W);
1970}1902}
19711903
1972static __inline__ __m256i __DEFAULT_FN_ATTRS2561904static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1973_mm256_maskz_slli_epi16(__mmask16 __U, __m256i __A, unsigned int __B)1905_mm256_maskz_slli_epi16(__mmask16 __U, __m256i __A, unsigned int __B) {
1974{
1975 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1906 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
1976 (__v16hi)_mm256_slli_epi16(__A, (int)__B),1907 (__v16hi)_mm256_slli_epi16(__A, (int)__B),
1977 (__v16hi)_mm256_setzero_si256());1908 (__v16hi)_mm256_setzero_si256());
1978}1909}
19791910
1980static __inline__ __m256i __DEFAULT_FN_ATTRS2561911static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1981_mm256_srlv_epi16(__m256i __A, __m256i __B)1912_mm256_srlv_epi16(__m256i __A, __m256i __B)
1982{1913{
1983 return (__m256i)__builtin_ia32_psrlv16hi((__v16hi)__A, (__v16hi)__B);1914 return (__m256i)__builtin_ia32_psrlv16hi((__v16hi)__A, (__v16hi)__B);
1984}1915}
19851916
1986static __inline__ __m256i __DEFAULT_FN_ATTRS2561917static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1987_mm256_mask_srlv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)1918_mm256_mask_srlv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
1988{1919{
1989 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1920 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1991,7 +1922,7 @@ _mm256_mask_srlv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)...@@ -1991,7 +1922,7 @@ _mm256_mask_srlv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
1991 (__v16hi)__W);1922 (__v16hi)__W);
1992}1923}
19931924
1994static __inline__ __m256i __DEFAULT_FN_ATTRS2561925static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1995_mm256_maskz_srlv_epi16(__mmask16 __U, __m256i __A, __m256i __B)1926_mm256_maskz_srlv_epi16(__mmask16 __U, __m256i __A, __m256i __B)
1996{1927{
1997 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1928 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -1999,13 +1930,13 @@ _mm256_maskz_srlv_epi16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -1999,13 +1930,13 @@ _mm256_maskz_srlv_epi16(__mmask16 __U, __m256i __A, __m256i __B)
1999 (__v16hi)_mm256_setzero_si256());1930 (__v16hi)_mm256_setzero_si256());
2000}1931}
20011932
2002static __inline__ __m128i __DEFAULT_FN_ATTRS1281933static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2003_mm_srlv_epi16(__m128i __A, __m128i __B)1934_mm_srlv_epi16(__m128i __A, __m128i __B)
2004{1935{
2005 return (__m128i)__builtin_ia32_psrlv8hi((__v8hi)__A, (__v8hi)__B);1936 return (__m128i)__builtin_ia32_psrlv8hi((__v8hi)__A, (__v8hi)__B);
2006}1937}
20071938
2008static __inline__ __m128i __DEFAULT_FN_ATTRS1281939static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2009_mm_mask_srlv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)1940_mm_mask_srlv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
2010{1941{
2011 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1942 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -2013,7 +1944,7 @@ _mm_mask_srlv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -2013,7 +1944,7 @@ _mm_mask_srlv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
2013 (__v8hi)__W);1944 (__v8hi)__W);
2014}1945}
20151946
2016static __inline__ __m128i __DEFAULT_FN_ATTRS1281947static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2017_mm_maskz_srlv_epi16(__mmask8 __U, __m128i __A, __m128i __B)1948_mm_maskz_srlv_epi16(__mmask8 __U, __m128i __A, __m128i __B)
2018{1949{
2019 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1950 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -2021,13 +1952,13 @@ _mm_maskz_srlv_epi16(__mmask8 __U, __m128i __A, __m128i __B)...@@ -2021,13 +1952,13 @@ _mm_maskz_srlv_epi16(__mmask8 __U, __m128i __A, __m128i __B)
2021 (__v8hi)_mm_setzero_si128());1952 (__v8hi)_mm_setzero_si128());
2022}1953}
20231954
2024static __inline__ __m256i __DEFAULT_FN_ATTRS2561955static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2025_mm256_srav_epi16(__m256i __A, __m256i __B)1956_mm256_srav_epi16(__m256i __A, __m256i __B)
2026{1957{
2027 return (__m256i)__builtin_ia32_psrav16hi((__v16hi)__A, (__v16hi)__B);1958 return (__m256i)__builtin_ia32_psrav16hi((__v16hi)__A, (__v16hi)__B);
2028}1959}
20291960
2030static __inline__ __m256i __DEFAULT_FN_ATTRS2561961static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2031_mm256_mask_srav_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)1962_mm256_mask_srav_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
2032{1963{
2033 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1964 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -2035,7 +1966,7 @@ _mm256_mask_srav_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)...@@ -2035,7 +1966,7 @@ _mm256_mask_srav_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B)
2035 (__v16hi)__W);1966 (__v16hi)__W);
2036}1967}
20371968
2038static __inline__ __m256i __DEFAULT_FN_ATTRS2561969static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2039_mm256_maskz_srav_epi16(__mmask16 __U, __m256i __A, __m256i __B)1970_mm256_maskz_srav_epi16(__mmask16 __U, __m256i __A, __m256i __B)
2040{1971{
2041 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,1972 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
...@@ -2043,13 +1974,13 @@ _mm256_maskz_srav_epi16(__mmask16 __U, __m256i __A, __m256i __B)...@@ -2043,13 +1974,13 @@ _mm256_maskz_srav_epi16(__mmask16 __U, __m256i __A, __m256i __B)
2043 (__v16hi)_mm256_setzero_si256());1974 (__v16hi)_mm256_setzero_si256());
2044}1975}
20451976
2046static __inline__ __m128i __DEFAULT_FN_ATTRS1281977static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2047_mm_srav_epi16(__m128i __A, __m128i __B)1978_mm_srav_epi16(__m128i __A, __m128i __B)
2048{1979{
2049 return (__m128i)__builtin_ia32_psrav8hi((__v8hi)__A, (__v8hi)__B);1980 return (__m128i)__builtin_ia32_psrav8hi((__v8hi)__A, (__v8hi)__B);
2050}1981}
20511982
2052static __inline__ __m128i __DEFAULT_FN_ATTRS1281983static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2053_mm_mask_srav_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)1984_mm_mask_srav_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
2054{1985{
2055 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1986 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -2057,7 +1988,7 @@ _mm_mask_srav_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -2057,7 +1988,7 @@ _mm_mask_srav_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
2057 (__v8hi)__W);1988 (__v8hi)__W);
2058}1989}
20591990
2060static __inline__ __m128i __DEFAULT_FN_ATTRS1281991static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2061_mm_maskz_srav_epi16(__mmask8 __U, __m128i __A, __m128i __B)1992_mm_maskz_srav_epi16(__mmask8 __U, __m128i __A, __m128i __B)
2062{1993{
2063 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,1994 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
...@@ -2097,34 +2028,30 @@ _mm256_maskz_sra_epi16(__mmask16 __U, __m256i __A, __m128i __B)...@@ -2097,34 +2028,30 @@ _mm256_maskz_sra_epi16(__mmask16 __U, __m256i __A, __m128i __B)
2097 (__v16hi)_mm256_setzero_si256());2028 (__v16hi)_mm256_setzero_si256());
2098}2029}
20992030
2100static __inline__ __m128i __DEFAULT_FN_ATTRS1282031static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2101_mm_mask_srai_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B)2032_mm_mask_srai_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) {
2102{
2103 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,2033 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
2104 (__v8hi)_mm_srai_epi16(__A, (int)__B),2034 (__v8hi)_mm_srai_epi16(__A, (int)__B),
2105 (__v8hi)__W);2035 (__v8hi)__W);
2106}2036}
21072037
2108static __inline__ __m128i __DEFAULT_FN_ATTRS1282038static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2109_mm_maskz_srai_epi16(__mmask8 __U, __m128i __A, unsigned int __B)2039_mm_maskz_srai_epi16(__mmask8 __U, __m128i __A, unsigned int __B) {
2110{
2111 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,2040 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
2112 (__v8hi)_mm_srai_epi16(__A, (int)__B),2041 (__v8hi)_mm_srai_epi16(__A, (int)__B),
2113 (__v8hi)_mm_setzero_si128());2042 (__v8hi)_mm_setzero_si128());
2114}2043}
21152044
2116static __inline__ __m256i __DEFAULT_FN_ATTRS2562045static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2117_mm256_mask_srai_epi16(__m256i __W, __mmask16 __U, __m256i __A,2046_mm256_mask_srai_epi16(__m256i __W, __mmask16 __U, __m256i __A,
2118 unsigned int __B)2047 unsigned int __B) {
2119{
2120 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,2048 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
2121 (__v16hi)_mm256_srai_epi16(__A, (int)__B),2049 (__v16hi)_mm256_srai_epi16(__A, (int)__B),
2122 (__v16hi)__W);2050 (__v16hi)__W);
2123}2051}
21242052
2125static __inline__ __m256i __DEFAULT_FN_ATTRS2562053static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2126_mm256_maskz_srai_epi16(__mmask16 __U, __m256i __A, unsigned int __B)2054_mm256_maskz_srai_epi16(__mmask16 __U, __m256i __A, unsigned int __B) {
2127{
2128 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,2055 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
2129 (__v16hi)_mm256_srai_epi16(__A, (int)__B),2056 (__v16hi)_mm256_srai_epi16(__A, (int)__B),
2130 (__v16hi)_mm256_setzero_si256());2057 (__v16hi)_mm256_setzero_si256());
...@@ -2162,104 +2089,91 @@ _mm256_maskz_srl_epi16(__mmask16 __U, __m256i __A, __m128i __B)...@@ -2162,104 +2089,91 @@ _mm256_maskz_srl_epi16(__mmask16 __U, __m256i __A, __m128i __B)
2162 (__v16hi)_mm256_setzero_si256());2089 (__v16hi)_mm256_setzero_si256());
2163}2090}
21642091
2165static __inline__ __m128i __DEFAULT_FN_ATTRS1282092static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2166_mm_mask_srli_epi16(__m128i __W, __mmask8 __U, __m128i __A, int __B)2093_mm_mask_srli_epi16(__m128i __W, __mmask8 __U, __m128i __A, int __B) {
2167{
2168 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,2094 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
2169 (__v8hi)_mm_srli_epi16(__A, __B),2095 (__v8hi)_mm_srli_epi16(__A, __B),
2170 (__v8hi)__W);2096 (__v8hi)__W);
2171}2097}
21722098
2173static __inline__ __m128i __DEFAULT_FN_ATTRS1282099static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2174_mm_maskz_srli_epi16 (__mmask8 __U, __m128i __A, int __B)2100_mm_maskz_srli_epi16(__mmask8 __U, __m128i __A, int __B) {
2175{
2176 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,2101 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U,
2177 (__v8hi)_mm_srli_epi16(__A, __B),2102 (__v8hi)_mm_srli_epi16(__A, __B),
2178 (__v8hi)_mm_setzero_si128());2103 (__v8hi)_mm_setzero_si128());
2179}2104}
21802105
2181static __inline__ __m256i __DEFAULT_FN_ATTRS2562106static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2182_mm256_mask_srli_epi16(__m256i __W, __mmask16 __U, __m256i __A, int __B)2107_mm256_mask_srli_epi16(__m256i __W, __mmask16 __U, __m256i __A, int __B) {
2183{
2184 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,2108 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
2185 (__v16hi)_mm256_srli_epi16(__A, __B),2109 (__v16hi)_mm256_srli_epi16(__A, __B),
2186 (__v16hi)__W);2110 (__v16hi)__W);
2187}2111}
21882112
2189static __inline__ __m256i __DEFAULT_FN_ATTRS2562113static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2190_mm256_maskz_srli_epi16(__mmask16 __U, __m256i __A, int __B)2114_mm256_maskz_srli_epi16(__mmask16 __U, __m256i __A, int __B) {
2191{
2192 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,2115 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U,
2193 (__v16hi)_mm256_srli_epi16(__A, __B),2116 (__v16hi)_mm256_srli_epi16(__A, __B),
2194 (__v16hi)_mm256_setzero_si256());2117 (__v16hi)_mm256_setzero_si256());
2195}2118}
21962119
2197static __inline__ __m128i __DEFAULT_FN_ATTRS1282120static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2198_mm_mask_mov_epi16 (__m128i __W, __mmask8 __U, __m128i __A)2121_mm_mask_mov_epi16(__m128i __W, __mmask8 __U, __m128i __A) {
2199{
2200 return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U,2122 return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U,
2201 (__v8hi) __A,2123 (__v8hi) __A,
2202 (__v8hi) __W);2124 (__v8hi) __W);
2203}2125}
22042126
2205static __inline__ __m128i __DEFAULT_FN_ATTRS1282127static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2206_mm_maskz_mov_epi16 (__mmask8 __U, __m128i __A)2128_mm_maskz_mov_epi16(__mmask8 __U, __m128i __A) {
2207{
2208 return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U,2129 return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U,
2209 (__v8hi) __A,2130 (__v8hi) __A,
2210 (__v8hi) _mm_setzero_si128 ());2131 (__v8hi) _mm_setzero_si128 ());
2211}2132}
22122133
2213static __inline__ __m256i __DEFAULT_FN_ATTRS2562134static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2214_mm256_mask_mov_epi16 (__m256i __W, __mmask16 __U, __m256i __A)2135_mm256_mask_mov_epi16(__m256i __W, __mmask16 __U, __m256i __A) {
2215{
2216 return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U,2136 return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U,
2217 (__v16hi) __A,2137 (__v16hi) __A,
2218 (__v16hi) __W);2138 (__v16hi) __W);
2219}2139}
22202140
2221static __inline__ __m256i __DEFAULT_FN_ATTRS2562141static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2222_mm256_maskz_mov_epi16 (__mmask16 __U, __m256i __A)2142_mm256_maskz_mov_epi16(__mmask16 __U, __m256i __A) {
2223{
2224 return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U,2143 return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U,
2225 (__v16hi) __A,2144 (__v16hi) __A,
2226 (__v16hi) _mm256_setzero_si256 ());2145 (__v16hi) _mm256_setzero_si256 ());
2227}2146}
22282147
2229static __inline__ __m128i __DEFAULT_FN_ATTRS1282148static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2230_mm_mask_mov_epi8 (__m128i __W, __mmask16 __U, __m128i __A)2149_mm_mask_mov_epi8(__m128i __W, __mmask16 __U, __m128i __A) {
2231{
2232 return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U,2150 return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U,
2233 (__v16qi) __A,2151 (__v16qi) __A,
2234 (__v16qi) __W);2152 (__v16qi) __W);
2235}2153}
22362154
2237static __inline__ __m128i __DEFAULT_FN_ATTRS1282155static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2238_mm_maskz_mov_epi8 (__mmask16 __U, __m128i __A)2156_mm_maskz_mov_epi8(__mmask16 __U, __m128i __A) {
2239{
2240 return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U,2157 return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U,
2241 (__v16qi) __A,2158 (__v16qi) __A,
2242 (__v16qi) _mm_setzero_si128 ());2159 (__v16qi) _mm_setzero_si128 ());
2243}2160}
22442161
2245static __inline__ __m256i __DEFAULT_FN_ATTRS2562162static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2246_mm256_mask_mov_epi8 (__m256i __W, __mmask32 __U, __m256i __A)2163_mm256_mask_mov_epi8(__m256i __W, __mmask32 __U, __m256i __A) {
2247{
2248 return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U,2164 return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U,
2249 (__v32qi) __A,2165 (__v32qi) __A,
2250 (__v32qi) __W);2166 (__v32qi) __W);
2251}2167}
22522168
2253static __inline__ __m256i __DEFAULT_FN_ATTRS2562169static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2254_mm256_maskz_mov_epi8 (__mmask32 __U, __m256i __A)2170_mm256_maskz_mov_epi8(__mmask32 __U, __m256i __A) {
2255{
2256 return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U,2171 return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U,
2257 (__v32qi) __A,2172 (__v32qi) __A,
2258 (__v32qi) _mm256_setzero_si256 ());2173 (__v32qi) _mm256_setzero_si256 ());
2259}2174}
22602175
22612176static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2262static __inline__ __m128i __DEFAULT_FN_ATTRS128
2263_mm_mask_set1_epi8 (__m128i __O, __mmask16 __M, char __A)2177_mm_mask_set1_epi8 (__m128i __O, __mmask16 __M, char __A)
2264{2178{
2265 return (__m128i) __builtin_ia32_selectb_128(__M,2179 return (__m128i) __builtin_ia32_selectb_128(__M,
...@@ -2267,7 +2181,7 @@ _mm_mask_set1_epi8 (__m128i __O, __mmask16 __M, char __A)...@@ -2267,7 +2181,7 @@ _mm_mask_set1_epi8 (__m128i __O, __mmask16 __M, char __A)
2267 (__v16qi) __O);2181 (__v16qi) __O);
2268}2182}
22692183
2270static __inline__ __m128i __DEFAULT_FN_ATTRS1282184static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2271_mm_maskz_set1_epi8 (__mmask16 __M, char __A)2185_mm_maskz_set1_epi8 (__mmask16 __M, char __A)
2272{2186{
2273 return (__m128i) __builtin_ia32_selectb_128(__M,2187 return (__m128i) __builtin_ia32_selectb_128(__M,
...@@ -2275,7 +2189,7 @@ _mm_maskz_set1_epi8 (__mmask16 __M, char __A)...@@ -2275,7 +2189,7 @@ _mm_maskz_set1_epi8 (__mmask16 __M, char __A)
2275 (__v16qi) _mm_setzero_si128());2189 (__v16qi) _mm_setzero_si128());
2276}2190}
22772191
2278static __inline__ __m256i __DEFAULT_FN_ATTRS2562192static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2279_mm256_mask_set1_epi8 (__m256i __O, __mmask32 __M, char __A)2193_mm256_mask_set1_epi8 (__m256i __O, __mmask32 __M, char __A)
2280{2194{
2281 return (__m256i) __builtin_ia32_selectb_256(__M,2195 return (__m256i) __builtin_ia32_selectb_256(__M,
...@@ -2283,7 +2197,7 @@ _mm256_mask_set1_epi8 (__m256i __O, __mmask32 __M, char __A)...@@ -2283,7 +2197,7 @@ _mm256_mask_set1_epi8 (__m256i __O, __mmask32 __M, char __A)
2283 (__v32qi) __O);2197 (__v32qi) __O);
2284}2198}
22852199
2286static __inline__ __m256i __DEFAULT_FN_ATTRS2562200static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2287_mm256_maskz_set1_epi8 (__mmask32 __M, char __A)2201_mm256_maskz_set1_epi8 (__mmask32 __M, char __A)
2288{2202{
2289 return (__m256i) __builtin_ia32_selectb_256(__M,2203 return (__m256i) __builtin_ia32_selectb_256(__M,
...@@ -2463,22 +2377,19 @@ _mm256_mask_storeu_epi8 (void *__P, __mmask32 __U, __m256i __A)...@@ -2463,22 +2377,19 @@ _mm256_mask_storeu_epi8 (void *__P, __mmask32 __U, __m256i __A)
2463 (__mmask32) __U);2377 (__mmask32) __U);
2464}2378}
24652379
2466static __inline__ __mmask16 __DEFAULT_FN_ATTRS1282380static __inline__ __mmask16 __DEFAULT_FN_ATTRS128_CONSTEXPR
2467_mm_test_epi8_mask (__m128i __A, __m128i __B)2381_mm_test_epi8_mask(__m128i __A, __m128i __B) {
2468{
2469 return _mm_cmpneq_epi8_mask (_mm_and_si128(__A, __B), _mm_setzero_si128());2382 return _mm_cmpneq_epi8_mask (_mm_and_si128(__A, __B), _mm_setzero_si128());
2470}2383}
24712384
2472static __inline__ __mmask16 __DEFAULT_FN_ATTRS1282385static __inline__ __mmask16 __DEFAULT_FN_ATTRS128_CONSTEXPR
2473_mm_mask_test_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B)2386_mm_mask_test_epi8_mask(__mmask16 __U, __m128i __A, __m128i __B) {
2474{
2475 return _mm_mask_cmpneq_epi8_mask (__U, _mm_and_si128 (__A, __B),2387 return _mm_mask_cmpneq_epi8_mask (__U, _mm_and_si128 (__A, __B),
2476 _mm_setzero_si128());2388 _mm_setzero_si128());
2477}2389}
24782390
2479static __inline__ __mmask32 __DEFAULT_FN_ATTRS2562391static __inline__ __mmask32 __DEFAULT_FN_ATTRS256_CONSTEXPR
2480_mm256_test_epi8_mask (__m256i __A, __m256i __B)2392_mm256_test_epi8_mask(__m256i __A, __m256i __B) {
2481{
2482 return _mm256_cmpneq_epi8_mask (_mm256_and_si256(__A, __B),2393 return _mm256_cmpneq_epi8_mask (_mm256_and_si256(__A, __B),
2483 _mm256_setzero_si256());2394 _mm256_setzero_si256());
2484}2395}
...@@ -2517,9 +2428,8 @@ _mm256_mask_test_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B)...@@ -2517,9 +2428,8 @@ _mm256_mask_test_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B)
2517 _mm256_setzero_si256());2428 _mm256_setzero_si256());
2518}2429}
25192430
2520static __inline__ __mmask16 __DEFAULT_FN_ATTRS1282431static __inline__ __mmask16 __DEFAULT_FN_ATTRS128_CONSTEXPR
2521_mm_testn_epi8_mask (__m128i __A, __m128i __B)2432_mm_testn_epi8_mask(__m128i __A, __m128i __B) {
2522{
2523 return _mm_cmpeq_epi8_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());2433 return _mm_cmpeq_epi8_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
2524}2434}
25252435
...@@ -2570,55 +2480,47 @@ _mm256_mask_testn_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B)...@@ -2570,55 +2480,47 @@ _mm256_mask_testn_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B)
2570 _mm256_setzero_si256());2480 _mm256_setzero_si256());
2571}2481}
25722482
2573static __inline__ __mmask16 __DEFAULT_FN_ATTRS1282483static __inline__ __mmask16 __DEFAULT_FN_ATTRS128_CONSTEXPR
2574_mm_movepi8_mask (__m128i __A)2484_mm_movepi8_mask(__m128i __A) {
2575{
2576 return (__mmask16) __builtin_ia32_cvtb2mask128 ((__v16qi) __A);2485 return (__mmask16) __builtin_ia32_cvtb2mask128 ((__v16qi) __A);
2577}2486}
25782487
2579static __inline__ __mmask32 __DEFAULT_FN_ATTRS2562488static __inline__ __mmask32 __DEFAULT_FN_ATTRS256_CONSTEXPR
2580_mm256_movepi8_mask (__m256i __A)2489_mm256_movepi8_mask(__m256i __A) {
2581{
2582 return (__mmask32) __builtin_ia32_cvtb2mask256 ((__v32qi) __A);2490 return (__mmask32) __builtin_ia32_cvtb2mask256 ((__v32qi) __A);
2583}2491}
25842492
2585static __inline__ __mmask8 __DEFAULT_FN_ATTRS1282493static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
2586_mm_movepi16_mask (__m128i __A)2494_mm_movepi16_mask(__m128i __A) {
2587{
2588 return (__mmask8) __builtin_ia32_cvtw2mask128 ((__v8hi) __A);2495 return (__mmask8) __builtin_ia32_cvtw2mask128 ((__v8hi) __A);
2589}2496}
25902497
2591static __inline__ __mmask16 __DEFAULT_FN_ATTRS2562498static __inline__ __mmask16 __DEFAULT_FN_ATTRS256_CONSTEXPR
2592_mm256_movepi16_mask (__m256i __A)2499_mm256_movepi16_mask(__m256i __A) {
2593{
2594 return (__mmask16) __builtin_ia32_cvtw2mask256 ((__v16hi) __A);2500 return (__mmask16) __builtin_ia32_cvtw2mask256 ((__v16hi) __A);
2595}2501}
25962502
2597static __inline__ __m128i __DEFAULT_FN_ATTRS1282503static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2598_mm_movm_epi8 (__mmask16 __A)2504_mm_movm_epi8(__mmask16 __A) {
2599{
2600 return (__m128i) __builtin_ia32_cvtmask2b128 (__A);2505 return (__m128i) __builtin_ia32_cvtmask2b128 (__A);
2601}2506}
26022507
2603static __inline__ __m256i __DEFAULT_FN_ATTRS2562508static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2604_mm256_movm_epi8 (__mmask32 __A)2509_mm256_movm_epi8(__mmask32 __A) {
2605{
2606 return (__m256i) __builtin_ia32_cvtmask2b256 (__A);2510 return (__m256i) __builtin_ia32_cvtmask2b256 (__A);
2607}2511}
26082512
2609static __inline__ __m128i __DEFAULT_FN_ATTRS1282513static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2610_mm_movm_epi16 (__mmask8 __A)2514_mm_movm_epi16(__mmask8 __A) {
2611{
2612 return (__m128i) __builtin_ia32_cvtmask2w128 (__A);2515 return (__m128i) __builtin_ia32_cvtmask2w128 (__A);
2613}2516}
26142517
2615static __inline__ __m256i __DEFAULT_FN_ATTRS2562518static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2616_mm256_movm_epi16 (__mmask16 __A)2519_mm256_movm_epi16(__mmask16 __A) {
2617{
2618 return (__m256i) __builtin_ia32_cvtmask2w256 (__A);2520 return (__m256i) __builtin_ia32_cvtmask2w256 (__A);
2619}2521}
26202522
2621static __inline__ __m128i __DEFAULT_FN_ATTRS1282523static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2622_mm_mask_broadcastb_epi8 (__m128i __O, __mmask16 __M, __m128i __A)2524_mm_mask_broadcastb_epi8 (__m128i __O, __mmask16 __M, __m128i __A)
2623{2525{
2624 return (__m128i)__builtin_ia32_selectb_128(__M,2526 return (__m128i)__builtin_ia32_selectb_128(__M,
...@@ -2626,7 +2528,7 @@ _mm_mask_broadcastb_epi8 (__m128i __O, __mmask16 __M, __m128i __A)...@@ -2626,7 +2528,7 @@ _mm_mask_broadcastb_epi8 (__m128i __O, __mmask16 __M, __m128i __A)
2626 (__v16qi) __O);2528 (__v16qi) __O);
2627}2529}
26282530
2629static __inline__ __m128i __DEFAULT_FN_ATTRS1282531static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2630_mm_maskz_broadcastb_epi8 (__mmask16 __M, __m128i __A)2532_mm_maskz_broadcastb_epi8 (__mmask16 __M, __m128i __A)
2631{2533{
2632 return (__m128i)__builtin_ia32_selectb_128(__M,2534 return (__m128i)__builtin_ia32_selectb_128(__M,
...@@ -2634,7 +2536,7 @@ _mm_maskz_broadcastb_epi8 (__mmask16 __M, __m128i __A)...@@ -2634,7 +2536,7 @@ _mm_maskz_broadcastb_epi8 (__mmask16 __M, __m128i __A)
2634 (__v16qi) _mm_setzero_si128());2536 (__v16qi) _mm_setzero_si128());
2635}2537}
26362538
2637static __inline__ __m256i __DEFAULT_FN_ATTRS2562539static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2638_mm256_mask_broadcastb_epi8 (__m256i __O, __mmask32 __M, __m128i __A)2540_mm256_mask_broadcastb_epi8 (__m256i __O, __mmask32 __M, __m128i __A)
2639{2541{
2640 return (__m256i)__builtin_ia32_selectb_256(__M,2542 return (__m256i)__builtin_ia32_selectb_256(__M,
...@@ -2642,7 +2544,7 @@ _mm256_mask_broadcastb_epi8 (__m256i __O, __mmask32 __M, __m128i __A)...@@ -2642,7 +2544,7 @@ _mm256_mask_broadcastb_epi8 (__m256i __O, __mmask32 __M, __m128i __A)
2642 (__v32qi) __O);2544 (__v32qi) __O);
2643}2545}
26442546
2645static __inline__ __m256i __DEFAULT_FN_ATTRS2562547static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2646_mm256_maskz_broadcastb_epi8 (__mmask32 __M, __m128i __A)2548_mm256_maskz_broadcastb_epi8 (__mmask32 __M, __m128i __A)
2647{2549{
2648 return (__m256i)__builtin_ia32_selectb_256(__M,2550 return (__m256i)__builtin_ia32_selectb_256(__M,
...@@ -2650,7 +2552,7 @@ _mm256_maskz_broadcastb_epi8 (__mmask32 __M, __m128i __A)...@@ -2650,7 +2552,7 @@ _mm256_maskz_broadcastb_epi8 (__mmask32 __M, __m128i __A)
2650 (__v32qi) _mm256_setzero_si256());2552 (__v32qi) _mm256_setzero_si256());
2651}2553}
26522554
2653static __inline__ __m128i __DEFAULT_FN_ATTRS1282555static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2654_mm_mask_broadcastw_epi16 (__m128i __O, __mmask8 __M, __m128i __A)2556_mm_mask_broadcastw_epi16 (__m128i __O, __mmask8 __M, __m128i __A)
2655{2557{
2656 return (__m128i)__builtin_ia32_selectw_128(__M,2558 return (__m128i)__builtin_ia32_selectw_128(__M,
...@@ -2658,7 +2560,7 @@ _mm_mask_broadcastw_epi16 (__m128i __O, __mmask8 __M, __m128i __A)...@@ -2658,7 +2560,7 @@ _mm_mask_broadcastw_epi16 (__m128i __O, __mmask8 __M, __m128i __A)
2658 (__v8hi) __O);2560 (__v8hi) __O);
2659}2561}
26602562
2661static __inline__ __m128i __DEFAULT_FN_ATTRS1282563static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2662_mm_maskz_broadcastw_epi16 (__mmask8 __M, __m128i __A)2564_mm_maskz_broadcastw_epi16 (__mmask8 __M, __m128i __A)
2663{2565{
2664 return (__m128i)__builtin_ia32_selectw_128(__M,2566 return (__m128i)__builtin_ia32_selectw_128(__M,
...@@ -2666,7 +2568,7 @@ _mm_maskz_broadcastw_epi16 (__mmask8 __M, __m128i __A)...@@ -2666,7 +2568,7 @@ _mm_maskz_broadcastw_epi16 (__mmask8 __M, __m128i __A)
2666 (__v8hi) _mm_setzero_si128());2568 (__v8hi) _mm_setzero_si128());
2667}2569}
26682570
2669static __inline__ __m256i __DEFAULT_FN_ATTRS2562571static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2670_mm256_mask_broadcastw_epi16 (__m256i __O, __mmask16 __M, __m128i __A)2572_mm256_mask_broadcastw_epi16 (__m256i __O, __mmask16 __M, __m128i __A)
2671{2573{
2672 return (__m256i)__builtin_ia32_selectw_256(__M,2574 return (__m256i)__builtin_ia32_selectw_256(__M,
...@@ -2674,7 +2576,7 @@ _mm256_mask_broadcastw_epi16 (__m256i __O, __mmask16 __M, __m128i __A)...@@ -2674,7 +2576,7 @@ _mm256_mask_broadcastw_epi16 (__m256i __O, __mmask16 __M, __m128i __A)
2674 (__v16hi) __O);2576 (__v16hi) __O);
2675}2577}
26762578
2677static __inline__ __m256i __DEFAULT_FN_ATTRS2562579static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2678_mm256_maskz_broadcastw_epi16 (__mmask16 __M, __m128i __A)2580_mm256_maskz_broadcastw_epi16 (__mmask16 __M, __m128i __A)
2679{2581{
2680 return (__m256i)__builtin_ia32_selectw_256(__M,2582 return (__m256i)__builtin_ia32_selectw_256(__M,
...@@ -2682,7 +2584,7 @@ _mm256_maskz_broadcastw_epi16 (__mmask16 __M, __m128i __A)...@@ -2682,7 +2584,7 @@ _mm256_maskz_broadcastw_epi16 (__mmask16 __M, __m128i __A)
2682 (__v16hi) _mm256_setzero_si256());2584 (__v16hi) _mm256_setzero_si256());
2683}2585}
26842586
2685static __inline__ __m256i __DEFAULT_FN_ATTRS2562587static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2686_mm256_mask_set1_epi16 (__m256i __O, __mmask16 __M, short __A)2588_mm256_mask_set1_epi16 (__m256i __O, __mmask16 __M, short __A)
2687{2589{
2688 return (__m256i) __builtin_ia32_selectw_256 (__M,2590 return (__m256i) __builtin_ia32_selectw_256 (__M,
...@@ -2690,7 +2592,7 @@ _mm256_mask_set1_epi16 (__m256i __O, __mmask16 __M, short __A)...@@ -2690,7 +2592,7 @@ _mm256_mask_set1_epi16 (__m256i __O, __mmask16 __M, short __A)
2690 (__v16hi) __O);2592 (__v16hi) __O);
2691}2593}
26922594
2693static __inline__ __m256i __DEFAULT_FN_ATTRS2562595static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2694_mm256_maskz_set1_epi16 (__mmask16 __M, short __A)2596_mm256_maskz_set1_epi16 (__mmask16 __M, short __A)
2695{2597{
2696 return (__m256i) __builtin_ia32_selectw_256(__M,2598 return (__m256i) __builtin_ia32_selectw_256(__M,
...@@ -2698,7 +2600,7 @@ _mm256_maskz_set1_epi16 (__mmask16 __M, short __A)...@@ -2698,7 +2600,7 @@ _mm256_maskz_set1_epi16 (__mmask16 __M, short __A)
2698 (__v16hi) _mm256_setzero_si256());2600 (__v16hi) _mm256_setzero_si256());
2699}2601}
27002602
2701static __inline__ __m128i __DEFAULT_FN_ATTRS1282603static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2702_mm_mask_set1_epi16 (__m128i __O, __mmask8 __M, short __A)2604_mm_mask_set1_epi16 (__m128i __O, __mmask8 __M, short __A)
2703{2605{
2704 return (__m128i) __builtin_ia32_selectw_128(__M,2606 return (__m128i) __builtin_ia32_selectw_128(__M,
...@@ -2706,7 +2608,7 @@ _mm_mask_set1_epi16 (__m128i __O, __mmask8 __M, short __A)...@@ -2706,7 +2608,7 @@ _mm_mask_set1_epi16 (__m128i __O, __mmask8 __M, short __A)
2706 (__v8hi) __O);2608 (__v8hi) __O);
2707}2609}
27082610
2709static __inline__ __m128i __DEFAULT_FN_ATTRS1282611static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2710_mm_maskz_set1_epi16 (__mmask8 __M, short __A)2612_mm_maskz_set1_epi16 (__mmask8 __M, short __A)
2711{2613{
2712 return (__m128i) __builtin_ia32_selectw_128(__M,2614 return (__m128i) __builtin_ia32_selectw_128(__M,
...@@ -2714,48 +2616,41 @@ _mm_maskz_set1_epi16 (__mmask8 __M, short __A)...@@ -2714,48 +2616,41 @@ _mm_maskz_set1_epi16 (__mmask8 __M, short __A)
2714 (__v8hi) _mm_setzero_si128());2616 (__v8hi) _mm_setzero_si128());
2715}2617}
27162618
2717static __inline__ __m128i __DEFAULT_FN_ATTRS1282619static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2718_mm_permutexvar_epi16 (__m128i __A, __m128i __B)2620_mm_permutexvar_epi16(__m128i __A, __m128i __B) {
2719{
2720 return (__m128i)__builtin_ia32_permvarhi128((__v8hi) __B, (__v8hi) __A);2621 return (__m128i)__builtin_ia32_permvarhi128((__v8hi) __B, (__v8hi) __A);
2721}2622}
27222623
2723static __inline__ __m128i __DEFAULT_FN_ATTRS1282624static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2724_mm_maskz_permutexvar_epi16 (__mmask8 __M, __m128i __A, __m128i __B)2625_mm_maskz_permutexvar_epi16(__mmask8 __M, __m128i __A, __m128i __B) {
2725{
2726 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,2626 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
2727 (__v8hi)_mm_permutexvar_epi16(__A, __B),2627 (__v8hi)_mm_permutexvar_epi16(__A, __B),
2728 (__v8hi) _mm_setzero_si128());2628 (__v8hi) _mm_setzero_si128());
2729}2629}
27302630
2731static __inline__ __m128i __DEFAULT_FN_ATTRS1282631static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2732_mm_mask_permutexvar_epi16 (__m128i __W, __mmask8 __M, __m128i __A,2632_mm_mask_permutexvar_epi16(__m128i __W, __mmask8 __M, __m128i __A,
2733 __m128i __B)2633 __m128i __B) {
2734{
2735 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,2634 return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M,
2736 (__v8hi)_mm_permutexvar_epi16(__A, __B),2635 (__v8hi)_mm_permutexvar_epi16(__A, __B),
2737 (__v8hi)__W);2636 (__v8hi)__W);
2738}2637}
27392638
2740static __inline__ __m256i __DEFAULT_FN_ATTRS2562639static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2741_mm256_permutexvar_epi16 (__m256i __A, __m256i __B)2640_mm256_permutexvar_epi16(__m256i __A, __m256i __B) {
2742{
2743 return (__m256i)__builtin_ia32_permvarhi256((__v16hi) __B, (__v16hi) __A);2641 return (__m256i)__builtin_ia32_permvarhi256((__v16hi) __B, (__v16hi) __A);
2744}2642}
27452643
2746static __inline__ __m256i __DEFAULT_FN_ATTRS2562644static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2747_mm256_maskz_permutexvar_epi16 (__mmask16 __M, __m256i __A,2645_mm256_maskz_permutexvar_epi16(__mmask16 __M, __m256i __A, __m256i __B) {
2748 __m256i __B)
2749{
2750 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,2646 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
2751 (__v16hi)_mm256_permutexvar_epi16(__A, __B),2647 (__v16hi)_mm256_permutexvar_epi16(__A, __B),
2752 (__v16hi)_mm256_setzero_si256());2648 (__v16hi)_mm256_setzero_si256());
2753}2649}
27542650
2755static __inline__ __m256i __DEFAULT_FN_ATTRS2562651static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2756_mm256_mask_permutexvar_epi16 (__m256i __W, __mmask16 __M, __m256i __A,2652_mm256_mask_permutexvar_epi16(__m256i __W, __mmask16 __M, __m256i __A,
2757 __m256i __B)2653 __m256i __B) {
2758{
2759 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,2654 return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M,
2760 (__v16hi)_mm256_permutexvar_epi16(__A, __B),2655 (__v16hi)_mm256_permutexvar_epi16(__A, __B),
2761 (__v16hi)__W);2656 (__v16hi)__W);
...@@ -2809,353 +2704,353 @@ _mm256_mask_permutexvar_epi16 (__m256i __W, __mmask16 __M, __m256i __A,...@@ -2809,353 +2704,353 @@ _mm256_mask_permutexvar_epi16 (__m256i __W, __mmask16 __M, __m256i __A,
2809 (__v16hi)_mm256_dbsad_epu8((A), (B), (imm)), \2704 (__v16hi)_mm256_dbsad_epu8((A), (B), (imm)), \
2810 (__v16hi)_mm256_setzero_si256()))2705 (__v16hi)_mm256_setzero_si256()))
28112706
2812static __inline__ short __DEFAULT_FN_ATTRS1282707static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2813_mm_reduce_add_epi16(__m128i __W) {2708_mm_reduce_add_epi16(__m128i __W) {
2814 return __builtin_reduce_add((__v8hi)__W);2709 return __builtin_reduce_add((__v8hi)__W);
2815}2710}
28162711
2817static __inline__ short __DEFAULT_FN_ATTRS1282712static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2818_mm_reduce_mul_epi16(__m128i __W) {2713_mm_reduce_mul_epi16(__m128i __W) {
2819 return __builtin_reduce_mul((__v8hi)__W);2714 return __builtin_reduce_mul((__v8hi)__W);
2820}2715}
28212716
2822static __inline__ short __DEFAULT_FN_ATTRS1282717static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2823_mm_reduce_and_epi16(__m128i __W) {2718_mm_reduce_and_epi16(__m128i __W) {
2824 return __builtin_reduce_and((__v8hi)__W);2719 return __builtin_reduce_and((__v8hi)__W);
2825}2720}
28262721
2827static __inline__ short __DEFAULT_FN_ATTRS1282722static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2828_mm_reduce_or_epi16(__m128i __W) {2723_mm_reduce_or_epi16(__m128i __W) {
2829 return __builtin_reduce_or((__v8hi)__W);2724 return __builtin_reduce_or((__v8hi)__W);
2830}2725}
28312726
2832static __inline__ short __DEFAULT_FN_ATTRS1282727static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2833_mm_mask_reduce_add_epi16( __mmask8 __M, __m128i __W) {2728_mm_mask_reduce_add_epi16(__mmask8 __M, __m128i __W) {
2834 __W = _mm_maskz_mov_epi16(__M, __W);2729 __W = _mm_maskz_mov_epi16(__M, __W);
2835 return __builtin_reduce_add((__v8hi)__W);2730 return __builtin_reduce_add((__v8hi)__W);
2836}2731}
28372732
2838static __inline__ short __DEFAULT_FN_ATTRS1282733static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2839_mm_mask_reduce_mul_epi16( __mmask8 __M, __m128i __W) {2734_mm_mask_reduce_mul_epi16(__mmask8 __M, __m128i __W) {
2840 __W = _mm_mask_mov_epi16(_mm_set1_epi16(1), __M, __W);2735 __W = _mm_mask_mov_epi16(_mm_set1_epi16(1), __M, __W);
2841 return __builtin_reduce_mul((__v8hi)__W);2736 return __builtin_reduce_mul((__v8hi)__W);
2842}2737}
28432738
2844static __inline__ short __DEFAULT_FN_ATTRS1282739static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2845_mm_mask_reduce_and_epi16( __mmask8 __M, __m128i __W) {2740_mm_mask_reduce_and_epi16(__mmask8 __M, __m128i __W) {
2846 __W = _mm_mask_mov_epi16(_mm_set1_epi16(-1), __M, __W);2741 __W = _mm_mask_mov_epi16(_mm_set1_epi16(-1), __M, __W);
2847 return __builtin_reduce_and((__v8hi)__W);2742 return __builtin_reduce_and((__v8hi)__W);
2848}2743}
28492744
2850static __inline__ short __DEFAULT_FN_ATTRS1282745static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2851_mm_mask_reduce_or_epi16(__mmask8 __M, __m128i __W) {2746_mm_mask_reduce_or_epi16(__mmask8 __M, __m128i __W) {
2852 __W = _mm_maskz_mov_epi16(__M, __W);2747 __W = _mm_maskz_mov_epi16(__M, __W);
2853 return __builtin_reduce_or((__v8hi)__W);2748 return __builtin_reduce_or((__v8hi)__W);
2854}2749}
28552750
2856static __inline__ short __DEFAULT_FN_ATTRS1282751static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2857_mm_reduce_max_epi16(__m128i __V) {2752_mm_reduce_max_epi16(__m128i __V) {
2858 return __builtin_reduce_max((__v8hi)__V);2753 return __builtin_reduce_max((__v8hi)__V);
2859}2754}
28602755
2861static __inline__ unsigned short __DEFAULT_FN_ATTRS1282756static __inline__ unsigned short __DEFAULT_FN_ATTRS128_CONSTEXPR
2862_mm_reduce_max_epu16(__m128i __V) {2757_mm_reduce_max_epu16(__m128i __V) {
2863 return __builtin_reduce_max((__v8hu)__V);2758 return __builtin_reduce_max((__v8hu)__V);
2864}2759}
28652760
2866static __inline__ short __DEFAULT_FN_ATTRS1282761static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2867_mm_reduce_min_epi16(__m128i __V) {2762_mm_reduce_min_epi16(__m128i __V) {
2868 return __builtin_reduce_min((__v8hi)__V);2763 return __builtin_reduce_min((__v8hi)__V);
2869}2764}
28702765
2871static __inline__ unsigned short __DEFAULT_FN_ATTRS1282766static __inline__ unsigned short __DEFAULT_FN_ATTRS128_CONSTEXPR
2872_mm_reduce_min_epu16(__m128i __V) {2767_mm_reduce_min_epu16(__m128i __V) {
2873 return __builtin_reduce_min((__v8hu)__V);2768 return __builtin_reduce_min((__v8hu)__V);
2874}2769}
28752770
2876static __inline__ short __DEFAULT_FN_ATTRS1282771static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2877_mm_mask_reduce_max_epi16(__mmask16 __M, __m128i __V) {2772_mm_mask_reduce_max_epi16(__mmask16 __M, __m128i __V) {
2878 __V = _mm_mask_mov_epi16(_mm_set1_epi16(-32767-1), __M, __V);2773 __V = _mm_mask_mov_epi16(_mm_set1_epi16(-32767-1), __M, __V);
2879 return __builtin_reduce_max((__v8hi)__V);2774 return __builtin_reduce_max((__v8hi)__V);
2880}2775}
28812776
2882static __inline__ unsigned short __DEFAULT_FN_ATTRS1282777static __inline__ unsigned short __DEFAULT_FN_ATTRS128_CONSTEXPR
2883_mm_mask_reduce_max_epu16(__mmask16 __M, __m128i __V) {2778_mm_mask_reduce_max_epu16(__mmask16 __M, __m128i __V) {
2884 __V = _mm_maskz_mov_epi16(__M, __V);2779 __V = _mm_maskz_mov_epi16(__M, __V);
2885 return __builtin_reduce_max((__v8hu)__V);2780 return __builtin_reduce_max((__v8hu)__V);
2886}2781}
28872782
2888static __inline__ short __DEFAULT_FN_ATTRS1282783static __inline__ short __DEFAULT_FN_ATTRS128_CONSTEXPR
2889_mm_mask_reduce_min_epi16(__mmask16 __M, __m128i __V) {2784_mm_mask_reduce_min_epi16(__mmask16 __M, __m128i __V) {
2890 __V = _mm_mask_mov_epi16(_mm_set1_epi16(32767), __M, __V);2785 __V = _mm_mask_mov_epi16(_mm_set1_epi16(32767), __M, __V);
2891 return __builtin_reduce_min((__v8hi)__V);2786 return __builtin_reduce_min((__v8hi)__V);
2892}2787}
28932788
2894static __inline__ unsigned short __DEFAULT_FN_ATTRS1282789static __inline__ unsigned short __DEFAULT_FN_ATTRS128_CONSTEXPR
2895_mm_mask_reduce_min_epu16(__mmask16 __M, __m128i __V) {2790_mm_mask_reduce_min_epu16(__mmask16 __M, __m128i __V) {
2896 __V = _mm_mask_mov_epi16(_mm_set1_epi16(-1), __M, __V);2791 __V = _mm_mask_mov_epi16(_mm_set1_epi16(-1), __M, __V);
2897 return __builtin_reduce_min((__v8hu)__V);2792 return __builtin_reduce_min((__v8hu)__V);
2898}2793}
28992794
2900static __inline__ short __DEFAULT_FN_ATTRS2562795static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2901_mm256_reduce_add_epi16(__m256i __W) {2796_mm256_reduce_add_epi16(__m256i __W) {
2902 return __builtin_reduce_add((__v16hi)__W);2797 return __builtin_reduce_add((__v16hi)__W);
2903}2798}
29042799
2905static __inline__ short __DEFAULT_FN_ATTRS2562800static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2906_mm256_reduce_mul_epi16(__m256i __W) {2801_mm256_reduce_mul_epi16(__m256i __W) {
2907 return __builtin_reduce_mul((__v16hi)__W);2802 return __builtin_reduce_mul((__v16hi)__W);
2908}2803}
29092804
2910static __inline__ short __DEFAULT_FN_ATTRS2562805static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2911_mm256_reduce_and_epi16(__m256i __W) {2806_mm256_reduce_and_epi16(__m256i __W) {
2912 return __builtin_reduce_and((__v16hi)__W);2807 return __builtin_reduce_and((__v16hi)__W);
2913}2808}
29142809
2915static __inline__ short __DEFAULT_FN_ATTRS2562810static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2916_mm256_reduce_or_epi16(__m256i __W) {2811_mm256_reduce_or_epi16(__m256i __W) {
2917 return __builtin_reduce_or((__v16hi)__W);2812 return __builtin_reduce_or((__v16hi)__W);
2918}2813}
29192814
2920static __inline__ short __DEFAULT_FN_ATTRS2562815static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2921_mm256_mask_reduce_add_epi16( __mmask16 __M, __m256i __W) {2816_mm256_mask_reduce_add_epi16(__mmask16 __M, __m256i __W) {
2922 __W = _mm256_maskz_mov_epi16(__M, __W);2817 __W = _mm256_maskz_mov_epi16(__M, __W);
2923 return __builtin_reduce_add((__v16hi)__W);2818 return __builtin_reduce_add((__v16hi)__W);
2924}2819}
29252820
2926static __inline__ short __DEFAULT_FN_ATTRS2562821static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2927_mm256_mask_reduce_mul_epi16( __mmask16 __M, __m256i __W) {2822_mm256_mask_reduce_mul_epi16(__mmask16 __M, __m256i __W) {
2928 __W = _mm256_mask_mov_epi16(_mm256_set1_epi16(1), __M, __W);2823 __W = _mm256_mask_mov_epi16(_mm256_set1_epi16(1), __M, __W);
2929 return __builtin_reduce_mul((__v16hi)__W);2824 return __builtin_reduce_mul((__v16hi)__W);
2930}2825}
29312826
2932static __inline__ short __DEFAULT_FN_ATTRS2562827static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2933_mm256_mask_reduce_and_epi16( __mmask16 __M, __m256i __W) {2828_mm256_mask_reduce_and_epi16(__mmask16 __M, __m256i __W) {
2934 __W = _mm256_mask_mov_epi16(_mm256_set1_epi16(-1), __M, __W);2829 __W = _mm256_mask_mov_epi16(_mm256_set1_epi16(-1), __M, __W);
2935 return __builtin_reduce_and((__v16hi)__W);2830 return __builtin_reduce_and((__v16hi)__W);
2936}2831}
29372832
2938static __inline__ short __DEFAULT_FN_ATTRS2562833static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2939_mm256_mask_reduce_or_epi16(__mmask16 __M, __m256i __W) {2834_mm256_mask_reduce_or_epi16(__mmask16 __M, __m256i __W) {
2940 __W = _mm256_maskz_mov_epi16(__M, __W);2835 __W = _mm256_maskz_mov_epi16(__M, __W);
2941 return __builtin_reduce_or((__v16hi)__W);2836 return __builtin_reduce_or((__v16hi)__W);
2942}2837}
29432838
2944static __inline__ short __DEFAULT_FN_ATTRS2562839static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2945_mm256_reduce_max_epi16(__m256i __V) {2840_mm256_reduce_max_epi16(__m256i __V) {
2946 return __builtin_reduce_max((__v16hi)__V);2841 return __builtin_reduce_max((__v16hi)__V);
2947}2842}
29482843
2949static __inline__ unsigned short __DEFAULT_FN_ATTRS2562844static __inline__ unsigned short __DEFAULT_FN_ATTRS256_CONSTEXPR
2950_mm256_reduce_max_epu16(__m256i __V) {2845_mm256_reduce_max_epu16(__m256i __V) {
2951 return __builtin_reduce_max((__v16hu)__V);2846 return __builtin_reduce_max((__v16hu)__V);
2952}2847}
29532848
2954static __inline__ short __DEFAULT_FN_ATTRS2562849static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2955_mm256_reduce_min_epi16(__m256i __V) {2850_mm256_reduce_min_epi16(__m256i __V) {
2956 return __builtin_reduce_min((__v16hi)__V);2851 return __builtin_reduce_min((__v16hi)__V);
2957}2852}
29582853
2959static __inline__ unsigned short __DEFAULT_FN_ATTRS2562854static __inline__ unsigned short __DEFAULT_FN_ATTRS256_CONSTEXPR
2960_mm256_reduce_min_epu16(__m256i __V) {2855_mm256_reduce_min_epu16(__m256i __V) {
2961 return __builtin_reduce_min((__v16hu)__V);2856 return __builtin_reduce_min((__v16hu)__V);
2962}2857}
29632858
2964static __inline__ short __DEFAULT_FN_ATTRS2562859static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2965_mm256_mask_reduce_max_epi16(__mmask16 __M, __m256i __V) {2860_mm256_mask_reduce_max_epi16(__mmask16 __M, __m256i __V) {
2966 __V = _mm256_mask_mov_epi16(_mm256_set1_epi16(-32767-1), __M, __V);2861 __V = _mm256_mask_mov_epi16(_mm256_set1_epi16(-32767-1), __M, __V);
2967 return __builtin_reduce_max((__v16hi)__V);2862 return __builtin_reduce_max((__v16hi)__V);
2968}2863}
29692864
2970static __inline__ unsigned short __DEFAULT_FN_ATTRS2562865static __inline__ unsigned short __DEFAULT_FN_ATTRS256_CONSTEXPR
2971_mm256_mask_reduce_max_epu16(__mmask16 __M, __m256i __V) {2866_mm256_mask_reduce_max_epu16(__mmask16 __M, __m256i __V) {
2972 __V = _mm256_maskz_mov_epi16(__M, __V);2867 __V = _mm256_maskz_mov_epi16(__M, __V);
2973 return __builtin_reduce_max((__v16hu)__V);2868 return __builtin_reduce_max((__v16hu)__V);
2974}2869}
29752870
2976static __inline__ short __DEFAULT_FN_ATTRS2562871static __inline__ short __DEFAULT_FN_ATTRS256_CONSTEXPR
2977_mm256_mask_reduce_min_epi16(__mmask16 __M, __m256i __V) {2872_mm256_mask_reduce_min_epi16(__mmask16 __M, __m256i __V) {
2978 __V = _mm256_mask_mov_epi16(_mm256_set1_epi16(32767), __M, __V);2873 __V = _mm256_mask_mov_epi16(_mm256_set1_epi16(32767), __M, __V);
2979 return __builtin_reduce_min((__v16hi)__V);2874 return __builtin_reduce_min((__v16hi)__V);
2980}2875}
29812876
2982static __inline__ unsigned short __DEFAULT_FN_ATTRS2562877static __inline__ unsigned short __DEFAULT_FN_ATTRS256_CONSTEXPR
2983_mm256_mask_reduce_min_epu16(__mmask16 __M, __m256i __V) {2878_mm256_mask_reduce_min_epu16(__mmask16 __M, __m256i __V) {
2984 __V = _mm256_mask_mov_epi16(_mm256_set1_epi16(-1), __M, __V);2879 __V = _mm256_mask_mov_epi16(_mm256_set1_epi16(-1), __M, __V);
2985 return __builtin_reduce_min((__v16hu)__V);2880 return __builtin_reduce_min((__v16hu)__V);
2986}2881}
29872882
2988static __inline__ signed char __DEFAULT_FN_ATTRS1282883static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
2989_mm_reduce_add_epi8(__m128i __W) {2884_mm_reduce_add_epi8(__m128i __W) {
2990 return __builtin_reduce_add((__v16qs)__W);2885 return __builtin_reduce_add((__v16qs)__W);
2991}2886}
29922887
2993static __inline__ signed char __DEFAULT_FN_ATTRS1282888static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
2994_mm_reduce_mul_epi8(__m128i __W) {2889_mm_reduce_mul_epi8(__m128i __W) {
2995 return __builtin_reduce_mul((__v16qs)__W);2890 return __builtin_reduce_mul((__v16qs)__W);
2996}2891}
29972892
2998static __inline__ signed char __DEFAULT_FN_ATTRS1282893static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
2999_mm_reduce_and_epi8(__m128i __W) {2894_mm_reduce_and_epi8(__m128i __W) {
3000 return __builtin_reduce_and((__v16qs)__W);2895 return __builtin_reduce_and((__v16qs)__W);
3001}2896}
30022897
3003static __inline__ signed char __DEFAULT_FN_ATTRS1282898static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3004_mm_reduce_or_epi8(__m128i __W) {2899_mm_reduce_or_epi8(__m128i __W) {
3005 return __builtin_reduce_or((__v16qs)__W);2900 return __builtin_reduce_or((__v16qs)__W);
3006}2901}
30072902
3008static __inline__ signed char __DEFAULT_FN_ATTRS1282903static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3009_mm_mask_reduce_add_epi8(__mmask16 __M, __m128i __W) {2904_mm_mask_reduce_add_epi8(__mmask16 __M, __m128i __W) {
3010 __W = _mm_maskz_mov_epi8(__M, __W);2905 __W = _mm_maskz_mov_epi8(__M, __W);
3011 return __builtin_reduce_add((__v16qs)__W);2906 return __builtin_reduce_add((__v16qs)__W);
3012}2907}
30132908
3014static __inline__ signed char __DEFAULT_FN_ATTRS1282909static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3015_mm_mask_reduce_mul_epi8(__mmask16 __M, __m128i __W) {2910_mm_mask_reduce_mul_epi8(__mmask16 __M, __m128i __W) {
3016 __W = _mm_mask_mov_epi8(_mm_set1_epi8(1), __M, __W);2911 __W = _mm_mask_mov_epi8(_mm_set1_epi8(1), __M, __W);
3017 return __builtin_reduce_mul((__v16qs)__W);2912 return __builtin_reduce_mul((__v16qs)__W);
3018}2913}
30192914
3020static __inline__ signed char __DEFAULT_FN_ATTRS1282915static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3021_mm_mask_reduce_and_epi8(__mmask16 __M, __m128i __W) {2916_mm_mask_reduce_and_epi8(__mmask16 __M, __m128i __W) {
3022 __W = _mm_mask_mov_epi8(_mm_set1_epi8(-1), __M, __W);2917 __W = _mm_mask_mov_epi8(_mm_set1_epi8(-1), __M, __W);
3023 return __builtin_reduce_and((__v16qs)__W);2918 return __builtin_reduce_and((__v16qs)__W);
3024}2919}
30252920
3026static __inline__ signed char __DEFAULT_FN_ATTRS1282921static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3027_mm_mask_reduce_or_epi8(__mmask16 __M, __m128i __W) {2922_mm_mask_reduce_or_epi8(__mmask16 __M, __m128i __W) {
3028 __W = _mm_maskz_mov_epi8(__M, __W);2923 __W = _mm_maskz_mov_epi8(__M, __W);
3029 return __builtin_reduce_or((__v16qs)__W);2924 return __builtin_reduce_or((__v16qs)__W);
3030}2925}
30312926
3032static __inline__ signed char __DEFAULT_FN_ATTRS1282927static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3033_mm_reduce_max_epi8(__m128i __V) {2928_mm_reduce_max_epi8(__m128i __V) {
3034 return __builtin_reduce_max((__v16qs)__V);2929 return __builtin_reduce_max((__v16qs)__V);
3035}2930}
30362931
3037static __inline__ unsigned char __DEFAULT_FN_ATTRS1282932static __inline__ unsigned char __DEFAULT_FN_ATTRS128_CONSTEXPR
3038_mm_reduce_max_epu8(__m128i __V) {2933_mm_reduce_max_epu8(__m128i __V) {
3039 return __builtin_reduce_max((__v16qu)__V);2934 return __builtin_reduce_max((__v16qu)__V);
3040}2935}
30412936
3042static __inline__ signed char __DEFAULT_FN_ATTRS1282937static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3043_mm_reduce_min_epi8(__m128i __V) {2938_mm_reduce_min_epi8(__m128i __V) {
3044 return __builtin_reduce_min((__v16qs)__V);2939 return __builtin_reduce_min((__v16qs)__V);
3045}2940}
30462941
3047static __inline__ unsigned char __DEFAULT_FN_ATTRS1282942static __inline__ unsigned char __DEFAULT_FN_ATTRS128_CONSTEXPR
3048_mm_reduce_min_epu8(__m128i __V) {2943_mm_reduce_min_epu8(__m128i __V) {
3049 return __builtin_reduce_min((__v16qu)__V);2944 return __builtin_reduce_min((__v16qu)__V);
3050}2945}
30512946
3052static __inline__ signed char __DEFAULT_FN_ATTRS1282947static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3053_mm_mask_reduce_max_epi8(__mmask16 __M, __m128i __V) {2948_mm_mask_reduce_max_epi8(__mmask16 __M, __m128i __V) {
3054 __V = _mm_mask_mov_epi8(_mm_set1_epi8(-127-1), __M, __V);2949 __V = _mm_mask_mov_epi8(_mm_set1_epi8(-127-1), __M, __V);
3055 return __builtin_reduce_max((__v16qs)__V);2950 return __builtin_reduce_max((__v16qs)__V);
3056}2951}
30572952
3058static __inline__ unsigned char __DEFAULT_FN_ATTRS1282953static __inline__ unsigned char __DEFAULT_FN_ATTRS128_CONSTEXPR
3059_mm_mask_reduce_max_epu8(__mmask16 __M, __m128i __V) {2954_mm_mask_reduce_max_epu8(__mmask16 __M, __m128i __V) {
3060 __V = _mm_maskz_mov_epi8(__M, __V);2955 __V = _mm_maskz_mov_epi8(__M, __V);
3061 return __builtin_reduce_max((__v16qu)__V);2956 return __builtin_reduce_max((__v16qu)__V);
3062}2957}
30632958
3064static __inline__ signed char __DEFAULT_FN_ATTRS1282959static __inline__ signed char __DEFAULT_FN_ATTRS128_CONSTEXPR
3065_mm_mask_reduce_min_epi8(__mmask16 __M, __m128i __V) {2960_mm_mask_reduce_min_epi8(__mmask16 __M, __m128i __V) {
3066 __V = _mm_mask_mov_epi8(_mm_set1_epi8(127), __M, __V);2961 __V = _mm_mask_mov_epi8(_mm_set1_epi8(127), __M, __V);
3067 return __builtin_reduce_min((__v16qs)__V);2962 return __builtin_reduce_min((__v16qs)__V);
3068}2963}
30692964
3070static __inline__ unsigned char __DEFAULT_FN_ATTRS1282965static __inline__ unsigned char __DEFAULT_FN_ATTRS128_CONSTEXPR
3071_mm_mask_reduce_min_epu8(__mmask16 __M, __m128i __V) {2966_mm_mask_reduce_min_epu8(__mmask16 __M, __m128i __V) {
3072 __V = _mm_mask_mov_epi8(_mm_set1_epi8(-1), __M, __V);2967 __V = _mm_mask_mov_epi8(_mm_set1_epi8(-1), __M, __V);
3073 return __builtin_reduce_min((__v16qu)__V);2968 return __builtin_reduce_min((__v16qu)__V);
3074}2969}
30752970
3076static __inline__ signed char __DEFAULT_FN_ATTRS2562971static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3077_mm256_reduce_add_epi8(__m256i __W) {2972_mm256_reduce_add_epi8(__m256i __W) {
3078 return __builtin_reduce_add((__v32qs)__W);2973 return __builtin_reduce_add((__v32qs)__W);
3079}2974}
30802975
3081static __inline__ signed char __DEFAULT_FN_ATTRS2562976static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3082_mm256_reduce_mul_epi8(__m256i __W) {2977_mm256_reduce_mul_epi8(__m256i __W) {
3083 return __builtin_reduce_mul((__v32qs)__W);2978 return __builtin_reduce_mul((__v32qs)__W);
3084}2979}
30852980
3086static __inline__ signed char __DEFAULT_FN_ATTRS2562981static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3087_mm256_reduce_and_epi8(__m256i __W) {2982_mm256_reduce_and_epi8(__m256i __W) {
3088 return __builtin_reduce_and((__v32qs)__W);2983 return __builtin_reduce_and((__v32qs)__W);
3089}2984}
30902985
3091static __inline__ signed char __DEFAULT_FN_ATTRS2562986static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3092_mm256_reduce_or_epi8(__m256i __W) {2987_mm256_reduce_or_epi8(__m256i __W) {
3093 return __builtin_reduce_or((__v32qs)__W);2988 return __builtin_reduce_or((__v32qs)__W);
3094}2989}
30952990
3096static __inline__ signed char __DEFAULT_FN_ATTRS2562991static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3097_mm256_mask_reduce_add_epi8(__mmask32 __M, __m256i __W) {2992_mm256_mask_reduce_add_epi8(__mmask32 __M, __m256i __W) {
3098 __W = _mm256_maskz_mov_epi8(__M, __W);2993 __W = _mm256_maskz_mov_epi8(__M, __W);
3099 return __builtin_reduce_add((__v32qs)__W);2994 return __builtin_reduce_add((__v32qs)__W);
3100}2995}
31012996
3102static __inline__ signed char __DEFAULT_FN_ATTRS2562997static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3103_mm256_mask_reduce_mul_epi8(__mmask32 __M, __m256i __W) {2998_mm256_mask_reduce_mul_epi8(__mmask32 __M, __m256i __W) {
3104 __W = _mm256_mask_mov_epi8(_mm256_set1_epi8(1), __M, __W);2999 __W = _mm256_mask_mov_epi8(_mm256_set1_epi8(1), __M, __W);
3105 return __builtin_reduce_mul((__v32qs)__W);3000 return __builtin_reduce_mul((__v32qs)__W);
3106}3001}
31073002
3108static __inline__ signed char __DEFAULT_FN_ATTRS2563003static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3109_mm256_mask_reduce_and_epi8(__mmask32 __M, __m256i __W) {3004_mm256_mask_reduce_and_epi8(__mmask32 __M, __m256i __W) {
3110 __W = _mm256_mask_mov_epi8(_mm256_set1_epi8(-1), __M, __W);3005 __W = _mm256_mask_mov_epi8(_mm256_set1_epi8(-1), __M, __W);
3111 return __builtin_reduce_and((__v32qs)__W);3006 return __builtin_reduce_and((__v32qs)__W);
3112}3007}
31133008
3114static __inline__ signed char __DEFAULT_FN_ATTRS2563009static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3115_mm256_mask_reduce_or_epi8(__mmask32 __M, __m256i __W) {3010_mm256_mask_reduce_or_epi8(__mmask32 __M, __m256i __W) {
3116 __W = _mm256_maskz_mov_epi8(__M, __W);3011 __W = _mm256_maskz_mov_epi8(__M, __W);
3117 return __builtin_reduce_or((__v32qs)__W);3012 return __builtin_reduce_or((__v32qs)__W);
3118}3013}
31193014
3120static __inline__ signed char __DEFAULT_FN_ATTRS2563015static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3121_mm256_reduce_max_epi8(__m256i __V) {3016_mm256_reduce_max_epi8(__m256i __V) {
3122 return __builtin_reduce_max((__v32qs)__V);3017 return __builtin_reduce_max((__v32qs)__V);
3123}3018}
31243019
3125static __inline__ unsigned char __DEFAULT_FN_ATTRS2563020static __inline__ unsigned char __DEFAULT_FN_ATTRS256_CONSTEXPR
3126_mm256_reduce_max_epu8(__m256i __V) {3021_mm256_reduce_max_epu8(__m256i __V) {
3127 return __builtin_reduce_max((__v32qu)__V);3022 return __builtin_reduce_max((__v32qu)__V);
3128}3023}
31293024
3130static __inline__ signed char __DEFAULT_FN_ATTRS2563025static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3131_mm256_reduce_min_epi8(__m256i __V) {3026_mm256_reduce_min_epi8(__m256i __V) {
3132 return __builtin_reduce_min((__v32qs)__V);3027 return __builtin_reduce_min((__v32qs)__V);
3133}3028}
31343029
3135static __inline__ unsigned char __DEFAULT_FN_ATTRS2563030static __inline__ unsigned char __DEFAULT_FN_ATTRS256_CONSTEXPR
3136_mm256_reduce_min_epu8(__m256i __V) {3031_mm256_reduce_min_epu8(__m256i __V) {
3137 return __builtin_reduce_min((__v32qu)__V);3032 return __builtin_reduce_min((__v32qu)__V);
3138}3033}
31393034
3140static __inline__ signed char __DEFAULT_FN_ATTRS2563035static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3141_mm256_mask_reduce_max_epi8(__mmask32 __M, __m256i __V) {3036_mm256_mask_reduce_max_epi8(__mmask32 __M, __m256i __V) {
3142 __V = _mm256_mask_mov_epi8(_mm256_set1_epi8(-127-1), __M, __V);3037 __V = _mm256_mask_mov_epi8(_mm256_set1_epi8(-127-1), __M, __V);
3143 return __builtin_reduce_max((__v32qs)__V);3038 return __builtin_reduce_max((__v32qs)__V);
3144}3039}
31453040
3146static __inline__ unsigned char __DEFAULT_FN_ATTRS2563041static __inline__ unsigned char __DEFAULT_FN_ATTRS256_CONSTEXPR
3147_mm256_mask_reduce_max_epu8(__mmask32 __M, __m256i __V) {3042_mm256_mask_reduce_max_epu8(__mmask32 __M, __m256i __V) {
3148 __V = _mm256_maskz_mov_epi8(__M, __V);3043 __V = _mm256_maskz_mov_epi8(__M, __V);
3149 return __builtin_reduce_max((__v32qu)__V);3044 return __builtin_reduce_max((__v32qu)__V);
3150}3045}
31513046
3152static __inline__ signed char __DEFAULT_FN_ATTRS2563047static __inline__ signed char __DEFAULT_FN_ATTRS256_CONSTEXPR
3153_mm256_mask_reduce_min_epi8(__mmask32 __M, __m256i __V) {3048_mm256_mask_reduce_min_epi8(__mmask32 __M, __m256i __V) {
3154 __V = _mm256_mask_mov_epi8(_mm256_set1_epi8(127), __M, __V);3049 __V = _mm256_mask_mov_epi8(_mm256_set1_epi8(127), __M, __V);
3155 return __builtin_reduce_min((__v32qs)__V);3050 return __builtin_reduce_min((__v32qs)__V);
3156}3051}
31573052
3158static __inline__ unsigned char __DEFAULT_FN_ATTRS2563053static __inline__ unsigned char __DEFAULT_FN_ATTRS256_CONSTEXPR
3159_mm256_mask_reduce_min_epu8(__mmask32 __M, __m256i __V) {3054_mm256_mask_reduce_min_epu8(__mmask32 __M, __m256i __V) {
3160 __V = _mm256_mask_mov_epi8(_mm256_set1_epi8(-1), __M, __V);3055 __V = _mm256_mask_mov_epi8(_mm256_set1_epi8(-1), __M, __V);
3161 return __builtin_reduce_min((__v32qu)__V);3056 return __builtin_reduce_min((__v32qu)__V);
...@@ -3163,5 +3058,7 @@ _mm256_mask_reduce_min_epu8(__mmask32 __M, __m256i __V) {...@@ -3163,5 +3058,7 @@ _mm256_mask_reduce_min_epu8(__mmask32 __M, __m256i __V) {
31633058
3164#undef __DEFAULT_FN_ATTRS1283059#undef __DEFAULT_FN_ATTRS128
3165#undef __DEFAULT_FN_ATTRS2563060#undef __DEFAULT_FN_ATTRS256
3061#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
3062#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
31663063
3167#endif /* __AVX512VLBWINTRIN_H */3064#endif /* __AVX512VLBWINTRIN_H */
lib/include/avx512vlcdintrin.h+74-102
...@@ -14,211 +14,183 @@...@@ -14,211 +14,183 @@
14#define __AVX512VLCDINTRIN_H14#define __AVX512VLCDINTRIN_H
1515
16/* Define the default attributes for the functions in this file. */16/* Define the default attributes for the functions in this file. */
17#if defined(__cplusplus) && (__cplusplus >= 201103L)
17#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
18 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, \
19 __target__("avx512vl,avx512cd,no-evex512"), \20 __target__("avx512vl,avx512cd"), \
20 __min_vector_width__(128)))21 __min_vector_width__(128))) constexpr
21#define __DEFAULT_FN_ATTRS256 \22#define __DEFAULT_FN_ATTRS256 \
22 __attribute__((__always_inline__, __nodebug__, \23 __attribute__((__always_inline__, __nodebug__, \
23 __target__("avx512vl,avx512cd,no-evex512"), \24 __target__("avx512vl,avx512cd"), \
24 __min_vector_width__(256)))25 __min_vector_width__(256))) constexpr
26#else
27#define __DEFAULT_FN_ATTRS128 \
28 __attribute__((__always_inline__, __nodebug__, \
29 __target__("avx512vl,avx512cd"), __min_vector_width__(128)))
30#define __DEFAULT_FN_ATTRS256 \
31 __attribute__((__always_inline__, __nodebug__, \
32 __target__("avx512vl,avx512cd"), __min_vector_width__(256)))
33#endif
2534
26static __inline__ __m128i __DEFAULT_FN_ATTRS12835static __inline__ __m128i __DEFAULT_FN_ATTRS128
27_mm_broadcastmb_epi64 (__mmask8 __A)36_mm_broadcastmb_epi64(__mmask8 __A) {
28{
29 return (__m128i) _mm_set1_epi64x((long long) __A);37 return (__m128i) _mm_set1_epi64x((long long) __A);
30}38}
3139
32static __inline__ __m256i __DEFAULT_FN_ATTRS25640static __inline__ __m256i __DEFAULT_FN_ATTRS256
33_mm256_broadcastmb_epi64 (__mmask8 __A)41_mm256_broadcastmb_epi64(__mmask8 __A) {
34{42 return (__m256i)_mm256_set1_epi64x((long long)__A);
35 return (__m256i) _mm256_set1_epi64x((long long)__A);
36}43}
3744
38static __inline__ __m128i __DEFAULT_FN_ATTRS12845static __inline__ __m128i __DEFAULT_FN_ATTRS128
39_mm_broadcastmw_epi32 (__mmask16 __A)46_mm_broadcastmw_epi32(__mmask16 __A) {
40{
41 return (__m128i) _mm_set1_epi32((int)__A);47 return (__m128i) _mm_set1_epi32((int)__A);
42}48}
4349
44static __inline__ __m256i __DEFAULT_FN_ATTRS25650static __inline__ __m256i __DEFAULT_FN_ATTRS256
45_mm256_broadcastmw_epi32 (__mmask16 __A)51_mm256_broadcastmw_epi32(__mmask16 __A) {
46{
47 return (__m256i) _mm256_set1_epi32((int)__A);52 return (__m256i) _mm256_set1_epi32((int)__A);
48}53}
4954
50
51static __inline__ __m128i __DEFAULT_FN_ATTRS12855static __inline__ __m128i __DEFAULT_FN_ATTRS128
52_mm_conflict_epi64 (__m128i __A)56_mm_conflict_epi64(__m128i __A) {
53{57 return (__m128i)__builtin_ia32_vpconflictdi_128((__v2di)__A);
54 return (__m128i) __builtin_ia32_vpconflictdi_128 ((__v2di) __A);
55}58}
5659
57static __inline__ __m128i __DEFAULT_FN_ATTRS12860static __inline__ __m128i __DEFAULT_FN_ATTRS128
58_mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A)61_mm_mask_conflict_epi64(__m128i __W, __mmask8 __U, __m128i __A) {
59{62 return (__m128i)__builtin_ia32_selectq_128(
60 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,63 (__mmask8)__U, (__v2di)_mm_conflict_epi64(__A), (__v2di)__W);
61 (__v2di)_mm_conflict_epi64(__A),
62 (__v2di)__W);
63}64}
6465
65static __inline__ __m128i __DEFAULT_FN_ATTRS12866static __inline__ __m128i __DEFAULT_FN_ATTRS128
66_mm_maskz_conflict_epi64 (__mmask8 __U, __m128i __A)67_mm_maskz_conflict_epi64(__mmask8 __U, __m128i __A) {
67{
68 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,68 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
69 (__v2di)_mm_conflict_epi64(__A),69 (__v2di)_mm_conflict_epi64(__A),
70 (__v2di)_mm_setzero_si128());70 (__v2di)_mm_setzero_si128());
71}71}
7272
73static __inline__ __m256i __DEFAULT_FN_ATTRS25673static __inline__ __m256i __DEFAULT_FN_ATTRS256
74_mm256_conflict_epi64 (__m256i __A)74_mm256_conflict_epi64(__m256i __A) {
75{75 return (__m256i)__builtin_ia32_vpconflictdi_256((__v4di)__A);
76 return (__m256i) __builtin_ia32_vpconflictdi_256 ((__v4di) __A);
77}76}
7877
79static __inline__ __m256i __DEFAULT_FN_ATTRS25678static __inline__ __m256i __DEFAULT_FN_ATTRS256
80_mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A)79_mm256_mask_conflict_epi64(__m256i __W, __mmask8 __U, __m256i __A) {
81{80 return (__m256i)__builtin_ia32_selectq_256(
82 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,81 (__mmask8)__U, (__v4di)_mm256_conflict_epi64(__A), (__v4di)__W);
83 (__v4di)_mm256_conflict_epi64(__A),
84 (__v4di)__W);
85}82}
8683
87static __inline__ __m256i __DEFAULT_FN_ATTRS25684static __inline__ __m256i __DEFAULT_FN_ATTRS256
88_mm256_maskz_conflict_epi64 (__mmask8 __U, __m256i __A)85_mm256_maskz_conflict_epi64(__mmask8 __U, __m256i __A) {
89{
90 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,86 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
91 (__v4di)_mm256_conflict_epi64(__A),87 (__v4di)_mm256_conflict_epi64(__A),
92 (__v4di)_mm256_setzero_si256());88 (__v4di)_mm256_setzero_si256());
93}89}
9490
95static __inline__ __m128i __DEFAULT_FN_ATTRS12891static __inline__ __m128i __DEFAULT_FN_ATTRS128
96_mm_conflict_epi32 (__m128i __A)92_mm_conflict_epi32(__m128i __A) {
97{93 return (__m128i)__builtin_ia32_vpconflictsi_128((__v4si)__A);
98 return (__m128i) __builtin_ia32_vpconflictsi_128 ((__v4si) __A);
99}94}
10095
101static __inline__ __m128i __DEFAULT_FN_ATTRS12896static __inline__ __m128i __DEFAULT_FN_ATTRS128
102_mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A)97_mm_mask_conflict_epi32(__m128i __W, __mmask8 __U, __m128i __A) {
103{98 return (__m128i)__builtin_ia32_selectd_128(
104 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,99 (__mmask8)__U, (__v4si)_mm_conflict_epi32(__A), (__v4si)__W);
105 (__v4si)_mm_conflict_epi32(__A),
106 (__v4si)__W);
107}100}
108101
109static __inline__ __m128i __DEFAULT_FN_ATTRS128102static __inline__ __m128i __DEFAULT_FN_ATTRS128
110_mm_maskz_conflict_epi32 (__mmask8 __U, __m128i __A)103_mm_maskz_conflict_epi32(__mmask8 __U, __m128i __A) {
111{
112 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,104 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
113 (__v4si)_mm_conflict_epi32(__A),105 (__v4si)_mm_conflict_epi32(__A),
114 (__v4si)_mm_setzero_si128());106 (__v4si)_mm_setzero_si128());
115}107}
116108
117static __inline__ __m256i __DEFAULT_FN_ATTRS256109static __inline__ __m256i __DEFAULT_FN_ATTRS256
118_mm256_conflict_epi32 (__m256i __A)110_mm256_conflict_epi32(__m256i __A) {
119{111 return (__m256i)__builtin_ia32_vpconflictsi_256((__v8si)__A);
120 return (__m256i) __builtin_ia32_vpconflictsi_256 ((__v8si) __A);
121}112}
122113
123static __inline__ __m256i __DEFAULT_FN_ATTRS256114static __inline__ __m256i __DEFAULT_FN_ATTRS256
124_mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A)115_mm256_mask_conflict_epi32(__m256i __W, __mmask8 __U, __m256i __A) {
125{116 return (__m256i)__builtin_ia32_selectd_256(
126 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,117 (__mmask8)__U, (__v8si)_mm256_conflict_epi32(__A), (__v8si)__W);
127 (__v8si)_mm256_conflict_epi32(__A),
128 (__v8si)__W);
129}118}
130119
131static __inline__ __m256i __DEFAULT_FN_ATTRS256120static __inline__ __m256i __DEFAULT_FN_ATTRS256
132_mm256_maskz_conflict_epi32 (__mmask8 __U, __m256i __A)121_mm256_maskz_conflict_epi32(__mmask8 __U, __m256i __A) {
133{
134 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,122 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
135 (__v8si)_mm256_conflict_epi32(__A),123 (__v8si)_mm256_conflict_epi32(__A),
136 (__v8si)_mm256_setzero_si256());124 (__v8si)_mm256_setzero_si256());
137}125}
138126
139static __inline__ __m128i __DEFAULT_FN_ATTRS128127static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_lzcnt_epi32(__m128i __A) {
140_mm_lzcnt_epi32 (__m128i __A)128 return (__m128i)__builtin_elementwise_clzg((__v4si)__A,
141{129 (__v4si)_mm_set1_epi32(32));
142 return (__m128i) __builtin_ia32_vplzcntd_128 ((__v4si) __A);
143}130}
144131
145static __inline__ __m128i __DEFAULT_FN_ATTRS128132static __inline__ __m128i __DEFAULT_FN_ATTRS128
146_mm_mask_lzcnt_epi32 (__m128i __W, __mmask8 __U, __m128i __A)133_mm_mask_lzcnt_epi32(__m128i __W, __mmask8 __U, __m128i __A) {
147{134 return (__m128i)__builtin_ia32_selectd_128(
148 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,135 (__mmask8)__U, (__v4si)_mm_lzcnt_epi32(__A), (__v4si)__W);
149 (__v4si)_mm_lzcnt_epi32(__A),
150 (__v4si)__W);
151}136}
152137
153static __inline__ __m128i __DEFAULT_FN_ATTRS128138static __inline__ __m128i __DEFAULT_FN_ATTRS128
154_mm_maskz_lzcnt_epi32 (__mmask8 __U, __m128i __A)139_mm_maskz_lzcnt_epi32(__mmask8 __U, __m128i __A) {
155{140 return (__m128i)__builtin_ia32_selectd_128(
156 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,141 (__mmask8)__U, (__v4si)_mm_lzcnt_epi32(__A), (__v4si)_mm_setzero_si128());
157 (__v4si)_mm_lzcnt_epi32(__A),
158 (__v4si)_mm_setzero_si128());
159}142}
160143
161static __inline__ __m256i __DEFAULT_FN_ATTRS256144static __inline__ __m256i __DEFAULT_FN_ATTRS256
162_mm256_lzcnt_epi32 (__m256i __A)145_mm256_lzcnt_epi32(__m256i __A) {
163{146 return (__m256i)__builtin_elementwise_clzg((__v8si)__A,
164 return (__m256i) __builtin_ia32_vplzcntd_256 ((__v8si) __A);147 (__v8si)_mm256_set1_epi32(32));
165}148}
166149
167static __inline__ __m256i __DEFAULT_FN_ATTRS256150static __inline__ __m256i __DEFAULT_FN_ATTRS256
168_mm256_mask_lzcnt_epi32 (__m256i __W, __mmask8 __U, __m256i __A)151_mm256_mask_lzcnt_epi32(__m256i __W, __mmask8 __U, __m256i __A) {
169{152 return (__m256i)__builtin_ia32_selectd_256(
170 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,153 (__mmask8)__U, (__v8si)_mm256_lzcnt_epi32(__A), (__v8si)__W);
171 (__v8si)_mm256_lzcnt_epi32(__A),
172 (__v8si)__W);
173}154}
174155
175static __inline__ __m256i __DEFAULT_FN_ATTRS256156static __inline__ __m256i __DEFAULT_FN_ATTRS256
176_mm256_maskz_lzcnt_epi32 (__mmask8 __U, __m256i __A)157_mm256_maskz_lzcnt_epi32(__mmask8 __U, __m256i __A) {
177{
178 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,158 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
179 (__v8si)_mm256_lzcnt_epi32(__A),159 (__v8si)_mm256_lzcnt_epi32(__A),
180 (__v8si)_mm256_setzero_si256());160 (__v8si)_mm256_setzero_si256());
181}161}
182162
183static __inline__ __m128i __DEFAULT_FN_ATTRS128163static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_lzcnt_epi64(__m128i __A) {
184_mm_lzcnt_epi64 (__m128i __A)164 return (__m128i)__builtin_elementwise_clzg(
185{165 (__v2di)__A, (__v2di)_mm_set1_epi64x((long long)64));
186 return (__m128i) __builtin_ia32_vplzcntq_128 ((__v2di) __A);
187}166}
188167
189static __inline__ __m128i __DEFAULT_FN_ATTRS128168static __inline__ __m128i __DEFAULT_FN_ATTRS128
190_mm_mask_lzcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A)169_mm_mask_lzcnt_epi64(__m128i __W, __mmask8 __U, __m128i __A) {
191{170 return (__m128i)__builtin_ia32_selectq_128(
192 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,171 (__mmask8)__U, (__v2di)_mm_lzcnt_epi64(__A), (__v2di)__W);
193 (__v2di)_mm_lzcnt_epi64(__A),
194 (__v2di)__W);
195}172}
196173
197static __inline__ __m128i __DEFAULT_FN_ATTRS128174static __inline__ __m128i __DEFAULT_FN_ATTRS128
198_mm_maskz_lzcnt_epi64 (__mmask8 __U, __m128i __A)175_mm_maskz_lzcnt_epi64(__mmask8 __U, __m128i __A) {
199{176 return (__m128i)__builtin_ia32_selectq_128(
200 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,177 (__mmask8)__U, (__v2di)_mm_lzcnt_epi64(__A), (__v2di)_mm_setzero_si128());
201 (__v2di)_mm_lzcnt_epi64(__A),
202 (__v2di)_mm_setzero_si128());
203}178}
204179
205static __inline__ __m256i __DEFAULT_FN_ATTRS256180static __inline__ __m256i __DEFAULT_FN_ATTRS256
206_mm256_lzcnt_epi64 (__m256i __A)181_mm256_lzcnt_epi64(__m256i __A) {
207{182 return (__m256i)__builtin_elementwise_clzg(
208 return (__m256i) __builtin_ia32_vplzcntq_256 ((__v4di) __A);183 (__v4di)__A, (__v4di)_mm256_set1_epi64x((long long)64));
209}184}
210185
211static __inline__ __m256i __DEFAULT_FN_ATTRS256186static __inline__ __m256i __DEFAULT_FN_ATTRS256
212_mm256_mask_lzcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A)187_mm256_mask_lzcnt_epi64(__m256i __W, __mmask8 __U, __m256i __A) {
213{188 return (__m256i)__builtin_ia32_selectq_256(
214 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,189 (__mmask8)__U, (__v4di)_mm256_lzcnt_epi64(__A), (__v4di)__W);
215 (__v4di)_mm256_lzcnt_epi64(__A),
216 (__v4di)__W);
217}190}
218191
219static __inline__ __m256i __DEFAULT_FN_ATTRS256192static __inline__ __m256i __DEFAULT_FN_ATTRS256
220_mm256_maskz_lzcnt_epi64 (__mmask8 __U, __m256i __A)193_mm256_maskz_lzcnt_epi64(__mmask8 __U, __m256i __A) {
221{
222 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,194 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
223 (__v4di)_mm256_lzcnt_epi64(__A),195 (__v4di)_mm256_lzcnt_epi64(__A),
224 (__v4di)_mm256_setzero_si256());196 (__v4di)_mm256_setzero_si256());
lib/include/avx512vldqintrin.h+110-127
...@@ -17,45 +17,51 @@...@@ -17,45 +17,51 @@
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512dq,no-evex512"), \20 __target__("avx512vl,avx512dq"), __min_vector_width__(128)))
21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \21#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \22 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512dq,no-evex512"), \23 __target__("avx512vl,avx512dq"), __min_vector_width__(256)))
25 __min_vector_width__(256)))24
25#if defined(__cplusplus) && (__cplusplus >= 201103L)
26#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
27#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
28#else
29#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
30#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
31#endif
2632
27static __inline__ __m256i __DEFAULT_FN_ATTRS25633static __inline__ __m256i __DEFAULT_FN_ATTRS128_CONSTEXPR
28_mm256_mullo_epi64 (__m256i __A, __m256i __B) {34_mm256_mullo_epi64(__m256i __A, __m256i __B) {
29 return (__m256i) ((__v4du) __A * (__v4du) __B);35 return (__m256i) ((__v4du) __A * (__v4du) __B);
30}36}
3137
32static __inline__ __m256i __DEFAULT_FN_ATTRS25638static __inline__ __m256i __DEFAULT_FN_ATTRS128_CONSTEXPR
33_mm256_mask_mullo_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {39_mm256_mask_mullo_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {
34 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,40 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
35 (__v4di)_mm256_mullo_epi64(__A, __B),41 (__v4di)_mm256_mullo_epi64(__A, __B),
36 (__v4di)__W);42 (__v4di)__W);
37}43}
3844
39static __inline__ __m256i __DEFAULT_FN_ATTRS25645static __inline__ __m256i __DEFAULT_FN_ATTRS128_CONSTEXPR
40_mm256_maskz_mullo_epi64(__mmask8 __U, __m256i __A, __m256i __B) {46_mm256_maskz_mullo_epi64(__mmask8 __U, __m256i __A, __m256i __B) {
41 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,47 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
42 (__v4di)_mm256_mullo_epi64(__A, __B),48 (__v4di)_mm256_mullo_epi64(__A, __B),
43 (__v4di)_mm256_setzero_si256());49 (__v4di)_mm256_setzero_si256());
44}50}
4551
46static __inline__ __m128i __DEFAULT_FN_ATTRS12852static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
47_mm_mullo_epi64 (__m128i __A, __m128i __B) {53_mm_mullo_epi64(__m128i __A, __m128i __B) {
48 return (__m128i) ((__v2du) __A * (__v2du) __B);54 return (__m128i) ((__v2du) __A * (__v2du) __B);
49}55}
5056
51static __inline__ __m128i __DEFAULT_FN_ATTRS12857static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
52_mm_mask_mullo_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {58_mm_mask_mullo_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
53 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,59 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
54 (__v2di)_mm_mullo_epi64(__A, __B),60 (__v2di)_mm_mullo_epi64(__A, __B),
55 (__v2di)__W);61 (__v2di)__W);
56}62}
5763
58static __inline__ __m128i __DEFAULT_FN_ATTRS12864static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
59_mm_maskz_mullo_epi64(__mmask8 __U, __m128i __A, __m128i __B) {65_mm_maskz_mullo_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
60 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,66 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
61 (__v2di)_mm_mullo_epi64(__A, __B),67 (__v2di)_mm_mullo_epi64(__A, __B),
...@@ -454,39 +460,39 @@ _mm256_maskz_cvtps_epu64 (__mmask8 __U, __m128 __A) {...@@ -454,39 +460,39 @@ _mm256_maskz_cvtps_epu64 (__mmask8 __U, __m128 __A) {
454 (__mmask8) __U);460 (__mmask8) __U);
455}461}
456462
457static __inline__ __m128d __DEFAULT_FN_ATTRS128463static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
458_mm_cvtepi64_pd (__m128i __A) {464_mm_cvtepi64_pd(__m128i __A) {
459 return (__m128d)__builtin_convertvector((__v2di)__A, __v2df);465 return (__m128d)__builtin_convertvector((__v2di)__A, __v2df);
460}466}
461467
462static __inline__ __m128d __DEFAULT_FN_ATTRS128468static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
463_mm_mask_cvtepi64_pd (__m128d __W, __mmask8 __U, __m128i __A) {469_mm_mask_cvtepi64_pd(__m128d __W, __mmask8 __U, __m128i __A) {
464 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,470 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
465 (__v2df)_mm_cvtepi64_pd(__A),471 (__v2df)_mm_cvtepi64_pd(__A),
466 (__v2df)__W);472 (__v2df)__W);
467}473}
468474
469static __inline__ __m128d __DEFAULT_FN_ATTRS128475static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
470_mm_maskz_cvtepi64_pd (__mmask8 __U, __m128i __A) {476_mm_maskz_cvtepi64_pd(__mmask8 __U, __m128i __A) {
471 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,477 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
472 (__v2df)_mm_cvtepi64_pd(__A),478 (__v2df)_mm_cvtepi64_pd(__A),
473 (__v2df)_mm_setzero_pd());479 (__v2df)_mm_setzero_pd());
474}480}
475481
476static __inline__ __m256d __DEFAULT_FN_ATTRS256482static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
477_mm256_cvtepi64_pd (__m256i __A) {483_mm256_cvtepi64_pd(__m256i __A) {
478 return (__m256d)__builtin_convertvector((__v4di)__A, __v4df);484 return (__m256d)__builtin_convertvector((__v4di)__A, __v4df);
479}485}
480486
481static __inline__ __m256d __DEFAULT_FN_ATTRS256487static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
482_mm256_mask_cvtepi64_pd (__m256d __W, __mmask8 __U, __m256i __A) {488_mm256_mask_cvtepi64_pd(__m256d __W, __mmask8 __U, __m256i __A) {
483 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,489 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
484 (__v4df)_mm256_cvtepi64_pd(__A),490 (__v4df)_mm256_cvtepi64_pd(__A),
485 (__v4df)__W);491 (__v4df)__W);
486}492}
487493
488static __inline__ __m256d __DEFAULT_FN_ATTRS256494static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
489_mm256_maskz_cvtepi64_pd (__mmask8 __U, __m256i __A) {495_mm256_maskz_cvtepi64_pd(__mmask8 __U, __m256i __A) {
490 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,496 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
491 (__v4df)_mm256_cvtepi64_pd(__A),497 (__v4df)_mm256_cvtepi64_pd(__A),
492 (__v4df)_mm256_setzero_pd());498 (__v4df)_mm256_setzero_pd());
...@@ -513,20 +519,20 @@ _mm_maskz_cvtepi64_ps (__mmask8 __U, __m128i __A) {...@@ -513,20 +519,20 @@ _mm_maskz_cvtepi64_ps (__mmask8 __U, __m128i __A) {
513 (__mmask8) __U);519 (__mmask8) __U);
514}520}
515521
516static __inline__ __m128 __DEFAULT_FN_ATTRS256522static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
517_mm256_cvtepi64_ps (__m256i __A) {523_mm256_cvtepi64_ps(__m256i __A) {
518 return (__m128)__builtin_convertvector((__v4di)__A, __v4sf);524 return (__m128)__builtin_convertvector((__v4di)__A, __v4sf);
519}525}
520526
521static __inline__ __m128 __DEFAULT_FN_ATTRS256527static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
522_mm256_mask_cvtepi64_ps (__m128 __W, __mmask8 __U, __m256i __A) {528_mm256_mask_cvtepi64_ps(__m128 __W, __mmask8 __U, __m256i __A) {
523 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,529 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
524 (__v4sf)_mm256_cvtepi64_ps(__A),530 (__v4sf)_mm256_cvtepi64_ps(__A),
525 (__v4sf)__W);531 (__v4sf)__W);
526}532}
527533
528static __inline__ __m128 __DEFAULT_FN_ATTRS256534static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
529_mm256_maskz_cvtepi64_ps (__mmask8 __U, __m256i __A) {535_mm256_maskz_cvtepi64_ps(__mmask8 __U, __m256i __A) {
530 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,536 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
531 (__v4sf)_mm256_cvtepi64_ps(__A),537 (__v4sf)_mm256_cvtepi64_ps(__A),
532 (__v4sf)_mm_setzero_ps());538 (__v4sf)_mm_setzero_ps());
...@@ -700,39 +706,39 @@ _mm256_maskz_cvttps_epu64 (__mmask8 __U, __m128 __A) {...@@ -700,39 +706,39 @@ _mm256_maskz_cvttps_epu64 (__mmask8 __U, __m128 __A) {
700 (__mmask8) __U);706 (__mmask8) __U);
701}707}
702708
703static __inline__ __m128d __DEFAULT_FN_ATTRS128709static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
704_mm_cvtepu64_pd (__m128i __A) {710_mm_cvtepu64_pd(__m128i __A) {
705 return (__m128d)__builtin_convertvector((__v2du)__A, __v2df);711 return (__m128d)__builtin_convertvector((__v2du)__A, __v2df);
706}712}
707713
708static __inline__ __m128d __DEFAULT_FN_ATTRS128714static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
709_mm_mask_cvtepu64_pd (__m128d __W, __mmask8 __U, __m128i __A) {715_mm_mask_cvtepu64_pd(__m128d __W, __mmask8 __U, __m128i __A) {
710 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,716 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
711 (__v2df)_mm_cvtepu64_pd(__A),717 (__v2df)_mm_cvtepu64_pd(__A),
712 (__v2df)__W);718 (__v2df)__W);
713}719}
714720
715static __inline__ __m128d __DEFAULT_FN_ATTRS128721static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
716_mm_maskz_cvtepu64_pd (__mmask8 __U, __m128i __A) {722_mm_maskz_cvtepu64_pd(__mmask8 __U, __m128i __A) {
717 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,723 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
718 (__v2df)_mm_cvtepu64_pd(__A),724 (__v2df)_mm_cvtepu64_pd(__A),
719 (__v2df)_mm_setzero_pd());725 (__v2df)_mm_setzero_pd());
720}726}
721727
722static __inline__ __m256d __DEFAULT_FN_ATTRS256728static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
723_mm256_cvtepu64_pd (__m256i __A) {729_mm256_cvtepu64_pd(__m256i __A) {
724 return (__m256d)__builtin_convertvector((__v4du)__A, __v4df);730 return (__m256d)__builtin_convertvector((__v4du)__A, __v4df);
725}731}
726732
727static __inline__ __m256d __DEFAULT_FN_ATTRS256733static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
728_mm256_mask_cvtepu64_pd (__m256d __W, __mmask8 __U, __m256i __A) {734_mm256_mask_cvtepu64_pd(__m256d __W, __mmask8 __U, __m256i __A) {
729 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,735 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
730 (__v4df)_mm256_cvtepu64_pd(__A),736 (__v4df)_mm256_cvtepu64_pd(__A),
731 (__v4df)__W);737 (__v4df)__W);
732}738}
733739
734static __inline__ __m256d __DEFAULT_FN_ATTRS256740static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
735_mm256_maskz_cvtepu64_pd (__mmask8 __U, __m256i __A) {741_mm256_maskz_cvtepu64_pd(__mmask8 __U, __m256i __A) {
736 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,742 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
737 (__v4df)_mm256_cvtepu64_pd(__A),743 (__v4df)_mm256_cvtepu64_pd(__A),
738 (__v4df)_mm256_setzero_pd());744 (__v4df)_mm256_setzero_pd());
...@@ -759,20 +765,20 @@ _mm_maskz_cvtepu64_ps (__mmask8 __U, __m128i __A) {...@@ -759,20 +765,20 @@ _mm_maskz_cvtepu64_ps (__mmask8 __U, __m128i __A) {
759 (__mmask8) __U);765 (__mmask8) __U);
760}766}
761767
762static __inline__ __m128 __DEFAULT_FN_ATTRS256768static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
763_mm256_cvtepu64_ps (__m256i __A) {769_mm256_cvtepu64_ps(__m256i __A) {
764 return (__m128)__builtin_convertvector((__v4du)__A, __v4sf);770 return (__m128)__builtin_convertvector((__v4du)__A, __v4sf);
765}771}
766772
767static __inline__ __m128 __DEFAULT_FN_ATTRS256773static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
768_mm256_mask_cvtepu64_ps (__m128 __W, __mmask8 __U, __m256i __A) {774_mm256_mask_cvtepu64_ps(__m128 __W, __mmask8 __U, __m256i __A) {
769 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,775 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
770 (__v4sf)_mm256_cvtepu64_ps(__A),776 (__v4sf)_mm256_cvtepu64_ps(__A),
771 (__v4sf)__W);777 (__v4sf)__W);
772}778}
773779
774static __inline__ __m128 __DEFAULT_FN_ATTRS256780static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
775_mm256_maskz_cvtepu64_ps (__mmask8 __U, __m256i __A) {781_mm256_maskz_cvtepu64_ps(__mmask8 __U, __m256i __A) {
776 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,782 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
777 (__v4sf)_mm256_cvtepu64_ps(__A),783 (__v4sf)_mm256_cvtepu64_ps(__A),
778 (__v4sf)_mm_setzero_ps());784 (__v4sf)_mm_setzero_ps());
...@@ -908,174 +914,150 @@ _mm256_maskz_cvtepu64_ps (__mmask8 __U, __m256i __A) {...@@ -908,174 +914,150 @@ _mm256_maskz_cvtepu64_ps (__mmask8 __U, __m256i __A) {
908 (__v8sf)_mm256_setzero_ps(), \914 (__v8sf)_mm256_setzero_ps(), \
909 (__mmask8)(U)))915 (__mmask8)(U)))
910916
911static __inline__ __mmask8 __DEFAULT_FN_ATTRS128917static __inline__ __mmask8
912_mm_movepi32_mask (__m128i __A)918 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_movepi32_mask(__m128i __A) {
913{
914 return (__mmask8) __builtin_ia32_cvtd2mask128 ((__v4si) __A);919 return (__mmask8) __builtin_ia32_cvtd2mask128 ((__v4si) __A);
915}920}
916921
917static __inline__ __mmask8 __DEFAULT_FN_ATTRS256922static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
918_mm256_movepi32_mask (__m256i __A)923_mm256_movepi32_mask(__m256i __A) {
919{
920 return (__mmask8) __builtin_ia32_cvtd2mask256 ((__v8si) __A);924 return (__mmask8) __builtin_ia32_cvtd2mask256 ((__v8si) __A);
921}925}
922926
923static __inline__ __m128i __DEFAULT_FN_ATTRS128927static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
924_mm_movm_epi32 (__mmask8 __A)928_mm_movm_epi32(__mmask8 __A) {
925{
926 return (__m128i) __builtin_ia32_cvtmask2d128 (__A);929 return (__m128i) __builtin_ia32_cvtmask2d128 (__A);
927}930}
928931
929static __inline__ __m256i __DEFAULT_FN_ATTRS256932static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
930_mm256_movm_epi32 (__mmask8 __A)933_mm256_movm_epi32(__mmask8 __A) {
931{
932 return (__m256i) __builtin_ia32_cvtmask2d256 (__A);934 return (__m256i) __builtin_ia32_cvtmask2d256 (__A);
933}935}
934936
935static __inline__ __m128i __DEFAULT_FN_ATTRS128937static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
936_mm_movm_epi64 (__mmask8 __A)938_mm_movm_epi64(__mmask8 __A) {
937{
938 return (__m128i) __builtin_ia32_cvtmask2q128 (__A);939 return (__m128i) __builtin_ia32_cvtmask2q128 (__A);
939}940}
940941
941static __inline__ __m256i __DEFAULT_FN_ATTRS256942static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
942_mm256_movm_epi64 (__mmask8 __A)943_mm256_movm_epi64(__mmask8 __A) {
943{
944 return (__m256i) __builtin_ia32_cvtmask2q256 (__A);944 return (__m256i) __builtin_ia32_cvtmask2q256 (__A);
945}945}
946946
947static __inline__ __mmask8 __DEFAULT_FN_ATTRS128947static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
948_mm_movepi64_mask (__m128i __A)948_mm_movepi64_mask(__m128i __A) {
949{
950 return (__mmask8) __builtin_ia32_cvtq2mask128 ((__v2di) __A);949 return (__mmask8) __builtin_ia32_cvtq2mask128 ((__v2di) __A);
951}950}
952951
953static __inline__ __mmask8 __DEFAULT_FN_ATTRS256952static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
954_mm256_movepi64_mask (__m256i __A)953_mm256_movepi64_mask(__m256i __A) {
955{
956 return (__mmask8) __builtin_ia32_cvtq2mask256 ((__v4di) __A);954 return (__mmask8) __builtin_ia32_cvtq2mask256 ((__v4di) __A);
957}955}
958956
959static __inline__ __m256 __DEFAULT_FN_ATTRS256957static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
960_mm256_broadcast_f32x2 (__m128 __A)958_mm256_broadcast_f32x2(__m128 __A) {
961{
962 return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,959 return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,
963 0, 1, 0, 1, 0, 1, 0, 1);960 0, 1, 0, 1, 0, 1, 0, 1);
964}961}
965962
966static __inline__ __m256 __DEFAULT_FN_ATTRS256963static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
967_mm256_mask_broadcast_f32x2 (__m256 __O, __mmask8 __M, __m128 __A)964_mm256_mask_broadcast_f32x2(__m256 __O, __mmask8 __M, __m128 __A) {
968{
969 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,965 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,
970 (__v8sf)_mm256_broadcast_f32x2(__A),966 (__v8sf)_mm256_broadcast_f32x2(__A),
971 (__v8sf)__O);967 (__v8sf)__O);
972}968}
973969
974static __inline__ __m256 __DEFAULT_FN_ATTRS256970static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
975_mm256_maskz_broadcast_f32x2 (__mmask8 __M, __m128 __A)971_mm256_maskz_broadcast_f32x2(__mmask8 __M, __m128 __A) {
976{
977 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,972 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,
978 (__v8sf)_mm256_broadcast_f32x2(__A),973 (__v8sf)_mm256_broadcast_f32x2(__A),
979 (__v8sf)_mm256_setzero_ps());974 (__v8sf)_mm256_setzero_ps());
980}975}
981976
982static __inline__ __m256d __DEFAULT_FN_ATTRS256977static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
983_mm256_broadcast_f64x2(__m128d __A)978_mm256_broadcast_f64x2(__m128d __A) {
984{
985 return (__m256d)__builtin_shufflevector((__v2df)__A, (__v2df)__A,979 return (__m256d)__builtin_shufflevector((__v2df)__A, (__v2df)__A,
986 0, 1, 0, 1);980 0, 1, 0, 1);
987}981}
988982
989static __inline__ __m256d __DEFAULT_FN_ATTRS256983static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
990_mm256_mask_broadcast_f64x2(__m256d __O, __mmask8 __M, __m128d __A)984_mm256_mask_broadcast_f64x2(__m256d __O, __mmask8 __M, __m128d __A) {
991{
992 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M,985 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M,
993 (__v4df)_mm256_broadcast_f64x2(__A),986 (__v4df)_mm256_broadcast_f64x2(__A),
994 (__v4df)__O);987 (__v4df)__O);
995}988}
996989
997static __inline__ __m256d __DEFAULT_FN_ATTRS256990static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
998_mm256_maskz_broadcast_f64x2 (__mmask8 __M, __m128d __A)991_mm256_maskz_broadcast_f64x2(__mmask8 __M, __m128d __A) {
999{
1000 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M,992 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M,
1001 (__v4df)_mm256_broadcast_f64x2(__A),993 (__v4df)_mm256_broadcast_f64x2(__A),
1002 (__v4df)_mm256_setzero_pd());994 (__v4df)_mm256_setzero_pd());
1003}995}
1004996
1005static __inline__ __m128i __DEFAULT_FN_ATTRS128997static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1006_mm_broadcast_i32x2 (__m128i __A)998_mm_broadcast_i32x2(__m128i __A) {
1007{
1008 return (__m128i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,999 return (__m128i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
1009 0, 1, 0, 1);1000 0, 1, 0, 1);
1010}1001}
10111002
1012static __inline__ __m128i __DEFAULT_FN_ATTRS1281003static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1013_mm_mask_broadcast_i32x2 (__m128i __O, __mmask8 __M, __m128i __A)1004_mm_mask_broadcast_i32x2(__m128i __O, __mmask8 __M, __m128i __A) {
1014{
1015 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,1005 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
1016 (__v4si)_mm_broadcast_i32x2(__A),1006 (__v4si)_mm_broadcast_i32x2(__A),
1017 (__v4si)__O);1007 (__v4si)__O);
1018}1008}
10191009
1020static __inline__ __m128i __DEFAULT_FN_ATTRS1281010static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1021_mm_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A)1011_mm_maskz_broadcast_i32x2(__mmask8 __M, __m128i __A) {
1022{
1023 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,1012 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
1024 (__v4si)_mm_broadcast_i32x2(__A),1013 (__v4si)_mm_broadcast_i32x2(__A),
1025 (__v4si)_mm_setzero_si128());1014 (__v4si)_mm_setzero_si128());
1026}1015}
10271016
1028static __inline__ __m256i __DEFAULT_FN_ATTRS2561017static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1029_mm256_broadcast_i32x2 (__m128i __A)1018_mm256_broadcast_i32x2(__m128i __A) {
1030{
1031 return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,1019 return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
1032 0, 1, 0, 1, 0, 1, 0, 1);1020 0, 1, 0, 1, 0, 1, 0, 1);
1033}1021}
10341022
1035static __inline__ __m256i __DEFAULT_FN_ATTRS2561023static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1036_mm256_mask_broadcast_i32x2 (__m256i __O, __mmask8 __M, __m128i __A)1024_mm256_mask_broadcast_i32x2(__m256i __O, __mmask8 __M, __m128i __A) {
1037{
1038 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,1025 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
1039 (__v8si)_mm256_broadcast_i32x2(__A),1026 (__v8si)_mm256_broadcast_i32x2(__A),
1040 (__v8si)__O);1027 (__v8si)__O);
1041}1028}
10421029
1043static __inline__ __m256i __DEFAULT_FN_ATTRS2561030static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1044_mm256_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A)1031_mm256_maskz_broadcast_i32x2(__mmask8 __M, __m128i __A) {
1045{
1046 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,1032 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
1047 (__v8si)_mm256_broadcast_i32x2(__A),1033 (__v8si)_mm256_broadcast_i32x2(__A),
1048 (__v8si)_mm256_setzero_si256());1034 (__v8si)_mm256_setzero_si256());
1049}1035}
10501036
1051static __inline__ __m256i __DEFAULT_FN_ATTRS2561037static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1052_mm256_broadcast_i64x2(__m128i __A)1038_mm256_broadcast_i64x2(__m128i __A) {
1053{
1054 return (__m256i)__builtin_shufflevector((__v2di)__A, (__v2di)__A,1039 return (__m256i)__builtin_shufflevector((__v2di)__A, (__v2di)__A,
1055 0, 1, 0, 1);1040 0, 1, 0, 1);
1056}1041}
10571042
1058static __inline__ __m256i __DEFAULT_FN_ATTRS2561043static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1059_mm256_mask_broadcast_i64x2(__m256i __O, __mmask8 __M, __m128i __A)1044_mm256_mask_broadcast_i64x2(__m256i __O, __mmask8 __M, __m128i __A) {
1060{
1061 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,1045 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
1062 (__v4di)_mm256_broadcast_i64x2(__A),1046 (__v4di)_mm256_broadcast_i64x2(__A),
1063 (__v4di)__O);1047 (__v4di)__O);
1064}1048}
10651049
1066static __inline__ __m256i __DEFAULT_FN_ATTRS2561050static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1067_mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)1051_mm256_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A) {
1068{
1069 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,1052 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
1070 (__v4di)_mm256_broadcast_i64x2(__A),1053 (__v4di)_mm256_broadcast_i64x2(__A),
1071 (__v4di)_mm256_setzero_si256());1054 (__v4di)_mm256_setzero_si256());
1072}1055}
10731056
1074#define _mm256_extractf64x2_pd(A, imm) \1057#define _mm256_extractf64x2_pd(A, imm) \
1075 ((__m128d)__builtin_ia32_extractf64x2_256_mask((__v4df)(__m256d)(A), \1058 ((__m128d)__builtin_ia32_extractf64x2_256_mask( \
1076 (int)(imm), \1059 (__v4df)(__m256d)(A), (int)(imm), (__v2df)_mm_setzero_pd(), \
1077 (__v2df)_mm_undefined_pd(), \1060 (__mmask8) - 1))
1078 (__mmask8)-1))
10791061
1080#define _mm256_mask_extractf64x2_pd(W, U, A, imm) \1062#define _mm256_mask_extractf64x2_pd(W, U, A, imm) \
1081 ((__m128d)__builtin_ia32_extractf64x2_256_mask((__v4df)(__m256d)(A), \1063 ((__m128d)__builtin_ia32_extractf64x2_256_mask((__v4df)(__m256d)(A), \
...@@ -1089,11 +1071,10 @@ _mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)...@@ -1089,11 +1071,10 @@ _mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)
1089 (__v2df)_mm_setzero_pd(), \1071 (__v2df)_mm_setzero_pd(), \
1090 (__mmask8)(U)))1072 (__mmask8)(U)))
10911073
1092#define _mm256_extracti64x2_epi64(A, imm) \1074#define _mm256_extracti64x2_epi64(A, imm) \
1093 ((__m128i)__builtin_ia32_extracti64x2_256_mask((__v4di)(__m256i)(A), \1075 ((__m128i)__builtin_ia32_extracti64x2_256_mask( \
1094 (int)(imm), \1076 (__v4di)(__m256i)(A), (int)(imm), (__v2di)_mm_setzero_si128(), \
1095 (__v2di)_mm_undefined_si128(), \1077 (__mmask8) - 1))
1096 (__mmask8)-1))
10971078
1098#define _mm256_mask_extracti64x2_epi64(W, U, A, imm) \1079#define _mm256_mask_extracti64x2_epi64(W, U, A, imm) \
1099 ((__m128i)__builtin_ia32_extracti64x2_256_mask((__v4di)(__m256i)(A), \1080 ((__m128i)__builtin_ia32_extracti64x2_256_mask((__v4di)(__m256i)(A), \
...@@ -1169,5 +1150,7 @@ _mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)...@@ -1169,5 +1150,7 @@ _mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A)
11691150
1170#undef __DEFAULT_FN_ATTRS1281151#undef __DEFAULT_FN_ATTRS128
1171#undef __DEFAULT_FN_ATTRS2561152#undef __DEFAULT_FN_ATTRS256
1153#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
1154#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
11721155
1173#endif1156#endif
lib/include/avx512vlfp16intrin.h+130-111
...@@ -19,51 +19,64 @@...@@ -19,51 +19,64 @@
19/* Define the default attributes for the functions in this file. */19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS256 \20#define __DEFAULT_FN_ATTRS256 \
21 __attribute__((__always_inline__, __nodebug__, \21 __attribute__((__always_inline__, __nodebug__, \
22 __target__("avx512fp16,avx512vl,no-evex512"), \22 __target__("avx512fp16,avx512vl"), \
23 __min_vector_width__(256)))23 __min_vector_width__(256)))
24#define __DEFAULT_FN_ATTRS128 \24#define __DEFAULT_FN_ATTRS128 \
25 __attribute__((__always_inline__, __nodebug__, \25 __attribute__((__always_inline__, __nodebug__, \
26 __target__("avx512fp16,avx512vl,no-evex512"), \26 __target__("avx512fp16,avx512vl"), \
27 __min_vector_width__(128)))27 __min_vector_width__(128)))
2828
29static __inline__ _Float16 __DEFAULT_FN_ATTRS128 _mm_cvtsh_h(__m128h __a) {29#if defined(__cplusplus) && (__cplusplus >= 201103L)
30#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
31#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
32#else
33#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
34#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
35#endif
36
37static __inline__ _Float16 __DEFAULT_FN_ATTRS128_CONSTEXPR
38_mm_cvtsh_h(__m128h __a) {
30 return __a[0];39 return __a[0];
31}40}
3241
33static __inline__ _Float16 __DEFAULT_FN_ATTRS256 _mm256_cvtsh_h(__m256h __a) {42static __inline__ _Float16 __DEFAULT_FN_ATTRS256_CONSTEXPR
43_mm256_cvtsh_h(__m256h __a) {
34 return __a[0];44 return __a[0];
35}45}
3646
37static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_set_sh(_Float16 __h) {47static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
48_mm_set_sh(_Float16 __h) {
38 return __extension__(__m128h){__h, 0, 0, 0, 0, 0, 0, 0};49 return __extension__(__m128h){__h, 0, 0, 0, 0, 0, 0, 0};
39}50}
4051
41static __inline __m128h __DEFAULT_FN_ATTRS128 _mm_set1_ph(_Float16 __h) {52static __inline __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
53_mm_set1_ph(_Float16 __h) {
42 return (__m128h)(__v8hf){__h, __h, __h, __h, __h, __h, __h, __h};54 return (__m128h)(__v8hf){__h, __h, __h, __h, __h, __h, __h, __h};
43}55}
4456
45static __inline __m256h __DEFAULT_FN_ATTRS256 _mm256_set1_ph(_Float16 __h) {57static __inline __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
58_mm256_set1_ph(_Float16 __h) {
46 return (__m256h)(__v16hf){__h, __h, __h, __h, __h, __h, __h, __h,59 return (__m256h)(__v16hf){__h, __h, __h, __h, __h, __h, __h, __h,
47 __h, __h, __h, __h, __h, __h, __h, __h};60 __h, __h, __h, __h, __h, __h, __h, __h};
48}61}
4962
50static __inline __m128h __DEFAULT_FN_ATTRS12863static __inline __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
51_mm_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,64_mm_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,
52 _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8) {65 _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8) {
53 return (__m128h)(__v8hf){__h8, __h7, __h6, __h5, __h4, __h3, __h2, __h1};66 return (__m128h)(__v8hf){__h8, __h7, __h6, __h5, __h4, __h3, __h2, __h1};
54}67}
5568
56static __inline __m256h __DEFAULT_FN_ATTRS25669static __inline __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
57_mm256_set1_pch(_Float16 _Complex h) {70_mm256_set1_pch(_Float16 _Complex h) {
58 return (__m256h)_mm256_set1_ps(__builtin_bit_cast(float, h));71 return (__m256h)_mm256_set1_ps(__builtin_bit_cast(float, h));
59}72}
6073
61static __inline __m128h __DEFAULT_FN_ATTRS12874static __inline __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
62_mm_set1_pch(_Float16 _Complex h) {75_mm_set1_pch(_Float16 _Complex h) {
63 return (__m128h)_mm_set1_ps(__builtin_bit_cast(float, h));76 return (__m128h)_mm_set1_ps(__builtin_bit_cast(float, h));
64}77}
6578
66static __inline __m256h __DEFAULT_FN_ATTRS25679static __inline __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
67_mm256_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,80_mm256_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,
68 _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8,81 _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8,
69 _Float16 __h9, _Float16 __h10, _Float16 __h11, _Float16 __h12,82 _Float16 __h9, _Float16 __h10, _Float16 __h11, _Float16 __h12,
...@@ -73,13 +86,20 @@ _mm256_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,...@@ -73,13 +86,20 @@ _mm256_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4,
73 __h4, __h3, __h2, __h1};86 __h4, __h3, __h2, __h1};
74}87}
7588
76#define _mm_setr_ph(h1, h2, h3, h4, h5, h6, h7, h8) \89static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
77 _mm_set_ph((h8), (h7), (h6), (h5), (h4), (h3), (h2), (h1))90_mm_setr_ph(_Float16 e0, _Float16 e1, _Float16 e2, _Float16 e3, _Float16 e4,
91 _Float16 e5, _Float16 e6, _Float16 e7) {
92 return _mm_set_ph(e7, e6, e5, e4, e3, e2, e1, e0);
93}
7894
79#define _mm256_setr_ph(h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, \95static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
80 h14, h15, h16) \96_mm256_setr_ph(_Float16 e0, _Float16 e1, _Float16 e2, _Float16 e3, _Float16 e4,
81 _mm256_set_ph((h16), (h15), (h14), (h13), (h12), (h11), (h10), (h9), (h8), \97 _Float16 e5, _Float16 e6, _Float16 e7, _Float16 e8, _Float16 e9,
82 (h7), (h6), (h5), (h4), (h3), (h2), (h1))98 _Float16 e10, _Float16 e11, _Float16 e12, _Float16 e13,
99 _Float16 e14, _Float16 e15) {
100 return _mm256_set_ph(e15, e14, e13, e12, e11, e10, e9, e8, e7, e6, e5, e4, e3,
101 e2, e1, e0);
102}
83103
84static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_add_ph(__m256h __A,104static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_add_ph(__m256h __A,
85 __m256h __B) {105 __m256h __B) {
...@@ -229,12 +249,12 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_div_ph(__mmask8 __U,...@@ -229,12 +249,12 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_div_ph(__mmask8 __U,
229 (__v8hf)_mm_setzero_ph());249 (__v8hf)_mm_setzero_ph());
230}250}
231251
232static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_min_ph(__m256h __A,252static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
233 __m256h __B) {253_mm256_min_ph(__m256h __A, __m256h __B) {
234 return (__m256h)__builtin_ia32_minph256((__v16hf)__A, (__v16hf)__B);254 return (__m256h)__builtin_ia32_minph256((__v16hf)__A, (__v16hf)__B);
235}255}
236256
237static __inline__ __m256h __DEFAULT_FN_ATTRS256257static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
238_mm256_mask_min_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {258_mm256_mask_min_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {
239 return (__m256h)__builtin_ia32_selectph_256(259 return (__m256h)__builtin_ia32_selectph_256(
240 (__mmask16)__U,260 (__mmask16)__U,
...@@ -242,7 +262,7 @@ _mm256_mask_min_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {...@@ -242,7 +262,7 @@ _mm256_mask_min_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {
242 (__v16hf)__W);262 (__v16hf)__W);
243}263}
244264
245static __inline__ __m256h __DEFAULT_FN_ATTRS256265static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
246_mm256_maskz_min_ph(__mmask16 __U, __m256h __A, __m256h __B) {266_mm256_maskz_min_ph(__mmask16 __U, __m256h __A, __m256h __B) {
247 return (__m256h)__builtin_ia32_selectph_256(267 return (__m256h)__builtin_ia32_selectph_256(
248 (__mmask16)__U,268 (__mmask16)__U,
...@@ -250,34 +270,31 @@ _mm256_maskz_min_ph(__mmask16 __U, __m256h __A, __m256h __B) {...@@ -250,34 +270,31 @@ _mm256_maskz_min_ph(__mmask16 __U, __m256h __A, __m256h __B) {
250 (__v16hf)_mm256_setzero_ph());270 (__v16hf)_mm256_setzero_ph());
251}271}
252272
253static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_min_ph(__m128h __A,273static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
254 __m128h __B) {274_mm_min_ph(__m128h __A, __m128h __B) {
255 return (__m128h)__builtin_ia32_minph128((__v8hf)__A, (__v8hf)__B);275 return (__m128h)__builtin_ia32_minph128((__v8hf)__A, (__v8hf)__B);
256}276}
257277
258static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_min_ph(__m128h __W,278static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
259 __mmask8 __U,279_mm_mask_min_ph(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
260 __m128h __A,
261 __m128h __B) {
262 return (__m128h)__builtin_ia32_selectph_128(280 return (__m128h)__builtin_ia32_selectph_128(
263 (__mmask8)__U, (__v8hf)__builtin_ia32_minph128((__v8hf)__A, (__v8hf)__B),281 (__mmask8)__U, (__v8hf)__builtin_ia32_minph128((__v8hf)__A, (__v8hf)__B),
264 (__v8hf)__W);282 (__v8hf)__W);
265}283}
266284
267static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_min_ph(__mmask8 __U,285static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
268 __m128h __A,286_mm_maskz_min_ph(__mmask8 __U, __m128h __A, __m128h __B) {
269 __m128h __B) {
270 return (__m128h)__builtin_ia32_selectph_128(287 return (__m128h)__builtin_ia32_selectph_128(
271 (__mmask8)__U, (__v8hf)__builtin_ia32_minph128((__v8hf)__A, (__v8hf)__B),288 (__mmask8)__U, (__v8hf)__builtin_ia32_minph128((__v8hf)__A, (__v8hf)__B),
272 (__v8hf)_mm_setzero_ph());289 (__v8hf)_mm_setzero_ph());
273}290}
274291
275static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_max_ph(__m256h __A,292static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
276 __m256h __B) {293_mm256_max_ph(__m256h __A, __m256h __B) {
277 return (__m256h)__builtin_ia32_maxph256((__v16hf)__A, (__v16hf)__B);294 return (__m256h)__builtin_ia32_maxph256((__v16hf)__A, (__v16hf)__B);
278}295}
279296
280static __inline__ __m256h __DEFAULT_FN_ATTRS256297static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
281_mm256_mask_max_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {298_mm256_mask_max_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {
282 return (__m256h)__builtin_ia32_selectph_256(299 return (__m256h)__builtin_ia32_selectph_256(
283 (__mmask16)__U,300 (__mmask16)__U,
...@@ -285,7 +302,7 @@ _mm256_mask_max_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {...@@ -285,7 +302,7 @@ _mm256_mask_max_ph(__m256h __W, __mmask16 __U, __m256h __A, __m256h __B) {
285 (__v16hf)__W);302 (__v16hf)__W);
286}303}
287304
288static __inline__ __m256h __DEFAULT_FN_ATTRS256305static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
289_mm256_maskz_max_ph(__mmask16 __U, __m256h __A, __m256h __B) {306_mm256_maskz_max_ph(__mmask16 __U, __m256h __A, __m256h __B) {
290 return (__m256h)__builtin_ia32_selectph_256(307 return (__m256h)__builtin_ia32_selectph_256(
291 (__mmask16)__U,308 (__mmask16)__U,
...@@ -293,33 +310,32 @@ _mm256_maskz_max_ph(__mmask16 __U, __m256h __A, __m256h __B) {...@@ -293,33 +310,32 @@ _mm256_maskz_max_ph(__mmask16 __U, __m256h __A, __m256h __B) {
293 (__v16hf)_mm256_setzero_ph());310 (__v16hf)_mm256_setzero_ph());
294}311}
295312
296static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_max_ph(__m128h __A,313static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
297 __m128h __B) {314_mm_max_ph(__m128h __A, __m128h __B) {
298 return (__m128h)__builtin_ia32_maxph128((__v8hf)__A, (__v8hf)__B);315 return (__m128h)__builtin_ia32_maxph128((__v8hf)__A, (__v8hf)__B);
299}316}
300317
301static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_max_ph(__m128h __W,318static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
302 __mmask8 __U,319_mm_mask_max_ph(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
303 __m128h __A,
304 __m128h __B) {
305 return (__m128h)__builtin_ia32_selectph_128(320 return (__m128h)__builtin_ia32_selectph_128(
306 (__mmask8)__U, (__v8hf)__builtin_ia32_maxph128((__v8hf)__A, (__v8hf)__B),321 (__mmask8)__U, (__v8hf)__builtin_ia32_maxph128((__v8hf)__A, (__v8hf)__B),
307 (__v8hf)__W);322 (__v8hf)__W);
308}323}
309324
310static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_max_ph(__mmask8 __U,325static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
311 __m128h __A,326_mm_maskz_max_ph(__mmask8 __U, __m128h __A, __m128h __B) {
312 __m128h __B) {
313 return (__m128h)__builtin_ia32_selectph_128(327 return (__m128h)__builtin_ia32_selectph_128(
314 (__mmask8)__U, (__v8hf)__builtin_ia32_maxph128((__v8hf)__A, (__v8hf)__B),328 (__mmask8)__U, (__v8hf)__builtin_ia32_maxph128((__v8hf)__A, (__v8hf)__B),
315 (__v8hf)_mm_setzero_ph());329 (__v8hf)_mm_setzero_ph());
316}330}
317331
318static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_abs_ph(__m256h __A) {332static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
333_mm256_abs_ph(__m256h __A) {
319 return (__m256h)_mm256_and_epi32(_mm256_set1_epi32(0x7FFF7FFF), (__m256i)__A);334 return (__m256h)_mm256_and_epi32(_mm256_set1_epi32(0x7FFF7FFF), (__m256i)__A);
320}335}
321336
322static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_abs_ph(__m128h __A) {337static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
338_mm_abs_ph(__m128h __A) {
323 return (__m128h)_mm_and_epi32(_mm_set1_epi32(0x7FFF7FFF), (__m128i)__A);339 return (__m128h)_mm_and_epi32(_mm_set1_epi32(0x7FFF7FFF), (__m128i)__A);
324}340}
325341
...@@ -601,7 +617,7 @@ _mm256_maskz_scalef_ph(__mmask16 __U, __m256h __A, __m256h __B) {...@@ -601,7 +617,7 @@ _mm256_maskz_scalef_ph(__mmask16 __U, __m256h __A, __m256h __B) {
601 (__mmask16)(U)))617 (__mmask16)(U)))
602618
603static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_sqrt_ph(__m128h __a) {619static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_sqrt_ph(__m128h __a) {
604 return __builtin_ia32_sqrtph((__v8hf)__a);620 return __builtin_elementwise_sqrt(__a);
605}621}
606622
607static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_sqrt_ph(__m128h __W,623static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_sqrt_ph(__m128h __W,
...@@ -618,7 +634,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_sqrt_ph(__mmask8 __U,...@@ -618,7 +634,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_sqrt_ph(__mmask8 __U,
618}634}
619635
620static __inline __m256h __DEFAULT_FN_ATTRS256 _mm256_sqrt_ph(__m256h __a) {636static __inline __m256h __DEFAULT_FN_ATTRS256 _mm256_sqrt_ph(__m256h __a) {
621 return (__m256h)__builtin_ia32_sqrtph256((__v16hf)__a);637 return __builtin_elementwise_sqrt(__a);
622}638}
623639
624static __inline__ __m256h __DEFAULT_FN_ATTRS256640static __inline__ __m256h __DEFAULT_FN_ATTRS256
...@@ -790,34 +806,35 @@ _mm256_maskz_cvttph_epi16(__mmask16 __U, __m256h __A) {...@@ -790,34 +806,35 @@ _mm256_maskz_cvttph_epi16(__mmask16 __U, __m256h __A) {
790 (__v16hf)__A, (__v16hi)_mm256_setzero_si256(), (__mmask16)__U);806 (__v16hf)__A, (__v16hi)_mm256_setzero_si256(), (__mmask16)__U);
791}807}
792808
793static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_cvtepi16_ph(__m128i __A) {809static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
810_mm_cvtepi16_ph(__m128i __A) {
794 return (__m128h) __builtin_convertvector((__v8hi)__A, __v8hf);811 return (__m128h) __builtin_convertvector((__v8hi)__A, __v8hf);
795}812}
796813
797static __inline__ __m128h __DEFAULT_FN_ATTRS128814static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
798_mm_mask_cvtepi16_ph(__m128h __W, __mmask8 __U, __m128i __A) {815_mm_mask_cvtepi16_ph(__m128h __W, __mmask8 __U, __m128i __A) {
799 return (__m128h)__builtin_ia32_selectph_128(816 return (__m128h)__builtin_ia32_selectph_128(
800 (__mmask8)__U, (__v8hf)_mm_cvtepi16_ph(__A), (__v8hf)__W);817 (__mmask8)__U, (__v8hf)_mm_cvtepi16_ph(__A), (__v8hf)__W);
801}818}
802819
803static __inline__ __m128h __DEFAULT_FN_ATTRS128820static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
804_mm_maskz_cvtepi16_ph(__mmask8 __U, __m128i __A) {821_mm_maskz_cvtepi16_ph(__mmask8 __U, __m128i __A) {
805 return (__m128h)__builtin_ia32_selectph_128(822 return (__m128h)__builtin_ia32_selectph_128(
806 (__mmask8)__U, (__v8hf)_mm_cvtepi16_ph(__A), (__v8hf)_mm_setzero_ph());823 (__mmask8)__U, (__v8hf)_mm_cvtepi16_ph(__A), (__v8hf)_mm_setzero_ph());
807}824}
808825
809static __inline__ __m256h __DEFAULT_FN_ATTRS256826static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
810_mm256_cvtepi16_ph(__m256i __A) {827_mm256_cvtepi16_ph(__m256i __A) {
811 return (__m256h) __builtin_convertvector((__v16hi)__A, __v16hf);828 return (__m256h) __builtin_convertvector((__v16hi)__A, __v16hf);
812}829}
813830
814static __inline__ __m256h __DEFAULT_FN_ATTRS256831static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
815_mm256_mask_cvtepi16_ph(__m256h __W, __mmask16 __U, __m256i __A) {832_mm256_mask_cvtepi16_ph(__m256h __W, __mmask16 __U, __m256i __A) {
816 return (__m256h)__builtin_ia32_selectph_256(833 return (__m256h)__builtin_ia32_selectph_256(
817 (__mmask16)__U, (__v16hf)_mm256_cvtepi16_ph(__A), (__v16hf)__W);834 (__mmask16)__U, (__v16hf)_mm256_cvtepi16_ph(__A), (__v16hf)__W);
818}835}
819836
820static __inline__ __m256h __DEFAULT_FN_ATTRS256837static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
821_mm256_maskz_cvtepi16_ph(__mmask16 __U, __m256i __A) {838_mm256_maskz_cvtepi16_ph(__mmask16 __U, __m256i __A) {
822 return (__m256h)__builtin_ia32_selectph_256((__mmask16)__U,839 return (__m256h)__builtin_ia32_selectph_256((__mmask16)__U,
823 (__v16hf)_mm256_cvtepi16_ph(__A),840 (__v16hf)_mm256_cvtepi16_ph(__A),
...@@ -894,34 +911,35 @@ _mm256_maskz_cvttph_epu16(__mmask16 __U, __m256h __A) {...@@ -894,34 +911,35 @@ _mm256_maskz_cvttph_epu16(__mmask16 __U, __m256h __A) {
894 (__v16hf)__A, (__v16hu)_mm256_setzero_si256(), (__mmask16)__U);911 (__v16hf)__A, (__v16hu)_mm256_setzero_si256(), (__mmask16)__U);
895}912}
896913
897static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_cvtepu16_ph(__m128i __A) {914static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
915_mm_cvtepu16_ph(__m128i __A) {
898 return (__m128h) __builtin_convertvector((__v8hu)__A, __v8hf);916 return (__m128h) __builtin_convertvector((__v8hu)__A, __v8hf);
899}917}
900918
901static __inline__ __m128h __DEFAULT_FN_ATTRS128919static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
902_mm_mask_cvtepu16_ph(__m128h __W, __mmask8 __U, __m128i __A) {920_mm_mask_cvtepu16_ph(__m128h __W, __mmask8 __U, __m128i __A) {
903 return (__m128h)__builtin_ia32_selectph_128(921 return (__m128h)__builtin_ia32_selectph_128(
904 (__mmask8)__U, (__v8hf)_mm_cvtepu16_ph(__A), (__v8hf)__W);922 (__mmask8)__U, (__v8hf)_mm_cvtepu16_ph(__A), (__v8hf)__W);
905}923}
906924
907static __inline__ __m128h __DEFAULT_FN_ATTRS128925static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
908_mm_maskz_cvtepu16_ph(__mmask8 __U, __m128i __A) {926_mm_maskz_cvtepu16_ph(__mmask8 __U, __m128i __A) {
909 return (__m128h)__builtin_ia32_selectph_128(927 return (__m128h)__builtin_ia32_selectph_128(
910 (__mmask8)__U, (__v8hf)_mm_cvtepu16_ph(__A), (__v8hf)_mm_setzero_ph());928 (__mmask8)__U, (__v8hf)_mm_cvtepu16_ph(__A), (__v8hf)_mm_setzero_ph());
911}929}
912930
913static __inline__ __m256h __DEFAULT_FN_ATTRS256931static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
914_mm256_cvtepu16_ph(__m256i __A) {932_mm256_cvtepu16_ph(__m256i __A) {
915 return (__m256h) __builtin_convertvector((__v16hu)__A, __v16hf);933 return (__m256h) __builtin_convertvector((__v16hu)__A, __v16hf);
916}934}
917935
918static __inline__ __m256h __DEFAULT_FN_ATTRS256936static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
919_mm256_mask_cvtepu16_ph(__m256h __W, __mmask16 __U, __m256i __A) {937_mm256_mask_cvtepu16_ph(__m256h __W, __mmask16 __U, __m256i __A) {
920 return (__m256h)__builtin_ia32_selectph_256(938 return (__m256h)__builtin_ia32_selectph_256(
921 (__mmask16)__U, (__v16hf)_mm256_cvtepu16_ph(__A), (__v16hf)__W);939 (__mmask16)__U, (__v16hf)_mm256_cvtepu16_ph(__A), (__v16hf)__W);
922}940}
923941
924static __inline__ __m256h __DEFAULT_FN_ATTRS256942static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
925_mm256_maskz_cvtepu16_ph(__mmask16 __U, __m256i __A) {943_mm256_maskz_cvtepu16_ph(__mmask16 __U, __m256i __A) {
926 return (__m256h)__builtin_ia32_selectph_256((__mmask16)__U,944 return (__m256h)__builtin_ia32_selectph_256((__mmask16)__U,
927 (__v16hf)_mm256_cvtepu16_ph(__A),945 (__v16hf)_mm256_cvtepu16_ph(__A),
...@@ -1015,18 +1033,18 @@ _mm_maskz_cvtepi32_ph(__mmask8 __U, __m128i __A) {...@@ -1015,18 +1033,18 @@ _mm_maskz_cvtepi32_ph(__mmask8 __U, __m128i __A) {
1015 (__v4si)__A, (__v8hf)_mm_setzero_ph(), (__mmask8)__U);1033 (__v4si)__A, (__v8hf)_mm_setzero_ph(), (__mmask8)__U);
1016}1034}
10171035
1018static __inline__ __m128h __DEFAULT_FN_ATTRS2561036static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
1019_mm256_cvtepi32_ph(__m256i __A) {1037_mm256_cvtepi32_ph(__m256i __A) {
1020 return (__m128h) __builtin_convertvector((__v8si)__A, __v8hf);1038 return (__m128h) __builtin_convertvector((__v8si)__A, __v8hf);
1021}1039}
10221040
1023static __inline__ __m128h __DEFAULT_FN_ATTRS2561041static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
1024_mm256_mask_cvtepi32_ph(__m128h __W, __mmask8 __U, __m256i __A) {1042_mm256_mask_cvtepi32_ph(__m128h __W, __mmask8 __U, __m256i __A) {
1025 return (__m128h)__builtin_ia32_selectph_128(1043 return (__m128h)__builtin_ia32_selectph_128(
1026 (__mmask8)__U, (__v8hf)_mm256_cvtepi32_ph(__A), (__v8hf)__W);1044 (__mmask8)__U, (__v8hf)_mm256_cvtepi32_ph(__A), (__v8hf)__W);
1027}1045}
10281046
1029static __inline__ __m128h __DEFAULT_FN_ATTRS2561047static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
1030_mm256_maskz_cvtepi32_ph(__mmask8 __U, __m256i __A) {1048_mm256_maskz_cvtepi32_ph(__mmask8 __U, __m256i __A) {
1031 return (__m128h)__builtin_ia32_selectph_128(1049 return (__m128h)__builtin_ia32_selectph_128(
1032 (__mmask8)__U, (__v8hf)_mm256_cvtepi32_ph(__A), (__v8hf)_mm_setzero_ph());1050 (__mmask8)__U, (__v8hf)_mm256_cvtepi32_ph(__A), (__v8hf)_mm_setzero_ph());
...@@ -1049,18 +1067,18 @@ _mm_maskz_cvtepu32_ph(__mmask8 __U, __m128i __A) {...@@ -1049,18 +1067,18 @@ _mm_maskz_cvtepu32_ph(__mmask8 __U, __m128i __A) {
1049 (__v4su)__A, (__v8hf)_mm_setzero_ph(), (__mmask8)__U);1067 (__v4su)__A, (__v8hf)_mm_setzero_ph(), (__mmask8)__U);
1050}1068}
10511069
1052static __inline__ __m128h __DEFAULT_FN_ATTRS2561070static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
1053_mm256_cvtepu32_ph(__m256i __A) {1071_mm256_cvtepu32_ph(__m256i __A) {
1054 return (__m128h) __builtin_convertvector((__v8su)__A, __v8hf);1072 return (__m128h) __builtin_convertvector((__v8su)__A, __v8hf);
1055}1073}
10561074
1057static __inline__ __m128h __DEFAULT_FN_ATTRS2561075static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
1058_mm256_mask_cvtepu32_ph(__m128h __W, __mmask8 __U, __m256i __A) {1076_mm256_mask_cvtepu32_ph(__m128h __W, __mmask8 __U, __m256i __A) {
1059 return (__m128h)__builtin_ia32_selectph_128(1077 return (__m128h)__builtin_ia32_selectph_128(
1060 (__mmask8)__U, (__v8hf)_mm256_cvtepu32_ph(__A), (__v8hf)__W);1078 (__mmask8)__U, (__v8hf)_mm256_cvtepu32_ph(__A), (__v8hf)__W);
1061}1079}
10621080
1063static __inline__ __m128h __DEFAULT_FN_ATTRS2561081static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
1064_mm256_maskz_cvtepu32_ph(__mmask8 __U, __m256i __A) {1082_mm256_maskz_cvtepu32_ph(__mmask8 __U, __m256i __A) {
1065 return (__m128h)__builtin_ia32_selectph_128(1083 return (__m128h)__builtin_ia32_selectph_128(
1066 (__mmask8)__U, (__v8hf)_mm256_cvtepu32_ph(__A), (__v8hf)_mm_setzero_ph());1084 (__mmask8)__U, (__v8hf)_mm256_cvtepu32_ph(__A), (__v8hf)_mm_setzero_ph());
...@@ -1419,8 +1437,8 @@ _mm256_maskz_cvtxps_ph(__mmask8 __U, __m256 __A) {...@@ -1419,8 +1437,8 @@ _mm256_maskz_cvtxps_ph(__mmask8 __U, __m256 __A) {
1419static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fmadd_ph(__m128h __A,1437static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fmadd_ph(__m128h __A,
1420 __m128h __B,1438 __m128h __B,
1421 __m128h __C) {1439 __m128h __C) {
1422 return (__m128h)__builtin_ia32_vfmaddph((__v8hf)__A, (__v8hf)__B,1440 return (__m128h)__builtin_elementwise_fma((__v8hf)__A, (__v8hf)__B,
1423 (__v8hf)__C);1441 (__v8hf)__C);
1424}1442}
14251443
1426static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_fmadd_ph(__m128h __A,1444static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_fmadd_ph(__m128h __A,
...@@ -1429,7 +1447,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_fmadd_ph(__m128h __A,...@@ -1429,7 +1447,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_fmadd_ph(__m128h __A,
1429 __m128h __C) {1447 __m128h __C) {
1430 return (__m128h)__builtin_ia32_selectph_128(1448 return (__m128h)__builtin_ia32_selectph_128(
1431 (__mmask8)__U,1449 (__mmask8)__U,
1432 __builtin_ia32_vfmaddph((__v8hf)__A, (__v8hf)__B, (__v8hf)__C),1450 __builtin_elementwise_fma((__v8hf)__A, (__v8hf)__B, (__v8hf)__C),
1433 (__v8hf)__A);1451 (__v8hf)__A);
1434}1452}
14351453
...@@ -1437,7 +1455,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1437,7 +1455,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1437_mm_mask3_fmadd_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {1455_mm_mask3_fmadd_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {
1438 return (__m128h)__builtin_ia32_selectph_128(1456 return (__m128h)__builtin_ia32_selectph_128(
1439 (__mmask8)__U,1457 (__mmask8)__U,
1440 __builtin_ia32_vfmaddph((__v8hf)__A, (__v8hf)__B, (__v8hf)__C),1458 __builtin_elementwise_fma((__v8hf)__A, (__v8hf)__B, (__v8hf)__C),
1441 (__v8hf)__C);1459 (__v8hf)__C);
1442}1460}
14431461
...@@ -1445,15 +1463,15 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1445,15 +1463,15 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1445_mm_maskz_fmadd_ph(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) {1463_mm_maskz_fmadd_ph(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) {
1446 return (__m128h)__builtin_ia32_selectph_128(1464 return (__m128h)__builtin_ia32_selectph_128(
1447 (__mmask8)__U,1465 (__mmask8)__U,
1448 __builtin_ia32_vfmaddph((__v8hf)__A, (__v8hf)__B, (__v8hf)__C),1466 __builtin_elementwise_fma((__v8hf)__A, (__v8hf)__B, (__v8hf)__C),
1449 (__v8hf)_mm_setzero_ph());1467 (__v8hf)_mm_setzero_ph());
1450}1468}
14511469
1452static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fmsub_ph(__m128h __A,1470static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fmsub_ph(__m128h __A,
1453 __m128h __B,1471 __m128h __B,
1454 __m128h __C) {1472 __m128h __C) {
1455 return (__m128h)__builtin_ia32_vfmaddph((__v8hf)__A, (__v8hf)__B,1473 return (__m128h)__builtin_elementwise_fma((__v8hf)__A, (__v8hf)__B,
1456 -(__v8hf)__C);1474 -(__v8hf)__C);
1457}1475}
14581476
1459static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_fmsub_ph(__m128h __A,1477static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_fmsub_ph(__m128h __A,
...@@ -1476,7 +1494,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1476,7 +1494,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1476_mm_mask3_fnmadd_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {1494_mm_mask3_fnmadd_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {
1477 return (__m128h)__builtin_ia32_selectph_128(1495 return (__m128h)__builtin_ia32_selectph_128(
1478 (__mmask8)__U,1496 (__mmask8)__U,
1479 __builtin_ia32_vfmaddph(-(__v8hf)__A, (__v8hf)__B, (__v8hf)__C),1497 __builtin_elementwise_fma(-(__v8hf)__A, (__v8hf)__B, (__v8hf)__C),
1480 (__v8hf)__C);1498 (__v8hf)__C);
1481}1499}
14821500
...@@ -1484,7 +1502,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1484,7 +1502,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1484_mm_maskz_fnmadd_ph(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) {1502_mm_maskz_fnmadd_ph(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) {
1485 return (__m128h)__builtin_ia32_selectph_128(1503 return (__m128h)__builtin_ia32_selectph_128(
1486 (__mmask8)__U,1504 (__mmask8)__U,
1487 __builtin_ia32_vfmaddph(-(__v8hf)__A, (__v8hf)__B, (__v8hf)__C),1505 __builtin_elementwise_fma(-(__v8hf)__A, (__v8hf)__B, (__v8hf)__C),
1488 (__v8hf)_mm_setzero_ph());1506 (__v8hf)_mm_setzero_ph());
1489}1507}
14901508
...@@ -1492,22 +1510,22 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1492,22 +1510,22 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1492_mm_maskz_fnmsub_ph(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) {1510_mm_maskz_fnmsub_ph(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) {
1493 return (__m128h)__builtin_ia32_selectph_128(1511 return (__m128h)__builtin_ia32_selectph_128(
1494 (__mmask8)__U,1512 (__mmask8)__U,
1495 __builtin_ia32_vfmaddph(-(__v8hf)__A, (__v8hf)__B, -(__v8hf)__C),1513 __builtin_elementwise_fma(-(__v8hf)__A, (__v8hf)__B, -(__v8hf)__C),
1496 (__v8hf)_mm_setzero_ph());1514 (__v8hf)_mm_setzero_ph());
1497}1515}
14981516
1499static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fmadd_ph(__m256h __A,1517static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fmadd_ph(__m256h __A,
1500 __m256h __B,1518 __m256h __B,
1501 __m256h __C) {1519 __m256h __C) {
1502 return (__m256h)__builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B,1520 return (__m256h)__builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B,
1503 (__v16hf)__C);1521 (__v16hf)__C);
1504}1522}
15051523
1506static __inline__ __m256h __DEFAULT_FN_ATTRS2561524static __inline__ __m256h __DEFAULT_FN_ATTRS256
1507_mm256_mask_fmadd_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {1525_mm256_mask_fmadd_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {
1508 return (__m256h)__builtin_ia32_selectph_256(1526 return (__m256h)__builtin_ia32_selectph_256(
1509 (__mmask16)__U,1527 (__mmask16)__U,
1510 __builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B, (__v16hf)__C),1528 __builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B, (__v16hf)__C),
1511 (__v16hf)__A);1529 (__v16hf)__A);
1512}1530}
15131531
...@@ -1515,7 +1533,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1515,7 +1533,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1515_mm256_mask3_fmadd_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {1533_mm256_mask3_fmadd_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {
1516 return (__m256h)__builtin_ia32_selectph_256(1534 return (__m256h)__builtin_ia32_selectph_256(
1517 (__mmask16)__U,1535 (__mmask16)__U,
1518 __builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B, (__v16hf)__C),1536 __builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B, (__v16hf)__C),
1519 (__v16hf)__C);1537 (__v16hf)__C);
1520}1538}
15211539
...@@ -1523,22 +1541,22 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1523,22 +1541,22 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1523_mm256_maskz_fmadd_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {1541_mm256_maskz_fmadd_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {
1524 return (__m256h)__builtin_ia32_selectph_256(1542 return (__m256h)__builtin_ia32_selectph_256(
1525 (__mmask16)__U,1543 (__mmask16)__U,
1526 __builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B, (__v16hf)__C),1544 __builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B, (__v16hf)__C),
1527 (__v16hf)_mm256_setzero_ph());1545 (__v16hf)_mm256_setzero_ph());
1528}1546}
15291547
1530static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fmsub_ph(__m256h __A,1548static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fmsub_ph(__m256h __A,
1531 __m256h __B,1549 __m256h __B,
1532 __m256h __C) {1550 __m256h __C) {
1533 return (__m256h)__builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B,1551 return (__m256h)__builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B,
1534 -(__v16hf)__C);1552 -(__v16hf)__C);
1535}1553}
15361554
1537static __inline__ __m256h __DEFAULT_FN_ATTRS2561555static __inline__ __m256h __DEFAULT_FN_ATTRS256
1538_mm256_mask_fmsub_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {1556_mm256_mask_fmsub_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {
1539 return (__m256h)__builtin_ia32_selectph_256(1557 return (__m256h)__builtin_ia32_selectph_256(
1540 (__mmask16)__U,1558 (__mmask16)__U,
1541 __builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),1559 __builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),
1542 (__v16hf)__A);1560 (__v16hf)__A);
1543}1561}
15441562
...@@ -1546,7 +1564,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1546,7 +1564,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1546_mm256_maskz_fmsub_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {1564_mm256_maskz_fmsub_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {
1547 return (__m256h)__builtin_ia32_selectph_256(1565 return (__m256h)__builtin_ia32_selectph_256(
1548 (__mmask16)__U,1566 (__mmask16)__U,
1549 __builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),1567 __builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),
1550 (__v16hf)_mm256_setzero_ph());1568 (__v16hf)_mm256_setzero_ph());
1551}1569}
15521570
...@@ -1554,7 +1572,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1554,7 +1572,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1554_mm256_mask3_fnmadd_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {1572_mm256_mask3_fnmadd_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {
1555 return (__m256h)__builtin_ia32_selectph_256(1573 return (__m256h)__builtin_ia32_selectph_256(
1556 (__mmask16)__U,1574 (__mmask16)__U,
1557 __builtin_ia32_vfmaddph256(-(__v16hf)__A, (__v16hf)__B, (__v16hf)__C),1575 __builtin_elementwise_fma(-(__v16hf)__A, (__v16hf)__B, (__v16hf)__C),
1558 (__v16hf)__C);1576 (__v16hf)__C);
1559}1577}
15601578
...@@ -1562,7 +1580,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1562,7 +1580,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1562_mm256_maskz_fnmadd_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {1580_mm256_maskz_fnmadd_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {
1563 return (__m256h)__builtin_ia32_selectph_256(1581 return (__m256h)__builtin_ia32_selectph_256(
1564 (__mmask16)__U,1582 (__mmask16)__U,
1565 __builtin_ia32_vfmaddph256(-(__v16hf)__A, (__v16hf)__B, (__v16hf)__C),1583 __builtin_elementwise_fma(-(__v16hf)__A, (__v16hf)__B, (__v16hf)__C),
1566 (__v16hf)_mm256_setzero_ph());1584 (__v16hf)_mm256_setzero_ph());
1567}1585}
15681586
...@@ -1570,7 +1588,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1570,7 +1588,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1570_mm256_maskz_fnmsub_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {1588_mm256_maskz_fnmsub_ph(__mmask16 __U, __m256h __A, __m256h __B, __m256h __C) {
1571 return (__m256h)__builtin_ia32_selectph_256(1589 return (__m256h)__builtin_ia32_selectph_256(
1572 (__mmask16)__U,1590 (__mmask16)__U,
1573 __builtin_ia32_vfmaddph256(-(__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),1591 __builtin_elementwise_fma(-(__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),
1574 (__v16hf)_mm256_setzero_ph());1592 (__v16hf)_mm256_setzero_ph());
1575}1593}
15761594
...@@ -1684,7 +1702,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1684,7 +1702,7 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1684_mm_mask3_fmsub_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {1702_mm_mask3_fmsub_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {
1685 return (__m128h)__builtin_ia32_selectph_128(1703 return (__m128h)__builtin_ia32_selectph_128(
1686 (__mmask8)__U,1704 (__mmask8)__U,
1687 __builtin_ia32_vfmaddph((__v8hf)__A, (__v8hf)__B, -(__v8hf)__C),1705 __builtin_elementwise_fma((__v8hf)__A, (__v8hf)__B, -(__v8hf)__C),
1688 (__v8hf)__C);1706 (__v8hf)__C);
1689}1707}
16901708
...@@ -1692,7 +1710,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1692,7 +1710,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1692_mm256_mask3_fmsub_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {1710_mm256_mask3_fmsub_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {
1693 return (__m256h)__builtin_ia32_selectph_256(1711 return (__m256h)__builtin_ia32_selectph_256(
1694 (__mmask16)__U,1712 (__mmask16)__U,
1695 __builtin_ia32_vfmaddph256((__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),1713 __builtin_elementwise_fma((__v16hf)__A, (__v16hf)__B, -(__v16hf)__C),
1696 (__v16hf)__C);1714 (__v16hf)__C);
1697}1715}
16981716
...@@ -1715,45 +1733,45 @@ _mm256_mask3_fmsubadd_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {...@@ -1715,45 +1733,45 @@ _mm256_mask3_fmsubadd_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {
1715static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fnmadd_ph(__m128h __A,1733static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fnmadd_ph(__m128h __A,
1716 __m128h __B,1734 __m128h __B,
1717 __m128h __C) {1735 __m128h __C) {
1718 return (__m128h)__builtin_ia32_vfmaddph((__v8hf)__A, -(__v8hf)__B,1736 return (__m128h)__builtin_elementwise_fma((__v8hf)__A, -(__v8hf)__B,
1719 (__v8hf)__C);1737 (__v8hf)__C);
1720}1738}
17211739
1722static __inline__ __m128h __DEFAULT_FN_ATTRS1281740static __inline__ __m128h __DEFAULT_FN_ATTRS128
1723_mm_mask_fnmadd_ph(__m128h __A, __mmask8 __U, __m128h __B, __m128h __C) {1741_mm_mask_fnmadd_ph(__m128h __A, __mmask8 __U, __m128h __B, __m128h __C) {
1724 return (__m128h)__builtin_ia32_selectph_128(1742 return (__m128h)__builtin_ia32_selectph_128(
1725 (__mmask8)__U,1743 (__mmask8)__U,
1726 __builtin_ia32_vfmaddph((__v8hf)__A, -(__v8hf)__B, (__v8hf)__C),1744 __builtin_elementwise_fma((__v8hf)__A, -(__v8hf)__B, (__v8hf)__C),
1727 (__v8hf)__A);1745 (__v8hf)__A);
1728}1746}
17291747
1730static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fnmadd_ph(__m256h __A,1748static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fnmadd_ph(__m256h __A,
1731 __m256h __B,1749 __m256h __B,
1732 __m256h __C) {1750 __m256h __C) {
1733 return (__m256h)__builtin_ia32_vfmaddph256((__v16hf)__A, -(__v16hf)__B,1751 return (__m256h)__builtin_elementwise_fma((__v16hf)__A, -(__v16hf)__B,
1734 (__v16hf)__C);1752 (__v16hf)__C);
1735}1753}
17361754
1737static __inline__ __m256h __DEFAULT_FN_ATTRS2561755static __inline__ __m256h __DEFAULT_FN_ATTRS256
1738_mm256_mask_fnmadd_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {1756_mm256_mask_fnmadd_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {
1739 return (__m256h)__builtin_ia32_selectph_256(1757 return (__m256h)__builtin_ia32_selectph_256(
1740 (__mmask16)__U,1758 (__mmask16)__U,
1741 __builtin_ia32_vfmaddph256((__v16hf)__A, -(__v16hf)__B, (__v16hf)__C),1759 __builtin_elementwise_fma((__v16hf)__A, -(__v16hf)__B, (__v16hf)__C),
1742 (__v16hf)__A);1760 (__v16hf)__A);
1743}1761}
17441762
1745static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fnmsub_ph(__m128h __A,1763static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_fnmsub_ph(__m128h __A,
1746 __m128h __B,1764 __m128h __B,
1747 __m128h __C) {1765 __m128h __C) {
1748 return (__m128h)__builtin_ia32_vfmaddph((__v8hf)__A, -(__v8hf)__B,1766 return (__m128h)__builtin_elementwise_fma((__v8hf)__A, -(__v8hf)__B,
1749 -(__v8hf)__C);1767 -(__v8hf)__C);
1750}1768}
17511769
1752static __inline__ __m128h __DEFAULT_FN_ATTRS1281770static __inline__ __m128h __DEFAULT_FN_ATTRS128
1753_mm_mask_fnmsub_ph(__m128h __A, __mmask8 __U, __m128h __B, __m128h __C) {1771_mm_mask_fnmsub_ph(__m128h __A, __mmask8 __U, __m128h __B, __m128h __C) {
1754 return (__m128h)__builtin_ia32_selectph_128(1772 return (__m128h)__builtin_ia32_selectph_128(
1755 (__mmask8)__U,1773 (__mmask8)__U,
1756 __builtin_ia32_vfmaddph((__v8hf)__A, -(__v8hf)__B, -(__v8hf)__C),1774 __builtin_elementwise_fma((__v8hf)__A, -(__v8hf)__B, -(__v8hf)__C),
1757 (__v8hf)__A);1775 (__v8hf)__A);
1758}1776}
17591777
...@@ -1761,22 +1779,22 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128...@@ -1761,22 +1779,22 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128
1761_mm_mask3_fnmsub_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {1779_mm_mask3_fnmsub_ph(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) {
1762 return (__m128h)__builtin_ia32_selectph_128(1780 return (__m128h)__builtin_ia32_selectph_128(
1763 (__mmask8)__U,1781 (__mmask8)__U,
1764 __builtin_ia32_vfmaddph((__v8hf)__A, -(__v8hf)__B, -(__v8hf)__C),1782 __builtin_elementwise_fma((__v8hf)__A, -(__v8hf)__B, -(__v8hf)__C),
1765 (__v8hf)__C);1783 (__v8hf)__C);
1766}1784}
17671785
1768static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fnmsub_ph(__m256h __A,1786static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_fnmsub_ph(__m256h __A,
1769 __m256h __B,1787 __m256h __B,
1770 __m256h __C) {1788 __m256h __C) {
1771 return (__m256h)__builtin_ia32_vfmaddph256((__v16hf)__A, -(__v16hf)__B,1789 return (__m256h)__builtin_elementwise_fma((__v16hf)__A, -(__v16hf)__B,
1772 -(__v16hf)__C);1790 -(__v16hf)__C);
1773}1791}
17741792
1775static __inline__ __m256h __DEFAULT_FN_ATTRS2561793static __inline__ __m256h __DEFAULT_FN_ATTRS256
1776_mm256_mask_fnmsub_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {1794_mm256_mask_fnmsub_ph(__m256h __A, __mmask16 __U, __m256h __B, __m256h __C) {
1777 return (__m256h)__builtin_ia32_selectph_256(1795 return (__m256h)__builtin_ia32_selectph_256(
1778 (__mmask16)__U,1796 (__mmask16)__U,
1779 __builtin_ia32_vfmaddph256((__v16hf)__A, -(__v16hf)__B, -(__v16hf)__C),1797 __builtin_elementwise_fma((__v16hf)__A, -(__v16hf)__B, -(__v16hf)__C),
1780 (__v16hf)__A);1798 (__v16hf)__A);
1781}1799}
17821800
...@@ -1784,7 +1802,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256...@@ -1784,7 +1802,7 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256
1784_mm256_mask3_fnmsub_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {1802_mm256_mask3_fnmsub_ph(__m256h __A, __m256h __B, __m256h __C, __mmask16 __U) {
1785 return (__m256h)__builtin_ia32_selectph_256(1803 return (__m256h)__builtin_ia32_selectph_256(
1786 (__mmask16)__U,1804 (__mmask16)__U,
1787 __builtin_ia32_vfmaddph256((__v16hf)__A, -(__v16hf)__B, -(__v16hf)__C),1805 __builtin_elementwise_fma((__v16hf)__A, -(__v16hf)__B, -(__v16hf)__C),
1788 (__v16hf)__C);1806 (__v16hf)__C);
1789}1807}
17901808
...@@ -1974,37 +1992,36 @@ _mm256_maskz_fmadd_pch(__mmask8 __U, __m256h __A, __m256h __B, __m256h __C) {...@@ -1974,37 +1992,36 @@ _mm256_maskz_fmadd_pch(__mmask8 __U, __m256h __A, __m256h __B, __m256h __C) {
1974 (__v8sf)__C, (__mmask8)__U);1992 (__v8sf)__C, (__mmask8)__U);
1975}1993}
19761994
1977static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_blend_ph(__mmask8 __U,1995static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
1978 __m128h __A,1996_mm_mask_blend_ph(__mmask8 __U, __m128h __A, __m128h __W) {
1979 __m128h __W) {
1980 return (__m128h)__builtin_ia32_selectph_128((__mmask8)__U, (__v8hf)__W,1997 return (__m128h)__builtin_ia32_selectph_128((__mmask8)__U, (__v8hf)__W,
1981 (__v8hf)__A);1998 (__v8hf)__A);
1982}1999}
19832000
1984static __inline__ __m256h __DEFAULT_FN_ATTRS2562001static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
1985_mm256_mask_blend_ph(__mmask16 __U, __m256h __A, __m256h __W) {2002_mm256_mask_blend_ph(__mmask16 __U, __m256h __A, __m256h __W) {
1986 return (__m256h)__builtin_ia32_selectph_256((__mmask16)__U, (__v16hf)__W,2003 return (__m256h)__builtin_ia32_selectph_256((__mmask16)__U, (__v16hf)__W,
1987 (__v16hf)__A);2004 (__v16hf)__A);
1988}2005}
19892006
1990static __inline__ __m128h __DEFAULT_FN_ATTRS1282007static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
1991_mm_permutex2var_ph(__m128h __A, __m128i __I, __m128h __B) {2008_mm_permutex2var_ph(__m128h __A, __m128i __I, __m128h __B) {
1992 return (__m128h)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,2009 return (__m128h)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,
1993 (__v8hi)__B);2010 (__v8hi)__B);
1994}2011}
19952012
1996static __inline__ __m256h __DEFAULT_FN_ATTRS2562013static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
1997_mm256_permutex2var_ph(__m256h __A, __m256i __I, __m256h __B) {2014_mm256_permutex2var_ph(__m256h __A, __m256i __I, __m256h __B) {
1998 return (__m256h)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,2015 return (__m256h)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,
1999 (__v16hi)__B);2016 (__v16hi)__B);
2000}2017}
20012018
2002static __inline__ __m128h __DEFAULT_FN_ATTRS1282019static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
2003_mm_permutexvar_ph(__m128i __A, __m128h __B) {2020_mm_permutexvar_ph(__m128i __A, __m128h __B) {
2004 return (__m128h)__builtin_ia32_permvarhi128((__v8hi)__B, (__v8hi)__A);2021 return (__m128h)__builtin_ia32_permvarhi128((__v8hi)__B, (__v8hi)__A);
2005}2022}
20062023
2007static __inline__ __m256h __DEFAULT_FN_ATTRS2562024static __inline__ __m256h __DEFAULT_FN_ATTRS256_CONSTEXPR
2008_mm256_permutexvar_ph(__m256i __A, __m256h __B) {2025_mm256_permutexvar_ph(__m256i __A, __m256h __B) {
2009 return (__m256h)__builtin_ia32_permvarhi256((__v16hi)__B, (__v16hi)__A);2026 return (__m256h)__builtin_ia32_permvarhi256((__v16hi)__B, (__v16hi)__A);
2010}2027}
...@@ -2066,6 +2083,8 @@ _mm_reduce_min_ph(__m128h __V) {...@@ -2066,6 +2083,8 @@ _mm_reduce_min_ph(__m128h __V) {
20662083
2067#undef __DEFAULT_FN_ATTRS1282084#undef __DEFAULT_FN_ATTRS128
2068#undef __DEFAULT_FN_ATTRS2562085#undef __DEFAULT_FN_ATTRS256
2086#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
2087#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
20692088
2070#endif2089#endif
2071#endif2090#endif
lib/include/avx512vlintrin.h+945-1299
...@@ -15,14 +15,20 @@...@@ -15,14 +15,20 @@
15#define __AVX512VLINTRIN_H15#define __AVX512VLINTRIN_H
1616
17#define __DEFAULT_FN_ATTRS128 \17#define __DEFAULT_FN_ATTRS128 \
18 __attribute__((__always_inline__, __nodebug__, \18 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl"), \
19 __target__("avx512vl,no-evex512"), \
20 __min_vector_width__(128)))19 __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 \20#define __DEFAULT_FN_ATTRS256 \
22 __attribute__((__always_inline__, __nodebug__, \21 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl"), \
23 __target__("avx512vl,no-evex512"), \
24 __min_vector_width__(256)))22 __min_vector_width__(256)))
2523
24#if defined(__cplusplus) && (__cplusplus >= 201103L)
25#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
26#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
27#else
28#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
29#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
30#endif
31
26typedef short __v2hi __attribute__((__vector_size__(4)));32typedef short __v2hi __attribute__((__vector_size__(4)));
27typedef char __v4qi __attribute__((__vector_size__(4)));33typedef char __v4qi __attribute__((__vector_size__(4)));
28typedef char __v2qi __attribute__((__vector_size__(2)));34typedef char __v2qi __attribute__((__vector_size__(2)));
...@@ -229,209 +235,183 @@ typedef char __v2qi __attribute__((__vector_size__(2)));...@@ -229,209 +235,183 @@ typedef char __v2qi __attribute__((__vector_size__(2)));
229#define _mm256_mask_cmpneq_epu64_mask(k, A, B) \235#define _mm256_mask_cmpneq_epu64_mask(k, A, B) \
230 _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE)236 _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE)
231237
232static __inline__ __m256i __DEFAULT_FN_ATTRS256238static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
233_mm256_mask_add_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)239_mm256_mask_add_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {
234{
235 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,240 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
236 (__v8si)_mm256_add_epi32(__A, __B),241 (__v8si)_mm256_add_epi32(__A, __B),
237 (__v8si)__W);242 (__v8si)__W);
238}243}
239244
240static __inline__ __m256i __DEFAULT_FN_ATTRS256245static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
241_mm256_maskz_add_epi32(__mmask8 __U, __m256i __A, __m256i __B)246_mm256_maskz_add_epi32(__mmask8 __U, __m256i __A, __m256i __B) {
242{
243 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,247 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
244 (__v8si)_mm256_add_epi32(__A, __B),248 (__v8si)_mm256_add_epi32(__A, __B),
245 (__v8si)_mm256_setzero_si256());249 (__v8si)_mm256_setzero_si256());
246}250}
247251
248static __inline__ __m256i __DEFAULT_FN_ATTRS256252static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
249_mm256_mask_add_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)253_mm256_mask_add_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {
250{
251 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,254 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
252 (__v4di)_mm256_add_epi64(__A, __B),255 (__v4di)_mm256_add_epi64(__A, __B),
253 (__v4di)__W);256 (__v4di)__W);
254}257}
255258
256static __inline__ __m256i __DEFAULT_FN_ATTRS256259static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
257_mm256_maskz_add_epi64(__mmask8 __U, __m256i __A, __m256i __B)260_mm256_maskz_add_epi64(__mmask8 __U, __m256i __A, __m256i __B) {
258{
259 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,261 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
260 (__v4di)_mm256_add_epi64(__A, __B),262 (__v4di)_mm256_add_epi64(__A, __B),
261 (__v4di)_mm256_setzero_si256());263 (__v4di)_mm256_setzero_si256());
262}264}
263265
264static __inline__ __m256i __DEFAULT_FN_ATTRS256266static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
265_mm256_mask_sub_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)267_mm256_mask_sub_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {
266{
267 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,268 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
268 (__v8si)_mm256_sub_epi32(__A, __B),269 (__v8si)_mm256_sub_epi32(__A, __B),
269 (__v8si)__W);270 (__v8si)__W);
270}271}
271272
272static __inline__ __m256i __DEFAULT_FN_ATTRS256273static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
273_mm256_maskz_sub_epi32(__mmask8 __U, __m256i __A, __m256i __B)274_mm256_maskz_sub_epi32(__mmask8 __U, __m256i __A, __m256i __B) {
274{
275 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,275 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
276 (__v8si)_mm256_sub_epi32(__A, __B),276 (__v8si)_mm256_sub_epi32(__A, __B),
277 (__v8si)_mm256_setzero_si256());277 (__v8si)_mm256_setzero_si256());
278}278}
279279
280static __inline__ __m256i __DEFAULT_FN_ATTRS256280static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
281_mm256_mask_sub_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)281_mm256_mask_sub_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) {
282{
283 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,282 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
284 (__v4di)_mm256_sub_epi64(__A, __B),283 (__v4di)_mm256_sub_epi64(__A, __B),
285 (__v4di)__W);284 (__v4di)__W);
286}285}
287286
288static __inline__ __m256i __DEFAULT_FN_ATTRS256287static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
289_mm256_maskz_sub_epi64(__mmask8 __U, __m256i __A, __m256i __B)288_mm256_maskz_sub_epi64(__mmask8 __U, __m256i __A, __m256i __B) {
290{
291 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,289 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
292 (__v4di)_mm256_sub_epi64(__A, __B),290 (__v4di)_mm256_sub_epi64(__A, __B),
293 (__v4di)_mm256_setzero_si256());291 (__v4di)_mm256_setzero_si256());
294}292}
295293
296static __inline__ __m128i __DEFAULT_FN_ATTRS128294static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
297_mm_mask_add_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)295_mm_mask_add_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
298{
299 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,296 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
300 (__v4si)_mm_add_epi32(__A, __B),297 (__v4si)_mm_add_epi32(__A, __B),
301 (__v4si)__W);298 (__v4si)__W);
302}299}
303300
304static __inline__ __m128i __DEFAULT_FN_ATTRS128301static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
305_mm_maskz_add_epi32(__mmask8 __U, __m128i __A, __m128i __B)302_mm_maskz_add_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
306{
307 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,303 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
308 (__v4si)_mm_add_epi32(__A, __B),304 (__v4si)_mm_add_epi32(__A, __B),
309 (__v4si)_mm_setzero_si128());305 (__v4si)_mm_setzero_si128());
310}306}
311307
312static __inline__ __m128i __DEFAULT_FN_ATTRS128308static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
313_mm_mask_add_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)309_mm_mask_add_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
314{
315 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,310 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
316 (__v2di)_mm_add_epi64(__A, __B),311 (__v2di)_mm_add_epi64(__A, __B),
317 (__v2di)__W);312 (__v2di)__W);
318}313}
319314
320static __inline__ __m128i __DEFAULT_FN_ATTRS128315static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
321_mm_maskz_add_epi64(__mmask8 __U, __m128i __A, __m128i __B)316_mm_maskz_add_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
322{
323 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,317 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
324 (__v2di)_mm_add_epi64(__A, __B),318 (__v2di)_mm_add_epi64(__A, __B),
325 (__v2di)_mm_setzero_si128());319 (__v2di)_mm_setzero_si128());
326}320}
327321
328static __inline__ __m128i __DEFAULT_FN_ATTRS128322static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
329_mm_mask_sub_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)323_mm_mask_sub_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
330{
331 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,324 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
332 (__v4si)_mm_sub_epi32(__A, __B),325 (__v4si)_mm_sub_epi32(__A, __B),
333 (__v4si)__W);326 (__v4si)__W);
334}327}
335328
336static __inline__ __m128i __DEFAULT_FN_ATTRS128329static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
337_mm_maskz_sub_epi32(__mmask8 __U, __m128i __A, __m128i __B)330_mm_maskz_sub_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
338{
339 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,331 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
340 (__v4si)_mm_sub_epi32(__A, __B),332 (__v4si)_mm_sub_epi32(__A, __B),
341 (__v4si)_mm_setzero_si128());333 (__v4si)_mm_setzero_si128());
342}334}
343335
344static __inline__ __m128i __DEFAULT_FN_ATTRS128336static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
345_mm_mask_sub_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)337_mm_mask_sub_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
346{
347 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,338 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
348 (__v2di)_mm_sub_epi64(__A, __B),339 (__v2di)_mm_sub_epi64(__A, __B),
349 (__v2di)__W);340 (__v2di)__W);
350}341}
351342
352static __inline__ __m128i __DEFAULT_FN_ATTRS128343static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
353_mm_maskz_sub_epi64(__mmask8 __U, __m128i __A, __m128i __B)344_mm_maskz_sub_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
354{
355 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,345 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
356 (__v2di)_mm_sub_epi64(__A, __B),346 (__v2di)_mm_sub_epi64(__A, __B),
357 (__v2di)_mm_setzero_si128());347 (__v2di)_mm_setzero_si128());
358}348}
359349
360static __inline__ __m256i __DEFAULT_FN_ATTRS256350static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
361_mm256_mask_mul_epi32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)351_mm256_mask_mul_epi32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) {
362{
363 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,352 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
364 (__v4di)_mm256_mul_epi32(__X, __Y),353 (__v4di)_mm256_mul_epi32(__X, __Y),
365 (__v4di)__W);354 (__v4di)__W);
366}355}
367356
368static __inline__ __m256i __DEFAULT_FN_ATTRS256357static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
369_mm256_maskz_mul_epi32(__mmask8 __M, __m256i __X, __m256i __Y)358_mm256_maskz_mul_epi32(__mmask8 __M, __m256i __X, __m256i __Y) {
370{
371 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,359 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
372 (__v4di)_mm256_mul_epi32(__X, __Y),360 (__v4di)_mm256_mul_epi32(__X, __Y),
373 (__v4di)_mm256_setzero_si256());361 (__v4di)_mm256_setzero_si256());
374}362}
375363
376static __inline__ __m128i __DEFAULT_FN_ATTRS128364static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
377_mm_mask_mul_epi32(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)365_mm_mask_mul_epi32(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) {
378{
379 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,366 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
380 (__v2di)_mm_mul_epi32(__X, __Y),367 (__v2di)_mm_mul_epi32(__X, __Y),
381 (__v2di)__W);368 (__v2di)__W);
382}369}
383370
384static __inline__ __m128i __DEFAULT_FN_ATTRS128371static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
385_mm_maskz_mul_epi32(__mmask8 __M, __m128i __X, __m128i __Y)372_mm_maskz_mul_epi32(__mmask8 __M, __m128i __X, __m128i __Y) {
386{
387 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,373 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
388 (__v2di)_mm_mul_epi32(__X, __Y),374 (__v2di)_mm_mul_epi32(__X, __Y),
389 (__v2di)_mm_setzero_si128());375 (__v2di)_mm_setzero_si128());
390}376}
391377
392static __inline__ __m256i __DEFAULT_FN_ATTRS256378static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
393_mm256_mask_mul_epu32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)379_mm256_mask_mul_epu32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) {
394{
395 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,380 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
396 (__v4di)_mm256_mul_epu32(__X, __Y),381 (__v4di)_mm256_mul_epu32(__X, __Y),
397 (__v4di)__W);382 (__v4di)__W);
398}383}
399384
400static __inline__ __m256i __DEFAULT_FN_ATTRS256385static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
401_mm256_maskz_mul_epu32(__mmask8 __M, __m256i __X, __m256i __Y)386_mm256_maskz_mul_epu32(__mmask8 __M, __m256i __X, __m256i __Y) {
402{
403 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,387 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
404 (__v4di)_mm256_mul_epu32(__X, __Y),388 (__v4di)_mm256_mul_epu32(__X, __Y),
405 (__v4di)_mm256_setzero_si256());389 (__v4di)_mm256_setzero_si256());
406}390}
407391
408static __inline__ __m128i __DEFAULT_FN_ATTRS128392static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
409_mm_mask_mul_epu32(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)393_mm_mask_mul_epu32(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) {
410{
411 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,394 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
412 (__v2di)_mm_mul_epu32(__X, __Y),395 (__v2di)_mm_mul_epu32(__X, __Y),
413 (__v2di)__W);396 (__v2di)__W);
414}397}
415398
416static __inline__ __m128i __DEFAULT_FN_ATTRS128399static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
417_mm_maskz_mul_epu32(__mmask8 __M, __m128i __X, __m128i __Y)400_mm_maskz_mul_epu32(__mmask8 __M, __m128i __X, __m128i __Y) {
418{
419 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,401 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
420 (__v2di)_mm_mul_epu32(__X, __Y),402 (__v2di)_mm_mul_epu32(__X, __Y),
421 (__v2di)_mm_setzero_si128());403 (__v2di)_mm_setzero_si128());
422}404}
423405
424static __inline__ __m256i __DEFAULT_FN_ATTRS256406static __inline__ __m256i __DEFAULT_FN_ATTRS128_CONSTEXPR
425_mm256_maskz_mullo_epi32(__mmask8 __M, __m256i __A, __m256i __B)407_mm256_maskz_mullo_epi32(__mmask8 __M, __m256i __A, __m256i __B) {
426{
427 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,408 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
428 (__v8si)_mm256_mullo_epi32(__A, __B),409 (__v8si)_mm256_mullo_epi32(__A, __B),
429 (__v8si)_mm256_setzero_si256());410 (__v8si)_mm256_setzero_si256());
430}411}
431412
432static __inline__ __m256i __DEFAULT_FN_ATTRS256413static __inline__ __m256i __DEFAULT_FN_ATTRS128_CONSTEXPR
433_mm256_mask_mullo_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B)414_mm256_mask_mullo_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
434{
435 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,415 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
436 (__v8si)_mm256_mullo_epi32(__A, __B),416 (__v8si)_mm256_mullo_epi32(__A, __B),
437 (__v8si)__W);417 (__v8si)__W);
...@@ -453,9 +433,8 @@ _mm_mask_mullo_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)...@@ -453,9 +433,8 @@ _mm_mask_mullo_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B)
453 (__v4si)__W);433 (__v4si)__W);
454}434}
455435
456static __inline__ __m256i __DEFAULT_FN_ATTRS256436static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
457_mm256_and_epi32(__m256i __a, __m256i __b)437_mm256_and_epi32(__m256i __a, __m256i __b) {
458{
459 return (__m256i)((__v8su)__a & (__v8su)__b);438 return (__m256i)((__v8su)__a & (__v8su)__b);
460}439}
461440
...@@ -473,9 +452,8 @@ _mm256_maskz_and_epi32(__mmask8 __U, __m256i __A, __m256i __B)...@@ -473,9 +452,8 @@ _mm256_maskz_and_epi32(__mmask8 __U, __m256i __A, __m256i __B)
473 return (__m256i)_mm256_mask_and_epi32(_mm256_setzero_si256(), __U, __A, __B);452 return (__m256i)_mm256_mask_and_epi32(_mm256_setzero_si256(), __U, __A, __B);
474}453}
475454
476static __inline__ __m128i __DEFAULT_FN_ATTRS128455static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
477_mm_and_epi32(__m128i __a, __m128i __b)456_mm_and_epi32(__m128i __a, __m128i __b) {
478{
479 return (__m128i)((__v4su)__a & (__v4su)__b);457 return (__m128i)((__v4su)__a & (__v4su)__b);
480}458}
481459
...@@ -896,329 +874,312 @@ _mm_maskz_xor_epi64(__mmask8 __U, __m128i __A, __m128i __B)...@@ -896,329 +874,312 @@ _mm_maskz_xor_epi64(__mmask8 __U, __m128i __A, __m128i __B)
896 (__v2df)(__m128d)(b), (int)(p), \874 (__v2df)(__m128d)(b), (int)(p), \
897 (__mmask8)(m)))875 (__mmask8)(m)))
898876
899static __inline__ __m128d __DEFAULT_FN_ATTRS128877static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
900_mm_mask_fmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C)878_mm_mask_fmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
901{879 return (__m128d)__builtin_ia32_selectpd_128(
902 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,880 (__mmask8)__U, (__v2df)_mm_fmadd_pd(__A, __B, __C), (__v2df)__A);
903 __builtin_ia32_vfmaddpd ((__v2df) __A,
904 (__v2df) __B,
905 (__v2df) __C),
906 (__v2df) __A);
907}881}
908882
909static __inline__ __m128d __DEFAULT_FN_ATTRS128883static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
910_mm_mask3_fmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U)884_mm_mask3_fmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
911{885 return (__m128d)__builtin_ia32_selectpd_128(
912 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,886 (__mmask8)__U, (__v2df)_mm_fmadd_pd(__A, __B, __C), (__v2df)__C);
913 __builtin_ia32_vfmaddpd ((__v2df) __A,
914 (__v2df) __B,
915 (__v2df) __C),
916 (__v2df) __C);
917}887}
918888
919static __inline__ __m128d __DEFAULT_FN_ATTRS128889static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
920_mm_maskz_fmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C)890_mm_maskz_fmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
921{891 return (__m128d)__builtin_ia32_selectpd_128(
922 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,892 (__mmask8)__U, (__v2df)_mm_fmadd_pd(__A, __B, __C),
923 __builtin_ia32_vfmaddpd ((__v2df) __A,893 (__v2df)_mm_setzero_pd());
924 (__v2df) __B,
925 (__v2df) __C),
926 (__v2df)_mm_setzero_pd());
927}894}
928895
929static __inline__ __m128d __DEFAULT_FN_ATTRS128896static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
930_mm_mask_fmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C)897_mm_mask_fmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
931{898 return (__m128d)__builtin_ia32_selectpd_128(
932 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,899 (__mmask8)__U, (__v2df)_mm_fmsub_pd(__A, __B, __C), (__v2df)__A);
933 __builtin_ia32_vfmaddpd ((__v2df) __A,
934 (__v2df) __B,
935 -(__v2df) __C),
936 (__v2df) __A);
937}900}
938901
939static __inline__ __m128d __DEFAULT_FN_ATTRS128902static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
940_mm_maskz_fmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C)903_mm_mask3_fmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
941{904 return (__m128d)__builtin_ia32_selectpd_128(
942 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,905 (__mmask8)__U, (__v2df)_mm_fmsub_pd(__A, __B, __C), (__v2df)__C);
943 __builtin_ia32_vfmaddpd ((__v2df) __A,
944 (__v2df) __B,
945 -(__v2df) __C),
946 (__v2df)_mm_setzero_pd());
947}906}
948907
949static __inline__ __m128d __DEFAULT_FN_ATTRS128908static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
950_mm_mask3_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U)909_mm_maskz_fmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
951{910 return (__m128d)__builtin_ia32_selectpd_128(
952 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,911 (__mmask8)__U, (__v2df)_mm_fmsub_pd(__A, __B, __C),
953 __builtin_ia32_vfmaddpd (-(__v2df) __A,912 (__v2df)_mm_setzero_pd());
954 (__v2df) __B,
955 (__v2df) __C),
956 (__v2df) __C);
957}913}
958914
959static __inline__ __m128d __DEFAULT_FN_ATTRS128915static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
960_mm_maskz_fnmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C)916_mm_mask_fnmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
961{917 return (__m128d)__builtin_ia32_selectpd_128(
962 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,918 (__mmask8)__U, (__v2df)_mm_fnmadd_pd(__A, __B, __C), (__v2df)__A);
963 __builtin_ia32_vfmaddpd (-(__v2df) __A,
964 (__v2df) __B,
965 (__v2df) __C),
966 (__v2df)_mm_setzero_pd());
967}919}
968920
969static __inline__ __m128d __DEFAULT_FN_ATTRS128921static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
970_mm_maskz_fnmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C)922_mm_mask3_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
971{923 return (__m128d)__builtin_ia32_selectpd_128(
972 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,924 (__mmask8)__U, (__v2df)_mm_fnmadd_pd(__A, __B, __C), (__v2df)__C);
973 __builtin_ia32_vfmaddpd (-(__v2df) __A,
974 (__v2df) __B,
975 -(__v2df) __C),
976 (__v2df)_mm_setzero_pd());
977}925}
978926
979static __inline__ __m256d __DEFAULT_FN_ATTRS256927static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
980_mm256_mask_fmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C)928_mm_maskz_fnmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
981{929 return (__m128d)__builtin_ia32_selectpd_128(
982 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,930 (__mmask8)__U, (__v2df)_mm_fnmadd_pd(__A, __B, __C),
983 __builtin_ia32_vfmaddpd256 ((__v4df) __A,931 (__v2df)_mm_setzero_pd());
984 (__v4df) __B,
985 (__v4df) __C),
986 (__v4df) __A);
987}932}
988933
989static __inline__ __m256d __DEFAULT_FN_ATTRS256934static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
990_mm256_mask3_fmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U)935_mm_mask_fnmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
991{936 return (__m128d)__builtin_ia32_selectpd_128(
992 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,937 (__mmask8)__U, (__v2df)_mm_fnmsub_pd(__A, __B, __C), (__v2df)__A);
993 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
994 (__v4df) __B,
995 (__v4df) __C),
996 (__v4df) __C);
997}938}
998939
999static __inline__ __m256d __DEFAULT_FN_ATTRS256940static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1000_mm256_maskz_fmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C)941_mm_mask3_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
1001{942 return (__m128d)__builtin_ia32_selectpd_128(
1002 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,943 (__mmask8)__U, (__v2df)_mm_fnmsub_pd(__A, __B, __C), (__v2df)__C);
1003 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
1004 (__v4df) __B,
1005 (__v4df) __C),
1006 (__v4df)_mm256_setzero_pd());
1007}944}
1008945
1009static __inline__ __m256d __DEFAULT_FN_ATTRS256946static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1010_mm256_mask_fmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C)947_mm_maskz_fnmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
1011{948 return (__m128d)__builtin_ia32_selectpd_128(
1012 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,949 (__mmask8)__U, (__v2df)_mm_fnmsub_pd(__A, __B, __C),
1013 __builtin_ia32_vfmaddpd256 ((__v4df) __A,950 (__v2df)_mm_setzero_pd());
1014 (__v4df) __B,
1015 -(__v4df) __C),
1016 (__v4df) __A);
1017}951}
1018952
1019static __inline__ __m256d __DEFAULT_FN_ATTRS256953static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1020_mm256_maskz_fmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C)954_mm256_mask_fmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
1021{955 return (__m256d)__builtin_ia32_selectpd_256(
1022 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,956 (__mmask8)__U, (__v4df)_mm256_fmadd_pd(__A, __B, __C), (__v4df)__A);
1023 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
1024 (__v4df) __B,
1025 -(__v4df) __C),
1026 (__v4df)_mm256_setzero_pd());
1027}957}
1028958
1029static __inline__ __m256d __DEFAULT_FN_ATTRS256959static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1030_mm256_mask3_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U)960_mm256_mask3_fmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
1031{961 return (__m256d)__builtin_ia32_selectpd_256(
1032 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,962 (__mmask8)__U, (__v4df)_mm256_fmadd_pd(__A, __B, __C), (__v4df)__C);
1033 __builtin_ia32_vfmaddpd256 (-(__v4df) __A,
1034 (__v4df) __B,
1035 (__v4df) __C),
1036 (__v4df) __C);
1037}963}
1038964
1039static __inline__ __m256d __DEFAULT_FN_ATTRS256965static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1040_mm256_maskz_fnmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C)966_mm256_maskz_fmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
1041{967 return (__m256d)__builtin_ia32_selectpd_256(
1042 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,968 (__mmask8)__U, (__v4df)_mm256_fmadd_pd(__A, __B, __C),
1043 __builtin_ia32_vfmaddpd256 (-(__v4df) __A,969 (__v4df)_mm256_setzero_pd());
1044 (__v4df) __B,
1045 (__v4df) __C),
1046 (__v4df)_mm256_setzero_pd());
1047}970}
1048971
1049static __inline__ __m256d __DEFAULT_FN_ATTRS256972static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1050_mm256_maskz_fnmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C)973_mm256_mask_fmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
1051{974 return (__m256d)__builtin_ia32_selectpd_256(
1052 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,975 (__mmask8)__U, (__v4df)_mm256_fmsub_pd(__A, __B, __C), (__v4df)__A);
1053 __builtin_ia32_vfmaddpd256 (-(__v4df) __A,
1054 (__v4df) __B,
1055 -(__v4df) __C),
1056 (__v4df)_mm256_setzero_pd());
1057}976}
1058977
1059static __inline__ __m128 __DEFAULT_FN_ATTRS128978static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1060_mm_mask_fmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C)979_mm256_mask3_fmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
1061{980 return (__m256d)__builtin_ia32_selectpd_256(
1062 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,981 (__mmask8)__U, (__v4df)_mm256_fmsub_pd(__A, __B, __C), (__v4df)__C);
1063 __builtin_ia32_vfmaddps ((__v4sf) __A,
1064 (__v4sf) __B,
1065 (__v4sf) __C),
1066 (__v4sf) __A);
1067}982}
1068983
1069static __inline__ __m128 __DEFAULT_FN_ATTRS128984static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1070_mm_mask3_fmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U)985_mm256_maskz_fmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
1071{986 return (__m256d)__builtin_ia32_selectpd_256(
1072 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,987 (__mmask8)__U, (__v4df)_mm256_fmsub_pd(__A, __B, __C),
1073 __builtin_ia32_vfmaddps ((__v4sf) __A,988 (__v4df)_mm256_setzero_pd());
1074 (__v4sf) __B,
1075 (__v4sf) __C),
1076 (__v4sf) __C);
1077}989}
1078990
1079static __inline__ __m128 __DEFAULT_FN_ATTRS128991static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1080_mm_maskz_fmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C)992_mm256_mask_fnmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
1081{993 return (__m256d)__builtin_ia32_selectpd_256(
1082 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,994 (__mmask8)__U, (__v4df)_mm256_fnmadd_pd(__A, __B, __C), (__v4df)__A);
1083 __builtin_ia32_vfmaddps ((__v4sf) __A,
1084 (__v4sf) __B,
1085 (__v4sf) __C),
1086 (__v4sf)_mm_setzero_ps());
1087}995}
1088996
1089static __inline__ __m128 __DEFAULT_FN_ATTRS128997static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1090_mm_mask_fmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C)998_mm256_mask3_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
1091{999 return (__m256d)__builtin_ia32_selectpd_256(
1092 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,1000 (__mmask8)__U, (__v4df)_mm256_fnmadd_pd(__A, __B, __C), (__v4df)__C);
1093 __builtin_ia32_vfmaddps ((__v4sf) __A,
1094 (__v4sf) __B,
1095 -(__v4sf) __C),
1096 (__v4sf) __A);
1097}1001}
10981002
1099static __inline__ __m128 __DEFAULT_FN_ATTRS1281003static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1100_mm_maskz_fmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C)1004_mm256_maskz_fnmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
1101{1005 return (__m256d)__builtin_ia32_selectpd_256(
1102 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,1006 (__mmask8)__U, (__v4df)_mm256_fnmadd_pd(__A, __B, __C),
1103 __builtin_ia32_vfmaddps ((__v4sf) __A,1007 (__v4df)_mm256_setzero_pd());
1104 (__v4sf) __B,
1105 -(__v4sf) __C),
1106 (__v4sf)_mm_setzero_ps());
1107}1008}
11081009
1109static __inline__ __m128 __DEFAULT_FN_ATTRS1281010static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1110_mm_mask3_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U)1011_mm256_mask_fnmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
1111{1012 return (__m256d)__builtin_ia32_selectpd_256(
1112 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,1013 (__mmask8)__U, (__v4df)_mm256_fnmsub_pd(__A, __B, __C), (__v4df)__A);
1113 __builtin_ia32_vfmaddps (-(__v4sf) __A,
1114 (__v4sf) __B,
1115 (__v4sf) __C),
1116 (__v4sf) __C);
1117}1014}
11181015
1119static __inline__ __m128 __DEFAULT_FN_ATTRS1281016static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1120_mm_maskz_fnmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C)1017_mm256_mask3_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
1121{1018 return (__m256d)__builtin_ia32_selectpd_256(
1122 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,1019 (__mmask8)__U, (__v4df)_mm256_fnmsub_pd(__A, __B, __C), (__v4df)__C);
1123 __builtin_ia32_vfmaddps (-(__v4sf) __A,
1124 (__v4sf) __B,
1125 (__v4sf) __C),
1126 (__v4sf)_mm_setzero_ps());
1127}1020}
11281021
1129static __inline__ __m128 __DEFAULT_FN_ATTRS1281022static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1130_mm_maskz_fnmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C)1023_mm256_maskz_fnmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
1131{1024 return (__m256d)__builtin_ia32_selectpd_256(
1132 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,1025 (__mmask8)__U, (__v4df)_mm256_fnmsub_pd(__A, __B, __C),
1133 __builtin_ia32_vfmaddps (-(__v4sf) __A,1026 (__v4df)_mm256_setzero_pd());
1134 (__v4sf) __B,
1135 -(__v4sf) __C),
1136 (__v4sf)_mm_setzero_ps());
1137}1027}
11381028
1139static __inline__ __m256 __DEFAULT_FN_ATTRS2561029static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1140_mm256_mask_fmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C)1030_mm_mask_fmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
1141{1031 return (__m128)__builtin_ia32_selectps_128(
1142 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1032 (__mmask8)__U, (__v4sf)_mm_fmadd_ps(__A, __B, __C), (__v4sf)__A);
1143 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1144 (__v8sf) __B,
1145 (__v8sf) __C),
1146 (__v8sf) __A);
1147}1033}
11481034
1149static __inline__ __m256 __DEFAULT_FN_ATTRS2561035static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1150_mm256_mask3_fmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U)1036_mm_mask3_fmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
1151{1037 return (__m128)__builtin_ia32_selectps_128(
1152 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1038 (__mmask8)__U, (__v4sf)_mm_fmadd_ps(__A, __B, __C), (__v4sf)__C);
1153 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1154 (__v8sf) __B,
1155 (__v8sf) __C),
1156 (__v8sf) __C);
1157}1039}
11581040
1159static __inline__ __m256 __DEFAULT_FN_ATTRS2561041static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1160_mm256_maskz_fmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C)1042_mm_maskz_fmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
1161{1043 return (__m128)__builtin_ia32_selectps_128(
1162 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1044 (__mmask8)__U, (__v4sf)_mm_fmadd_ps(__A, __B, __C),
1163 __builtin_ia32_vfmaddps256 ((__v8sf) __A,1045 (__v4sf)_mm_setzero_ps());
1164 (__v8sf) __B,
1165 (__v8sf) __C),
1166 (__v8sf)_mm256_setzero_ps());
1167}1046}
11681047
1169static __inline__ __m256 __DEFAULT_FN_ATTRS2561048static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1170_mm256_mask_fmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C)1049_mm_mask_fmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
1171{1050 return (__m128)__builtin_ia32_selectps_128(
1172 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1051 (__mmask8)__U, (__v4sf)_mm_fmsub_ps(__A, __B, __C), (__v4sf)__A);
1173 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1174 (__v8sf) __B,
1175 -(__v8sf) __C),
1176 (__v8sf) __A);
1177}1052}
11781053
1179static __inline__ __m256 __DEFAULT_FN_ATTRS2561054static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1180_mm256_maskz_fmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C)1055_mm_mask3_fmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
1181{1056 return (__m128)__builtin_ia32_selectps_128(
1182 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1057 (__mmask8)__U, (__v4sf)_mm_fmsub_ps(__A, __B, __C), (__v4sf)__C);
1183 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1184 (__v8sf) __B,
1185 -(__v8sf) __C),
1186 (__v8sf)_mm256_setzero_ps());
1187}1058}
11881059
1189static __inline__ __m256 __DEFAULT_FN_ATTRS2561060static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1190_mm256_mask3_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U)1061_mm_maskz_fmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
1191{1062 return (__m128)__builtin_ia32_selectps_128(
1192 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1063 (__mmask8)__U, (__v4sf)_mm_fmsub_ps(__A, __B, __C),
1193 __builtin_ia32_vfmaddps256 (-(__v8sf) __A,1064 (__v4sf)_mm_setzero_ps());
1194 (__v8sf) __B,
1195 (__v8sf) __C),
1196 (__v8sf) __C);
1197}1065}
11981066
1199static __inline__ __m256 __DEFAULT_FN_ATTRS2561067static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1200_mm256_maskz_fnmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C)1068_mm_mask_fnmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
1201{1069 return (__m128)__builtin_ia32_selectps_128(
1202 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1070 (__mmask8)__U, (__v4sf)_mm_fnmadd_ps(__A, __B, __C), (__v4sf)__A);
1203 __builtin_ia32_vfmaddps256 (-(__v8sf) __A,
1204 (__v8sf) __B,
1205 (__v8sf) __C),
1206 (__v8sf)_mm256_setzero_ps());
1207}1071}
12081072
1209static __inline__ __m256 __DEFAULT_FN_ATTRS2561073static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1210_mm256_maskz_fnmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C)1074_mm_mask3_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
1211{1075 return (__m128)__builtin_ia32_selectps_128(
1212 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,1076 (__mmask8)__U, (__v4sf)_mm_fnmadd_ps(__A, __B, __C), (__v4sf)__C);
1213 __builtin_ia32_vfmaddps256 (-(__v8sf) __A,1077}
1214 (__v8sf) __B,1078
1215 -(__v8sf) __C),1079static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1216 (__v8sf)_mm256_setzero_ps());1080_mm_maskz_fnmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
1081 return (__m128)__builtin_ia32_selectps_128(
1082 (__mmask8)__U, (__v4sf)_mm_fnmadd_ps(__A, __B, __C),
1083 (__v4sf)_mm_setzero_ps());
1084}
1085
1086static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1087_mm_mask_fnmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
1088 return (__m128)__builtin_ia32_selectps_128(
1089 (__mmask8)__U, (__v4sf)_mm_fnmsub_ps(__A, __B, __C), (__v4sf)__A);
1090}
1091
1092static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1093_mm_mask3_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
1094 return (__m128)__builtin_ia32_selectps_128(
1095 (__mmask8)__U, (__v4sf)_mm_fnmsub_ps(__A, __B, __C), (__v4sf)__C);
1096}
1097
1098static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1099_mm_maskz_fnmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
1100 return (__m128)__builtin_ia32_selectps_128(
1101 (__mmask8)__U, (__v4sf)_mm_fnmsub_ps(__A, __B, __C),
1102 (__v4sf)_mm_setzero_ps());
1103}
1104
1105static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1106_mm256_mask_fmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
1107 return (__m256)__builtin_ia32_selectps_256(
1108 (__mmask8)__U, (__v8sf)_mm256_fmadd_ps(__A, __B, __C), (__v8sf)__A);
1109}
1110
1111static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1112_mm256_mask3_fmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
1113 return (__m256)__builtin_ia32_selectps_256(
1114 (__mmask8)__U, (__v8sf)_mm256_fmadd_ps(__A, __B, __C), (__v8sf)__C);
1115}
1116
1117static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1118_mm256_maskz_fmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
1119 return (__m256)__builtin_ia32_selectps_256(
1120 (__mmask8)__U, (__v8sf)_mm256_fmadd_ps(__A, __B, __C),
1121 (__v8sf)_mm256_setzero_ps());
1122}
1123
1124static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1125_mm256_mask_fmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
1126 return (__m256)__builtin_ia32_selectps_256(
1127 (__mmask8)__U, (__v8sf)_mm256_fmsub_ps(__A, __B, __C), (__v8sf)__A);
1128}
1129
1130static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1131_mm256_mask3_fmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
1132 return (__m256)__builtin_ia32_selectps_256(
1133 (__mmask8)__U, (__v8sf)_mm256_fmsub_ps(__A, __B, __C), (__v8sf)__C);
1134}
1135
1136static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1137_mm256_maskz_fmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
1138 return (__m256)__builtin_ia32_selectps_256(
1139 (__mmask8)__U, (__v8sf)_mm256_fmsub_ps(__A, __B, __C),
1140 (__v8sf)_mm256_setzero_ps());
1141}
1142
1143static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1144_mm256_mask_fnmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
1145 return (__m256)__builtin_ia32_selectps_256(
1146 (__mmask8)__U, (__v8sf)_mm256_fnmadd_ps(__A, __B, __C), (__v8sf)__A);
1147}
1148
1149static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1150_mm256_mask3_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
1151 return (__m256)__builtin_ia32_selectps_256(
1152 (__mmask8)__U, (__v8sf)_mm256_fnmadd_ps(__A, __B, __C), (__v8sf)__C);
1153}
1154
1155static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1156_mm256_maskz_fnmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
1157 return (__m256)__builtin_ia32_selectps_256(
1158 (__mmask8)__U, (__v8sf)_mm256_fnmadd_ps(__A, __B, __C),
1159 (__v8sf)_mm256_setzero_ps());
1160}
1161
1162static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1163_mm256_mask_fnmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
1164 return (__m256)__builtin_ia32_selectps_256(
1165 (__mmask8)__U, (__v8sf)_mm256_fnmsub_ps(__A, __B, __C), (__v8sf)__A);
1166}
1167
1168static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1169_mm256_mask3_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
1170 return (__m256)__builtin_ia32_selectps_256(
1171 (__mmask8)__U, (__v8sf)_mm256_fnmsub_ps(__A, __B, __C), (__v8sf)__C);
1172}
1173
1174static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1175_mm256_maskz_fnmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
1176 return (__m256)__builtin_ia32_selectps_256(
1177 (__mmask8)__U, (__v8sf)_mm256_fnmsub_ps(__A, __B, __C),
1178 (__v8sf)_mm256_setzero_ps());
1217}1179}
12181180
1219static __inline__ __m128d __DEFAULT_FN_ATTRS1281181static __inline__ __m128d __DEFAULT_FN_ATTRS128
1220_mm_mask_fmaddsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C)1182_mm_mask_fmaddsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
1221{
1222 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,1183 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,
1223 __builtin_ia32_vfmaddsubpd ((__v2df) __A,1184 __builtin_ia32_vfmaddsubpd ((__v2df) __A,
1224 (__v2df) __B,1185 (__v2df) __B,
...@@ -1417,46 +1378,6 @@ _mm256_maskz_fmsubadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C)...@@ -1417,46 +1378,6 @@ _mm256_maskz_fmsubadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C)
1417 (__v8sf)_mm256_setzero_ps());1378 (__v8sf)_mm256_setzero_ps());
1418}1379}
14191380
1420static __inline__ __m128d __DEFAULT_FN_ATTRS128
1421_mm_mask3_fmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U)
1422{
1423 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,
1424 __builtin_ia32_vfmaddpd ((__v2df) __A,
1425 (__v2df) __B,
1426 -(__v2df) __C),
1427 (__v2df) __C);
1428}
1429
1430static __inline__ __m256d __DEFAULT_FN_ATTRS256
1431_mm256_mask3_fmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U)
1432{
1433 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,
1434 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
1435 (__v4df) __B,
1436 -(__v4df) __C),
1437 (__v4df) __C);
1438}
1439
1440static __inline__ __m128 __DEFAULT_FN_ATTRS128
1441_mm_mask3_fmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U)
1442{
1443 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,
1444 __builtin_ia32_vfmaddps ((__v4sf) __A,
1445 (__v4sf) __B,
1446 -(__v4sf) __C),
1447 (__v4sf) __C);
1448}
1449
1450static __inline__ __m256 __DEFAULT_FN_ATTRS256
1451_mm256_mask3_fmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U)
1452{
1453 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,
1454 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1455 (__v8sf) __B,
1456 -(__v8sf) __C),
1457 (__v8sf) __C);
1458}
1459
1460static __inline__ __m128d __DEFAULT_FN_ATTRS1281381static __inline__ __m128d __DEFAULT_FN_ATTRS128
1461_mm_mask3_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U)1382_mm_mask3_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U)
1462{1383{
...@@ -1497,233 +1418,113 @@ _mm256_mask3_fmsubadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U)...@@ -1497,233 +1418,113 @@ _mm256_mask3_fmsubadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U)
1497 (__v8sf) __C);1418 (__v8sf) __C);
1498}1419}
14991420
1500static __inline__ __m128d __DEFAULT_FN_ATTRS1281421static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1501_mm_mask_fnmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C)
1502{
1503 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,
1504 __builtin_ia32_vfmaddpd ((__v2df) __A,
1505 -(__v2df) __B,
1506 (__v2df) __C),
1507 (__v2df) __A);
1508}
1509
1510static __inline__ __m256d __DEFAULT_FN_ATTRS256
1511_mm256_mask_fnmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C)
1512{
1513 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,
1514 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
1515 -(__v4df) __B,
1516 (__v4df) __C),
1517 (__v4df) __A);
1518}
1519
1520static __inline__ __m128 __DEFAULT_FN_ATTRS128
1521_mm_mask_fnmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C)
1522{
1523 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,
1524 __builtin_ia32_vfmaddps ((__v4sf) __A,
1525 -(__v4sf) __B,
1526 (__v4sf) __C),
1527 (__v4sf) __A);
1528}
1529
1530static __inline__ __m256 __DEFAULT_FN_ATTRS256
1531_mm256_mask_fnmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C)
1532{
1533 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,
1534 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1535 -(__v8sf) __B,
1536 (__v8sf) __C),
1537 (__v8sf) __A);
1538}
1539
1540static __inline__ __m128d __DEFAULT_FN_ATTRS128
1541_mm_mask_fnmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C)
1542{
1543 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,
1544 __builtin_ia32_vfmaddpd ((__v2df) __A,
1545 -(__v2df) __B,
1546 -(__v2df) __C),
1547 (__v2df) __A);
1548}
1549
1550static __inline__ __m128d __DEFAULT_FN_ATTRS128
1551_mm_mask3_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U)
1552{
1553 return (__m128d) __builtin_ia32_selectpd_128((__mmask8) __U,
1554 __builtin_ia32_vfmaddpd ((__v2df) __A,
1555 -(__v2df) __B,
1556 -(__v2df) __C),
1557 (__v2df) __C);
1558}
1559
1560static __inline__ __m256d __DEFAULT_FN_ATTRS256
1561_mm256_mask_fnmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C)
1562{
1563 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,
1564 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
1565 -(__v4df) __B,
1566 -(__v4df) __C),
1567 (__v4df) __A);
1568}
1569
1570static __inline__ __m256d __DEFAULT_FN_ATTRS256
1571_mm256_mask3_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U)
1572{
1573 return (__m256d) __builtin_ia32_selectpd_256((__mmask8) __U,
1574 __builtin_ia32_vfmaddpd256 ((__v4df) __A,
1575 -(__v4df) __B,
1576 -(__v4df) __C),
1577 (__v4df) __C);
1578}
1579
1580static __inline__ __m128 __DEFAULT_FN_ATTRS128
1581_mm_mask_fnmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C)
1582{
1583 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,
1584 __builtin_ia32_vfmaddps ((__v4sf) __A,
1585 -(__v4sf) __B,
1586 -(__v4sf) __C),
1587 (__v4sf) __A);
1588}
1589
1590static __inline__ __m128 __DEFAULT_FN_ATTRS128
1591_mm_mask3_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U)
1592{
1593 return (__m128) __builtin_ia32_selectps_128((__mmask8) __U,
1594 __builtin_ia32_vfmaddps ((__v4sf) __A,
1595 -(__v4sf) __B,
1596 -(__v4sf) __C),
1597 (__v4sf) __C);
1598}
1599
1600static __inline__ __m256 __DEFAULT_FN_ATTRS256
1601_mm256_mask_fnmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C)
1602{
1603 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,
1604 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1605 -(__v8sf) __B,
1606 -(__v8sf) __C),
1607 (__v8sf) __A);
1608}
1609
1610static __inline__ __m256 __DEFAULT_FN_ATTRS256
1611_mm256_mask3_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U)
1612{
1613 return (__m256) __builtin_ia32_selectps_256((__mmask8) __U,
1614 __builtin_ia32_vfmaddps256 ((__v8sf) __A,
1615 -(__v8sf) __B,
1616 -(__v8sf) __C),
1617 (__v8sf) __C);
1618}
1619
1620static __inline__ __m128d __DEFAULT_FN_ATTRS128
1621_mm_mask_add_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {1422_mm_mask_add_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
1622 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,1423 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
1623 (__v2df)_mm_add_pd(__A, __B),1424 (__v2df)_mm_add_pd(__A, __B),
1624 (__v2df)__W);1425 (__v2df)__W);
1625}1426}
16261427
1627static __inline__ __m128d __DEFAULT_FN_ATTRS1281428static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1628_mm_maskz_add_pd(__mmask8 __U, __m128d __A, __m128d __B) {1429_mm_maskz_add_pd(__mmask8 __U, __m128d __A, __m128d __B) {
1629 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,1430 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
1630 (__v2df)_mm_add_pd(__A, __B),1431 (__v2df)_mm_add_pd(__A, __B),
1631 (__v2df)_mm_setzero_pd());1432 (__v2df)_mm_setzero_pd());
1632}1433}
16331434
1634static __inline__ __m256d __DEFAULT_FN_ATTRS2561435static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1635_mm256_mask_add_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {1436_mm256_mask_add_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
1636 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,1437 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
1637 (__v4df)_mm256_add_pd(__A, __B),1438 (__v4df)_mm256_add_pd(__A, __B),
1638 (__v4df)__W);1439 (__v4df)__W);
1639}1440}
16401441
1641static __inline__ __m256d __DEFAULT_FN_ATTRS2561442static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1642_mm256_maskz_add_pd(__mmask8 __U, __m256d __A, __m256d __B) {1443_mm256_maskz_add_pd(__mmask8 __U, __m256d __A, __m256d __B) {
1643 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,1444 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
1644 (__v4df)_mm256_add_pd(__A, __B),1445 (__v4df)_mm256_add_pd(__A, __B),
1645 (__v4df)_mm256_setzero_pd());1446 (__v4df)_mm256_setzero_pd());
1646}1447}
16471448
1648static __inline__ __m128 __DEFAULT_FN_ATTRS1281449static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1649_mm_mask_add_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {1450_mm_mask_add_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
1650 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,1451 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
1651 (__v4sf)_mm_add_ps(__A, __B),1452 (__v4sf)_mm_add_ps(__A, __B),
1652 (__v4sf)__W);1453 (__v4sf)__W);
1653}1454}
16541455
1655static __inline__ __m128 __DEFAULT_FN_ATTRS1281456static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1656_mm_maskz_add_ps(__mmask8 __U, __m128 __A, __m128 __B) {1457_mm_maskz_add_ps(__mmask8 __U, __m128 __A, __m128 __B) {
1657 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,1458 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
1658 (__v4sf)_mm_add_ps(__A, __B),1459 (__v4sf)_mm_add_ps(__A, __B),
1659 (__v4sf)_mm_setzero_ps());1460 (__v4sf)_mm_setzero_ps());
1660}1461}
16611462
1662static __inline__ __m256 __DEFAULT_FN_ATTRS2561463static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1663_mm256_mask_add_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {1464_mm256_mask_add_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
1664 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,1465 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
1665 (__v8sf)_mm256_add_ps(__A, __B),1466 (__v8sf)_mm256_add_ps(__A, __B),
1666 (__v8sf)__W);1467 (__v8sf)__W);
1667}1468}
16681469
1669static __inline__ __m256 __DEFAULT_FN_ATTRS2561470static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1670_mm256_maskz_add_ps(__mmask8 __U, __m256 __A, __m256 __B) {1471_mm256_maskz_add_ps(__mmask8 __U, __m256 __A, __m256 __B) {
1671 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,1472 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
1672 (__v8sf)_mm256_add_ps(__A, __B),1473 (__v8sf)_mm256_add_ps(__A, __B),
1673 (__v8sf)_mm256_setzero_ps());1474 (__v8sf)_mm256_setzero_ps());
1674}1475}
16751476
1676static __inline__ __m128i __DEFAULT_FN_ATTRS1281477static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1677_mm_mask_blend_epi32 (__mmask8 __U, __m128i __A, __m128i __W) {1478_mm_mask_blend_epi32(__mmask8 __U, __m128i __A, __m128i __W) {
1678 return (__m128i) __builtin_ia32_selectd_128 ((__mmask8) __U,1479 return (__m128i) __builtin_ia32_selectd_128 ((__mmask8) __U,
1679 (__v4si) __W,1480 (__v4si) __W,
1680 (__v4si) __A);1481 (__v4si) __A);
1681}1482}
16821483
1683static __inline__ __m256i __DEFAULT_FN_ATTRS2561484static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1684_mm256_mask_blend_epi32 (__mmask8 __U, __m256i __A, __m256i __W) {1485_mm256_mask_blend_epi32(__mmask8 __U, __m256i __A, __m256i __W) {
1685 return (__m256i) __builtin_ia32_selectd_256 ((__mmask8) __U,1486 return (__m256i) __builtin_ia32_selectd_256 ((__mmask8) __U,
1686 (__v8si) __W,1487 (__v8si) __W,
1687 (__v8si) __A);1488 (__v8si) __A);
1688}1489}
16891490
1690static __inline__ __m128d __DEFAULT_FN_ATTRS1281491static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1691_mm_mask_blend_pd (__mmask8 __U, __m128d __A, __m128d __W) {1492_mm_mask_blend_pd(__mmask8 __U, __m128d __A, __m128d __W) {
1692 return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U,1493 return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U,
1693 (__v2df) __W,1494 (__v2df) __W,
1694 (__v2df) __A);1495 (__v2df) __A);
1695}1496}
16961497
1697static __inline__ __m256d __DEFAULT_FN_ATTRS2561498static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1698_mm256_mask_blend_pd (__mmask8 __U, __m256d __A, __m256d __W) {1499_mm256_mask_blend_pd(__mmask8 __U, __m256d __A, __m256d __W) {
1699 return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U,1500 return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U,
1700 (__v4df) __W,1501 (__v4df) __W,
1701 (__v4df) __A);1502 (__v4df) __A);
1702}1503}
17031504
1704static __inline__ __m128 __DEFAULT_FN_ATTRS1281505static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1705_mm_mask_blend_ps (__mmask8 __U, __m128 __A, __m128 __W) {1506_mm_mask_blend_ps(__mmask8 __U, __m128 __A, __m128 __W) {
1706 return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U,1507 return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U,
1707 (__v4sf) __W,1508 (__v4sf) __W,
1708 (__v4sf) __A);1509 (__v4sf) __A);
1709}1510}
17101511
1711static __inline__ __m256 __DEFAULT_FN_ATTRS2561512static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1712_mm256_mask_blend_ps (__mmask8 __U, __m256 __A, __m256 __W) {1513_mm256_mask_blend_ps(__mmask8 __U, __m256 __A, __m256 __W) {
1713 return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U,1514 return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U,
1714 (__v8sf) __W,1515 (__v8sf) __W,
1715 (__v8sf) __A);1516 (__v8sf) __A);
1716}1517}
17171518
1718static __inline__ __m128i __DEFAULT_FN_ATTRS1281519static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1719_mm_mask_blend_epi64 (__mmask8 __U, __m128i __A, __m128i __W) {1520_mm_mask_blend_epi64(__mmask8 __U, __m128i __A, __m128i __W) {
1720 return (__m128i) __builtin_ia32_selectq_128 ((__mmask8) __U,1521 return (__m128i) __builtin_ia32_selectq_128 ((__mmask8) __U,
1721 (__v2di) __W,1522 (__v2di) __W,
1722 (__v2di) __A);1523 (__v2di) __A);
1723}1524}
17241525
1725static __inline__ __m256i __DEFAULT_FN_ATTRS2561526static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1726_mm256_mask_blend_epi64 (__mmask8 __U, __m256i __A, __m256i __W) {1527_mm256_mask_blend_epi64(__mmask8 __U, __m256i __A, __m256i __W) {
1727 return (__m256i) __builtin_ia32_selectq_256 ((__mmask8) __U,1528 return (__m256i) __builtin_ia32_selectq_256 ((__mmask8) __U,
1728 (__v4di) __W,1529 (__v4di) __W,
1729 (__v4di) __A);1530 (__v4di) __A);
...@@ -1905,57 +1706,57 @@ _mm256_mask_compressstoreu_epi32 (void *__P, __mmask8 __U, __m256i __A) {...@@ -1905,57 +1706,57 @@ _mm256_mask_compressstoreu_epi32 (void *__P, __mmask8 __U, __m256i __A) {
1905 (__mmask8) __U);1706 (__mmask8) __U);
1906}1707}
19071708
1908static __inline__ __m128d __DEFAULT_FN_ATTRS1281709static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1909_mm_mask_cvtepi32_pd (__m128d __W, __mmask8 __U, __m128i __A) {1710_mm_mask_cvtepi32_pd(__m128d __W, __mmask8 __U, __m128i __A) {
1910 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,1711 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,
1911 (__v2df)_mm_cvtepi32_pd(__A),1712 (__v2df)_mm_cvtepi32_pd(__A),
1912 (__v2df)__W);1713 (__v2df)__W);
1913}1714}
19141715
1915static __inline__ __m128d __DEFAULT_FN_ATTRS1281716static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1916_mm_maskz_cvtepi32_pd (__mmask8 __U, __m128i __A) {1717_mm_maskz_cvtepi32_pd(__mmask8 __U, __m128i __A) {
1917 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,1718 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,
1918 (__v2df)_mm_cvtepi32_pd(__A),1719 (__v2df)_mm_cvtepi32_pd(__A),
1919 (__v2df)_mm_setzero_pd());1720 (__v2df)_mm_setzero_pd());
1920}1721}
19211722
1922static __inline__ __m256d __DEFAULT_FN_ATTRS2561723static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1923_mm256_mask_cvtepi32_pd (__m256d __W, __mmask8 __U, __m128i __A) {1724_mm256_mask_cvtepi32_pd(__m256d __W, __mmask8 __U, __m128i __A) {
1924 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,1725 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,
1925 (__v4df)_mm256_cvtepi32_pd(__A),1726 (__v4df)_mm256_cvtepi32_pd(__A),
1926 (__v4df)__W);1727 (__v4df)__W);
1927}1728}
19281729
1929static __inline__ __m256d __DEFAULT_FN_ATTRS2561730static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1930_mm256_maskz_cvtepi32_pd (__mmask8 __U, __m128i __A) {1731_mm256_maskz_cvtepi32_pd(__mmask8 __U, __m128i __A) {
1931 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,1732 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,
1932 (__v4df)_mm256_cvtepi32_pd(__A),1733 (__v4df)_mm256_cvtepi32_pd(__A),
1933 (__v4df)_mm256_setzero_pd());1734 (__v4df)_mm256_setzero_pd());
1934}1735}
19351736
1936static __inline__ __m128 __DEFAULT_FN_ATTRS1281737static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1937_mm_mask_cvtepi32_ps (__m128 __W, __mmask8 __U, __m128i __A) {1738_mm_mask_cvtepi32_ps(__m128 __W, __mmask8 __U, __m128i __A) {
1938 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,1739 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
1939 (__v4sf)_mm_cvtepi32_ps(__A),1740 (__v4sf)_mm_cvtepi32_ps(__A),
1940 (__v4sf)__W);1741 (__v4sf)__W);
1941}1742}
19421743
1943static __inline__ __m128 __DEFAULT_FN_ATTRS1281744static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1944_mm_maskz_cvtepi32_ps (__mmask8 __U, __m128i __A) {1745_mm_maskz_cvtepi32_ps(__mmask8 __U, __m128i __A) {
1945 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,1746 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
1946 (__v4sf)_mm_cvtepi32_ps(__A),1747 (__v4sf)_mm_cvtepi32_ps(__A),
1947 (__v4sf)_mm_setzero_ps());1748 (__v4sf)_mm_setzero_ps());
1948}1749}
19491750
1950static __inline__ __m256 __DEFAULT_FN_ATTRS2561751static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1951_mm256_mask_cvtepi32_ps (__m256 __W, __mmask8 __U, __m256i __A) {1752_mm256_mask_cvtepi32_ps(__m256 __W, __mmask8 __U, __m256i __A) {
1952 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,1753 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
1953 (__v8sf)_mm256_cvtepi32_ps(__A),1754 (__v8sf)_mm256_cvtepi32_ps(__A),
1954 (__v8sf)__W);1755 (__v8sf)__W);
1955}1756}
19561757
1957static __inline__ __m256 __DEFAULT_FN_ATTRS2561758static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1958_mm256_maskz_cvtepi32_ps (__mmask8 __U, __m256i __A) {1759_mm256_maskz_cvtepi32_ps(__mmask8 __U, __m256i __A) {
1959 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,1760 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
1960 (__v8sf)_mm256_cvtepi32_ps(__A),1761 (__v8sf)_mm256_cvtepi32_ps(__A),
1961 (__v8sf)_mm256_setzero_ps());1762 (__v8sf)_mm256_setzero_ps());
...@@ -1990,30 +1791,30 @@ _mm256_maskz_cvtpd_epi32 (__mmask8 __U, __m256d __A) {...@@ -1990,30 +1791,30 @@ _mm256_maskz_cvtpd_epi32 (__mmask8 __U, __m256d __A) {
1990 (__v4si)_mm_setzero_si128());1791 (__v4si)_mm_setzero_si128());
1991}1792}
19921793
1993static __inline__ __m128 __DEFAULT_FN_ATTRS1281794static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1994_mm_mask_cvtpd_ps (__m128 __W, __mmask8 __U, __m128d __A) {1795_mm_mask_cvtpd_ps(__m128 __W, __mmask8 __U, __m128d __A) {
1995 return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A,1796 return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A,
1996 (__v4sf) __W,1797 (__v4sf) __W,
1997 (__mmask8) __U);1798 (__mmask8) __U);
1998}1799}
19991800
2000static __inline__ __m128 __DEFAULT_FN_ATTRS1281801static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2001_mm_maskz_cvtpd_ps (__mmask8 __U, __m128d __A) {1802_mm_maskz_cvtpd_ps(__mmask8 __U, __m128d __A) {
2002 return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A,1803 return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A,
2003 (__v4sf)1804 (__v4sf)
2004 _mm_setzero_ps (),1805 _mm_setzero_ps (),
2005 (__mmask8) __U);1806 (__mmask8) __U);
2006}1807}
20071808
2008static __inline__ __m128 __DEFAULT_FN_ATTRS2561809static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
2009_mm256_mask_cvtpd_ps (__m128 __W, __mmask8 __U, __m256d __A) {1810_mm256_mask_cvtpd_ps(__m128 __W, __mmask8 __U, __m256d __A) {
2010 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,1811 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2011 (__v4sf)_mm256_cvtpd_ps(__A),1812 (__v4sf)_mm256_cvtpd_ps(__A),
2012 (__v4sf)__W);1813 (__v4sf)__W);
2013}1814}
20141815
2015static __inline__ __m128 __DEFAULT_FN_ATTRS2561816static __inline__ __m128 __DEFAULT_FN_ATTRS256_CONSTEXPR
2016_mm256_maskz_cvtpd_ps (__mmask8 __U, __m256d __A) {1817_mm256_maskz_cvtpd_ps(__mmask8 __U, __m256d __A) {
2017 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,1818 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2018 (__v4sf)_mm256_cvtpd_ps(__A),1819 (__v4sf)_mm256_cvtpd_ps(__A),
2019 (__v4sf)_mm_setzero_ps());1820 (__v4sf)_mm_setzero_ps());
...@@ -2316,133 +2117,133 @@ _mm256_maskz_cvttps_epu32 (__mmask8 __U, __m256 __A) {...@@ -2316,133 +2117,133 @@ _mm256_maskz_cvttps_epu32 (__mmask8 __U, __m256 __A) {
2316 (__mmask8) __U);2117 (__mmask8) __U);
2317}2118}
23182119
2319static __inline__ __m128d __DEFAULT_FN_ATTRS1282120static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2320_mm_cvtepu32_pd (__m128i __A) {2121_mm_cvtepu32_pd(__m128i __A) {
2321 return (__m128d) __builtin_convertvector(2122 return (__m128d) __builtin_convertvector(
2322 __builtin_shufflevector((__v4su)__A, (__v4su)__A, 0, 1), __v2df);2123 __builtin_shufflevector((__v4su)__A, (__v4su)__A, 0, 1), __v2df);
2323}2124}
23242125
2325static __inline__ __m128d __DEFAULT_FN_ATTRS1282126static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2326_mm_mask_cvtepu32_pd (__m128d __W, __mmask8 __U, __m128i __A) {2127_mm_mask_cvtepu32_pd(__m128d __W, __mmask8 __U, __m128i __A) {
2327 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,2128 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,
2328 (__v2df)_mm_cvtepu32_pd(__A),2129 (__v2df)_mm_cvtepu32_pd(__A),
2329 (__v2df)__W);2130 (__v2df)__W);
2330}2131}
23312132
2332static __inline__ __m128d __DEFAULT_FN_ATTRS1282133static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2333_mm_maskz_cvtepu32_pd (__mmask8 __U, __m128i __A) {2134_mm_maskz_cvtepu32_pd(__mmask8 __U, __m128i __A) {
2334 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,2135 return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U,
2335 (__v2df)_mm_cvtepu32_pd(__A),2136 (__v2df)_mm_cvtepu32_pd(__A),
2336 (__v2df)_mm_setzero_pd());2137 (__v2df)_mm_setzero_pd());
2337}2138}
23382139
2339static __inline__ __m256d __DEFAULT_FN_ATTRS2562140static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2340_mm256_cvtepu32_pd (__m128i __A) {2141_mm256_cvtepu32_pd(__m128i __A) {
2341 return (__m256d)__builtin_convertvector((__v4su)__A, __v4df);2142 return (__m256d)__builtin_convertvector((__v4su)__A, __v4df);
2342}2143}
23432144
2344static __inline__ __m256d __DEFAULT_FN_ATTRS2562145static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2345_mm256_mask_cvtepu32_pd (__m256d __W, __mmask8 __U, __m128i __A) {2146_mm256_mask_cvtepu32_pd(__m256d __W, __mmask8 __U, __m128i __A) {
2346 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,2147 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,
2347 (__v4df)_mm256_cvtepu32_pd(__A),2148 (__v4df)_mm256_cvtepu32_pd(__A),
2348 (__v4df)__W);2149 (__v4df)__W);
2349}2150}
23502151
2351static __inline__ __m256d __DEFAULT_FN_ATTRS2562152static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2352_mm256_maskz_cvtepu32_pd (__mmask8 __U, __m128i __A) {2153_mm256_maskz_cvtepu32_pd(__mmask8 __U, __m128i __A) {
2353 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,2154 return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U,
2354 (__v4df)_mm256_cvtepu32_pd(__A),2155 (__v4df)_mm256_cvtepu32_pd(__A),
2355 (__v4df)_mm256_setzero_pd());2156 (__v4df)_mm256_setzero_pd());
2356}2157}
23572158
2358static __inline__ __m128 __DEFAULT_FN_ATTRS1282159static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2359_mm_cvtepu32_ps (__m128i __A) {2160_mm_cvtepu32_ps(__m128i __A) {
2360 return (__m128)__builtin_convertvector((__v4su)__A, __v4sf);2161 return (__m128)__builtin_convertvector((__v4su)__A, __v4sf);
2361}2162}
23622163
2363static __inline__ __m128 __DEFAULT_FN_ATTRS1282164static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2364_mm_mask_cvtepu32_ps (__m128 __W, __mmask8 __U, __m128i __A) {2165_mm_mask_cvtepu32_ps(__m128 __W, __mmask8 __U, __m128i __A) {
2365 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2166 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2366 (__v4sf)_mm_cvtepu32_ps(__A),2167 (__v4sf)_mm_cvtepu32_ps(__A),
2367 (__v4sf)__W);2168 (__v4sf)__W);
2368}2169}
23692170
2370static __inline__ __m128 __DEFAULT_FN_ATTRS1282171static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2371_mm_maskz_cvtepu32_ps (__mmask8 __U, __m128i __A) {2172_mm_maskz_cvtepu32_ps(__mmask8 __U, __m128i __A) {
2372 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2173 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2373 (__v4sf)_mm_cvtepu32_ps(__A),2174 (__v4sf)_mm_cvtepu32_ps(__A),
2374 (__v4sf)_mm_setzero_ps());2175 (__v4sf)_mm_setzero_ps());
2375}2176}
23762177
2377static __inline__ __m256 __DEFAULT_FN_ATTRS2562178static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2378_mm256_cvtepu32_ps (__m256i __A) {2179_mm256_cvtepu32_ps(__m256i __A) {
2379 return (__m256)__builtin_convertvector((__v8su)__A, __v8sf);2180 return (__m256)__builtin_convertvector((__v8su)__A, __v8sf);
2380}2181}
23812182
2382static __inline__ __m256 __DEFAULT_FN_ATTRS2562183static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2383_mm256_mask_cvtepu32_ps (__m256 __W, __mmask8 __U, __m256i __A) {2184_mm256_mask_cvtepu32_ps(__m256 __W, __mmask8 __U, __m256i __A) {
2384 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2185 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2385 (__v8sf)_mm256_cvtepu32_ps(__A),2186 (__v8sf)_mm256_cvtepu32_ps(__A),
2386 (__v8sf)__W);2187 (__v8sf)__W);
2387}2188}
23882189
2389static __inline__ __m256 __DEFAULT_FN_ATTRS2562190static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2390_mm256_maskz_cvtepu32_ps (__mmask8 __U, __m256i __A) {2191_mm256_maskz_cvtepu32_ps(__mmask8 __U, __m256i __A) {
2391 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2192 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2392 (__v8sf)_mm256_cvtepu32_ps(__A),2193 (__v8sf)_mm256_cvtepu32_ps(__A),
2393 (__v8sf)_mm256_setzero_ps());2194 (__v8sf)_mm256_setzero_ps());
2394}2195}
23952196
2396static __inline__ __m128d __DEFAULT_FN_ATTRS1282197static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2397_mm_mask_div_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {2198_mm_mask_div_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2398 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2199 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2399 (__v2df)_mm_div_pd(__A, __B),2200 (__v2df)_mm_div_pd(__A, __B),
2400 (__v2df)__W);2201 (__v2df)__W);
2401}2202}
24022203
2403static __inline__ __m128d __DEFAULT_FN_ATTRS1282204static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2404_mm_maskz_div_pd(__mmask8 __U, __m128d __A, __m128d __B) {2205_mm_maskz_div_pd(__mmask8 __U, __m128d __A, __m128d __B) {
2405 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2206 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2406 (__v2df)_mm_div_pd(__A, __B),2207 (__v2df)_mm_div_pd(__A, __B),
2407 (__v2df)_mm_setzero_pd());2208 (__v2df)_mm_setzero_pd());
2408}2209}
24092210
2410static __inline__ __m256d __DEFAULT_FN_ATTRS2562211static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2411_mm256_mask_div_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {2212_mm256_mask_div_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
2412 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2213 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2413 (__v4df)_mm256_div_pd(__A, __B),2214 (__v4df)_mm256_div_pd(__A, __B),
2414 (__v4df)__W);2215 (__v4df)__W);
2415}2216}
24162217
2417static __inline__ __m256d __DEFAULT_FN_ATTRS2562218static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2418_mm256_maskz_div_pd(__mmask8 __U, __m256d __A, __m256d __B) {2219_mm256_maskz_div_pd(__mmask8 __U, __m256d __A, __m256d __B) {
2419 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2220 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2420 (__v4df)_mm256_div_pd(__A, __B),2221 (__v4df)_mm256_div_pd(__A, __B),
2421 (__v4df)_mm256_setzero_pd());2222 (__v4df)_mm256_setzero_pd());
2422}2223}
24232224
2424static __inline__ __m128 __DEFAULT_FN_ATTRS1282225static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2425_mm_mask_div_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {2226_mm_mask_div_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2426 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2227 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2427 (__v4sf)_mm_div_ps(__A, __B),2228 (__v4sf)_mm_div_ps(__A, __B),
2428 (__v4sf)__W);2229 (__v4sf)__W);
2429}2230}
24302231
2431static __inline__ __m128 __DEFAULT_FN_ATTRS1282232static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2432_mm_maskz_div_ps(__mmask8 __U, __m128 __A, __m128 __B) {2233_mm_maskz_div_ps(__mmask8 __U, __m128 __A, __m128 __B) {
2433 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2234 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2434 (__v4sf)_mm_div_ps(__A, __B),2235 (__v4sf)_mm_div_ps(__A, __B),
2435 (__v4sf)_mm_setzero_ps());2236 (__v4sf)_mm_setzero_ps());
2436}2237}
24372238
2438static __inline__ __m256 __DEFAULT_FN_ATTRS2562239static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2439_mm256_mask_div_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {2240_mm256_mask_div_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
2440 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2241 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2441 (__v8sf)_mm256_div_ps(__A, __B),2242 (__v8sf)_mm256_div_ps(__A, __B),
2442 (__v8sf)__W);2243 (__v8sf)__W);
2443}2244}
24442245
2445static __inline__ __m256 __DEFAULT_FN_ATTRS2562246static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2446_mm256_maskz_div_ps(__mmask8 __U, __m256 __A, __m256 __B) {2247_mm256_maskz_div_ps(__mmask8 __U, __m256 __A, __m256 __B) {
2447 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2248 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2448 (__v8sf)_mm256_div_ps(__A, __B),2249 (__v8sf)_mm256_div_ps(__A, __B),
...@@ -2796,499 +2597,499 @@ _mm256_maskz_getexp_ps (__mmask8 __U, __m256 __A) {...@@ -2796,499 +2597,499 @@ _mm256_maskz_getexp_ps (__mmask8 __U, __m256 __A) {
2796 (__mmask8) __U);2597 (__mmask8) __U);
2797}2598}
27982599
2799static __inline__ __m128d __DEFAULT_FN_ATTRS1282600static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2800_mm_mask_max_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {2601_mm_mask_max_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2801 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2602 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2802 (__v2df)_mm_max_pd(__A, __B),2603 (__v2df)_mm_max_pd(__A, __B),
2803 (__v2df)__W);2604 (__v2df)__W);
2804}2605}
28052606
2806static __inline__ __m128d __DEFAULT_FN_ATTRS1282607static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2807_mm_maskz_max_pd(__mmask8 __U, __m128d __A, __m128d __B) {2608_mm_maskz_max_pd(__mmask8 __U, __m128d __A, __m128d __B) {
2808 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2609 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2809 (__v2df)_mm_max_pd(__A, __B),2610 (__v2df)_mm_max_pd(__A, __B),
2810 (__v2df)_mm_setzero_pd());2611 (__v2df)_mm_setzero_pd());
2811}2612}
28122613
2813static __inline__ __m256d __DEFAULT_FN_ATTRS2562614static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2814_mm256_mask_max_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {2615_mm256_mask_max_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
2815 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2616 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2816 (__v4df)_mm256_max_pd(__A, __B),2617 (__v4df)_mm256_max_pd(__A, __B),
2817 (__v4df)__W);2618 (__v4df)__W);
2818}2619}
28192620
2820static __inline__ __m256d __DEFAULT_FN_ATTRS2562621static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2821_mm256_maskz_max_pd(__mmask8 __U, __m256d __A, __m256d __B) {2622_mm256_maskz_max_pd(__mmask8 __U, __m256d __A, __m256d __B) {
2822 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2623 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2823 (__v4df)_mm256_max_pd(__A, __B),2624 (__v4df)_mm256_max_pd(__A, __B),
2824 (__v4df)_mm256_setzero_pd());2625 (__v4df)_mm256_setzero_pd());
2825}2626}
28262627
2827static __inline__ __m128 __DEFAULT_FN_ATTRS1282628static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2828_mm_mask_max_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {2629_mm_mask_max_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2829 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2630 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2830 (__v4sf)_mm_max_ps(__A, __B),2631 (__v4sf)_mm_max_ps(__A, __B),
2831 (__v4sf)__W);2632 (__v4sf)__W);
2832}2633}
28332634
2834static __inline__ __m128 __DEFAULT_FN_ATTRS1282635static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2835_mm_maskz_max_ps(__mmask8 __U, __m128 __A, __m128 __B) {2636_mm_maskz_max_ps(__mmask8 __U, __m128 __A, __m128 __B) {
2836 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2637 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2837 (__v4sf)_mm_max_ps(__A, __B),2638 (__v4sf)_mm_max_ps(__A, __B),
2838 (__v4sf)_mm_setzero_ps());2639 (__v4sf)_mm_setzero_ps());
2839}2640}
28402641
2841static __inline__ __m256 __DEFAULT_FN_ATTRS2562642static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2842_mm256_mask_max_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {2643_mm256_mask_max_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
2843 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2644 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2844 (__v8sf)_mm256_max_ps(__A, __B),2645 (__v8sf)_mm256_max_ps(__A, __B),
2845 (__v8sf)__W);2646 (__v8sf)__W);
2846}2647}
28472648
2848static __inline__ __m256 __DEFAULT_FN_ATTRS2562649static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2849_mm256_maskz_max_ps(__mmask8 __U, __m256 __A, __m256 __B) {2650_mm256_maskz_max_ps(__mmask8 __U, __m256 __A, __m256 __B) {
2850 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2651 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2851 (__v8sf)_mm256_max_ps(__A, __B),2652 (__v8sf)_mm256_max_ps(__A, __B),
2852 (__v8sf)_mm256_setzero_ps());2653 (__v8sf)_mm256_setzero_ps());
2853}2654}
28542655
2855static __inline__ __m128d __DEFAULT_FN_ATTRS1282656static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2856_mm_mask_min_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {2657_mm_mask_min_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2857 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2658 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2858 (__v2df)_mm_min_pd(__A, __B),2659 (__v2df)_mm_min_pd(__A, __B),
2859 (__v2df)__W);2660 (__v2df)__W);
2860}2661}
28612662
2862static __inline__ __m128d __DEFAULT_FN_ATTRS1282663static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2863_mm_maskz_min_pd(__mmask8 __U, __m128d __A, __m128d __B) {2664_mm_maskz_min_pd(__mmask8 __U, __m128d __A, __m128d __B) {
2864 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2665 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2865 (__v2df)_mm_min_pd(__A, __B),2666 (__v2df)_mm_min_pd(__A, __B),
2866 (__v2df)_mm_setzero_pd());2667 (__v2df)_mm_setzero_pd());
2867}2668}
28682669
2869static __inline__ __m256d __DEFAULT_FN_ATTRS2562670static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2870_mm256_mask_min_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {2671_mm256_mask_min_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
2871 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2672 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2872 (__v4df)_mm256_min_pd(__A, __B),2673 (__v4df)_mm256_min_pd(__A, __B),
2873 (__v4df)__W);2674 (__v4df)__W);
2874}2675}
28752676
2876static __inline__ __m256d __DEFAULT_FN_ATTRS2562677static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2877_mm256_maskz_min_pd(__mmask8 __U, __m256d __A, __m256d __B) {2678_mm256_maskz_min_pd(__mmask8 __U, __m256d __A, __m256d __B) {
2878 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2679 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2879 (__v4df)_mm256_min_pd(__A, __B),2680 (__v4df)_mm256_min_pd(__A, __B),
2880 (__v4df)_mm256_setzero_pd());2681 (__v4df)_mm256_setzero_pd());
2881}2682}
28822683
2883static __inline__ __m128 __DEFAULT_FN_ATTRS1282684static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2884_mm_mask_min_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {2685_mm_mask_min_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2885 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2686 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2886 (__v4sf)_mm_min_ps(__A, __B),2687 (__v4sf)_mm_min_ps(__A, __B),
2887 (__v4sf)__W);2688 (__v4sf)__W);
2888}2689}
28892690
2890static __inline__ __m128 __DEFAULT_FN_ATTRS1282691static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2891_mm_maskz_min_ps(__mmask8 __U, __m128 __A, __m128 __B) {2692_mm_maskz_min_ps(__mmask8 __U, __m128 __A, __m128 __B) {
2892 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2693 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2893 (__v4sf)_mm_min_ps(__A, __B),2694 (__v4sf)_mm_min_ps(__A, __B),
2894 (__v4sf)_mm_setzero_ps());2695 (__v4sf)_mm_setzero_ps());
2895}2696}
28962697
2897static __inline__ __m256 __DEFAULT_FN_ATTRS2562698static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2898_mm256_mask_min_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {2699_mm256_mask_min_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
2899 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2700 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2900 (__v8sf)_mm256_min_ps(__A, __B),2701 (__v8sf)_mm256_min_ps(__A, __B),
2901 (__v8sf)__W);2702 (__v8sf)__W);
2902}2703}
29032704
2904static __inline__ __m256 __DEFAULT_FN_ATTRS2562705static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2905_mm256_maskz_min_ps(__mmask8 __U, __m256 __A, __m256 __B) {2706_mm256_maskz_min_ps(__mmask8 __U, __m256 __A, __m256 __B) {
2906 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2707 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2907 (__v8sf)_mm256_min_ps(__A, __B),2708 (__v8sf)_mm256_min_ps(__A, __B),
2908 (__v8sf)_mm256_setzero_ps());2709 (__v8sf)_mm256_setzero_ps());
2909}2710}
29102711
2911static __inline__ __m128d __DEFAULT_FN_ATTRS1282712static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2912_mm_mask_mul_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {2713_mm_mask_mul_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
2913 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2714 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2914 (__v2df)_mm_mul_pd(__A, __B),2715 (__v2df)_mm_mul_pd(__A, __B),
2915 (__v2df)__W);2716 (__v2df)__W);
2916}2717}
29172718
2918static __inline__ __m128d __DEFAULT_FN_ATTRS1282719static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2919_mm_maskz_mul_pd(__mmask8 __U, __m128d __A, __m128d __B) {2720_mm_maskz_mul_pd(__mmask8 __U, __m128d __A, __m128d __B) {
2920 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,2721 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
2921 (__v2df)_mm_mul_pd(__A, __B),2722 (__v2df)_mm_mul_pd(__A, __B),
2922 (__v2df)_mm_setzero_pd());2723 (__v2df)_mm_setzero_pd());
2923}2724}
29242725
2925static __inline__ __m256d __DEFAULT_FN_ATTRS2562726static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2926_mm256_mask_mul_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {2727_mm256_mask_mul_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
2927 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2728 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2928 (__v4df)_mm256_mul_pd(__A, __B),2729 (__v4df)_mm256_mul_pd(__A, __B),
2929 (__v4df)__W);2730 (__v4df)__W);
2930}2731}
29312732
2932static __inline__ __m256d __DEFAULT_FN_ATTRS2562733static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2933_mm256_maskz_mul_pd(__mmask8 __U, __m256d __A, __m256d __B) {2734_mm256_maskz_mul_pd(__mmask8 __U, __m256d __A, __m256d __B) {
2934 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,2735 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
2935 (__v4df)_mm256_mul_pd(__A, __B),2736 (__v4df)_mm256_mul_pd(__A, __B),
2936 (__v4df)_mm256_setzero_pd());2737 (__v4df)_mm256_setzero_pd());
2937}2738}
29382739
2939static __inline__ __m128 __DEFAULT_FN_ATTRS1282740static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2940_mm_mask_mul_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {2741_mm_mask_mul_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
2941 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2742 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2942 (__v4sf)_mm_mul_ps(__A, __B),2743 (__v4sf)_mm_mul_ps(__A, __B),
2943 (__v4sf)__W);2744 (__v4sf)__W);
2944}2745}
29452746
2946static __inline__ __m128 __DEFAULT_FN_ATTRS1282747static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2947_mm_maskz_mul_ps(__mmask8 __U, __m128 __A, __m128 __B) {2748_mm_maskz_mul_ps(__mmask8 __U, __m128 __A, __m128 __B) {
2948 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,2749 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
2949 (__v4sf)_mm_mul_ps(__A, __B),2750 (__v4sf)_mm_mul_ps(__A, __B),
2950 (__v4sf)_mm_setzero_ps());2751 (__v4sf)_mm_setzero_ps());
2951}2752}
29522753
2953static __inline__ __m256 __DEFAULT_FN_ATTRS2562754static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2954_mm256_mask_mul_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {2755_mm256_mask_mul_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
2955 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2756 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2956 (__v8sf)_mm256_mul_ps(__A, __B),2757 (__v8sf)_mm256_mul_ps(__A, __B),
2957 (__v8sf)__W);2758 (__v8sf)__W);
2958}2759}
29592760
2960static __inline__ __m256 __DEFAULT_FN_ATTRS2562761static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2961_mm256_maskz_mul_ps(__mmask8 __U, __m256 __A, __m256 __B) {2762_mm256_maskz_mul_ps(__mmask8 __U, __m256 __A, __m256 __B) {
2962 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,2763 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
2963 (__v8sf)_mm256_mul_ps(__A, __B),2764 (__v8sf)_mm256_mul_ps(__A, __B),
2964 (__v8sf)_mm256_setzero_ps());2765 (__v8sf)_mm256_setzero_ps());
2965}2766}
29662767
2967static __inline__ __m128i __DEFAULT_FN_ATTRS1282768static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2968_mm_mask_abs_epi32(__m128i __W, __mmask8 __U, __m128i __A) {2769_mm_mask_abs_epi32(__m128i __W, __mmask8 __U, __m128i __A) {
2969 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,2770 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
2970 (__v4si)_mm_abs_epi32(__A),2771 (__v4si)_mm_abs_epi32(__A),
2971 (__v4si)__W);2772 (__v4si)__W);
2972}2773}
29732774
2974static __inline__ __m128i __DEFAULT_FN_ATTRS1282775static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2975_mm_maskz_abs_epi32(__mmask8 __U, __m128i __A) {2776_mm_maskz_abs_epi32(__mmask8 __U, __m128i __A) {
2976 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,2777 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
2977 (__v4si)_mm_abs_epi32(__A),2778 (__v4si)_mm_abs_epi32(__A),
2978 (__v4si)_mm_setzero_si128());2779 (__v4si)_mm_setzero_si128());
2979}2780}
29802781
2981static __inline__ __m256i __DEFAULT_FN_ATTRS2562782static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2982_mm256_mask_abs_epi32(__m256i __W, __mmask8 __U, __m256i __A) {2783_mm256_mask_abs_epi32(__m256i __W, __mmask8 __U, __m256i __A) {
2983 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,2784 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
2984 (__v8si)_mm256_abs_epi32(__A),2785 (__v8si)_mm256_abs_epi32(__A),
2985 (__v8si)__W);2786 (__v8si)__W);
2986}2787}
29872788
2988static __inline__ __m256i __DEFAULT_FN_ATTRS2562789static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2989_mm256_maskz_abs_epi32(__mmask8 __U, __m256i __A) {2790_mm256_maskz_abs_epi32(__mmask8 __U, __m256i __A) {
2990 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,2791 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
2991 (__v8si)_mm256_abs_epi32(__A),2792 (__v8si)_mm256_abs_epi32(__A),
2992 (__v8si)_mm256_setzero_si256());2793 (__v8si)_mm256_setzero_si256());
2993}2794}
29942795
2995static __inline__ __m128i __DEFAULT_FN_ATTRS1282796static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2996_mm_abs_epi64 (__m128i __A) {2797_mm_abs_epi64(__m128i __A) {
2997 return (__m128i)__builtin_elementwise_abs((__v2di)__A);2798 return (__m128i)__builtin_elementwise_abs((__v2di)__A);
2998}2799}
29992800
3000static __inline__ __m128i __DEFAULT_FN_ATTRS1282801static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3001_mm_mask_abs_epi64 (__m128i __W, __mmask8 __U, __m128i __A) {2802_mm_mask_abs_epi64(__m128i __W, __mmask8 __U, __m128i __A) {
3002 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,2803 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
3003 (__v2di)_mm_abs_epi64(__A),2804 (__v2di)_mm_abs_epi64(__A),
3004 (__v2di)__W);2805 (__v2di)__W);
3005}2806}
30062807
3007static __inline__ __m128i __DEFAULT_FN_ATTRS1282808static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3008_mm_maskz_abs_epi64 (__mmask8 __U, __m128i __A) {2809_mm_maskz_abs_epi64(__mmask8 __U, __m128i __A) {
3009 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,2810 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
3010 (__v2di)_mm_abs_epi64(__A),2811 (__v2di)_mm_abs_epi64(__A),
3011 (__v2di)_mm_setzero_si128());2812 (__v2di)_mm_setzero_si128());
3012}2813}
30132814
3014static __inline__ __m256i __DEFAULT_FN_ATTRS2562815static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3015_mm256_abs_epi64 (__m256i __A) {2816_mm256_abs_epi64(__m256i __A) {
3016 return (__m256i)__builtin_elementwise_abs((__v4di)__A);2817 return (__m256i)__builtin_elementwise_abs((__v4di)__A);
3017}2818}
30182819
3019static __inline__ __m256i __DEFAULT_FN_ATTRS2562820static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3020_mm256_mask_abs_epi64 (__m256i __W, __mmask8 __U, __m256i __A) {2821_mm256_mask_abs_epi64(__m256i __W, __mmask8 __U, __m256i __A) {
3021 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,2822 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
3022 (__v4di)_mm256_abs_epi64(__A),2823 (__v4di)_mm256_abs_epi64(__A),
3023 (__v4di)__W);2824 (__v4di)__W);
3024}2825}
30252826
3026static __inline__ __m256i __DEFAULT_FN_ATTRS2562827static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3027_mm256_maskz_abs_epi64 (__mmask8 __U, __m256i __A) {2828_mm256_maskz_abs_epi64(__mmask8 __U, __m256i __A) {
3028 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,2829 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
3029 (__v4di)_mm256_abs_epi64(__A),2830 (__v4di)_mm256_abs_epi64(__A),
3030 (__v4di)_mm256_setzero_si256());2831 (__v4di)_mm256_setzero_si256());
3031}2832}
30322833
3033static __inline__ __m128i __DEFAULT_FN_ATTRS1282834static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3034_mm_maskz_max_epi32(__mmask8 __M, __m128i __A, __m128i __B) {2835_mm_maskz_max_epi32(__mmask8 __M, __m128i __A, __m128i __B) {
3035 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,2836 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3036 (__v4si)_mm_max_epi32(__A, __B),2837 (__v4si)_mm_max_epi32(__A, __B),
3037 (__v4si)_mm_setzero_si128());2838 (__v4si)_mm_setzero_si128());
3038}2839}
30392840
3040static __inline__ __m128i __DEFAULT_FN_ATTRS1282841static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3041_mm_mask_max_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {2842_mm_mask_max_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3042 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,2843 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3043 (__v4si)_mm_max_epi32(__A, __B),2844 (__v4si)_mm_max_epi32(__A, __B),
3044 (__v4si)__W);2845 (__v4si)__W);
3045}2846}
30462847
3047static __inline__ __m256i __DEFAULT_FN_ATTRS2562848static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3048_mm256_maskz_max_epi32(__mmask8 __M, __m256i __A, __m256i __B) {2849_mm256_maskz_max_epi32(__mmask8 __M, __m256i __A, __m256i __B) {
3049 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,2850 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3050 (__v8si)_mm256_max_epi32(__A, __B),2851 (__v8si)_mm256_max_epi32(__A, __B),
3051 (__v8si)_mm256_setzero_si256());2852 (__v8si)_mm256_setzero_si256());
3052}2853}
30532854
3054static __inline__ __m256i __DEFAULT_FN_ATTRS2562855static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3055_mm256_mask_max_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {2856_mm256_mask_max_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3056 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,2857 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3057 (__v8si)_mm256_max_epi32(__A, __B),2858 (__v8si)_mm256_max_epi32(__A, __B),
3058 (__v8si)__W);2859 (__v8si)__W);
3059}2860}
30602861
3061static __inline__ __m128i __DEFAULT_FN_ATTRS1282862static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3062_mm_max_epi64 (__m128i __A, __m128i __B) {2863_mm_max_epi64(__m128i __A, __m128i __B) {
3063 return (__m128i)__builtin_elementwise_max((__v2di)__A, (__v2di)__B);2864 return (__m128i)__builtin_elementwise_max((__v2di)__A, (__v2di)__B);
3064}2865}
30652866
3066static __inline__ __m128i __DEFAULT_FN_ATTRS1282867static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3067_mm_maskz_max_epi64 (__mmask8 __M, __m128i __A, __m128i __B) {2868_mm_maskz_max_epi64(__mmask8 __M, __m128i __A, __m128i __B) {
3068 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,2869 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3069 (__v2di)_mm_max_epi64(__A, __B),2870 (__v2di)_mm_max_epi64(__A, __B),
3070 (__v2di)_mm_setzero_si128());2871 (__v2di)_mm_setzero_si128());
3071}2872}
30722873
3073static __inline__ __m128i __DEFAULT_FN_ATTRS1282874static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3074_mm_mask_max_epi64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {2875_mm_mask_max_epi64(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3075 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,2876 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3076 (__v2di)_mm_max_epi64(__A, __B),2877 (__v2di)_mm_max_epi64(__A, __B),
3077 (__v2di)__W);2878 (__v2di)__W);
3078}2879}
30792880
3080static __inline__ __m256i __DEFAULT_FN_ATTRS2562881static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3081_mm256_max_epi64 (__m256i __A, __m256i __B) {2882_mm256_max_epi64(__m256i __A, __m256i __B) {
3082 return (__m256i)__builtin_elementwise_max((__v4di)__A, (__v4di)__B);2883 return (__m256i)__builtin_elementwise_max((__v4di)__A, (__v4di)__B);
3083}2884}
30842885
3085static __inline__ __m256i __DEFAULT_FN_ATTRS2562886static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3086_mm256_maskz_max_epi64 (__mmask8 __M, __m256i __A, __m256i __B) {2887_mm256_maskz_max_epi64(__mmask8 __M, __m256i __A, __m256i __B) {
3087 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,2888 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3088 (__v4di)_mm256_max_epi64(__A, __B),2889 (__v4di)_mm256_max_epi64(__A, __B),
3089 (__v4di)_mm256_setzero_si256());2890 (__v4di)_mm256_setzero_si256());
3090}2891}
30912892
3092static __inline__ __m256i __DEFAULT_FN_ATTRS2562893static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3093_mm256_mask_max_epi64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {2894_mm256_mask_max_epi64(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3094 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,2895 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3095 (__v4di)_mm256_max_epi64(__A, __B),2896 (__v4di)_mm256_max_epi64(__A, __B),
3096 (__v4di)__W);2897 (__v4di)__W);
3097}2898}
30982899
3099static __inline__ __m128i __DEFAULT_FN_ATTRS1282900static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3100_mm_maskz_max_epu32(__mmask8 __M, __m128i __A, __m128i __B) {2901_mm_maskz_max_epu32(__mmask8 __M, __m128i __A, __m128i __B) {
3101 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,2902 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3102 (__v4si)_mm_max_epu32(__A, __B),2903 (__v4si)_mm_max_epu32(__A, __B),
3103 (__v4si)_mm_setzero_si128());2904 (__v4si)_mm_setzero_si128());
3104}2905}
31052906
3106static __inline__ __m128i __DEFAULT_FN_ATTRS1282907static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3107_mm_mask_max_epu32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {2908_mm_mask_max_epu32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3108 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,2909 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3109 (__v4si)_mm_max_epu32(__A, __B),2910 (__v4si)_mm_max_epu32(__A, __B),
3110 (__v4si)__W);2911 (__v4si)__W);
3111}2912}
31122913
3113static __inline__ __m256i __DEFAULT_FN_ATTRS2562914static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3114_mm256_maskz_max_epu32(__mmask8 __M, __m256i __A, __m256i __B) {2915_mm256_maskz_max_epu32(__mmask8 __M, __m256i __A, __m256i __B) {
3115 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,2916 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3116 (__v8si)_mm256_max_epu32(__A, __B),2917 (__v8si)_mm256_max_epu32(__A, __B),
3117 (__v8si)_mm256_setzero_si256());2918 (__v8si)_mm256_setzero_si256());
3118}2919}
31192920
3120static __inline__ __m256i __DEFAULT_FN_ATTRS2562921static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3121_mm256_mask_max_epu32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {2922_mm256_mask_max_epu32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3122 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,2923 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3123 (__v8si)_mm256_max_epu32(__A, __B),2924 (__v8si)_mm256_max_epu32(__A, __B),
3124 (__v8si)__W);2925 (__v8si)__W);
3125}2926}
31262927
3127static __inline__ __m128i __DEFAULT_FN_ATTRS1282928static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3128_mm_max_epu64 (__m128i __A, __m128i __B) {2929_mm_max_epu64(__m128i __A, __m128i __B) {
3129 return (__m128i)__builtin_elementwise_max((__v2du)__A, (__v2du)__B);2930 return (__m128i)__builtin_elementwise_max((__v2du)__A, (__v2du)__B);
3130}2931}
31312932
3132static __inline__ __m128i __DEFAULT_FN_ATTRS1282933static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3133_mm_maskz_max_epu64 (__mmask8 __M, __m128i __A, __m128i __B) {2934_mm_maskz_max_epu64(__mmask8 __M, __m128i __A, __m128i __B) {
3134 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,2935 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3135 (__v2di)_mm_max_epu64(__A, __B),2936 (__v2di)_mm_max_epu64(__A, __B),
3136 (__v2di)_mm_setzero_si128());2937 (__v2di)_mm_setzero_si128());
3137}2938}
31382939
3139static __inline__ __m128i __DEFAULT_FN_ATTRS1282940static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3140_mm_mask_max_epu64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {2941_mm_mask_max_epu64(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3141 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,2942 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3142 (__v2di)_mm_max_epu64(__A, __B),2943 (__v2di)_mm_max_epu64(__A, __B),
3143 (__v2di)__W);2944 (__v2di)__W);
3144}2945}
31452946
3146static __inline__ __m256i __DEFAULT_FN_ATTRS2562947static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3147_mm256_max_epu64 (__m256i __A, __m256i __B) {2948_mm256_max_epu64(__m256i __A, __m256i __B) {
3148 return (__m256i)__builtin_elementwise_max((__v4du)__A, (__v4du)__B);2949 return (__m256i)__builtin_elementwise_max((__v4du)__A, (__v4du)__B);
3149}2950}
31502951
3151static __inline__ __m256i __DEFAULT_FN_ATTRS2562952static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3152_mm256_maskz_max_epu64 (__mmask8 __M, __m256i __A, __m256i __B) {2953_mm256_maskz_max_epu64(__mmask8 __M, __m256i __A, __m256i __B) {
3153 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,2954 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3154 (__v4di)_mm256_max_epu64(__A, __B),2955 (__v4di)_mm256_max_epu64(__A, __B),
3155 (__v4di)_mm256_setzero_si256());2956 (__v4di)_mm256_setzero_si256());
3156}2957}
31572958
3158static __inline__ __m256i __DEFAULT_FN_ATTRS2562959static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3159_mm256_mask_max_epu64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {2960_mm256_mask_max_epu64(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3160 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,2961 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3161 (__v4di)_mm256_max_epu64(__A, __B),2962 (__v4di)_mm256_max_epu64(__A, __B),
3162 (__v4di)__W);2963 (__v4di)__W);
3163}2964}
31642965
3165static __inline__ __m128i __DEFAULT_FN_ATTRS1282966static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3166_mm_maskz_min_epi32(__mmask8 __M, __m128i __A, __m128i __B) {2967_mm_maskz_min_epi32(__mmask8 __M, __m128i __A, __m128i __B) {
3167 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,2968 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3168 (__v4si)_mm_min_epi32(__A, __B),2969 (__v4si)_mm_min_epi32(__A, __B),
3169 (__v4si)_mm_setzero_si128());2970 (__v4si)_mm_setzero_si128());
3170}2971}
31712972
3172static __inline__ __m128i __DEFAULT_FN_ATTRS1282973static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3173_mm_mask_min_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {2974_mm_mask_min_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3174 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,2975 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3175 (__v4si)_mm_min_epi32(__A, __B),2976 (__v4si)_mm_min_epi32(__A, __B),
3176 (__v4si)__W);2977 (__v4si)__W);
3177}2978}
31782979
3179static __inline__ __m256i __DEFAULT_FN_ATTRS2562980static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3180_mm256_maskz_min_epi32(__mmask8 __M, __m256i __A, __m256i __B) {2981_mm256_maskz_min_epi32(__mmask8 __M, __m256i __A, __m256i __B) {
3181 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,2982 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3182 (__v8si)_mm256_min_epi32(__A, __B),2983 (__v8si)_mm256_min_epi32(__A, __B),
3183 (__v8si)_mm256_setzero_si256());2984 (__v8si)_mm256_setzero_si256());
3184}2985}
31852986
3186static __inline__ __m256i __DEFAULT_FN_ATTRS2562987static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3187_mm256_mask_min_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {2988_mm256_mask_min_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3188 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,2989 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3189 (__v8si)_mm256_min_epi32(__A, __B),2990 (__v8si)_mm256_min_epi32(__A, __B),
3190 (__v8si)__W);2991 (__v8si)__W);
3191}2992}
31922993
3193static __inline__ __m128i __DEFAULT_FN_ATTRS1282994static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3194_mm_min_epi64 (__m128i __A, __m128i __B) {2995_mm_min_epi64(__m128i __A, __m128i __B) {
3195 return (__m128i)__builtin_elementwise_min((__v2di)__A, (__v2di)__B);2996 return (__m128i)__builtin_elementwise_min((__v2di)__A, (__v2di)__B);
3196}2997}
31972998
3198static __inline__ __m128i __DEFAULT_FN_ATTRS1282999static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3199_mm_mask_min_epi64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {3000_mm_mask_min_epi64(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3200 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,3001 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3201 (__v2di)_mm_min_epi64(__A, __B),3002 (__v2di)_mm_min_epi64(__A, __B),
3202 (__v2di)__W);3003 (__v2di)__W);
3203}3004}
32043005
3205static __inline__ __m128i __DEFAULT_FN_ATTRS1283006static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3206_mm_maskz_min_epi64 (__mmask8 __M, __m128i __A, __m128i __B) {3007_mm_maskz_min_epi64(__mmask8 __M, __m128i __A, __m128i __B) {
3207 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,3008 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3208 (__v2di)_mm_min_epi64(__A, __B),3009 (__v2di)_mm_min_epi64(__A, __B),
3209 (__v2di)_mm_setzero_si128());3010 (__v2di)_mm_setzero_si128());
3210}3011}
32113012
3212static __inline__ __m256i __DEFAULT_FN_ATTRS2563013static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3213_mm256_min_epi64 (__m256i __A, __m256i __B) {3014_mm256_min_epi64(__m256i __A, __m256i __B) {
3214 return (__m256i)__builtin_elementwise_min((__v4di)__A, (__v4di)__B);3015 return (__m256i)__builtin_elementwise_min((__v4di)__A, (__v4di)__B);
3215}3016}
32163017
3217static __inline__ __m256i __DEFAULT_FN_ATTRS2563018static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3218_mm256_mask_min_epi64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {3019_mm256_mask_min_epi64(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3219 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,3020 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3220 (__v4di)_mm256_min_epi64(__A, __B),3021 (__v4di)_mm256_min_epi64(__A, __B),
3221 (__v4di)__W);3022 (__v4di)__W);
3222}3023}
32233024
3224static __inline__ __m256i __DEFAULT_FN_ATTRS2563025static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3225_mm256_maskz_min_epi64 (__mmask8 __M, __m256i __A, __m256i __B) {3026_mm256_maskz_min_epi64(__mmask8 __M, __m256i __A, __m256i __B) {
3226 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,3027 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3227 (__v4di)_mm256_min_epi64(__A, __B),3028 (__v4di)_mm256_min_epi64(__A, __B),
3228 (__v4di)_mm256_setzero_si256());3029 (__v4di)_mm256_setzero_si256());
3229}3030}
32303031
3231static __inline__ __m128i __DEFAULT_FN_ATTRS1283032static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3232_mm_maskz_min_epu32(__mmask8 __M, __m128i __A, __m128i __B) {3033_mm_maskz_min_epu32(__mmask8 __M, __m128i __A, __m128i __B) {
3233 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,3034 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3234 (__v4si)_mm_min_epu32(__A, __B),3035 (__v4si)_mm_min_epu32(__A, __B),
3235 (__v4si)_mm_setzero_si128());3036 (__v4si)_mm_setzero_si128());
3236}3037}
32373038
3238static __inline__ __m128i __DEFAULT_FN_ATTRS1283039static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3239_mm_mask_min_epu32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {3040_mm_mask_min_epu32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3240 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,3041 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
3241 (__v4si)_mm_min_epu32(__A, __B),3042 (__v4si)_mm_min_epu32(__A, __B),
3242 (__v4si)__W);3043 (__v4si)__W);
3243}3044}
32443045
3245static __inline__ __m256i __DEFAULT_FN_ATTRS2563046static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3246_mm256_maskz_min_epu32(__mmask8 __M, __m256i __A, __m256i __B) {3047_mm256_maskz_min_epu32(__mmask8 __M, __m256i __A, __m256i __B) {
3247 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,3048 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3248 (__v8si)_mm256_min_epu32(__A, __B),3049 (__v8si)_mm256_min_epu32(__A, __B),
3249 (__v8si)_mm256_setzero_si256());3050 (__v8si)_mm256_setzero_si256());
3250}3051}
32513052
3252static __inline__ __m256i __DEFAULT_FN_ATTRS2563053static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3253_mm256_mask_min_epu32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {3054_mm256_mask_min_epu32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3254 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,3055 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
3255 (__v8si)_mm256_min_epu32(__A, __B),3056 (__v8si)_mm256_min_epu32(__A, __B),
3256 (__v8si)__W);3057 (__v8si)__W);
3257}3058}
32583059
3259static __inline__ __m128i __DEFAULT_FN_ATTRS1283060static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3260_mm_min_epu64 (__m128i __A, __m128i __B) {3061_mm_min_epu64(__m128i __A, __m128i __B) {
3261 return (__m128i)__builtin_elementwise_min((__v2du)__A, (__v2du)__B);3062 return (__m128i)__builtin_elementwise_min((__v2du)__A, (__v2du)__B);
3262}3063}
32633064
3264static __inline__ __m128i __DEFAULT_FN_ATTRS1283065static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3265_mm_mask_min_epu64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {3066_mm_mask_min_epu64(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) {
3266 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,3067 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3267 (__v2di)_mm_min_epu64(__A, __B),3068 (__v2di)_mm_min_epu64(__A, __B),
3268 (__v2di)__W);3069 (__v2di)__W);
3269}3070}
32703071
3271static __inline__ __m128i __DEFAULT_FN_ATTRS1283072static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3272_mm_maskz_min_epu64 (__mmask8 __M, __m128i __A, __m128i __B) {3073_mm_maskz_min_epu64(__mmask8 __M, __m128i __A, __m128i __B) {
3273 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,3074 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M,
3274 (__v2di)_mm_min_epu64(__A, __B),3075 (__v2di)_mm_min_epu64(__A, __B),
3275 (__v2di)_mm_setzero_si128());3076 (__v2di)_mm_setzero_si128());
3276}3077}
32773078
3278static __inline__ __m256i __DEFAULT_FN_ATTRS2563079static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3279_mm256_min_epu64 (__m256i __A, __m256i __B) {3080_mm256_min_epu64(__m256i __A, __m256i __B) {
3280 return (__m256i)__builtin_elementwise_min((__v4du)__A, (__v4du)__B);3081 return (__m256i)__builtin_elementwise_min((__v4du)__A, (__v4du)__B);
3281}3082}
32823083
3283static __inline__ __m256i __DEFAULT_FN_ATTRS2563084static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3284_mm256_mask_min_epu64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {3085_mm256_mask_min_epu64(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) {
3285 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,3086 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3286 (__v4di)_mm256_min_epu64(__A, __B),3087 (__v4di)_mm256_min_epu64(__A, __B),
3287 (__v4di)__W);3088 (__v4di)__W);
3288}3089}
32893090
3290static __inline__ __m256i __DEFAULT_FN_ATTRS2563091static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3291_mm256_maskz_min_epu64 (__mmask8 __M, __m256i __A, __m256i __B) {3092_mm256_maskz_min_epu64(__mmask8 __M, __m256i __A, __m256i __B) {
3292 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,3093 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
3293 (__v4di)_mm256_min_epu64(__A, __B),3094 (__v4di)_mm256_min_epu64(__A, __B),
3294 (__v4di)_mm256_setzero_si256());3095 (__v4di)_mm256_setzero_si256());
...@@ -3691,69 +3492,69 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3691,69 +3492,69 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3691 (__v8sf)_mm256_setzero_ps());3492 (__v8sf)_mm256_setzero_ps());
3692 }3493 }
36933494
3694 static __inline__ __m128d __DEFAULT_FN_ATTRS1283495 static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3695 _mm_mask_sub_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {3496 _mm_mask_sub_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
3696 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,3497 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
3697 (__v2df)_mm_sub_pd(__A, __B),3498 (__v2df)_mm_sub_pd(__A, __B),
3698 (__v2df)__W);3499 (__v2df)__W);
3699 }3500 }
37003501
3701 static __inline__ __m128d __DEFAULT_FN_ATTRS1283502 static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3702 _mm_maskz_sub_pd(__mmask8 __U, __m128d __A, __m128d __B) {3503 _mm_maskz_sub_pd(__mmask8 __U, __m128d __A, __m128d __B) {
3703 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,3504 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
3704 (__v2df)_mm_sub_pd(__A, __B),3505 (__v2df)_mm_sub_pd(__A, __B),
3705 (__v2df)_mm_setzero_pd());3506 (__v2df)_mm_setzero_pd());
3706 }3507 }
37073508
3708 static __inline__ __m256d __DEFAULT_FN_ATTRS2563509 static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3709 _mm256_mask_sub_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {3510 _mm256_mask_sub_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
3710 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,3511 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
3711 (__v4df)_mm256_sub_pd(__A, __B),3512 (__v4df)_mm256_sub_pd(__A, __B),
3712 (__v4df)__W);3513 (__v4df)__W);
3713 }3514 }
37143515
3715 static __inline__ __m256d __DEFAULT_FN_ATTRS2563516 static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3716 _mm256_maskz_sub_pd(__mmask8 __U, __m256d __A, __m256d __B) {3517 _mm256_maskz_sub_pd(__mmask8 __U, __m256d __A, __m256d __B) {
3717 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,3518 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
3718 (__v4df)_mm256_sub_pd(__A, __B),3519 (__v4df)_mm256_sub_pd(__A, __B),
3719 (__v4df)_mm256_setzero_pd());3520 (__v4df)_mm256_setzero_pd());
3720 }3521 }
37213522
3722 static __inline__ __m128 __DEFAULT_FN_ATTRS1283523 static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3723 _mm_mask_sub_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {3524 _mm_mask_sub_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
3724 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,3525 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
3725 (__v4sf)_mm_sub_ps(__A, __B),3526 (__v4sf)_mm_sub_ps(__A, __B),
3726 (__v4sf)__W);3527 (__v4sf)__W);
3727 }3528 }
37283529
3729 static __inline__ __m128 __DEFAULT_FN_ATTRS1283530 static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3730 _mm_maskz_sub_ps(__mmask8 __U, __m128 __A, __m128 __B) {3531 _mm_maskz_sub_ps(__mmask8 __U, __m128 __A, __m128 __B) {
3731 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,3532 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
3732 (__v4sf)_mm_sub_ps(__A, __B),3533 (__v4sf)_mm_sub_ps(__A, __B),
3733 (__v4sf)_mm_setzero_ps());3534 (__v4sf)_mm_setzero_ps());
3734 }3535 }
37353536
3736 static __inline__ __m256 __DEFAULT_FN_ATTRS2563537 static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3737 _mm256_mask_sub_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {3538 _mm256_mask_sub_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
3738 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,3539 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
3739 (__v8sf)_mm256_sub_ps(__A, __B),3540 (__v8sf)_mm256_sub_ps(__A, __B),
3740 (__v8sf)__W);3541 (__v8sf)__W);
3741 }3542 }
37423543
3743 static __inline__ __m256 __DEFAULT_FN_ATTRS2563544 static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3744 _mm256_maskz_sub_ps(__mmask8 __U, __m256 __A, __m256 __B) {3545 _mm256_maskz_sub_ps(__mmask8 __U, __m256 __A, __m256 __B) {
3745 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,3546 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
3746 (__v8sf)_mm256_sub_ps(__A, __B),3547 (__v8sf)_mm256_sub_ps(__A, __B),
3747 (__v8sf)_mm256_setzero_ps());3548 (__v8sf)_mm256_setzero_ps());
3748 }3549 }
37493550
3750 static __inline__ __m128i __DEFAULT_FN_ATTRS1283551 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3751 _mm_permutex2var_epi32(__m128i __A, __m128i __I, __m128i __B) {3552 _mm_permutex2var_epi32(__m128i __A, __m128i __I, __m128i __B) {
3752 return (__m128i)__builtin_ia32_vpermi2vard128((__v4si) __A, (__v4si)__I,3553 return (__m128i)__builtin_ia32_vpermi2vard128((__v4si) __A, (__v4si)__I,
3753 (__v4si)__B);3554 (__v4si)__B);
3754 }3555 }
37553556
3756 static __inline__ __m128i __DEFAULT_FN_ATTRS1283557 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3757 _mm_mask_permutex2var_epi32(__m128i __A, __mmask8 __U, __m128i __I,3558 _mm_mask_permutex2var_epi32(__m128i __A, __mmask8 __U, __m128i __I,
3758 __m128i __B) {3559 __m128i __B) {
3759 return (__m128i)__builtin_ia32_selectd_128(__U,3560 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -3761,7 +3562,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3761,7 +3562,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3761 (__v4si)__A);3562 (__v4si)__A);
3762 }3563 }
37633564
3764 static __inline__ __m128i __DEFAULT_FN_ATTRS1283565 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3765 _mm_mask2_permutex2var_epi32(__m128i __A, __m128i __I, __mmask8 __U,3566 _mm_mask2_permutex2var_epi32(__m128i __A, __m128i __I, __mmask8 __U,
3766 __m128i __B) {3567 __m128i __B) {
3767 return (__m128i)__builtin_ia32_selectd_128(__U,3568 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -3769,7 +3570,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3769,7 +3570,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3769 (__v4si)__I);3570 (__v4si)__I);
3770 }3571 }
37713572
3772 static __inline__ __m128i __DEFAULT_FN_ATTRS1283573 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3773 _mm_maskz_permutex2var_epi32(__mmask8 __U, __m128i __A, __m128i __I,3574 _mm_maskz_permutex2var_epi32(__mmask8 __U, __m128i __A, __m128i __I,
3774 __m128i __B) {3575 __m128i __B) {
3775 return (__m128i)__builtin_ia32_selectd_128(__U,3576 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -3777,13 +3578,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3777,13 +3578,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3777 (__v4si)_mm_setzero_si128());3578 (__v4si)_mm_setzero_si128());
3778 }3579 }
37793580
3780 static __inline__ __m256i __DEFAULT_FN_ATTRS2563581 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3781 _mm256_permutex2var_epi32(__m256i __A, __m256i __I, __m256i __B) {3582 _mm256_permutex2var_epi32(__m256i __A, __m256i __I, __m256i __B) {
3782 return (__m256i)__builtin_ia32_vpermi2vard256((__v8si)__A, (__v8si) __I,3583 return (__m256i)__builtin_ia32_vpermi2vard256((__v8si)__A, (__v8si) __I,
3783 (__v8si) __B);3584 (__v8si) __B);
3784 }3585 }
37853586
3786 static __inline__ __m256i __DEFAULT_FN_ATTRS2563587 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3787 _mm256_mask_permutex2var_epi32(__m256i __A, __mmask8 __U, __m256i __I,3588 _mm256_mask_permutex2var_epi32(__m256i __A, __mmask8 __U, __m256i __I,
3788 __m256i __B) {3589 __m256i __B) {
3789 return (__m256i)__builtin_ia32_selectd_256(__U,3590 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -3791,7 +3592,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3791,7 +3592,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3791 (__v8si)__A);3592 (__v8si)__A);
3792 }3593 }
37933594
3794 static __inline__ __m256i __DEFAULT_FN_ATTRS2563595 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3795 _mm256_mask2_permutex2var_epi32(__m256i __A, __m256i __I, __mmask8 __U,3596 _mm256_mask2_permutex2var_epi32(__m256i __A, __m256i __I, __mmask8 __U,
3796 __m256i __B) {3597 __m256i __B) {
3797 return (__m256i)__builtin_ia32_selectd_256(__U,3598 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -3799,7 +3600,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3799,7 +3600,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3799 (__v8si)__I);3600 (__v8si)__I);
3800 }3601 }
38013602
3802 static __inline__ __m256i __DEFAULT_FN_ATTRS2563603 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3803 _mm256_maskz_permutex2var_epi32(__mmask8 __U, __m256i __A, __m256i __I,3604 _mm256_maskz_permutex2var_epi32(__mmask8 __U, __m256i __A, __m256i __I,
3804 __m256i __B) {3605 __m256i __B) {
3805 return (__m256i)__builtin_ia32_selectd_256(__U,3606 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -3807,40 +3608,43 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3807,40 +3608,43 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3807 (__v8si)_mm256_setzero_si256());3608 (__v8si)_mm256_setzero_si256());
3808 }3609 }
38093610
3810 static __inline__ __m128d __DEFAULT_FN_ATTRS1283611 static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3811 _mm_permutex2var_pd(__m128d __A, __m128i __I, __m128d __B) {3612 _mm_permutex2var_pd(__m128d __A, __m128i __I, __m128d __B) {
3812 return (__m128d)__builtin_ia32_vpermi2varpd128((__v2df)__A, (__v2di)__I,3613 return (__m128d)__builtin_ia32_vpermi2varpd128((__v2df)__A, (__v2di)__I,
3813 (__v2df)__B);3614 (__v2df)__B);
3814 }3615 }
38153616
3816 static __inline__ __m128d __DEFAULT_FN_ATTRS1283617 static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3817 _mm_mask_permutex2var_pd(__m128d __A, __mmask8 __U, __m128i __I, __m128d __B) {3618 _mm_mask_permutex2var_pd(__m128d __A, __mmask8 __U, __m128i __I,
3619 __m128d __B) {
3818 return (__m128d)__builtin_ia32_selectpd_128(__U,3620 return (__m128d)__builtin_ia32_selectpd_128(__U,
3819 (__v2df)_mm_permutex2var_pd(__A, __I, __B),3621 (__v2df)_mm_permutex2var_pd(__A, __I, __B),
3820 (__v2df)__A);3622 (__v2df)__A);
3821 }3623 }
38223624
3823 static __inline__ __m128d __DEFAULT_FN_ATTRS1283625 static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3824 _mm_mask2_permutex2var_pd(__m128d __A, __m128i __I, __mmask8 __U, __m128d __B) {3626 _mm_mask2_permutex2var_pd(__m128d __A, __m128i __I, __mmask8 __U,
3627 __m128d __B) {
3825 return (__m128d)__builtin_ia32_selectpd_128(__U,3628 return (__m128d)__builtin_ia32_selectpd_128(__U,
3826 (__v2df)_mm_permutex2var_pd(__A, __I, __B),3629 (__v2df)_mm_permutex2var_pd(__A, __I, __B),
3827 (__v2df)(__m128d)__I);3630 (__v2df)(__m128d)__I);
3828 }3631 }
38293632
3830 static __inline__ __m128d __DEFAULT_FN_ATTRS1283633 static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
3831 _mm_maskz_permutex2var_pd(__mmask8 __U, __m128d __A, __m128i __I, __m128d __B) {3634 _mm_maskz_permutex2var_pd(__mmask8 __U, __m128d __A, __m128i __I,
3635 __m128d __B) {
3832 return (__m128d)__builtin_ia32_selectpd_128(__U,3636 return (__m128d)__builtin_ia32_selectpd_128(__U,
3833 (__v2df)_mm_permutex2var_pd(__A, __I, __B),3637 (__v2df)_mm_permutex2var_pd(__A, __I, __B),
3834 (__v2df)_mm_setzero_pd());3638 (__v2df)_mm_setzero_pd());
3835 }3639 }
38363640
3837 static __inline__ __m256d __DEFAULT_FN_ATTRS2563641 static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3838 _mm256_permutex2var_pd(__m256d __A, __m256i __I, __m256d __B) {3642 _mm256_permutex2var_pd(__m256d __A, __m256i __I, __m256d __B) {
3839 return (__m256d)__builtin_ia32_vpermi2varpd256((__v4df)__A, (__v4di)__I,3643 return (__m256d)__builtin_ia32_vpermi2varpd256((__v4df)__A, (__v4di)__I,
3840 (__v4df)__B);3644 (__v4df)__B);
3841 }3645 }
38423646
3843 static __inline__ __m256d __DEFAULT_FN_ATTRS2563647 static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3844 _mm256_mask_permutex2var_pd(__m256d __A, __mmask8 __U, __m256i __I,3648 _mm256_mask_permutex2var_pd(__m256d __A, __mmask8 __U, __m256i __I,
3845 __m256d __B) {3649 __m256d __B) {
3846 return (__m256d)__builtin_ia32_selectpd_256(__U,3650 return (__m256d)__builtin_ia32_selectpd_256(__U,
...@@ -3848,7 +3652,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3848,7 +3652,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3848 (__v4df)__A);3652 (__v4df)__A);
3849 }3653 }
38503654
3851 static __inline__ __m256d __DEFAULT_FN_ATTRS2563655 static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3852 _mm256_mask2_permutex2var_pd(__m256d __A, __m256i __I, __mmask8 __U,3656 _mm256_mask2_permutex2var_pd(__m256d __A, __m256i __I, __mmask8 __U,
3853 __m256d __B) {3657 __m256d __B) {
3854 return (__m256d)__builtin_ia32_selectpd_256(__U,3658 return (__m256d)__builtin_ia32_selectpd_256(__U,
...@@ -3856,7 +3660,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3856,7 +3660,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3856 (__v4df)(__m256d)__I);3660 (__v4df)(__m256d)__I);
3857 }3661 }
38583662
3859 static __inline__ __m256d __DEFAULT_FN_ATTRS2563663 static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
3860 _mm256_maskz_permutex2var_pd(__mmask8 __U, __m256d __A, __m256i __I,3664 _mm256_maskz_permutex2var_pd(__mmask8 __U, __m256d __A, __m256i __I,
3861 __m256d __B) {3665 __m256d __B) {
3862 return (__m256d)__builtin_ia32_selectpd_256(__U,3666 return (__m256d)__builtin_ia32_selectpd_256(__U,
...@@ -3864,47 +3668,48 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3864,47 +3668,48 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3864 (__v4df)_mm256_setzero_pd());3668 (__v4df)_mm256_setzero_pd());
3865 }3669 }
38663670
3867 static __inline__ __m128 __DEFAULT_FN_ATTRS1283671 static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3868 _mm_permutex2var_ps(__m128 __A, __m128i __I, __m128 __B) {3672 _mm_permutex2var_ps(__m128 __A, __m128i __I, __m128 __B) {
3869 return (__m128)__builtin_ia32_vpermi2varps128((__v4sf)__A, (__v4si)__I,3673 return (__m128)__builtin_ia32_vpermi2varps128((__v4sf)__A, (__v4si)__I,
3870 (__v4sf)__B);3674 (__v4sf)__B);
3871 }3675 }
38723676
3873 static __inline__ __m128 __DEFAULT_FN_ATTRS1283677 static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3874 _mm_mask_permutex2var_ps(__m128 __A, __mmask8 __U, __m128i __I, __m128 __B) {3678 _mm_mask_permutex2var_ps(__m128 __A, __mmask8 __U, __m128i __I, __m128 __B) {
3875 return (__m128)__builtin_ia32_selectps_128(__U,3679 return (__m128)__builtin_ia32_selectps_128(__U,
3876 (__v4sf)_mm_permutex2var_ps(__A, __I, __B),3680 (__v4sf)_mm_permutex2var_ps(__A, __I, __B),
3877 (__v4sf)__A);3681 (__v4sf)__A);
3878 }3682 }
38793683
3880 static __inline__ __m128 __DEFAULT_FN_ATTRS1283684 static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3881 _mm_mask2_permutex2var_ps(__m128 __A, __m128i __I, __mmask8 __U, __m128 __B) {3685 _mm_mask2_permutex2var_ps(__m128 __A, __m128i __I, __mmask8 __U, __m128 __B) {
3882 return (__m128)__builtin_ia32_selectps_128(__U,3686 return (__m128)__builtin_ia32_selectps_128(__U,
3883 (__v4sf)_mm_permutex2var_ps(__A, __I, __B),3687 (__v4sf)_mm_permutex2var_ps(__A, __I, __B),
3884 (__v4sf)(__m128)__I);3688 (__v4sf)(__m128)__I);
3885 }3689 }
38863690
3887 static __inline__ __m128 __DEFAULT_FN_ATTRS1283691 static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
3888 _mm_maskz_permutex2var_ps(__mmask8 __U, __m128 __A, __m128i __I, __m128 __B) {3692 _mm_maskz_permutex2var_ps(__mmask8 __U, __m128 __A, __m128i __I, __m128 __B) {
3889 return (__m128)__builtin_ia32_selectps_128(__U,3693 return (__m128)__builtin_ia32_selectps_128(__U,
3890 (__v4sf)_mm_permutex2var_ps(__A, __I, __B),3694 (__v4sf)_mm_permutex2var_ps(__A, __I, __B),
3891 (__v4sf)_mm_setzero_ps());3695 (__v4sf)_mm_setzero_ps());
3892 }3696 }
38933697
3894 static __inline__ __m256 __DEFAULT_FN_ATTRS2563698 static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3895 _mm256_permutex2var_ps(__m256 __A, __m256i __I, __m256 __B) {3699 _mm256_permutex2var_ps(__m256 __A, __m256i __I, __m256 __B) {
3896 return (__m256)__builtin_ia32_vpermi2varps256((__v8sf)__A, (__v8si)__I,3700 return (__m256)__builtin_ia32_vpermi2varps256((__v8sf)__A, (__v8si)__I,
3897 (__v8sf) __B);3701 (__v8sf) __B);
3898 }3702 }
38993703
3900 static __inline__ __m256 __DEFAULT_FN_ATTRS2563704 static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3901 _mm256_mask_permutex2var_ps(__m256 __A, __mmask8 __U, __m256i __I, __m256 __B) {3705 _mm256_mask_permutex2var_ps(__m256 __A, __mmask8 __U, __m256i __I,
3706 __m256 __B) {
3902 return (__m256)__builtin_ia32_selectps_256(__U,3707 return (__m256)__builtin_ia32_selectps_256(__U,
3903 (__v8sf)_mm256_permutex2var_ps(__A, __I, __B),3708 (__v8sf)_mm256_permutex2var_ps(__A, __I, __B),
3904 (__v8sf)__A);3709 (__v8sf)__A);
3905 }3710 }
39063711
3907 static __inline__ __m256 __DEFAULT_FN_ATTRS2563712 static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3908 _mm256_mask2_permutex2var_ps(__m256 __A, __m256i __I, __mmask8 __U,3713 _mm256_mask2_permutex2var_ps(__m256 __A, __m256i __I, __mmask8 __U,
3909 __m256 __B) {3714 __m256 __B) {
3910 return (__m256)__builtin_ia32_selectps_256(__U,3715 return (__m256)__builtin_ia32_selectps_256(__U,
...@@ -3912,7 +3717,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3912,7 +3717,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3912 (__v8sf)(__m256)__I);3717 (__v8sf)(__m256)__I);
3913 }3718 }
39143719
3915 static __inline__ __m256 __DEFAULT_FN_ATTRS2563720 static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
3916 _mm256_maskz_permutex2var_ps(__mmask8 __U, __m256 __A, __m256i __I,3721 _mm256_maskz_permutex2var_ps(__mmask8 __U, __m256 __A, __m256i __I,
3917 __m256 __B) {3722 __m256 __B) {
3918 return (__m256)__builtin_ia32_selectps_256(__U,3723 return (__m256)__builtin_ia32_selectps_256(__U,
...@@ -3920,13 +3725,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3920,13 +3725,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3920 (__v8sf)_mm256_setzero_ps());3725 (__v8sf)_mm256_setzero_ps());
3921 }3726 }
39223727
3923 static __inline__ __m128i __DEFAULT_FN_ATTRS1283728 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3924 _mm_permutex2var_epi64(__m128i __A, __m128i __I, __m128i __B) {3729 _mm_permutex2var_epi64(__m128i __A, __m128i __I, __m128i __B) {
3925 return (__m128i)__builtin_ia32_vpermi2varq128((__v2di)__A, (__v2di)__I,3730 return (__m128i)__builtin_ia32_vpermi2varq128((__v2di)__A, (__v2di)__I,
3926 (__v2di)__B);3731 (__v2di)__B);
3927 }3732 }
39283733
3929 static __inline__ __m128i __DEFAULT_FN_ATTRS1283734 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3930 _mm_mask_permutex2var_epi64(__m128i __A, __mmask8 __U, __m128i __I,3735 _mm_mask_permutex2var_epi64(__m128i __A, __mmask8 __U, __m128i __I,
3931 __m128i __B) {3736 __m128i __B) {
3932 return (__m128i)__builtin_ia32_selectq_128(__U,3737 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -3934,7 +3739,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3934,7 +3739,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3934 (__v2di)__A);3739 (__v2di)__A);
3935 }3740 }
39363741
3937 static __inline__ __m128i __DEFAULT_FN_ATTRS1283742 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3938 _mm_mask2_permutex2var_epi64(__m128i __A, __m128i __I, __mmask8 __U,3743 _mm_mask2_permutex2var_epi64(__m128i __A, __m128i __I, __mmask8 __U,
3939 __m128i __B) {3744 __m128i __B) {
3940 return (__m128i)__builtin_ia32_selectq_128(__U,3745 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -3942,7 +3747,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3942,7 +3747,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3942 (__v2di)__I);3747 (__v2di)__I);
3943 }3748 }
39443749
3945 static __inline__ __m128i __DEFAULT_FN_ATTRS1283750 static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
3946 _mm_maskz_permutex2var_epi64(__mmask8 __U, __m128i __A, __m128i __I,3751 _mm_maskz_permutex2var_epi64(__mmask8 __U, __m128i __A, __m128i __I,
3947 __m128i __B) {3752 __m128i __B) {
3948 return (__m128i)__builtin_ia32_selectq_128(__U,3753 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -3950,14 +3755,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3950,14 +3755,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3950 (__v2di)_mm_setzero_si128());3755 (__v2di)_mm_setzero_si128());
3951 }3756 }
39523757
39533758 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3954 static __inline__ __m256i __DEFAULT_FN_ATTRS256
3955 _mm256_permutex2var_epi64(__m256i __A, __m256i __I, __m256i __B) {3759 _mm256_permutex2var_epi64(__m256i __A, __m256i __I, __m256i __B) {
3956 return (__m256i)__builtin_ia32_vpermi2varq256((__v4di)__A, (__v4di) __I,3760 return (__m256i)__builtin_ia32_vpermi2varq256((__v4di)__A, (__v4di) __I,
3957 (__v4di) __B);3761 (__v4di) __B);
3958 }3762 }
39593763
3960 static __inline__ __m256i __DEFAULT_FN_ATTRS2563764 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3961 _mm256_mask_permutex2var_epi64(__m256i __A, __mmask8 __U, __m256i __I,3765 _mm256_mask_permutex2var_epi64(__m256i __A, __mmask8 __U, __m256i __I,
3962 __m256i __B) {3766 __m256i __B) {
3963 return (__m256i)__builtin_ia32_selectq_256(__U,3767 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -3965,7 +3769,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3965,7 +3769,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3965 (__v4di)__A);3769 (__v4di)__A);
3966 }3770 }
39673771
3968 static __inline__ __m256i __DEFAULT_FN_ATTRS2563772 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3969 _mm256_mask2_permutex2var_epi64(__m256i __A, __m256i __I, __mmask8 __U,3773 _mm256_mask2_permutex2var_epi64(__m256i __A, __m256i __I, __mmask8 __U,
3970 __m256i __B) {3774 __m256i __B) {
3971 return (__m256i)__builtin_ia32_selectq_256(__U,3775 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -3973,7 +3777,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -3973,7 +3777,7 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
3973 (__v4di)__I);3777 (__v4di)__I);
3974 }3778 }
39753779
3976 static __inline__ __m256i __DEFAULT_FN_ATTRS2563780 static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
3977 _mm256_maskz_permutex2var_epi64(__mmask8 __U, __m256i __A, __m256i __I,3781 _mm256_maskz_permutex2var_epi64(__mmask8 __U, __m256i __A, __m256i __I,
3978 __m256i __B) {3782 __m256i __B) {
3979 return (__m256i)__builtin_ia32_selectq_256(__U,3783 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -4355,13 +4159,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {...@@ -4355,13 +4159,13 @@ _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) {
4355 (__v4di)_mm256_rol_epi64((a), (b)), \4159 (__v4di)_mm256_rol_epi64((a), (b)), \
4356 (__v4di)_mm256_setzero_si256()))4160 (__v4di)_mm256_setzero_si256()))
43574161
4358static __inline__ __m128i __DEFAULT_FN_ATTRS1284162static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4359_mm_rolv_epi32 (__m128i __A, __m128i __B)4163_mm_rolv_epi32 (__m128i __A, __m128i __B)
4360{4164{
4361 return (__m128i)__builtin_ia32_prolvd128((__v4si)__A, (__v4si)__B);4165 return (__m128i)__builtin_elementwise_fshl((__v4su)__A, (__v4su)__A, (__v4su)__B);
4362}4166}
43634167
4364static __inline__ __m128i __DEFAULT_FN_ATTRS1284168static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4365_mm_mask_rolv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4169_mm_mask_rolv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4366{4170{
4367 return (__m128i)__builtin_ia32_selectd_128(__U,4171 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -4369,7 +4173,7 @@ _mm_mask_rolv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -4369,7 +4173,7 @@ _mm_mask_rolv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4369 (__v4si)__W);4173 (__v4si)__W);
4370}4174}
43714175
4372static __inline__ __m128i __DEFAULT_FN_ATTRS1284176static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4373_mm_maskz_rolv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)4177_mm_maskz_rolv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)
4374{4178{
4375 return (__m128i)__builtin_ia32_selectd_128(__U,4179 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -4377,13 +4181,13 @@ _mm_maskz_rolv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)...@@ -4377,13 +4181,13 @@ _mm_maskz_rolv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)
4377 (__v4si)_mm_setzero_si128());4181 (__v4si)_mm_setzero_si128());
4378}4182}
43794183
4380static __inline__ __m256i __DEFAULT_FN_ATTRS2564184static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4381_mm256_rolv_epi32 (__m256i __A, __m256i __B)4185_mm256_rolv_epi32 (__m256i __A, __m256i __B)
4382{4186{
4383 return (__m256i)__builtin_ia32_prolvd256((__v8si)__A, (__v8si)__B);4187 return (__m256i)__builtin_elementwise_fshl((__v8su)__A, (__v8su)__A, (__v8su)__B);
4384}4188}
43854189
4386static __inline__ __m256i __DEFAULT_FN_ATTRS2564190static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4387_mm256_mask_rolv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)4191_mm256_mask_rolv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4388{4192{
4389 return (__m256i)__builtin_ia32_selectd_256(__U,4193 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -4391,7 +4195,7 @@ _mm256_mask_rolv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)...@@ -4391,7 +4195,7 @@ _mm256_mask_rolv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4391 (__v8si)__W);4195 (__v8si)__W);
4392}4196}
43934197
4394static __inline__ __m256i __DEFAULT_FN_ATTRS2564198static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4395_mm256_maskz_rolv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)4199_mm256_maskz_rolv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)
4396{4200{
4397 return (__m256i)__builtin_ia32_selectd_256(__U,4201 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -4399,13 +4203,13 @@ _mm256_maskz_rolv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)...@@ -4399,13 +4203,13 @@ _mm256_maskz_rolv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)
4399 (__v8si)_mm256_setzero_si256());4203 (__v8si)_mm256_setzero_si256());
4400}4204}
44014205
4402static __inline__ __m128i __DEFAULT_FN_ATTRS1284206static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4403_mm_rolv_epi64 (__m128i __A, __m128i __B)4207_mm_rolv_epi64 (__m128i __A, __m128i __B)
4404{4208{
4405 return (__m128i)__builtin_ia32_prolvq128((__v2di)__A, (__v2di)__B);4209 return (__m128i)__builtin_elementwise_fshl((__v2du)__A, (__v2du)__A, (__v2du)__B);
4406}4210}
44074211
4408static __inline__ __m128i __DEFAULT_FN_ATTRS1284212static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4409_mm_mask_rolv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4213_mm_mask_rolv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4410{4214{
4411 return (__m128i)__builtin_ia32_selectq_128(__U,4215 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -4413,7 +4217,7 @@ _mm_mask_rolv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -4413,7 +4217,7 @@ _mm_mask_rolv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4413 (__v2di)__W);4217 (__v2di)__W);
4414}4218}
44154219
4416static __inline__ __m128i __DEFAULT_FN_ATTRS1284220static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4417_mm_maskz_rolv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)4221_mm_maskz_rolv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)
4418{4222{
4419 return (__m128i)__builtin_ia32_selectq_128(__U,4223 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -4421,13 +4225,13 @@ _mm_maskz_rolv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)...@@ -4421,13 +4225,13 @@ _mm_maskz_rolv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)
4421 (__v2di)_mm_setzero_si128());4225 (__v2di)_mm_setzero_si128());
4422}4226}
44234227
4424static __inline__ __m256i __DEFAULT_FN_ATTRS2564228static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4425_mm256_rolv_epi64 (__m256i __A, __m256i __B)4229_mm256_rolv_epi64 (__m256i __A, __m256i __B)
4426{4230{
4427 return (__m256i)__builtin_ia32_prolvq256((__v4di)__A, (__v4di)__B);4231 return (__m256i)__builtin_elementwise_fshl((__v4du)__A, (__v4du)__A, (__v4du)__B);
4428}4232}
44294233
4430static __inline__ __m256i __DEFAULT_FN_ATTRS2564234static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4431_mm256_mask_rolv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)4235_mm256_mask_rolv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4432{4236{
4433 return (__m256i)__builtin_ia32_selectq_256(__U,4237 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -4435,7 +4239,7 @@ _mm256_mask_rolv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)...@@ -4435,7 +4239,7 @@ _mm256_mask_rolv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4435 (__v4di)__W);4239 (__v4di)__W);
4436}4240}
44374241
4438static __inline__ __m256i __DEFAULT_FN_ATTRS2564242static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4439_mm256_maskz_rolv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)4243_mm256_maskz_rolv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)
4440{4244{
4441 return (__m256i)__builtin_ia32_selectq_256(__U,4245 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -4495,33 +4299,29 @@ _mm256_maskz_rolv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)...@@ -4495,33 +4299,29 @@ _mm256_maskz_rolv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)
4495 (__v4di)_mm256_ror_epi64((a), (b)), \4299 (__v4di)_mm256_ror_epi64((a), (b)), \
4496 (__v4di)_mm256_setzero_si256()))4300 (__v4di)_mm256_setzero_si256()))
44974301
4498static __inline__ __m128i __DEFAULT_FN_ATTRS1284302static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4499_mm_mask_sll_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4303_mm_mask_sll_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
4500{
4501 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4304 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
4502 (__v4si)_mm_sll_epi32(__A, __B),4305 (__v4si)_mm_sll_epi32(__A, __B),
4503 (__v4si)__W);4306 (__v4si)__W);
4504}4307}
45054308
4506static __inline__ __m128i __DEFAULT_FN_ATTRS1284309static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4507_mm_maskz_sll_epi32(__mmask8 __U, __m128i __A, __m128i __B)4310_mm_maskz_sll_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
4508{
4509 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4311 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
4510 (__v4si)_mm_sll_epi32(__A, __B),4312 (__v4si)_mm_sll_epi32(__A, __B),
4511 (__v4si)_mm_setzero_si128());4313 (__v4si)_mm_setzero_si128());
4512}4314}
45134315
4514static __inline__ __m256i __DEFAULT_FN_ATTRS2564316static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4515_mm256_mask_sll_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B)4317_mm256_mask_sll_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) {
4516{
4517 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4318 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4518 (__v8si)_mm256_sll_epi32(__A, __B),4319 (__v8si)_mm256_sll_epi32(__A, __B),
4519 (__v8si)__W);4320 (__v8si)__W);
4520}4321}
45214322
4522static __inline__ __m256i __DEFAULT_FN_ATTRS2564323static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4523_mm256_maskz_sll_epi32(__mmask8 __U, __m256i __A, __m128i __B)4324_mm256_maskz_sll_epi32(__mmask8 __U, __m256i __A, __m128i __B) {
4524{
4525 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4325 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4526 (__v8si)_mm256_sll_epi32(__A, __B),4326 (__v8si)_mm256_sll_epi32(__A, __B),
4527 (__v8si)_mm256_setzero_si256());4327 (__v8si)_mm256_setzero_si256());
...@@ -4543,49 +4343,44 @@ _mm_maskz_slli_epi32(__mmask8 __U, __m128i __A, unsigned int __B)...@@ -4543,49 +4343,44 @@ _mm_maskz_slli_epi32(__mmask8 __U, __m128i __A, unsigned int __B)
4543 (__v4si)_mm_setzero_si128());4343 (__v4si)_mm_setzero_si128());
4544}4344}
45454345
4546static __inline__ __m256i __DEFAULT_FN_ATTRS2564346static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4547_mm256_mask_slli_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B)4347_mm256_mask_slli_epi32(__m256i __W, __mmask8 __U, __m256i __A,
4548{4348 unsigned int __B) {
4549 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4349 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4550 (__v8si)_mm256_slli_epi32(__A, (int)__B),4350 (__v8si)_mm256_slli_epi32(__A, (int)__B),
4551 (__v8si)__W);4351 (__v8si)__W);
4552}4352}
45534353
4554static __inline__ __m256i __DEFAULT_FN_ATTRS2564354static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4555_mm256_maskz_slli_epi32(__mmask8 __U, __m256i __A, unsigned int __B)4355_mm256_maskz_slli_epi32(__mmask8 __U, __m256i __A, unsigned int __B) {
4556{
4557 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4356 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4558 (__v8si)_mm256_slli_epi32(__A, (int)__B),4357 (__v8si)_mm256_slli_epi32(__A, (int)__B),
4559 (__v8si)_mm256_setzero_si256());4358 (__v8si)_mm256_setzero_si256());
4560}4359}
45614360
4562static __inline__ __m128i __DEFAULT_FN_ATTRS1284361static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4563_mm_mask_sll_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4362_mm_mask_sll_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
4564{
4565 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4363 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
4566 (__v2di)_mm_sll_epi64(__A, __B),4364 (__v2di)_mm_sll_epi64(__A, __B),
4567 (__v2di)__W);4365 (__v2di)__W);
4568}4366}
45694367
4570static __inline__ __m128i __DEFAULT_FN_ATTRS1284368static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4571_mm_maskz_sll_epi64(__mmask8 __U, __m128i __A, __m128i __B)4369_mm_maskz_sll_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
4572{
4573 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4370 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
4574 (__v2di)_mm_sll_epi64(__A, __B),4371 (__v2di)_mm_sll_epi64(__A, __B),
4575 (__v2di)_mm_setzero_si128());4372 (__v2di)_mm_setzero_si128());
4576}4373}
45774374
4578static __inline__ __m256i __DEFAULT_FN_ATTRS2564375static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4579_mm256_mask_sll_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B)4376_mm256_mask_sll_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) {
4580{
4581 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4377 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4582 (__v4di)_mm256_sll_epi64(__A, __B),4378 (__v4di)_mm256_sll_epi64(__A, __B),
4583 (__v4di)__W);4379 (__v4di)__W);
4584}4380}
45854381
4586static __inline__ __m256i __DEFAULT_FN_ATTRS2564382static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4587_mm256_maskz_sll_epi64(__mmask8 __U, __m256i __A, __m128i __B)4383_mm256_maskz_sll_epi64(__mmask8 __U, __m256i __A, __m128i __B) {
4588{
4589 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4384 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4590 (__v4di)_mm256_sll_epi64(__A, __B),4385 (__v4di)_mm256_sll_epi64(__A, __B),
4591 (__v4di)_mm256_setzero_si256());4386 (__v4di)_mm256_setzero_si256());
...@@ -4607,29 +4402,28 @@ _mm_maskz_slli_epi64(__mmask8 __U, __m128i __A, unsigned int __B)...@@ -4607,29 +4402,28 @@ _mm_maskz_slli_epi64(__mmask8 __U, __m128i __A, unsigned int __B)
4607 (__v2di)_mm_setzero_si128());4402 (__v2di)_mm_setzero_si128());
4608}4403}
46094404
4610static __inline__ __m256i __DEFAULT_FN_ATTRS2564405static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4611_mm256_mask_slli_epi64(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B)4406_mm256_mask_slli_epi64(__m256i __W, __mmask8 __U, __m256i __A,
4612{4407 unsigned int __B) {
4613 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4408 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4614 (__v4di)_mm256_slli_epi64(__A, (int)__B),4409 (__v4di)_mm256_slli_epi64(__A, (int)__B),
4615 (__v4di)__W);4410 (__v4di)__W);
4616}4411}
46174412
4618static __inline__ __m256i __DEFAULT_FN_ATTRS2564413static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4619_mm256_maskz_slli_epi64(__mmask8 __U, __m256i __A, unsigned int __B)4414_mm256_maskz_slli_epi64(__mmask8 __U, __m256i __A, unsigned int __B) {
4620{
4621 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4415 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4622 (__v4di)_mm256_slli_epi64(__A, (int)__B),4416 (__v4di)_mm256_slli_epi64(__A, (int)__B),
4623 (__v4di)_mm256_setzero_si256());4417 (__v4di)_mm256_setzero_si256());
4624}4418}
46254419
4626static __inline__ __m128i __DEFAULT_FN_ATTRS1284420static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4627_mm_rorv_epi32 (__m128i __A, __m128i __B)4421_mm_rorv_epi32 (__m128i __A, __m128i __B)
4628{4422{
4629 return (__m128i)__builtin_ia32_prorvd128((__v4si)__A, (__v4si)__B);4423 return (__m128i)__builtin_elementwise_fshr((__v4su)__A, (__v4su)__A, (__v4su)__B);
4630}4424}
46314425
4632static __inline__ __m128i __DEFAULT_FN_ATTRS1284426static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4633_mm_mask_rorv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4427_mm_mask_rorv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4634{4428{
4635 return (__m128i)__builtin_ia32_selectd_128(__U,4429 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -4637,7 +4431,7 @@ _mm_mask_rorv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -4637,7 +4431,7 @@ _mm_mask_rorv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4637 (__v4si)__W);4431 (__v4si)__W);
4638}4432}
46394433
4640static __inline__ __m128i __DEFAULT_FN_ATTRS1284434static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4641_mm_maskz_rorv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)4435_mm_maskz_rorv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)
4642{4436{
4643 return (__m128i)__builtin_ia32_selectd_128(__U,4437 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -4645,13 +4439,13 @@ _mm_maskz_rorv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)...@@ -4645,13 +4439,13 @@ _mm_maskz_rorv_epi32 (__mmask8 __U, __m128i __A, __m128i __B)
4645 (__v4si)_mm_setzero_si128());4439 (__v4si)_mm_setzero_si128());
4646}4440}
46474441
4648static __inline__ __m256i __DEFAULT_FN_ATTRS2564442static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4649_mm256_rorv_epi32 (__m256i __A, __m256i __B)4443_mm256_rorv_epi32 (__m256i __A, __m256i __B)
4650{4444{
4651 return (__m256i)__builtin_ia32_prorvd256((__v8si)__A, (__v8si)__B);4445 return (__m256i)__builtin_elementwise_fshr((__v8su)__A, (__v8su)__A, (__v8su)__B);
4652}4446}
46534447
4654static __inline__ __m256i __DEFAULT_FN_ATTRS2564448static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4655_mm256_mask_rorv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)4449_mm256_mask_rorv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4656{4450{
4657 return (__m256i)__builtin_ia32_selectd_256(__U,4451 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -4659,7 +4453,7 @@ _mm256_mask_rorv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)...@@ -4659,7 +4453,7 @@ _mm256_mask_rorv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4659 (__v8si)__W);4453 (__v8si)__W);
4660}4454}
46614455
4662static __inline__ __m256i __DEFAULT_FN_ATTRS2564456static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4663_mm256_maskz_rorv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)4457_mm256_maskz_rorv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)
4664{4458{
4665 return (__m256i)__builtin_ia32_selectd_256(__U,4459 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -4667,13 +4461,13 @@ _mm256_maskz_rorv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)...@@ -4667,13 +4461,13 @@ _mm256_maskz_rorv_epi32 (__mmask8 __U, __m256i __A, __m256i __B)
4667 (__v8si)_mm256_setzero_si256());4461 (__v8si)_mm256_setzero_si256());
4668}4462}
46694463
4670static __inline__ __m128i __DEFAULT_FN_ATTRS1284464static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4671_mm_rorv_epi64 (__m128i __A, __m128i __B)4465_mm_rorv_epi64 (__m128i __A, __m128i __B)
4672{4466{
4673 return (__m128i)__builtin_ia32_prorvq128((__v2di)__A, (__v2di)__B);4467 return (__m128i)__builtin_elementwise_fshr((__v2du)__A, (__v2du)__A, (__v2du)__B);
4674}4468}
46754469
4676static __inline__ __m128i __DEFAULT_FN_ATTRS1284470static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4677_mm_mask_rorv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4471_mm_mask_rorv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4678{4472{
4679 return (__m128i)__builtin_ia32_selectq_128(__U,4473 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -4681,7 +4475,7 @@ _mm_mask_rorv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)...@@ -4681,7 +4475,7 @@ _mm_mask_rorv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)
4681 (__v2di)__W);4475 (__v2di)__W);
4682}4476}
46834477
4684static __inline__ __m128i __DEFAULT_FN_ATTRS1284478static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4685_mm_maskz_rorv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)4479_mm_maskz_rorv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)
4686{4480{
4687 return (__m128i)__builtin_ia32_selectq_128(__U,4481 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -4689,13 +4483,13 @@ _mm_maskz_rorv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)...@@ -4689,13 +4483,13 @@ _mm_maskz_rorv_epi64 (__mmask8 __U, __m128i __A, __m128i __B)
4689 (__v2di)_mm_setzero_si128());4483 (__v2di)_mm_setzero_si128());
4690}4484}
46914485
4692static __inline__ __m256i __DEFAULT_FN_ATTRS2564486static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4693_mm256_rorv_epi64 (__m256i __A, __m256i __B)4487_mm256_rorv_epi64 (__m256i __A, __m256i __B)
4694{4488{
4695 return (__m256i)__builtin_ia32_prorvq256((__v4di)__A, (__v4di)__B);4489 return (__m256i)__builtin_elementwise_fshr((__v4du)__A, (__v4du)__A, (__v4du)__B);
4696}4490}
46974491
4698static __inline__ __m256i __DEFAULT_FN_ATTRS2564492static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4699_mm256_mask_rorv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)4493_mm256_mask_rorv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4700{4494{
4701 return (__m256i)__builtin_ia32_selectq_256(__U,4495 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -4703,7 +4497,7 @@ _mm256_mask_rorv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)...@@ -4703,7 +4497,7 @@ _mm256_mask_rorv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
4703 (__v4di)__W);4497 (__v4di)__W);
4704}4498}
47054499
4706static __inline__ __m256i __DEFAULT_FN_ATTRS2564500static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4707_mm256_maskz_rorv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)4501_mm256_maskz_rorv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)
4708{4502{
4709 return (__m256i)__builtin_ia32_selectq_256(__U,4503 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -4711,7 +4505,7 @@ _mm256_maskz_rorv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)...@@ -4711,7 +4505,7 @@ _mm256_maskz_rorv_epi64 (__mmask8 __U, __m256i __A, __m256i __B)
4711 (__v4di)_mm256_setzero_si256());4505 (__v4di)_mm256_setzero_si256());
4712}4506}
47134507
4714static __inline__ __m128i __DEFAULT_FN_ATTRS1284508static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4715_mm_mask_sllv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)4509_mm_mask_sllv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4716{4510{
4717 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4511 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
...@@ -4719,7 +4513,7 @@ _mm_mask_sllv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)...@@ -4719,7 +4513,7 @@ _mm_mask_sllv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4719 (__v2di)__W);4513 (__v2di)__W);
4720}4514}
47214515
4722static __inline__ __m128i __DEFAULT_FN_ATTRS1284516static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4723_mm_maskz_sllv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)4517_mm_maskz_sllv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)
4724{4518{
4725 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4519 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
...@@ -4727,7 +4521,7 @@ _mm_maskz_sllv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)...@@ -4727,7 +4521,7 @@ _mm_maskz_sllv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)
4727 (__v2di)_mm_setzero_si128());4521 (__v2di)_mm_setzero_si128());
4728}4522}
47294523
4730static __inline__ __m256i __DEFAULT_FN_ATTRS2564524static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4731_mm256_mask_sllv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)4525_mm256_mask_sllv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4732{4526{
4733 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4527 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
...@@ -4735,7 +4529,7 @@ _mm256_mask_sllv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)...@@ -4735,7 +4529,7 @@ _mm256_mask_sllv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4735 (__v4di)__W);4529 (__v4di)__W);
4736}4530}
47374531
4738static __inline__ __m256i __DEFAULT_FN_ATTRS2564532static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4739_mm256_maskz_sllv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)4533_mm256_maskz_sllv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)
4740{4534{
4741 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4535 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
...@@ -4743,7 +4537,7 @@ _mm256_maskz_sllv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)...@@ -4743,7 +4537,7 @@ _mm256_maskz_sllv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)
4743 (__v4di)_mm256_setzero_si256());4537 (__v4di)_mm256_setzero_si256());
4744}4538}
47454539
4746static __inline__ __m128i __DEFAULT_FN_ATTRS1284540static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4747_mm_mask_sllv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)4541_mm_mask_sllv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4748{4542{
4749 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4543 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
...@@ -4751,7 +4545,7 @@ _mm_mask_sllv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)...@@ -4751,7 +4545,7 @@ _mm_mask_sllv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4751 (__v4si)__W);4545 (__v4si)__W);
4752}4546}
47534547
4754static __inline__ __m128i __DEFAULT_FN_ATTRS1284548static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4755_mm_maskz_sllv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)4549_mm_maskz_sllv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)
4756{4550{
4757 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4551 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
...@@ -4759,7 +4553,7 @@ _mm_maskz_sllv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)...@@ -4759,7 +4553,7 @@ _mm_maskz_sllv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)
4759 (__v4si)_mm_setzero_si128());4553 (__v4si)_mm_setzero_si128());
4760}4554}
47614555
4762static __inline__ __m256i __DEFAULT_FN_ATTRS2564556static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4763_mm256_mask_sllv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)4557_mm256_mask_sllv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4764{4558{
4765 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4559 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
...@@ -4767,7 +4561,7 @@ _mm256_mask_sllv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)...@@ -4767,7 +4561,7 @@ _mm256_mask_sllv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4767 (__v8si)__W);4561 (__v8si)__W);
4768}4562}
47694563
4770static __inline__ __m256i __DEFAULT_FN_ATTRS2564564static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4771_mm256_maskz_sllv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)4565_mm256_maskz_sllv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)
4772{4566{
4773 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4567 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
...@@ -4775,7 +4569,7 @@ _mm256_maskz_sllv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)...@@ -4775,7 +4569,7 @@ _mm256_maskz_sllv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)
4775 (__v8si)_mm256_setzero_si256());4569 (__v8si)_mm256_setzero_si256());
4776}4570}
47774571
4778static __inline__ __m128i __DEFAULT_FN_ATTRS1284572static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4779_mm_mask_srlv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)4573_mm_mask_srlv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4780{4574{
4781 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4575 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
...@@ -4783,7 +4577,7 @@ _mm_mask_srlv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)...@@ -4783,7 +4577,7 @@ _mm_mask_srlv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4783 (__v2di)__W);4577 (__v2di)__W);
4784}4578}
47854579
4786static __inline__ __m128i __DEFAULT_FN_ATTRS1284580static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4787_mm_maskz_srlv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)4581_mm_maskz_srlv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)
4788{4582{
4789 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4583 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
...@@ -4791,7 +4585,7 @@ _mm_maskz_srlv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)...@@ -4791,7 +4585,7 @@ _mm_maskz_srlv_epi64(__mmask8 __U, __m128i __X, __m128i __Y)
4791 (__v2di)_mm_setzero_si128());4585 (__v2di)_mm_setzero_si128());
4792}4586}
47934587
4794static __inline__ __m256i __DEFAULT_FN_ATTRS2564588static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4795_mm256_mask_srlv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)4589_mm256_mask_srlv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4796{4590{
4797 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4591 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
...@@ -4799,7 +4593,7 @@ _mm256_mask_srlv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)...@@ -4799,7 +4593,7 @@ _mm256_mask_srlv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4799 (__v4di)__W);4593 (__v4di)__W);
4800}4594}
48014595
4802static __inline__ __m256i __DEFAULT_FN_ATTRS2564596static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4803_mm256_maskz_srlv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)4597_mm256_maskz_srlv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)
4804{4598{
4805 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4599 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
...@@ -4807,7 +4601,7 @@ _mm256_maskz_srlv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)...@@ -4807,7 +4601,7 @@ _mm256_maskz_srlv_epi64(__mmask8 __U, __m256i __X, __m256i __Y)
4807 (__v4di)_mm256_setzero_si256());4601 (__v4di)_mm256_setzero_si256());
4808}4602}
48094603
4810static __inline__ __m128i __DEFAULT_FN_ATTRS1284604static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4811_mm_mask_srlv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)4605_mm_mask_srlv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4812{4606{
4813 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4607 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
...@@ -4815,7 +4609,7 @@ _mm_mask_srlv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)...@@ -4815,7 +4609,7 @@ _mm_mask_srlv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4815 (__v4si)__W);4609 (__v4si)__W);
4816}4610}
48174611
4818static __inline__ __m128i __DEFAULT_FN_ATTRS1284612static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4819_mm_maskz_srlv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)4613_mm_maskz_srlv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)
4820{4614{
4821 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4615 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
...@@ -4823,7 +4617,7 @@ _mm_maskz_srlv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)...@@ -4823,7 +4617,7 @@ _mm_maskz_srlv_epi32(__mmask8 __U, __m128i __X, __m128i __Y)
4823 (__v4si)_mm_setzero_si128());4617 (__v4si)_mm_setzero_si128());
4824}4618}
48254619
4826static __inline__ __m256i __DEFAULT_FN_ATTRS2564620static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4827_mm256_mask_srlv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)4621_mm256_mask_srlv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4828{4622{
4829 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4623 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
...@@ -4831,7 +4625,7 @@ _mm256_mask_srlv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)...@@ -4831,7 +4625,7 @@ _mm256_mask_srlv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4831 (__v8si)__W);4625 (__v8si)__W);
4832}4626}
48334627
4834static __inline__ __m256i __DEFAULT_FN_ATTRS2564628static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4835_mm256_maskz_srlv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)4629_mm256_maskz_srlv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)
4836{4630{
4837 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4631 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
...@@ -4839,33 +4633,29 @@ _mm256_maskz_srlv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)...@@ -4839,33 +4633,29 @@ _mm256_maskz_srlv_epi32(__mmask8 __U, __m256i __X, __m256i __Y)
4839 (__v8si)_mm256_setzero_si256());4633 (__v8si)_mm256_setzero_si256());
4840}4634}
48414635
4842static __inline__ __m128i __DEFAULT_FN_ATTRS1284636static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4843_mm_mask_srl_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4637_mm_mask_srl_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
4844{
4845 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4638 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
4846 (__v4si)_mm_srl_epi32(__A, __B),4639 (__v4si)_mm_srl_epi32(__A, __B),
4847 (__v4si)__W);4640 (__v4si)__W);
4848}4641}
48494642
4850static __inline__ __m128i __DEFAULT_FN_ATTRS1284643static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4851_mm_maskz_srl_epi32(__mmask8 __U, __m128i __A, __m128i __B)4644_mm_maskz_srl_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
4852{
4853 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4645 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
4854 (__v4si)_mm_srl_epi32(__A, __B),4646 (__v4si)_mm_srl_epi32(__A, __B),
4855 (__v4si)_mm_setzero_si128());4647 (__v4si)_mm_setzero_si128());
4856}4648}
48574649
4858static __inline__ __m256i __DEFAULT_FN_ATTRS2564650static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4859_mm256_mask_srl_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B)4651_mm256_mask_srl_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) {
4860{
4861 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4652 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4862 (__v8si)_mm256_srl_epi32(__A, __B),4653 (__v8si)_mm256_srl_epi32(__A, __B),
4863 (__v8si)__W);4654 (__v8si)__W);
4864}4655}
48654656
4866static __inline__ __m256i __DEFAULT_FN_ATTRS2564657static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4867_mm256_maskz_srl_epi32(__mmask8 __U, __m256i __A, __m128i __B)4658_mm256_maskz_srl_epi32(__mmask8 __U, __m256i __A, __m128i __B) {
4868{
4869 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4659 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4870 (__v8si)_mm256_srl_epi32(__A, __B),4660 (__v8si)_mm256_srl_epi32(__A, __B),
4871 (__v8si)_mm256_setzero_si256());4661 (__v8si)_mm256_setzero_si256());
...@@ -4887,49 +4677,44 @@ _mm_maskz_srli_epi32(__mmask8 __U, __m128i __A, unsigned int __B)...@@ -4887,49 +4677,44 @@ _mm_maskz_srli_epi32(__mmask8 __U, __m128i __A, unsigned int __B)
4887 (__v4si)_mm_setzero_si128());4677 (__v4si)_mm_setzero_si128());
4888}4678}
48894679
4890static __inline__ __m256i __DEFAULT_FN_ATTRS2564680static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4891_mm256_mask_srli_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B)4681_mm256_mask_srli_epi32(__m256i __W, __mmask8 __U, __m256i __A,
4892{4682 unsigned int __B) {
4893 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4683 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4894 (__v8si)_mm256_srli_epi32(__A, (int)__B),4684 (__v8si)_mm256_srli_epi32(__A, (int)__B),
4895 (__v8si)__W);4685 (__v8si)__W);
4896}4686}
48974687
4898static __inline__ __m256i __DEFAULT_FN_ATTRS2564688static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4899_mm256_maskz_srli_epi32(__mmask8 __U, __m256i __A, unsigned int __B)4689_mm256_maskz_srli_epi32(__mmask8 __U, __m256i __A, unsigned int __B) {
4900{
4901 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4690 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
4902 (__v8si)_mm256_srli_epi32(__A, (int)__B),4691 (__v8si)_mm256_srli_epi32(__A, (int)__B),
4903 (__v8si)_mm256_setzero_si256());4692 (__v8si)_mm256_setzero_si256());
4904}4693}
49054694
4906static __inline__ __m128i __DEFAULT_FN_ATTRS1284695static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4907_mm_mask_srl_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)4696_mm_mask_srl_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
4908{
4909 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4697 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
4910 (__v2di)_mm_srl_epi64(__A, __B),4698 (__v2di)_mm_srl_epi64(__A, __B),
4911 (__v2di)__W);4699 (__v2di)__W);
4912}4700}
49134701
4914static __inline__ __m128i __DEFAULT_FN_ATTRS1284702static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4915_mm_maskz_srl_epi64(__mmask8 __U, __m128i __A, __m128i __B)4703_mm_maskz_srl_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
4916{
4917 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4704 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
4918 (__v2di)_mm_srl_epi64(__A, __B),4705 (__v2di)_mm_srl_epi64(__A, __B),
4919 (__v2di)_mm_setzero_si128());4706 (__v2di)_mm_setzero_si128());
4920}4707}
49214708
4922static __inline__ __m256i __DEFAULT_FN_ATTRS2564709static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4923_mm256_mask_srl_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B)4710_mm256_mask_srl_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) {
4924{
4925 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4711 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4926 (__v4di)_mm256_srl_epi64(__A, __B),4712 (__v4di)_mm256_srl_epi64(__A, __B),
4927 (__v4di)__W);4713 (__v4di)__W);
4928}4714}
49294715
4930static __inline__ __m256i __DEFAULT_FN_ATTRS2564716static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4931_mm256_maskz_srl_epi64(__mmask8 __U, __m256i __A, __m128i __B)4717_mm256_maskz_srl_epi64(__mmask8 __U, __m256i __A, __m128i __B) {
4932{
4933 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4718 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4934 (__v4di)_mm256_srl_epi64(__A, __B),4719 (__v4di)_mm256_srl_epi64(__A, __B),
4935 (__v4di)_mm256_setzero_si256());4720 (__v4di)_mm256_setzero_si256());
...@@ -4951,23 +4736,22 @@ _mm_maskz_srli_epi64(__mmask8 __U, __m128i __A, unsigned int __B)...@@ -4951,23 +4736,22 @@ _mm_maskz_srli_epi64(__mmask8 __U, __m128i __A, unsigned int __B)
4951 (__v2di)_mm_setzero_si128());4736 (__v2di)_mm_setzero_si128());
4952}4737}
49534738
4954static __inline__ __m256i __DEFAULT_FN_ATTRS2564739static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4955_mm256_mask_srli_epi64(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B)4740_mm256_mask_srli_epi64(__m256i __W, __mmask8 __U, __m256i __A,
4956{4741 unsigned int __B) {
4957 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4742 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4958 (__v4di)_mm256_srli_epi64(__A, (int)__B),4743 (__v4di)_mm256_srli_epi64(__A, (int)__B),
4959 (__v4di)__W);4744 (__v4di)__W);
4960}4745}
49614746
4962static __inline__ __m256i __DEFAULT_FN_ATTRS2564747static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4963_mm256_maskz_srli_epi64(__mmask8 __U, __m256i __A, unsigned int __B)4748_mm256_maskz_srli_epi64(__mmask8 __U, __m256i __A, unsigned int __B) {
4964{
4965 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4749 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
4966 (__v4di)_mm256_srli_epi64(__A, (int)__B),4750 (__v4di)_mm256_srli_epi64(__A, (int)__B),
4967 (__v4di)_mm256_setzero_si256());4751 (__v4di)_mm256_setzero_si256());
4968}4752}
49694753
4970static __inline__ __m128i __DEFAULT_FN_ATTRS1284754static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4971_mm_mask_srav_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)4755_mm_mask_srav_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4972{4756{
4973 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4757 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
...@@ -4975,7 +4759,7 @@ _mm_mask_srav_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)...@@ -4975,7 +4759,7 @@ _mm_mask_srav_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
4975 (__v4si)__W);4759 (__v4si)__W);
4976}4760}
49774761
4978static __inline__ __m128i __DEFAULT_FN_ATTRS1284762static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
4979_mm_maskz_srav_epi32(__mmask8 __U, __m128i __X, __m128i __Y)4763_mm_maskz_srav_epi32(__mmask8 __U, __m128i __X, __m128i __Y)
4980{4764{
4981 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,4765 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
...@@ -4983,7 +4767,7 @@ _mm_maskz_srav_epi32(__mmask8 __U, __m128i __X, __m128i __Y)...@@ -4983,7 +4767,7 @@ _mm_maskz_srav_epi32(__mmask8 __U, __m128i __X, __m128i __Y)
4983 (__v4si)_mm_setzero_si128());4767 (__v4si)_mm_setzero_si128());
4984}4768}
49854769
4986static __inline__ __m256i __DEFAULT_FN_ATTRS2564770static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4987_mm256_mask_srav_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)4771_mm256_mask_srav_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4988{4772{
4989 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4773 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
...@@ -4991,7 +4775,7 @@ _mm256_mask_srav_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)...@@ -4991,7 +4775,7 @@ _mm256_mask_srav_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
4991 (__v8si)__W);4775 (__v8si)__W);
4992}4776}
49934777
4994static __inline__ __m256i __DEFAULT_FN_ATTRS2564778static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
4995_mm256_maskz_srav_epi32(__mmask8 __U, __m256i __X, __m256i __Y)4779_mm256_maskz_srav_epi32(__mmask8 __U, __m256i __X, __m256i __Y)
4996{4780{
4997 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,4781 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
...@@ -4999,13 +4783,13 @@ _mm256_maskz_srav_epi32(__mmask8 __U, __m256i __X, __m256i __Y)...@@ -4999,13 +4783,13 @@ _mm256_maskz_srav_epi32(__mmask8 __U, __m256i __X, __m256i __Y)
4999 (__v8si)_mm256_setzero_si256());4783 (__v8si)_mm256_setzero_si256());
5000}4784}
50014785
5002static __inline__ __m128i __DEFAULT_FN_ATTRS1284786static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5003_mm_srav_epi64(__m128i __X, __m128i __Y)4787_mm_srav_epi64(__m128i __X, __m128i __Y)
5004{4788{
5005 return (__m128i)__builtin_ia32_psravq128((__v2di)__X, (__v2di)__Y);4789 return (__m128i)__builtin_ia32_psravq128((__v2di)__X, (__v2di)__Y);
5006}4790}
50074791
5008static __inline__ __m128i __DEFAULT_FN_ATTRS1284792static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5009_mm_mask_srav_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)4793_mm_mask_srav_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
5010{4794{
5011 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4795 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
...@@ -5013,7 +4797,7 @@ _mm_mask_srav_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)...@@ -5013,7 +4797,7 @@ _mm_mask_srav_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y)
5013 (__v2di)__W);4797 (__v2di)__W);
5014}4798}
50154799
5016static __inline__ __m128i __DEFAULT_FN_ATTRS1284800static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5017_mm_maskz_srav_epi64(__mmask8 __U, __m128i __X, __m128i __Y)4801_mm_maskz_srav_epi64(__mmask8 __U, __m128i __X, __m128i __Y)
5018{4802{
5019 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,4803 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
...@@ -5021,13 +4805,13 @@ _mm_maskz_srav_epi64(__mmask8 __U, __m128i __X, __m128i __Y)...@@ -5021,13 +4805,13 @@ _mm_maskz_srav_epi64(__mmask8 __U, __m128i __X, __m128i __Y)
5021 (__v2di)_mm_setzero_si128());4805 (__v2di)_mm_setzero_si128());
5022}4806}
50234807
5024static __inline__ __m256i __DEFAULT_FN_ATTRS2564808static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5025_mm256_srav_epi64(__m256i __X, __m256i __Y)4809_mm256_srav_epi64(__m256i __X, __m256i __Y)
5026{4810{
5027 return (__m256i)__builtin_ia32_psravq256((__v4di)__X, (__v4di) __Y);4811 return (__m256i)__builtin_ia32_psravq256((__v4di)__X, (__v4di) __Y);
5028}4812}
50294813
5030static __inline__ __m256i __DEFAULT_FN_ATTRS2564814static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5031_mm256_mask_srav_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)4815_mm256_mask_srav_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
5032{4816{
5033 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4817 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
...@@ -5035,7 +4819,7 @@ _mm256_mask_srav_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)...@@ -5035,7 +4819,7 @@ _mm256_mask_srav_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y)
5035 (__v4di)__W);4819 (__v4di)__W);
5036}4820}
50374821
5038static __inline__ __m256i __DEFAULT_FN_ATTRS2564822static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5039_mm256_maskz_srav_epi64 (__mmask8 __U, __m256i __X, __m256i __Y)4823_mm256_maskz_srav_epi64 (__mmask8 __U, __m256i __X, __m256i __Y)
5040{4824{
5041 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,4825 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
...@@ -5296,69 +5080,55 @@ _mm256_maskz_movedup_pd (__mmask8 __U, __m256d __A)...@@ -5296,69 +5080,55 @@ _mm256_maskz_movedup_pd (__mmask8 __U, __m256d __A)
5296 (__v4df)_mm256_setzero_pd());5080 (__v4df)_mm256_setzero_pd());
5297}5081}
52985082
5299static __inline__ __m128i __DEFAULT_FN_ATTRS1285083static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5300_mm_mask_set1_epi32(__m128i __O, __mmask8 __M, int __A)5084_mm_mask_set1_epi32(__m128i __O, __mmask8 __M, int __A) {
5301{5085 return (__m128i)__builtin_ia32_selectd_128(__M, (__v4si)_mm_set1_epi32(__A),
5302 return (__m128i)__builtin_ia32_selectd_128(__M,5086 (__v4si)__O);
5303 (__v4si) _mm_set1_epi32(__A),
5304 (__v4si)__O);
5305}5087}
53065088
5307static __inline__ __m128i __DEFAULT_FN_ATTRS1285089static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5308_mm_maskz_set1_epi32( __mmask8 __M, int __A)5090_mm_maskz_set1_epi32(__mmask8 __M, int __A) {
5309{5091 return (__m128i)__builtin_ia32_selectd_128(__M, (__v4si)_mm_set1_epi32(__A),
5310 return (__m128i)__builtin_ia32_selectd_128(__M,5092 (__v4si)_mm_setzero_si128());
5311 (__v4si) _mm_set1_epi32(__A),
5312 (__v4si)_mm_setzero_si128());
5313}5093}
53145094
5315static __inline__ __m256i __DEFAULT_FN_ATTRS2565095static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5316_mm256_mask_set1_epi32(__m256i __O, __mmask8 __M, int __A)5096_mm256_mask_set1_epi32(__m256i __O, __mmask8 __M, int __A) {
5317{5097 return (__m256i)__builtin_ia32_selectd_256(
5318 return (__m256i)__builtin_ia32_selectd_256(__M,5098 __M, (__v8si)_mm256_set1_epi32(__A), (__v8si)__O);
5319 (__v8si) _mm256_set1_epi32(__A),
5320 (__v8si)__O);
5321}5099}
53225100
5323static __inline__ __m256i __DEFAULT_FN_ATTRS2565101static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5324_mm256_maskz_set1_epi32( __mmask8 __M, int __A)5102_mm256_maskz_set1_epi32(__mmask8 __M, int __A) {
5325{5103 return (__m256i)__builtin_ia32_selectd_256(
5326 return (__m256i)__builtin_ia32_selectd_256(__M,5104 __M, (__v8si)_mm256_set1_epi32(__A), (__v8si)_mm256_setzero_si256());
5327 (__v8si) _mm256_set1_epi32(__A),
5328 (__v8si)_mm256_setzero_si256());
5329}5105}
53305106
53315107static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5332static __inline__ __m128i __DEFAULT_FN_ATTRS1285108_mm_mask_set1_epi64(__m128i __O, __mmask8 __M, long long __A) {
5333_mm_mask_set1_epi64 (__m128i __O, __mmask8 __M, long long __A)
5334{
5335 return (__m128i) __builtin_ia32_selectq_128(__M,5109 return (__m128i) __builtin_ia32_selectq_128(__M,
5336 (__v2di) _mm_set1_epi64x(__A),5110 (__v2di) _mm_set1_epi64x(__A),
5337 (__v2di) __O);5111 (__v2di) __O);
5338}5112}
53395113
5340static __inline__ __m128i __DEFAULT_FN_ATTRS1285114static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
5341_mm_maskz_set1_epi64 (__mmask8 __M, long long __A)5115_mm_maskz_set1_epi64(__mmask8 __M, long long __A) {
5342{
5343 return (__m128i) __builtin_ia32_selectq_128(__M,5116 return (__m128i) __builtin_ia32_selectq_128(__M,
5344 (__v2di) _mm_set1_epi64x(__A),5117 (__v2di) _mm_set1_epi64x(__A),
5345 (__v2di) _mm_setzero_si128());5118 (__v2di) _mm_setzero_si128());
5346}5119}
53475120
5348static __inline__ __m256i __DEFAULT_FN_ATTRS2565121static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5349_mm256_mask_set1_epi64 (__m256i __O, __mmask8 __M, long long __A)5122_mm256_mask_set1_epi64(__m256i __O, __mmask8 __M, long long __A) {
5350{
5351 return (__m256i) __builtin_ia32_selectq_256(__M,5123 return (__m256i) __builtin_ia32_selectq_256(__M,
5352 (__v4di) _mm256_set1_epi64x(__A),5124 (__v4di) _mm256_set1_epi64x(__A),
5353 (__v4di) __O) ;5125 (__v4di) __O) ;
5354}5126}
53555127
5356static __inline__ __m256i __DEFAULT_FN_ATTRS2565128static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
5357_mm256_maskz_set1_epi64 (__mmask8 __M, long long __A)5129_mm256_maskz_set1_epi64(__mmask8 __M, long long __A) {
5358{5130 return (__m256i)__builtin_ia32_selectq_256(
5359 return (__m256i) __builtin_ia32_selectq_256(__M,5131 __M, (__v4di)_mm256_set1_epi64x(__A), (__v4di)_mm256_setzero_si256());
5360 (__v4di) _mm256_set1_epi64x(__A),
5361 (__v4di) _mm256_setzero_si256());
5362}5132}
53635133
5364#define _mm_fixupimm_pd(A, B, C, imm) \5134#define _mm_fixupimm_pd(A, B, C, imm) \
...@@ -5805,130 +5575,113 @@ _mm256_mask_storeu_ps (void *__P, __mmask8 __U, __m256 __A)...@@ -5805,130 +5575,113 @@ _mm256_mask_storeu_ps (void *__P, __mmask8 __U, __m256 __A)
5805 (__mmask8) __U);5575 (__mmask8) __U);
5806}5576}
58075577
58085578static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
5809static __inline__ __m128d __DEFAULT_FN_ATTRS1285579_mm_mask_unpackhi_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
5810_mm_mask_unpackhi_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B)
5811{
5812 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,5580 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
5813 (__v2df)_mm_unpackhi_pd(__A, __B),5581 (__v2df)_mm_unpackhi_pd(__A, __B),
5814 (__v2df)__W);5582 (__v2df)__W);
5815}5583}
58165584
5817static __inline__ __m128d __DEFAULT_FN_ATTRS1285585static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
5818_mm_maskz_unpackhi_pd(__mmask8 __U, __m128d __A, __m128d __B)5586_mm_maskz_unpackhi_pd(__mmask8 __U, __m128d __A, __m128d __B) {
5819{
5820 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,5587 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
5821 (__v2df)_mm_unpackhi_pd(__A, __B),5588 (__v2df)_mm_unpackhi_pd(__A, __B),
5822 (__v2df)_mm_setzero_pd());5589 (__v2df)_mm_setzero_pd());
5823}5590}
58245591
5825static __inline__ __m256d __DEFAULT_FN_ATTRS2565592static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
5826_mm256_mask_unpackhi_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B)5593_mm256_mask_unpackhi_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
5827{
5828 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,5594 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
5829 (__v4df)_mm256_unpackhi_pd(__A, __B),5595 (__v4df)_mm256_unpackhi_pd(__A, __B),
5830 (__v4df)__W);5596 (__v4df)__W);
5831}5597}
58325598
5833static __inline__ __m256d __DEFAULT_FN_ATTRS2565599static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
5834_mm256_maskz_unpackhi_pd(__mmask8 __U, __m256d __A, __m256d __B)5600_mm256_maskz_unpackhi_pd(__mmask8 __U, __m256d __A, __m256d __B) {
5835{
5836 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,5601 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
5837 (__v4df)_mm256_unpackhi_pd(__A, __B),5602 (__v4df)_mm256_unpackhi_pd(__A, __B),
5838 (__v4df)_mm256_setzero_pd());5603 (__v4df)_mm256_setzero_pd());
5839}5604}
58405605
5841static __inline__ __m128 __DEFAULT_FN_ATTRS1285606static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
5842_mm_mask_unpackhi_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B)5607_mm_mask_unpackhi_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
5843{
5844 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,5608 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
5845 (__v4sf)_mm_unpackhi_ps(__A, __B),5609 (__v4sf)_mm_unpackhi_ps(__A, __B),
5846 (__v4sf)__W);5610 (__v4sf)__W);
5847}5611}
58485612
5849static __inline__ __m128 __DEFAULT_FN_ATTRS1285613static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
5850_mm_maskz_unpackhi_ps(__mmask8 __U, __m128 __A, __m128 __B)5614_mm_maskz_unpackhi_ps(__mmask8 __U, __m128 __A, __m128 __B) {
5851{
5852 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,5615 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
5853 (__v4sf)_mm_unpackhi_ps(__A, __B),5616 (__v4sf)_mm_unpackhi_ps(__A, __B),
5854 (__v4sf)_mm_setzero_ps());5617 (__v4sf)_mm_setzero_ps());
5855}5618}
58565619
5857static __inline__ __m256 __DEFAULT_FN_ATTRS2565620static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
5858_mm256_mask_unpackhi_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B)5621_mm256_mask_unpackhi_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
5859{
5860 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,5622 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
5861 (__v8sf)_mm256_unpackhi_ps(__A, __B),5623 (__v8sf)_mm256_unpackhi_ps(__A, __B),
5862 (__v8sf)__W);5624 (__v8sf)__W);
5863}5625}
58645626
5865static __inline__ __m256 __DEFAULT_FN_ATTRS2565627static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
5866_mm256_maskz_unpackhi_ps(__mmask8 __U, __m256 __A, __m256 __B)5628_mm256_maskz_unpackhi_ps(__mmask8 __U, __m256 __A, __m256 __B) {
5867{
5868 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,5629 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
5869 (__v8sf)_mm256_unpackhi_ps(__A, __B),5630 (__v8sf)_mm256_unpackhi_ps(__A, __B),
5870 (__v8sf)_mm256_setzero_ps());5631 (__v8sf)_mm256_setzero_ps());
5871}5632}
58725633
5873static __inline__ __m128d __DEFAULT_FN_ATTRS1285634static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
5874_mm_mask_unpacklo_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B)5635_mm_mask_unpacklo_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
5875{
5876 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,5636 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
5877 (__v2df)_mm_unpacklo_pd(__A, __B),5637 (__v2df)_mm_unpacklo_pd(__A, __B),
5878 (__v2df)__W);5638 (__v2df)__W);
5879}5639}
58805640
5881static __inline__ __m128d __DEFAULT_FN_ATTRS1285641static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
5882_mm_maskz_unpacklo_pd(__mmask8 __U, __m128d __A, __m128d __B)5642_mm_maskz_unpacklo_pd(__mmask8 __U, __m128d __A, __m128d __B) {
5883{
5884 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,5643 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
5885 (__v2df)_mm_unpacklo_pd(__A, __B),5644 (__v2df)_mm_unpacklo_pd(__A, __B),
5886 (__v2df)_mm_setzero_pd());5645 (__v2df)_mm_setzero_pd());
5887}5646}
58885647
5889static __inline__ __m256d __DEFAULT_FN_ATTRS2565648static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
5890_mm256_mask_unpacklo_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B)5649_mm256_mask_unpacklo_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) {
5891{
5892 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,5650 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
5893 (__v4df)_mm256_unpacklo_pd(__A, __B),5651 (__v4df)_mm256_unpacklo_pd(__A, __B),
5894 (__v4df)__W);5652 (__v4df)__W);
5895}5653}
58965654
5897static __inline__ __m256d __DEFAULT_FN_ATTRS2565655static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
5898_mm256_maskz_unpacklo_pd(__mmask8 __U, __m256d __A, __m256d __B)5656_mm256_maskz_unpacklo_pd(__mmask8 __U, __m256d __A, __m256d __B) {
5899{
5900 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,5657 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
5901 (__v4df)_mm256_unpacklo_pd(__A, __B),5658 (__v4df)_mm256_unpacklo_pd(__A, __B),
5902 (__v4df)_mm256_setzero_pd());5659 (__v4df)_mm256_setzero_pd());
5903}5660}
59045661
5905static __inline__ __m128 __DEFAULT_FN_ATTRS1285662static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
5906_mm_mask_unpacklo_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B)5663_mm_mask_unpacklo_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
5907{
5908 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,5664 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
5909 (__v4sf)_mm_unpacklo_ps(__A, __B),5665 (__v4sf)_mm_unpacklo_ps(__A, __B),
5910 (__v4sf)__W);5666 (__v4sf)__W);
5911}5667}
59125668
5913static __inline__ __m128 __DEFAULT_FN_ATTRS1285669static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
5914_mm_maskz_unpacklo_ps(__mmask8 __U, __m128 __A, __m128 __B)5670_mm_maskz_unpacklo_ps(__mmask8 __U, __m128 __A, __m128 __B) {
5915{
5916 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,5671 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
5917 (__v4sf)_mm_unpacklo_ps(__A, __B),5672 (__v4sf)_mm_unpacklo_ps(__A, __B),
5918 (__v4sf)_mm_setzero_ps());5673 (__v4sf)_mm_setzero_ps());
5919}5674}
59205675
5921static __inline__ __m256 __DEFAULT_FN_ATTRS2565676static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
5922_mm256_mask_unpacklo_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B)5677_mm256_mask_unpacklo_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) {
5923{
5924 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,5678 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
5925 (__v8sf)_mm256_unpacklo_ps(__A, __B),5679 (__v8sf)_mm256_unpacklo_ps(__A, __B),
5926 (__v8sf)__W);5680 (__v8sf)__W);
5927}5681}
59285682
5929static __inline__ __m256 __DEFAULT_FN_ATTRS2565683static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
5930_mm256_maskz_unpacklo_ps(__mmask8 __U, __m256 __A, __m256 __B)5684_mm256_maskz_unpacklo_ps(__mmask8 __U, __m256 __A, __m256 __B) {
5931{
5932 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,5685 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
5933 (__v8sf)_mm256_unpacklo_ps(__A, __B),5686 (__v8sf)_mm256_unpacklo_ps(__A, __B),
5934 (__v8sf)_mm256_setzero_ps());5687 (__v8sf)_mm256_setzero_ps());
...@@ -6078,65 +5831,57 @@ _mm256_maskz_rcp14_ps (__mmask8 __U, __m256 __A)...@@ -6078,65 +5831,57 @@ _mm256_maskz_rcp14_ps (__mmask8 __U, __m256 __A)
6078 (__v8sf)_mm256_permute_ps((X), (C)), \5831 (__v8sf)_mm256_permute_ps((X), (C)), \
6079 (__v8sf)_mm256_setzero_ps()))5832 (__v8sf)_mm256_setzero_ps()))
60805833
6081static __inline__ __m128d __DEFAULT_FN_ATTRS1285834static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
6082_mm_mask_permutevar_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128i __C)5835_mm_mask_permutevar_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128i __C) {
6083{
6084 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,5836 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
6085 (__v2df)_mm_permutevar_pd(__A, __C),5837 (__v2df)_mm_permutevar_pd(__A, __C),
6086 (__v2df)__W);5838 (__v2df)__W);
6087}5839}
60885840
6089static __inline__ __m128d __DEFAULT_FN_ATTRS1285841static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
6090_mm_maskz_permutevar_pd(__mmask8 __U, __m128d __A, __m128i __C)5842_mm_maskz_permutevar_pd(__mmask8 __U, __m128d __A, __m128i __C) {
6091{
6092 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,5843 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
6093 (__v2df)_mm_permutevar_pd(__A, __C),5844 (__v2df)_mm_permutevar_pd(__A, __C),
6094 (__v2df)_mm_setzero_pd());5845 (__v2df)_mm_setzero_pd());
6095}5846}
60965847
6097static __inline__ __m256d __DEFAULT_FN_ATTRS2565848static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
6098_mm256_mask_permutevar_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256i __C)5849_mm256_mask_permutevar_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256i __C) {
6099{
6100 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,5850 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
6101 (__v4df)_mm256_permutevar_pd(__A, __C),5851 (__v4df)_mm256_permutevar_pd(__A, __C),
6102 (__v4df)__W);5852 (__v4df)__W);
6103}5853}
61045854
6105static __inline__ __m256d __DEFAULT_FN_ATTRS2565855static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
6106_mm256_maskz_permutevar_pd(__mmask8 __U, __m256d __A, __m256i __C)5856_mm256_maskz_permutevar_pd(__mmask8 __U, __m256d __A, __m256i __C) {
6107{
6108 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,5857 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
6109 (__v4df)_mm256_permutevar_pd(__A, __C),5858 (__v4df)_mm256_permutevar_pd(__A, __C),
6110 (__v4df)_mm256_setzero_pd());5859 (__v4df)_mm256_setzero_pd());
6111}5860}
61125861
6113static __inline__ __m128 __DEFAULT_FN_ATTRS1285862static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
6114_mm_mask_permutevar_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128i __C)5863_mm_mask_permutevar_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128i __C) {
6115{
6116 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,5864 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
6117 (__v4sf)_mm_permutevar_ps(__A, __C),5865 (__v4sf)_mm_permutevar_ps(__A, __C),
6118 (__v4sf)__W);5866 (__v4sf)__W);
6119}5867}
61205868
6121static __inline__ __m128 __DEFAULT_FN_ATTRS1285869static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
6122_mm_maskz_permutevar_ps(__mmask8 __U, __m128 __A, __m128i __C)5870_mm_maskz_permutevar_ps(__mmask8 __U, __m128 __A, __m128i __C) {
6123{
6124 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,5871 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
6125 (__v4sf)_mm_permutevar_ps(__A, __C),5872 (__v4sf)_mm_permutevar_ps(__A, __C),
6126 (__v4sf)_mm_setzero_ps());5873 (__v4sf)_mm_setzero_ps());
6127}5874}
61285875
6129static __inline__ __m256 __DEFAULT_FN_ATTRS2565876static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6130_mm256_mask_permutevar_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256i __C)5877_mm256_mask_permutevar_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256i __C) {
6131{
6132 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,5878 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
6133 (__v8sf)_mm256_permutevar_ps(__A, __C),5879 (__v8sf)_mm256_permutevar_ps(__A, __C),
6134 (__v8sf)__W);5880 (__v8sf)__W);
6135}5881}
61365882
6137static __inline__ __m256 __DEFAULT_FN_ATTRS2565883static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6138_mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C)5884_mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C) {
6139{
6140 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,5885 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
6141 (__v8sf)_mm256_permutevar_ps(__A, __C),5886 (__v8sf)_mm256_permutevar_ps(__A, __C),
6142 (__v8sf)_mm256_setzero_ps());5887 (__v8sf)_mm256_setzero_ps());
...@@ -6250,282 +5995,251 @@ _mm256_mask_testn_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B)...@@ -6250,282 +5995,251 @@ _mm256_mask_testn_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B)
6250 _mm256_setzero_si256());5995 _mm256_setzero_si256());
6251}5996}
62525997
6253static __inline__ __m128i __DEFAULT_FN_ATTRS1285998static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6254_mm_mask_unpackhi_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)5999_mm_mask_unpackhi_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
6255{
6256 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6000 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6257 (__v4si)_mm_unpackhi_epi32(__A, __B),6001 (__v4si)_mm_unpackhi_epi32(__A, __B),
6258 (__v4si)__W);6002 (__v4si)__W);
6259}6003}
62606004
6261static __inline__ __m128i __DEFAULT_FN_ATTRS1286005static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6262_mm_maskz_unpackhi_epi32(__mmask8 __U, __m128i __A, __m128i __B)6006_mm_maskz_unpackhi_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
6263{
6264 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6007 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6265 (__v4si)_mm_unpackhi_epi32(__A, __B),6008 (__v4si)_mm_unpackhi_epi32(__A, __B),
6266 (__v4si)_mm_setzero_si128());6009 (__v4si)_mm_setzero_si128());
6267}6010}
62686011
6269static __inline__ __m256i __DEFAULT_FN_ATTRS2566012static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6270_mm256_mask_unpackhi_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)6013_mm256_mask_unpackhi_epi32(__m256i __W, __mmask8 __U, __m256i __A,
6271{6014 __m256i __B) {
6272 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6015 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6273 (__v8si)_mm256_unpackhi_epi32(__A, __B),6016 (__v8si)_mm256_unpackhi_epi32(__A, __B),
6274 (__v8si)__W);6017 (__v8si)__W);
6275}6018}
62766019
6277static __inline__ __m256i __DEFAULT_FN_ATTRS2566020static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6278_mm256_maskz_unpackhi_epi32(__mmask8 __U, __m256i __A, __m256i __B)6021_mm256_maskz_unpackhi_epi32(__mmask8 __U, __m256i __A, __m256i __B) {
6279{
6280 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6022 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6281 (__v8si)_mm256_unpackhi_epi32(__A, __B),6023 (__v8si)_mm256_unpackhi_epi32(__A, __B),
6282 (__v8si)_mm256_setzero_si256());6024 (__v8si)_mm256_setzero_si256());
6283}6025}
62846026
6285static __inline__ __m128i __DEFAULT_FN_ATTRS1286027static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6286_mm_mask_unpackhi_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)6028_mm_mask_unpackhi_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
6287{
6288 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,6029 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
6289 (__v2di)_mm_unpackhi_epi64(__A, __B),6030 (__v2di)_mm_unpackhi_epi64(__A, __B),
6290 (__v2di)__W);6031 (__v2di)__W);
6291}6032}
62926033
6293static __inline__ __m128i __DEFAULT_FN_ATTRS1286034static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6294_mm_maskz_unpackhi_epi64(__mmask8 __U, __m128i __A, __m128i __B)6035_mm_maskz_unpackhi_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
6295{
6296 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,6036 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
6297 (__v2di)_mm_unpackhi_epi64(__A, __B),6037 (__v2di)_mm_unpackhi_epi64(__A, __B),
6298 (__v2di)_mm_setzero_si128());6038 (__v2di)_mm_setzero_si128());
6299}6039}
63006040
6301static __inline__ __m256i __DEFAULT_FN_ATTRS2566041static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6302_mm256_mask_unpackhi_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)6042_mm256_mask_unpackhi_epi64(__m256i __W, __mmask8 __U, __m256i __A,
6303{6043 __m256i __B) {
6304 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,6044 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
6305 (__v4di)_mm256_unpackhi_epi64(__A, __B),6045 (__v4di)_mm256_unpackhi_epi64(__A, __B),
6306 (__v4di)__W);6046 (__v4di)__W);
6307}6047}
63086048
6309static __inline__ __m256i __DEFAULT_FN_ATTRS2566049static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6310_mm256_maskz_unpackhi_epi64(__mmask8 __U, __m256i __A, __m256i __B)6050_mm256_maskz_unpackhi_epi64(__mmask8 __U, __m256i __A, __m256i __B) {
6311{
6312 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,6051 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
6313 (__v4di)_mm256_unpackhi_epi64(__A, __B),6052 (__v4di)_mm256_unpackhi_epi64(__A, __B),
6314 (__v4di)_mm256_setzero_si256());6053 (__v4di)_mm256_setzero_si256());
6315}6054}
63166055
6317static __inline__ __m128i __DEFAULT_FN_ATTRS1286056static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6318_mm_mask_unpacklo_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)6057_mm_mask_unpacklo_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
6319{
6320 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6058 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6321 (__v4si)_mm_unpacklo_epi32(__A, __B),6059 (__v4si)_mm_unpacklo_epi32(__A, __B),
6322 (__v4si)__W);6060 (__v4si)__W);
6323}6061}
63246062
6325static __inline__ __m128i __DEFAULT_FN_ATTRS1286063static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6326_mm_maskz_unpacklo_epi32(__mmask8 __U, __m128i __A, __m128i __B)6064_mm_maskz_unpacklo_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
6327{
6328 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6065 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6329 (__v4si)_mm_unpacklo_epi32(__A, __B),6066 (__v4si)_mm_unpacklo_epi32(__A, __B),
6330 (__v4si)_mm_setzero_si128());6067 (__v4si)_mm_setzero_si128());
6331}6068}
63326069
6333static __inline__ __m256i __DEFAULT_FN_ATTRS2566070static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6334_mm256_mask_unpacklo_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)6071_mm256_mask_unpacklo_epi32(__m256i __W, __mmask8 __U, __m256i __A,
6335{6072 __m256i __B) {
6336 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6073 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6337 (__v8si)_mm256_unpacklo_epi32(__A, __B),6074 (__v8si)_mm256_unpacklo_epi32(__A, __B),
6338 (__v8si)__W);6075 (__v8si)__W);
6339}6076}
63406077
6341static __inline__ __m256i __DEFAULT_FN_ATTRS2566078static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6342_mm256_maskz_unpacklo_epi32(__mmask8 __U, __m256i __A, __m256i __B)6079_mm256_maskz_unpacklo_epi32(__mmask8 __U, __m256i __A, __m256i __B) {
6343{
6344 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6080 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6345 (__v8si)_mm256_unpacklo_epi32(__A, __B),6081 (__v8si)_mm256_unpacklo_epi32(__A, __B),
6346 (__v8si)_mm256_setzero_si256());6082 (__v8si)_mm256_setzero_si256());
6347}6083}
63486084
6349static __inline__ __m128i __DEFAULT_FN_ATTRS1286085static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6350_mm_mask_unpacklo_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)6086_mm_mask_unpacklo_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
6351{
6352 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,6087 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
6353 (__v2di)_mm_unpacklo_epi64(__A, __B),6088 (__v2di)_mm_unpacklo_epi64(__A, __B),
6354 (__v2di)__W);6089 (__v2di)__W);
6355}6090}
63566091
6357static __inline__ __m128i __DEFAULT_FN_ATTRS1286092static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6358_mm_maskz_unpacklo_epi64(__mmask8 __U, __m128i __A, __m128i __B)6093_mm_maskz_unpacklo_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
6359{
6360 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,6094 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
6361 (__v2di)_mm_unpacklo_epi64(__A, __B),6095 (__v2di)_mm_unpacklo_epi64(__A, __B),
6362 (__v2di)_mm_setzero_si128());6096 (__v2di)_mm_setzero_si128());
6363}6097}
63646098
6365static __inline__ __m256i __DEFAULT_FN_ATTRS2566099static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6366_mm256_mask_unpacklo_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)6100_mm256_mask_unpacklo_epi64(__m256i __W, __mmask8 __U, __m256i __A,
6367{6101 __m256i __B) {
6368 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,6102 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
6369 (__v4di)_mm256_unpacklo_epi64(__A, __B),6103 (__v4di)_mm256_unpacklo_epi64(__A, __B),
6370 (__v4di)__W);6104 (__v4di)__W);
6371}6105}
63726106
6373static __inline__ __m256i __DEFAULT_FN_ATTRS2566107static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6374_mm256_maskz_unpacklo_epi64(__mmask8 __U, __m256i __A, __m256i __B)6108_mm256_maskz_unpacklo_epi64(__mmask8 __U, __m256i __A, __m256i __B) {
6375{
6376 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,6109 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
6377 (__v4di)_mm256_unpacklo_epi64(__A, __B),6110 (__v4di)_mm256_unpacklo_epi64(__A, __B),
6378 (__v4di)_mm256_setzero_si256());6111 (__v4di)_mm256_setzero_si256());
6379}6112}
63806113
6381static __inline__ __m128i __DEFAULT_FN_ATTRS1286114static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6382_mm_mask_sra_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)6115_mm_mask_sra_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
6383{
6384 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6116 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6385 (__v4si)_mm_sra_epi32(__A, __B),6117 (__v4si)_mm_sra_epi32(__A, __B),
6386 (__v4si)__W);6118 (__v4si)__W);
6387}6119}
63886120
6389static __inline__ __m128i __DEFAULT_FN_ATTRS1286121static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6390_mm_maskz_sra_epi32(__mmask8 __U, __m128i __A, __m128i __B)6122_mm_maskz_sra_epi32(__mmask8 __U, __m128i __A, __m128i __B) {
6391{
6392 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6123 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6393 (__v4si)_mm_sra_epi32(__A, __B),6124 (__v4si)_mm_sra_epi32(__A, __B),
6394 (__v4si)_mm_setzero_si128());6125 (__v4si)_mm_setzero_si128());
6395}6126}
63966127
6397static __inline__ __m256i __DEFAULT_FN_ATTRS2566128static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6398_mm256_mask_sra_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B)6129_mm256_mask_sra_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) {
6399{
6400 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6130 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6401 (__v8si)_mm256_sra_epi32(__A, __B),6131 (__v8si)_mm256_sra_epi32(__A, __B),
6402 (__v8si)__W);6132 (__v8si)__W);
6403}6133}
64046134
6405static __inline__ __m256i __DEFAULT_FN_ATTRS2566135static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6406_mm256_maskz_sra_epi32(__mmask8 __U, __m256i __A, __m128i __B)6136_mm256_maskz_sra_epi32(__mmask8 __U, __m256i __A, __m128i __B) {
6407{
6408 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6137 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6409 (__v8si)_mm256_sra_epi32(__A, __B),6138 (__v8si)_mm256_sra_epi32(__A, __B),
6410 (__v8si)_mm256_setzero_si256());6139 (__v8si)_mm256_setzero_si256());
6411}6140}
64126141
6413static __inline__ __m128i __DEFAULT_FN_ATTRS1286142static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6414_mm_mask_srai_epi32(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B)6143_mm_mask_srai_epi32(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) {
6415{
6416 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6144 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6417 (__v4si)_mm_srai_epi32(__A, (int)__B),6145 (__v4si)_mm_srai_epi32(__A, (int)__B),
6418 (__v4si)__W);6146 (__v4si)__W);
6419}6147}
64206148
6421static __inline__ __m128i __DEFAULT_FN_ATTRS1286149static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6422_mm_maskz_srai_epi32(__mmask8 __U, __m128i __A, unsigned int __B)6150_mm_maskz_srai_epi32(__mmask8 __U, __m128i __A, unsigned int __B) {
6423{
6424 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,6151 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
6425 (__v4si)_mm_srai_epi32(__A, (int)__B),6152 (__v4si)_mm_srai_epi32(__A, (int)__B),
6426 (__v4si)_mm_setzero_si128());6153 (__v4si)_mm_setzero_si128());
6427}6154}
64286155
6429static __inline__ __m256i __DEFAULT_FN_ATTRS2566156static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6430_mm256_mask_srai_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B)6157_mm256_mask_srai_epi32(__m256i __W, __mmask8 __U, __m256i __A,
6431{6158 unsigned int __B) {
6432 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6159 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6433 (__v8si)_mm256_srai_epi32(__A, (int)__B),6160 (__v8si)_mm256_srai_epi32(__A, (int)__B),
6434 (__v8si)__W);6161 (__v8si)__W);
6435}6162}
64366163
6437static __inline__ __m256i __DEFAULT_FN_ATTRS2566164static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6438_mm256_maskz_srai_epi32(__mmask8 __U, __m256i __A, unsigned int __B)6165_mm256_maskz_srai_epi32(__mmask8 __U, __m256i __A, unsigned int __B) {
6439{
6440 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,6166 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
6441 (__v8si)_mm256_srai_epi32(__A, (int)__B),6167 (__v8si)_mm256_srai_epi32(__A, (int)__B),
6442 (__v8si)_mm256_setzero_si256());6168 (__v8si)_mm256_setzero_si256());
6443}6169}
64446170
6445static __inline__ __m128i __DEFAULT_FN_ATTRS1286171static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6446_mm_sra_epi64(__m128i __A, __m128i __B)6172_mm_sra_epi64(__m128i __A, __m128i __B) {
6447{
6448 return (__m128i)__builtin_ia32_psraq128((__v2di)__A, (__v2di)__B);6173 return (__m128i)__builtin_ia32_psraq128((__v2di)__A, (__v2di)__B);
6449}6174}
64506175
6451static __inline__ __m128i __DEFAULT_FN_ATTRS1286176static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6452_mm_mask_sra_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B)6177_mm_mask_sra_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {
6453{
6454 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \6178 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \
6455 (__v2di)_mm_sra_epi64(__A, __B), \6179 (__v2di)_mm_sra_epi64(__A, __B), \
6456 (__v2di)__W);6180 (__v2di)__W);
6457}6181}
64586182
6459static __inline__ __m128i __DEFAULT_FN_ATTRS1286183static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6460_mm_maskz_sra_epi64(__mmask8 __U, __m128i __A, __m128i __B)6184_mm_maskz_sra_epi64(__mmask8 __U, __m128i __A, __m128i __B) {
6461{
6462 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \6185 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \
6463 (__v2di)_mm_sra_epi64(__A, __B), \6186 (__v2di)_mm_sra_epi64(__A, __B), \
6464 (__v2di)_mm_setzero_si128());6187 (__v2di)_mm_setzero_si128());
6465}6188}
64666189
6467static __inline__ __m256i __DEFAULT_FN_ATTRS2566190static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6468_mm256_sra_epi64(__m256i __A, __m128i __B)6191_mm256_sra_epi64(__m256i __A, __m128i __B) {
6469{
6470 return (__m256i)__builtin_ia32_psraq256((__v4di) __A, (__v2di) __B);6192 return (__m256i)__builtin_ia32_psraq256((__v4di) __A, (__v2di) __B);
6471}6193}
64726194
6473static __inline__ __m256i __DEFAULT_FN_ATTRS2566195static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6474_mm256_mask_sra_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B)6196_mm256_mask_sra_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) {
6475{
6476 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \6197 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \
6477 (__v4di)_mm256_sra_epi64(__A, __B), \6198 (__v4di)_mm256_sra_epi64(__A, __B), \
6478 (__v4di)__W);6199 (__v4di)__W);
6479}6200}
64806201
6481static __inline__ __m256i __DEFAULT_FN_ATTRS2566202static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6482_mm256_maskz_sra_epi64(__mmask8 __U, __m256i __A, __m128i __B)6203_mm256_maskz_sra_epi64(__mmask8 __U, __m256i __A, __m128i __B) {
6483{
6484 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \6204 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \
6485 (__v4di)_mm256_sra_epi64(__A, __B), \6205 (__v4di)_mm256_sra_epi64(__A, __B), \
6486 (__v4di)_mm256_setzero_si256());6206 (__v4di)_mm256_setzero_si256());
6487}6207}
64886208
6489static __inline__ __m128i __DEFAULT_FN_ATTRS1286209static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6490_mm_srai_epi64(__m128i __A, unsigned int __imm)6210_mm_srai_epi64(__m128i __A, unsigned int __imm) {
6491{
6492 return (__m128i)__builtin_ia32_psraqi128((__v2di)__A, (int)__imm);6211 return (__m128i)__builtin_ia32_psraqi128((__v2di)__A, (int)__imm);
6493}6212}
64946213
6495static __inline__ __m128i __DEFAULT_FN_ATTRS1286214static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_mask_srai_epi64(
6496_mm_mask_srai_epi64(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __imm)6215 __m128i __W, __mmask8 __U, __m128i __A, unsigned int __imm) {
6497{
6498 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \6216 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \
6499 (__v2di)_mm_srai_epi64(__A, __imm), \6217 (__v2di)_mm_srai_epi64(__A, __imm), \
6500 (__v2di)__W);6218 (__v2di)__W);
6501}6219}
65026220
6503static __inline__ __m128i __DEFAULT_FN_ATTRS1286221static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6504_mm_maskz_srai_epi64(__mmask8 __U, __m128i __A, unsigned int __imm)6222_mm_maskz_srai_epi64(__mmask8 __U, __m128i __A, unsigned int __imm) {
6505{
6506 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \6223 return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \
6507 (__v2di)_mm_srai_epi64(__A, __imm), \6224 (__v2di)_mm_srai_epi64(__A, __imm), \
6508 (__v2di)_mm_setzero_si128());6225 (__v2di)_mm_setzero_si128());
6509}6226}
65106227
6511static __inline__ __m256i __DEFAULT_FN_ATTRS2566228static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6512_mm256_srai_epi64(__m256i __A, unsigned int __imm)6229_mm256_srai_epi64(__m256i __A, unsigned int __imm) {
6513{
6514 return (__m256i)__builtin_ia32_psraqi256((__v4di)__A, (int)__imm);6230 return (__m256i)__builtin_ia32_psraqi256((__v4di)__A, (int)__imm);
6515}6231}
65166232
6517static __inline__ __m256i __DEFAULT_FN_ATTRS2566233static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6518_mm256_mask_srai_epi64(__m256i __W, __mmask8 __U, __m256i __A,6234_mm256_mask_srai_epi64(__m256i __W, __mmask8 __U, __m256i __A,
6519 unsigned int __imm)6235 unsigned int __imm) {
6520{
6521 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \6236 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \
6522 (__v4di)_mm256_srai_epi64(__A, __imm), \6237 (__v4di)_mm256_srai_epi64(__A, __imm), \
6523 (__v4di)__W);6238 (__v4di)__W);
6524}6239}
65256240
6526static __inline__ __m256i __DEFAULT_FN_ATTRS2566241static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6527_mm256_maskz_srai_epi64(__mmask8 __U, __m256i __A, unsigned int __imm)6242_mm256_maskz_srai_epi64(__mmask8 __U, __m256i __A, unsigned int __imm) {
6528{
6529 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \6243 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \
6530 (__v4di)_mm256_srai_epi64(__A, __imm), \6244 (__v4di)_mm256_srai_epi64(__A, __imm), \
6531 (__v4di)_mm256_setzero_si256());6245 (__v4di)_mm256_setzero_si256());
...@@ -6792,159 +6506,139 @@ _mm256_maskz_rsqrt14_ps (__mmask8 __U, __m256 __A)...@@ -6792,159 +6506,139 @@ _mm256_maskz_rsqrt14_ps (__mmask8 __U, __m256 __A)
6792 (__mmask8) __U);6506 (__mmask8) __U);
6793}6507}
67946508
6795static __inline__ __m256 __DEFAULT_FN_ATTRS2566509static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6796_mm256_broadcast_f32x4(__m128 __A)6510_mm256_broadcast_f32x4(__m128 __A) {
6797{
6798 return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,6511 return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A,
6799 0, 1, 2, 3, 0, 1, 2, 3);6512 0, 1, 2, 3, 0, 1, 2, 3);
6800}6513}
68016514
6802static __inline__ __m256 __DEFAULT_FN_ATTRS2566515static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6803_mm256_mask_broadcast_f32x4(__m256 __O, __mmask8 __M, __m128 __A)6516_mm256_mask_broadcast_f32x4(__m256 __O, __mmask8 __M, __m128 __A) {
6804{
6805 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,6517 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,
6806 (__v8sf)_mm256_broadcast_f32x4(__A),6518 (__v8sf)_mm256_broadcast_f32x4(__A),
6807 (__v8sf)__O);6519 (__v8sf)__O);
6808}6520}
68096521
6810static __inline__ __m256 __DEFAULT_FN_ATTRS2566522static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6811_mm256_maskz_broadcast_f32x4 (__mmask8 __M, __m128 __A)6523_mm256_maskz_broadcast_f32x4(__mmask8 __M, __m128 __A) {
6812{
6813 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,6524 return (__m256)__builtin_ia32_selectps_256((__mmask8)__M,
6814 (__v8sf)_mm256_broadcast_f32x4(__A),6525 (__v8sf)_mm256_broadcast_f32x4(__A),
6815 (__v8sf)_mm256_setzero_ps());6526 (__v8sf)_mm256_setzero_ps());
6816}6527}
68176528
6818static __inline__ __m256i __DEFAULT_FN_ATTRS2566529static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6819_mm256_broadcast_i32x4(__m128i __A)6530_mm256_broadcast_i32x4(__m128i __A) {
6820{
6821 return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,6531 return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)__A,
6822 0, 1, 2, 3, 0, 1, 2, 3);6532 0, 1, 2, 3, 0, 1, 2, 3);
6823}6533}
68246534
6825static __inline__ __m256i __DEFAULT_FN_ATTRS2566535static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6826_mm256_mask_broadcast_i32x4(__m256i __O, __mmask8 __M, __m128i __A)6536_mm256_mask_broadcast_i32x4(__m256i __O, __mmask8 __M, __m128i __A) {
6827{
6828 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,6537 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
6829 (__v8si)_mm256_broadcast_i32x4(__A),6538 (__v8si)_mm256_broadcast_i32x4(__A),
6830 (__v8si)__O);6539 (__v8si)__O);
6831}6540}
68326541
6833static __inline__ __m256i __DEFAULT_FN_ATTRS2566542static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6834_mm256_maskz_broadcast_i32x4(__mmask8 __M, __m128i __A)6543_mm256_maskz_broadcast_i32x4(__mmask8 __M, __m128i __A) {
6835{
6836 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,6544 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
6837 (__v8si)_mm256_broadcast_i32x4(__A),6545 (__v8si)_mm256_broadcast_i32x4(__A),
6838 (__v8si)_mm256_setzero_si256());6546 (__v8si)_mm256_setzero_si256());
6839}6547}
68406548
6841static __inline__ __m256d __DEFAULT_FN_ATTRS2566549static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
6842_mm256_mask_broadcastsd_pd (__m256d __O, __mmask8 __M, __m128d __A)6550_mm256_mask_broadcastsd_pd(__m256d __O, __mmask8 __M, __m128d __A) {
6843{
6844 return (__m256d)__builtin_ia32_selectpd_256(__M,6551 return (__m256d)__builtin_ia32_selectpd_256(__M,
6845 (__v4df) _mm256_broadcastsd_pd(__A),6552 (__v4df) _mm256_broadcastsd_pd(__A),
6846 (__v4df) __O);6553 (__v4df) __O);
6847}6554}
68486555
6849static __inline__ __m256d __DEFAULT_FN_ATTRS2566556static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
6850_mm256_maskz_broadcastsd_pd (__mmask8 __M, __m128d __A)6557_mm256_maskz_broadcastsd_pd(__mmask8 __M, __m128d __A) {
6851{
6852 return (__m256d)__builtin_ia32_selectpd_256(__M,6558 return (__m256d)__builtin_ia32_selectpd_256(__M,
6853 (__v4df) _mm256_broadcastsd_pd(__A),6559 (__v4df) _mm256_broadcastsd_pd(__A),
6854 (__v4df) _mm256_setzero_pd());6560 (__v4df) _mm256_setzero_pd());
6855}6561}
68566562
6857static __inline__ __m128 __DEFAULT_FN_ATTRS1286563static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
6858_mm_mask_broadcastss_ps (__m128 __O, __mmask8 __M, __m128 __A)6564_mm_mask_broadcastss_ps(__m128 __O, __mmask8 __M, __m128 __A) {
6859{
6860 return (__m128)__builtin_ia32_selectps_128(__M,6565 return (__m128)__builtin_ia32_selectps_128(__M,
6861 (__v4sf) _mm_broadcastss_ps(__A),6566 (__v4sf) _mm_broadcastss_ps(__A),
6862 (__v4sf) __O);6567 (__v4sf) __O);
6863}6568}
68646569
6865static __inline__ __m128 __DEFAULT_FN_ATTRS1286570static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
6866_mm_maskz_broadcastss_ps (__mmask8 __M, __m128 __A)6571_mm_maskz_broadcastss_ps(__mmask8 __M, __m128 __A) {
6867{
6868 return (__m128)__builtin_ia32_selectps_128(__M,6572 return (__m128)__builtin_ia32_selectps_128(__M,
6869 (__v4sf) _mm_broadcastss_ps(__A),6573 (__v4sf) _mm_broadcastss_ps(__A),
6870 (__v4sf) _mm_setzero_ps());6574 (__v4sf) _mm_setzero_ps());
6871}6575}
68726576
6873static __inline__ __m256 __DEFAULT_FN_ATTRS2566577static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6874_mm256_mask_broadcastss_ps (__m256 __O, __mmask8 __M, __m128 __A)6578_mm256_mask_broadcastss_ps(__m256 __O, __mmask8 __M, __m128 __A) {
6875{
6876 return (__m256)__builtin_ia32_selectps_256(__M,6579 return (__m256)__builtin_ia32_selectps_256(__M,
6877 (__v8sf) _mm256_broadcastss_ps(__A),6580 (__v8sf) _mm256_broadcastss_ps(__A),
6878 (__v8sf) __O);6581 (__v8sf) __O);
6879}6582}
68806583
6881static __inline__ __m256 __DEFAULT_FN_ATTRS2566584static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
6882_mm256_maskz_broadcastss_ps (__mmask8 __M, __m128 __A)6585_mm256_maskz_broadcastss_ps(__mmask8 __M, __m128 __A) {
6883{
6884 return (__m256)__builtin_ia32_selectps_256(__M,6586 return (__m256)__builtin_ia32_selectps_256(__M,
6885 (__v8sf) _mm256_broadcastss_ps(__A),6587 (__v8sf) _mm256_broadcastss_ps(__A),
6886 (__v8sf) _mm256_setzero_ps());6588 (__v8sf) _mm256_setzero_ps());
6887}6589}
68886590
6889static __inline__ __m128i __DEFAULT_FN_ATTRS1286591static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6890_mm_mask_broadcastd_epi32 (__m128i __O, __mmask8 __M, __m128i __A)6592_mm_mask_broadcastd_epi32(__m128i __O, __mmask8 __M, __m128i __A) {
6891{
6892 return (__m128i)__builtin_ia32_selectd_128(__M,6593 return (__m128i)__builtin_ia32_selectd_128(__M,
6893 (__v4si) _mm_broadcastd_epi32(__A),6594 (__v4si) _mm_broadcastd_epi32(__A),
6894 (__v4si) __O);6595 (__v4si) __O);
6895}6596}
68966597
6897static __inline__ __m128i __DEFAULT_FN_ATTRS1286598static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6898_mm_maskz_broadcastd_epi32 (__mmask8 __M, __m128i __A)6599_mm_maskz_broadcastd_epi32(__mmask8 __M, __m128i __A) {
6899{
6900 return (__m128i)__builtin_ia32_selectd_128(__M,6600 return (__m128i)__builtin_ia32_selectd_128(__M,
6901 (__v4si) _mm_broadcastd_epi32(__A),6601 (__v4si) _mm_broadcastd_epi32(__A),
6902 (__v4si) _mm_setzero_si128());6602 (__v4si) _mm_setzero_si128());
6903}6603}
69046604
6905static __inline__ __m256i __DEFAULT_FN_ATTRS2566605static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6906_mm256_mask_broadcastd_epi32 (__m256i __O, __mmask8 __M, __m128i __A)6606_mm256_mask_broadcastd_epi32(__m256i __O, __mmask8 __M, __m128i __A) {
6907{
6908 return (__m256i)__builtin_ia32_selectd_256(__M,6607 return (__m256i)__builtin_ia32_selectd_256(__M,
6909 (__v8si) _mm256_broadcastd_epi32(__A),6608 (__v8si) _mm256_broadcastd_epi32(__A),
6910 (__v8si) __O);6609 (__v8si) __O);
6911}6610}
69126611
6913static __inline__ __m256i __DEFAULT_FN_ATTRS2566612static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6914_mm256_maskz_broadcastd_epi32 (__mmask8 __M, __m128i __A)6613_mm256_maskz_broadcastd_epi32(__mmask8 __M, __m128i __A) {
6915{
6916 return (__m256i)__builtin_ia32_selectd_256(__M,6614 return (__m256i)__builtin_ia32_selectd_256(__M,
6917 (__v8si) _mm256_broadcastd_epi32(__A),6615 (__v8si) _mm256_broadcastd_epi32(__A),
6918 (__v8si) _mm256_setzero_si256());6616 (__v8si) _mm256_setzero_si256());
6919}6617}
69206618
6921static __inline__ __m128i __DEFAULT_FN_ATTRS1286619static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6922_mm_mask_broadcastq_epi64 (__m128i __O, __mmask8 __M, __m128i __A)6620_mm_mask_broadcastq_epi64(__m128i __O, __mmask8 __M, __m128i __A) {
6923{
6924 return (__m128i)__builtin_ia32_selectq_128(__M,6621 return (__m128i)__builtin_ia32_selectq_128(__M,
6925 (__v2di) _mm_broadcastq_epi64(__A),6622 (__v2di) _mm_broadcastq_epi64(__A),
6926 (__v2di) __O);6623 (__v2di) __O);
6927}6624}
69286625
6929static __inline__ __m128i __DEFAULT_FN_ATTRS1286626static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
6930_mm_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A)6627_mm_maskz_broadcastq_epi64(__mmask8 __M, __m128i __A) {
6931{
6932 return (__m128i)__builtin_ia32_selectq_128(__M,6628 return (__m128i)__builtin_ia32_selectq_128(__M,
6933 (__v2di) _mm_broadcastq_epi64(__A),6629 (__v2di) _mm_broadcastq_epi64(__A),
6934 (__v2di) _mm_setzero_si128());6630 (__v2di) _mm_setzero_si128());
6935}6631}
69366632
6937static __inline__ __m256i __DEFAULT_FN_ATTRS2566633static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6938_mm256_mask_broadcastq_epi64 (__m256i __O, __mmask8 __M, __m128i __A)6634_mm256_mask_broadcastq_epi64(__m256i __O, __mmask8 __M, __m128i __A) {
6939{
6940 return (__m256i)__builtin_ia32_selectq_256(__M,6635 return (__m256i)__builtin_ia32_selectq_256(__M,
6941 (__v4di) _mm256_broadcastq_epi64(__A),6636 (__v4di) _mm256_broadcastq_epi64(__A),
6942 (__v4di) __O);6637 (__v4di) __O);
6943}6638}
69446639
6945static __inline__ __m256i __DEFAULT_FN_ATTRS2566640static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
6946_mm256_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A)6641_mm256_maskz_broadcastq_epi64(__mmask8 __M, __m128i __A) {
6947{
6948 return (__m256i)__builtin_ia32_selectq_256(__M,6642 return (__m256i)__builtin_ia32_selectq_256(__M,
6949 (__v4di) _mm256_broadcastq_epi64(__A),6643 (__v4di) _mm256_broadcastq_epi64(__A),
6950 (__v4di) _mm256_setzero_si256());6644 (__v4di) _mm256_setzero_si256());
...@@ -7536,9 +7230,8 @@ _mm256_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)...@@ -7536,9 +7230,8 @@ _mm256_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)
7536 __builtin_ia32_pmovusqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M);7230 __builtin_ia32_pmovusqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M);
7537}7231}
75387232
7539static __inline__ __m128i __DEFAULT_FN_ATTRS1287233static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
7540_mm_cvtepi32_epi8 (__m128i __A)7234_mm_cvtepi32_epi8(__m128i __A) {
7541{
7542 return (__m128i)__builtin_shufflevector(7235 return (__m128i)__builtin_shufflevector(
7543 __builtin_convertvector((__v4si)__A, __v4qi), (__v4qi){0, 0, 0, 0}, 0, 1,7236 __builtin_convertvector((__v4si)__A, __v4qi), (__v4qi){0, 0, 0, 0}, 0, 1,
7544 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7);7237 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7);
...@@ -7566,9 +7259,8 @@ _mm_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A)...@@ -7566,9 +7259,8 @@ _mm_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A)
7566 __builtin_ia32_pmovdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M);7259 __builtin_ia32_pmovdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M);
7567}7260}
75687261
7569static __inline__ __m128i __DEFAULT_FN_ATTRS2567262static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7570_mm256_cvtepi32_epi8 (__m256i __A)7263_mm256_cvtepi32_epi8(__m256i __A) {
7571{
7572 return (__m128i)__builtin_shufflevector(7264 return (__m128i)__builtin_shufflevector(
7573 __builtin_convertvector((__v8si)__A, __v8qi),7265 __builtin_convertvector((__v8si)__A, __v8qi),
7574 (__v8qi){0, 0, 0, 0, 0, 0, 0, 0}, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,7266 (__v8qi){0, 0, 0, 0, 0, 0, 0, 0}, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
...@@ -7576,8 +7268,7 @@ _mm256_cvtepi32_epi8 (__m256i __A)...@@ -7576,8 +7268,7 @@ _mm256_cvtepi32_epi8 (__m256i __A)
7576}7268}
75777269
7578static __inline__ __m128i __DEFAULT_FN_ATTRS2567270static __inline__ __m128i __DEFAULT_FN_ATTRS256
7579_mm256_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A)7271_mm256_mask_cvtepi32_epi8(__m128i __O, __mmask8 __M, __m256i __A) {
7580{
7581 return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A,7272 return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A,
7582 (__v16qi) __O, __M);7273 (__v16qi) __O, __M);
7583}7274}
...@@ -7596,9 +7287,8 @@ _mm256_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A)...@@ -7596,9 +7287,8 @@ _mm256_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A)
7596 __builtin_ia32_pmovdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M);7287 __builtin_ia32_pmovdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M);
7597}7288}
75987289
7599static __inline__ __m128i __DEFAULT_FN_ATTRS1287290static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
7600_mm_cvtepi32_epi16 (__m128i __A)7291_mm_cvtepi32_epi16(__m128i __A) {
7601{
7602 return (__m128i)__builtin_shufflevector(7292 return (__m128i)__builtin_shufflevector(
7603 __builtin_convertvector((__v4si)__A, __v4hi), (__v4hi){0, 0, 0, 0}, 0, 1,7293 __builtin_convertvector((__v4si)__A, __v4hi), (__v4hi){0, 0, 0, 0}, 0, 1,
7604 2, 3, 4, 5, 6, 7);7294 2, 3, 4, 5, 6, 7);
...@@ -7625,9 +7315,8 @@ _mm_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A)...@@ -7625,9 +7315,8 @@ _mm_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A)
7625 __builtin_ia32_pmovdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M);7315 __builtin_ia32_pmovdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M);
7626}7316}
76277317
7628static __inline__ __m128i __DEFAULT_FN_ATTRS2567318static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7629_mm256_cvtepi32_epi16 (__m256i __A)7319_mm256_cvtepi32_epi16(__m256i __A) {
7630{
7631 return (__m128i)__builtin_convertvector((__v8si)__A, __v8hi);7320 return (__m128i)__builtin_convertvector((__v8si)__A, __v8hi);
7632}7321}
76337322
...@@ -7652,9 +7341,8 @@ _mm256_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)...@@ -7652,9 +7341,8 @@ _mm256_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)
7652 __builtin_ia32_pmovdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M);7341 __builtin_ia32_pmovdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M);
7653}7342}
76547343
7655static __inline__ __m128i __DEFAULT_FN_ATTRS1287344static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
7656_mm_cvtepi64_epi8 (__m128i __A)7345_mm_cvtepi64_epi8(__m128i __A) {
7657{
7658 return (__m128i)__builtin_shufflevector(7346 return (__m128i)__builtin_shufflevector(
7659 __builtin_convertvector((__v2di)__A, __v2qi), (__v2qi){0, 0}, 0, 1, 2, 3,7347 __builtin_convertvector((__v2di)__A, __v2qi), (__v2qi){0, 0}, 0, 1, 2, 3,
7660 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);7348 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
...@@ -7681,9 +7369,8 @@ _mm_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A)...@@ -7681,9 +7369,8 @@ _mm_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A)
7681 __builtin_ia32_pmovqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M);7369 __builtin_ia32_pmovqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M);
7682}7370}
76837371
7684static __inline__ __m128i __DEFAULT_FN_ATTRS2567372static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7685_mm256_cvtepi64_epi8 (__m256i __A)7373_mm256_cvtepi64_epi8(__m256i __A) {
7686{
7687 return (__m128i)__builtin_shufflevector(7374 return (__m128i)__builtin_shufflevector(
7688 __builtin_convertvector((__v4di)__A, __v4qi), (__v4qi){0, 0, 0, 0}, 0, 1,7375 __builtin_convertvector((__v4di)__A, __v4qi), (__v4qi){0, 0, 0, 0}, 0, 1,
7689 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7);7376 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7);
...@@ -7710,9 +7397,8 @@ _mm256_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A)...@@ -7710,9 +7397,8 @@ _mm256_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A)
7710 __builtin_ia32_pmovqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M);7397 __builtin_ia32_pmovqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M);
7711}7398}
77127399
7713static __inline__ __m128i __DEFAULT_FN_ATTRS1287400static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
7714_mm_cvtepi64_epi32 (__m128i __A)7401_mm_cvtepi64_epi32(__m128i __A) {
7715{
7716 return (__m128i)__builtin_shufflevector(7402 return (__m128i)__builtin_shufflevector(
7717 __builtin_convertvector((__v2di)__A, __v2si), (__v2si){0, 0}, 0, 1, 2, 3);7403 __builtin_convertvector((__v2di)__A, __v2si), (__v2si){0, 0}, 0, 1, 2, 3);
7718}7404}
...@@ -7738,23 +7424,20 @@ _mm_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A)...@@ -7738,23 +7424,20 @@ _mm_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A)
7738 __builtin_ia32_pmovqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M);7424 __builtin_ia32_pmovqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M);
7739}7425}
77407426
7741static __inline__ __m128i __DEFAULT_FN_ATTRS2567427static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7742_mm256_cvtepi64_epi32 (__m256i __A)7428_mm256_cvtepi64_epi32(__m256i __A) {
7743{
7744 return (__m128i)__builtin_convertvector((__v4di)__A, __v4si);7429 return (__m128i)__builtin_convertvector((__v4di)__A, __v4si);
7745}7430}
77467431
7747static __inline__ __m128i __DEFAULT_FN_ATTRS2567432static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7748_mm256_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A)7433_mm256_mask_cvtepi64_epi32(__m128i __O, __mmask8 __M, __m256i __A) {
7749{
7750 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,7434 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
7751 (__v4si)_mm256_cvtepi64_epi32(__A),7435 (__v4si)_mm256_cvtepi64_epi32(__A),
7752 (__v4si)__O);7436 (__v4si)__O);
7753}7437}
77547438
7755static __inline__ __m128i __DEFAULT_FN_ATTRS2567439static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7756_mm256_maskz_cvtepi64_epi32 (__mmask8 __M, __m256i __A)7440_mm256_maskz_cvtepi64_epi32(__mmask8 __M, __m256i __A) {
7757{
7758 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,7441 return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M,
7759 (__v4si)_mm256_cvtepi64_epi32(__A),7442 (__v4si)_mm256_cvtepi64_epi32(__A),
7760 (__v4si)_mm_setzero_si128());7443 (__v4si)_mm_setzero_si128());
...@@ -7766,9 +7449,8 @@ _mm256_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A)...@@ -7766,9 +7449,8 @@ _mm256_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A)
7766 __builtin_ia32_pmovqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M);7449 __builtin_ia32_pmovqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M);
7767}7450}
77687451
7769static __inline__ __m128i __DEFAULT_FN_ATTRS1287452static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
7770_mm_cvtepi64_epi16 (__m128i __A)7453_mm_cvtepi64_epi16(__m128i __A) {
7771{
7772 return (__m128i)__builtin_shufflevector(7454 return (__m128i)__builtin_shufflevector(
7773 __builtin_convertvector((__v2di)__A, __v2hi), (__v2hi){0, 0}, 0, 1, 2, 3,7455 __builtin_convertvector((__v2di)__A, __v2hi), (__v2hi){0, 0}, 0, 1, 2, 3,
7774 3, 3, 3, 3);7456 3, 3, 3, 3);
...@@ -7796,9 +7478,8 @@ _mm_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A)...@@ -7796,9 +7478,8 @@ _mm_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A)
7796 __builtin_ia32_pmovqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M);7478 __builtin_ia32_pmovqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M);
7797}7479}
77987480
7799static __inline__ __m128i __DEFAULT_FN_ATTRS2567481static __inline__ __m128i __DEFAULT_FN_ATTRS256_CONSTEXPR
7800_mm256_cvtepi64_epi16 (__m256i __A)7482_mm256_cvtepi64_epi16(__m256i __A) {
7801{
7802 return (__m128i)__builtin_shufflevector(7483 return (__m128i)__builtin_shufflevector(
7803 __builtin_convertvector((__v4di)__A, __v4hi), (__v4hi){0, 0, 0, 0}, 0, 1,7484 __builtin_convertvector((__v4di)__A, __v4hi), (__v4hi){0, 0, 0, 0}, 0, 1,
7804 2, 3, 4, 5, 6, 7);7485 2, 3, 4, 5, 6, 7);
...@@ -7825,11 +7506,10 @@ _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)...@@ -7825,11 +7506,10 @@ _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)
7825 __builtin_ia32_pmovqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M);7506 __builtin_ia32_pmovqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M);
7826}7507}
78277508
7828#define _mm256_extractf32x4_ps(A, imm) \7509#define _mm256_extractf32x4_ps(A, imm) \
7829 ((__m128)__builtin_ia32_extractf32x4_256_mask((__v8sf)(__m256)(A), \7510 ((__m128)__builtin_ia32_extractf32x4_256_mask( \
7830 (int)(imm), \7511 (__v8sf)(__m256)(A), (int)(imm), (__v4sf)_mm_setzero_ps(), \
7831 (__v4sf)_mm_undefined_ps(), \7512 (__mmask8) - 1))
7832 (__mmask8)-1))
78337513
7834#define _mm256_mask_extractf32x4_ps(W, U, A, imm) \7514#define _mm256_mask_extractf32x4_ps(W, U, A, imm) \
7835 ((__m128)__builtin_ia32_extractf32x4_256_mask((__v8sf)(__m256)(A), \7515 ((__m128)__builtin_ia32_extractf32x4_256_mask((__v8sf)(__m256)(A), \
...@@ -7843,11 +7523,10 @@ _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)...@@ -7843,11 +7523,10 @@ _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)
7843 (__v4sf)_mm_setzero_ps(), \7523 (__v4sf)_mm_setzero_ps(), \
7844 (__mmask8)(U)))7524 (__mmask8)(U)))
78457525
7846#define _mm256_extracti32x4_epi32(A, imm) \7526#define _mm256_extracti32x4_epi32(A, imm) \
7847 ((__m128i)__builtin_ia32_extracti32x4_256_mask((__v8si)(__m256i)(A), \7527 ((__m128i)__builtin_ia32_extracti32x4_256_mask( \
7848 (int)(imm), \7528 (__v8si)(__m256i)(A), (int)(imm), (__v4si)_mm_setzero_si128(), \
7849 (__v4si)_mm_undefined_si128(), \7529 (__mmask8) - 1))
7850 (__mmask8)-1))
78517530
7852#define _mm256_mask_extracti32x4_epi32(W, U, A, imm) \7531#define _mm256_mask_extracti32x4_epi32(W, U, A, imm) \
7853 ((__m128i)__builtin_ia32_extracti32x4_256_mask((__v8si)(__m256i)(A), \7532 ((__m128i)__builtin_ia32_extracti32x4_256_mask((__v8si)(__m256i)(A), \
...@@ -8083,47 +7762,41 @@ _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)...@@ -8083,47 +7762,41 @@ _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A)
8083 (__v4di)_mm256_permutex_epi64((X), (C)), \7762 (__v4di)_mm256_permutex_epi64((X), (C)), \
8084 (__v4di)_mm256_setzero_si256()))7763 (__v4di)_mm256_setzero_si256()))
80857764
8086static __inline__ __m256d __DEFAULT_FN_ATTRS2567765static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
8087_mm256_permutexvar_pd (__m256i __X, __m256d __Y)7766_mm256_permutexvar_pd(__m256i __X, __m256d __Y) {
8088{
8089 return (__m256d)__builtin_ia32_permvardf256((__v4df)__Y, (__v4di)__X);7767 return (__m256d)__builtin_ia32_permvardf256((__v4df)__Y, (__v4di)__X);
8090}7768}
80917769
8092static __inline__ __m256d __DEFAULT_FN_ATTRS2567770static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
8093_mm256_mask_permutexvar_pd (__m256d __W, __mmask8 __U, __m256i __X,7771_mm256_mask_permutexvar_pd(__m256d __W, __mmask8 __U, __m256i __X,
8094 __m256d __Y)7772 __m256d __Y) {
8095{
8096 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,7773 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
8097 (__v4df)_mm256_permutexvar_pd(__X, __Y),7774 (__v4df)_mm256_permutexvar_pd(__X, __Y),
8098 (__v4df)__W);7775 (__v4df)__W);
8099}7776}
81007777
8101static __inline__ __m256d __DEFAULT_FN_ATTRS2567778static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
8102_mm256_maskz_permutexvar_pd (__mmask8 __U, __m256i __X, __m256d __Y)7779_mm256_maskz_permutexvar_pd(__mmask8 __U, __m256i __X, __m256d __Y) {
8103{
8104 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,7780 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
8105 (__v4df)_mm256_permutexvar_pd(__X, __Y),7781 (__v4df)_mm256_permutexvar_pd(__X, __Y),
8106 (__v4df)_mm256_setzero_pd());7782 (__v4df)_mm256_setzero_pd());
8107}7783}
81087784
8109static __inline__ __m256i __DEFAULT_FN_ATTRS2567785static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
8110_mm256_permutexvar_epi64 ( __m256i __X, __m256i __Y)7786_mm256_permutexvar_epi64(__m256i __X, __m256i __Y) {
8111{
8112 return (__m256i)__builtin_ia32_permvardi256((__v4di) __Y, (__v4di) __X);7787 return (__m256i)__builtin_ia32_permvardi256((__v4di) __Y, (__v4di) __X);
8113}7788}
81147789
8115static __inline__ __m256i __DEFAULT_FN_ATTRS2567790static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
8116_mm256_maskz_permutexvar_epi64 (__mmask8 __M, __m256i __X, __m256i __Y)7791_mm256_maskz_permutexvar_epi64(__mmask8 __M, __m256i __X, __m256i __Y) {
8117{
8118 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,7792 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
8119 (__v4di)_mm256_permutexvar_epi64(__X, __Y),7793 (__v4di)_mm256_permutexvar_epi64(__X, __Y),
8120 (__v4di)_mm256_setzero_si256());7794 (__v4di)_mm256_setzero_si256());
8121}7795}
81227796
8123static __inline__ __m256i __DEFAULT_FN_ATTRS2567797static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
8124_mm256_mask_permutexvar_epi64 (__m256i __W, __mmask8 __M, __m256i __X,7798_mm256_mask_permutexvar_epi64(__m256i __W, __mmask8 __M, __m256i __X,
8125 __m256i __Y)7799 __m256i __Y) {
8126{
8127 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,7800 return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M,
8128 (__v4di)_mm256_permutexvar_epi64(__X, __Y),7801 (__v4di)_mm256_permutexvar_epi64(__X, __Y),
8129 (__v4di)__W);7802 (__v4di)__W);
...@@ -8131,17 +7804,15 @@ _mm256_mask_permutexvar_epi64 (__m256i __W, __mmask8 __M, __m256i __X,...@@ -8131,17 +7804,15 @@ _mm256_mask_permutexvar_epi64 (__m256i __W, __mmask8 __M, __m256i __X,
81317804
8132#define _mm256_permutexvar_ps(A, B) _mm256_permutevar8x32_ps((B), (A))7805#define _mm256_permutexvar_ps(A, B) _mm256_permutevar8x32_ps((B), (A))
81337806
8134static __inline__ __m256 __DEFAULT_FN_ATTRS2567807static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8135_mm256_mask_permutexvar_ps(__m256 __W, __mmask8 __U, __m256i __X, __m256 __Y)7808_mm256_mask_permutexvar_ps(__m256 __W, __mmask8 __U, __m256i __X, __m256 __Y) {
8136{
8137 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,7809 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
8138 (__v8sf)_mm256_permutexvar_ps(__X, __Y),7810 (__v8sf)_mm256_permutexvar_ps(__X, __Y),
8139 (__v8sf)__W);7811 (__v8sf)__W);
8140}7812}
81417813
8142static __inline__ __m256 __DEFAULT_FN_ATTRS2567814static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8143_mm256_maskz_permutexvar_ps(__mmask8 __U, __m256i __X, __m256 __Y)7815_mm256_maskz_permutexvar_ps(__mmask8 __U, __m256i __X, __m256 __Y) {
8144{
8145 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,7816 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
8146 (__v8sf)_mm256_permutexvar_ps(__X, __Y),7817 (__v8sf)_mm256_permutexvar_ps(__X, __Y),
8147 (__v8sf)_mm256_setzero_ps());7818 (__v8sf)_mm256_setzero_ps());
...@@ -8149,18 +7820,16 @@ _mm256_maskz_permutexvar_ps(__mmask8 __U, __m256i __X, __m256 __Y)...@@ -8149,18 +7820,16 @@ _mm256_maskz_permutexvar_ps(__mmask8 __U, __m256i __X, __m256 __Y)
81497820
8150#define _mm256_permutexvar_epi32(A, B) _mm256_permutevar8x32_epi32((B), (A))7821#define _mm256_permutexvar_epi32(A, B) _mm256_permutevar8x32_epi32((B), (A))
81517822
8152static __inline__ __m256i __DEFAULT_FN_ATTRS2567823static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
8153_mm256_mask_permutexvar_epi32(__m256i __W, __mmask8 __M, __m256i __X,7824_mm256_mask_permutexvar_epi32(__m256i __W, __mmask8 __M, __m256i __X,
8154 __m256i __Y)7825 __m256i __Y) {
8155{
8156 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,7826 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
8157 (__v8si)_mm256_permutexvar_epi32(__X, __Y),7827 (__v8si)_mm256_permutexvar_epi32(__X, __Y),
8158 (__v8si)__W);7828 (__v8si)__W);
8159}7829}
81607830
8161static __inline__ __m256i __DEFAULT_FN_ATTRS2567831static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
8162_mm256_maskz_permutexvar_epi32(__mmask8 __M, __m256i __X, __m256i __Y)7832_mm256_maskz_permutexvar_epi32(__mmask8 __M, __m256i __X, __m256i __Y) {
8163{
8164 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,7833 return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M,
8165 (__v8si)_mm256_permutexvar_epi32(__X, __Y),7834 (__v8si)_mm256_permutexvar_epi32(__X, __Y),
8166 (__v8si)_mm256_setzero_si256());7835 (__v8si)_mm256_setzero_si256());
...@@ -8222,65 +7891,57 @@ _mm256_maskz_permutexvar_epi32(__mmask8 __M, __m256i __X, __m256i __Y)...@@ -8222,65 +7891,57 @@ _mm256_maskz_permutexvar_epi32(__mmask8 __M, __m256i __X, __m256i __Y)
8222 (__v4di)_mm256_alignr_epi64((A), (B), (imm)), \7891 (__v4di)_mm256_alignr_epi64((A), (B), (imm)), \
8223 (__v4di)_mm256_setzero_si256()))7892 (__v4di)_mm256_setzero_si256()))
82247893
8225static __inline__ __m128 __DEFAULT_FN_ATTRS1287894static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8226_mm_mask_movehdup_ps (__m128 __W, __mmask8 __U, __m128 __A)7895_mm_mask_movehdup_ps(__m128 __W, __mmask8 __U, __m128 __A) {
8227{
8228 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,7896 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
8229 (__v4sf)_mm_movehdup_ps(__A),7897 (__v4sf)_mm_movehdup_ps(__A),
8230 (__v4sf)__W);7898 (__v4sf)__W);
8231}7899}
82327900
8233static __inline__ __m128 __DEFAULT_FN_ATTRS1287901static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8234_mm_maskz_movehdup_ps (__mmask8 __U, __m128 __A)7902_mm_maskz_movehdup_ps(__mmask8 __U, __m128 __A) {
8235{
8236 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,7903 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
8237 (__v4sf)_mm_movehdup_ps(__A),7904 (__v4sf)_mm_movehdup_ps(__A),
8238 (__v4sf)_mm_setzero_ps());7905 (__v4sf)_mm_setzero_ps());
8239}7906}
82407907
8241static __inline__ __m256 __DEFAULT_FN_ATTRS2567908static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8242_mm256_mask_movehdup_ps (__m256 __W, __mmask8 __U, __m256 __A)7909_mm256_mask_movehdup_ps(__m256 __W, __mmask8 __U, __m256 __A) {
8243{
8244 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,7910 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
8245 (__v8sf)_mm256_movehdup_ps(__A),7911 (__v8sf)_mm256_movehdup_ps(__A),
8246 (__v8sf)__W);7912 (__v8sf)__W);
8247}7913}
82487914
8249static __inline__ __m256 __DEFAULT_FN_ATTRS2567915static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8250_mm256_maskz_movehdup_ps (__mmask8 __U, __m256 __A)7916_mm256_maskz_movehdup_ps(__mmask8 __U, __m256 __A) {
8251{
8252 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,7917 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
8253 (__v8sf)_mm256_movehdup_ps(__A),7918 (__v8sf)_mm256_movehdup_ps(__A),
8254 (__v8sf)_mm256_setzero_ps());7919 (__v8sf)_mm256_setzero_ps());
8255}7920}
82567921
8257static __inline__ __m128 __DEFAULT_FN_ATTRS1287922static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8258_mm_mask_moveldup_ps (__m128 __W, __mmask8 __U, __m128 __A)7923_mm_mask_moveldup_ps(__m128 __W, __mmask8 __U, __m128 __A) {
8259{
8260 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,7924 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
8261 (__v4sf)_mm_moveldup_ps(__A),7925 (__v4sf)_mm_moveldup_ps(__A),
8262 (__v4sf)__W);7926 (__v4sf)__W);
8263}7927}
82647928
8265static __inline__ __m128 __DEFAULT_FN_ATTRS1287929static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8266_mm_maskz_moveldup_ps (__mmask8 __U, __m128 __A)7930_mm_maskz_moveldup_ps(__mmask8 __U, __m128 __A) {
8267{
8268 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,7931 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
8269 (__v4sf)_mm_moveldup_ps(__A),7932 (__v4sf)_mm_moveldup_ps(__A),
8270 (__v4sf)_mm_setzero_ps());7933 (__v4sf)_mm_setzero_ps());
8271}7934}
82727935
8273static __inline__ __m256 __DEFAULT_FN_ATTRS2567936static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8274_mm256_mask_moveldup_ps (__m256 __W, __mmask8 __U, __m256 __A)7937_mm256_mask_moveldup_ps(__m256 __W, __mmask8 __U, __m256 __A) {
8275{
8276 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,7938 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
8277 (__v8sf)_mm256_moveldup_ps(__A),7939 (__v8sf)_mm256_moveldup_ps(__A),
8278 (__v8sf)__W);7940 (__v8sf)__W);
8279}7941}
82807942
8281static __inline__ __m256 __DEFAULT_FN_ATTRS2567943static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8282_mm256_maskz_moveldup_ps (__mmask8 __U, __m256 __A)7944_mm256_maskz_moveldup_ps(__mmask8 __U, __m256 __A) {
8283{
8284 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,7945 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
8285 (__v8sf)_mm256_moveldup_ps(__A),7946 (__v8sf)_mm256_moveldup_ps(__A),
8286 (__v8sf)_mm256_setzero_ps());7947 (__v8sf)_mm256_setzero_ps());
...@@ -8306,68 +7967,52 @@ _mm256_maskz_moveldup_ps (__mmask8 __U, __m256 __A)...@@ -8306,68 +7967,52 @@ _mm256_maskz_moveldup_ps (__mmask8 __U, __m256 __A)
8306 (__v4si)_mm_shuffle_epi32((A), (I)), \7967 (__v4si)_mm_shuffle_epi32((A), (I)), \
8307 (__v4si)_mm_setzero_si128()))7968 (__v4si)_mm_setzero_si128()))
83087969
8309static __inline__ __m128d __DEFAULT_FN_ATTRS1287970static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
8310_mm_mask_mov_pd (__m128d __W, __mmask8 __U, __m128d __A)7971_mm_mask_mov_pd(__m128d __W, __mmask8 __U, __m128d __A) {
8311{7972 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)__A,
8312 return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U,7973 (__v2df)__W);
8313 (__v2df) __A,
8314 (__v2df) __W);
8315}7974}
83167975
8317static __inline__ __m128d __DEFAULT_FN_ATTRS1287976static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
8318_mm_maskz_mov_pd (__mmask8 __U, __m128d __A)7977_mm_maskz_mov_pd(__mmask8 __U, __m128d __A) {
8319{7978 return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)__A,
8320 return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U,7979 (__v2df)_mm_setzero_pd());
8321 (__v2df) __A,
8322 (__v2df) _mm_setzero_pd ());
8323}7980}
83247981
8325static __inline__ __m256d __DEFAULT_FN_ATTRS2567982static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
8326_mm256_mask_mov_pd (__m256d __W, __mmask8 __U, __m256d __A)7983_mm256_mask_mov_pd(__m256d __W, __mmask8 __U, __m256d __A) {
8327{7984 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)__A,
8328 return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U,7985 (__v4df)__W);
8329 (__v4df) __A,
8330 (__v4df) __W);
8331}7986}
83327987
8333static __inline__ __m256d __DEFAULT_FN_ATTRS2567988static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
8334_mm256_maskz_mov_pd (__mmask8 __U, __m256d __A)7989_mm256_maskz_mov_pd(__mmask8 __U, __m256d __A) {
8335{7990 return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)__A,
8336 return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U,7991 (__v4df)_mm256_setzero_pd());
8337 (__v4df) __A,
8338 (__v4df) _mm256_setzero_pd ());
8339}7992}
83407993
8341static __inline__ __m128 __DEFAULT_FN_ATTRS1287994static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8342_mm_mask_mov_ps (__m128 __W, __mmask8 __U, __m128 __A)7995_mm_mask_mov_ps(__m128 __W, __mmask8 __U, __m128 __A) {
8343{7996 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)__A,
8344 return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U,7997 (__v4sf)__W);
8345 (__v4sf) __A,
8346 (__v4sf) __W);
8347}7998}
83487999
8349static __inline__ __m128 __DEFAULT_FN_ATTRS1288000static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
8350_mm_maskz_mov_ps (__mmask8 __U, __m128 __A)8001_mm_maskz_mov_ps(__mmask8 __U, __m128 __A) {
8351{8002 return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)__A,
8352 return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U,8003 (__v4sf)_mm_setzero_ps());
8353 (__v4sf) __A,
8354 (__v4sf) _mm_setzero_ps ());
8355}8004}
83568005
8357static __inline__ __m256 __DEFAULT_FN_ATTRS2568006static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8358_mm256_mask_mov_ps (__m256 __W, __mmask8 __U, __m256 __A)8007_mm256_mask_mov_ps(__m256 __W, __mmask8 __U, __m256 __A) {
8359{8008 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)__A,
8360 return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U,8009 (__v8sf)__W);
8361 (__v8sf) __A,
8362 (__v8sf) __W);
8363}8010}
83648011
8365static __inline__ __m256 __DEFAULT_FN_ATTRS2568012static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
8366_mm256_maskz_mov_ps (__mmask8 __U, __m256 __A)8013_mm256_maskz_mov_ps(__mmask8 __U, __m256 __A) {
8367{8014 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)__A,
8368 return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U,8015 (__v8sf)_mm256_setzero_ps());
8369 (__v8sf) __A,
8370 (__v8sf) _mm256_setzero_ps ());
8371}8016}
83728017
8373static __inline__ __m128 __DEFAULT_FN_ATTRS1288018static __inline__ __m128 __DEFAULT_FN_ATTRS128
...@@ -8430,8 +8075,9 @@ _mm256_maskz_cvtph_ps (__mmask8 __U, __m128i __A)...@@ -8430,8 +8075,9 @@ _mm256_maskz_cvtph_ps (__mmask8 __U, __m128i __A)
8430#define _mm256_mask_cvtps_ph _mm256_mask_cvt_roundps_ph8075#define _mm256_mask_cvtps_ph _mm256_mask_cvt_roundps_ph
8431#define _mm256_maskz_cvtps_ph _mm256_maskz_cvt_roundps_ph8076#define _mm256_maskz_cvtps_ph _mm256_maskz_cvt_roundps_ph
84328077
8433
8434#undef __DEFAULT_FN_ATTRS1288078#undef __DEFAULT_FN_ATTRS128
8435#undef __DEFAULT_FN_ATTRS2568079#undef __DEFAULT_FN_ATTRS256
8080#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
8081#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
84368082
8437#endif /* __AVX512VLINTRIN_H */8083#endif /* __AVX512VLINTRIN_H */
lib/include/avx512vlvbmi2intrin.h+78-63
...@@ -17,13 +17,21 @@...@@ -17,13 +17,21 @@
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512vbmi2,no-evex512"), \20 __target__("avx512vl,avx512vbmi2"), \
21 __min_vector_width__(128)))21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \23 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512vbmi2,no-evex512"), \24 __target__("avx512vl,avx512vbmi2"), \
25 __min_vector_width__(256)))25 __min_vector_width__(256)))
2626
27#if defined(__cplusplus) && (__cplusplus >= 201103L)
28#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
29#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
30#else
31#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
32#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
33#endif
34
27static __inline__ __m128i __DEFAULT_FN_ATTRS12835static __inline__ __m128i __DEFAULT_FN_ATTRS128
28_mm_mask_compress_epi16(__m128i __S, __mmask8 __U, __m128i __D)36_mm_mask_compress_epi16(__m128i __S, __mmask8 __U, __m128i __D)
29{37{
...@@ -412,14 +420,14 @@ _mm256_maskz_expandloadu_epi8(__mmask32 __U, void const *__P)...@@ -412,14 +420,14 @@ _mm256_maskz_expandloadu_epi8(__mmask32 __U, void const *__P)
412 (__v8hi)_mm_shrdi_epi16((A), (B), (I)), \420 (__v8hi)_mm_shrdi_epi16((A), (B), (I)), \
413 (__v8hi)_mm_setzero_si128()))421 (__v8hi)_mm_setzero_si128()))
414422
415static __inline__ __m256i __DEFAULT_FN_ATTRS256423static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
416_mm256_shldv_epi64(__m256i __A, __m256i __B, __m256i __C)424_mm256_shldv_epi64(__m256i __A, __m256i __B, __m256i __C)
417{425{
418 return (__m256i)__builtin_ia32_vpshldvq256((__v4di)__A, (__v4di)__B,426 return (__m256i)__builtin_elementwise_fshl((__v4du)__A, (__v4du)__B,
419 (__v4di)__C);427 (__v4du)__C);
420}428}
421429
422static __inline__ __m256i __DEFAULT_FN_ATTRS256430static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
423_mm256_mask_shldv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)431_mm256_mask_shldv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
424{432{
425 return (__m256i)__builtin_ia32_selectq_256(__U,433 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -427,7 +435,7 @@ _mm256_mask_shldv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)...@@ -427,7 +435,7 @@ _mm256_mask_shldv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
427 (__v4di)__A);435 (__v4di)__A);
428}436}
429437
430static __inline__ __m256i __DEFAULT_FN_ATTRS256438static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
431_mm256_maskz_shldv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)439_mm256_maskz_shldv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
432{440{
433 return (__m256i)__builtin_ia32_selectq_256(__U,441 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -435,14 +443,14 @@ _mm256_maskz_shldv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)...@@ -435,14 +443,14 @@ _mm256_maskz_shldv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
435 (__v4di)_mm256_setzero_si256());443 (__v4di)_mm256_setzero_si256());
436}444}
437445
438static __inline__ __m128i __DEFAULT_FN_ATTRS128446static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
439_mm_shldv_epi64(__m128i __A, __m128i __B, __m128i __C)447_mm_shldv_epi64(__m128i __A, __m128i __B, __m128i __C)
440{448{
441 return (__m128i)__builtin_ia32_vpshldvq128((__v2di)__A, (__v2di)__B,449 return (__m128i)__builtin_elementwise_fshl((__v2du)__A, (__v2du)__B,
442 (__v2di)__C);450 (__v2du)__C);
443}451}
444452
445static __inline__ __m128i __DEFAULT_FN_ATTRS128453static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
446_mm_mask_shldv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)454_mm_mask_shldv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
447{455{
448 return (__m128i)__builtin_ia32_selectq_128(__U,456 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -450,7 +458,7 @@ _mm_mask_shldv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)...@@ -450,7 +458,7 @@ _mm_mask_shldv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
450 (__v2di)__A);458 (__v2di)__A);
451}459}
452460
453static __inline__ __m128i __DEFAULT_FN_ATTRS128461static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
454_mm_maskz_shldv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)462_mm_maskz_shldv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
455{463{
456 return (__m128i)__builtin_ia32_selectq_128(__U,464 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -458,14 +466,14 @@ _mm_maskz_shldv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)...@@ -458,14 +466,14 @@ _mm_maskz_shldv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
458 (__v2di)_mm_setzero_si128());466 (__v2di)_mm_setzero_si128());
459}467}
460468
461static __inline__ __m256i __DEFAULT_FN_ATTRS256469static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
462_mm256_shldv_epi32(__m256i __A, __m256i __B, __m256i __C)470_mm256_shldv_epi32(__m256i __A, __m256i __B, __m256i __C)
463{471{
464 return (__m256i)__builtin_ia32_vpshldvd256((__v8si)__A, (__v8si)__B,472 return (__m256i)__builtin_elementwise_fshl((__v8su)__A, (__v8su)__B,
465 (__v8si)__C);473 (__v8su)__C);
466}474}
467475
468static __inline__ __m256i __DEFAULT_FN_ATTRS256476static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
469_mm256_mask_shldv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)477_mm256_mask_shldv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
470{478{
471 return (__m256i)__builtin_ia32_selectd_256(__U,479 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -473,7 +481,7 @@ _mm256_mask_shldv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)...@@ -473,7 +481,7 @@ _mm256_mask_shldv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
473 (__v8si)__A);481 (__v8si)__A);
474}482}
475483
476static __inline__ __m256i __DEFAULT_FN_ATTRS256484static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
477_mm256_maskz_shldv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)485_mm256_maskz_shldv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
478{486{
479 return (__m256i)__builtin_ia32_selectd_256(__U,487 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -481,14 +489,14 @@ _mm256_maskz_shldv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)...@@ -481,14 +489,14 @@ _mm256_maskz_shldv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
481 (__v8si)_mm256_setzero_si256());489 (__v8si)_mm256_setzero_si256());
482}490}
483491
484static __inline__ __m128i __DEFAULT_FN_ATTRS128492static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
485_mm_shldv_epi32(__m128i __A, __m128i __B, __m128i __C)493_mm_shldv_epi32(__m128i __A, __m128i __B, __m128i __C)
486{494{
487 return (__m128i)__builtin_ia32_vpshldvd128((__v4si)__A, (__v4si)__B,495 return (__m128i)__builtin_elementwise_fshl((__v4su)__A, (__v4su)__B,
488 (__v4si)__C);496 (__v4su)__C);
489}497}
490498
491static __inline__ __m128i __DEFAULT_FN_ATTRS128499static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
492_mm_mask_shldv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)500_mm_mask_shldv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
493{501{
494 return (__m128i)__builtin_ia32_selectd_128(__U,502 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -496,7 +504,7 @@ _mm_mask_shldv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)...@@ -496,7 +504,7 @@ _mm_mask_shldv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
496 (__v4si)__A);504 (__v4si)__A);
497}505}
498506
499static __inline__ __m128i __DEFAULT_FN_ATTRS128507static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
500_mm_maskz_shldv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)508_mm_maskz_shldv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
501{509{
502 return (__m128i)__builtin_ia32_selectd_128(__U,510 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -504,14 +512,14 @@ _mm_maskz_shldv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)...@@ -504,14 +512,14 @@ _mm_maskz_shldv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
504 (__v4si)_mm_setzero_si128());512 (__v4si)_mm_setzero_si128());
505}513}
506514
507static __inline__ __m256i __DEFAULT_FN_ATTRS256515static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
508_mm256_shldv_epi16(__m256i __A, __m256i __B, __m256i __C)516_mm256_shldv_epi16(__m256i __A, __m256i __B, __m256i __C)
509{517{
510 return (__m256i)__builtin_ia32_vpshldvw256((__v16hi)__A, (__v16hi)__B,518 return (__m256i)__builtin_elementwise_fshl((__v16hu)__A, (__v16hu)__B,
511 (__v16hi)__C);519 (__v16hu)__C);
512}520}
513521
514static __inline__ __m256i __DEFAULT_FN_ATTRS256522static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
515_mm256_mask_shldv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)523_mm256_mask_shldv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)
516{524{
517 return (__m256i)__builtin_ia32_selectw_256(__U,525 return (__m256i)__builtin_ia32_selectw_256(__U,
...@@ -519,7 +527,7 @@ _mm256_mask_shldv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)...@@ -519,7 +527,7 @@ _mm256_mask_shldv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)
519 (__v16hi)__A);527 (__v16hi)__A);
520}528}
521529
522static __inline__ __m256i __DEFAULT_FN_ATTRS256530static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
523_mm256_maskz_shldv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)531_mm256_maskz_shldv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)
524{532{
525 return (__m256i)__builtin_ia32_selectw_256(__U,533 return (__m256i)__builtin_ia32_selectw_256(__U,
...@@ -527,14 +535,14 @@ _mm256_maskz_shldv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)...@@ -527,14 +535,14 @@ _mm256_maskz_shldv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)
527 (__v16hi)_mm256_setzero_si256());535 (__v16hi)_mm256_setzero_si256());
528}536}
529537
530static __inline__ __m128i __DEFAULT_FN_ATTRS128538static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
531_mm_shldv_epi16(__m128i __A, __m128i __B, __m128i __C)539_mm_shldv_epi16(__m128i __A, __m128i __B, __m128i __C)
532{540{
533 return (__m128i)__builtin_ia32_vpshldvw128((__v8hi)__A, (__v8hi)__B,541 return (__m128i)__builtin_elementwise_fshl((__v8hu)__A, (__v8hu)__B,
534 (__v8hi)__C);542 (__v8hu)__C);
535}543}
536544
537static __inline__ __m128i __DEFAULT_FN_ATTRS128545static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
538_mm_mask_shldv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)546_mm_mask_shldv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
539{547{
540 return (__m128i)__builtin_ia32_selectw_128(__U,548 return (__m128i)__builtin_ia32_selectw_128(__U,
...@@ -542,7 +550,7 @@ _mm_mask_shldv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)...@@ -542,7 +550,7 @@ _mm_mask_shldv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
542 (__v8hi)__A);550 (__v8hi)__A);
543}551}
544552
545static __inline__ __m128i __DEFAULT_FN_ATTRS128553static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
546_mm_maskz_shldv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)554_mm_maskz_shldv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
547{555{
548 return (__m128i)__builtin_ia32_selectw_128(__U,556 return (__m128i)__builtin_ia32_selectw_128(__U,
...@@ -550,14 +558,15 @@ _mm_maskz_shldv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)...@@ -550,14 +558,15 @@ _mm_maskz_shldv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
550 (__v8hi)_mm_setzero_si128());558 (__v8hi)_mm_setzero_si128());
551}559}
552560
553static __inline__ __m256i __DEFAULT_FN_ATTRS256561static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
554_mm256_shrdv_epi64(__m256i __A, __m256i __B, __m256i __C)562_mm256_shrdv_epi64(__m256i __A, __m256i __B, __m256i __C)
555{563{
556 return (__m256i)__builtin_ia32_vpshrdvq256((__v4di)__A, (__v4di)__B,564 // Ops __A and __B are swapped.
557 (__v4di)__C);565 return (__m256i)__builtin_elementwise_fshr((__v4du)__B, (__v4du)__A,
566 (__v4du)__C);
558}567}
559568
560static __inline__ __m256i __DEFAULT_FN_ATTRS256569static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
561_mm256_mask_shrdv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)570_mm256_mask_shrdv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
562{571{
563 return (__m256i)__builtin_ia32_selectq_256(__U,572 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -565,7 +574,7 @@ _mm256_mask_shrdv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)...@@ -565,7 +574,7 @@ _mm256_mask_shrdv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
565 (__v4di)__A);574 (__v4di)__A);
566}575}
567576
568static __inline__ __m256i __DEFAULT_FN_ATTRS256577static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
569_mm256_maskz_shrdv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)578_mm256_maskz_shrdv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
570{579{
571 return (__m256i)__builtin_ia32_selectq_256(__U,580 return (__m256i)__builtin_ia32_selectq_256(__U,
...@@ -573,14 +582,15 @@ _mm256_maskz_shrdv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)...@@ -573,14 +582,15 @@ _mm256_maskz_shrdv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
573 (__v4di)_mm256_setzero_si256());582 (__v4di)_mm256_setzero_si256());
574}583}
575584
576static __inline__ __m128i __DEFAULT_FN_ATTRS128585static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
577_mm_shrdv_epi64(__m128i __A, __m128i __B, __m128i __C)586_mm_shrdv_epi64(__m128i __A, __m128i __B, __m128i __C)
578{587{
579 return (__m128i)__builtin_ia32_vpshrdvq128((__v2di)__A, (__v2di)__B,588 // Ops __A and __B are swapped.
580 (__v2di)__C);589 return (__m128i)__builtin_elementwise_fshr((__v2du)__B, (__v2du)__A,
590 (__v2du)__C);
581}591}
582592
583static __inline__ __m128i __DEFAULT_FN_ATTRS128593static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
584_mm_mask_shrdv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)594_mm_mask_shrdv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
585{595{
586 return (__m128i)__builtin_ia32_selectq_128(__U,596 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -588,7 +598,7 @@ _mm_mask_shrdv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)...@@ -588,7 +598,7 @@ _mm_mask_shrdv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
588 (__v2di)__A);598 (__v2di)__A);
589}599}
590600
591static __inline__ __m128i __DEFAULT_FN_ATTRS128601static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
592_mm_maskz_shrdv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)602_mm_maskz_shrdv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
593{603{
594 return (__m128i)__builtin_ia32_selectq_128(__U,604 return (__m128i)__builtin_ia32_selectq_128(__U,
...@@ -596,14 +606,15 @@ _mm_maskz_shrdv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)...@@ -596,14 +606,15 @@ _mm_maskz_shrdv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
596 (__v2di)_mm_setzero_si128());606 (__v2di)_mm_setzero_si128());
597}607}
598608
599static __inline__ __m256i __DEFAULT_FN_ATTRS256609static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
600_mm256_shrdv_epi32(__m256i __A, __m256i __B, __m256i __C)610_mm256_shrdv_epi32(__m256i __A, __m256i __B, __m256i __C)
601{611{
602 return (__m256i)__builtin_ia32_vpshrdvd256((__v8si)__A, (__v8si)__B,612 // Ops __A and __B are swapped.
603 (__v8si)__C);613 return (__m256i)__builtin_elementwise_fshr((__v8su)__B, (__v8su)__A,
614 (__v8su)__C);
604}615}
605616
606static __inline__ __m256i __DEFAULT_FN_ATTRS256617static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
607_mm256_mask_shrdv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)618_mm256_mask_shrdv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
608{619{
609 return (__m256i)__builtin_ia32_selectd_256(__U,620 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -611,7 +622,7 @@ _mm256_mask_shrdv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)...@@ -611,7 +622,7 @@ _mm256_mask_shrdv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
611 (__v8si)__A);622 (__v8si)__A);
612}623}
613624
614static __inline__ __m256i __DEFAULT_FN_ATTRS256625static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
615_mm256_maskz_shrdv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)626_mm256_maskz_shrdv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
616{627{
617 return (__m256i)__builtin_ia32_selectd_256(__U,628 return (__m256i)__builtin_ia32_selectd_256(__U,
...@@ -619,14 +630,15 @@ _mm256_maskz_shrdv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)...@@ -619,14 +630,15 @@ _mm256_maskz_shrdv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
619 (__v8si)_mm256_setzero_si256());630 (__v8si)_mm256_setzero_si256());
620}631}
621632
622static __inline__ __m128i __DEFAULT_FN_ATTRS128633static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
623_mm_shrdv_epi32(__m128i __A, __m128i __B, __m128i __C)634_mm_shrdv_epi32(__m128i __A, __m128i __B, __m128i __C)
624{635{
625 return (__m128i)__builtin_ia32_vpshrdvd128((__v4si)__A, (__v4si)__B,636 // Ops __A and __B are swapped.
626 (__v4si)__C);637 return (__m128i)__builtin_elementwise_fshr((__v4su)__B, (__v4su)__A,
638 (__v4su)__C);
627}639}
628640
629static __inline__ __m128i __DEFAULT_FN_ATTRS128641static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
630_mm_mask_shrdv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)642_mm_mask_shrdv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
631{643{
632 return (__m128i)__builtin_ia32_selectd_128(__U,644 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -634,7 +646,7 @@ _mm_mask_shrdv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)...@@ -634,7 +646,7 @@ _mm_mask_shrdv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
634 (__v4si)__A);646 (__v4si)__A);
635}647}
636648
637static __inline__ __m128i __DEFAULT_FN_ATTRS128649static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
638_mm_maskz_shrdv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)650_mm_maskz_shrdv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
639{651{
640 return (__m128i)__builtin_ia32_selectd_128(__U,652 return (__m128i)__builtin_ia32_selectd_128(__U,
...@@ -642,14 +654,15 @@ _mm_maskz_shrdv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)...@@ -642,14 +654,15 @@ _mm_maskz_shrdv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
642 (__v4si)_mm_setzero_si128());654 (__v4si)_mm_setzero_si128());
643}655}
644656
645static __inline__ __m256i __DEFAULT_FN_ATTRS256657static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
646_mm256_shrdv_epi16(__m256i __A, __m256i __B, __m256i __C)658_mm256_shrdv_epi16(__m256i __A, __m256i __B, __m256i __C)
647{659{
648 return (__m256i)__builtin_ia32_vpshrdvw256((__v16hi)__A, (__v16hi)__B,660 // Ops __A and __B are swapped.
649 (__v16hi)__C);661 return (__m256i)__builtin_elementwise_fshr((__v16hu)__B, (__v16hu)__A,
662 (__v16hu)__C);
650}663}
651664
652static __inline__ __m256i __DEFAULT_FN_ATTRS256665static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
653_mm256_mask_shrdv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)666_mm256_mask_shrdv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)
654{667{
655 return (__m256i)__builtin_ia32_selectw_256(__U,668 return (__m256i)__builtin_ia32_selectw_256(__U,
...@@ -657,7 +670,7 @@ _mm256_mask_shrdv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)...@@ -657,7 +670,7 @@ _mm256_mask_shrdv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)
657 (__v16hi)__A);670 (__v16hi)__A);
658}671}
659672
660static __inline__ __m256i __DEFAULT_FN_ATTRS256673static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
661_mm256_maskz_shrdv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)674_mm256_maskz_shrdv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)
662{675{
663 return (__m256i)__builtin_ia32_selectw_256(__U,676 return (__m256i)__builtin_ia32_selectw_256(__U,
...@@ -665,14 +678,15 @@ _mm256_maskz_shrdv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)...@@ -665,14 +678,15 @@ _mm256_maskz_shrdv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)
665 (__v16hi)_mm256_setzero_si256());678 (__v16hi)_mm256_setzero_si256());
666}679}
667680
668static __inline__ __m128i __DEFAULT_FN_ATTRS128681static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
669_mm_shrdv_epi16(__m128i __A, __m128i __B, __m128i __C)682_mm_shrdv_epi16(__m128i __A, __m128i __B, __m128i __C)
670{683{
671 return (__m128i)__builtin_ia32_vpshrdvw128((__v8hi)__A, (__v8hi)__B,684 // Ops __A and __B are swapped.
672 (__v8hi)__C);685 return (__m128i)__builtin_elementwise_fshr((__v8hu)__B, (__v8hu)__A,
686 (__v8hu)__C);
673}687}
674688
675static __inline__ __m128i __DEFAULT_FN_ATTRS128689static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
676_mm_mask_shrdv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)690_mm_mask_shrdv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
677{691{
678 return (__m128i)__builtin_ia32_selectw_128(__U,692 return (__m128i)__builtin_ia32_selectw_128(__U,
...@@ -680,7 +694,7 @@ _mm_mask_shrdv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)...@@ -680,7 +694,7 @@ _mm_mask_shrdv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
680 (__v8hi)__A);694 (__v8hi)__A);
681}695}
682696
683static __inline__ __m128i __DEFAULT_FN_ATTRS128697static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
684_mm_maskz_shrdv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)698_mm_maskz_shrdv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
685{699{
686 return (__m128i)__builtin_ia32_selectw_128(__U,700 return (__m128i)__builtin_ia32_selectw_128(__U,
...@@ -688,8 +702,9 @@ _mm_maskz_shrdv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)...@@ -688,8 +702,9 @@ _mm_maskz_shrdv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
688 (__v8hi)_mm_setzero_si128());702 (__v8hi)_mm_setzero_si128());
689}703}
690704
691
692#undef __DEFAULT_FN_ATTRS128705#undef __DEFAULT_FN_ATTRS128
693#undef __DEFAULT_FN_ATTRS256706#undef __DEFAULT_FN_ATTRS256
707#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
708#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
694709
695#endif710#endif
lib/include/avx512vlvnniintrin.h+21-18
...@@ -17,11 +17,11 @@...@@ -17,11 +17,11 @@
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS128 \18#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512vnni,no-evex512"), \20 __target__("avx512vl,avx512vnni"), \
21 __min_vector_width__(128)))21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \23 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512vnni,no-evex512"), \24 __target__("avx512vl,avx512vnni"), \
25 __min_vector_width__(256)))25 __min_vector_width__(256)))
2626
27/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with27/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
...@@ -41,8 +41,8 @@...@@ -41,8 +41,8 @@
41/// ENDFOR41/// ENDFOR
42/// DST[MAX:256] := 042/// DST[MAX:256] := 0
43/// \endcode43/// \endcode
44#define _mm256_dpbusd_epi32(S, A, B) \44#define _mm256_dpbusd_epi32(S, A, B) \
45 ((__m256i)__builtin_ia32_vpdpbusd256((__v8si)(S), (__v8si)(A), (__v8si)(B)))45 ((__m256i)__builtin_ia32_vpdpbusd256((__v8si)(S), (__v32qu)(A), (__v32qi)(B)))
4646
47/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with47/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
48/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed48/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
...@@ -61,8 +61,9 @@...@@ -61,8 +61,9 @@
61/// ENDFOR61/// ENDFOR
62/// DST[MAX:256] := 062/// DST[MAX:256] := 0
63/// \endcode63/// \endcode
64#define _mm256_dpbusds_epi32(S, A, B) \64#define _mm256_dpbusds_epi32(S, A, B) \
65 ((__m256i)__builtin_ia32_vpdpbusds256((__v8si)(S), (__v8si)(A), (__v8si)(B)))65 ((__m256i)__builtin_ia32_vpdpbusds256((__v8si)(S), (__v32qu)(A), \
66 (__v32qi)(B)))
6667
67/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with68/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
68/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit69/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
...@@ -79,8 +80,8 @@...@@ -79,8 +80,8 @@
79/// ENDFOR80/// ENDFOR
80/// DST[MAX:256] := 081/// DST[MAX:256] := 0
81/// \endcode82/// \endcode
82#define _mm256_dpwssd_epi32(S, A, B) \83#define _mm256_dpwssd_epi32(S, A, B) \
83 ((__m256i)__builtin_ia32_vpdpwssd256((__v8si)(S), (__v8si)(A), (__v8si)(B)))84 ((__m256i)__builtin_ia32_vpdpwssd256((__v8si)(S), (__v16hi)(A), (__v16hi)(B)))
8485
85/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with86/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
86/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit87/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
...@@ -97,8 +98,9 @@...@@ -97,8 +98,9 @@
97/// ENDFOR98/// ENDFOR
98/// DST[MAX:256] := 099/// DST[MAX:256] := 0
99/// \endcode100/// \endcode
100#define _mm256_dpwssds_epi32(S, A, B) \101#define _mm256_dpwssds_epi32(S, A, B) \
101 ((__m256i)__builtin_ia32_vpdpwssds256((__v8si)(S), (__v8si)(A), (__v8si)(B)))102 ((__m256i)__builtin_ia32_vpdpwssds256((__v8si)(S), (__v16hi)(A), \
103 (__v16hi)(B)))
102104
103/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with105/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
104/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed106/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
...@@ -117,8 +119,8 @@...@@ -117,8 +119,8 @@
117/// ENDFOR119/// ENDFOR
118/// DST[MAX:128] := 0120/// DST[MAX:128] := 0
119/// \endcode121/// \endcode
120#define _mm_dpbusd_epi32(S, A, B) \122#define _mm_dpbusd_epi32(S, A, B) \
121 ((__m128i)__builtin_ia32_vpdpbusd128((__v4si)(S), (__v4si)(A), (__v4si)(B)))123 ((__m128i)__builtin_ia32_vpdpbusd128((__v4si)(S), (__v16qu)(A), (__v16qi)(B)))
122124
123/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with125/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
124/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed126/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
...@@ -137,8 +139,9 @@...@@ -137,8 +139,9 @@
137/// ENDFOR139/// ENDFOR
138/// DST[MAX:128] := 0140/// DST[MAX:128] := 0
139/// \endcode141/// \endcode
140#define _mm_dpbusds_epi32(S, A, B) \142#define _mm_dpbusds_epi32(S, A, B) \
141 ((__m128i)__builtin_ia32_vpdpbusds128((__v4si)(S), (__v4si)(A), (__v4si)(B)))143 ((__m128i)__builtin_ia32_vpdpbusds128((__v4si)(S), (__v16qu)(A), \
144 (__v16qi)(B)))
142145
143/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with146/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
144/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit147/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
...@@ -155,8 +158,8 @@...@@ -155,8 +158,8 @@
155/// ENDFOR158/// ENDFOR
156/// DST[MAX:128] := 0159/// DST[MAX:128] := 0
157/// \endcode160/// \endcode
158#define _mm_dpwssd_epi32(S, A, B) \161#define _mm_dpwssd_epi32(S, A, B) \
159 ((__m128i)__builtin_ia32_vpdpwssd128((__v4si)(S), (__v4si)(A), (__v4si)(B)))162 ((__m128i)__builtin_ia32_vpdpwssd128((__v4si)(S), (__v8hi)(A), (__v8hi)(B)))
160163
161/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with164/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
162/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit165/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
...@@ -173,8 +176,8 @@...@@ -173,8 +176,8 @@
173/// ENDFOR176/// ENDFOR
174/// DST[MAX:128] := 0177/// DST[MAX:128] := 0
175/// \endcode178/// \endcode
176#define _mm_dpwssds_epi32(S, A, B) \179#define _mm_dpwssds_epi32(S, A, B) \
177 ((__m128i)__builtin_ia32_vpdpwssds128((__v4si)(S), (__v4si)(A), (__v4si)(B)))180 ((__m128i)__builtin_ia32_vpdpwssds128((__v4si)(S), (__v8hi)(A), (__v8hi)(B)))
178181
179static __inline__ __m256i __DEFAULT_FN_ATTRS256182static __inline__ __m256i __DEFAULT_FN_ATTRS256
180_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)183_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
lib/include/avx512vlvp2intersectintrin.h+2-2
...@@ -30,12 +30,12 @@...@@ -30,12 +30,12 @@
3030
31#define __DEFAULT_FN_ATTRS128 \31#define __DEFAULT_FN_ATTRS128 \
32 __attribute__((__always_inline__, __nodebug__, \32 __attribute__((__always_inline__, __nodebug__, \
33 __target__("avx512vl,avx512vp2intersect,no-evex512"), \33 __target__("avx512vl,avx512vp2intersect"), \
34 __min_vector_width__(128)))34 __min_vector_width__(128)))
3535
36#define __DEFAULT_FN_ATTRS256 \36#define __DEFAULT_FN_ATTRS256 \
37 __attribute__((__always_inline__, __nodebug__, \37 __attribute__((__always_inline__, __nodebug__, \
38 __target__("avx512vl,avx512vp2intersect,no-evex512"), \38 __target__("avx512vl,avx512vp2intersect"), \
39 __min_vector_width__(256)))39 __min_vector_width__(256)))
40/// Store, in an even/odd pair of mask registers, the indicators of the40/// Store, in an even/odd pair of mask registers, the indicators of the
41/// locations of value matches between dwords in operands __a and __b.41/// locations of value matches between dwords in operands __a and __b.
lib/include/avx512vnniintrin.h+10-10
...@@ -16,14 +16,14 @@...@@ -16,14 +16,14 @@
1616
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS \18#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, \19 __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"), \
20 __target__("avx512vnni,evex512"), __min_vector_width__(512)))20 __min_vector_width__(512)))
2121
22static __inline__ __m512i __DEFAULT_FN_ATTRS22static __inline__ __m512i __DEFAULT_FN_ATTRS
23_mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B)23_mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B)
24{24{
25 return (__m512i)__builtin_ia32_vpdpbusd512((__v16si)__S, (__v16si)__A,25 return (__m512i)__builtin_ia32_vpdpbusd512((__v16si)__S, (__v64qu)__A,
26 (__v16si)__B);26 (__v64qi)__B);
27}27}
2828
29static __inline__ __m512i __DEFAULT_FN_ATTRS29static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -45,8 +45,8 @@ _mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)...@@ -45,8 +45,8 @@ _mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
45static __inline__ __m512i __DEFAULT_FN_ATTRS45static __inline__ __m512i __DEFAULT_FN_ATTRS
46_mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B)46_mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B)
47{47{
48 return (__m512i)__builtin_ia32_vpdpbusds512((__v16si)__S, (__v16si)__A,48 return (__m512i)__builtin_ia32_vpdpbusds512((__v16si)__S, (__v64qu)__A,
49 (__v16si)__B);49 (__v64qi)__B);
50}50}
5151
52static __inline__ __m512i __DEFAULT_FN_ATTRS52static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -68,8 +68,8 @@ _mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)...@@ -68,8 +68,8 @@ _mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
68static __inline__ __m512i __DEFAULT_FN_ATTRS68static __inline__ __m512i __DEFAULT_FN_ATTRS
69_mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B)69_mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B)
70{70{
71 return (__m512i)__builtin_ia32_vpdpwssd512((__v16si)__S, (__v16si)__A,71 return (__m512i)__builtin_ia32_vpdpwssd512((__v16si)__S, (__v32hi)__A,
72 (__v16si)__B);72 (__v32hi)__B);
73}73}
7474
75static __inline__ __m512i __DEFAULT_FN_ATTRS75static __inline__ __m512i __DEFAULT_FN_ATTRS
...@@ -91,8 +91,8 @@ _mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)...@@ -91,8 +91,8 @@ _mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
91static __inline__ __m512i __DEFAULT_FN_ATTRS91static __inline__ __m512i __DEFAULT_FN_ATTRS
92_mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B)92_mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B)
93{93{
94 return (__m512i)__builtin_ia32_vpdpwssds512((__v16si)__S, (__v16si)__A,94 return (__m512i)__builtin_ia32_vpdpwssds512((__v16si)__S, (__v32hi)__A,
95 (__v16si)__B);95 (__v32hi)__B);
96}96}
9797
98static __inline__ __m512i __DEFAULT_FN_ATTRS98static __inline__ __m512i __DEFAULT_FN_ATTRS
lib/include/avx512vp2intersectintrin.h+1-2
...@@ -30,8 +30,7 @@...@@ -30,8 +30,7 @@
3030
31#define __DEFAULT_FN_ATTRS \31#define __DEFAULT_FN_ATTRS \
32 __attribute__((__always_inline__, __nodebug__, \32 __attribute__((__always_inline__, __nodebug__, \
33 __target__("avx512vp2intersect,evex512"), \33 __target__("avx512vp2intersect"), __min_vector_width__(512)))
34 __min_vector_width__(512)))
3534
36/// Store, in an even/odd pair of mask registers, the indicators of the35/// Store, in an even/odd pair of mask registers, the indicators of the
37/// locations of value matches between dwords in operands __a and __b.36/// locations of value matches between dwords in operands __a and __b.
lib/include/avx512vpopcntdqintrin.h+8-10
...@@ -16,19 +16,18 @@...@@ -16,19 +16,18 @@
16#define __AVX512VPOPCNTDQINTRIN_H16#define __AVX512VPOPCNTDQINTRIN_H
1717
18/* Define the default attributes for the functions in this file. */18/* Define the default attributes for the functions in this file. */
19#if defined(__cplusplus) && (__cplusplus >= 201103L)
19#define __DEFAULT_FN_ATTRS \20#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, \21 __attribute__((__always_inline__, __nodebug__, \
21 __target__("avx512vpopcntdq,evex512"), \22 __target__("avx512vpopcntdq"), \
22 __min_vector_width__(512)))23 __min_vector_width__(512))) constexpr
23
24#if defined(__cplusplus) && (__cplusplus >= 201103L)
25#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
26#else24#else
27#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS25#define __DEFAULT_FN_ATTRS \
26 __attribute__((__always_inline__, __nodebug__, \
27 __target__("avx512vpopcntdq"), __min_vector_width__(512)))
28#endif28#endif
2929
30static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR30static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi64(__m512i __A) {
31_mm512_popcnt_epi64(__m512i __A) {
32 return (__m512i)__builtin_elementwise_popcount((__v8du)__A);31 return (__m512i)__builtin_elementwise_popcount((__v8du)__A);
33}32}
3433
...@@ -43,8 +42,7 @@ _mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) {...@@ -43,8 +42,7 @@ _mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) {
43 return _mm512_mask_popcnt_epi64((__m512i)_mm512_setzero_si512(), __U, __A);42 return _mm512_mask_popcnt_epi64((__m512i)_mm512_setzero_si512(), __U, __A);
44}43}
4544
46static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR45static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi32(__m512i __A) {
47_mm512_popcnt_epi32(__m512i __A) {
48 return (__m512i)__builtin_elementwise_popcount((__v16su)__A);46 return (__m512i)__builtin_elementwise_popcount((__v16su)__A);
49}47}
5048
lib/include/avx512vpopcntdqvlintrin.h+17-15
...@@ -16,25 +16,28 @@...@@ -16,25 +16,28 @@
16#define __AVX512VPOPCNTDQVLINTRIN_H16#define __AVX512VPOPCNTDQVLINTRIN_H
1717
18/* Define the default attributes for the functions in this file. */18/* Define the default attributes for the functions in this file. */
19
20#if defined(__cplusplus) && (__cplusplus >= 201103L)
21#define __DEFAULT_FN_ATTRS128 \
22 __attribute__((__always_inline__, __nodebug__, \
23 __target__("avx512vpopcntdq,avx512vl"), \
24 __min_vector_width__(128))) constexpr
25#define __DEFAULT_FN_ATTRS256 \
26 __attribute__((__always_inline__, __nodebug__, \
27 __target__("avx512vpopcntdq,avx512vl"), \
28 __min_vector_width__(256))) constexpr
29#else
19#define __DEFAULT_FN_ATTRS128 \30#define __DEFAULT_FN_ATTRS128 \
20 __attribute__((__always_inline__, __nodebug__, \31 __attribute__((__always_inline__, __nodebug__, \
21 __target__("avx512vpopcntdq,avx512vl,no-evex512"), \32 __target__("avx512vpopcntdq,avx512vl"), \
22 __min_vector_width__(128)))33 __min_vector_width__(128)))
23#define __DEFAULT_FN_ATTRS256 \34#define __DEFAULT_FN_ATTRS256 \
24 __attribute__((__always_inline__, __nodebug__, \35 __attribute__((__always_inline__, __nodebug__, \
25 __target__("avx512vpopcntdq,avx512vl,no-evex512"), \36 __target__("avx512vpopcntdq,avx512vl"), \
26 __min_vector_width__(256)))37 __min_vector_width__(256)))
27
28#if defined(__cplusplus) && (__cplusplus >= 201103L)
29#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
30#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
31#else
32#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
33#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
34#endif38#endif
3539
36static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR40static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_popcnt_epi64(__m128i __A) {
37_mm_popcnt_epi64(__m128i __A) {
38 return (__m128i)__builtin_elementwise_popcount((__v2du)__A);41 return (__m128i)__builtin_elementwise_popcount((__v2du)__A);
39}42}
4043
...@@ -49,8 +52,7 @@ _mm_maskz_popcnt_epi64(__mmask8 __U, __m128i __A) {...@@ -49,8 +52,7 @@ _mm_maskz_popcnt_epi64(__mmask8 __U, __m128i __A) {
49 return _mm_mask_popcnt_epi64((__m128i)_mm_setzero_si128(), __U, __A);52 return _mm_mask_popcnt_epi64((__m128i)_mm_setzero_si128(), __U, __A);
50}53}
5154
52static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR55static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_popcnt_epi32(__m128i __A) {
53_mm_popcnt_epi32(__m128i __A) {
54 return (__m128i)__builtin_elementwise_popcount((__v4su)__A);56 return (__m128i)__builtin_elementwise_popcount((__v4su)__A);
55}57}
5658
...@@ -65,7 +67,7 @@ _mm_maskz_popcnt_epi32(__mmask8 __U, __m128i __A) {...@@ -65,7 +67,7 @@ _mm_maskz_popcnt_epi32(__mmask8 __U, __m128i __A) {
65 return _mm_mask_popcnt_epi32((__m128i)_mm_setzero_si128(), __U, __A);67 return _mm_mask_popcnt_epi32((__m128i)_mm_setzero_si128(), __U, __A);
66}68}
6769
68static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR70static __inline__ __m256i __DEFAULT_FN_ATTRS256
69_mm256_popcnt_epi64(__m256i __A) {71_mm256_popcnt_epi64(__m256i __A) {
70 return (__m256i)__builtin_elementwise_popcount((__v4du)__A);72 return (__m256i)__builtin_elementwise_popcount((__v4du)__A);
71}73}
...@@ -81,7 +83,7 @@ _mm256_maskz_popcnt_epi64(__mmask8 __U, __m256i __A) {...@@ -81,7 +83,7 @@ _mm256_maskz_popcnt_epi64(__mmask8 __U, __m256i __A) {
81 return _mm256_mask_popcnt_epi64((__m256i)_mm256_setzero_si256(), __U, __A);83 return _mm256_mask_popcnt_epi64((__m256i)_mm256_setzero_si256(), __U, __A);
82}84}
8385
84static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR86static __inline__ __m256i __DEFAULT_FN_ATTRS256
85_mm256_popcnt_epi32(__m256i __A) {87_mm256_popcnt_epi32(__m256i __A) {
86 return (__m256i)__builtin_elementwise_popcount((__v8su)__A);88 return (__m256i)__builtin_elementwise_popcount((__v8su)__A);
87}89}
lib/include/avxifmaintrin.h+16
...@@ -15,12 +15,28 @@...@@ -15,12 +15,28 @@
15#define __AVXIFMAINTRIN_H15#define __AVXIFMAINTRIN_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__, __target__("avxifma"), \
21 __min_vector_width__(128))) constexpr
22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \
24 __min_vector_width__(256))) constexpr
25#else
18#define __DEFAULT_FN_ATTRS128 \26#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \27 __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \
20 __min_vector_width__(128)))28 __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 \29#define __DEFAULT_FN_ATTRS256 \
22 __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \30 __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \
23 __min_vector_width__(256)))31 __min_vector_width__(256)))
32#endif
33
34#if !defined(__AVX512IFMA__) && defined(__AVXIFMA__)
35#define _mm_madd52hi_epu64(X, Y, Z) _mm_madd52hi_avx_epu64(X, Y, Z)
36#define _mm_madd52lo_epu64(X, Y, Z) _mm_madd52lo_avx_epu64(X, Y, Z)
37#define _mm256_madd52hi_epu64(X, Y, Z) _mm256_madd52hi_avx_epu64(X, Y, Z)
38#define _mm256_madd52lo_epu64(X, Y, Z) _mm256_madd52lo_avx_epu64(X, Y, Z)
39#endif
2440
25// must vex-encoding41// must vex-encoding
2642
lib/include/avxintrin.h+165-241
...@@ -50,28 +50,19 @@ typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));...@@ -50,28 +50,19 @@ typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));
50#endif50#endif
5151
52/* Define the default attributes for the functions in this file. */52/* Define the default attributes for the functions in this file. */
53#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
54#define __DEFAULT_FN_ATTRS \
55 __attribute__((__always_inline__, __nodebug__, __target__("avx,no-evex512"), \
56 __min_vector_width__(256)))
57#define __DEFAULT_FN_ATTRS128 \
58 __attribute__((__always_inline__, __nodebug__, __target__("avx,no-evex512"), \
59 __min_vector_width__(128)))
60#else
61#define __DEFAULT_FN_ATTRS \53#define __DEFAULT_FN_ATTRS \
62 __attribute__((__always_inline__, __nodebug__, __target__("avx"), \54 __attribute__((__always_inline__, __nodebug__, __target__("avx"), \
63 __min_vector_width__(256)))55 __min_vector_width__(256)))
64#define __DEFAULT_FN_ATTRS128 \56#define __DEFAULT_FN_ATTRS128 \
65 __attribute__((__always_inline__, __nodebug__, __target__("avx"), \57 __attribute__((__always_inline__, __nodebug__, __target__("avx"), \
66 __min_vector_width__(128)))58 __min_vector_width__(128)))
67#endif
6859
69#if defined(__cplusplus) && (__cplusplus >= 201103L)60#if defined(__cplusplus) && (__cplusplus >= 201103L)
70#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr61#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
71#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr62#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
72#else63#else
73#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS12864#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
74#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS65#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
75#endif66#endif
7667
77/* Arithmetic */68/* Arithmetic */
...@@ -87,9 +78,8 @@ typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));...@@ -87,9 +78,8 @@ typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));
87/// A 256-bit vector of [4 x double] containing one of the source operands.78/// A 256-bit vector of [4 x double] containing one of the source operands.
88/// \returns A 256-bit vector of [4 x double] containing the sums of both79/// \returns A 256-bit vector of [4 x double] containing the sums of both
89/// operands.80/// operands.
90static __inline __m256d __DEFAULT_FN_ATTRS81static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
91_mm256_add_pd(__m256d __a, __m256d __b)82_mm256_add_pd(__m256d __a, __m256d __b) {
92{
93 return (__m256d)((__v4df)__a+(__v4df)__b);83 return (__m256d)((__v4df)__a+(__v4df)__b);
94}84}
9585
...@@ -105,9 +95,8 @@ _mm256_add_pd(__m256d __a, __m256d __b)...@@ -105,9 +95,8 @@ _mm256_add_pd(__m256d __a, __m256d __b)
105/// A 256-bit vector of [8 x float] containing one of the source operands.95/// A 256-bit vector of [8 x float] containing one of the source operands.
106/// \returns A 256-bit vector of [8 x float] containing the sums of both96/// \returns A 256-bit vector of [8 x float] containing the sums of both
107/// operands.97/// operands.
108static __inline __m256 __DEFAULT_FN_ATTRS98static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_add_ps(__m256 __a,
109_mm256_add_ps(__m256 __a, __m256 __b)99 __m256 __b) {
110{
111 return (__m256)((__v8sf)__a+(__v8sf)__b);100 return (__m256)((__v8sf)__a+(__v8sf)__b);
112}101}
113102
...@@ -123,9 +112,8 @@ _mm256_add_ps(__m256 __a, __m256 __b)...@@ -123,9 +112,8 @@ _mm256_add_ps(__m256 __a, __m256 __b)
123/// A 256-bit vector of [4 x double] containing the subtrahend.112/// A 256-bit vector of [4 x double] containing the subtrahend.
124/// \returns A 256-bit vector of [4 x double] containing the differences between113/// \returns A 256-bit vector of [4 x double] containing the differences between
125/// both operands.114/// both operands.
126static __inline __m256d __DEFAULT_FN_ATTRS115static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
127_mm256_sub_pd(__m256d __a, __m256d __b)116_mm256_sub_pd(__m256d __a, __m256d __b) {
128{
129 return (__m256d)((__v4df)__a-(__v4df)__b);117 return (__m256d)((__v4df)__a-(__v4df)__b);
130}118}
131119
...@@ -141,9 +129,8 @@ _mm256_sub_pd(__m256d __a, __m256d __b)...@@ -141,9 +129,8 @@ _mm256_sub_pd(__m256d __a, __m256d __b)
141/// A 256-bit vector of [8 x float] containing the subtrahend.129/// A 256-bit vector of [8 x float] containing the subtrahend.
142/// \returns A 256-bit vector of [8 x float] containing the differences between130/// \returns A 256-bit vector of [8 x float] containing the differences between
143/// both operands.131/// both operands.
144static __inline __m256 __DEFAULT_FN_ATTRS132static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_sub_ps(__m256 __a,
145_mm256_sub_ps(__m256 __a, __m256 __b)133 __m256 __b) {
146{
147 return (__m256)((__v8sf)__a-(__v8sf)__b);134 return (__m256)((__v8sf)__a-(__v8sf)__b);
148}135}
149136
...@@ -160,9 +147,8 @@ _mm256_sub_ps(__m256 __a, __m256 __b)...@@ -160,9 +147,8 @@ _mm256_sub_ps(__m256 __a, __m256 __b)
160/// A 256-bit vector of [4 x double] containing the right source operand.147/// A 256-bit vector of [4 x double] containing the right source operand.
161/// \returns A 256-bit vector of [4 x double] containing the alternating sums148/// \returns A 256-bit vector of [4 x double] containing the alternating sums
162/// and differences between both operands.149/// and differences between both operands.
163static __inline __m256d __DEFAULT_FN_ATTRS150static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
164_mm256_addsub_pd(__m256d __a, __m256d __b)151_mm256_addsub_pd(__m256d __a, __m256d __b) {
165{
166 return (__m256d)__builtin_ia32_addsubpd256((__v4df)__a, (__v4df)__b);152 return (__m256d)__builtin_ia32_addsubpd256((__v4df)__a, (__v4df)__b);
167}153}
168154
...@@ -179,9 +165,8 @@ _mm256_addsub_pd(__m256d __a, __m256d __b)...@@ -179,9 +165,8 @@ _mm256_addsub_pd(__m256d __a, __m256d __b)
179/// A 256-bit vector of [8 x float] containing the right source operand.165/// A 256-bit vector of [8 x float] containing the right source operand.
180/// \returns A 256-bit vector of [8 x float] containing the alternating sums and166/// \returns A 256-bit vector of [8 x float] containing the alternating sums and
181/// differences between both operands.167/// differences between both operands.
182static __inline __m256 __DEFAULT_FN_ATTRS168static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
183_mm256_addsub_ps(__m256 __a, __m256 __b)169_mm256_addsub_ps(__m256 __a, __m256 __b) {
184{
185 return (__m256)__builtin_ia32_addsubps256((__v8sf)__a, (__v8sf)__b);170 return (__m256)__builtin_ia32_addsubps256((__v8sf)__a, (__v8sf)__b);
186}171}
187172
...@@ -197,9 +182,8 @@ _mm256_addsub_ps(__m256 __a, __m256 __b)...@@ -197,9 +182,8 @@ _mm256_addsub_ps(__m256 __a, __m256 __b)
197/// A 256-bit vector of [4 x double] containing the divisor.182/// A 256-bit vector of [4 x double] containing the divisor.
198/// \returns A 256-bit vector of [4 x double] containing the quotients of both183/// \returns A 256-bit vector of [4 x double] containing the quotients of both
199/// operands.184/// operands.
200static __inline __m256d __DEFAULT_FN_ATTRS185static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
201_mm256_div_pd(__m256d __a, __m256d __b)186_mm256_div_pd(__m256d __a, __m256d __b) {
202{
203 return (__m256d)((__v4df)__a/(__v4df)__b);187 return (__m256d)((__v4df)__a/(__v4df)__b);
204}188}
205189
...@@ -215,9 +199,8 @@ _mm256_div_pd(__m256d __a, __m256d __b)...@@ -215,9 +199,8 @@ _mm256_div_pd(__m256d __a, __m256d __b)
215/// A 256-bit vector of [8 x float] containing the divisor.199/// A 256-bit vector of [8 x float] containing the divisor.
216/// \returns A 256-bit vector of [8 x float] containing the quotients of both200/// \returns A 256-bit vector of [8 x float] containing the quotients of both
217/// operands.201/// operands.
218static __inline __m256 __DEFAULT_FN_ATTRS202static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_div_ps(__m256 __a,
219_mm256_div_ps(__m256 __a, __m256 __b)203 __m256 __b) {
220{
221 return (__m256)((__v8sf)__a/(__v8sf)__b);204 return (__m256)((__v8sf)__a/(__v8sf)__b);
222}205}
223206
...@@ -236,9 +219,8 @@ _mm256_div_ps(__m256 __a, __m256 __b)...@@ -236,9 +219,8 @@ _mm256_div_ps(__m256 __a, __m256 __b)
236/// A 256-bit vector of [4 x double] containing one of the operands.219/// A 256-bit vector of [4 x double] containing one of the operands.
237/// \returns A 256-bit vector of [4 x double] containing the maximum values220/// \returns A 256-bit vector of [4 x double] containing the maximum values
238/// between both operands.221/// between both operands.
239static __inline __m256d __DEFAULT_FN_ATTRS222static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
240_mm256_max_pd(__m256d __a, __m256d __b)223_mm256_max_pd(__m256d __a, __m256d __b) {
241{
242 return (__m256d)__builtin_ia32_maxpd256((__v4df)__a, (__v4df)__b);224 return (__m256d)__builtin_ia32_maxpd256((__v4df)__a, (__v4df)__b);
243}225}
244226
...@@ -257,9 +239,8 @@ _mm256_max_pd(__m256d __a, __m256d __b)...@@ -257,9 +239,8 @@ _mm256_max_pd(__m256d __a, __m256d __b)
257/// A 256-bit vector of [8 x float] containing one of the operands.239/// A 256-bit vector of [8 x float] containing one of the operands.
258/// \returns A 256-bit vector of [8 x float] containing the maximum values240/// \returns A 256-bit vector of [8 x float] containing the maximum values
259/// between both operands.241/// between both operands.
260static __inline __m256 __DEFAULT_FN_ATTRS242static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_max_ps(__m256 __a,
261_mm256_max_ps(__m256 __a, __m256 __b)243 __m256 __b) {
262{
263 return (__m256)__builtin_ia32_maxps256((__v8sf)__a, (__v8sf)__b);244 return (__m256)__builtin_ia32_maxps256((__v8sf)__a, (__v8sf)__b);
264}245}
265246
...@@ -278,9 +259,8 @@ _mm256_max_ps(__m256 __a, __m256 __b)...@@ -278,9 +259,8 @@ _mm256_max_ps(__m256 __a, __m256 __b)
278/// A 256-bit vector of [4 x double] containing one of the operands.259/// A 256-bit vector of [4 x double] containing one of the operands.
279/// \returns A 256-bit vector of [4 x double] containing the minimum values260/// \returns A 256-bit vector of [4 x double] containing the minimum values
280/// between both operands.261/// between both operands.
281static __inline __m256d __DEFAULT_FN_ATTRS262static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
282_mm256_min_pd(__m256d __a, __m256d __b)263_mm256_min_pd(__m256d __a, __m256d __b) {
283{
284 return (__m256d)__builtin_ia32_minpd256((__v4df)__a, (__v4df)__b);264 return (__m256d)__builtin_ia32_minpd256((__v4df)__a, (__v4df)__b);
285}265}
286266
...@@ -299,9 +279,8 @@ _mm256_min_pd(__m256d __a, __m256d __b)...@@ -299,9 +279,8 @@ _mm256_min_pd(__m256d __a, __m256d __b)
299/// A 256-bit vector of [8 x float] containing one of the operands.279/// A 256-bit vector of [8 x float] containing one of the operands.
300/// \returns A 256-bit vector of [8 x float] containing the minimum values280/// \returns A 256-bit vector of [8 x float] containing the minimum values
301/// between both operands.281/// between both operands.
302static __inline __m256 __DEFAULT_FN_ATTRS282static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_min_ps(__m256 __a,
303_mm256_min_ps(__m256 __a, __m256 __b)283 __m256 __b) {
304{
305 return (__m256)__builtin_ia32_minps256((__v8sf)__a, (__v8sf)__b);284 return (__m256)__builtin_ia32_minps256((__v8sf)__a, (__v8sf)__b);
306}285}
307286
...@@ -317,9 +296,8 @@ _mm256_min_ps(__m256 __a, __m256 __b)...@@ -317,9 +296,8 @@ _mm256_min_ps(__m256 __a, __m256 __b)
317/// A 256-bit vector of [4 x double] containing one of the operands.296/// A 256-bit vector of [4 x double] containing one of the operands.
318/// \returns A 256-bit vector of [4 x double] containing the products of both297/// \returns A 256-bit vector of [4 x double] containing the products of both
319/// operands.298/// operands.
320static __inline __m256d __DEFAULT_FN_ATTRS299static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
321_mm256_mul_pd(__m256d __a, __m256d __b)300_mm256_mul_pd(__m256d __a, __m256d __b) {
322{
323 return (__m256d)((__v4df)__a * (__v4df)__b);301 return (__m256d)((__v4df)__a * (__v4df)__b);
324}302}
325303
...@@ -335,9 +313,8 @@ _mm256_mul_pd(__m256d __a, __m256d __b)...@@ -335,9 +313,8 @@ _mm256_mul_pd(__m256d __a, __m256d __b)
335/// A 256-bit vector of [8 x float] containing one of the operands.313/// A 256-bit vector of [8 x float] containing one of the operands.
336/// \returns A 256-bit vector of [8 x float] containing the products of both314/// \returns A 256-bit vector of [8 x float] containing the products of both
337/// operands.315/// operands.
338static __inline __m256 __DEFAULT_FN_ATTRS316static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_mul_ps(__m256 __a,
339_mm256_mul_ps(__m256 __a, __m256 __b)317 __m256 __b) {
340{
341 return (__m256)((__v8sf)__a * (__v8sf)__b);318 return (__m256)((__v8sf)__a * (__v8sf)__b);
342}319}
343320
...@@ -352,10 +329,8 @@ _mm256_mul_ps(__m256 __a, __m256 __b)...@@ -352,10 +329,8 @@ _mm256_mul_ps(__m256 __a, __m256 __b)
352/// A 256-bit vector of [4 x double].329/// A 256-bit vector of [4 x double].
353/// \returns A 256-bit vector of [4 x double] containing the square roots of the330/// \returns A 256-bit vector of [4 x double] containing the square roots of the
354/// values in the operand.331/// values in the operand.
355static __inline __m256d __DEFAULT_FN_ATTRS332static __inline __m256d __DEFAULT_FN_ATTRS _mm256_sqrt_pd(__m256d __a) {
356_mm256_sqrt_pd(__m256d __a)333 return __builtin_elementwise_sqrt(__a);
357{
358 return (__m256d)__builtin_ia32_sqrtpd256((__v4df)__a);
359}334}
360335
361/// Calculates the square roots of the values in a 256-bit vector of336/// Calculates the square roots of the values in a 256-bit vector of
...@@ -369,10 +344,8 @@ _mm256_sqrt_pd(__m256d __a)...@@ -369,10 +344,8 @@ _mm256_sqrt_pd(__m256d __a)
369/// A 256-bit vector of [8 x float].344/// A 256-bit vector of [8 x float].
370/// \returns A 256-bit vector of [8 x float] containing the square roots of the345/// \returns A 256-bit vector of [8 x float] containing the square roots of the
371/// values in the operand.346/// values in the operand.
372static __inline __m256 __DEFAULT_FN_ATTRS347static __inline __m256 __DEFAULT_FN_ATTRS _mm256_sqrt_ps(__m256 __a) {
373_mm256_sqrt_ps(__m256 __a)348 return __builtin_elementwise_sqrt(__a);
374{
375 return (__m256)__builtin_ia32_sqrtps256((__v8sf)__a);
376}349}
377350
378/// Calculates the reciprocal square roots of the values in a 256-bit351/// Calculates the reciprocal square roots of the values in a 256-bit
...@@ -555,7 +528,7 @@ _mm256_rcp_ps(__m256 __a)...@@ -555,7 +528,7 @@ _mm256_rcp_ps(__m256 __a)
555/// A 256-bit vector of [4 x double] containing one of the source operands.528/// A 256-bit vector of [4 x double] containing one of the source operands.
556/// \returns A 256-bit vector of [4 x double] containing the bitwise AND of the529/// \returns A 256-bit vector of [4 x double] containing the bitwise AND of the
557/// values between both operands.530/// values between both operands.
558static __inline __m256d __DEFAULT_FN_ATTRS531static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
559_mm256_and_pd(__m256d __a, __m256d __b)532_mm256_and_pd(__m256d __a, __m256d __b)
560{533{
561 return (__m256d)((__v4du)__a & (__v4du)__b);534 return (__m256d)((__v4du)__a & (__v4du)__b);
...@@ -573,7 +546,7 @@ _mm256_and_pd(__m256d __a, __m256d __b)...@@ -573,7 +546,7 @@ _mm256_and_pd(__m256d __a, __m256d __b)
573/// A 256-bit vector of [8 x float] containing one of the source operands.546/// A 256-bit vector of [8 x float] containing one of the source operands.
574/// \returns A 256-bit vector of [8 x float] containing the bitwise AND of the547/// \returns A 256-bit vector of [8 x float] containing the bitwise AND of the
575/// values between both operands.548/// values between both operands.
576static __inline __m256 __DEFAULT_FN_ATTRS549static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
577_mm256_and_ps(__m256 __a, __m256 __b)550_mm256_and_ps(__m256 __a, __m256 __b)
578{551{
579 return (__m256)((__v8su)__a & (__v8su)__b);552 return (__m256)((__v8su)__a & (__v8su)__b);
...@@ -594,7 +567,7 @@ _mm256_and_ps(__m256 __a, __m256 __b)...@@ -594,7 +567,7 @@ _mm256_and_ps(__m256 __a, __m256 __b)
594/// \returns A 256-bit vector of [4 x double] containing the bitwise AND of the567/// \returns A 256-bit vector of [4 x double] containing the bitwise AND of the
595/// values of the second operand and the one's complement of the first568/// values of the second operand and the one's complement of the first
596/// operand.569/// operand.
597static __inline __m256d __DEFAULT_FN_ATTRS570static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
598_mm256_andnot_pd(__m256d __a, __m256d __b)571_mm256_andnot_pd(__m256d __a, __m256d __b)
599{572{
600 return (__m256d)(~(__v4du)__a & (__v4du)__b);573 return (__m256d)(~(__v4du)__a & (__v4du)__b);
...@@ -615,7 +588,7 @@ _mm256_andnot_pd(__m256d __a, __m256d __b)...@@ -615,7 +588,7 @@ _mm256_andnot_pd(__m256d __a, __m256d __b)
615/// \returns A 256-bit vector of [8 x float] containing the bitwise AND of the588/// \returns A 256-bit vector of [8 x float] containing the bitwise AND of the
616/// values of the second operand and the one's complement of the first589/// values of the second operand and the one's complement of the first
617/// operand.590/// operand.
618static __inline __m256 __DEFAULT_FN_ATTRS591static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
619_mm256_andnot_ps(__m256 __a, __m256 __b)592_mm256_andnot_ps(__m256 __a, __m256 __b)
620{593{
621 return (__m256)(~(__v8su)__a & (__v8su)__b);594 return (__m256)(~(__v8su)__a & (__v8su)__b);
...@@ -633,7 +606,7 @@ _mm256_andnot_ps(__m256 __a, __m256 __b)...@@ -633,7 +606,7 @@ _mm256_andnot_ps(__m256 __a, __m256 __b)
633/// A 256-bit vector of [4 x double] containing one of the source operands.606/// A 256-bit vector of [4 x double] containing one of the source operands.
634/// \returns A 256-bit vector of [4 x double] containing the bitwise OR of the607/// \returns A 256-bit vector of [4 x double] containing the bitwise OR of the
635/// values between both operands.608/// values between both operands.
636static __inline __m256d __DEFAULT_FN_ATTRS609static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
637_mm256_or_pd(__m256d __a, __m256d __b)610_mm256_or_pd(__m256d __a, __m256d __b)
638{611{
639 return (__m256d)((__v4du)__a | (__v4du)__b);612 return (__m256d)((__v4du)__a | (__v4du)__b);
...@@ -651,7 +624,7 @@ _mm256_or_pd(__m256d __a, __m256d __b)...@@ -651,7 +624,7 @@ _mm256_or_pd(__m256d __a, __m256d __b)
651/// A 256-bit vector of [8 x float] containing one of the source operands.624/// A 256-bit vector of [8 x float] containing one of the source operands.
652/// \returns A 256-bit vector of [8 x float] containing the bitwise OR of the625/// \returns A 256-bit vector of [8 x float] containing the bitwise OR of the
653/// values between both operands.626/// values between both operands.
654static __inline __m256 __DEFAULT_FN_ATTRS627static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
655_mm256_or_ps(__m256 __a, __m256 __b)628_mm256_or_ps(__m256 __a, __m256 __b)
656{629{
657 return (__m256)((__v8su)__a | (__v8su)__b);630 return (__m256)((__v8su)__a | (__v8su)__b);
...@@ -669,7 +642,7 @@ _mm256_or_ps(__m256 __a, __m256 __b)...@@ -669,7 +642,7 @@ _mm256_or_ps(__m256 __a, __m256 __b)
669/// A 256-bit vector of [4 x double] containing one of the source operands.642/// A 256-bit vector of [4 x double] containing one of the source operands.
670/// \returns A 256-bit vector of [4 x double] containing the bitwise XOR of the643/// \returns A 256-bit vector of [4 x double] containing the bitwise XOR of the
671/// values between both operands.644/// values between both operands.
672static __inline __m256d __DEFAULT_FN_ATTRS645static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
673_mm256_xor_pd(__m256d __a, __m256d __b)646_mm256_xor_pd(__m256d __a, __m256d __b)
674{647{
675 return (__m256d)((__v4du)__a ^ (__v4du)__b);648 return (__m256d)((__v4du)__a ^ (__v4du)__b);
...@@ -687,7 +660,7 @@ _mm256_xor_pd(__m256d __a, __m256d __b)...@@ -687,7 +660,7 @@ _mm256_xor_pd(__m256d __a, __m256d __b)
687/// A 256-bit vector of [8 x float] containing one of the source operands.660/// A 256-bit vector of [8 x float] containing one of the source operands.
688/// \returns A 256-bit vector of [8 x float] containing the bitwise XOR of the661/// \returns A 256-bit vector of [8 x float] containing the bitwise XOR of the
689/// values between both operands.662/// values between both operands.
690static __inline __m256 __DEFAULT_FN_ATTRS663static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
691_mm256_xor_ps(__m256 __a, __m256 __b)664_mm256_xor_ps(__m256 __a, __m256 __b)
692{665{
693 return (__m256)((__v8su)__a ^ (__v8su)__b);666 return (__m256)((__v8su)__a ^ (__v8su)__b);
...@@ -711,9 +684,8 @@ _mm256_xor_ps(__m256 __a, __m256 __b)...@@ -711,9 +684,8 @@ _mm256_xor_ps(__m256 __a, __m256 __b)
711/// elements of a vector of [4 x double].684/// elements of a vector of [4 x double].
712/// \returns A 256-bit vector of [4 x double] containing the horizontal sums of685/// \returns A 256-bit vector of [4 x double] containing the horizontal sums of
713/// both operands.686/// both operands.
714static __inline __m256d __DEFAULT_FN_ATTRS687static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
715_mm256_hadd_pd(__m256d __a, __m256d __b)688_mm256_hadd_pd(__m256d __a, __m256d __b) {
716{
717 return (__m256d)__builtin_ia32_haddpd256((__v4df)__a, (__v4df)__b);689 return (__m256d)__builtin_ia32_haddpd256((__v4df)__a, (__v4df)__b);
718}690}
719691
...@@ -734,9 +706,8 @@ _mm256_hadd_pd(__m256d __a, __m256d __b)...@@ -734,9 +706,8 @@ _mm256_hadd_pd(__m256d __a, __m256d __b)
734/// index 2, 3, 6, 7 of a vector of [8 x float].706/// index 2, 3, 6, 7 of a vector of [8 x float].
735/// \returns A 256-bit vector of [8 x float] containing the horizontal sums of707/// \returns A 256-bit vector of [8 x float] containing the horizontal sums of
736/// both operands.708/// both operands.
737static __inline __m256 __DEFAULT_FN_ATTRS709static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_hadd_ps(__m256 __a,
738_mm256_hadd_ps(__m256 __a, __m256 __b)710 __m256 __b) {
739{
740 return (__m256)__builtin_ia32_haddps256((__v8sf)__a, (__v8sf)__b);711 return (__m256)__builtin_ia32_haddps256((__v8sf)__a, (__v8sf)__b);
741}712}
742713
...@@ -757,9 +728,8 @@ _mm256_hadd_ps(__m256 __a, __m256 __b)...@@ -757,9 +728,8 @@ _mm256_hadd_ps(__m256 __a, __m256 __b)
757/// odd-indexed elements of a vector of [4 x double].728/// odd-indexed elements of a vector of [4 x double].
758/// \returns A 256-bit vector of [4 x double] containing the horizontal729/// \returns A 256-bit vector of [4 x double] containing the horizontal
759/// differences of both operands.730/// differences of both operands.
760static __inline __m256d __DEFAULT_FN_ATTRS731static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
761_mm256_hsub_pd(__m256d __a, __m256d __b)732_mm256_hsub_pd(__m256d __a, __m256d __b) {
762{
763 return (__m256d)__builtin_ia32_hsubpd256((__v4df)__a, (__v4df)__b);733 return (__m256d)__builtin_ia32_hsubpd256((__v4df)__a, (__v4df)__b);
764}734}
765735
...@@ -780,9 +750,8 @@ _mm256_hsub_pd(__m256d __a, __m256d __b)...@@ -780,9 +750,8 @@ _mm256_hsub_pd(__m256d __a, __m256d __b)
780/// elements with index 2, 3, 6, 7 of a vector of [8 x float].750/// elements with index 2, 3, 6, 7 of a vector of [8 x float].
781/// \returns A 256-bit vector of [8 x float] containing the horizontal751/// \returns A 256-bit vector of [8 x float] containing the horizontal
782/// differences of both operands.752/// differences of both operands.
783static __inline __m256 __DEFAULT_FN_ATTRS753static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_hsub_ps(__m256 __a,
784_mm256_hsub_ps(__m256 __a, __m256 __b)754 __m256 __b) {
785{
786 return (__m256)__builtin_ia32_hsubps256((__v8sf)__a, (__v8sf)__b);755 return (__m256)__builtin_ia32_hsubps256((__v8sf)__a, (__v8sf)__b);
787}756}
788757
...@@ -810,9 +779,8 @@ _mm256_hsub_ps(__m256 __a, __m256 __b)...@@ -810,9 +779,8 @@ _mm256_hsub_ps(__m256 __a, __m256 __b)
810/// 1: Bits [127:64] of the source are copied to bits [127:64] of the779/// 1: Bits [127:64] of the source are copied to bits [127:64] of the
811/// returned vector.780/// returned vector.
812/// \returns A 128-bit vector of [2 x double] containing the copied values.781/// \returns A 128-bit vector of [2 x double] containing the copied values.
813static __inline __m128d __DEFAULT_FN_ATTRS128782static __inline __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
814_mm_permutevar_pd(__m128d __a, __m128i __c)783_mm_permutevar_pd(__m128d __a, __m128i __c) {
815{
816 return (__m128d)__builtin_ia32_vpermilvarpd((__v2df)__a, (__v2di)__c);784 return (__m128d)__builtin_ia32_vpermilvarpd((__v2df)__a, (__v2di)__c);
817}785}
818786
...@@ -849,9 +817,8 @@ _mm_permutevar_pd(__m128d __a, __m128i __c)...@@ -849,9 +817,8 @@ _mm_permutevar_pd(__m128d __a, __m128i __c)
849/// 1: Bits [255:192] of the source are copied to bits [255:192] of the817/// 1: Bits [255:192] of the source are copied to bits [255:192] of the
850/// returned vector.818/// returned vector.
851/// \returns A 256-bit vector of [4 x double] containing the copied values.819/// \returns A 256-bit vector of [4 x double] containing the copied values.
852static __inline __m256d __DEFAULT_FN_ATTRS820static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
853_mm256_permutevar_pd(__m256d __a, __m256i __c)821_mm256_permutevar_pd(__m256d __a, __m256i __c) {
854{
855 return (__m256d)__builtin_ia32_vpermilvarpd256((__v4df)__a, (__v4di)__c);822 return (__m256d)__builtin_ia32_vpermilvarpd256((__v4df)__a, (__v4di)__c);
856}823}
857824
...@@ -904,9 +871,8 @@ _mm256_permutevar_pd(__m256d __a, __m256i __c)...@@ -904,9 +871,8 @@ _mm256_permutevar_pd(__m256d __a, __m256i __c)
904/// 11: Bits [127:96] of the source are copied to bits [127:96] of the871/// 11: Bits [127:96] of the source are copied to bits [127:96] of the
905/// returned vector.872/// returned vector.
906/// \returns A 128-bit vector of [4 x float] containing the copied values.873/// \returns A 128-bit vector of [4 x float] containing the copied values.
907static __inline __m128 __DEFAULT_FN_ATTRS128874static __inline __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
908_mm_permutevar_ps(__m128 __a, __m128i __c)875_mm_permutevar_ps(__m128 __a, __m128i __c) {
909{
910 return (__m128)__builtin_ia32_vpermilvarps((__v4sf)__a, (__v4si)__c);876 return (__m128)__builtin_ia32_vpermilvarps((__v4sf)__a, (__v4si)__c);
911}877}
912878
...@@ -995,9 +961,8 @@ _mm_permutevar_ps(__m128 __a, __m128i __c)...@@ -995,9 +961,8 @@ _mm_permutevar_ps(__m128 __a, __m128i __c)
995/// 11: Bits [255:224] of the source are copied to bits [255:224] of the961/// 11: Bits [255:224] of the source are copied to bits [255:224] of the
996/// returned vector.962/// returned vector.
997/// \returns A 256-bit vector of [8 x float] containing the copied values.963/// \returns A 256-bit vector of [8 x float] containing the copied values.
998static __inline __m256 __DEFAULT_FN_ATTRS964static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
999_mm256_permutevar_ps(__m256 __a, __m256i __c)965_mm256_permutevar_ps(__m256 __a, __m256i __c) {
1000{
1001 return (__m256)__builtin_ia32_vpermilvarps256((__v8sf)__a, (__v8si)__c);966 return (__m256)__builtin_ia32_vpermilvarps256((__v8sf)__a, (__v8si)__c);
1002}967}
1003968
...@@ -1419,9 +1384,8 @@ _mm256_permutevar_ps(__m256 __a, __m256i __c)...@@ -1419,9 +1384,8 @@ _mm256_permutevar_ps(__m256 __a, __m256i __c)
1419/// 64-bit element in operand \a __b is copied to the same position in the1384/// 64-bit element in operand \a __b is copied to the same position in the
1420/// destination.1385/// destination.
1421/// \returns A 256-bit vector of [4 x double] containing the copied values.1386/// \returns A 256-bit vector of [4 x double] containing the copied values.
1422static __inline __m256d __DEFAULT_FN_ATTRS1387static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
1423_mm256_blendv_pd(__m256d __a, __m256d __b, __m256d __c)1388_mm256_blendv_pd(__m256d __a, __m256d __b, __m256d __c) {
1424{
1425 return (__m256d)__builtin_ia32_blendvpd256(1389 return (__m256d)__builtin_ia32_blendvpd256(
1426 (__v4df)__a, (__v4df)__b, (__v4df)__c);1390 (__v4df)__a, (__v4df)__b, (__v4df)__c);
1427}1391}
...@@ -1447,9 +1411,8 @@ _mm256_blendv_pd(__m256d __a, __m256d __b, __m256d __c)...@@ -1447,9 +1411,8 @@ _mm256_blendv_pd(__m256d __a, __m256d __b, __m256d __c)
1447/// corresponding 32-bit element in operand \a __b is copied to the same1411/// corresponding 32-bit element in operand \a __b is copied to the same
1448/// position in the destination.1412/// position in the destination.
1449/// \returns A 256-bit vector of [8 x float] containing the copied values.1413/// \returns A 256-bit vector of [8 x float] containing the copied values.
1450static __inline __m256 __DEFAULT_FN_ATTRS1414static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
1451_mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)1415_mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c) {
1452{
1453 return (__m256)__builtin_ia32_blendvps256(1416 return (__m256)__builtin_ia32_blendvps256(
1454 (__v8sf)__a, (__v8sf)__b, (__v8sf)__c);1417 (__v8sf)__a, (__v8sf)__b, (__v8sf)__c);
1455}1418}
...@@ -2190,9 +2153,8 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)...@@ -2190,9 +2153,8 @@ _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c)
2190/// \param __a2153/// \param __a
2191/// A 128-bit integer vector of [4 x i32].2154/// A 128-bit integer vector of [4 x i32].
2192/// \returns A 256-bit vector of [4 x double] containing the converted values.2155/// \returns A 256-bit vector of [4 x double] containing the converted values.
2193static __inline __m256d __DEFAULT_FN_ATTRS2156static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
2194_mm256_cvtepi32_pd(__m128i __a)2157_mm256_cvtepi32_pd(__m128i __a) {
2195{
2196 return (__m256d)__builtin_convertvector((__v4si)__a, __v4df);2158 return (__m256d)__builtin_convertvector((__v4si)__a, __v4df);
2197}2159}
21982160
...@@ -2205,9 +2167,8 @@ _mm256_cvtepi32_pd(__m128i __a)...@@ -2205,9 +2167,8 @@ _mm256_cvtepi32_pd(__m128i __a)
2205/// \param __a2167/// \param __a
2206/// A 256-bit integer vector.2168/// A 256-bit integer vector.
2207/// \returns A 256-bit vector of [8 x float] containing the converted values.2169/// \returns A 256-bit vector of [8 x float] containing the converted values.
2208static __inline __m256 __DEFAULT_FN_ATTRS2170static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
2209_mm256_cvtepi32_ps(__m256i __a)2171_mm256_cvtepi32_ps(__m256i __a) {
2210{
2211 return (__m256)__builtin_convertvector((__v8si)__a, __v8sf);2172 return (__m256)__builtin_convertvector((__v8si)__a, __v8sf);
2212}2173}
22132174
...@@ -2221,9 +2182,8 @@ _mm256_cvtepi32_ps(__m256i __a)...@@ -2221,9 +2182,8 @@ _mm256_cvtepi32_ps(__m256i __a)
2221/// \param __a2182/// \param __a
2222/// A 256-bit vector of [4 x double].2183/// A 256-bit vector of [4 x double].
2223/// \returns A 128-bit vector of [4 x float] containing the converted values.2184/// \returns A 128-bit vector of [4 x float] containing the converted values.
2224static __inline __m128 __DEFAULT_FN_ATTRS2185static __inline __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2225_mm256_cvtpd_ps(__m256d __a)2186_mm256_cvtpd_ps(__m256d __a) {
2226{
2227 return (__m128)__builtin_ia32_cvtpd2ps256((__v4df) __a);2187 return (__m128)__builtin_ia32_cvtpd2ps256((__v4df) __a);
2228}2188}
22292189
...@@ -2256,9 +2216,8 @@ _mm256_cvtps_epi32(__m256 __a)...@@ -2256,9 +2216,8 @@ _mm256_cvtps_epi32(__m256 __a)
2256/// \param __a2216/// \param __a
2257/// A 128-bit vector of [4 x float].2217/// A 128-bit vector of [4 x float].
2258/// \returns A 256-bit vector of [4 x double] containing the converted values.2218/// \returns A 256-bit vector of [4 x double] containing the converted values.
2259static __inline __m256d __DEFAULT_FN_ATTRS2219static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
2260_mm256_cvtps_pd(__m128 __a)2220_mm256_cvtps_pd(__m128 __a) {
2261{
2262 return (__m256d)__builtin_convertvector((__v4sf)__a, __v4df);2221 return (__m256d)__builtin_convertvector((__v4sf)__a, __v4df);
2263}2222}
22642223
...@@ -2333,10 +2292,9 @@ _mm256_cvttps_epi32(__m256 __a)...@@ -2333,10 +2292,9 @@ _mm256_cvttps_epi32(__m256 __a)
2333/// \param __a2292/// \param __a
2334/// A 256-bit vector of [4 x double].2293/// A 256-bit vector of [4 x double].
2335/// \returns A 64 bit double containing the first element of the input vector.2294/// \returns A 64 bit double containing the first element of the input vector.
2336static __inline double __DEFAULT_FN_ATTRS2295static __inline double __DEFAULT_FN_ATTRS_CONSTEXPR
2337_mm256_cvtsd_f64(__m256d __a)2296_mm256_cvtsd_f64(__m256d __a) {
2338{2297 return __a[0];
2339 return __a[0];
2340}2298}
23412299
2342/// Returns the first element of the input vector of [8 x i32].2300/// Returns the first element of the input vector of [8 x i32].
...@@ -2349,11 +2307,10 @@ _mm256_cvtsd_f64(__m256d __a)...@@ -2349,11 +2307,10 @@ _mm256_cvtsd_f64(__m256d __a)
2349/// \param __a2307/// \param __a
2350/// A 256-bit vector of [8 x i32].2308/// A 256-bit vector of [8 x i32].
2351/// \returns A 32 bit integer containing the first element of the input vector.2309/// \returns A 32 bit integer containing the first element of the input vector.
2352static __inline int __DEFAULT_FN_ATTRS2310static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2353_mm256_cvtsi256_si32(__m256i __a)2311_mm256_cvtsi256_si32(__m256i __a) {
2354{2312 __v8si __b = (__v8si)__a;
2355 __v8si __b = (__v8si)__a;2313 return __b[0];
2356 return __b[0];
2357}2314}
23582315
2359/// Returns the first element of the input vector of [8 x float].2316/// Returns the first element of the input vector of [8 x float].
...@@ -2366,10 +2323,9 @@ _mm256_cvtsi256_si32(__m256i __a)...@@ -2366,10 +2323,9 @@ _mm256_cvtsi256_si32(__m256i __a)
2366/// \param __a2323/// \param __a
2367/// A 256-bit vector of [8 x float].2324/// A 256-bit vector of [8 x float].
2368/// \returns A 32 bit float containing the first element of the input vector.2325/// \returns A 32 bit float containing the first element of the input vector.
2369static __inline float __DEFAULT_FN_ATTRS2326static __inline float __DEFAULT_FN_ATTRS_CONSTEXPR
2370_mm256_cvtss_f32(__m256 __a)2327_mm256_cvtss_f32(__m256 __a) {
2371{2328 return __a[0];
2372 return __a[0];
2373}2329}
23742330
2375/* Vector replicate */2331/* Vector replicate */
...@@ -2392,7 +2348,7 @@ _mm256_cvtss_f32(__m256 __a)...@@ -2392,7 +2348,7 @@ _mm256_cvtss_f32(__m256 __a)
2392/// return value.2348/// return value.
2393/// \returns A 256-bit vector of [8 x float] containing the moved and duplicated2349/// \returns A 256-bit vector of [8 x float] containing the moved and duplicated
2394/// values.2350/// values.
2395static __inline __m256 __DEFAULT_FN_ATTRS2351static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
2396_mm256_movehdup_ps(__m256 __a)2352_mm256_movehdup_ps(__m256 __a)
2397{2353{
2398 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 1, 1, 3, 3, 5, 5, 7, 7);2354 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 1, 1, 3, 3, 5, 5, 7, 7);
...@@ -2417,7 +2373,7 @@ _mm256_movehdup_ps(__m256 __a)...@@ -2417,7 +2373,7 @@ _mm256_movehdup_ps(__m256 __a)
2417/// return value.2373/// return value.
2418/// \returns A 256-bit vector of [8 x float] containing the moved and duplicated2374/// \returns A 256-bit vector of [8 x float] containing the moved and duplicated
2419/// values.2375/// values.
2420static __inline __m256 __DEFAULT_FN_ATTRS2376static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
2421_mm256_moveldup_ps(__m256 __a)2377_mm256_moveldup_ps(__m256 __a)
2422{2378{
2423 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 0, 2, 2, 4, 4, 6, 6);2379 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 0, 2, 2, 4, 4, 6, 6);
...@@ -2439,7 +2395,7 @@ _mm256_moveldup_ps(__m256 __a)...@@ -2439,7 +2395,7 @@ _mm256_moveldup_ps(__m256 __a)
2439/// the return value.2395/// the return value.
2440/// \returns A 256-bit vector of [4 x double] containing the moved and2396/// \returns A 256-bit vector of [4 x double] containing the moved and
2441/// duplicated values.2397/// duplicated values.
2442static __inline __m256d __DEFAULT_FN_ATTRS2398static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
2443_mm256_movedup_pd(__m256d __a)2399_mm256_movedup_pd(__m256d __a)
2444{2400{
2445 return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 0, 2, 2);2401 return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 0, 2, 2);
...@@ -2462,9 +2418,8 @@ _mm256_movedup_pd(__m256d __a)...@@ -2462,9 +2418,8 @@ _mm256_movedup_pd(__m256d __a)
2462/// Bits [127:64] are written to bits [127:64] of the return value. \n2418/// Bits [127:64] are written to bits [127:64] of the return value. \n
2463/// Bits [255:192] are written to bits [255:192] of the return value. \n2419/// Bits [255:192] are written to bits [255:192] of the return value. \n
2464/// \returns A 256-bit vector of [4 x double] containing the interleaved values.2420/// \returns A 256-bit vector of [4 x double] containing the interleaved values.
2465static __inline __m256d __DEFAULT_FN_ATTRS2421static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
2466_mm256_unpackhi_pd(__m256d __a, __m256d __b)2422_mm256_unpackhi_pd(__m256d __a, __m256d __b) {
2467{
2468 return __builtin_shufflevector((__v4df)__a, (__v4df)__b, 1, 5, 1+2, 5+2);2423 return __builtin_shufflevector((__v4df)__a, (__v4df)__b, 1, 5, 1+2, 5+2);
2469}2424}
24702425
...@@ -2484,9 +2439,8 @@ _mm256_unpackhi_pd(__m256d __a, __m256d __b)...@@ -2484,9 +2439,8 @@ _mm256_unpackhi_pd(__m256d __a, __m256d __b)
2484/// Bits [63:0] are written to bits [127:64] of the return value. \n2439/// Bits [63:0] are written to bits [127:64] of the return value. \n
2485/// Bits [191:128] are written to bits [255:192] of the return value. \n2440/// Bits [191:128] are written to bits [255:192] of the return value. \n
2486/// \returns A 256-bit vector of [4 x double] containing the interleaved values.2441/// \returns A 256-bit vector of [4 x double] containing the interleaved values.
2487static __inline __m256d __DEFAULT_FN_ATTRS2442static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
2488_mm256_unpacklo_pd(__m256d __a, __m256d __b)2443_mm256_unpacklo_pd(__m256d __a, __m256d __b) {
2489{
2490 return __builtin_shufflevector((__v4df)__a, (__v4df)__b, 0, 4, 0+2, 4+2);2444 return __builtin_shufflevector((__v4df)__a, (__v4df)__b, 0, 4, 0+2, 4+2);
2491}2445}
24922446
...@@ -2511,9 +2465,8 @@ _mm256_unpacklo_pd(__m256d __a, __m256d __b)...@@ -2511,9 +2465,8 @@ _mm256_unpacklo_pd(__m256d __a, __m256d __b)
2511/// Bits [223:192] are written to bits [191:160] of the return value. \n2465/// Bits [223:192] are written to bits [191:160] of the return value. \n
2512/// Bits [255:224] are written to bits [255:224] of the return value.2466/// Bits [255:224] are written to bits [255:224] of the return value.
2513/// \returns A 256-bit vector of [8 x float] containing the interleaved values.2467/// \returns A 256-bit vector of [8 x float] containing the interleaved values.
2514static __inline __m256 __DEFAULT_FN_ATTRS2468static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
2515_mm256_unpackhi_ps(__m256 __a, __m256 __b)2469_mm256_unpackhi_ps(__m256 __a, __m256 __b) {
2516{
2517 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__b, 2, 10, 2+1, 10+1, 6, 14, 6+1, 14+1);2470 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__b, 2, 10, 2+1, 10+1, 6, 14, 6+1, 14+1);
2518}2471}
25192472
...@@ -2538,9 +2491,8 @@ _mm256_unpackhi_ps(__m256 __a, __m256 __b)...@@ -2538,9 +2491,8 @@ _mm256_unpackhi_ps(__m256 __a, __m256 __b)
2538/// Bits [159:128] are written to bits [191:160] of the return value. \n2491/// Bits [159:128] are written to bits [191:160] of the return value. \n
2539/// Bits [191:160] are written to bits [255:224] of the return value.2492/// Bits [191:160] are written to bits [255:224] of the return value.
2540/// \returns A 256-bit vector of [8 x float] containing the interleaved values.2493/// \returns A 256-bit vector of [8 x float] containing the interleaved values.
2541static __inline __m256 __DEFAULT_FN_ATTRS2494static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
2542_mm256_unpacklo_ps(__m256 __a, __m256 __b)2495_mm256_unpacklo_ps(__m256 __a, __m256 __b) {
2543{
2544 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__b, 0, 8, 0+1, 8+1, 4, 12, 4+1, 12+1);2496 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__b, 0, 8, 0+1, 8+1, 4, 12, 4+1, 12+1);
2545}2497}
25462498
...@@ -2568,9 +2520,8 @@ _mm256_unpacklo_ps(__m256 __a, __m256 __b)...@@ -2568,9 +2520,8 @@ _mm256_unpacklo_ps(__m256 __a, __m256 __b)
2568/// \param __b2520/// \param __b
2569/// A 128-bit vector of [2 x double].2521/// A 128-bit vector of [2 x double].
2570/// \returns the ZF flag in the EFLAGS register.2522/// \returns the ZF flag in the EFLAGS register.
2571static __inline int __DEFAULT_FN_ATTRS1282523static __inline int __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_testz_pd(__m128d __a,
2572_mm_testz_pd(__m128d __a, __m128d __b)2524 __m128d __b) {
2573{
2574 return __builtin_ia32_vtestzpd((__v2df)__a, (__v2df)__b);2525 return __builtin_ia32_vtestzpd((__v2df)__a, (__v2df)__b);
2575}2526}
25762527
...@@ -2597,9 +2548,8 @@ _mm_testz_pd(__m128d __a, __m128d __b)...@@ -2597,9 +2548,8 @@ _mm_testz_pd(__m128d __a, __m128d __b)
2597/// \param __b2548/// \param __b
2598/// A 128-bit vector of [2 x double].2549/// A 128-bit vector of [2 x double].
2599/// \returns the CF flag in the EFLAGS register.2550/// \returns the CF flag in the EFLAGS register.
2600static __inline int __DEFAULT_FN_ATTRS1282551static __inline int __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_testc_pd(__m128d __a,
2601_mm_testc_pd(__m128d __a, __m128d __b)2552 __m128d __b) {
2602{
2603 return __builtin_ia32_vtestcpd((__v2df)__a, (__v2df)__b);2553 return __builtin_ia32_vtestcpd((__v2df)__a, (__v2df)__b);
2604}2554}
26052555
...@@ -2627,9 +2577,8 @@ _mm_testc_pd(__m128d __a, __m128d __b)...@@ -2627,9 +2577,8 @@ _mm_testc_pd(__m128d __a, __m128d __b)
2627/// \param __b2577/// \param __b
2628/// A 128-bit vector of [2 x double].2578/// A 128-bit vector of [2 x double].
2629/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.2579/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.
2630static __inline int __DEFAULT_FN_ATTRS1282580static __inline int __DEFAULT_FN_ATTRS128_CONSTEXPR
2631_mm_testnzc_pd(__m128d __a, __m128d __b)2581_mm_testnzc_pd(__m128d __a, __m128d __b) {
2632{
2633 return __builtin_ia32_vtestnzcpd((__v2df)__a, (__v2df)__b);2582 return __builtin_ia32_vtestnzcpd((__v2df)__a, (__v2df)__b);
2634}2583}
26352584
...@@ -2656,9 +2605,8 @@ _mm_testnzc_pd(__m128d __a, __m128d __b)...@@ -2656,9 +2605,8 @@ _mm_testnzc_pd(__m128d __a, __m128d __b)
2656/// \param __b2605/// \param __b
2657/// A 128-bit vector of [4 x float].2606/// A 128-bit vector of [4 x float].
2658/// \returns the ZF flag.2607/// \returns the ZF flag.
2659static __inline int __DEFAULT_FN_ATTRS1282608static __inline int __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_testz_ps(__m128 __a,
2660_mm_testz_ps(__m128 __a, __m128 __b)2609 __m128 __b) {
2661{
2662 return __builtin_ia32_vtestzps((__v4sf)__a, (__v4sf)__b);2610 return __builtin_ia32_vtestzps((__v4sf)__a, (__v4sf)__b);
2663}2611}
26642612
...@@ -2685,9 +2633,8 @@ _mm_testz_ps(__m128 __a, __m128 __b)...@@ -2685,9 +2633,8 @@ _mm_testz_ps(__m128 __a, __m128 __b)
2685/// \param __b2633/// \param __b
2686/// A 128-bit vector of [4 x float].2634/// A 128-bit vector of [4 x float].
2687/// \returns the CF flag.2635/// \returns the CF flag.
2688static __inline int __DEFAULT_FN_ATTRS1282636static __inline int __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_testc_ps(__m128 __a,
2689_mm_testc_ps(__m128 __a, __m128 __b)2637 __m128 __b) {
2690{
2691 return __builtin_ia32_vtestcps((__v4sf)__a, (__v4sf)__b);2638 return __builtin_ia32_vtestcps((__v4sf)__a, (__v4sf)__b);
2692}2639}
26932640
...@@ -2715,9 +2662,8 @@ _mm_testc_ps(__m128 __a, __m128 __b)...@@ -2715,9 +2662,8 @@ _mm_testc_ps(__m128 __a, __m128 __b)
2715/// \param __b2662/// \param __b
2716/// A 128-bit vector of [4 x float].2663/// A 128-bit vector of [4 x float].
2717/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.2664/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.
2718static __inline int __DEFAULT_FN_ATTRS1282665static __inline int __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_testnzc_ps(__m128 __a,
2719_mm_testnzc_ps(__m128 __a, __m128 __b)2666 __m128 __b) {
2720{
2721 return __builtin_ia32_vtestnzcps((__v4sf)__a, (__v4sf)__b);2667 return __builtin_ia32_vtestnzcps((__v4sf)__a, (__v4sf)__b);
2722}2668}
27232669
...@@ -2744,9 +2690,8 @@ _mm_testnzc_ps(__m128 __a, __m128 __b)...@@ -2744,9 +2690,8 @@ _mm_testnzc_ps(__m128 __a, __m128 __b)
2744/// \param __b2690/// \param __b
2745/// A 256-bit vector of [4 x double].2691/// A 256-bit vector of [4 x double].
2746/// \returns the ZF flag.2692/// \returns the ZF flag.
2747static __inline int __DEFAULT_FN_ATTRS2693static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_testz_pd(__m256d __a,
2748_mm256_testz_pd(__m256d __a, __m256d __b)2694 __m256d __b) {
2749{
2750 return __builtin_ia32_vtestzpd256((__v4df)__a, (__v4df)__b);2695 return __builtin_ia32_vtestzpd256((__v4df)__a, (__v4df)__b);
2751}2696}
27522697
...@@ -2773,9 +2718,8 @@ _mm256_testz_pd(__m256d __a, __m256d __b)...@@ -2773,9 +2718,8 @@ _mm256_testz_pd(__m256d __a, __m256d __b)
2773/// \param __b2718/// \param __b
2774/// A 256-bit vector of [4 x double].2719/// A 256-bit vector of [4 x double].
2775/// \returns the CF flag.2720/// \returns the CF flag.
2776static __inline int __DEFAULT_FN_ATTRS2721static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_testc_pd(__m256d __a,
2777_mm256_testc_pd(__m256d __a, __m256d __b)2722 __m256d __b) {
2778{
2779 return __builtin_ia32_vtestcpd256((__v4df)__a, (__v4df)__b);2723 return __builtin_ia32_vtestcpd256((__v4df)__a, (__v4df)__b);
2780}2724}
27812725
...@@ -2803,9 +2747,8 @@ _mm256_testc_pd(__m256d __a, __m256d __b)...@@ -2803,9 +2747,8 @@ _mm256_testc_pd(__m256d __a, __m256d __b)
2803/// \param __b2747/// \param __b
2804/// A 256-bit vector of [4 x double].2748/// A 256-bit vector of [4 x double].
2805/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.2749/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.
2806static __inline int __DEFAULT_FN_ATTRS2750static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2807_mm256_testnzc_pd(__m256d __a, __m256d __b)2751_mm256_testnzc_pd(__m256d __a, __m256d __b) {
2808{
2809 return __builtin_ia32_vtestnzcpd256((__v4df)__a, (__v4df)__b);2752 return __builtin_ia32_vtestnzcpd256((__v4df)__a, (__v4df)__b);
2810}2753}
28112754
...@@ -2832,9 +2775,8 @@ _mm256_testnzc_pd(__m256d __a, __m256d __b)...@@ -2832,9 +2775,8 @@ _mm256_testnzc_pd(__m256d __a, __m256d __b)
2832/// \param __b2775/// \param __b
2833/// A 256-bit vector of [8 x float].2776/// A 256-bit vector of [8 x float].
2834/// \returns the ZF flag.2777/// \returns the ZF flag.
2835static __inline int __DEFAULT_FN_ATTRS2778static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_testz_ps(__m256 __a,
2836_mm256_testz_ps(__m256 __a, __m256 __b)2779 __m256 __b) {
2837{
2838 return __builtin_ia32_vtestzps256((__v8sf)__a, (__v8sf)__b);2780 return __builtin_ia32_vtestzps256((__v8sf)__a, (__v8sf)__b);
2839}2781}
28402782
...@@ -2861,9 +2803,8 @@ _mm256_testz_ps(__m256 __a, __m256 __b)...@@ -2861,9 +2803,8 @@ _mm256_testz_ps(__m256 __a, __m256 __b)
2861/// \param __b2803/// \param __b
2862/// A 256-bit vector of [8 x float].2804/// A 256-bit vector of [8 x float].
2863/// \returns the CF flag.2805/// \returns the CF flag.
2864static __inline int __DEFAULT_FN_ATTRS2806static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_testc_ps(__m256 __a,
2865_mm256_testc_ps(__m256 __a, __m256 __b)2807 __m256 __b) {
2866{
2867 return __builtin_ia32_vtestcps256((__v8sf)__a, (__v8sf)__b);2808 return __builtin_ia32_vtestcps256((__v8sf)__a, (__v8sf)__b);
2868}2809}
28692810
...@@ -2891,9 +2832,8 @@ _mm256_testc_ps(__m256 __a, __m256 __b)...@@ -2891,9 +2832,8 @@ _mm256_testc_ps(__m256 __a, __m256 __b)
2891/// \param __b2832/// \param __b
2892/// A 256-bit vector of [8 x float].2833/// A 256-bit vector of [8 x float].
2893/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.2834/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.
2894static __inline int __DEFAULT_FN_ATTRS2835static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_testnzc_ps(__m256 __a,
2895_mm256_testnzc_ps(__m256 __a, __m256 __b)2836 __m256 __b) {
2896{
2897 return __builtin_ia32_vtestnzcps256((__v8sf)__a, (__v8sf)__b);2837 return __builtin_ia32_vtestnzcps256((__v8sf)__a, (__v8sf)__b);
2898}2838}
28992839
...@@ -2917,9 +2857,8 @@ _mm256_testnzc_ps(__m256 __a, __m256 __b)...@@ -2917,9 +2857,8 @@ _mm256_testnzc_ps(__m256 __a, __m256 __b)
2917/// \param __b2857/// \param __b
2918/// A 256-bit integer vector.2858/// A 256-bit integer vector.
2919/// \returns the ZF flag.2859/// \returns the ZF flag.
2920static __inline int __DEFAULT_FN_ATTRS2860static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2921_mm256_testz_si256(__m256i __a, __m256i __b)2861_mm256_testz_si256(__m256i __a, __m256i __b) {
2922{
2923 return __builtin_ia32_ptestz256((__v4di)__a, (__v4di)__b);2862 return __builtin_ia32_ptestz256((__v4di)__a, (__v4di)__b);
2924}2863}
29252864
...@@ -2943,9 +2882,8 @@ _mm256_testz_si256(__m256i __a, __m256i __b)...@@ -2943,9 +2882,8 @@ _mm256_testz_si256(__m256i __a, __m256i __b)
2943/// \param __b2882/// \param __b
2944/// A 256-bit integer vector.2883/// A 256-bit integer vector.
2945/// \returns the CF flag.2884/// \returns the CF flag.
2946static __inline int __DEFAULT_FN_ATTRS2885static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2947_mm256_testc_si256(__m256i __a, __m256i __b)2886_mm256_testc_si256(__m256i __a, __m256i __b) {
2948{
2949 return __builtin_ia32_ptestc256((__v4di)__a, (__v4di)__b);2887 return __builtin_ia32_ptestc256((__v4di)__a, (__v4di)__b);
2950}2888}
29512889
...@@ -2970,9 +2908,8 @@ _mm256_testc_si256(__m256i __a, __m256i __b)...@@ -2970,9 +2908,8 @@ _mm256_testc_si256(__m256i __a, __m256i __b)
2970/// \param __b2908/// \param __b
2971/// A 256-bit integer vector.2909/// A 256-bit integer vector.
2972/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.2910/// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0.
2973static __inline int __DEFAULT_FN_ATTRS2911static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2974_mm256_testnzc_si256(__m256i __a, __m256i __b)2912_mm256_testnzc_si256(__m256i __a, __m256i __b) {
2975{
2976 return __builtin_ia32_ptestnzc256((__v4di)__a, (__v4di)__b);2913 return __builtin_ia32_ptestnzc256((__v4di)__a, (__v4di)__b);
2977}2914}
29782915
...@@ -2989,9 +2926,8 @@ _mm256_testnzc_si256(__m256i __a, __m256i __b)...@@ -2989,9 +2926,8 @@ _mm256_testnzc_si256(__m256i __a, __m256i __b)
2989/// A 256-bit vector of [4 x double] containing the double-precision2926/// A 256-bit vector of [4 x double] containing the double-precision
2990/// floating point values with sign bits to be extracted.2927/// floating point values with sign bits to be extracted.
2991/// \returns The sign bits from the operand, written to bits [3:0].2928/// \returns The sign bits from the operand, written to bits [3:0].
2992static __inline int __DEFAULT_FN_ATTRS2929static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2993_mm256_movemask_pd(__m256d __a)2930_mm256_movemask_pd(__m256d __a) {
2994{
2995 return __builtin_ia32_movmskpd256((__v4df)__a);2931 return __builtin_ia32_movmskpd256((__v4df)__a);
2996}2932}
29972933
...@@ -3007,9 +2943,8 @@ _mm256_movemask_pd(__m256d __a)...@@ -3007,9 +2943,8 @@ _mm256_movemask_pd(__m256d __a)
3007/// A 256-bit vector of [8 x float] containing the single-precision floating2943/// A 256-bit vector of [8 x float] containing the single-precision floating
3008/// point values with sign bits to be extracted.2944/// point values with sign bits to be extracted.
3009/// \returns The sign bits from the operand, written to bits [7:0].2945/// \returns The sign bits from the operand, written to bits [7:0].
3010static __inline int __DEFAULT_FN_ATTRS2946static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
3011_mm256_movemask_ps(__m256 __a)2947_mm256_movemask_ps(__m256 __a) {
3012{
3013 return __builtin_ia32_movmskps256((__v8sf)__a);2948 return __builtin_ia32_movmskps256((__v8sf)__a);
3014}2949}
30152950
...@@ -3666,9 +3601,7 @@ _mm256_undefined_pd(void)...@@ -3666,9 +3601,7 @@ _mm256_undefined_pd(void)
3666/// This intrinsic has no corresponding instruction.3601/// This intrinsic has no corresponding instruction.
3667///3602///
3668/// \returns A 256-bit vector of [8 x float] containing undefined values.3603/// \returns A 256-bit vector of [8 x float] containing undefined values.
3669static __inline__ __m256 __DEFAULT_FN_ATTRS3604static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_undefined_ps(void) {
3670_mm256_undefined_ps(void)
3671{
3672 return (__m256)__builtin_ia32_undef256();3605 return (__m256)__builtin_ia32_undef256();
3673}3606}
36743607
...@@ -3777,7 +3710,7 @@ _mm256_set_ps(float __a, float __b, float __c, float __d,...@@ -3777,7 +3710,7 @@ _mm256_set_ps(float __a, float __b, float __c, float __d,
3777/// \param __i73710/// \param __i7
3778/// A 32-bit integral value used to initialize bits [31:0] of the result.3711/// A 32-bit integral value used to initialize bits [31:0] of the result.
3779/// \returns An initialized 256-bit integer vector.3712/// \returns An initialized 256-bit integer vector.
3780static __inline __m256i __DEFAULT_FN_ATTRS3713static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
3781_mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,3714_mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,
3782 int __i4, int __i5, int __i6, int __i7)3715 int __i4, int __i5, int __i6, int __i7)
3783{3716{
...@@ -3825,7 +3758,7 @@ _mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,...@@ -3825,7 +3758,7 @@ _mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,
3825/// \param __w003758/// \param __w00
3826/// A 16-bit integral value used to initialize bits [15:0] of the result.3759/// A 16-bit integral value used to initialize bits [15:0] of the result.
3827/// \returns An initialized 256-bit integer vector.3760/// \returns An initialized 256-bit integer vector.
3828static __inline __m256i __DEFAULT_FN_ATTRS3761static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
3829_mm256_set_epi16(short __w15, short __w14, short __w13, short __w12,3762_mm256_set_epi16(short __w15, short __w14, short __w13, short __w12,
3830 short __w11, short __w10, short __w09, short __w08,3763 short __w11, short __w10, short __w09, short __w08,
3831 short __w07, short __w06, short __w05, short __w04,3764 short __w07, short __w06, short __w05, short __w04,
...@@ -3908,7 +3841,7 @@ _mm256_set_epi16(short __w15, short __w14, short __w13, short __w12,...@@ -3908,7 +3841,7 @@ _mm256_set_epi16(short __w15, short __w14, short __w13, short __w12,
3908/// \param __b003841/// \param __b00
3909/// An 8-bit integral value used to initialize bits [7:0] of the result.3842/// An 8-bit integral value used to initialize bits [7:0] of the result.
3910/// \returns An initialized 256-bit integer vector.3843/// \returns An initialized 256-bit integer vector.
3911static __inline __m256i __DEFAULT_FN_ATTRS3844static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
3912_mm256_set_epi8(char __b31, char __b30, char __b29, char __b28,3845_mm256_set_epi8(char __b31, char __b30, char __b29, char __b28,
3913 char __b27, char __b26, char __b25, char __b24,3846 char __b27, char __b26, char __b25, char __b24,
3914 char __b23, char __b22, char __b21, char __b20,3847 char __b23, char __b22, char __b21, char __b20,
...@@ -3943,7 +3876,7 @@ _mm256_set_epi8(char __b31, char __b30, char __b29, char __b28,...@@ -3943,7 +3876,7 @@ _mm256_set_epi8(char __b31, char __b30, char __b29, char __b28,
3943/// \param __d3876/// \param __d
3944/// A 64-bit integral value used to initialize bits [63:0] of the result.3877/// A 64-bit integral value used to initialize bits [63:0] of the result.
3945/// \returns An initialized 256-bit integer vector.3878/// \returns An initialized 256-bit integer vector.
3946static __inline __m256i __DEFAULT_FN_ATTRS3879static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
3947_mm256_set_epi64x(long long __a, long long __b, long long __c, long long __d)3880_mm256_set_epi64x(long long __a, long long __b, long long __c, long long __d)
3948{3881{
3949 return __extension__ (__m256i)(__v4di){ __d, __c, __b, __a };3882 return __extension__ (__m256i)(__v4di){ __d, __c, __b, __a };
...@@ -4044,7 +3977,7 @@ _mm256_setr_ps(float __a, float __b, float __c, float __d,...@@ -4044,7 +3977,7 @@ _mm256_setr_ps(float __a, float __b, float __c, float __d,
4044/// \param __i73977/// \param __i7
4045/// A 32-bit integral value used to initialize bits [255:224] of the result.3978/// A 32-bit integral value used to initialize bits [255:224] of the result.
4046/// \returns An initialized 256-bit integer vector.3979/// \returns An initialized 256-bit integer vector.
4047static __inline __m256i __DEFAULT_FN_ATTRS3980static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4048_mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,3981_mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,
4049 int __i4, int __i5, int __i6, int __i7)3982 int __i4, int __i5, int __i6, int __i7)
4050{3983{
...@@ -4092,7 +4025,7 @@ _mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,...@@ -4092,7 +4025,7 @@ _mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,
4092/// \param __w004025/// \param __w00
4093/// A 16-bit integral value used to initialize bits [255:240] of the result.4026/// A 16-bit integral value used to initialize bits [255:240] of the result.
4094/// \returns An initialized 256-bit integer vector.4027/// \returns An initialized 256-bit integer vector.
4095static __inline __m256i __DEFAULT_FN_ATTRS4028static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4096_mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12,4029_mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12,
4097 short __w11, short __w10, short __w09, short __w08,4030 short __w11, short __w10, short __w09, short __w08,
4098 short __w07, short __w06, short __w05, short __w04,4031 short __w07, short __w06, short __w05, short __w04,
...@@ -4177,7 +4110,7 @@ _mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12,...@@ -4177,7 +4110,7 @@ _mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12,
4177/// \param __b004110/// \param __b00
4178/// An 8-bit integral value used to initialize bits [255:248] of the result.4111/// An 8-bit integral value used to initialize bits [255:248] of the result.
4179/// \returns An initialized 256-bit integer vector.4112/// \returns An initialized 256-bit integer vector.
4180static __inline __m256i __DEFAULT_FN_ATTRS4113static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4181_mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28,4114_mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28,
4182 char __b27, char __b26, char __b25, char __b24,4115 char __b27, char __b26, char __b25, char __b24,
4183 char __b23, char __b22, char __b21, char __b20,4116 char __b23, char __b22, char __b21, char __b20,
...@@ -4210,7 +4143,7 @@ _mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28,...@@ -4210,7 +4143,7 @@ _mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28,
4210/// \param __d4143/// \param __d
4211/// A 64-bit integral value used to initialize bits [255:192] of the result.4144/// A 64-bit integral value used to initialize bits [255:192] of the result.
4212/// \returns An initialized 256-bit integer vector.4145/// \returns An initialized 256-bit integer vector.
4213static __inline __m256i __DEFAULT_FN_ATTRS4146static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4214_mm256_setr_epi64x(long long __a, long long __b, long long __c, long long __d)4147_mm256_setr_epi64x(long long __a, long long __b, long long __c, long long __d)
4215{4148{
4216 return _mm256_set_epi64x(__d, __c, __b, __a);4149 return _mm256_set_epi64x(__d, __c, __b, __a);
...@@ -4267,7 +4200,7 @@ _mm256_set1_ps(float __w)...@@ -4267,7 +4200,7 @@ _mm256_set1_ps(float __w)
4267/// A 32-bit integral value used to initialize each vector element of the4200/// A 32-bit integral value used to initialize each vector element of the
4268/// result.4201/// result.
4269/// \returns An initialized 256-bit integer vector of [8 x i32].4202/// \returns An initialized 256-bit integer vector of [8 x i32].
4270static __inline __m256i __DEFAULT_FN_ATTRS4203static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4271_mm256_set1_epi32(int __i)4204_mm256_set1_epi32(int __i)
4272{4205{
4273 return _mm256_set_epi32(__i, __i, __i, __i, __i, __i, __i, __i);4206 return _mm256_set_epi32(__i, __i, __i, __i, __i, __i, __i, __i);
...@@ -4285,7 +4218,7 @@ _mm256_set1_epi32(int __i)...@@ -4285,7 +4218,7 @@ _mm256_set1_epi32(int __i)
4285/// A 16-bit integral value used to initialize each vector element of the4218/// A 16-bit integral value used to initialize each vector element of the
4286/// result.4219/// result.
4287/// \returns An initialized 256-bit integer vector of [16 x i16].4220/// \returns An initialized 256-bit integer vector of [16 x i16].
4288static __inline __m256i __DEFAULT_FN_ATTRS4221static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4289_mm256_set1_epi16(short __w)4222_mm256_set1_epi16(short __w)
4290{4223{
4291 return _mm256_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w,4224 return _mm256_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w,
...@@ -4303,7 +4236,7 @@ _mm256_set1_epi16(short __w)...@@ -4303,7 +4236,7 @@ _mm256_set1_epi16(short __w)
4303/// An 8-bit integral value used to initialize each vector element of the4236/// An 8-bit integral value used to initialize each vector element of the
4304/// result.4237/// result.
4305/// \returns An initialized 256-bit integer vector of [32 x i8].4238/// \returns An initialized 256-bit integer vector of [32 x i8].
4306static __inline __m256i __DEFAULT_FN_ATTRS4239static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4307_mm256_set1_epi8(char __b)4240_mm256_set1_epi8(char __b)
4308{4241{
4309 return _mm256_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b,4242 return _mm256_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b,
...@@ -4324,7 +4257,7 @@ _mm256_set1_epi8(char __b)...@@ -4324,7 +4257,7 @@ _mm256_set1_epi8(char __b)
4324/// A 64-bit integral value used to initialize each vector element of the4257/// A 64-bit integral value used to initialize each vector element of the
4325/// result.4258/// result.
4326/// \returns An initialized 256-bit integer vector of [4 x i64].4259/// \returns An initialized 256-bit integer vector of [4 x i64].
4327static __inline __m256i __DEFAULT_FN_ATTRS4260static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4328_mm256_set1_epi64x(long long __q)4261_mm256_set1_epi64x(long long __q)
4329{4262{
4330 return _mm256_set_epi64x(__q, __q, __q, __q);4263 return _mm256_set_epi64x(__q, __q, __q, __q);
...@@ -4379,7 +4312,7 @@ _mm256_setzero_si256(void) {...@@ -4379,7 +4312,7 @@ _mm256_setzero_si256(void) {
4379/// A 256-bit floating-point vector of [4 x double].4312/// A 256-bit floating-point vector of [4 x double].
4380/// \returns A 256-bit floating-point vector of [8 x float] containing the same4313/// \returns A 256-bit floating-point vector of [8 x float] containing the same
4381/// bitwise pattern as the parameter.4314/// bitwise pattern as the parameter.
4382static __inline __m256 __DEFAULT_FN_ATTRS4315static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
4383_mm256_castpd_ps(__m256d __a)4316_mm256_castpd_ps(__m256d __a)
4384{4317{
4385 return (__m256)__a;4318 return (__m256)__a;
...@@ -4396,7 +4329,7 @@ _mm256_castpd_ps(__m256d __a)...@@ -4396,7 +4329,7 @@ _mm256_castpd_ps(__m256d __a)
4396/// A 256-bit floating-point vector of [4 x double].4329/// A 256-bit floating-point vector of [4 x double].
4397/// \returns A 256-bit integer vector containing the same bitwise pattern as the4330/// \returns A 256-bit integer vector containing the same bitwise pattern as the
4398/// parameter.4331/// parameter.
4399static __inline __m256i __DEFAULT_FN_ATTRS4332static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4400_mm256_castpd_si256(__m256d __a)4333_mm256_castpd_si256(__m256d __a)
4401{4334{
4402 return (__m256i)__a;4335 return (__m256i)__a;
...@@ -4413,7 +4346,7 @@ _mm256_castpd_si256(__m256d __a)...@@ -4413,7 +4346,7 @@ _mm256_castpd_si256(__m256d __a)
4413/// A 256-bit floating-point vector of [8 x float].4346/// A 256-bit floating-point vector of [8 x float].
4414/// \returns A 256-bit floating-point vector of [4 x double] containing the same4347/// \returns A 256-bit floating-point vector of [4 x double] containing the same
4415/// bitwise pattern as the parameter.4348/// bitwise pattern as the parameter.
4416static __inline __m256d __DEFAULT_FN_ATTRS4349static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
4417_mm256_castps_pd(__m256 __a)4350_mm256_castps_pd(__m256 __a)
4418{4351{
4419 return (__m256d)__a;4352 return (__m256d)__a;
...@@ -4430,7 +4363,7 @@ _mm256_castps_pd(__m256 __a)...@@ -4430,7 +4363,7 @@ _mm256_castps_pd(__m256 __a)
4430/// A 256-bit floating-point vector of [8 x float].4363/// A 256-bit floating-point vector of [8 x float].
4431/// \returns A 256-bit integer vector containing the same bitwise pattern as the4364/// \returns A 256-bit integer vector containing the same bitwise pattern as the
4432/// parameter.4365/// parameter.
4433static __inline __m256i __DEFAULT_FN_ATTRS4366static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4434_mm256_castps_si256(__m256 __a)4367_mm256_castps_si256(__m256 __a)
4435{4368{
4436 return (__m256i)__a;4369 return (__m256i)__a;
...@@ -4447,7 +4380,7 @@ _mm256_castps_si256(__m256 __a)...@@ -4447,7 +4380,7 @@ _mm256_castps_si256(__m256 __a)
4447/// A 256-bit integer vector.4380/// A 256-bit integer vector.
4448/// \returns A 256-bit floating-point vector of [8 x float] containing the same4381/// \returns A 256-bit floating-point vector of [8 x float] containing the same
4449/// bitwise pattern as the parameter.4382/// bitwise pattern as the parameter.
4450static __inline __m256 __DEFAULT_FN_ATTRS4383static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
4451_mm256_castsi256_ps(__m256i __a)4384_mm256_castsi256_ps(__m256i __a)
4452{4385{
4453 return (__m256)__a;4386 return (__m256)__a;
...@@ -4464,7 +4397,7 @@ _mm256_castsi256_ps(__m256i __a)...@@ -4464,7 +4397,7 @@ _mm256_castsi256_ps(__m256i __a)
4464/// A 256-bit integer vector.4397/// A 256-bit integer vector.
4465/// \returns A 256-bit floating-point vector of [4 x double] containing the same4398/// \returns A 256-bit floating-point vector of [4 x double] containing the same
4466/// bitwise pattern as the parameter.4399/// bitwise pattern as the parameter.
4467static __inline __m256d __DEFAULT_FN_ATTRS4400static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
4468_mm256_castsi256_pd(__m256i __a)4401_mm256_castsi256_pd(__m256i __a)
4469{4402{
4470 return (__m256d)__a;4403 return (__m256d)__a;
...@@ -4481,7 +4414,7 @@ _mm256_castsi256_pd(__m256i __a)...@@ -4481,7 +4414,7 @@ _mm256_castsi256_pd(__m256i __a)
4481/// A 256-bit floating-point vector of [4 x double].4414/// A 256-bit floating-point vector of [4 x double].
4482/// \returns A 128-bit floating-point vector of [2 x double] containing the4415/// \returns A 128-bit floating-point vector of [2 x double] containing the
4483/// lower 128 bits of the parameter.4416/// lower 128 bits of the parameter.
4484static __inline __m128d __DEFAULT_FN_ATTRS4417static __inline __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
4485_mm256_castpd256_pd128(__m256d __a)4418_mm256_castpd256_pd128(__m256d __a)
4486{4419{
4487 return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 1);4420 return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 1);
...@@ -4498,7 +4431,7 @@ _mm256_castpd256_pd128(__m256d __a)...@@ -4498,7 +4431,7 @@ _mm256_castpd256_pd128(__m256d __a)
4498/// A 256-bit floating-point vector of [8 x float].4431/// A 256-bit floating-point vector of [8 x float].
4499/// \returns A 128-bit floating-point vector of [4 x float] containing the4432/// \returns A 128-bit floating-point vector of [4 x float] containing the
4500/// lower 128 bits of the parameter.4433/// lower 128 bits of the parameter.
4501static __inline __m128 __DEFAULT_FN_ATTRS4434static __inline __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
4502_mm256_castps256_ps128(__m256 __a)4435_mm256_castps256_ps128(__m256 __a)
4503{4436{
4504 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 1, 2, 3);4437 return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 1, 2, 3);
...@@ -4514,7 +4447,7 @@ _mm256_castps256_ps128(__m256 __a)...@@ -4514,7 +4447,7 @@ _mm256_castps256_ps128(__m256 __a)
4514/// A 256-bit integer vector.4447/// A 256-bit integer vector.
4515/// \returns A 128-bit integer vector containing the lower 128 bits of the4448/// \returns A 128-bit integer vector containing the lower 128 bits of the
4516/// parameter.4449/// parameter.
4517static __inline __m128i __DEFAULT_FN_ATTRS4450static __inline __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4518_mm256_castsi256_si128(__m256i __a)4451_mm256_castsi256_si128(__m256i __a)
4519{4452{
4520 return __builtin_shufflevector((__v4di)__a, (__v4di)__a, 0, 1);4453 return __builtin_shufflevector((__v4di)__a, (__v4di)__a, 0, 1);
...@@ -4598,9 +4531,8 @@ _mm256_castsi128_si256(__m128i __a)...@@ -4598,9 +4531,8 @@ _mm256_castsi128_si256(__m128i __a)
4598/// A 128-bit vector of [2 x double].4531/// A 128-bit vector of [2 x double].
4599/// \returns A 256-bit floating-point vector of [4 x double]. The lower 128 bits4532/// \returns A 256-bit floating-point vector of [4 x double]. The lower 128 bits
4600/// contain the value of the parameter. The upper 128 bits are set to zero.4533/// contain the value of the parameter. The upper 128 bits are set to zero.
4601static __inline __m256d __DEFAULT_FN_ATTRS4534static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
4602_mm256_zextpd128_pd256(__m128d __a)4535_mm256_zextpd128_pd256(__m128d __a) {
4603{
4604 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3);4536 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3);
4605}4537}
46064538
...@@ -4616,9 +4548,8 @@ _mm256_zextpd128_pd256(__m128d __a)...@@ -4616,9 +4548,8 @@ _mm256_zextpd128_pd256(__m128d __a)
4616/// A 128-bit vector of [4 x float].4548/// A 128-bit vector of [4 x float].
4617/// \returns A 256-bit floating-point vector of [8 x float]. The lower 128 bits4549/// \returns A 256-bit floating-point vector of [8 x float]. The lower 128 bits
4618/// contain the value of the parameter. The upper 128 bits are set to zero.4550/// contain the value of the parameter. The upper 128 bits are set to zero.
4619static __inline __m256 __DEFAULT_FN_ATTRS4551static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
4620_mm256_zextps128_ps256(__m128 __a)4552_mm256_zextps128_ps256(__m128 __a) {
4621{
4622 return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7);4553 return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7);
4623}4554}
46244555
...@@ -4634,9 +4565,8 @@ _mm256_zextps128_ps256(__m128 __a)...@@ -4634,9 +4565,8 @@ _mm256_zextps128_ps256(__m128 __a)
4634/// A 128-bit integer vector.4565/// A 128-bit integer vector.
4635/// \returns A 256-bit integer vector. The lower 128 bits contain the value of4566/// \returns A 256-bit integer vector. The lower 128 bits contain the value of
4636/// the parameter. The upper 128 bits are set to zero.4567/// the parameter. The upper 128 bits are set to zero.
4637static __inline __m256i __DEFAULT_FN_ATTRS4568static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4638_mm256_zextsi128_si256(__m128i __a)4569_mm256_zextsi128_si256(__m128i __a) {
4639{
4640 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3);4570 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3);
4641}4571}
46424572
...@@ -4851,9 +4781,8 @@ _mm256_zextsi128_si256(__m128i __a)...@@ -4851,9 +4781,8 @@ _mm256_zextsi128_si256(__m128i __a)
4851/// 128 bits of the result.4781/// 128 bits of the result.
4852/// \returns A 256-bit floating-point vector of [8 x float] containing the4782/// \returns A 256-bit floating-point vector of [8 x float] containing the
4853/// concatenated result.4783/// concatenated result.
4854static __inline __m256 __DEFAULT_FN_ATTRS4784static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
4855_mm256_set_m128 (__m128 __hi, __m128 __lo)4785_mm256_set_m128(__m128 __hi, __m128 __lo) {
4856{
4857 return (__m256) __builtin_shufflevector((__v4sf)__lo, (__v4sf)__hi, 0, 1, 2, 3, 4, 5, 6, 7);4786 return (__m256) __builtin_shufflevector((__v4sf)__lo, (__v4sf)__hi, 0, 1, 2, 3, 4, 5, 6, 7);
4858}4787}
48594788
...@@ -4872,9 +4801,8 @@ _mm256_set_m128 (__m128 __hi, __m128 __lo)...@@ -4872,9 +4801,8 @@ _mm256_set_m128 (__m128 __hi, __m128 __lo)
4872/// 128 bits of the result.4801/// 128 bits of the result.
4873/// \returns A 256-bit floating-point vector of [4 x double] containing the4802/// \returns A 256-bit floating-point vector of [4 x double] containing the
4874/// concatenated result.4803/// concatenated result.
4875static __inline __m256d __DEFAULT_FN_ATTRS4804static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
4876_mm256_set_m128d (__m128d __hi, __m128d __lo)4805_mm256_set_m128d(__m128d __hi, __m128d __lo) {
4877{
4878 return (__m256d) __builtin_shufflevector((__v2df)__lo, (__v2df)__hi, 0, 1, 2, 3);4806 return (__m256d) __builtin_shufflevector((__v2df)__lo, (__v2df)__hi, 0, 1, 2, 3);
4879}4807}
48804808
...@@ -4892,9 +4820,8 @@ _mm256_set_m128d (__m128d __hi, __m128d __lo)...@@ -4892,9 +4820,8 @@ _mm256_set_m128d (__m128d __hi, __m128d __lo)
4892/// A 128-bit integer vector to be copied to the lower 128 bits of the4820/// A 128-bit integer vector to be copied to the lower 128 bits of the
4893/// result.4821/// result.
4894/// \returns A 256-bit integer vector containing the concatenated result.4822/// \returns A 256-bit integer vector containing the concatenated result.
4895static __inline __m256i __DEFAULT_FN_ATTRS4823static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4896_mm256_set_m128i (__m128i __hi, __m128i __lo)4824_mm256_set_m128i(__m128i __hi, __m128i __lo) {
4897{
4898 return (__m256i) __builtin_shufflevector((__v2di)__lo, (__v2di)__hi, 0, 1, 2, 3);4825 return (__m256i) __builtin_shufflevector((__v2di)__lo, (__v2di)__hi, 0, 1, 2, 3);
4899}4826}
49004827
...@@ -4915,9 +4842,8 @@ _mm256_set_m128i (__m128i __hi, __m128i __lo)...@@ -4915,9 +4842,8 @@ _mm256_set_m128i (__m128i __hi, __m128i __lo)
4915/// 128 bits of the result.4842/// 128 bits of the result.
4916/// \returns A 256-bit floating-point vector of [8 x float] containing the4843/// \returns A 256-bit floating-point vector of [8 x float] containing the
4917/// concatenated result.4844/// concatenated result.
4918static __inline __m256 __DEFAULT_FN_ATTRS4845static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
4919_mm256_setr_m128 (__m128 __lo, __m128 __hi)4846_mm256_setr_m128(__m128 __lo, __m128 __hi) {
4920{
4921 return _mm256_set_m128(__hi, __lo);4847 return _mm256_set_m128(__hi, __lo);
4922}4848}
49234849
...@@ -4938,9 +4864,8 @@ _mm256_setr_m128 (__m128 __lo, __m128 __hi)...@@ -4938,9 +4864,8 @@ _mm256_setr_m128 (__m128 __lo, __m128 __hi)
4938/// 128 bits of the result.4864/// 128 bits of the result.
4939/// \returns A 256-bit floating-point vector of [4 x double] containing the4865/// \returns A 256-bit floating-point vector of [4 x double] containing the
4940/// concatenated result.4866/// concatenated result.
4941static __inline __m256d __DEFAULT_FN_ATTRS4867static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
4942_mm256_setr_m128d (__m128d __lo, __m128d __hi)4868_mm256_setr_m128d(__m128d __lo, __m128d __hi) {
4943{
4944 return (__m256d)_mm256_set_m128d(__hi, __lo);4869 return (__m256d)_mm256_set_m128d(__hi, __lo);
4945}4870}
49464871
...@@ -4959,9 +4884,8 @@ _mm256_setr_m128d (__m128d __lo, __m128d __hi)...@@ -4959,9 +4884,8 @@ _mm256_setr_m128d (__m128d __lo, __m128d __hi)
4959/// A 128-bit integer vector to be copied to the upper 128 bits of the4884/// A 128-bit integer vector to be copied to the upper 128 bits of the
4960/// result.4885/// result.
4961/// \returns A 256-bit integer vector containing the concatenated result.4886/// \returns A 256-bit integer vector containing the concatenated result.
4962static __inline __m256i __DEFAULT_FN_ATTRS4887static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
4963_mm256_setr_m128i (__m128i __lo, __m128i __hi)4888_mm256_setr_m128i(__m128i __lo, __m128i __hi) {
4964{
4965 return (__m256i)_mm256_set_m128i(__hi, __lo);4889 return (__m256i)_mm256_set_m128i(__hi, __lo);
4966}4890}
49674891
lib/include/avxvnniint16intrin.h+118-99
...@@ -16,9 +16,10 @@...@@ -16,9 +16,10 @@
16#define __AVXVNNIINT16INTRIN_H16#define __AVXVNNIINT16INTRIN_H
1717
18/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with18/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
19/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate19/// corresponding unsigned 16-bit integers in \a __B, producing 2
20/// signed 16-bit results. Sum these 2 results with the corresponding20/// intermediate signed 16-bit results. Sum these 2 results with the
21/// 32-bit integer in \a __W, and store the packed 32-bit results in \a dst.21/// corresponding 32-bit integer in \a __W, and store the packed 32-bit
22/// results in \a dst.
22///23///
23/// \headerfile <immintrin.h>24/// \headerfile <immintrin.h>
24///25///
...@@ -40,19 +41,21 @@...@@ -40,19 +41,21 @@
40/// \code{.operation}41/// \code{.operation}
41/// FOR j := 0 to 342/// FOR j := 0 to 3
42/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])43/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
43/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])44/// tmp2.dword :=
45/// SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
44/// dst.dword[j] := __W.dword[j] + tmp1 + tmp246/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2
45/// ENDFOR47/// ENDFOR
46/// dst[MAX:128] := 048/// dst[MAX:128] := 0
47/// \endcode49/// \endcode
48#define _mm_dpwsud_epi32(__W, __A, __B) \50#define _mm_dpwsud_epi32(__W, __A, __B) \
49 ((__m128i)__builtin_ia32_vpdpwsud128((__v4si)(__W), (__v4si)(__A), \51 ((__m128i)__builtin_ia32_vpdpwsud128((__v4si)(__W), (__v8hi)(__A), \
50 (__v4si)(__B)))52 (__v8hu)(__B)))
5153
52/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with54/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
53/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate55/// corresponding unsigned 16-bit integers in \a __B, producing 2
54/// signed 16-bit results. Sum these 2 results with the corresponding56/// intermediate signed 16-bit results. Sum these 2 results with the
55/// 32-bit integer in \a __W, and store the packed 32-bit results in \a dst.57/// corresponding 32-bit integer in \a __W, and store the packed 32-bit
58/// results in \a dst.
56///59///
57/// \headerfile <immintrin.h>60/// \headerfile <immintrin.h>
58///61///
...@@ -74,20 +77,21 @@...@@ -74,20 +77,21 @@
74/// \code{.operation}77/// \code{.operation}
75/// FOR j := 0 to 778/// FOR j := 0 to 7
76/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])79/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
77/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])80/// tmp2.dword :=
78/// dst.dword[j] := __W.dword[j] + tmp1 + tmp281/// SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
82/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2
79/// ENDFOR83/// ENDFOR
80/// dst[MAX:256] := 084/// dst[MAX:256] := 0
81/// \endcode85/// \endcode
82#define _mm256_dpwsud_epi32(__W, __A, __B) \86#define _mm256_dpwsud_epi32(__W, __A, __B) \
83 ((__m256i)__builtin_ia32_vpdpwsud256((__v8si)(__W), (__v8si)(__A), \87 ((__m256i)__builtin_ia32_vpdpwsud256((__v8si)(__W), (__v16hi)(__A), \
84 (__v8si)(__B)))88 (__v16hu)(__B)))
8589
86/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with90/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
87/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate91/// corresponding unsigned 16-bit integers in \a __B, producing 2
88/// signed 16-bit results. Sum these 2 results with the corresponding92/// intermediate signed 16-bit results. Sum these 2 results with the
89/// 32-bit integer in \a __W with signed saturation, and store the packed93/// corresponding 32-bit integer in \a __W with signed saturation, and store
90/// 32-bit results in \a dst.94/// the packed 32-bit results in \a dst.
91///95///
92/// \headerfile <immintrin.h>96/// \headerfile <immintrin.h>
93///97///
...@@ -109,20 +113,22 @@...@@ -109,20 +113,22 @@
109/// \code{.operation}113/// \code{.operation}
110/// FOR j := 0 to 3114/// FOR j := 0 to 3
111/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])115/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
112/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])116/// tmp2.dword :=
117/// SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
113/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)118/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)
114/// ENDFOR119/// ENDFOR
115/// dst[MAX:128] := 0120/// dst[MAX:128] := 0
116/// \endcode121/// \endcode
122/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
117#define _mm_dpwsuds_epi32(__W, __A, __B) \123#define _mm_dpwsuds_epi32(__W, __A, __B) \
118 ((__m128i)__builtin_ia32_vpdpwsuds128((__v4si)(__W), (__v4si)(__A), \124 ((__m128i)__builtin_ia32_vpdpwsuds128((__v4si)(__W), (__v8hi)(__A), \
119 (__v4si)(__B)))125 (__v8hu)(__B)))
120126
121/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with127/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
122/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate128/// corresponding unsigned 16-bit integers in \a __B, producing 2
123/// signed 16-bit results. Sum these 2 results with the corresponding129/// intermediate signed 16-bit results. Sum these 2 results with the
124/// 32-bit integer in \a __W with signed saturation, and store the packed130/// corresponding 32-bit integer in \a __W with signed saturation, and store
125/// 32-bit results in \a dst.131/// the packed 32-bit results in \a dst.
126///132///
127/// \headerfile <immintrin.h>133/// \headerfile <immintrin.h>
128///134///
...@@ -144,19 +150,21 @@...@@ -144,19 +150,21 @@
144/// \code{.operation}150/// \code{.operation}
145/// FOR j := 0 to 7151/// FOR j := 0 to 7
146/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])152/// tmp1.dword := SignExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
147/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])153/// tmp2.dword :=
154/// SignExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
148/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)155/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)
149/// ENDFOR156/// ENDFOR
150/// dst[MAX:256] := 0157/// dst[MAX:256] := 0
151/// \endcode158/// \endcode
152#define _mm256_dpwsuds_epi32(__W, __A, __B) \159#define _mm256_dpwsuds_epi32(__W, __A, __B) \
153 ((__m256i)__builtin_ia32_vpdpwsuds256((__v8si)(__W), (__v8si)(__A), \160 ((__m256i)__builtin_ia32_vpdpwsuds256((__v8si)(__W), (__v16hi)(__A), \
154 (__v8si)(__B)))161 (__v16hu)(__B)))
155162
156/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with163/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
157/// corresponding signed 16-bit integers in \a __B, producing 2 intermediate164/// with corresponding signed 16-bit integers in \a __B, producing 2
158/// signed 16-bit results. Sum these 2 results with the corresponding165/// intermediate signed 16-bit results. Sum these 2 results with the
159/// 32-bit integer in \a __W, and store the packed 32-bit results in \a dst.166/// corresponding 32-bit integer in \a __W, and store the packed 32-bit
167/// results in \a dst.
160///168///
161/// \headerfile <immintrin.h>169/// \headerfile <immintrin.h>
162///170///
...@@ -178,19 +186,21 @@...@@ -178,19 +186,21 @@
178/// \code{.operation}186/// \code{.operation}
179/// FOR j := 0 to 3187/// FOR j := 0 to 3
180/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])188/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
181/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])189/// tmp2.dword :=
190/// ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
182/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2191/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2
183/// ENDFOR192/// ENDFOR
184/// dst[MAX:128] := 0193/// dst[MAX:128] := 0
185/// \endcode194/// \endcode
186#define _mm_dpwusd_epi32(__W, __A, __B) \195#define _mm_dpwusd_epi32(__W, __A, __B) \
187 ((__m128i)__builtin_ia32_vpdpwusd128((__v4si)(__W), (__v4si)(__A), \196 ((__m128i)__builtin_ia32_vpdpwusd128((__v4si)(__W), (__v8hu)(__A), \
188 (__v4si)(__B)))197 (__v8hi)(__B)))
189198
190/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with199/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
191/// corresponding signed 16-bit integers in \a __B, producing 2 intermediate200/// with corresponding signed 16-bit integers in \a __B, producing 2
192/// signed 16-bit results. Sum these 2 results with the corresponding201/// intermediate signed 16-bit results. Sum these 2 results with the
193/// 32-bit integer in \a __W, and store the packed 32-bit results in \a dst.202/// corresponding 32-bit integer in \a __W, and store the packed 32-bit
203/// results in \a dst.
194///204///
195/// \headerfile <immintrin.h>205/// \headerfile <immintrin.h>
196///206///
...@@ -212,20 +222,21 @@...@@ -212,20 +222,21 @@
212/// \code{.operation}222/// \code{.operation}
213/// FOR j := 0 to 7223/// FOR j := 0 to 7
214/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])224/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
215/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])225/// tmp2.dword :=
226/// ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
216/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2227/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2
217/// ENDFOR228/// ENDFOR
218/// dst[MAX:256] := 0229/// dst[MAX:256] := 0
219/// \endcode230/// \endcode
220#define _mm256_dpwusd_epi32(__W, __A, __B) \231#define _mm256_dpwusd_epi32(__W, __A, __B) \
221 ((__m256i)__builtin_ia32_vpdpwusd256((__v8si)(__W), (__v8si)(__A), \232 ((__m256i)__builtin_ia32_vpdpwusd256((__v8si)(__W), (__v16hu)(__A), \
222 (__v8si)(__B)))233 (__v16hi)(__B)))
223234
224/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with235/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
225/// corresponding signed 16-bit integers in \a __B, producing 2 intermediate236/// with corresponding signed 16-bit integers in \a __B, producing 2
226/// signed 16-bit results. Sum these 2 results with the corresponding237/// intermediate signed 16-bit results. Sum these 2 results with the
227/// 32-bit integer in \a __W with signed saturation, and store the packed238/// corresponding 32-bit integer in \a __W with signed saturation, and
228/// 32-bit results in \a dst.239/// store the packed 32-bit results in \a dst.
229///240///
230/// \headerfile <immintrin.h>241/// \headerfile <immintrin.h>
231///242///
...@@ -233,7 +244,7 @@...@@ -233,7 +244,7 @@
233/// __m128i _mm_dpwusds_epi32(__m128i __W, __m128i __A, __m128i __B)244/// __m128i _mm_dpwusds_epi32(__m128i __W, __m128i __A, __m128i __B)
234/// \endcode245/// \endcode
235///246///
236/// This intrinsic corresponds to the \c VPDPWSUDS instruction.247/// This intrinsic corresponds to the \c VPDPWUSDS instruction.
237///248///
238/// \param __W249/// \param __W
239/// A 128-bit vector of [4 x int].250/// A 128-bit vector of [4 x int].
...@@ -247,20 +258,21 @@...@@ -247,20 +258,21 @@
247/// \code{.operation}258/// \code{.operation}
248/// FOR j := 0 to 3259/// FOR j := 0 to 3
249/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])260/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
250/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])261/// tmp2.dword :=
262/// ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
251/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)263/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)
252/// ENDFOR264/// ENDFOR
253/// dst[MAX:128] := 0265/// dst[MAX:128] := 0
254/// \endcode266/// \endcode
255#define _mm_dpwusds_epi32(__W, __A, __B) \267#define _mm_dpwusds_epi32(__W, __A, __B) \
256 ((__m128i)__builtin_ia32_vpdpwusds128((__v4si)(__W), (__v4si)(__A), \268 ((__m128i)__builtin_ia32_vpdpwusds128((__v4si)(__W), (__v8hu)(__A), \
257 (__v4si)(__B)))269 (__v8hi)(__B)))
258270
259/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with271/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
260/// corresponding signed 16-bit integers in \a __B, producing 2 intermediate272/// with corresponding signed 16-bit integers in \a __B, producing 2
261/// signed 16-bit results. Sum these 2 results with the corresponding273/// intermediate signed 16-bit results. Sum these 2 results with the
262/// 32-bit integer in \a __W with signed saturation, and store the packed274/// corresponding 32-bit integer in \a __W with signed saturation, and
263/// 32-bit results in \a dst.275/// store the packed 32-bit results in \a dst.
264///276///
265/// \headerfile <immintrin.h>277/// \headerfile <immintrin.h>
266///278///
...@@ -268,7 +280,7 @@...@@ -268,7 +280,7 @@
268/// __m256i _mm256_dpwsuds_epi32(__m256i __W, __m256i __A, __m256i __B)280/// __m256i _mm256_dpwsuds_epi32(__m256i __W, __m256i __A, __m256i __B)
269/// \endcode281/// \endcode
270///282///
271/// This intrinsic corresponds to the \c VPDPWSUDS instruction.283/// This intrinsic corresponds to the \c VPDPWUSDS instruction.
272///284///
273/// \param __W285/// \param __W
274/// A 256-bit vector of [8 x int].286/// A 256-bit vector of [8 x int].
...@@ -282,19 +294,21 @@...@@ -282,19 +294,21 @@
282/// \code{.operation}294/// \code{.operation}
283/// FOR j := 0 to 7295/// FOR j := 0 to 7
284/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])296/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
285/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])297/// tmp2.dword :=
298/// ZeroExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
286/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)299/// dst.dword[j] := SIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)
287/// ENDFOR300/// ENDFOR
288/// dst[MAX:256] := 0301/// dst[MAX:256] := 0
289/// \endcode302/// \endcode
290#define _mm256_dpwusds_epi32(__W, __A, __B) \303#define _mm256_dpwusds_epi32(__W, __A, __B) \
291 ((__m256i)__builtin_ia32_vpdpwusds256((__v8si)(__W), (__v8si)(__A), \304 ((__m256i)__builtin_ia32_vpdpwusds256((__v8si)(__W), (__v16hu)(__A), \
292 (__v8si)(__B)))305 (__v16hi)(__B)))
293306
294/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with307/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
295/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate308/// with corresponding unsigned 16-bit integers in \a __B, producing 2
296/// signed 16-bit results. Sum these 2 results with the corresponding309/// intermediate signed 16-bit results. Sum these 2 results with the
297/// 32-bit integer in \a __W, and store the packed 32-bit results in \a dst.310/// corresponding 32-bit integer in \a __W, and store the packed 32-bit
311/// results in \a dst.
298///312///
299/// \headerfile <immintrin.h>313/// \headerfile <immintrin.h>
300///314///
...@@ -305,30 +319,32 @@...@@ -305,30 +319,32 @@
305/// This intrinsic corresponds to the \c VPDPWUUD instruction.319/// This intrinsic corresponds to the \c VPDPWUUD instruction.
306///320///
307/// \param __W321/// \param __W
308/// A 128-bit vector of [4 x unsigned int].322/// A 128-bit vector of [4 x int].
309/// \param __A323/// \param __A
310/// A 128-bit vector of [8 x unsigned short].324/// A 128-bit vector of [8 x unsigned short].
311/// \param __B325/// \param __B
312/// A 128-bit vector of [8 x unsigned short].326/// A 128-bit vector of [8 x unsigned short].
313/// \returns327/// \returns
314/// A 128-bit vector of [4 x unsigned int].328/// A 128-bit vector of [4 x int].
315///329///
316/// \code{.operation}330/// \code{.operation}
317/// FOR j := 0 to 3331/// FOR j := 0 to 3
318/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])332/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
319/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])333/// tmp2.dword :=
334/// ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
320/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2335/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2
321/// ENDFOR336/// ENDFOR
322/// dst[MAX:128] := 0337/// dst[MAX:128] := 0
323/// \endcode338/// \endcode
324#define _mm_dpwuud_epi32(__W, __A, __B) \339#define _mm_dpwuud_epi32(__W, __A, __B) \
325 ((__m128i)__builtin_ia32_vpdpwuud128((__v4si)(__W), (__v4si)(__A), \340 ((__m128i)__builtin_ia32_vpdpwuud128((__v4si)(__W), (__v8hu)(__A), \
326 (__v4si)(__B)))341 (__v8hu)(__B)))
327342
328/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with343/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
329/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate344/// with corresponding unsigned 16-bit integers in \a __B, producing 2
330/// signed 16-bit results. Sum these 2 results with the corresponding345/// intermediate signed 16-bit results. Sum these 2 results with the
331/// 32-bit integer in \a __W, and store the packed 32-bit results in \a dst.346/// corresponding 32-bit integer in \a __W, and store the packed 32-bit
347/// results in \a dst.
332///348///
333/// \headerfile <immintrin.h>349/// \headerfile <immintrin.h>
334///350///
...@@ -339,31 +355,32 @@...@@ -339,31 +355,32 @@
339/// This intrinsic corresponds to the \c VPDPWUUD instruction.355/// This intrinsic corresponds to the \c VPDPWUUD instruction.
340///356///
341/// \param __W357/// \param __W
342/// A 256-bit vector of [8 x unsigned int].358/// A 256-bit vector of [8 x int].
343/// \param __A359/// \param __A
344/// A 256-bit vector of [16 x unsigned short].360/// A 256-bit vector of [16 x unsigned short].
345/// \param __B361/// \param __B
346/// A 256-bit vector of [16 x unsigned short].362/// A 256-bit vector of [16 x unsigned short].
347/// \returns363/// \returns
348/// A 256-bit vector of [8 x unsigned int].364/// A 256-bit vector of [8 x int].
349///365///
350/// \code{.operation}366/// \code{.operation}
351/// FOR j := 0 to 7367/// FOR j := 0 to 7
352/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])368/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
353/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])369/// tmp2.dword :=
370/// ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
354/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2371/// dst.dword[j] := __W.dword[j] + tmp1 + tmp2
355/// ENDFOR372/// ENDFOR
356/// dst[MAX:256] := 0373/// dst[MAX:256] := 0
357/// \endcode374/// \endcode
358#define _mm256_dpwuud_epi32(__W, __A, __B) \375#define _mm256_dpwuud_epi32(__W, __A, __B) \
359 ((__m256i)__builtin_ia32_vpdpwuud256((__v8si)(__W), (__v8si)(__A), \376 ((__m256i)__builtin_ia32_vpdpwuud256((__v8si)(__W), (__v16hu)(__A), \
360 (__v8si)(__B)))377 (__v16hu)(__B)))
361378
362/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with379/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
363/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate380/// with corresponding unsigned 16-bit integers in \a __B, producing 2
364/// signed 16-bit results. Sum these 2 results with the corresponding381/// intermediate signed 16-bit results. Sum these 2 results with the
365/// 32-bit integer in \a __W with signed saturation, and store the packed382/// corresponding 32-bit integer in \a __W with signed saturation, and store
366/// 32-bit results in \a dst.383/// the packed 32-bit results in \a dst.
367///384///
368/// \headerfile <immintrin.h>385/// \headerfile <immintrin.h>
369///386///
...@@ -371,34 +388,35 @@...@@ -371,34 +388,35 @@
371/// __m128i _mm_dpwsuds_epi32(__m128i __W, __m128i __A, __m128i __B)388/// __m128i _mm_dpwsuds_epi32(__m128i __W, __m128i __A, __m128i __B)
372/// \endcode389/// \endcode
373///390///
374/// This intrinsic corresponds to the \c VPDPWSUDS instruction.391/// This intrinsic corresponds to the \c VPDPWUUDS instruction.
375///392///
376/// \param __W393/// \param __W
377/// A 128-bit vector of [4 x unsigned int].394/// A 128-bit vector of [4 x int].
378/// \param __A395/// \param __A
379/// A 128-bit vector of [8 x unsigned short].396/// A 128-bit vector of [8 x unsigned short].
380/// \param __B397/// \param __B
381/// A 128-bit vector of [8 x unsigned short].398/// A 128-bit vector of [8 x unsigned short].
382/// \returns399/// \returns
383/// A 128-bit vector of [4 x unsigned int].400/// A 128-bit vector of [4 x int].
384///401///
385/// \code{.operation}402/// \code{.operation}
386/// FOR j := 0 to 3403/// FOR j := 0 to 3
387/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])404/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
388/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])405/// tmp2.dword :=
406/// ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
389/// dst.dword[j] := UNSIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)407/// dst.dword[j] := UNSIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)
390/// ENDFOR408/// ENDFOR
391/// dst[MAX:128] := 0409/// dst[MAX:128] := 0
392/// \endcode410/// \endcode
393#define _mm_dpwuuds_epi32(__W, __A, __B) \411#define _mm_dpwuuds_epi32(__W, __A, __B) \
394 ((__m128i)__builtin_ia32_vpdpwuuds128((__v4si)(__W), (__v4si)(__A), \412 ((__m128i)__builtin_ia32_vpdpwuuds128((__v4si)(__W), (__v8hu)(__A), \
395 (__v4si)(__B)))413 (__v8hu)(__B)))
396414
397/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A with415/// Multiply groups of 2 adjacent pairs of unsigned 16-bit integers in \a __A
398/// corresponding unsigned 16-bit integers in \a __B, producing 2 intermediate416/// with corresponding unsigned 16-bit integers in \a __B, producing 2
399/// signed 16-bit results. Sum these 2 results with the corresponding417/// intermediate signed 16-bit results. Sum these 2 results with the
400/// 32-bit integer in \a __W with signed saturation, and store the packed418/// corresponding 32-bit integer in \a __W with signed saturation, and store
401/// 32-bit results in \a dst.419/// the packed 32-bit results in \a dst.
402///420///
403/// \headerfile <immintrin.h>421/// \headerfile <immintrin.h>
404///422///
...@@ -406,27 +424,28 @@...@@ -406,27 +424,28 @@
406/// __m256i _mm256_dpwuuds_epi32(__m256i __W, __m256i __A, __m256i __B)424/// __m256i _mm256_dpwuuds_epi32(__m256i __W, __m256i __A, __m256i __B)
407/// \endcode425/// \endcode
408///426///
409/// This intrinsic corresponds to the \c VPDPWSUDS instruction.427/// This intrinsic corresponds to the \c VPDPWUUDS instruction.
410///428///
411/// \param __W429/// \param __W
412/// A 256-bit vector of [8 x unsigned int].430/// A 256-bit vector of [8 x int].
413/// \param __A431/// \param __A
414/// A 256-bit vector of [16 x unsigned short].432/// A 256-bit vector of [16 x unsigned short].
415/// \param __B433/// \param __B
416/// A 256-bit vector of [16 x unsigned short].434/// A 256-bit vector of [16 x unsigned short].
417/// \returns435/// \returns
418/// A 256-bit vector of [8 x unsigned int].436/// A 256-bit vector of [8 x int].
419///437///
420/// \code{.operation}438/// \code{.operation}
421/// FOR j := 0 to 7439/// FOR j := 0 to 7
422/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])440/// tmp1.dword := ZeroExtend32(__A.word[2*j]) * ZeroExtend32(__B.word[2*j])
423/// tmp2.dword := ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])441/// tmp2.dword :=
442/// ZeroExtend32(__A.word[2*j+1]) * ZeroExtend32(__B.word[2*j+1])
424/// dst.dword[j] := UNSIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)443/// dst.dword[j] := UNSIGNED_DWORD_SATURATE(__W.dword[j] + tmp1 + tmp2)
425/// ENDFOR444/// ENDFOR
426/// dst[MAX:256] := 0445/// dst[MAX:256] := 0
427/// \endcode446/// \endcode
428#define _mm256_dpwuuds_epi32(__W, __A, __B) \447#define _mm256_dpwuuds_epi32(__W, __A, __B) \
429 ((__m256i)__builtin_ia32_vpdpwuuds256((__v8si)(__W), (__v8si)(__A), \448 ((__m256i)__builtin_ia32_vpdpwuuds256((__v8si)(__W), (__v16hu)(__A), \
430 (__v8si)(__B)))449 (__v16hu)(__B)))
431450
432#endif // __AVXVNNIINT16INTRIN_H451#endif // __AVXVNNIINT16INTRIN_H
lib/include/avxvnniint8intrin.h+56-32
...@@ -14,6 +14,7 @@...@@ -14,6 +14,7 @@
14#ifndef __AVXVNNIINT8INTRIN_H14#ifndef __AVXVNNIINT8INTRIN_H
15#define __AVXVNNIINT8INTRIN_H15#define __AVXVNNIINT8INTRIN_H
1616
17// clang-format off
17/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with18/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
18/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate19/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate
19/// signed 16-bit results. Sum these 4 results with the corresponding20/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -44,10 +45,12 @@...@@ -44,10 +45,12 @@
44/// ENDFOR45/// ENDFOR
45/// dst[MAX:128] := 046/// dst[MAX:128] := 0
46/// \endcode47/// \endcode
48// clang-format on
47#define _mm_dpbssd_epi32(__W, __A, __B) \49#define _mm_dpbssd_epi32(__W, __A, __B) \
48 ((__m128i)__builtin_ia32_vpdpbssd128((__v4si)(__W), (__v4si)(__A), \50 ((__m128i)__builtin_ia32_vpdpbssd128((__v4si)(__W), (__v16qi)(__A), \
49 (__v4si)(__B)))51 (__v16qi)(__B)))
5052
53// clang-format off
51/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with54/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
52/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate55/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate
53/// signed 16-bit results. Sum these 4 results with the corresponding56/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -78,10 +81,12 @@...@@ -78,10 +81,12 @@
78/// ENDFOR81/// ENDFOR
79/// dst[MAX:256] := 082/// dst[MAX:256] := 0
80/// \endcode83/// \endcode
84// clang-format on
81#define _mm256_dpbssd_epi32(__W, __A, __B) \85#define _mm256_dpbssd_epi32(__W, __A, __B) \
82 ((__m256i)__builtin_ia32_vpdpbssd256((__v8si)(__W), (__v8si)(__A), \86 ((__m256i)__builtin_ia32_vpdpbssd256((__v8si)(__W), (__v32qi)(__A), \
83 (__v8si)(__B)))87 (__v32qi)(__B)))
8488
89// clang-format off
85/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with90/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
86/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate91/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate
87/// signed 16-bit results. Sum these 4 results with the corresponding92/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -94,7 +99,7 @@...@@ -94,7 +99,7 @@
94/// _mm_dpbssds_epi32( __m128i __W, __m128i __A, __m128i __B);99/// _mm_dpbssds_epi32( __m128i __W, __m128i __A, __m128i __B);
95/// \endcode100/// \endcode
96///101///
97/// This intrinsic corresponds to the \c VPDPBSSD instruction.102/// This intrinsic corresponds to the \c VPDPBSSDS instruction.
98///103///
99/// \param __A104/// \param __A
100/// A 128-bit vector of [16 x char].105/// A 128-bit vector of [16 x char].
...@@ -113,10 +118,12 @@...@@ -113,10 +118,12 @@
113/// ENDFOR118/// ENDFOR
114/// dst[MAX:128] := 0119/// dst[MAX:128] := 0
115/// \endcode120/// \endcode
121// clang-format on
116#define _mm_dpbssds_epi32(__W, __A, __B) \122#define _mm_dpbssds_epi32(__W, __A, __B) \
117 ((__m128i)__builtin_ia32_vpdpbssds128((__v4si)(__W), (__v4si)(__A), \123 ((__m128i)__builtin_ia32_vpdpbssds128((__v4si)(__W), (__v16qi)(__A), \
118 (__v4si)(__B)))124 (__v16qi)(__B)))
119125
126// clang-format off
120/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with127/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
121/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate128/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate
122/// signed 16-bit results. Sum these 4 results with the corresponding129/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -129,7 +136,7 @@...@@ -129,7 +136,7 @@
129/// _mm256_dpbssds_epi32(__m256i __W, __m256i __A, __m256i __B);136/// _mm256_dpbssds_epi32(__m256i __W, __m256i __A, __m256i __B);
130/// \endcode137/// \endcode
131///138///
132/// This intrinsic corresponds to the \c VPDPBSSD instruction.139/// This intrinsic corresponds to the \c VPDPBSSDS instruction.
133///140///
134/// \param __A141/// \param __A
135/// A 256-bit vector of [32 x char].142/// A 256-bit vector of [32 x char].
...@@ -148,10 +155,12 @@...@@ -148,10 +155,12 @@
148/// ENDFOR155/// ENDFOR
149/// dst[MAX:256] := 0156/// dst[MAX:256] := 0
150/// \endcode157/// \endcode
158// clang-format on
151#define _mm256_dpbssds_epi32(__W, __A, __B) \159#define _mm256_dpbssds_epi32(__W, __A, __B) \
152 ((__m256i)__builtin_ia32_vpdpbssds256((__v8si)(__W), (__v8si)(__A), \160 ((__m256i)__builtin_ia32_vpdpbssds256((__v8si)(__W), (__v32qi)(__A), \
153 (__v8si)(__B)))161 (__v32qi)(__B)))
154162
163// clang-format off
155/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with164/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
156/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate165/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
157/// signed 16-bit results. Sum these 4 results with the corresponding166/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -163,7 +172,7 @@...@@ -163,7 +172,7 @@
163/// _mm_dpbsud_epi32(__m128i __W, __m128i __A, __m128i __B);172/// _mm_dpbsud_epi32(__m128i __W, __m128i __A, __m128i __B);
164/// \endcode173/// \endcode
165///174///
166/// This intrinsic corresponds to the \c VPDPBSSD instruction.175/// This intrinsic corresponds to the \c VPDPBSUD instruction.
167///176///
168/// \param __A177/// \param __A
169/// A 128-bit vector of [16 x char].178/// A 128-bit vector of [16 x char].
...@@ -182,10 +191,12 @@...@@ -182,10 +191,12 @@
182/// ENDFOR191/// ENDFOR
183/// dst[MAX:128] := 0192/// dst[MAX:128] := 0
184/// \endcode193/// \endcode
194// clang-format on
185#define _mm_dpbsud_epi32(__W, __A, __B) \195#define _mm_dpbsud_epi32(__W, __A, __B) \
186 ((__m128i)__builtin_ia32_vpdpbsud128((__v4si)(__W), (__v4si)(__A), \196 ((__m128i)__builtin_ia32_vpdpbsud128((__v4si)(__W), (__v16qi)(__A), \
187 (__v4si)(__B)))197 (__v16qu)(__B)))
188198
199// clang-format off
189/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with200/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
190/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate201/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
191/// signed 16-bit results. Sum these 4 results with the corresponding202/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -197,7 +208,7 @@...@@ -197,7 +208,7 @@
197/// _mm256_dpbsud_epi32(__m256i __W, __m256i __A, __m256i __B);208/// _mm256_dpbsud_epi32(__m256i __W, __m256i __A, __m256i __B);
198/// \endcode209/// \endcode
199///210///
200/// This intrinsic corresponds to the \c VPDPBSSD instruction.211/// This intrinsic corresponds to the \c VPDPBSUD instruction.
201///212///
202/// \param __A213/// \param __A
203/// A 256-bit vector of [32 x char].214/// A 256-bit vector of [32 x char].
...@@ -216,10 +227,12 @@...@@ -216,10 +227,12 @@
216/// ENDFOR227/// ENDFOR
217/// dst[MAX:256] := 0228/// dst[MAX:256] := 0
218/// \endcode229/// \endcode
230// clang-format on
219#define _mm256_dpbsud_epi32(__W, __A, __B) \231#define _mm256_dpbsud_epi32(__W, __A, __B) \
220 ((__m256i)__builtin_ia32_vpdpbsud256((__v8si)(__W), (__v8si)(__A), \232 ((__m256i)__builtin_ia32_vpdpbsud256((__v8si)(__W), (__v32qi)(__A), \
221 (__v8si)(__B)))233 (__v32qu)(__B)))
222234
235// clang-format off
223/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with236/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
224/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate237/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
225/// signed 16-bit results. Sum these 4 results with the corresponding238/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -232,7 +245,7 @@...@@ -232,7 +245,7 @@
232/// _mm_dpbsuds_epi32( __m128i __W, __m128i __A, __m128i __B);245/// _mm_dpbsuds_epi32( __m128i __W, __m128i __A, __m128i __B);
233/// \endcode246/// \endcode
234///247///
235/// This intrinsic corresponds to the \c VPDPBSSD instruction.248/// This intrinsic corresponds to the \c VPDPBSUDS instruction.
236///249///
237/// \param __A250/// \param __A
238/// A 128-bit vector of [16 x char].251/// A 128-bit vector of [16 x char].
...@@ -251,10 +264,12 @@...@@ -251,10 +264,12 @@
251/// ENDFOR264/// ENDFOR
252/// dst[MAX:128] := 0265/// dst[MAX:128] := 0
253/// \endcode266/// \endcode
267// clang-format on
254#define _mm_dpbsuds_epi32(__W, __A, __B) \268#define _mm_dpbsuds_epi32(__W, __A, __B) \
255 ((__m128i)__builtin_ia32_vpdpbsuds128((__v4si)(__W), (__v4si)(__A), \269 ((__m128i)__builtin_ia32_vpdpbsuds128((__v4si)(__W), (__v16qi)(__A), \
256 (__v4si)(__B)))270 (__v16qu)(__B)))
257271
272// clang-format off
258/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with273/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in \a __A with
259/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate274/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
260/// signed 16-bit results. Sum these 4 results with the corresponding275/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -267,7 +282,7 @@...@@ -267,7 +282,7 @@
267/// _mm256_dpbsuds_epi32(__m256i __W, __m256i __A, __m256i __B);282/// _mm256_dpbsuds_epi32(__m256i __W, __m256i __A, __m256i __B);
268/// \endcode283/// \endcode
269///284///
270/// This intrinsic corresponds to the \c VPDPBSSD instruction.285/// This intrinsic corresponds to the \c VPDPBSUDS instruction.
271///286///
272/// \param __A287/// \param __A
273/// A 256-bit vector of [32 x char].288/// A 256-bit vector of [32 x char].
...@@ -286,10 +301,12 @@...@@ -286,10 +301,12 @@
286/// ENDFOR301/// ENDFOR
287/// dst[MAX:256] := 0302/// dst[MAX:256] := 0
288/// \endcode303/// \endcode
304// clang-format on
289#define _mm256_dpbsuds_epi32(__W, __A, __B) \305#define _mm256_dpbsuds_epi32(__W, __A, __B) \
290 ((__m256i)__builtin_ia32_vpdpbsuds256((__v8si)(__W), (__v8si)(__A), \306 ((__m256i)__builtin_ia32_vpdpbsuds256((__v8si)(__W), (__v32qi)(__A), \
291 (__v8si)(__B)))307 (__v32qu)(__B)))
292308
309// clang-format off
293/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with310/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
294/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate311/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
295/// signed 16-bit results. Sum these 4 results with the corresponding312/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -301,7 +318,7 @@...@@ -301,7 +318,7 @@
301/// _mm_dpbuud_epi32(__m128i __W, __m128i __A, __m128i __B);318/// _mm_dpbuud_epi32(__m128i __W, __m128i __A, __m128i __B);
302/// \endcode319/// \endcode
303///320///
304/// This intrinsic corresponds to the \c VPDPBSSD instruction.321/// This intrinsic corresponds to the \c VPDPBUUD instruction.
305///322///
306/// \param __A323/// \param __A
307/// A 128-bit vector of [16 x unsigned char].324/// A 128-bit vector of [16 x unsigned char].
...@@ -320,10 +337,12 @@...@@ -320,10 +337,12 @@
320/// ENDFOR337/// ENDFOR
321/// dst[MAX:128] := 0338/// dst[MAX:128] := 0
322/// \endcode339/// \endcode
340// clang-format on
323#define _mm_dpbuud_epi32(__W, __A, __B) \341#define _mm_dpbuud_epi32(__W, __A, __B) \
324 ((__m128i)__builtin_ia32_vpdpbuud128((__v4si)(__W), (__v4si)(__A), \342 ((__m128i)__builtin_ia32_vpdpbuud128((__v4si)(__W), (__v16qu)(__A), \
325 (__v4si)(__B)))343 (__v16qu)(__B)))
326344
345// clang-format off
327/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with346/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
328/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate347/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
329/// signed 16-bit results. Sum these 4 results with the corresponding348/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -335,7 +354,7 @@...@@ -335,7 +354,7 @@
335/// _mm256_dpbuud_epi32(__m256i __W, __m256i __A, __m256i __B);354/// _mm256_dpbuud_epi32(__m256i __W, __m256i __A, __m256i __B);
336/// \endcode355/// \endcode
337///356///
338/// This intrinsic corresponds to the \c VPDPBSSD instruction.357/// This intrinsic corresponds to the \c VPDPBUUD instruction.
339///358///
340/// \param __A359/// \param __A
341/// A 256-bit vector of [32 x unsigned char].360/// A 256-bit vector of [32 x unsigned char].
...@@ -354,10 +373,12 @@...@@ -354,10 +373,12 @@
354/// ENDFOR373/// ENDFOR
355/// dst[MAX:256] := 0374/// dst[MAX:256] := 0
356/// \endcode375/// \endcode
376// clang-format on
357#define _mm256_dpbuud_epi32(__W, __A, __B) \377#define _mm256_dpbuud_epi32(__W, __A, __B) \
358 ((__m256i)__builtin_ia32_vpdpbuud256((__v8si)(__W), (__v8si)(__A), \378 ((__m256i)__builtin_ia32_vpdpbuud256((__v8si)(__W), (__v32qu)(__A), \
359 (__v8si)(__B)))379 (__v32qu)(__B)))
360380
381// clang-format off
361/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with382/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
362/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate383/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
363/// signed 16-bit results. Sum these 4 results with the corresponding384/// signed 16-bit results. Sum these 4 results with the corresponding
...@@ -389,10 +410,12 @@...@@ -389,10 +410,12 @@
389/// ENDFOR410/// ENDFOR
390/// dst[MAX:128] := 0411/// dst[MAX:128] := 0
391/// \endcode412/// \endcode
413// clang-format on
392#define _mm_dpbuuds_epi32(__W, __A, __B) \414#define _mm_dpbuuds_epi32(__W, __A, __B) \
393 ((__m128i)__builtin_ia32_vpdpbuuds128((__v4si)(__W), (__v4si)(__A), \415 ((__m128i)__builtin_ia32_vpdpbuuds128((__v4si)(__W), (__v16qu)(__A), \
394 (__v4si)(__B)))416 (__v16qu)(__B)))
395417
418// clang-format off
396/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate419/// corresponding unsigned 8-bit integers in \a __B, producing 4 intermediate
397/// signed 16-bit results. Sum these 4 results with the corresponding420/// signed 16-bit results. Sum these 4 results with the corresponding
398/// 32-bit integer in \a __W with signed saturation, and store the packed421/// 32-bit integer in \a __W with signed saturation, and store the packed
...@@ -423,8 +446,9 @@...@@ -423,8 +446,9 @@
423/// ENDFOR446/// ENDFOR
424/// dst[MAX:256] := 0447/// dst[MAX:256] := 0
425/// \endcode448/// \endcode
449// clang-format on
426#define _mm256_dpbuuds_epi32(__W, __A, __B) \450#define _mm256_dpbuuds_epi32(__W, __A, __B) \
427 ((__m256i)__builtin_ia32_vpdpbuuds256((__v8si)(__W), (__v8si)(__A), \451 ((__m256i)__builtin_ia32_vpdpbuuds256((__v8si)(__W), (__v32qu)(__A), \
428 (__v8si)(__B)))452 (__v32qu)(__B)))
429453
430#endif // __AVXVNNIINT8INTRIN_H454#endif // __AVXVNNIINT8INTRIN_H
lib/include/avxvnniintrin.h+16-8
...@@ -63,7 +63,8 @@...@@ -63,7 +63,8 @@
63static __inline__ __m256i __DEFAULT_FN_ATTRS25663static __inline__ __m256i __DEFAULT_FN_ATTRS256
64_mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)64_mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
65{65{
66 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v8si)__A, (__v8si)__B);66 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v32qu)__A,
67 (__v32qi)__B);
67}68}
6869
69/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with70/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
...@@ -86,7 +87,8 @@ _mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -86,7 +87,8 @@ _mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
86static __inline__ __m256i __DEFAULT_FN_ATTRS25687static __inline__ __m256i __DEFAULT_FN_ATTRS256
87_mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)88_mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
88{89{
89 return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v8si)__A, (__v8si)__B);90 return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v32qu)__A,
91 (__v32qi)__B);
90}92}
9193
92/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with94/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
...@@ -107,7 +109,8 @@ _mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -107,7 +109,8 @@ _mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
107static __inline__ __m256i __DEFAULT_FN_ATTRS256109static __inline__ __m256i __DEFAULT_FN_ATTRS256
108_mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)110_mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
109{111{
110 return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v8si)__A, (__v8si)__B);112 return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v16hi)__A,
113 (__v16hi)__B);
111}114}
112115
113/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with116/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
...@@ -128,7 +131,8 @@ _mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -128,7 +131,8 @@ _mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
128static __inline__ __m256i __DEFAULT_FN_ATTRS256131static __inline__ __m256i __DEFAULT_FN_ATTRS256
129_mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)132_mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
130{133{
131 return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v8si)__A, (__v8si)__B);134 return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v16hi)__A,
135 (__v16hi)__B);
132}136}
133137
134/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with138/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
...@@ -151,7 +155,8 @@ _mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -151,7 +155,8 @@ _mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
151static __inline__ __m128i __DEFAULT_FN_ATTRS128155static __inline__ __m128i __DEFAULT_FN_ATTRS128
152_mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)156_mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
153{157{
154 return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v4si)__A, (__v4si)__B);158 return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v16qu)__A,
159 (__v16qi)__B);
155}160}
156161
157/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with162/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
...@@ -174,7 +179,8 @@ _mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)...@@ -174,7 +179,8 @@ _mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
174static __inline__ __m128i __DEFAULT_FN_ATTRS128179static __inline__ __m128i __DEFAULT_FN_ATTRS128
175_mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)180_mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
176{181{
177 return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v4si)__A, (__v4si)__B);182 return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v16qu)__A,
183 (__v16qi)__B);
178}184}
179185
180/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with186/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
...@@ -195,7 +201,8 @@ _mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)...@@ -195,7 +201,8 @@ _mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
195static __inline__ __m128i __DEFAULT_FN_ATTRS128201static __inline__ __m128i __DEFAULT_FN_ATTRS128
196_mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)202_mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
197{203{
198 return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v4si)__A, (__v4si)__B);204 return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v8hi)__A,
205 (__v8hi)__B);
199}206}
200207
201/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with208/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
...@@ -216,7 +223,8 @@ _mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)...@@ -216,7 +223,8 @@ _mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
216static __inline__ __m128i __DEFAULT_FN_ATTRS128223static __inline__ __m128i __DEFAULT_FN_ATTRS128
217_mm_dpwssds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)224_mm_dpwssds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
218{225{
219 return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v4si)__A, (__v4si)__B);226 return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v8hi)__A,
227 (__v8hi)__B);
220}228}
221229
222#undef __DEFAULT_FN_ATTRS128230#undef __DEFAULT_FN_ATTRS128
lib/include/cpuid.h+101-4
...@@ -253,10 +253,6 @@...@@ -253,10 +253,6 @@
253#define bit_RDPRU 0x00000010253#define bit_RDPRU 0x00000010
254#define bit_WBNOINVD 0x00000200254#define bit_WBNOINVD 0x00000200
255255
256/* Features in %ebx for leaf 0x24 */
257#define bit_AVX10_256 0x00020000
258#define bit_AVX10_512 0x00040000
259
260#ifdef __i386__256#ifdef __i386__
261#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \257#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
262 __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \258 __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
...@@ -282,6 +278,24 @@...@@ -282,6 +278,24 @@
282 : "0"(__leaf), "2"(__count))278 : "0"(__leaf), "2"(__count))
283#endif279#endif
284280
281/// Queries the processor to determine the highest supported \c CPUID leaf.
282/// This intrinsic is only available on x86 and x64.
283///
284/// \headerfile <cpuid.h>
285///
286/// This intrinsic corresponds to the <c> CPUID </c> instruction.
287///
288/// \param __leaf
289/// \a __leaf can be either 0x0 or 0x8000000. If \a __leaf == 0x0, the
290/// highest supported value for basic \c CPUID information is returned.
291/// If \a __leaf == 0x8000000, the highest supported value for extended
292/// \c CPUID information is returned.
293/// \param __sig
294/// If the \a __sig pointer is non-null, the first four bytes of the
295/// signature (as found in the \c EBX register) are returned in the
296/// location pointed to by \a __sig.
297/// \returns Returns 0 if \c CPUID is supported; otherwise returns the value
298/// that \c CPUID returns in the \c EAX register.
285static __inline unsigned int __get_cpuid_max (unsigned int __leaf,299static __inline unsigned int __get_cpuid_max (unsigned int __leaf,
286 unsigned int *__sig)300 unsigned int *__sig)
287{301{
...@@ -315,6 +329,32 @@ static __inline unsigned int __get_cpuid_max (unsigned int __leaf,...@@ -315,6 +329,32 @@ static __inline unsigned int __get_cpuid_max (unsigned int __leaf,
315 return __eax;329 return __eax;
316}330}
317331
332/// For the requested \c CPUID leaf, queries the processor for information
333/// about the CPU type and CPU features (such as processor vendor, supported
334/// instruction sets, CPU capabilities, cache sizes, CPU model and family, and
335/// other hardware details). This intrinsic is only available on x86 and x64.
336///
337/// \headerfile <cpuid.h>
338///
339/// This intrinsic corresponds to the <c> CPUID </c> instruction.
340///
341/// \param __leaf
342/// An unsigned integer that identifies the level (also called "leaf") at
343/// which the \c CPUID instruction will be executed.
344/// \param __eax
345/// A pointer to an integer that corresponds to the \c EAX register where
346/// \c CPUID stores output results.
347/// \param __ebx
348/// A pointer to an integer that corresponds to the \c EBX register where
349/// \c CPUID stores output results.
350/// \param __ecx
351/// A pointer to an integer that corresponds to the \c ECX register where
352/// \c CPUID stores output results.
353/// \param __edx
354/// A pointer to an integer that corresponds to the \c EDX register where
355/// \c CPUID stores output results.
356/// \returns Returns 1 if the requested \c CPUID leaf is supported; otherwise
357/// returns 0.
318static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax,358static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax,
319 unsigned int *__ebx, unsigned int *__ecx,359 unsigned int *__ebx, unsigned int *__ecx,
320 unsigned int *__edx)360 unsigned int *__edx)
...@@ -328,6 +368,36 @@ static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax,...@@ -328,6 +368,36 @@ static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax,
328 return 1;368 return 1;
329}369}
330370
371/// For the requested \c CPUID leaf and subleaf, queries the processor for
372/// information about the CPU type and CPU features (such as processor vendor,
373/// supported instruction sets, CPU capabilities, cache sizes, CPU model and
374/// family, and other hardware details). This intrinsic is only available on
375/// x86 and x64.
376///
377/// \headerfile <cpuid.h>
378///
379/// This intrinsic corresponds to the <c> CPUID </c> instruction.
380///
381/// \param __leaf
382/// An unsigned integer that identifies the level (also called "leaf") at
383/// which the \c CPUID instruction will be executed.
384/// \param __subleaf
385/// An unsigned integer that identifies the sublevel (also called
386/// "subleaf") at which the \c CPUID instruction will be executed.
387/// \param __eax
388/// A pointer to an integer that corresponds to the \c EAX register where
389/// \c CPUID stores output results.
390/// \param __ebx
391/// A pointer to an integer that corresponds to the \c EBX register where
392/// \c CPUID stores output results.
393/// \param __ecx
394/// A pointer to an integer that corresponds to the \c ECX register where
395/// \c CPUID stores output results.
396/// \param __edx
397/// A pointer to an integer that corresponds to the \c EDX register where
398/// \c CPUID stores output results.
399/// \returns Returns 1 if the requested \c CPUID leaf is supported; otherwise
400/// returns 0.
331static __inline int __get_cpuid_count (unsigned int __leaf,401static __inline int __get_cpuid_count (unsigned int __leaf,
332 unsigned int __subleaf,402 unsigned int __subleaf,
333 unsigned int *__eax, unsigned int *__ebx,403 unsigned int *__eax, unsigned int *__ebx,
...@@ -345,10 +415,37 @@ static __inline int __get_cpuid_count (unsigned int __leaf,...@@ -345,10 +415,37 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
345// In some configurations, __cpuidex is defined as a builtin (primarily415// In some configurations, __cpuidex is defined as a builtin (primarily
346// -fms-extensions) which will conflict with the __cpuidex definition below.416// -fms-extensions) which will conflict with the __cpuidex definition below.
347#if !(__has_builtin(__cpuidex))417#if !(__has_builtin(__cpuidex))
418// In some cases, offloading will set the host as the aux triple and define the
419// builtin. Given __has_builtin does not detect builtins on aux triples, we need
420// to explicitly check for some offloading cases.
421#if !defined(__NVPTX__) && !defined(__AMDGPU__) && !defined(__SPIRV__)
422/// Executes the \c CPUID instruction with the specified leaf and subleaf
423/// values, and returns the results from the CPU's registers. This intrinsic
424/// is only available on x86 and x64.
425///
426/// \headerfile <cpuid.h>
427///
428/// This intrinsic corresponds to the <c> CPUID </c> instruction.
429///
430/// \param __cpu_info
431/// An output array of four integers:
432/// <ul>
433/// <li>\a __cpuInfo[0] receives the value of the \c EAX register.</li>
434/// <li>\a __cpuInfo[1] receives the value of the \c EBX register.</li>
435/// <li>\a __cpuInfo[2] receives the value of the \c ECX register.</li>
436/// <li>\a __cpuInfo[3] receives the value of the \c EDX register.</li>
437/// </ul>
438/// \param __leaf
439/// An unsigned integer that identifies the level (also called the "leaf")
440/// at which the \c CPUID instruction will be executed.
441/// \param __subleaf
442/// An unsigned integer that identifies the sublevel (also called the
443/// "subleaf") at which the \c CPUID instruction will be executed.
348static __inline void __cpuidex(int __cpu_info[4], int __leaf, int __subleaf) {444static __inline void __cpuidex(int __cpu_info[4], int __leaf, int __subleaf) {
349 __cpuid_count(__leaf, __subleaf, __cpu_info[0], __cpu_info[1], __cpu_info[2],445 __cpuid_count(__leaf, __subleaf, __cpu_info[0], __cpu_info[1], __cpu_info[2],
350 __cpu_info[3]);446 __cpu_info[3]);
351}447}
352#endif448#endif
449#endif
353450
354#endif /* __CPUID_H */451#endif /* __CPUID_H */
lib/include/emmintrin.h+168-168
...@@ -17,7 +17,6 @@...@@ -17,7 +17,6 @@
17#include <xmmintrin.h>17#include <xmmintrin.h>
1818
19typedef double __m128d __attribute__((__vector_size__(16), __aligned__(16)));19typedef double __m128d __attribute__((__vector_size__(16), __aligned__(16)));
20typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16)));
2120
22typedef double __m128d_u __attribute__((__vector_size__(16), __aligned__(1)));21typedef double __m128d_u __attribute__((__vector_size__(16), __aligned__(1)));
23typedef long long __m128i_u22typedef long long __m128i_u
...@@ -25,14 +24,9 @@ typedef long long __m128i_u...@@ -25,14 +24,9 @@ typedef long long __m128i_u
2524
26/* Type defines. */25/* Type defines. */
27typedef double __v2df __attribute__((__vector_size__(16)));26typedef double __v2df __attribute__((__vector_size__(16)));
28typedef long long __v2di __attribute__((__vector_size__(16)));
29typedef short __v8hi __attribute__((__vector_size__(16)));
30typedef char __v16qi __attribute__((__vector_size__(16)));
3127
32/* Unsigned types */28/* Unsigned types */
33typedef unsigned long long __v2du __attribute__((__vector_size__(16)));29typedef unsigned long long __v2du __attribute__((__vector_size__(16)));
34typedef unsigned short __v8hu __attribute__((__vector_size__(16)));
35typedef unsigned char __v16qu __attribute__((__vector_size__(16)));
3630
37/* We need an explicitly signed variant for char. Note that this shouldn't31/* We need an explicitly signed variant for char. Note that this shouldn't
38 * appear in the interface though. */32 * appear in the interface though. */
...@@ -49,15 +43,9 @@ typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));...@@ -49,15 +43,9 @@ typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));
49#endif43#endif
5044
51/* Define the default attributes for the functions in this file. */45/* Define the default attributes for the functions in this file. */
52#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
53#define __DEFAULT_FN_ATTRS \
54 __attribute__((__always_inline__, __nodebug__, \
55 __target__("sse2,no-evex512"), __min_vector_width__(128)))
56#else
57#define __DEFAULT_FN_ATTRS \46#define __DEFAULT_FN_ATTRS \
58 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \47 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
59 __min_vector_width__(128)))48 __min_vector_width__(128)))
60#endif
6149
62#if defined(__cplusplus) && (__cplusplus >= 201103L)50#if defined(__cplusplus) && (__cplusplus >= 201103L)
63#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr51#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
...@@ -67,6 +55,9 @@ typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));...@@ -67,6 +55,9 @@ typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));
6755
68#define __trunc64(x) \56#define __trunc64(x) \
69 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)57 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
58#define __zext128(x) \
59 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
60 1, 2, 3)
70#define __anyext128(x) \61#define __anyext128(x) \
71 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \62 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
72 1, -1, -1)63 1, -1, -1)
...@@ -250,8 +241,7 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_div_pd(__m128d __a,...@@ -250,8 +241,7 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_div_pd(__m128d __a,
250/// bits are copied from the upper 64 bits of operand \a __a.241/// bits are copied from the upper 64 bits of operand \a __a.
251static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a,242static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a,
252 __m128d __b) {243 __m128d __b) {
253 __m128d __c = __builtin_ia32_sqrtsd((__v2df)__b);244 return __extension__(__m128d){__builtin_elementwise_sqrt(__b[0]), __a[1]};
254 return __extension__(__m128d){__c[0], __a[1]};
255}245}
256246
257/// Calculates the square root of the each of two values stored in a247/// Calculates the square root of the each of two values stored in a
...@@ -266,7 +256,7 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a,...@@ -266,7 +256,7 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a,
266/// \returns A 128-bit vector of [2 x double] containing the square roots of the256/// \returns A 128-bit vector of [2 x double] containing the square roots of the
267/// values in the operand.257/// values in the operand.
268static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a) {258static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a) {
269 return __builtin_ia32_sqrtpd((__v2df)__a);259 return __builtin_elementwise_sqrt(__a);
270}260}
271261
272/// Compares lower 64-bit double-precision values of both operands, and262/// Compares lower 64-bit double-precision values of both operands, and
...@@ -310,8 +300,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_sd(__m128d __a,...@@ -310,8 +300,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_sd(__m128d __a,
310/// A 128-bit vector of [2 x double] containing one of the operands.300/// A 128-bit vector of [2 x double] containing one of the operands.
311/// \returns A 128-bit vector of [2 x double] containing the minimum values301/// \returns A 128-bit vector of [2 x double] containing the minimum values
312/// between both operands.302/// between both operands.
313static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_pd(__m128d __a,303static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_pd(__m128d __a,
314 __m128d __b) {304 __m128d __b) {
315 return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b);305 return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b);
316}306}
317307
...@@ -356,8 +346,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_sd(__m128d __a,...@@ -356,8 +346,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_sd(__m128d __a,
356/// A 128-bit vector of [2 x double] containing one of the operands.346/// A 128-bit vector of [2 x double] containing one of the operands.
357/// \returns A 128-bit vector of [2 x double] containing the maximum values347/// \returns A 128-bit vector of [2 x double] containing the maximum values
358/// between both operands.348/// between both operands.
359static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_pd(__m128d __a,349static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_max_pd(__m128d __a,
360 __m128d __b) {350 __m128d __b) {
361 return __builtin_ia32_maxpd((__v2df)__a, (__v2df)__b);351 return __builtin_ia32_maxpd((__v2df)__a, (__v2df)__b);
362}352}
363353
...@@ -1288,7 +1278,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_sd(__m128d __a,...@@ -1288,7 +1278,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_sd(__m128d __a,
1288/// A 128-bit vector of [2 x double].1278/// A 128-bit vector of [2 x double].
1289/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the1279/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1290/// converted values. The upper 64 bits are set to zero.1280/// converted values. The upper 64 bits are set to zero.
1291static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpd_ps(__m128d __a) {1281static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1282_mm_cvtpd_ps(__m128d __a) {
1292 return __builtin_ia32_cvtpd2ps((__v2df)__a);1283 return __builtin_ia32_cvtpd2ps((__v2df)__a);
1293}1284}
12941285
...@@ -1393,8 +1384,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsd_si32(__m128d __a) {...@@ -1393,8 +1384,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsd_si32(__m128d __a) {
1393/// \returns A 128-bit vector of [4 x float]. The lower 32 bits contain the1384/// \returns A 128-bit vector of [4 x float]. The lower 32 bits contain the
1394/// converted value from the second parameter. The upper 96 bits are copied1385/// converted value from the second parameter. The upper 96 bits are copied
1395/// from the upper 96 bits of the first parameter.1386/// from the upper 96 bits of the first parameter.
1396static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsd_ss(__m128 __a,1387static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1397 __m128d __b) {1388_mm_cvtsd_ss(__m128 __a, __m128d __b) {
1398 return (__m128)__builtin_ia32_cvtsd2ss((__v4sf)__a, (__v2df)__b);1389 return (__m128)__builtin_ia32_cvtsd2ss((__v4sf)__a, (__v2df)__b);
1399}1390}
14001391
...@@ -2068,8 +2059,8 @@ static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pd(double *__dp,...@@ -2068,8 +2059,8 @@ static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pd(double *__dp,
2068/// A 128-bit vector of [16 x i8].2059/// A 128-bit vector of [16 x i8].
2069/// \returns A 128-bit vector of [16 x i8] containing the sums of both2060/// \returns A 128-bit vector of [16 x i8] containing the sums of both
2070/// parameters.2061/// parameters.
2071static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi8(__m128i __a,2062static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2072 __m128i __b) {2063_mm_add_epi8(__m128i __a, __m128i __b) {
2073 return (__m128i)((__v16qu)__a + (__v16qu)__b);2064 return (__m128i)((__v16qu)__a + (__v16qu)__b);
2074}2065}
20752066
...@@ -2089,8 +2080,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi8(__m128i __a,...@@ -2089,8 +2080,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi8(__m128i __a,
2089/// A 128-bit vector of [8 x i16].2080/// A 128-bit vector of [8 x i16].
2090/// \returns A 128-bit vector of [8 x i16] containing the sums of both2081/// \returns A 128-bit vector of [8 x i16] containing the sums of both
2091/// parameters.2082/// parameters.
2092static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi16(__m128i __a,2083static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2093 __m128i __b) {2084_mm_add_epi16(__m128i __a, __m128i __b) {
2094 return (__m128i)((__v8hu)__a + (__v8hu)__b);2085 return (__m128i)((__v8hu)__a + (__v8hu)__b);
2095}2086}
20962087
...@@ -2127,8 +2118,9 @@ _mm_add_epi32(__m128i __a, __m128i __b) {...@@ -2127,8 +2118,9 @@ _mm_add_epi32(__m128i __a, __m128i __b) {
2127/// \param __b2118/// \param __b
2128/// A 64-bit integer.2119/// A 64-bit integer.
2129/// \returns A 64-bit integer containing the sum of both parameters.2120/// \returns A 64-bit integer containing the sum of both parameters.
2130static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_add_si64(__m64 __a, __m64 __b) {2121static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_si64(__m64 __a,
2131 return (__m64)(((unsigned long long)__a) + ((unsigned long long)__b));2122 __m64 __b) {
2123 return (__m64)(((__v1du)__a)[0] + ((__v1du)__b)[0]);
2132}2124}
21332125
2134/// Adds the corresponding elements of two 128-bit vectors of [2 x i64],2126/// Adds the corresponding elements of two 128-bit vectors of [2 x i64],
...@@ -2169,8 +2161,8 @@ _mm_add_epi64(__m128i __a, __m128i __b) {...@@ -2169,8 +2161,8 @@ _mm_add_epi64(__m128i __a, __m128i __b) {
2169/// A 128-bit signed [16 x i8] vector.2161/// A 128-bit signed [16 x i8] vector.
2170/// \returns A 128-bit signed [16 x i8] vector containing the saturated sums of2162/// \returns A 128-bit signed [16 x i8] vector containing the saturated sums of
2171/// both parameters.2163/// both parameters.
2172static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi8(__m128i __a,2164static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2173 __m128i __b) {2165_mm_adds_epi8(__m128i __a, __m128i __b) {
2174 return (__m128i)__builtin_elementwise_add_sat((__v16qs)__a, (__v16qs)__b);2166 return (__m128i)__builtin_elementwise_add_sat((__v16qs)__a, (__v16qs)__b);
2175}2167}
21762168
...@@ -2191,8 +2183,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi8(__m128i __a,...@@ -2191,8 +2183,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi8(__m128i __a,
2191/// A 128-bit signed [8 x i16] vector.2183/// A 128-bit signed [8 x i16] vector.
2192/// \returns A 128-bit signed [8 x i16] vector containing the saturated sums of2184/// \returns A 128-bit signed [8 x i16] vector containing the saturated sums of
2193/// both parameters.2185/// both parameters.
2194static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi16(__m128i __a,2186static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2195 __m128i __b) {2187_mm_adds_epi16(__m128i __a, __m128i __b) {
2196 return (__m128i)__builtin_elementwise_add_sat((__v8hi)__a, (__v8hi)__b);2188 return (__m128i)__builtin_elementwise_add_sat((__v8hi)__a, (__v8hi)__b);
2197}2189}
21982190
...@@ -2213,8 +2205,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi16(__m128i __a,...@@ -2213,8 +2205,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi16(__m128i __a,
2213/// A 128-bit unsigned [16 x i8] vector.2205/// A 128-bit unsigned [16 x i8] vector.
2214/// \returns A 128-bit unsigned [16 x i8] vector containing the saturated sums2206/// \returns A 128-bit unsigned [16 x i8] vector containing the saturated sums
2215/// of both parameters.2207/// of both parameters.
2216static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu8(__m128i __a,2208static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2217 __m128i __b) {2209_mm_adds_epu8(__m128i __a, __m128i __b) {
2218 return (__m128i)__builtin_elementwise_add_sat((__v16qu)__a, (__v16qu)__b);2210 return (__m128i)__builtin_elementwise_add_sat((__v16qu)__a, (__v16qu)__b);
2219}2211}
22202212
...@@ -2235,8 +2227,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu8(__m128i __a,...@@ -2235,8 +2227,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu8(__m128i __a,
2235/// A 128-bit unsigned [8 x i16] vector.2227/// A 128-bit unsigned [8 x i16] vector.
2236/// \returns A 128-bit unsigned [8 x i16] vector containing the saturated sums2228/// \returns A 128-bit unsigned [8 x i16] vector containing the saturated sums
2237/// of both parameters.2229/// of both parameters.
2238static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu16(__m128i __a,2230static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2239 __m128i __b) {2231_mm_adds_epu16(__m128i __a, __m128i __b) {
2240 return (__m128i)__builtin_elementwise_add_sat((__v8hu)__a, (__v8hu)__b);2232 return (__m128i)__builtin_elementwise_add_sat((__v8hu)__a, (__v8hu)__b);
2241}2233}
22422234
...@@ -2254,9 +2246,9 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu16(__m128i __a,...@@ -2254,9 +2246,9 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu16(__m128i __a,
2254/// A 128-bit unsigned [16 x i8] vector.2246/// A 128-bit unsigned [16 x i8] vector.
2255/// \returns A 128-bit unsigned [16 x i8] vector containing the rounded2247/// \returns A 128-bit unsigned [16 x i8] vector containing the rounded
2256/// averages of both parameters.2248/// averages of both parameters.
2257static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu8(__m128i __a,2249static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2258 __m128i __b) {2250_mm_avg_epu8(__m128i __a, __m128i __b) {
2259 return (__m128i)__builtin_ia32_pavgb128((__v16qi)__a, (__v16qi)__b);2251 return (__m128i)__builtin_ia32_pavgb128((__v16qu)__a, (__v16qu)__b);
2260}2252}
22612253
2262/// Computes the rounded averages of corresponding elements of two2254/// Computes the rounded averages of corresponding elements of two
...@@ -2273,9 +2265,9 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu8(__m128i __a,...@@ -2273,9 +2265,9 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu8(__m128i __a,
2273/// A 128-bit unsigned [8 x i16] vector.2265/// A 128-bit unsigned [8 x i16] vector.
2274/// \returns A 128-bit unsigned [8 x i16] vector containing the rounded2266/// \returns A 128-bit unsigned [8 x i16] vector containing the rounded
2275/// averages of both parameters.2267/// averages of both parameters.
2276static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu16(__m128i __a,2268static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2277 __m128i __b) {2269_mm_avg_epu16(__m128i __a, __m128i __b) {
2278 return (__m128i)__builtin_ia32_pavgw128((__v8hi)__a, (__v8hi)__b);2270 return (__m128i)__builtin_ia32_pavgw128((__v8hu)__a, (__v8hu)__b);
2279}2271}
22802272
2281/// Multiplies the corresponding elements of two 128-bit signed [8 x i16]2273/// Multiplies the corresponding elements of two 128-bit signed [8 x i16]
...@@ -2298,8 +2290,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu16(__m128i __a,...@@ -2298,8 +2290,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu16(__m128i __a,
2298/// A 128-bit signed [8 x i16] vector.2290/// A 128-bit signed [8 x i16] vector.
2299/// \returns A 128-bit signed [4 x i32] vector containing the sums of products2291/// \returns A 128-bit signed [4 x i32] vector containing the sums of products
2300/// of both parameters.2292/// of both parameters.
2301static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd_epi16(__m128i __a,2293static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2302 __m128i __b) {2294_mm_madd_epi16(__m128i __a, __m128i __b) {
2303 return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b);2295 return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b);
2304}2296}
23052297
...@@ -2317,8 +2309,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd_epi16(__m128i __a,...@@ -2317,8 +2309,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd_epi16(__m128i __a,
2317/// A 128-bit signed [8 x i16] vector.2309/// A 128-bit signed [8 x i16] vector.
2318/// \returns A 128-bit signed [8 x i16] vector containing the greater value of2310/// \returns A 128-bit signed [8 x i16] vector containing the greater value of
2319/// each comparison.2311/// each comparison.
2320static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi16(__m128i __a,2312static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2321 __m128i __b) {2313_mm_max_epi16(__m128i __a, __m128i __b) {
2322 return (__m128i)__builtin_elementwise_max((__v8hi)__a, (__v8hi)__b);2314 return (__m128i)__builtin_elementwise_max((__v8hi)__a, (__v8hi)__b);
2323}2315}
23242316
...@@ -2336,8 +2328,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi16(__m128i __a,...@@ -2336,8 +2328,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi16(__m128i __a,
2336/// A 128-bit unsigned [16 x i8] vector.2328/// A 128-bit unsigned [16 x i8] vector.
2337/// \returns A 128-bit unsigned [16 x i8] vector containing the greater value of2329/// \returns A 128-bit unsigned [16 x i8] vector containing the greater value of
2338/// each comparison.2330/// each comparison.
2339static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu8(__m128i __a,2331static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2340 __m128i __b) {2332_mm_max_epu8(__m128i __a, __m128i __b) {
2341 return (__m128i)__builtin_elementwise_max((__v16qu)__a, (__v16qu)__b);2333 return (__m128i)__builtin_elementwise_max((__v16qu)__a, (__v16qu)__b);
2342}2334}
23432335
...@@ -2355,8 +2347,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu8(__m128i __a,...@@ -2355,8 +2347,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu8(__m128i __a,
2355/// A 128-bit signed [8 x i16] vector.2347/// A 128-bit signed [8 x i16] vector.
2356/// \returns A 128-bit signed [8 x i16] vector containing the smaller value of2348/// \returns A 128-bit signed [8 x i16] vector containing the smaller value of
2357/// each comparison.2349/// each comparison.
2358static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi16(__m128i __a,2350static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2359 __m128i __b) {2351_mm_min_epi16(__m128i __a, __m128i __b) {
2360 return (__m128i)__builtin_elementwise_min((__v8hi)__a, (__v8hi)__b);2352 return (__m128i)__builtin_elementwise_min((__v8hi)__a, (__v8hi)__b);
2361}2353}
23622354
...@@ -2374,8 +2366,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi16(__m128i __a,...@@ -2374,8 +2366,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi16(__m128i __a,
2374/// A 128-bit unsigned [16 x i8] vector.2366/// A 128-bit unsigned [16 x i8] vector.
2375/// \returns A 128-bit unsigned [16 x i8] vector containing the smaller value of2367/// \returns A 128-bit unsigned [16 x i8] vector containing the smaller value of
2376/// each comparison.2368/// each comparison.
2377static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu8(__m128i __a,2369static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2378 __m128i __b) {2370_mm_min_epu8(__m128i __a, __m128i __b) {
2379 return (__m128i)__builtin_elementwise_min((__v16qu)__a, (__v16qu)__b);2371 return (__m128i)__builtin_elementwise_min((__v16qu)__a, (__v16qu)__b);
2380}2372}
23812373
...@@ -2393,8 +2385,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu8(__m128i __a,...@@ -2393,8 +2385,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu8(__m128i __a,
2393/// A 128-bit signed [8 x i16] vector.2385/// A 128-bit signed [8 x i16] vector.
2394/// \returns A 128-bit signed [8 x i16] vector containing the upper 16 bits of2386/// \returns A 128-bit signed [8 x i16] vector containing the upper 16 bits of
2395/// each of the eight 32-bit products.2387/// each of the eight 32-bit products.
2396static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epi16(__m128i __a,2388static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2397 __m128i __b) {2389_mm_mulhi_epi16(__m128i __a, __m128i __b) {
2398 return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b);2390 return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b);
2399}2391}
24002392
...@@ -2412,9 +2404,9 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epi16(__m128i __a,...@@ -2412,9 +2404,9 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epi16(__m128i __a,
2412/// A 128-bit unsigned [8 x i16] vector.2404/// A 128-bit unsigned [8 x i16] vector.
2413/// \returns A 128-bit unsigned [8 x i16] vector containing the upper 16 bits2405/// \returns A 128-bit unsigned [8 x i16] vector containing the upper 16 bits
2414/// of each of the eight 32-bit products.2406/// of each of the eight 32-bit products.
2415static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epu16(__m128i __a,2407static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2416 __m128i __b) {2408_mm_mulhi_epu16(__m128i __a, __m128i __b) {
2417 return (__m128i)__builtin_ia32_pmulhuw128((__v8hi)__a, (__v8hi)__b);2409 return (__m128i)__builtin_ia32_pmulhuw128((__v8hu)__a, (__v8hu)__b);
2418}2410}
24192411
2420/// Multiplies the corresponding elements of two signed [8 x i16]2412/// Multiplies the corresponding elements of two signed [8 x i16]
...@@ -2431,8 +2423,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epu16(__m128i __a,...@@ -2431,8 +2423,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epu16(__m128i __a,
2431/// A 128-bit signed [8 x i16] vector.2423/// A 128-bit signed [8 x i16] vector.
2432/// \returns A 128-bit signed [8 x i16] vector containing the lower 16 bits of2424/// \returns A 128-bit signed [8 x i16] vector containing the lower 16 bits of
2433/// each of the eight 32-bit products.2425/// each of the eight 32-bit products.
2434static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi16(__m128i __a,2426static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2435 __m128i __b) {2427_mm_mullo_epi16(__m128i __a, __m128i __b) {
2436 return (__m128i)((__v8hu)__a * (__v8hu)__b);2428 return (__m128i)((__v8hu)__a * (__v8hu)__b);
2437}2429}
24382430
...@@ -2449,9 +2441,10 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi16(__m128i __a,...@@ -2449,9 +2441,10 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi16(__m128i __a,
2449/// \param __b2441/// \param __b
2450/// A 64-bit integer containing one of the source operands.2442/// A 64-bit integer containing one of the source operands.
2451/// \returns A 64-bit integer vector containing the product of both operands.2443/// \returns A 64-bit integer vector containing the product of both operands.
2452static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mul_su32(__m64 __a, __m64 __b) {2444static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_su32(__m64 __a,
2453 return __trunc64(__builtin_ia32_pmuludq128((__v4si)__anyext128(__a),2445 __m64 __b) {
2454 (__v4si)__anyext128(__b)));2446 return __trunc64(__builtin_ia32_pmuludq128((__v4si)__zext128(__a),
2447 (__v4si)__zext128(__b)));
2455}2448}
24562449
2457/// Multiplies 32-bit unsigned integer values contained in the lower2450/// Multiplies 32-bit unsigned integer values contained in the lower
...@@ -2467,8 +2460,8 @@ static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mul_su32(__m64 __a, __m64 __b) {...@@ -2467,8 +2460,8 @@ static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mul_su32(__m64 __a, __m64 __b) {
2467/// \param __b2460/// \param __b
2468/// A [2 x i64] vector containing one of the source operands.2461/// A [2 x i64] vector containing one of the source operands.
2469/// \returns A [2 x i64] vector containing the product of both operands.2462/// \returns A [2 x i64] vector containing the product of both operands.
2470static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mul_epu32(__m128i __a,2463static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2471 __m128i __b) {2464_mm_mul_epu32(__m128i __a, __m128i __b) {
2472 return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b);2465 return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b);
2473}2466}
24742467
...@@ -2505,8 +2498,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sad_epu8(__m128i __a,...@@ -2505,8 +2498,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sad_epu8(__m128i __a,
2505/// A 128-bit integer vector containing the subtrahends.2498/// A 128-bit integer vector containing the subtrahends.
2506/// \returns A 128-bit integer vector containing the differences of the values2499/// \returns A 128-bit integer vector containing the differences of the values
2507/// in the operands.2500/// in the operands.
2508static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi8(__m128i __a,2501static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2509 __m128i __b) {2502_mm_sub_epi8(__m128i __a, __m128i __b) {
2510 return (__m128i)((__v16qu)__a - (__v16qu)__b);2503 return (__m128i)((__v16qu)__a - (__v16qu)__b);
2511}2504}
25122505
...@@ -2522,8 +2515,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi8(__m128i __a,...@@ -2522,8 +2515,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi8(__m128i __a,
2522/// A 128-bit integer vector containing the subtrahends.2515/// A 128-bit integer vector containing the subtrahends.
2523/// \returns A 128-bit integer vector containing the differences of the values2516/// \returns A 128-bit integer vector containing the differences of the values
2524/// in the operands.2517/// in the operands.
2525static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi16(__m128i __a,2518static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2526 __m128i __b) {2519_mm_sub_epi16(__m128i __a, __m128i __b) {
2527 return (__m128i)((__v8hu)__a - (__v8hu)__b);2520 return (__m128i)((__v8hu)__a - (__v8hu)__b);
2528}2521}
25292522
...@@ -2557,8 +2550,9 @@ _mm_sub_epi32(__m128i __a, __m128i __b) {...@@ -2557,8 +2550,9 @@ _mm_sub_epi32(__m128i __a, __m128i __b) {
2557/// A 64-bit integer vector containing the subtrahend.2550/// A 64-bit integer vector containing the subtrahend.
2558/// \returns A 64-bit integer vector containing the difference of the values in2551/// \returns A 64-bit integer vector containing the difference of the values in
2559/// the operands.2552/// the operands.
2560static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sub_si64(__m64 __a, __m64 __b) {2553static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_si64(__m64 __a,
2561 return (__m64)((unsigned long long)__a - (unsigned long long)__b);2554 __m64 __b) {
2555 return (__m64)(((__v1du)__a)[0] - ((__v1du)__b)[0]);
2562}2556}
25632557
2564/// Subtracts the corresponding elements of two [2 x i64] vectors.2558/// Subtracts the corresponding elements of two [2 x i64] vectors.
...@@ -2595,8 +2589,8 @@ _mm_sub_epi64(__m128i __a, __m128i __b) {...@@ -2595,8 +2589,8 @@ _mm_sub_epi64(__m128i __a, __m128i __b) {
2595/// A 128-bit integer vector containing the subtrahends.2589/// A 128-bit integer vector containing the subtrahends.
2596/// \returns A 128-bit integer vector containing the differences of the values2590/// \returns A 128-bit integer vector containing the differences of the values
2597/// in the operands.2591/// in the operands.
2598static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi8(__m128i __a,2592static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2599 __m128i __b) {2593_mm_subs_epi8(__m128i __a, __m128i __b) {
2600 return (__m128i)__builtin_elementwise_sub_sat((__v16qs)__a, (__v16qs)__b);2594 return (__m128i)__builtin_elementwise_sub_sat((__v16qs)__a, (__v16qs)__b);
2601}2595}
26022596
...@@ -2617,8 +2611,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi8(__m128i __a,...@@ -2617,8 +2611,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi8(__m128i __a,
2617/// A 128-bit integer vector containing the subtrahends.2611/// A 128-bit integer vector containing the subtrahends.
2618/// \returns A 128-bit integer vector containing the differences of the values2612/// \returns A 128-bit integer vector containing the differences of the values
2619/// in the operands.2613/// in the operands.
2620static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi16(__m128i __a,2614static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2621 __m128i __b) {2615_mm_subs_epi16(__m128i __a, __m128i __b) {
2622 return (__m128i)__builtin_elementwise_sub_sat((__v8hi)__a, (__v8hi)__b);2616 return (__m128i)__builtin_elementwise_sub_sat((__v8hi)__a, (__v8hi)__b);
2623}2617}
26242618
...@@ -2638,8 +2632,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi16(__m128i __a,...@@ -2638,8 +2632,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi16(__m128i __a,
2638/// A 128-bit integer vector containing the subtrahends.2632/// A 128-bit integer vector containing the subtrahends.
2639/// \returns A 128-bit integer vector containing the unsigned integer2633/// \returns A 128-bit integer vector containing the unsigned integer
2640/// differences of the values in the operands.2634/// differences of the values in the operands.
2641static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu8(__m128i __a,2635static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2642 __m128i __b) {2636_mm_subs_epu8(__m128i __a, __m128i __b) {
2643 return (__m128i)__builtin_elementwise_sub_sat((__v16qu)__a, (__v16qu)__b);2637 return (__m128i)__builtin_elementwise_sub_sat((__v16qu)__a, (__v16qu)__b);
2644}2638}
26452639
...@@ -2659,8 +2653,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu8(__m128i __a,...@@ -2659,8 +2653,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu8(__m128i __a,
2659/// A 128-bit integer vector containing the subtrahends.2653/// A 128-bit integer vector containing the subtrahends.
2660/// \returns A 128-bit integer vector containing the unsigned integer2654/// \returns A 128-bit integer vector containing the unsigned integer
2661/// differences of the values in the operands.2655/// differences of the values in the operands.
2662static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu16(__m128i __a,2656static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2663 __m128i __b) {2657_mm_subs_epu16(__m128i __a, __m128i __b) {
2664 return (__m128i)__builtin_elementwise_sub_sat((__v8hu)__a, (__v8hu)__b);2658 return (__m128i)__builtin_elementwise_sub_sat((__v8hu)__a, (__v8hu)__b);
2665}2659}
26662660
...@@ -2676,8 +2670,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu16(__m128i __a,...@@ -2676,8 +2670,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu16(__m128i __a,
2676/// A 128-bit integer vector containing one of the source operands.2670/// A 128-bit integer vector containing one of the source operands.
2677/// \returns A 128-bit integer vector containing the bitwise AND of the values2671/// \returns A 128-bit integer vector containing the bitwise AND of the values
2678/// in both operands.2672/// in both operands.
2679static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_and_si128(__m128i __a,2673static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2680 __m128i __b) {2674_mm_and_si128(__m128i __a, __m128i __b) {
2681 return (__m128i)((__v2du)__a & (__v2du)__b);2675 return (__m128i)((__v2du)__a & (__v2du)__b);
2682}2676}
26832677
...@@ -2695,8 +2689,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_and_si128(__m128i __a,...@@ -2695,8 +2689,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_and_si128(__m128i __a,
2695/// A 128-bit vector containing the right source operand.2689/// A 128-bit vector containing the right source operand.
2696/// \returns A 128-bit integer vector containing the bitwise AND of the one's2690/// \returns A 128-bit integer vector containing the bitwise AND of the one's
2697/// complement of the first operand and the values in the second operand.2691/// complement of the first operand and the values in the second operand.
2698static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_andnot_si128(__m128i __a,2692static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2699 __m128i __b) {2693_mm_andnot_si128(__m128i __a, __m128i __b) {
2700 return (__m128i)(~(__v2du)__a & (__v2du)__b);2694 return (__m128i)(~(__v2du)__a & (__v2du)__b);
2701}2695}
2702/// Performs a bitwise OR of two 128-bit integer vectors.2696/// Performs a bitwise OR of two 128-bit integer vectors.
...@@ -2711,8 +2705,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_andnot_si128(__m128i __a,...@@ -2711,8 +2705,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_andnot_si128(__m128i __a,
2711/// A 128-bit integer vector containing one of the source operands.2705/// A 128-bit integer vector containing one of the source operands.
2712/// \returns A 128-bit integer vector containing the bitwise OR of the values2706/// \returns A 128-bit integer vector containing the bitwise OR of the values
2713/// in both operands.2707/// in both operands.
2714static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_or_si128(__m128i __a,2708static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2715 __m128i __b) {2709_mm_or_si128(__m128i __a, __m128i __b) {
2716 return (__m128i)((__v2du)__a | (__v2du)__b);2710 return (__m128i)((__v2du)__a | (__v2du)__b);
2717}2711}
27182712
...@@ -2728,8 +2722,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_or_si128(__m128i __a,...@@ -2728,8 +2722,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_or_si128(__m128i __a,
2728/// A 128-bit integer vector containing one of the source operands.2722/// A 128-bit integer vector containing one of the source operands.
2729/// \returns A 128-bit integer vector containing the bitwise exclusive OR of the2723/// \returns A 128-bit integer vector containing the bitwise exclusive OR of the
2730/// values in both operands.2724/// values in both operands.
2731static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_xor_si128(__m128i __a,2725static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2732 __m128i __b) {2726_mm_xor_si128(__m128i __a, __m128i __b) {
2733 return (__m128i)((__v2du)__a ^ (__v2du)__b);2727 return (__m128i)((__v2du)__a ^ (__v2du)__b);
2734}2728}
27352729
...@@ -2751,11 +2745,11 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_xor_si128(__m128i __a,...@@ -2751,11 +2745,11 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_xor_si128(__m128i __a,
2751/// \a a.2745/// \a a.
2752/// \returns A 128-bit integer vector containing the left-shifted value.2746/// \returns A 128-bit integer vector containing the left-shifted value.
2753#define _mm_slli_si128(a, imm) \2747#define _mm_slli_si128(a, imm) \
2754 ((__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), \2748 ((__m128i)__builtin_ia32_pslldqi128_byteshift((__v16qi)(__m128i)(a), \
2755 (int)(imm)))2749 (int)(imm)))
27562750
2757#define _mm_bslli_si128(a, imm) \2751#define _mm_bslli_si128(a, imm) \
2758 ((__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), \2752 ((__m128i)__builtin_ia32_pslldqi128_byteshift((__v16qi)(__m128i)(a), \
2759 (int)(imm)))2753 (int)(imm)))
27602754
2761/// Left-shifts each 16-bit value in the 128-bit integer vector operand2755/// Left-shifts each 16-bit value in the 128-bit integer vector operand
...@@ -2771,8 +2765,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_xor_si128(__m128i __a,...@@ -2771,8 +2765,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_xor_si128(__m128i __a,
2771/// An integer value specifying the number of bits to left-shift each value2765/// An integer value specifying the number of bits to left-shift each value
2772/// in operand \a __a.2766/// in operand \a __a.
2773/// \returns A 128-bit integer vector containing the left-shifted values.2767/// \returns A 128-bit integer vector containing the left-shifted values.
2774static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi16(__m128i __a,2768static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2775 int __count) {2769_mm_slli_epi16(__m128i __a, int __count) {
2776 return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count);2770 return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count);
2777}2771}
27782772
...@@ -2789,8 +2783,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi16(__m128i __a,...@@ -2789,8 +2783,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi16(__m128i __a,
2789/// A 128-bit integer vector in which bits [63:0] specify the number of bits2783/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2790/// to left-shift each value in operand \a __a.2784/// to left-shift each value in operand \a __a.
2791/// \returns A 128-bit integer vector containing the left-shifted values.2785/// \returns A 128-bit integer vector containing the left-shifted values.
2792static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi16(__m128i __a,2786static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2793 __m128i __count) {2787_mm_sll_epi16(__m128i __a, __m128i __count) {
2794 return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count);2788 return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count);
2795}2789}
27962790
...@@ -2807,8 +2801,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi16(__m128i __a,...@@ -2807,8 +2801,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi16(__m128i __a,
2807/// An integer value specifying the number of bits to left-shift each value2801/// An integer value specifying the number of bits to left-shift each value
2808/// in operand \a __a.2802/// in operand \a __a.
2809/// \returns A 128-bit integer vector containing the left-shifted values.2803/// \returns A 128-bit integer vector containing the left-shifted values.
2810static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi32(__m128i __a,2804static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2811 int __count) {2805_mm_slli_epi32(__m128i __a, int __count) {
2812 return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count);2806 return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count);
2813}2807}
28142808
...@@ -2825,8 +2819,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi32(__m128i __a,...@@ -2825,8 +2819,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi32(__m128i __a,
2825/// A 128-bit integer vector in which bits [63:0] specify the number of bits2819/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2826/// to left-shift each value in operand \a __a.2820/// to left-shift each value in operand \a __a.
2827/// \returns A 128-bit integer vector containing the left-shifted values.2821/// \returns A 128-bit integer vector containing the left-shifted values.
2828static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi32(__m128i __a,2822static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2829 __m128i __count) {2823_mm_sll_epi32(__m128i __a, __m128i __count) {
2830 return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count);2824 return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count);
2831}2825}
28322826
...@@ -2843,8 +2837,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi32(__m128i __a,...@@ -2843,8 +2837,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi32(__m128i __a,
2843/// An integer value specifying the number of bits to left-shift each value2837/// An integer value specifying the number of bits to left-shift each value
2844/// in operand \a __a.2838/// in operand \a __a.
2845/// \returns A 128-bit integer vector containing the left-shifted values.2839/// \returns A 128-bit integer vector containing the left-shifted values.
2846static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi64(__m128i __a,2840static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2847 int __count) {2841_mm_slli_epi64(__m128i __a, int __count) {
2848 return __builtin_ia32_psllqi128((__v2di)__a, __count);2842 return __builtin_ia32_psllqi128((__v2di)__a, __count);
2849}2843}
28502844
...@@ -2861,8 +2855,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi64(__m128i __a,...@@ -2861,8 +2855,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi64(__m128i __a,
2861/// A 128-bit integer vector in which bits [63:0] specify the number of bits2855/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2862/// to left-shift each value in operand \a __a.2856/// to left-shift each value in operand \a __a.
2863/// \returns A 128-bit integer vector containing the left-shifted values.2857/// \returns A 128-bit integer vector containing the left-shifted values.
2864static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi64(__m128i __a,2858static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2865 __m128i __count) {2859_mm_sll_epi64(__m128i __a, __m128i __count) {
2866 return __builtin_ia32_psllq128((__v2di)__a, (__v2di)__count);2860 return __builtin_ia32_psllq128((__v2di)__a, (__v2di)__count);
2867}2861}
28682862
...@@ -2880,8 +2874,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi64(__m128i __a,...@@ -2880,8 +2874,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi64(__m128i __a,
2880/// An integer value specifying the number of bits to right-shift each value2874/// An integer value specifying the number of bits to right-shift each value
2881/// in operand \a __a.2875/// in operand \a __a.
2882/// \returns A 128-bit integer vector containing the right-shifted values.2876/// \returns A 128-bit integer vector containing the right-shifted values.
2883static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi16(__m128i __a,2877static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2884 int __count) {2878_mm_srai_epi16(__m128i __a, int __count) {
2885 return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count);2879 return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count);
2886}2880}
28872881
...@@ -2899,8 +2893,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi16(__m128i __a,...@@ -2899,8 +2893,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi16(__m128i __a,
2899/// A 128-bit integer vector in which bits [63:0] specify the number of bits2893/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2900/// to right-shift each value in operand \a __a.2894/// to right-shift each value in operand \a __a.
2901/// \returns A 128-bit integer vector containing the right-shifted values.2895/// \returns A 128-bit integer vector containing the right-shifted values.
2902static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi16(__m128i __a,2896static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2903 __m128i __count) {2897_mm_sra_epi16(__m128i __a, __m128i __count) {
2904 return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count);2898 return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count);
2905}2899}
29062900
...@@ -2918,8 +2912,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi16(__m128i __a,...@@ -2918,8 +2912,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi16(__m128i __a,
2918/// An integer value specifying the number of bits to right-shift each value2912/// An integer value specifying the number of bits to right-shift each value
2919/// in operand \a __a.2913/// in operand \a __a.
2920/// \returns A 128-bit integer vector containing the right-shifted values.2914/// \returns A 128-bit integer vector containing the right-shifted values.
2921static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi32(__m128i __a,2915static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2922 int __count) {2916_mm_srai_epi32(__m128i __a, int __count) {
2923 return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count);2917 return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count);
2924}2918}
29252919
...@@ -2937,8 +2931,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi32(__m128i __a,...@@ -2937,8 +2931,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi32(__m128i __a,
2937/// A 128-bit integer vector in which bits [63:0] specify the number of bits2931/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2938/// to right-shift each value in operand \a __a.2932/// to right-shift each value in operand \a __a.
2939/// \returns A 128-bit integer vector containing the right-shifted values.2933/// \returns A 128-bit integer vector containing the right-shifted values.
2940static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a,2934static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2941 __m128i __count) {2935_mm_sra_epi32(__m128i __a, __m128i __count) {
2942 return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count);2936 return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count);
2943}2937}
29442938
...@@ -2960,11 +2954,11 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a,...@@ -2960,11 +2954,11 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a,
2960/// \a a.2954/// \a a.
2961/// \returns A 128-bit integer vector containing the right-shifted value.2955/// \returns A 128-bit integer vector containing the right-shifted value.
2962#define _mm_srli_si128(a, imm) \2956#define _mm_srli_si128(a, imm) \
2963 ((__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), \2957 ((__m128i)__builtin_ia32_psrldqi128_byteshift((__v16qi)(__m128i)(a), \
2964 (int)(imm)))2958 (int)(imm)))
29652959
2966#define _mm_bsrli_si128(a, imm) \2960#define _mm_bsrli_si128(a, imm) \
2967 ((__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), \2961 ((__m128i)__builtin_ia32_psrldqi128_byteshift((__v16qi)(__m128i)(a), \
2968 (int)(imm)))2962 (int)(imm)))
29692963
2970/// Right-shifts each of 16-bit values in the 128-bit integer vector2964/// Right-shifts each of 16-bit values in the 128-bit integer vector
...@@ -2980,8 +2974,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a,...@@ -2980,8 +2974,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a,
2980/// An integer value specifying the number of bits to right-shift each value2974/// An integer value specifying the number of bits to right-shift each value
2981/// in operand \a __a.2975/// in operand \a __a.
2982/// \returns A 128-bit integer vector containing the right-shifted values.2976/// \returns A 128-bit integer vector containing the right-shifted values.
2983static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi16(__m128i __a,2977static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2984 int __count) {2978_mm_srli_epi16(__m128i __a, int __count) {
2985 return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count);2979 return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count);
2986}2980}
29872981
...@@ -2998,8 +2992,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi16(__m128i __a,...@@ -2998,8 +2992,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi16(__m128i __a,
2998/// A 128-bit integer vector in which bits [63:0] specify the number of bits2992/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2999/// to right-shift each value in operand \a __a.2993/// to right-shift each value in operand \a __a.
3000/// \returns A 128-bit integer vector containing the right-shifted values.2994/// \returns A 128-bit integer vector containing the right-shifted values.
3001static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi16(__m128i __a,2995static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3002 __m128i __count) {2996_mm_srl_epi16(__m128i __a, __m128i __count) {
3003 return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count);2997 return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count);
3004}2998}
30052999
...@@ -3016,8 +3010,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi16(__m128i __a,...@@ -3016,8 +3010,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi16(__m128i __a,
3016/// An integer value specifying the number of bits to right-shift each value3010/// An integer value specifying the number of bits to right-shift each value
3017/// in operand \a __a.3011/// in operand \a __a.
3018/// \returns A 128-bit integer vector containing the right-shifted values.3012/// \returns A 128-bit integer vector containing the right-shifted values.
3019static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi32(__m128i __a,3013static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3020 int __count) {3014_mm_srli_epi32(__m128i __a, int __count) {
3021 return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count);3015 return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count);
3022}3016}
30233017
...@@ -3034,8 +3028,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi32(__m128i __a,...@@ -3034,8 +3028,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi32(__m128i __a,
3034/// A 128-bit integer vector in which bits [63:0] specify the number of bits3028/// A 128-bit integer vector in which bits [63:0] specify the number of bits
3035/// to right-shift each value in operand \a __a.3029/// to right-shift each value in operand \a __a.
3036/// \returns A 128-bit integer vector containing the right-shifted values.3030/// \returns A 128-bit integer vector containing the right-shifted values.
3037static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi32(__m128i __a,3031static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3038 __m128i __count) {3032_mm_srl_epi32(__m128i __a, __m128i __count) {
3039 return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count);3033 return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count);
3040}3034}
30413035
...@@ -3052,8 +3046,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi32(__m128i __a,...@@ -3052,8 +3046,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi32(__m128i __a,
3052/// An integer value specifying the number of bits to right-shift each value3046/// An integer value specifying the number of bits to right-shift each value
3053/// in operand \a __a.3047/// in operand \a __a.
3054/// \returns A 128-bit integer vector containing the right-shifted values.3048/// \returns A 128-bit integer vector containing the right-shifted values.
3055static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi64(__m128i __a,3049static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3056 int __count) {3050_mm_srli_epi64(__m128i __a, int __count) {
3057 return __builtin_ia32_psrlqi128((__v2di)__a, __count);3051 return __builtin_ia32_psrlqi128((__v2di)__a, __count);
3058}3052}
30593053
...@@ -3070,8 +3064,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi64(__m128i __a,...@@ -3070,8 +3064,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi64(__m128i __a,
3070/// A 128-bit integer vector in which bits [63:0] specify the number of bits3064/// A 128-bit integer vector in which bits [63:0] specify the number of bits
3071/// to right-shift each value in operand \a __a.3065/// to right-shift each value in operand \a __a.
3072/// \returns A 128-bit integer vector containing the right-shifted values.3066/// \returns A 128-bit integer vector containing the right-shifted values.
3073static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi64(__m128i __a,3067static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3074 __m128i __count) {3068_mm_srl_epi64(__m128i __a, __m128i __count) {
3075 return __builtin_ia32_psrlq128((__v2di)__a, (__v2di)__count);3069 return __builtin_ia32_psrlq128((__v2di)__a, (__v2di)__count);
3076}3070}
30773071
...@@ -3089,8 +3083,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi64(__m128i __a,...@@ -3089,8 +3083,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi64(__m128i __a,
3089/// \param __b3083/// \param __b
3090/// A 128-bit integer vector.3084/// A 128-bit integer vector.
3091/// \returns A 128-bit integer vector containing the comparison results.3085/// \returns A 128-bit integer vector containing the comparison results.
3092static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi8(__m128i __a,3086static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3093 __m128i __b) {3087_mm_cmpeq_epi8(__m128i __a, __m128i __b) {
3094 return (__m128i)((__v16qi)__a == (__v16qi)__b);3088 return (__m128i)((__v16qi)__a == (__v16qi)__b);
3095}3089}
30963090
...@@ -3108,8 +3102,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi8(__m128i __a,...@@ -3108,8 +3102,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi8(__m128i __a,
3108/// \param __b3102/// \param __b
3109/// A 128-bit integer vector.3103/// A 128-bit integer vector.
3110/// \returns A 128-bit integer vector containing the comparison results.3104/// \returns A 128-bit integer vector containing the comparison results.
3111static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi16(__m128i __a,3105static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3112 __m128i __b) {3106_mm_cmpeq_epi16(__m128i __a, __m128i __b) {
3113 return (__m128i)((__v8hi)__a == (__v8hi)__b);3107 return (__m128i)((__v8hi)__a == (__v8hi)__b);
3114}3108}
31153109
...@@ -3127,8 +3121,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi16(__m128i __a,...@@ -3127,8 +3121,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi16(__m128i __a,
3127/// \param __b3121/// \param __b
3128/// A 128-bit integer vector.3122/// A 128-bit integer vector.
3129/// \returns A 128-bit integer vector containing the comparison results.3123/// \returns A 128-bit integer vector containing the comparison results.
3130static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi32(__m128i __a,3124static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3131 __m128i __b) {3125_mm_cmpeq_epi32(__m128i __a, __m128i __b) {
3132 return (__m128i)((__v4si)__a == (__v4si)__b);3126 return (__m128i)((__v4si)__a == (__v4si)__b);
3133}3127}
31343128
...@@ -3147,8 +3141,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi32(__m128i __a,...@@ -3147,8 +3141,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi32(__m128i __a,
3147/// \param __b3141/// \param __b
3148/// A 128-bit integer vector.3142/// A 128-bit integer vector.
3149/// \returns A 128-bit integer vector containing the comparison results.3143/// \returns A 128-bit integer vector containing the comparison results.
3150static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi8(__m128i __a,3144static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3151 __m128i __b) {3145_mm_cmpgt_epi8(__m128i __a, __m128i __b) {
3152 /* This function always performs a signed comparison, but __v16qi is a char3146 /* This function always performs a signed comparison, but __v16qi is a char
3153 which may be signed or unsigned, so use __v16qs. */3147 which may be signed or unsigned, so use __v16qs. */
3154 return (__m128i)((__v16qs)__a > (__v16qs)__b);3148 return (__m128i)((__v16qs)__a > (__v16qs)__b);
...@@ -3169,8 +3163,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi8(__m128i __a,...@@ -3169,8 +3163,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi8(__m128i __a,
3169/// \param __b3163/// \param __b
3170/// A 128-bit integer vector.3164/// A 128-bit integer vector.
3171/// \returns A 128-bit integer vector containing the comparison results.3165/// \returns A 128-bit integer vector containing the comparison results.
3172static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi16(__m128i __a,3166static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3173 __m128i __b) {3167_mm_cmpgt_epi16(__m128i __a, __m128i __b) {
3174 return (__m128i)((__v8hi)__a > (__v8hi)__b);3168 return (__m128i)((__v8hi)__a > (__v8hi)__b);
3175}3169}
31763170
...@@ -3189,8 +3183,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi16(__m128i __a,...@@ -3189,8 +3183,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi16(__m128i __a,
3189/// \param __b3183/// \param __b
3190/// A 128-bit integer vector.3184/// A 128-bit integer vector.
3191/// \returns A 128-bit integer vector containing the comparison results.3185/// \returns A 128-bit integer vector containing the comparison results.
3192static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi32(__m128i __a,3186static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3193 __m128i __b) {3187_mm_cmpgt_epi32(__m128i __a, __m128i __b) {
3194 return (__m128i)((__v4si)__a > (__v4si)__b);3188 return (__m128i)((__v4si)__a > (__v4si)__b);
3195}3189}
31963190
...@@ -3209,8 +3203,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi32(__m128i __a,...@@ -3209,8 +3203,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi32(__m128i __a,
3209/// \param __b3203/// \param __b
3210/// A 128-bit integer vector.3204/// A 128-bit integer vector.
3211/// \returns A 128-bit integer vector containing the comparison results.3205/// \returns A 128-bit integer vector containing the comparison results.
3212static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi8(__m128i __a,3206static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3213 __m128i __b) {3207_mm_cmplt_epi8(__m128i __a, __m128i __b) {
3214 return _mm_cmpgt_epi8(__b, __a);3208 return _mm_cmpgt_epi8(__b, __a);
3215}3209}
32163210
...@@ -3229,8 +3223,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi8(__m128i __a,...@@ -3229,8 +3223,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi8(__m128i __a,
3229/// \param __b3223/// \param __b
3230/// A 128-bit integer vector.3224/// A 128-bit integer vector.
3231/// \returns A 128-bit integer vector containing the comparison results.3225/// \returns A 128-bit integer vector containing the comparison results.
3232static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi16(__m128i __a,3226static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3233 __m128i __b) {3227_mm_cmplt_epi16(__m128i __a, __m128i __b) {
3234 return _mm_cmpgt_epi16(__b, __a);3228 return _mm_cmpgt_epi16(__b, __a);
3235}3229}
32363230
...@@ -3249,8 +3243,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi16(__m128i __a,...@@ -3249,8 +3243,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi16(__m128i __a,
3249/// \param __b3243/// \param __b
3250/// A 128-bit integer vector.3244/// A 128-bit integer vector.
3251/// \returns A 128-bit integer vector containing the comparison results.3245/// \returns A 128-bit integer vector containing the comparison results.
3252static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi32(__m128i __a,3246static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3253 __m128i __b) {3247_mm_cmplt_epi32(__m128i __a, __m128i __b) {
3254 return _mm_cmpgt_epi32(__b, __a);3248 return _mm_cmpgt_epi32(__b, __a);
3255}3249}
32563250
...@@ -3379,7 +3373,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epi32(__m128 __a) {...@@ -3379,7 +3373,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epi32(__m128 __a) {
3379/// \param __a3373/// \param __a
3380/// A 32-bit signed integer operand.3374/// A 32-bit signed integer operand.
3381/// \returns A 128-bit vector of [4 x i32].3375/// \returns A 128-bit vector of [4 x i32].
3382static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi32_si128(int __a) {3376static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3377_mm_cvtsi32_si128(int __a) {
3383 return __extension__(__m128i)(__v4si){__a, 0, 0, 0};3378 return __extension__(__m128i)(__v4si){__a, 0, 0, 0};
3384}3379}
33853380
...@@ -3394,7 +3389,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi32_si128(int __a) {...@@ -3394,7 +3389,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi32_si128(int __a) {
3394/// \param __a3389/// \param __a
3395/// A 64-bit signed integer operand containing the value to be converted.3390/// A 64-bit signed integer operand containing the value to be converted.
3396/// \returns A 128-bit vector of [2 x i64] containing the converted value.3391/// \returns A 128-bit vector of [2 x i64] containing the converted value.
3397static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi64_si128(long long __a) {3392static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3393_mm_cvtsi64_si128(long long __a) {
3398 return __extension__(__m128i)(__v2di){__a, 0};3394 return __extension__(__m128i)(__v2di){__a, 0};
3399}3395}
34003396
...@@ -3409,7 +3405,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi64_si128(long long __a) {...@@ -3409,7 +3405,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi64_si128(long long __a) {
3409/// A vector of [4 x i32]. The least significant 32 bits are moved to the3405/// A vector of [4 x i32]. The least significant 32 bits are moved to the
3410/// destination.3406/// destination.
3411/// \returns A 32-bit signed integer containing the moved value.3407/// \returns A 32-bit signed integer containing the moved value.
3412static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsi128_si32(__m128i __a) {3408static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
3409_mm_cvtsi128_si32(__m128i __a) {
3413 __v4si __b = (__v4si)__a;3410 __v4si __b = (__v4si)__a;
3414 return __b[0];3411 return __b[0];
3415}3412}
...@@ -3425,7 +3422,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsi128_si32(__m128i __a) {...@@ -3425,7 +3422,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsi128_si32(__m128i __a) {
3425/// A vector of [2 x i64]. The least significant 64 bits are moved to the3422/// A vector of [2 x i64]. The least significant 64 bits are moved to the
3426/// destination.3423/// destination.
3427/// \returns A 64-bit signed integer containing the moved value.3424/// \returns A 64-bit signed integer containing the moved value.
3428static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtsi128_si64(__m128i __a) {3425static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
3426_mm_cvtsi128_si64(__m128i __a) {
3429 return __a[0];3427 return __a[0];
3430}3428}
34313429
...@@ -4161,8 +4159,8 @@ void _mm_mfence(void);...@@ -4161,8 +4159,8 @@ void _mm_mfence(void);
4161/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are4159/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are
4162/// written to the higher 64 bits of the result.4160/// written to the higher 64 bits of the result.
4163/// \returns A 128-bit vector of [16 x i8] containing the converted values.4161/// \returns A 128-bit vector of [16 x i8] containing the converted values.
4164static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi16(__m128i __a,4162static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4165 __m128i __b) {4163_mm_packs_epi16(__m128i __a, __m128i __b) {
4166 return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b);4164 return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b);
4167}4165}
41684166
...@@ -4184,8 +4182,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi16(__m128i __a,...@@ -4184,8 +4182,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi16(__m128i __a,
4184/// A 128-bit integer vector of [4 x i32]. The converted [4 x i16] values4182/// A 128-bit integer vector of [4 x i32]. The converted [4 x i16] values
4185/// are written to the higher 64 bits of the result.4183/// are written to the higher 64 bits of the result.
4186/// \returns A 128-bit vector of [8 x i16] containing the converted values.4184/// \returns A 128-bit vector of [8 x i16] containing the converted values.
4187static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi32(__m128i __a,4185static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4188 __m128i __b) {4186_mm_packs_epi32(__m128i __a, __m128i __b) {
4189 return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b);4187 return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b);
4190}4188}
41914189
...@@ -4207,8 +4205,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi32(__m128i __a,...@@ -4207,8 +4205,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi32(__m128i __a,
4207/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are4205/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are
4208/// written to the higher 64 bits of the result.4206/// written to the higher 64 bits of the result.
4209/// \returns A 128-bit vector of [16 x i8] containing the converted values.4207/// \returns A 128-bit vector of [16 x i8] containing the converted values.
4210static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi16(__m128i __a,4208static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4211 __m128i __b) {4209_mm_packus_epi16(__m128i __a, __m128i __b) {
4212 return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b);4210 return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b);
4213}4211}
42144212
...@@ -4282,7 +4280,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi16(__m128i __a,...@@ -4282,7 +4280,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi16(__m128i __a,
4282/// A 128-bit integer vector containing the values with bits to be extracted.4280/// A 128-bit integer vector containing the values with bits to be extracted.
4283/// \returns The most significant bits from each 8-bit element in \a __a,4281/// \returns The most significant bits from each 8-bit element in \a __a,
4284/// written to bits [15:0]. The other bits are assigned zeros.4282/// written to bits [15:0]. The other bits are assigned zeros.
4285static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_epi8(__m128i __a) {4283static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
4284_mm_movemask_epi8(__m128i __a) {
4286 return __builtin_ia32_pmovmskb128((__v16qi)__a);4285 return __builtin_ia32_pmovmskb128((__v16qi)__a);
4287}4286}
42884287
...@@ -4415,8 +4414,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_epi8(__m128i __a) {...@@ -4415,8 +4414,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_epi8(__m128i __a) {
4415/// Bits [119:112] are written to bits [111:104] of the result. \n4414/// Bits [119:112] are written to bits [111:104] of the result. \n
4416/// Bits [127:120] are written to bits [127:120] of the result.4415/// Bits [127:120] are written to bits [127:120] of the result.
4417/// \returns A 128-bit vector of [16 x i8] containing the interleaved values.4416/// \returns A 128-bit vector of [16 x i8] containing the interleaved values.
4418static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi8(__m128i __a,4417static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4419 __m128i __b) {4418_mm_unpackhi_epi8(__m128i __a, __m128i __b) {
4420 return (__m128i)__builtin_shufflevector(4419 return (__m128i)__builtin_shufflevector(
4421 (__v16qi)__a, (__v16qi)__b, 8, 16 + 8, 9, 16 + 9, 10, 16 + 10, 11,4420 (__v16qi)__a, (__v16qi)__b, 8, 16 + 8, 9, 16 + 9, 10, 16 + 10, 11,
4422 16 + 11, 12, 16 + 12, 13, 16 + 13, 14, 16 + 14, 15, 16 + 15);4421 16 + 11, 12, 16 + 12, 13, 16 + 13, 14, 16 + 14, 15, 16 + 15);
...@@ -4443,8 +4442,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi8(__m128i __a,...@@ -4443,8 +4442,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi8(__m128i __a,
4443/// Bits [111:96] are written to bits [95:80] of the result. \n4442/// Bits [111:96] are written to bits [95:80] of the result. \n
4444/// Bits [127:112] are written to bits [127:112] of the result.4443/// Bits [127:112] are written to bits [127:112] of the result.
4445/// \returns A 128-bit vector of [8 x i16] containing the interleaved values.4444/// \returns A 128-bit vector of [8 x i16] containing the interleaved values.
4446static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi16(__m128i __a,4445static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4447 __m128i __b) {4446_mm_unpackhi_epi16(__m128i __a, __m128i __b) {
4448 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8 + 4, 5,4447 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8 + 4, 5,
4449 8 + 5, 6, 8 + 6, 7, 8 + 7);4448 8 + 5, 6, 8 + 6, 7, 8 + 7);
4450}4449}
...@@ -4466,8 +4465,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi16(__m128i __a,...@@ -4466,8 +4465,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi16(__m128i __a,
4466/// Bits [95:64] are written to bits [64:32] of the destination. \n4465/// Bits [95:64] are written to bits [64:32] of the destination. \n
4467/// Bits [127:96] are written to bits [127:96] of the destination.4466/// Bits [127:96] are written to bits [127:96] of the destination.
4468/// \returns A 128-bit vector of [4 x i32] containing the interleaved values.4467/// \returns A 128-bit vector of [4 x i32] containing the interleaved values.
4469static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi32(__m128i __a,4468static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4470 __m128i __b) {4469_mm_unpackhi_epi32(__m128i __a, __m128i __b) {
4471 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4 + 2, 3,4470 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4 + 2, 3,
4472 4 + 3);4471 4 + 3);
4473}4472}
...@@ -4487,8 +4486,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi32(__m128i __a,...@@ -4487,8 +4486,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi32(__m128i __a,
4487/// A 128-bit vector of [2 x i64]. \n4486/// A 128-bit vector of [2 x i64]. \n
4488/// Bits [127:64] are written to bits [127:64] of the destination.4487/// Bits [127:64] are written to bits [127:64] of the destination.
4489/// \returns A 128-bit vector of [2 x i64] containing the interleaved values.4488/// \returns A 128-bit vector of [2 x i64] containing the interleaved values.
4490static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi64(__m128i __a,4489static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4491 __m128i __b) {4490_mm_unpackhi_epi64(__m128i __a, __m128i __b) {
4492 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 1, 2 + 1);4491 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 1, 2 + 1);
4493}4492}
44944493
...@@ -4521,8 +4520,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi64(__m128i __a,...@@ -4521,8 +4520,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi64(__m128i __a,
4521/// Bits [55:48] are written to bits [111:104] of the result. \n4520/// Bits [55:48] are written to bits [111:104] of the result. \n
4522/// Bits [63:56] are written to bits [127:120] of the result.4521/// Bits [63:56] are written to bits [127:120] of the result.
4523/// \returns A 128-bit vector of [16 x i8] containing the interleaved values.4522/// \returns A 128-bit vector of [16 x i8] containing the interleaved values.
4524static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi8(__m128i __a,4523static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4525 __m128i __b) {4524_mm_unpacklo_epi8(__m128i __a, __m128i __b) {
4526 return (__m128i)__builtin_shufflevector(4525 return (__m128i)__builtin_shufflevector(
4527 (__v16qi)__a, (__v16qi)__b, 0, 16 + 0, 1, 16 + 1, 2, 16 + 2, 3, 16 + 3, 4,4526 (__v16qi)__a, (__v16qi)__b, 0, 16 + 0, 1, 16 + 1, 2, 16 + 2, 3, 16 + 3, 4,
4528 16 + 4, 5, 16 + 5, 6, 16 + 6, 7, 16 + 7);4527 16 + 4, 5, 16 + 5, 6, 16 + 6, 7, 16 + 7);
...@@ -4550,8 +4549,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi8(__m128i __a,...@@ -4550,8 +4549,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi8(__m128i __a,
4550/// Bits [47:32] are written to bits [95:80] of the result. \n4549/// Bits [47:32] are written to bits [95:80] of the result. \n
4551/// Bits [63:48] are written to bits [127:112] of the result.4550/// Bits [63:48] are written to bits [127:112] of the result.
4552/// \returns A 128-bit vector of [8 x i16] containing the interleaved values.4551/// \returns A 128-bit vector of [8 x i16] containing the interleaved values.
4553static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi16(__m128i __a,4552static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4554 __m128i __b) {4553_mm_unpacklo_epi16(__m128i __a, __m128i __b) {
4555 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8 + 0, 1,4554 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8 + 0, 1,
4556 8 + 1, 2, 8 + 2, 3, 8 + 3);4555 8 + 1, 2, 8 + 2, 3, 8 + 3);
4557}4556}
...@@ -4573,8 +4572,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi16(__m128i __a,...@@ -4573,8 +4572,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi16(__m128i __a,
4573/// Bits [31:0] are written to bits [64:32] of the destination. \n4572/// Bits [31:0] are written to bits [64:32] of the destination. \n
4574/// Bits [63:32] are written to bits [127:96] of the destination.4573/// Bits [63:32] are written to bits [127:96] of the destination.
4575/// \returns A 128-bit vector of [4 x i32] containing the interleaved values.4574/// \returns A 128-bit vector of [4 x i32] containing the interleaved values.
4576static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi32(__m128i __a,4575static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4577 __m128i __b) {4576_mm_unpacklo_epi32(__m128i __a, __m128i __b) {
4578 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4 + 0, 1,4577 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4 + 0, 1,
4579 4 + 1);4578 4 + 1);
4580}4579}
...@@ -4594,8 +4593,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi32(__m128i __a,...@@ -4594,8 +4593,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi32(__m128i __a,
4594/// A 128-bit vector of [2 x i64]. \n4593/// A 128-bit vector of [2 x i64]. \n
4595/// Bits [63:0] are written to bits [127:64] of the destination. \n4594/// Bits [63:0] are written to bits [127:64] of the destination. \n
4596/// \returns A 128-bit vector of [2 x i64] containing the interleaved values.4595/// \returns A 128-bit vector of [2 x i64] containing the interleaved values.
4597static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi64(__m128i __a,4596static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4598 __m128i __b) {4597_mm_unpacklo_epi64(__m128i __a, __m128i __b) {
4599 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 0, 2 + 0);4598 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 0, 2 + 0);
4600}4599}
46014600
...@@ -4701,7 +4700,8 @@ _mm_unpacklo_pd(__m128d __a, __m128d __b) {...@@ -4701,7 +4700,8 @@ _mm_unpacklo_pd(__m128d __a, __m128d __b) {
4701/// be extracted.4700/// be extracted.
4702/// \returns The sign bits from each of the double-precision elements in \a __a,4701/// \returns The sign bits from each of the double-precision elements in \a __a,
4703/// written to bits [1:0]. The remaining bits are assigned values of zero.4702/// written to bits [1:0]. The remaining bits are assigned values of zero.
4704static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_pd(__m128d __a) {4703static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
4704_mm_movemask_pd(__m128d __a) {
4705 return __builtin_ia32_movmskpd((__v2df)__a);4705 return __builtin_ia32_movmskpd((__v2df)__a);
4706}4706}
47074707
lib/include/f16cintrin.h+23-9
...@@ -15,10 +15,21 @@...@@ -15,10 +15,21 @@
15#define __F16CINTRIN_H15#define __F16CINTRIN_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#define __DEFAULT_FN_ATTRS128 \18#if defined(__cplusplus) && (__cplusplus >= 201103L)
19 __attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(128)))19#define __DEFAULT_FN_ATTRS128 \
20#define __DEFAULT_FN_ATTRS256 \20 __attribute__((__always_inline__, __nodebug__, __target__("f16c"), \
21 __attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(256)))21 __min_vector_width__(128))) constexpr
22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, __target__("f16c"), \
24 __min_vector_width__(256))) constexpr
25#else
26#define __DEFAULT_FN_ATTRS128 \
27 __attribute__((__always_inline__, __nodebug__, __target__("f16c"), \
28 __min_vector_width__(128)))
29#define __DEFAULT_FN_ATTRS256 \
30 __attribute__((__always_inline__, __nodebug__, __target__("f16c"), \
31 __min_vector_width__(256)))
32#endif
2233
23/* NOTE: Intel documents the 128-bit versions of these as being in emmintrin.h,34/* NOTE: Intel documents the 128-bit versions of these as being in emmintrin.h,
24 * but that's because icc can emulate these without f16c using a library call.35 * but that's because icc can emulate these without f16c using a library call.
...@@ -38,9 +49,7 @@...@@ -38,9 +49,7 @@
38static __inline float __DEFAULT_FN_ATTRS12849static __inline float __DEFAULT_FN_ATTRS128
39_cvtsh_ss(unsigned short __a)50_cvtsh_ss(unsigned short __a)
40{51{
41 __v8hi __v = {(short)__a, 0, 0, 0, 0, 0, 0, 0};52 return (float)__builtin_bit_cast(__fp16, __a);
42 __v4sf __r = __builtin_ia32_vcvtph2ps(__v);
43 return __r[0];
44}53}
4554
46/// Converts a 32-bit single-precision float value to a 16-bit55/// Converts a 32-bit single-precision float value to a 16-bit
...@@ -109,7 +118,10 @@ _cvtsh_ss(unsigned short __a)...@@ -109,7 +118,10 @@ _cvtsh_ss(unsigned short __a)
109static __inline __m128 __DEFAULT_FN_ATTRS128118static __inline __m128 __DEFAULT_FN_ATTRS128
110_mm_cvtph_ps(__m128i __a)119_mm_cvtph_ps(__m128i __a)
111{120{
112 return (__m128)__builtin_ia32_vcvtph2ps((__v8hi)__a);121 typedef __fp16 __v4fp16 __attribute__((__vector_size__(8)));
122
123 __v4hi __v = __builtin_shufflevector((__v8hi)__a, (__v8hi)__a, 0, 1, 2, 3);
124 return (__m128) __builtin_convertvector((__v4fp16)__v, __v4sf);
113}125}
114126
115/// Converts a 256-bit vector of [8 x float] into a 128-bit vector127/// Converts a 256-bit vector of [8 x float] into a 128-bit vector
...@@ -153,7 +165,9 @@ _mm_cvtph_ps(__m128i __a)...@@ -153,7 +165,9 @@ _mm_cvtph_ps(__m128i __a)
153static __inline __m256 __DEFAULT_FN_ATTRS256165static __inline __m256 __DEFAULT_FN_ATTRS256
154_mm256_cvtph_ps(__m128i __a)166_mm256_cvtph_ps(__m128i __a)
155{167{
156 return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);168 typedef __fp16 __v8fp16 __attribute__((__vector_size__(16), __aligned__(16)));
169
170 return (__m256) __builtin_convertvector((__v8fp16)__a, __v8sf);
157}171}
158172
159#undef __DEFAULT_FN_ATTRS128173#undef __DEFAULT_FN_ATTRS128
lib/include/float.h+16-155
...@@ -7,13 +7,21 @@...@@ -7,13 +7,21 @@
7 *===-----------------------------------------------------------------------===7 *===-----------------------------------------------------------------------===
8 */8 */
99
10#ifndef __CLANG_FLOAT_H
11#define __CLANG_FLOAT_H
12
13#if defined(__MVS__) && __has_include_next(<float.h>)10#if defined(__MVS__) && __has_include_next(<float.h>)
11#include <__float_header_macro.h>
14#include_next <float.h>12#include_next <float.h>
15#else13#else
1614
15#if !defined(__need_infinity_nan)
16#define __need_float_float
17#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
18 !defined(__STRICT_ANSI__)
19#define __need_infinity_nan
20#endif
21#include <__float_header_macro.h>
22#endif
23
24#ifdef __need_float_float
17/* If we're on MinGW, fall back to the system's float.h, which might have25/* If we're on MinGW, fall back to the system's float.h, which might have
18 * additional definitions provided for Windows.26 * additional definitions provided for Windows.
19 * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx27 * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx
...@@ -26,162 +34,15 @@...@@ -26,162 +34,15 @@
2634
27# include_next <float.h>35# include_next <float.h>
2836
29/* Undefine anything that we'll be redefining below. */
30# undef FLT_EVAL_METHOD
31# undef FLT_ROUNDS
32# undef FLT_RADIX
33# undef FLT_MANT_DIG
34# undef DBL_MANT_DIG
35# undef LDBL_MANT_DIG
36#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
37 !defined(__STRICT_ANSI__) || \
38 (defined(__cplusplus) && __cplusplus >= 201103L) || \
39 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
40# undef DECIMAL_DIG
41# endif
42# undef FLT_DIG
43# undef DBL_DIG
44# undef LDBL_DIG
45# undef FLT_MIN_EXP
46# undef DBL_MIN_EXP
47# undef LDBL_MIN_EXP
48# undef FLT_MIN_10_EXP
49# undef DBL_MIN_10_EXP
50# undef LDBL_MIN_10_EXP
51# undef FLT_MAX_EXP
52# undef DBL_MAX_EXP
53# undef LDBL_MAX_EXP
54# undef FLT_MAX_10_EXP
55# undef DBL_MAX_10_EXP
56# undef LDBL_MAX_10_EXP
57# undef FLT_MAX
58# undef DBL_MAX
59# undef LDBL_MAX
60# undef FLT_EPSILON
61# undef DBL_EPSILON
62# undef LDBL_EPSILON
63# undef FLT_MIN
64# undef DBL_MIN
65# undef LDBL_MIN
66#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
67 !defined(__STRICT_ANSI__) || \
68 (defined(__cplusplus) && __cplusplus >= 201703L) || \
69 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
70# undef FLT_TRUE_MIN
71# undef DBL_TRUE_MIN
72# undef LDBL_TRUE_MIN
73# undef FLT_DECIMAL_DIG
74# undef DBL_DECIMAL_DIG
75# undef LDBL_DECIMAL_DIG
76# undef FLT_HAS_SUBNORM
77# undef DBL_HAS_SUBNORM
78# undef LDBL_HAS_SUBNORM
79# endif
80#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
81 !defined(__STRICT_ANSI__)
82# undef FLT_NORM_MAX
83# undef DBL_NORM_MAX
84# undef LDBL_NORM_MAX
85#endif
86#endif
87
88#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
89 !defined(__STRICT_ANSI__)
90# undef INFINITY
91# undef NAN
92#endif
93
94/* Characteristics of floating point types, C99 5.2.4.2.2 */
95
96#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
97 (defined(__cplusplus) && __cplusplus >= 201103L)
98#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
99#endif37#endif
100#define FLT_ROUNDS (__builtin_flt_rounds())
101#define FLT_RADIX __FLT_RADIX__
102
103#define FLT_MANT_DIG __FLT_MANT_DIG__
104#define DBL_MANT_DIG __DBL_MANT_DIG__
105#define LDBL_MANT_DIG __LDBL_MANT_DIG__
10638
107#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \39#include <__float_float.h>
108 !defined(__STRICT_ANSI__) || \40#undef __need_float_float
109 (defined(__cplusplus) && __cplusplus >= 201103L) || \
110 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
111# define DECIMAL_DIG __DECIMAL_DIG__
112#endif41#endif
11342
114#define FLT_DIG __FLT_DIG__43#ifdef __need_infinity_nan
115#define DBL_DIG __DBL_DIG__44#include <__float_infinity_nan.h>
116#define LDBL_DIG __LDBL_DIG__45#undef __need_infinity_nan
117
118#define FLT_MIN_EXP __FLT_MIN_EXP__
119#define DBL_MIN_EXP __DBL_MIN_EXP__
120#define LDBL_MIN_EXP __LDBL_MIN_EXP__
121
122#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
123#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
124#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
125
126#define FLT_MAX_EXP __FLT_MAX_EXP__
127#define DBL_MAX_EXP __DBL_MAX_EXP__
128#define LDBL_MAX_EXP __LDBL_MAX_EXP__
129
130#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
131#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
132#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
133
134#define FLT_MAX __FLT_MAX__
135#define DBL_MAX __DBL_MAX__
136#define LDBL_MAX __LDBL_MAX__
137
138#define FLT_EPSILON __FLT_EPSILON__
139#define DBL_EPSILON __DBL_EPSILON__
140#define LDBL_EPSILON __LDBL_EPSILON__
141
142#define FLT_MIN __FLT_MIN__
143#define DBL_MIN __DBL_MIN__
144#define LDBL_MIN __LDBL_MIN__
145
146#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
147 !defined(__STRICT_ANSI__) || \
148 (defined(__cplusplus) && __cplusplus >= 201703L) || \
149 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
150# define FLT_TRUE_MIN __FLT_DENORM_MIN__
151# define DBL_TRUE_MIN __DBL_DENORM_MIN__
152# define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
153# define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
154# define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
155# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
156# define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
157# define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
158# define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
159#endif46#endif
16047
161#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \
162 !defined(__STRICT_ANSI__)
163 /* C23 5.2.5.3.3p29-30 */
164# define INFINITY (__builtin_inff())
165# define NAN (__builtin_nanf(""))
166 /* C23 5.2.5.3.3p32 */
167# define FLT_NORM_MAX __FLT_NORM_MAX__
168# define DBL_NORM_MAX __DBL_NORM_MAX__
169# define LDBL_NORM_MAX __LDBL_NORM_MAX__
170#endif
171
172#ifdef __STDC_WANT_IEC_60559_TYPES_EXT__
173# define FLT16_MANT_DIG __FLT16_MANT_DIG__
174# define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__
175# define FLT16_DIG __FLT16_DIG__
176# define FLT16_MIN_EXP __FLT16_MIN_EXP__
177# define FLT16_MIN_10_EXP __FLT16_MIN_10_EXP__
178# define FLT16_MAX_EXP __FLT16_MAX_EXP__
179# define FLT16_MAX_10_EXP __FLT16_MAX_10_EXP__
180# define FLT16_MAX __FLT16_MAX__
181# define FLT16_EPSILON __FLT16_EPSILON__
182# define FLT16_MIN __FLT16_MIN__
183# define FLT16_TRUE_MIN __FLT16_TRUE_MIN__
184#endif /* __STDC_WANT_IEC_60559_TYPES_EXT__ */
185
186#endif /* __MVS__ */48#endif /* __MVS__ */
187#endif /* __CLANG_FLOAT_H */
lib/include/fma4intrin.h+98-96
...@@ -20,100 +20,100 @@...@@ -20,100 +20,100 @@
20#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(128)))20#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(256)))21#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(256)))
2222
23static __inline__ __m128 __DEFAULT_FN_ATTRS12823#if defined(__cplusplus) && (__cplusplus >= 201103L)
24_mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)24#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
25{25#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
26 return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);26#else
27#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
28#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
29#endif
30
31static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
32_mm_macc_ps(__m128 __A, __m128 __B, __m128 __C) {
33 return (__m128)__builtin_elementwise_fma((__v4sf)__A, (__v4sf)__B,
34 (__v4sf)__C);
27}35}
2836
29static __inline__ __m128d __DEFAULT_FN_ATTRS12837static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
30_mm_macc_pd(__m128d __A, __m128d __B, __m128d __C)38_mm_macc_pd(__m128d __A, __m128d __B, __m128d __C) {
31{39 return (__m128d)__builtin_elementwise_fma((__v2df)__A, (__v2df)__B,
32 return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C);40 (__v2df)__C);
33}41}
3442
35static __inline__ __m128 __DEFAULT_FN_ATTRS12843static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
36_mm_macc_ss(__m128 __A, __m128 __B, __m128 __C)44_mm_macc_ss(__m128 __A, __m128 __B, __m128 __C) {
37{45 return _mm_set_ss(__builtin_elementwise_fma(__A[0], __B[0], __C[0]));
38 return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
39}46}
4047
41static __inline__ __m128d __DEFAULT_FN_ATTRS12848static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
42_mm_macc_sd(__m128d __A, __m128d __B, __m128d __C)49_mm_macc_sd(__m128d __A, __m128d __B, __m128d __C) {
43{50 return _mm_set_sd(__builtin_elementwise_fma(__A[0], __B[0], __C[0]));
44 return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, (__v2df)__C);
45}51}
4652
47static __inline__ __m128 __DEFAULT_FN_ATTRS12853static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
48_mm_msub_ps(__m128 __A, __m128 __B, __m128 __C)54_mm_msub_ps(__m128 __A, __m128 __B, __m128 __C) {
49{55 return (__m128)__builtin_elementwise_fma((__v4sf)__A, (__v4sf)__B,
50 return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);56 -(__v4sf)__C);
51}57}
5258
53static __inline__ __m128d __DEFAULT_FN_ATTRS12859static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
54_mm_msub_pd(__m128d __A, __m128d __B, __m128d __C)60_mm_msub_pd(__m128d __A, __m128d __B, __m128d __C) {
55{61 return (__m128d)__builtin_elementwise_fma((__v2df)__A, (__v2df)__B,
56 return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);62 -(__v2df)__C);
57}63}
5864
59static __inline__ __m128 __DEFAULT_FN_ATTRS12865static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
60_mm_msub_ss(__m128 __A, __m128 __B, __m128 __C)66_mm_msub_ss(__m128 __A, __m128 __B, __m128 __C) {
61{67 return _mm_set_ss(__builtin_elementwise_fma(__A[0], __B[0], -__C[0]));
62 return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
63}68}
6469
65static __inline__ __m128d __DEFAULT_FN_ATTRS12870static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
66_mm_msub_sd(__m128d __A, __m128d __B, __m128d __C)71_mm_msub_sd(__m128d __A, __m128d __B, __m128d __C) {
67{72 return _mm_set_sd(__builtin_elementwise_fma(__A[0], __B[0], -__C[0]));
68 return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
69}73}
7074
71static __inline__ __m128 __DEFAULT_FN_ATTRS12875static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
72_mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C)76_mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C) {
73{77 return (__m128)__builtin_elementwise_fma(-(__v4sf)__A, (__v4sf)__B,
74 return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);78 (__v4sf)__C);
75}79}
7680
77static __inline__ __m128d __DEFAULT_FN_ATTRS12881static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
78_mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C)82_mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C) {
79{83 return (__m128d)__builtin_elementwise_fma(-(__v2df)__A, (__v2df)__B,
80 return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);84 (__v2df)__C);
81}85}
8286
83static __inline__ __m128 __DEFAULT_FN_ATTRS12887static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
84_mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C)88_mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C) {
85{89 return _mm_set_ss(__builtin_elementwise_fma(-__A[0], __B[0], __C[0]));
86 return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
87}90}
8891
89static __inline__ __m128d __DEFAULT_FN_ATTRS12892static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
90_mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C)93_mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C) {
91{94 return _mm_set_sd(__builtin_elementwise_fma(-__A[0], __B[0], __C[0]));
92 return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);
93}95}
9496
95static __inline__ __m128 __DEFAULT_FN_ATTRS12897static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
96_mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C)98_mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C) {
97{99 return (__m128)__builtin_elementwise_fma(-(__v4sf)__A, (__v4sf)__B,
98 return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);100 -(__v4sf)__C);
99}101}
100102
101static __inline__ __m128d __DEFAULT_FN_ATTRS128103static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
102_mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C)104_mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C) {
103{105 return (__m128d)__builtin_elementwise_fma(-(__v2df)__A, (__v2df)__B,
104 return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);106 -(__v2df)__C);
105}107}
106108
107static __inline__ __m128 __DEFAULT_FN_ATTRS128109static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
108_mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C)110_mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C) {
109{111 return _mm_set_ss(__builtin_elementwise_fma(-__A[0], __B[0], -__C[0]));
110 return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
111}112}
112113
113static __inline__ __m128d __DEFAULT_FN_ATTRS128114static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
114_mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C)115_mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C) {
115{116 return _mm_set_sd(__builtin_elementwise_fma(-__A[0], __B[0], -__C[0]));
116 return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);
117}117}
118118
119static __inline__ __m128 __DEFAULT_FN_ATTRS128119static __inline__ __m128 __DEFAULT_FN_ATTRS128
...@@ -140,52 +140,52 @@ _mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C)...@@ -140,52 +140,52 @@ _mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C)
140 return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);140 return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
141}141}
142142
143static __inline__ __m256 __DEFAULT_FN_ATTRS256143static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
144_mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C)144_mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C) {
145{145 return (__m256)__builtin_elementwise_fma((__v8sf)__A, (__v8sf)__B,
146 return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);146 (__v8sf)__C);
147}147}
148148
149static __inline__ __m256d __DEFAULT_FN_ATTRS256149static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
150_mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C)150_mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C) {
151{151 return (__m256d)__builtin_elementwise_fma((__v4df)__A, (__v4df)__B,
152 return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);152 (__v4df)__C);
153}153}
154154
155static __inline__ __m256 __DEFAULT_FN_ATTRS256155static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
156_mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C)156_mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C) {
157{157 return (__m256)__builtin_elementwise_fma((__v8sf)__A, (__v8sf)__B,
158 return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);158 -(__v8sf)__C);
159}159}
160160
161static __inline__ __m256d __DEFAULT_FN_ATTRS256161static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
162_mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C)162_mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C) {
163{163 return (__m256d)__builtin_elementwise_fma((__v4df)__A, (__v4df)__B,
164 return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);164 -(__v4df)__C);
165}165}
166166
167static __inline__ __m256 __DEFAULT_FN_ATTRS256167static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
168_mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C)168_mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C) {
169{169 return (__m256)__builtin_elementwise_fma(-(__v8sf)__A, (__v8sf)__B,
170 return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C);170 (__v8sf)__C);
171}171}
172172
173static __inline__ __m256d __DEFAULT_FN_ATTRS256173static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
174_mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C)174_mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C) {
175{175 return (__m256d)__builtin_elementwise_fma(-(__v4df)__A, (__v4df)__B,
176 return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C);176 (__v4df)__C);
177}177}
178178
179static __inline__ __m256 __DEFAULT_FN_ATTRS256179static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
180_mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C)180_mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C) {
181{181 return (__m256)__builtin_elementwise_fma(-(__v8sf)__A, (__v8sf)__B,
182 return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);182 -(__v8sf)__C);
183}183}
184184
185static __inline__ __m256d __DEFAULT_FN_ATTRS256185static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
186_mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C)186_mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C) {
187{187 return (__m256d)__builtin_elementwise_fma(-(__v4df)__A, (__v4df)__B,
188 return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C);188 -(__v4df)__C);
189}189}
190190
191static __inline__ __m256 __DEFAULT_FN_ATTRS256191static __inline__ __m256 __DEFAULT_FN_ATTRS256
...@@ -214,5 +214,7 @@ _mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C)...@@ -214,5 +214,7 @@ _mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C)
214214
215#undef __DEFAULT_FN_ATTRS128215#undef __DEFAULT_FN_ATTRS128
216#undef __DEFAULT_FN_ATTRS256216#undef __DEFAULT_FN_ATTRS256
217#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
218#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
217219
218#endif /* __FMA4INTRIN_H */220#endif /* __FMA4INTRIN_H */
lib/include/fmaintrin.h+96-66
...@@ -15,8 +15,20 @@...@@ -15,8 +15,20 @@
15#define __FMAINTRIN_H15#define __FMAINTRIN_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#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("fma"), __min_vector_width__(128)))18#define __DEFAULT_FN_ATTRS128 \
19#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("fma"), __min_vector_width__(256)))19 __attribute__((__always_inline__, __nodebug__, __target__("fma"), \
20 __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 \
22 __attribute__((__always_inline__, __nodebug__, __target__("fma"), \
23 __min_vector_width__(256)))
24
25#if defined(__cplusplus) && (__cplusplus >= 201103L)
26#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
27#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
28#else
29#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
30#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
31#endif
2032
21/// Computes a multiply-add of 128-bit vectors of [4 x float].33/// Computes a multiply-add of 128-bit vectors of [4 x float].
22/// For each element, computes <c> (__A * __B) + __C </c>.34/// For each element, computes <c> (__A * __B) + __C </c>.
...@@ -32,10 +44,11 @@...@@ -32,10 +44,11 @@
32/// \param __C44/// \param __C
33/// A 128-bit vector of [4 x float] containing the addend.45/// A 128-bit vector of [4 x float] containing the addend.
34/// \returns A 128-bit vector of [4 x float] containing the result.46/// \returns A 128-bit vector of [4 x float] containing the result.
35static __inline__ __m128 __DEFAULT_FN_ATTRS12847static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
36_mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C)48_mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C)
37{49{
38 return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);50 return (__m128)__builtin_elementwise_fma((__v4sf)__A, (__v4sf)__B,
51 (__v4sf)__C);
39}52}
4053
41/// Computes a multiply-add of 128-bit vectors of [2 x double].54/// Computes a multiply-add of 128-bit vectors of [2 x double].
...@@ -52,10 +65,11 @@ _mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C)...@@ -52,10 +65,11 @@ _mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C)
52/// \param __C65/// \param __C
53/// A 128-bit vector of [2 x double] containing the addend.66/// A 128-bit vector of [2 x double] containing the addend.
54/// \returns A 128-bit [2 x double] vector containing the result.67/// \returns A 128-bit [2 x double] vector containing the result.
55static __inline__ __m128d __DEFAULT_FN_ATTRS12868static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
56_mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C)69_mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C)
57{70{
58 return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C);71 return (__m128d)__builtin_elementwise_fma((__v2df)__A, (__v2df)__B,
72 (__v2df)__C);
59}73}
6074
61/// Computes a scalar multiply-add of the single-precision values in the75/// Computes a scalar multiply-add of the single-precision values in the
...@@ -81,10 +95,10 @@ _mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C)...@@ -81,10 +95,10 @@ _mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C)
81/// 32 bits.95/// 32 bits.
82/// \returns A 128-bit vector of [4 x float] containing the result in the low96/// \returns A 128-bit vector of [4 x float] containing the result in the low
83/// 32 bits and a copy of \a __A[127:32] in the upper 96 bits.97/// 32 bits and a copy of \a __A[127:32] in the upper 96 bits.
84static __inline__ __m128 __DEFAULT_FN_ATTRS12898static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
85_mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C)99_mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C) {
86{100 __A[0] = __builtin_elementwise_fma(__A[0], __B[0], __C[0]);
87 return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);101 return __A;
88}102}
89103
90/// Computes a scalar multiply-add of the double-precision values in the104/// Computes a scalar multiply-add of the double-precision values in the
...@@ -110,10 +124,10 @@ _mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C)...@@ -110,10 +124,10 @@ _mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C)
110/// 64 bits.124/// 64 bits.
111/// \returns A 128-bit vector of [2 x double] containing the result in the low125/// \returns A 128-bit vector of [2 x double] containing the result in the low
112/// 64 bits and a copy of \a __A[127:64] in the upper 64 bits.126/// 64 bits and a copy of \a __A[127:64] in the upper 64 bits.
113static __inline__ __m128d __DEFAULT_FN_ATTRS128127static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
114_mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C)128_mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C) {
115{129 __A[0] = __builtin_elementwise_fma(__A[0], __B[0], __C[0]);
116 return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, (__v2df)__C);130 return __A;
117}131}
118132
119/// Computes a multiply-subtract of 128-bit vectors of [4 x float].133/// Computes a multiply-subtract of 128-bit vectors of [4 x float].
...@@ -130,10 +144,11 @@ _mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C)...@@ -130,10 +144,11 @@ _mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C)
130/// \param __C144/// \param __C
131/// A 128-bit vector of [4 x float] containing the subtrahend.145/// A 128-bit vector of [4 x float] containing the subtrahend.
132/// \returns A 128-bit vector of [4 x float] containing the result.146/// \returns A 128-bit vector of [4 x float] containing the result.
133static __inline__ __m128 __DEFAULT_FN_ATTRS128147static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
134_mm_fmsub_ps(__m128 __A, __m128 __B, __m128 __C)148_mm_fmsub_ps(__m128 __A, __m128 __B, __m128 __C)
135{149{
136 return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);150 return (__m128)__builtin_elementwise_fma((__v4sf)__A, (__v4sf)__B,
151 -(__v4sf)__C);
137}152}
138153
139/// Computes a multiply-subtract of 128-bit vectors of [2 x double].154/// Computes a multiply-subtract of 128-bit vectors of [2 x double].
...@@ -150,10 +165,11 @@ _mm_fmsub_ps(__m128 __A, __m128 __B, __m128 __C)...@@ -150,10 +165,11 @@ _mm_fmsub_ps(__m128 __A, __m128 __B, __m128 __C)
150/// \param __C165/// \param __C
151/// A 128-bit vector of [2 x double] containing the addend.166/// A 128-bit vector of [2 x double] containing the addend.
152/// \returns A 128-bit vector of [2 x double] containing the result.167/// \returns A 128-bit vector of [2 x double] containing the result.
153static __inline__ __m128d __DEFAULT_FN_ATTRS128168static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
154_mm_fmsub_pd(__m128d __A, __m128d __B, __m128d __C)169_mm_fmsub_pd(__m128d __A, __m128d __B, __m128d __C)
155{170{
156 return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);171 return (__m128d)__builtin_elementwise_fma((__v2df)__A, (__v2df)__B,
172 -(__v2df)__C);
157}173}
158174
159/// Computes a scalar multiply-subtract of the single-precision values in175/// Computes a scalar multiply-subtract of the single-precision values in
...@@ -179,10 +195,10 @@ _mm_fmsub_pd(__m128d __A, __m128d __B, __m128d __C)...@@ -179,10 +195,10 @@ _mm_fmsub_pd(__m128d __A, __m128d __B, __m128d __C)
179/// 32 bits.195/// 32 bits.
180/// \returns A 128-bit vector of [4 x float] containing the result in the low196/// \returns A 128-bit vector of [4 x float] containing the result in the low
181/// 32 bits, and a copy of \a __A[127:32] in the upper 96 bits.197/// 32 bits, and a copy of \a __A[127:32] in the upper 96 bits.
182static __inline__ __m128 __DEFAULT_FN_ATTRS128198static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
183_mm_fmsub_ss(__m128 __A, __m128 __B, __m128 __C)199_mm_fmsub_ss(__m128 __A, __m128 __B, __m128 __C) {
184{200 __A[0] = __builtin_elementwise_fma(__A[0], __B[0], -__C[0]);
185 return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);201 return __A;
186}202}
187203
188/// Computes a scalar multiply-subtract of the double-precision values in204/// Computes a scalar multiply-subtract of the double-precision values in
...@@ -208,10 +224,10 @@ _mm_fmsub_ss(__m128 __A, __m128 __B, __m128 __C)...@@ -208,10 +224,10 @@ _mm_fmsub_ss(__m128 __A, __m128 __B, __m128 __C)
208/// 64 bits.224/// 64 bits.
209/// \returns A 128-bit vector of [2 x double] containing the result in the low225/// \returns A 128-bit vector of [2 x double] containing the result in the low
210/// 64 bits, and a copy of \a __A[127:64] in the upper 64 bits.226/// 64 bits, and a copy of \a __A[127:64] in the upper 64 bits.
211static __inline__ __m128d __DEFAULT_FN_ATTRS128227static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
212_mm_fmsub_sd(__m128d __A, __m128d __B, __m128d __C)228_mm_fmsub_sd(__m128d __A, __m128d __B, __m128d __C) {
213{229 __A[0] = __builtin_elementwise_fma(__A[0], __B[0], -__C[0]);
214 return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, -(__v2df)__C);230 return __A;
215}231}
216232
217/// Computes a negated multiply-add of 128-bit vectors of [4 x float].233/// Computes a negated multiply-add of 128-bit vectors of [4 x float].
...@@ -228,10 +244,11 @@ _mm_fmsub_sd(__m128d __A, __m128d __B, __m128d __C)...@@ -228,10 +244,11 @@ _mm_fmsub_sd(__m128d __A, __m128d __B, __m128d __C)
228/// \param __C244/// \param __C
229/// A 128-bit vector of [4 x float] containing the addend.245/// A 128-bit vector of [4 x float] containing the addend.
230/// \returns A 128-bit [4 x float] vector containing the result.246/// \returns A 128-bit [4 x float] vector containing the result.
231static __inline__ __m128 __DEFAULT_FN_ATTRS128247static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
232_mm_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C)248_mm_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C)
233{249{
234 return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);250 return (__m128)__builtin_elementwise_fma(-(__v4sf)__A, (__v4sf)__B,
251 (__v4sf)__C);
235}252}
236253
237/// Computes a negated multiply-add of 128-bit vectors of [2 x double].254/// Computes a negated multiply-add of 128-bit vectors of [2 x double].
...@@ -248,10 +265,11 @@ _mm_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C)...@@ -248,10 +265,11 @@ _mm_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C)
248/// \param __C265/// \param __C
249/// A 128-bit vector of [2 x double] containing the addend.266/// A 128-bit vector of [2 x double] containing the addend.
250/// \returns A 128-bit vector of [2 x double] containing the result.267/// \returns A 128-bit vector of [2 x double] containing the result.
251static __inline__ __m128d __DEFAULT_FN_ATTRS128268static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
252_mm_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C)269_mm_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C)
253{270{
254 return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);271 return (__m128d)__builtin_elementwise_fma(-(__v2df)__A, (__v2df)__B,
272 (__v2df)__C);
255}273}
256274
257/// Computes a scalar negated multiply-add of the single-precision values in275/// Computes a scalar negated multiply-add of the single-precision values in
...@@ -277,10 +295,10 @@ _mm_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C)...@@ -277,10 +295,10 @@ _mm_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C)
277/// 32 bits.295/// 32 bits.
278/// \returns A 128-bit vector of [4 x float] containing the result in the low296/// \returns A 128-bit vector of [4 x float] containing the result in the low
279/// 32 bits, and a copy of \a __A[127:32] in the upper 96 bits.297/// 32 bits, and a copy of \a __A[127:32] in the upper 96 bits.
280static __inline__ __m128 __DEFAULT_FN_ATTRS128298static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
281_mm_fnmadd_ss(__m128 __A, __m128 __B, __m128 __C)299_mm_fnmadd_ss(__m128 __A, __m128 __B, __m128 __C) {
282{300 __A[0] = __builtin_elementwise_fma(__A[0], -__B[0], __C[0]);
283 return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, -(__v4sf)__B, (__v4sf)__C);301 return __A;
284}302}
285303
286/// Computes a scalar negated multiply-add of the double-precision values304/// Computes a scalar negated multiply-add of the double-precision values
...@@ -306,10 +324,10 @@ _mm_fnmadd_ss(__m128 __A, __m128 __B, __m128 __C)...@@ -306,10 +324,10 @@ _mm_fnmadd_ss(__m128 __A, __m128 __B, __m128 __C)
306/// 64 bits.324/// 64 bits.
307/// \returns A 128-bit vector of [2 x double] containing the result in the low325/// \returns A 128-bit vector of [2 x double] containing the result in the low
308/// 64 bits, and a copy of \a __A[127:64] in the upper 64 bits.326/// 64 bits, and a copy of \a __A[127:64] in the upper 64 bits.
309static __inline__ __m128d __DEFAULT_FN_ATTRS128327static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
310_mm_fnmadd_sd(__m128d __A, __m128d __B, __m128d __C)328_mm_fnmadd_sd(__m128d __A, __m128d __B, __m128d __C) {
311{329 __A[0] = __builtin_elementwise_fma(__A[0], -__B[0], __C[0]);
312 return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, -(__v2df)__B, (__v2df)__C);330 return __A;
313}331}
314332
315/// Computes a negated multiply-subtract of 128-bit vectors of [4 x float].333/// Computes a negated multiply-subtract of 128-bit vectors of [4 x float].
...@@ -326,10 +344,11 @@ _mm_fnmadd_sd(__m128d __A, __m128d __B, __m128d __C)...@@ -326,10 +344,11 @@ _mm_fnmadd_sd(__m128d __A, __m128d __B, __m128d __C)
326/// \param __C344/// \param __C
327/// A 128-bit vector of [4 x float] containing the subtrahend.345/// A 128-bit vector of [4 x float] containing the subtrahend.
328/// \returns A 128-bit vector of [4 x float] containing the result.346/// \returns A 128-bit vector of [4 x float] containing the result.
329static __inline__ __m128 __DEFAULT_FN_ATTRS128347static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
330_mm_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C)348_mm_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C)
331{349{
332 return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);350 return (__m128)__builtin_elementwise_fma(-(__v4sf)__A, (__v4sf)__B,
351 -(__v4sf)__C);
333}352}
334353
335/// Computes a negated multiply-subtract of 128-bit vectors of [2 x double].354/// Computes a negated multiply-subtract of 128-bit vectors of [2 x double].
...@@ -346,10 +365,11 @@ _mm_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C)...@@ -346,10 +365,11 @@ _mm_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C)
346/// \param __C365/// \param __C
347/// A 128-bit vector of [2 x double] containing the subtrahend.366/// A 128-bit vector of [2 x double] containing the subtrahend.
348/// \returns A 128-bit vector of [2 x double] containing the result.367/// \returns A 128-bit vector of [2 x double] containing the result.
349static __inline__ __m128d __DEFAULT_FN_ATTRS128368static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
350_mm_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C)369_mm_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C)
351{370{
352 return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);371 return (__m128d)__builtin_elementwise_fma(-(__v2df)__A, (__v2df)__B,
372 -(__v2df)__C);
353}373}
354374
355/// Computes a scalar negated multiply-subtract of the single-precision375/// Computes a scalar negated multiply-subtract of the single-precision
...@@ -375,10 +395,10 @@ _mm_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C)...@@ -375,10 +395,10 @@ _mm_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C)
375/// 32 bits.395/// 32 bits.
376/// \returns A 128-bit vector of [4 x float] containing the result in the low396/// \returns A 128-bit vector of [4 x float] containing the result in the low
377/// 32 bits, and a copy of \a __A[127:32] in the upper 96 bits.397/// 32 bits, and a copy of \a __A[127:32] in the upper 96 bits.
378static __inline__ __m128 __DEFAULT_FN_ATTRS128398static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
379_mm_fnmsub_ss(__m128 __A, __m128 __B, __m128 __C)399_mm_fnmsub_ss(__m128 __A, __m128 __B, __m128 __C) {
380{400 __A[0] = __builtin_elementwise_fma(__A[0], -__B[0], -__C[0]);
381 return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, -(__v4sf)__B, -(__v4sf)__C);401 return __A;
382}402}
383403
384/// Computes a scalar negated multiply-subtract of the double-precision404/// Computes a scalar negated multiply-subtract of the double-precision
...@@ -404,10 +424,10 @@ _mm_fnmsub_ss(__m128 __A, __m128 __B, __m128 __C)...@@ -404,10 +424,10 @@ _mm_fnmsub_ss(__m128 __A, __m128 __B, __m128 __C)
404/// 64 bits.424/// 64 bits.
405/// \returns A 128-bit vector of [2 x double] containing the result in the low425/// \returns A 128-bit vector of [2 x double] containing the result in the low
406/// 64 bits, and a copy of \a __A[127:64] in the upper 64 bits.426/// 64 bits, and a copy of \a __A[127:64] in the upper 64 bits.
407static __inline__ __m128d __DEFAULT_FN_ATTRS128427static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
408_mm_fnmsub_sd(__m128d __A, __m128d __B, __m128d __C)428_mm_fnmsub_sd(__m128d __A, __m128d __B, __m128d __C) {
409{429 __A[0] = __builtin_elementwise_fma(__A[0], -__B[0], -__C[0]);
410 return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, -(__v2df)__B, -(__v2df)__C);430 return __A;
411}431}
412432
413/// Computes a multiply with alternating add/subtract of 128-bit vectors of433/// Computes a multiply with alternating add/subtract of 128-bit vectors of
...@@ -528,10 +548,11 @@ _mm_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C)...@@ -528,10 +548,11 @@ _mm_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C)
528/// \param __C548/// \param __C
529/// A 256-bit vector of [8 x float] containing the addend.549/// A 256-bit vector of [8 x float] containing the addend.
530/// \returns A 256-bit vector of [8 x float] containing the result.550/// \returns A 256-bit vector of [8 x float] containing the result.
531static __inline__ __m256 __DEFAULT_FN_ATTRS256551static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
532_mm256_fmadd_ps(__m256 __A, __m256 __B, __m256 __C)552_mm256_fmadd_ps(__m256 __A, __m256 __B, __m256 __C)
533{553{
534 return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);554 return (__m256)__builtin_elementwise_fma((__v8sf)__A, (__v8sf)__B,
555 (__v8sf)__C);
535}556}
536557
537/// Computes a multiply-add of 256-bit vectors of [4 x double].558/// Computes a multiply-add of 256-bit vectors of [4 x double].
...@@ -548,10 +569,11 @@ _mm256_fmadd_ps(__m256 __A, __m256 __B, __m256 __C)...@@ -548,10 +569,11 @@ _mm256_fmadd_ps(__m256 __A, __m256 __B, __m256 __C)
548/// \param __C569/// \param __C
549/// A 256-bit vector of [4 x double] containing the addend.570/// A 256-bit vector of [4 x double] containing the addend.
550/// \returns A 256-bit vector of [4 x double] containing the result.571/// \returns A 256-bit vector of [4 x double] containing the result.
551static __inline__ __m256d __DEFAULT_FN_ATTRS256572static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
552_mm256_fmadd_pd(__m256d __A, __m256d __B, __m256d __C)573_mm256_fmadd_pd(__m256d __A, __m256d __B, __m256d __C)
553{574{
554 return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);575 return (__m256d)__builtin_elementwise_fma((__v4df)__A, (__v4df)__B,
576 (__v4df)__C);
555}577}
556578
557/// Computes a multiply-subtract of 256-bit vectors of [8 x float].579/// Computes a multiply-subtract of 256-bit vectors of [8 x float].
...@@ -568,10 +590,11 @@ _mm256_fmadd_pd(__m256d __A, __m256d __B, __m256d __C)...@@ -568,10 +590,11 @@ _mm256_fmadd_pd(__m256d __A, __m256d __B, __m256d __C)
568/// \param __C590/// \param __C
569/// A 256-bit vector of [8 x float] containing the subtrahend.591/// A 256-bit vector of [8 x float] containing the subtrahend.
570/// \returns A 256-bit vector of [8 x float] containing the result.592/// \returns A 256-bit vector of [8 x float] containing the result.
571static __inline__ __m256 __DEFAULT_FN_ATTRS256593static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
572_mm256_fmsub_ps(__m256 __A, __m256 __B, __m256 __C)594_mm256_fmsub_ps(__m256 __A, __m256 __B, __m256 __C)
573{595{
574 return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);596 return (__m256)__builtin_elementwise_fma((__v8sf)__A, (__v8sf)__B,
597 -(__v8sf)__C);
575}598}
576599
577/// Computes a multiply-subtract of 256-bit vectors of [4 x double].600/// Computes a multiply-subtract of 256-bit vectors of [4 x double].
...@@ -588,10 +611,11 @@ _mm256_fmsub_ps(__m256 __A, __m256 __B, __m256 __C)...@@ -588,10 +611,11 @@ _mm256_fmsub_ps(__m256 __A, __m256 __B, __m256 __C)
588/// \param __C611/// \param __C
589/// A 256-bit vector of [4 x double] containing the subtrahend.612/// A 256-bit vector of [4 x double] containing the subtrahend.
590/// \returns A 256-bit vector of [4 x double] containing the result.613/// \returns A 256-bit vector of [4 x double] containing the result.
591static __inline__ __m256d __DEFAULT_FN_ATTRS256614static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
592_mm256_fmsub_pd(__m256d __A, __m256d __B, __m256d __C)615_mm256_fmsub_pd(__m256d __A, __m256d __B, __m256d __C)
593{616{
594 return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);617 return (__m256d)__builtin_elementwise_fma((__v4df)__A, (__v4df)__B,
618 -(__v4df)__C);
595}619}
596620
597/// Computes a negated multiply-add of 256-bit vectors of [8 x float].621/// Computes a negated multiply-add of 256-bit vectors of [8 x float].
...@@ -608,10 +632,11 @@ _mm256_fmsub_pd(__m256d __A, __m256d __B, __m256d __C)...@@ -608,10 +632,11 @@ _mm256_fmsub_pd(__m256d __A, __m256d __B, __m256d __C)
608/// \param __C632/// \param __C
609/// A 256-bit vector of [8 x float] containing the addend.633/// A 256-bit vector of [8 x float] containing the addend.
610/// \returns A 256-bit vector of [8 x float] containing the result.634/// \returns A 256-bit vector of [8 x float] containing the result.
611static __inline__ __m256 __DEFAULT_FN_ATTRS256635static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
612_mm256_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C)636_mm256_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C)
613{637{
614 return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C);638 return (__m256)__builtin_elementwise_fma(-(__v8sf)__A, (__v8sf)__B,
639 (__v8sf)__C);
615}640}
616641
617/// Computes a negated multiply-add of 256-bit vectors of [4 x double].642/// Computes a negated multiply-add of 256-bit vectors of [4 x double].
...@@ -628,10 +653,11 @@ _mm256_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C)...@@ -628,10 +653,11 @@ _mm256_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C)
628/// \param __C653/// \param __C
629/// A 256-bit vector of [4 x double] containing the addend.654/// A 256-bit vector of [4 x double] containing the addend.
630/// \returns A 256-bit vector of [4 x double] containing the result.655/// \returns A 256-bit vector of [4 x double] containing the result.
631static __inline__ __m256d __DEFAULT_FN_ATTRS256656static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
632_mm256_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C)657_mm256_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C)
633{658{
634 return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C);659 return (__m256d)__builtin_elementwise_fma(-(__v4df)__A, (__v4df)__B,
660 (__v4df)__C);
635}661}
636662
637/// Computes a negated multiply-subtract of 256-bit vectors of [8 x float].663/// Computes a negated multiply-subtract of 256-bit vectors of [8 x float].
...@@ -648,10 +674,11 @@ _mm256_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C)...@@ -648,10 +674,11 @@ _mm256_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C)
648/// \param __C674/// \param __C
649/// A 256-bit vector of [8 x float] containing the subtrahend.675/// A 256-bit vector of [8 x float] containing the subtrahend.
650/// \returns A 256-bit vector of [8 x float] containing the result.676/// \returns A 256-bit vector of [8 x float] containing the result.
651static __inline__ __m256 __DEFAULT_FN_ATTRS256677static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
652_mm256_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C)678_mm256_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C)
653{679{
654 return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);680 return (__m256)__builtin_elementwise_fma(-(__v8sf)__A, (__v8sf)__B,
681 -(__v8sf)__C);
655}682}
656683
657/// Computes a negated multiply-subtract of 256-bit vectors of [4 x double].684/// Computes a negated multiply-subtract of 256-bit vectors of [4 x double].
...@@ -668,10 +695,11 @@ _mm256_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C)...@@ -668,10 +695,11 @@ _mm256_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C)
668/// \param __C695/// \param __C
669/// A 256-bit vector of [4 x double] containing the subtrahend.696/// A 256-bit vector of [4 x double] containing the subtrahend.
670/// \returns A 256-bit vector of [4 x double] containing the result.697/// \returns A 256-bit vector of [4 x double] containing the result.
671static __inline__ __m256d __DEFAULT_FN_ATTRS256698static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
672_mm256_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C)699_mm256_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C)
673{700{
674 return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C);701 return (__m256d)__builtin_elementwise_fma(-(__v4df)__A, (__v4df)__B,
702 -(__v4df)__C);
675}703}
676704
677/// Computes a multiply with alternating add/subtract of 256-bit vectors of705/// Computes a multiply with alternating add/subtract of 256-bit vectors of
...@@ -792,5 +820,7 @@ _mm256_fmsubadd_pd(__m256d __A, __m256d __B, __m256d __C)...@@ -792,5 +820,7 @@ _mm256_fmsubadd_pd(__m256d __A, __m256d __B, __m256d __C)
792820
793#undef __DEFAULT_FN_ATTRS128821#undef __DEFAULT_FN_ATTRS128
794#undef __DEFAULT_FN_ATTRS256822#undef __DEFAULT_FN_ATTRS256
823#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
824#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
795825
796#endif /* __FMAINTRIN_H */826#endif /* __FMAINTRIN_H */
lib/include/gfniintrin.h+21-16
...@@ -14,29 +14,36 @@...@@ -14,29 +14,36 @@
14#ifndef __GFNIINTRIN_H14#ifndef __GFNIINTRIN_H
15#define __GFNIINTRIN_H15#define __GFNIINTRIN_H
1616
17#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
18/* Default attributes for simple form (no masking). */17/* Default attributes for simple form (no masking). */
18#if defined(__cplusplus) && (__cplusplus >= 201103L)
19#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("gfni"), \
21 __target__("gfni,no-evex512"), __min_vector_width__(128)))21 __min_vector_width__(128))) constexpr
2222
23/* Default attributes for YMM unmasked form. */23/* Default attributes for YMM unmasked form. */
24#define __DEFAULT_FN_ATTRS_Y \24#define __DEFAULT_FN_ATTRS_Y \
25 __attribute__((__always_inline__, __nodebug__, \25 __attribute__((__always_inline__, __nodebug__, __target__("avx,gfni"), \
26 __target__("avx,gfni,no-evex512"), \26 __min_vector_width__(256))) constexpr
27 __min_vector_width__(256)))
2827
29/* Default attributes for VLX masked forms. */28/* Default attributes for VLX masked forms. */
30#define __DEFAULT_FN_ATTRS_VL128 \29#define __DEFAULT_FN_ATTRS_VL128 \
31 __attribute__((__always_inline__, __nodebug__, \30 __attribute__((__always_inline__, __nodebug__, \
32 __target__("avx512bw,avx512vl,gfni,no-evex512"), \31 __target__("avx512bw,avx512vl,gfni"), \
33 __min_vector_width__(128)))32 __min_vector_width__(128))) constexpr
34#define __DEFAULT_FN_ATTRS_VL256 \33#define __DEFAULT_FN_ATTRS_VL256 \
35 __attribute__((__always_inline__, __nodebug__, \34 __attribute__((__always_inline__, __nodebug__, \
36 __target__("avx512bw,avx512vl,gfni,no-evex512"), \35 __target__("avx512bw,avx512vl,gfni"), \
37 __min_vector_width__(256)))36 __min_vector_width__(256))) constexpr
37
38/* Default attributes for ZMM unmasked forms. */
39#define __DEFAULT_FN_ATTRS_Z \
40 __attribute__((__always_inline__, __nodebug__, __target__("avx512f,gfni"), \
41 __min_vector_width__(512))) constexpr
42/* Default attributes for ZMM masked forms. */
43#define __DEFAULT_FN_ATTRS_Z_MASK \
44 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni"), \
45 __min_vector_width__(512))) constexpr
38#else46#else
39/* Default attributes for simple form (no masking). */
40#define __DEFAULT_FN_ATTRS \47#define __DEFAULT_FN_ATTRS \
41 __attribute__((__always_inline__, __nodebug__, __target__("gfni"), \48 __attribute__((__always_inline__, __nodebug__, __target__("gfni"), \
42 __min_vector_width__(128)))49 __min_vector_width__(128)))
...@@ -55,18 +62,16 @@...@@ -55,18 +62,16 @@
55 __attribute__((__always_inline__, __nodebug__, \62 __attribute__((__always_inline__, __nodebug__, \
56 __target__("avx512bw,avx512vl,gfni"), \63 __target__("avx512bw,avx512vl,gfni"), \
57 __min_vector_width__(256)))64 __min_vector_width__(256)))
58#endif
5965
60/* Default attributes for ZMM unmasked forms. */66/* Default attributes for ZMM unmasked forms. */
61#define __DEFAULT_FN_ATTRS_Z \67#define __DEFAULT_FN_ATTRS_Z \
62 __attribute__((__always_inline__, __nodebug__, \68 __attribute__((__always_inline__, __nodebug__, __target__("avx512f,gfni"), \
63 __target__("avx512f,evex512,gfni"), \
64 __min_vector_width__(512)))69 __min_vector_width__(512)))
65/* Default attributes for ZMM masked forms. */70/* Default attributes for ZMM masked forms. */
66#define __DEFAULT_FN_ATTRS_Z_MASK \71#define __DEFAULT_FN_ATTRS_Z_MASK \
67 __attribute__((__always_inline__, __nodebug__, \72 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni"), \
68 __target__("avx512bw,evex512,gfni"), \
69 __min_vector_width__(512)))73 __min_vector_width__(512)))
74#endif
7075
71#define _mm_gf2p8affineinv_epi64_epi8(A, B, I) \76#define _mm_gf2p8affineinv_epi64_epi8(A, B, I) \
72 ((__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \77 ((__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \
lib/include/hexagon_types.h+23-20
...@@ -11,6 +11,11 @@...@@ -11,6 +11,11 @@
1111
12#include <hexagon_protos.h>12#include <hexagon_protos.h>
1313
14// Save and undefine B0 to avoid conflicts with POSIX termios.h which
15// defines B0 as a macro for baud rate 0.
16#pragma push_macro("B0")
17#undef B0
18
14/* Hexagon names */19/* Hexagon names */
15#define HEXAGON_Vect HEXAGON_Vect6420#define HEXAGON_Vect HEXAGON_Vect64
16#define HEXAGON_V_GET_D HEXAGON_V64_GET_D21#define HEXAGON_V_GET_D HEXAGON_V64_GET_D
...@@ -697,9 +702,8 @@ public:...@@ -697,9 +702,8 @@ public:
697 };702 };
698703
699 // Extract byte methods704 // Extract byte methods
700 signed char B0(void) {705 signed char b0(void) { return HEXAGON_V64_GET_B0(data); };
701 return HEXAGON_V64_GET_B0(data);706 signed char B0(void) { return b0(); };
702 };
703 signed char B1(void) {707 signed char B1(void) {
704 return HEXAGON_V64_GET_B1(data);708 return HEXAGON_V64_GET_B1(data);
705 };709 };
...@@ -776,9 +780,10 @@ public:...@@ -776,9 +780,10 @@ public:
776 };780 };
777781
778 // Set byte methods782 // Set byte methods
779 HEXAGON_Vect64C B0(signed char b) {783 HEXAGON_Vect64C b0(signed char b) {
780 return HEXAGON_Vect64C(HEXAGON_V64_PUT_B0(data, b));784 return HEXAGON_Vect64C(HEXAGON_V64_PUT_B0(data, b));
781 };785 };
786 HEXAGON_Vect64C B0(signed char b) { return b0(b); };
782 HEXAGON_Vect64C B1(signed char b) {787 HEXAGON_Vect64C B1(signed char b) {
783 return HEXAGON_Vect64C(HEXAGON_V64_PUT_B1(data, b));788 return HEXAGON_Vect64C(HEXAGON_V64_PUT_B1(data, b));
784 };789 };
...@@ -1121,9 +1126,8 @@ public:...@@ -1121,9 +1126,8 @@ public:
1121 };1126 };
11221127
1123 // Extract byte methods1128 // Extract byte methods
1124 signed char B0(void) {1129 signed char b0(void) { return HEXAGON_V32_GET_B0(data); };
1125 return HEXAGON_V32_GET_B0(data);1130 signed char B0(void) { return b0(); };
1126 };
1127 signed char B1(void) {1131 signed char B1(void) {
1128 return HEXAGON_V32_GET_B1(data);1132 return HEXAGON_V32_GET_B1(data);
1129 };1133 };
...@@ -1162,9 +1166,10 @@ public:...@@ -1162,9 +1166,10 @@ public:
1162 };1166 };
11631167
1164 // Set byte methods1168 // Set byte methods
1165 HEXAGON_Vect32C B0(signed char b) {1169 HEXAGON_Vect32C b0(signed char b) {
1166 return HEXAGON_Vect32C(HEXAGON_V32_PUT_B0(data, b));1170 return HEXAGON_Vect32C(HEXAGON_V32_PUT_B0(data, b));
1167 };1171 };
1172 HEXAGON_Vect32C B0(signed char b) { return b0(b); };
1168 HEXAGON_Vect32C B1(signed char b) {1173 HEXAGON_Vect32C B1(signed char b) {
1169 return HEXAGON_Vect32C(HEXAGON_V32_PUT_B1(data, b));1174 return HEXAGON_Vect32C(HEXAGON_V32_PUT_B1(data, b));
1170 };1175 };
...@@ -1924,9 +1929,8 @@ public:...@@ -1924,9 +1929,8 @@ public:
1924 };1929 };
19251930
1926 // Extract byte methods1931 // Extract byte methods
1927 signed char B0(void) {1932 signed char b0(void) { return Q6V64_GET_B0(data); };
1928 return Q6V64_GET_B0(data);1933 signed char B0(void) { return b0(); };
1929 };
1930 signed char B1(void) {1934 signed char B1(void) {
1931 return Q6V64_GET_B1(data);1935 return Q6V64_GET_B1(data);
1932 };1936 };
...@@ -2003,9 +2007,8 @@ public:...@@ -2003,9 +2007,8 @@ public:
2003 };2007 };
20042008
2005 // Set byte methods2009 // Set byte methods
2006 Q6Vect64C B0(signed char b) {2010 Q6Vect64C b0(signed char b) { return Q6Vect64C(Q6V64_PUT_B0(data, b)); };
2007 return Q6Vect64C(Q6V64_PUT_B0(data, b));2011 Q6Vect64C B0(signed char b) { return b0(b); };
2008 };
2009 Q6Vect64C B1(signed char b) {2012 Q6Vect64C B1(signed char b) {
2010 return Q6Vect64C(Q6V64_PUT_B1(data, b));2013 return Q6Vect64C(Q6V64_PUT_B1(data, b));
2011 };2014 };
...@@ -2348,9 +2351,8 @@ public:...@@ -2348,9 +2351,8 @@ public:
2348 };2351 };
23492352
2350 // Extract byte methods2353 // Extract byte methods
2351 signed char B0(void) {2354 signed char b0(void) { return Q6V32_GET_B0(data); };
2352 return Q6V32_GET_B0(data);2355 signed char B0(void) { return b0(); };
2353 };
2354 signed char B1(void) {2356 signed char B1(void) {
2355 return Q6V32_GET_B1(data);2357 return Q6V32_GET_B1(data);
2356 };2358 };
...@@ -2389,9 +2391,8 @@ public:...@@ -2389,9 +2391,8 @@ public:
2389 };2391 };
23902392
2391 // Set byte methods2393 // Set byte methods
2392 Q6Vect32C B0(signed char b) {2394 Q6Vect32C b0(signed char b) { return Q6Vect32C(Q6V32_PUT_B0(data, b)); };
2393 return Q6Vect32C(Q6V32_PUT_B0(data, b));2395 Q6Vect32C B0(signed char b) { return b0(b); };
2394 };
2395 Q6Vect32C B1(signed char b) {2396 Q6Vect32C B1(signed char b) {
2396 return Q6Vect32C(Q6V32_PUT_B1(data, b));2397 return Q6Vect32C(Q6V32_PUT_B1(data, b));
2397 };2398 };
...@@ -2622,4 +2623,6 @@ typedef struct hexagon_udma_descriptor_type1_s...@@ -2622,4 +2623,6 @@ typedef struct hexagon_udma_descriptor_type1_s
2622 unsigned int dstwidthoffset:16;2623 unsigned int dstwidthoffset:16;
2623} hexagon_udma_descriptor_type1_t;2624} hexagon_udma_descriptor_type1_t;
26242625
2626#pragma pop_macro("B0")
2627
2625#endif /* !HEXAGON_TYPES_H */2628#endif /* !HEXAGON_TYPES_H */
lib/include/hvx_hexagon_protos.h+649-860
...@@ -19,7 +19,6 @@...@@ -19,7 +19,6 @@
19#define __BUILTIN_VECTOR_WRAP(a) a19#define __BUILTIN_VECTOR_WRAP(a) a
20#endif20#endif
2121
22#if __HVX_ARCH__ >= 60
23/* ==========================================================================22/* ==========================================================================
24 Assembly Syntax: Rd32=vextract(Vu32,Rs32)23 Assembly Syntax: Rd32=vextract(Vu32,Rs32)
25 C Intrinsic Prototype: Word32 Q6_R_vextract_VR(HVX_Vector Vu, Word32 Rs)24 C Intrinsic Prototype: Word32 Q6_R_vextract_VR(HVX_Vector Vu, Word32 Rs)
...@@ -28,9 +27,7 @@...@@ -28,9 +27,7 @@
28 ========================================================================== */27 ========================================================================== */
2928
30#define Q6_R_vextract_VR(Vu,Rs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_extractw)(Vu,Rs)29#define Q6_R_vextract_VR(Vu,Rs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_extractw)(Vu,Rs)
31#endif /* __HEXAGON_ARCH___ >= 60 */
3230
33#if __HVX_ARCH__ >= 60
34/* ==========================================================================31/* ==========================================================================
35 Assembly Syntax: Vd32=hi(Vss32)32 Assembly Syntax: Vd32=hi(Vss32)
36 C Intrinsic Prototype: HVX_Vector Q6_V_hi_W(HVX_VectorPair Vss)33 C Intrinsic Prototype: HVX_Vector Q6_V_hi_W(HVX_VectorPair Vss)
...@@ -39,9 +36,7 @@...@@ -39,9 +36,7 @@
39 ========================================================================== */36 ========================================================================== */
4037
41#define Q6_V_hi_W(Vss) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_hi)(Vss)38#define Q6_V_hi_W(Vss) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_hi)(Vss)
42#endif /* __HEXAGON_ARCH___ >= 60 */
4339
44#if __HVX_ARCH__ >= 60
45/* ==========================================================================40/* ==========================================================================
46 Assembly Syntax: Vd32=lo(Vss32)41 Assembly Syntax: Vd32=lo(Vss32)
47 C Intrinsic Prototype: HVX_Vector Q6_V_lo_W(HVX_VectorPair Vss)42 C Intrinsic Prototype: HVX_Vector Q6_V_lo_W(HVX_VectorPair Vss)
...@@ -50,9 +45,7 @@...@@ -50,9 +45,7 @@
50 ========================================================================== */45 ========================================================================== */
5146
52#define Q6_V_lo_W(Vss) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lo)(Vss)47#define Q6_V_lo_W(Vss) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lo)(Vss)
53#endif /* __HEXAGON_ARCH___ >= 60 */
5448
55#if __HVX_ARCH__ >= 60
56/* ==========================================================================49/* ==========================================================================
57 Assembly Syntax: Vd32=vsplat(Rt32)50 Assembly Syntax: Vd32=vsplat(Rt32)
58 C Intrinsic Prototype: HVX_Vector Q6_V_vsplat_R(Word32 Rt)51 C Intrinsic Prototype: HVX_Vector Q6_V_vsplat_R(Word32 Rt)
...@@ -61,9 +54,7 @@...@@ -61,9 +54,7 @@
61 ========================================================================== */54 ========================================================================== */
6255
63#define Q6_V_vsplat_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lvsplatw)(Rt)56#define Q6_V_vsplat_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lvsplatw)(Rt)
64#endif /* __HEXAGON_ARCH___ >= 60 */
6557
66#if __HVX_ARCH__ >= 60
67/* ==========================================================================58/* ==========================================================================
68 Assembly Syntax: Qd4=and(Qs4,Qt4)59 Assembly Syntax: Qd4=and(Qs4,Qt4)
69 C Intrinsic Prototype: HVX_VectorPred Q6_Q_and_QQ(HVX_VectorPred Qs, HVX_VectorPred Qt)60 C Intrinsic Prototype: HVX_VectorPred Q6_Q_and_QQ(HVX_VectorPred Qs, HVX_VectorPred Qt)
...@@ -72,9 +63,7 @@...@@ -72,9 +63,7 @@
72 ========================================================================== */63 ========================================================================== */
7364
74#define Q6_Q_and_QQ(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)65#define Q6_Q_and_QQ(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
75#endif /* __HEXAGON_ARCH___ >= 60 */
7666
77#if __HVX_ARCH__ >= 60
78/* ==========================================================================67/* ==========================================================================
79 Assembly Syntax: Qd4=and(Qs4,!Qt4)68 Assembly Syntax: Qd4=and(Qs4,!Qt4)
80 C Intrinsic Prototype: HVX_VectorPred Q6_Q_and_QQn(HVX_VectorPred Qs, HVX_VectorPred Qt)69 C Intrinsic Prototype: HVX_VectorPred Q6_Q_and_QQn(HVX_VectorPred Qs, HVX_VectorPred Qt)
...@@ -83,9 +72,7 @@...@@ -83,9 +72,7 @@
83 ========================================================================== */72 ========================================================================== */
8473
85#define Q6_Q_and_QQn(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_and_n)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)74#define Q6_Q_and_QQn(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_and_n)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
86#endif /* __HEXAGON_ARCH___ >= 60 */
8775
88#if __HVX_ARCH__ >= 60
89/* ==========================================================================76/* ==========================================================================
90 Assembly Syntax: Qd4=not(Qs4)77 Assembly Syntax: Qd4=not(Qs4)
91 C Intrinsic Prototype: HVX_VectorPred Q6_Q_not_Q(HVX_VectorPred Qs)78 C Intrinsic Prototype: HVX_VectorPred Q6_Q_not_Q(HVX_VectorPred Qs)
...@@ -94,9 +81,7 @@...@@ -94,9 +81,7 @@
94 ========================================================================== */81 ========================================================================== */
9582
96#define Q6_Q_not_Q(Qs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_not)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1))),-1)83#define Q6_Q_not_Q(Qs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_not)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1))),-1)
97#endif /* __HEXAGON_ARCH___ >= 60 */
9884
99#if __HVX_ARCH__ >= 60
100/* ==========================================================================85/* ==========================================================================
101 Assembly Syntax: Qd4=or(Qs4,Qt4)86 Assembly Syntax: Qd4=or(Qs4,Qt4)
102 C Intrinsic Prototype: HVX_VectorPred Q6_Q_or_QQ(HVX_VectorPred Qs, HVX_VectorPred Qt)87 C Intrinsic Prototype: HVX_VectorPred Q6_Q_or_QQ(HVX_VectorPred Qs, HVX_VectorPred Qt)
...@@ -105,9 +90,7 @@...@@ -105,9 +90,7 @@
105 ========================================================================== */90 ========================================================================== */
10691
107#define Q6_Q_or_QQ(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)92#define Q6_Q_or_QQ(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
108#endif /* __HEXAGON_ARCH___ >= 60 */
10993
110#if __HVX_ARCH__ >= 60
111/* ==========================================================================94/* ==========================================================================
112 Assembly Syntax: Qd4=or(Qs4,!Qt4)95 Assembly Syntax: Qd4=or(Qs4,!Qt4)
113 C Intrinsic Prototype: HVX_VectorPred Q6_Q_or_QQn(HVX_VectorPred Qs, HVX_VectorPred Qt)96 C Intrinsic Prototype: HVX_VectorPred Q6_Q_or_QQn(HVX_VectorPred Qs, HVX_VectorPred Qt)
...@@ -116,9 +99,7 @@...@@ -116,9 +99,7 @@
116 ========================================================================== */99 ========================================================================== */
117100
118#define Q6_Q_or_QQn(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_or_n)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)101#define Q6_Q_or_QQn(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_or_n)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
119#endif /* __HEXAGON_ARCH___ >= 60 */
120102
121#if __HVX_ARCH__ >= 60
122/* ==========================================================================103/* ==========================================================================
123 Assembly Syntax: Qd4=vsetq(Rt32)104 Assembly Syntax: Qd4=vsetq(Rt32)
124 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vsetq_R(Word32 Rt)105 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vsetq_R(Word32 Rt)
...@@ -127,9 +108,7 @@...@@ -127,9 +108,7 @@
127 ========================================================================== */108 ========================================================================== */
128109
129#define Q6_Q_vsetq_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_scalar2)(Rt)),-1)110#define Q6_Q_vsetq_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_scalar2)(Rt)),-1)
130#endif /* __HEXAGON_ARCH___ >= 60 */
131111
132#if __HVX_ARCH__ >= 60
133/* ==========================================================================112/* ==========================================================================
134 Assembly Syntax: Qd4=xor(Qs4,Qt4)113 Assembly Syntax: Qd4=xor(Qs4,Qt4)
135 C Intrinsic Prototype: HVX_VectorPred Q6_Q_xor_QQ(HVX_VectorPred Qs, HVX_VectorPred Qt)114 C Intrinsic Prototype: HVX_VectorPred Q6_Q_xor_QQ(HVX_VectorPred Qs, HVX_VectorPred Qt)
...@@ -138,9 +117,7 @@...@@ -138,9 +117,7 @@
138 ========================================================================== */117 ========================================================================== */
139118
140#define Q6_Q_xor_QQ(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)119#define Q6_Q_xor_QQ(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
141#endif /* __HEXAGON_ARCH___ >= 60 */
142120
143#if __HVX_ARCH__ >= 60
144/* ==========================================================================121/* ==========================================================================
145 Assembly Syntax: if (!Qv4) vmem(Rt32+#s4)=Vs32122 Assembly Syntax: if (!Qv4) vmem(Rt32+#s4)=Vs32
146 C Intrinsic Prototype: void Q6_vmem_QnRIV(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)123 C Intrinsic Prototype: void Q6_vmem_QnRIV(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)
...@@ -149,9 +126,7 @@...@@ -149,9 +126,7 @@
149 ========================================================================== */126 ========================================================================== */
150127
151#define Q6_vmem_QnRIV(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_nqpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)128#define Q6_vmem_QnRIV(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_nqpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)
152#endif /* __HEXAGON_ARCH___ >= 60 */
153129
154#if __HVX_ARCH__ >= 60
155/* ==========================================================================130/* ==========================================================================
156 Assembly Syntax: if (!Qv4) vmem(Rt32+#s4):nt=Vs32131 Assembly Syntax: if (!Qv4) vmem(Rt32+#s4):nt=Vs32
157 C Intrinsic Prototype: void Q6_vmem_QnRIV_nt(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)132 C Intrinsic Prototype: void Q6_vmem_QnRIV_nt(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)
...@@ -160,9 +135,7 @@...@@ -160,9 +135,7 @@
160 ========================================================================== */135 ========================================================================== */
161136
162#define Q6_vmem_QnRIV_nt(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_nt_nqpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)137#define Q6_vmem_QnRIV_nt(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_nt_nqpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)
163#endif /* __HEXAGON_ARCH___ >= 60 */
164138
165#if __HVX_ARCH__ >= 60
166/* ==========================================================================139/* ==========================================================================
167 Assembly Syntax: if (Qv4) vmem(Rt32+#s4):nt=Vs32140 Assembly Syntax: if (Qv4) vmem(Rt32+#s4):nt=Vs32
168 C Intrinsic Prototype: void Q6_vmem_QRIV_nt(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)141 C Intrinsic Prototype: void Q6_vmem_QRIV_nt(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)
...@@ -171,9 +144,7 @@...@@ -171,9 +144,7 @@
171 ========================================================================== */144 ========================================================================== */
172145
173#define Q6_vmem_QRIV_nt(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_nt_qpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)146#define Q6_vmem_QRIV_nt(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_nt_qpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)
174#endif /* __HEXAGON_ARCH___ >= 60 */
175147
176#if __HVX_ARCH__ >= 60
177/* ==========================================================================148/* ==========================================================================
178 Assembly Syntax: if (Qv4) vmem(Rt32+#s4)=Vs32149 Assembly Syntax: if (Qv4) vmem(Rt32+#s4)=Vs32
179 C Intrinsic Prototype: void Q6_vmem_QRIV(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)150 C Intrinsic Prototype: void Q6_vmem_QRIV(HVX_VectorPred Qv, HVX_Vector* Rt, HVX_Vector Vs)
...@@ -182,9 +153,7 @@...@@ -182,9 +153,7 @@
182 ========================================================================== */153 ========================================================================== */
183154
184#define Q6_vmem_QRIV(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_qpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)155#define Q6_vmem_QRIV(Qv,Rt,Vs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vS32b_qpred_ai)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Rt,Vs)
185#endif /* __HEXAGON_ARCH___ >= 60 */
186156
187#if __HVX_ARCH__ >= 60
188/* ==========================================================================157/* ==========================================================================
189 Assembly Syntax: Vd32.uh=vabsdiff(Vu32.h,Vv32.h)158 Assembly Syntax: Vd32.uh=vabsdiff(Vu32.h,Vv32.h)
190 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vabsdiff_VhVh(HVX_Vector Vu, HVX_Vector Vv)159 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vabsdiff_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -193,9 +162,7 @@...@@ -193,9 +162,7 @@
193 ========================================================================== */162 ========================================================================== */
194163
195#define Q6_Vuh_vabsdiff_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffh)(Vu,Vv)164#define Q6_Vuh_vabsdiff_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffh)(Vu,Vv)
196#endif /* __HEXAGON_ARCH___ >= 60 */
197165
198#if __HVX_ARCH__ >= 60
199/* ==========================================================================166/* ==========================================================================
200 Assembly Syntax: Vd32.ub=vabsdiff(Vu32.ub,Vv32.ub)167 Assembly Syntax: Vd32.ub=vabsdiff(Vu32.ub,Vv32.ub)
201 C Intrinsic Prototype: HVX_Vector Q6_Vub_vabsdiff_VubVub(HVX_Vector Vu, HVX_Vector Vv)168 C Intrinsic Prototype: HVX_Vector Q6_Vub_vabsdiff_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -204,9 +171,7 @@...@@ -204,9 +171,7 @@
204 ========================================================================== */171 ========================================================================== */
205172
206#define Q6_Vub_vabsdiff_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffub)(Vu,Vv)173#define Q6_Vub_vabsdiff_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffub)(Vu,Vv)
207#endif /* __HEXAGON_ARCH___ >= 60 */
208174
209#if __HVX_ARCH__ >= 60
210/* ==========================================================================175/* ==========================================================================
211 Assembly Syntax: Vd32.uh=vabsdiff(Vu32.uh,Vv32.uh)176 Assembly Syntax: Vd32.uh=vabsdiff(Vu32.uh,Vv32.uh)
212 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vabsdiff_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)177 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vabsdiff_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -215,9 +180,7 @@...@@ -215,9 +180,7 @@
215 ========================================================================== */180 ========================================================================== */
216181
217#define Q6_Vuh_vabsdiff_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffuh)(Vu,Vv)182#define Q6_Vuh_vabsdiff_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffuh)(Vu,Vv)
218#endif /* __HEXAGON_ARCH___ >= 60 */
219183
220#if __HVX_ARCH__ >= 60
221/* ==========================================================================184/* ==========================================================================
222 Assembly Syntax: Vd32.uw=vabsdiff(Vu32.w,Vv32.w)185 Assembly Syntax: Vd32.uw=vabsdiff(Vu32.w,Vv32.w)
223 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vabsdiff_VwVw(HVX_Vector Vu, HVX_Vector Vv)186 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vabsdiff_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -226,9 +189,7 @@...@@ -226,9 +189,7 @@
226 ========================================================================== */189 ========================================================================== */
227190
228#define Q6_Vuw_vabsdiff_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffw)(Vu,Vv)191#define Q6_Vuw_vabsdiff_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsdiffw)(Vu,Vv)
229#endif /* __HEXAGON_ARCH___ >= 60 */
230192
231#if __HVX_ARCH__ >= 60
232/* ==========================================================================193/* ==========================================================================
233 Assembly Syntax: Vd32.h=vabs(Vu32.h)194 Assembly Syntax: Vd32.h=vabs(Vu32.h)
234 C Intrinsic Prototype: HVX_Vector Q6_Vh_vabs_Vh(HVX_Vector Vu)195 C Intrinsic Prototype: HVX_Vector Q6_Vh_vabs_Vh(HVX_Vector Vu)
...@@ -237,9 +198,7 @@...@@ -237,9 +198,7 @@
237 ========================================================================== */198 ========================================================================== */
238199
239#define Q6_Vh_vabs_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsh)(Vu)200#define Q6_Vh_vabs_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsh)(Vu)
240#endif /* __HEXAGON_ARCH___ >= 60 */
241201
242#if __HVX_ARCH__ >= 60
243/* ==========================================================================202/* ==========================================================================
244 Assembly Syntax: Vd32.h=vabs(Vu32.h):sat203 Assembly Syntax: Vd32.h=vabs(Vu32.h):sat
245 C Intrinsic Prototype: HVX_Vector Q6_Vh_vabs_Vh_sat(HVX_Vector Vu)204 C Intrinsic Prototype: HVX_Vector Q6_Vh_vabs_Vh_sat(HVX_Vector Vu)
...@@ -248,9 +207,7 @@...@@ -248,9 +207,7 @@
248 ========================================================================== */207 ========================================================================== */
249208
250#define Q6_Vh_vabs_Vh_sat(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsh_sat)(Vu)209#define Q6_Vh_vabs_Vh_sat(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsh_sat)(Vu)
251#endif /* __HEXAGON_ARCH___ >= 60 */
252210
253#if __HVX_ARCH__ >= 60
254/* ==========================================================================211/* ==========================================================================
255 Assembly Syntax: Vd32.w=vabs(Vu32.w)212 Assembly Syntax: Vd32.w=vabs(Vu32.w)
256 C Intrinsic Prototype: HVX_Vector Q6_Vw_vabs_Vw(HVX_Vector Vu)213 C Intrinsic Prototype: HVX_Vector Q6_Vw_vabs_Vw(HVX_Vector Vu)
...@@ -259,9 +216,7 @@...@@ -259,9 +216,7 @@
259 ========================================================================== */216 ========================================================================== */
260217
261#define Q6_Vw_vabs_Vw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsw)(Vu)218#define Q6_Vw_vabs_Vw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsw)(Vu)
262#endif /* __HEXAGON_ARCH___ >= 60 */
263219
264#if __HVX_ARCH__ >= 60
265/* ==========================================================================220/* ==========================================================================
266 Assembly Syntax: Vd32.w=vabs(Vu32.w):sat221 Assembly Syntax: Vd32.w=vabs(Vu32.w):sat
267 C Intrinsic Prototype: HVX_Vector Q6_Vw_vabs_Vw_sat(HVX_Vector Vu)222 C Intrinsic Prototype: HVX_Vector Q6_Vw_vabs_Vw_sat(HVX_Vector Vu)
...@@ -270,9 +225,7 @@...@@ -270,9 +225,7 @@
270 ========================================================================== */225 ========================================================================== */
271226
272#define Q6_Vw_vabs_Vw_sat(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsw_sat)(Vu)227#define Q6_Vw_vabs_Vw_sat(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsw_sat)(Vu)
273#endif /* __HEXAGON_ARCH___ >= 60 */
274228
275#if __HVX_ARCH__ >= 60
276/* ==========================================================================229/* ==========================================================================
277 Assembly Syntax: Vd32.b=vadd(Vu32.b,Vv32.b)230 Assembly Syntax: Vd32.b=vadd(Vu32.b,Vv32.b)
278 C Intrinsic Prototype: HVX_Vector Q6_Vb_vadd_VbVb(HVX_Vector Vu, HVX_Vector Vv)231 C Intrinsic Prototype: HVX_Vector Q6_Vb_vadd_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -281,9 +234,7 @@...@@ -281,9 +234,7 @@
281 ========================================================================== */234 ========================================================================== */
282235
283#define Q6_Vb_vadd_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddb)(Vu,Vv)236#define Q6_Vb_vadd_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddb)(Vu,Vv)
284#endif /* __HEXAGON_ARCH___ >= 60 */
285237
286#if __HVX_ARCH__ >= 60
287/* ==========================================================================238/* ==========================================================================
288 Assembly Syntax: Vdd32.b=vadd(Vuu32.b,Vvv32.b)239 Assembly Syntax: Vdd32.b=vadd(Vuu32.b,Vvv32.b)
289 C Intrinsic Prototype: HVX_VectorPair Q6_Wb_vadd_WbWb(HVX_VectorPair Vuu, HVX_VectorPair Vvv)240 C Intrinsic Prototype: HVX_VectorPair Q6_Wb_vadd_WbWb(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -292,9 +243,7 @@...@@ -292,9 +243,7 @@
292 ========================================================================== */243 ========================================================================== */
293244
294#define Q6_Wb_vadd_WbWb(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddb_dv)(Vuu,Vvv)245#define Q6_Wb_vadd_WbWb(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddb_dv)(Vuu,Vvv)
295#endif /* __HEXAGON_ARCH___ >= 60 */
296246
297#if __HVX_ARCH__ >= 60
298/* ==========================================================================247/* ==========================================================================
299 Assembly Syntax: if (!Qv4) Vx32.b+=Vu32.b248 Assembly Syntax: if (!Qv4) Vx32.b+=Vu32.b
300 C Intrinsic Prototype: HVX_Vector Q6_Vb_condacc_QnVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)249 C Intrinsic Prototype: HVX_Vector Q6_Vb_condacc_QnVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -303,9 +252,7 @@...@@ -303,9 +252,7 @@
303 ========================================================================== */252 ========================================================================== */
304253
305#define Q6_Vb_condacc_QnVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)254#define Q6_Vb_condacc_QnVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
306#endif /* __HEXAGON_ARCH___ >= 60 */
307255
308#if __HVX_ARCH__ >= 60
309/* ==========================================================================256/* ==========================================================================
310 Assembly Syntax: if (Qv4) Vx32.b+=Vu32.b257 Assembly Syntax: if (Qv4) Vx32.b+=Vu32.b
311 C Intrinsic Prototype: HVX_Vector Q6_Vb_condacc_QVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)258 C Intrinsic Prototype: HVX_Vector Q6_Vb_condacc_QVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -314,9 +261,7 @@...@@ -314,9 +261,7 @@
314 ========================================================================== */261 ========================================================================== */
315262
316#define Q6_Vb_condacc_QVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)263#define Q6_Vb_condacc_QVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
317#endif /* __HEXAGON_ARCH___ >= 60 */
318264
319#if __HVX_ARCH__ >= 60
320/* ==========================================================================265/* ==========================================================================
321 Assembly Syntax: Vd32.h=vadd(Vu32.h,Vv32.h)266 Assembly Syntax: Vd32.h=vadd(Vu32.h,Vv32.h)
322 C Intrinsic Prototype: HVX_Vector Q6_Vh_vadd_VhVh(HVX_Vector Vu, HVX_Vector Vv)267 C Intrinsic Prototype: HVX_Vector Q6_Vh_vadd_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -325,9 +270,7 @@...@@ -325,9 +270,7 @@
325 ========================================================================== */270 ========================================================================== */
326271
327#define Q6_Vh_vadd_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddh)(Vu,Vv)272#define Q6_Vh_vadd_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddh)(Vu,Vv)
328#endif /* __HEXAGON_ARCH___ >= 60 */
329273
330#if __HVX_ARCH__ >= 60
331/* ==========================================================================274/* ==========================================================================
332 Assembly Syntax: Vdd32.h=vadd(Vuu32.h,Vvv32.h)275 Assembly Syntax: Vdd32.h=vadd(Vuu32.h,Vvv32.h)
333 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vadd_WhWh(HVX_VectorPair Vuu, HVX_VectorPair Vvv)276 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vadd_WhWh(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -336,9 +279,7 @@...@@ -336,9 +279,7 @@
336 ========================================================================== */279 ========================================================================== */
337280
338#define Q6_Wh_vadd_WhWh(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddh_dv)(Vuu,Vvv)281#define Q6_Wh_vadd_WhWh(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddh_dv)(Vuu,Vvv)
339#endif /* __HEXAGON_ARCH___ >= 60 */
340282
341#if __HVX_ARCH__ >= 60
342/* ==========================================================================283/* ==========================================================================
343 Assembly Syntax: if (!Qv4) Vx32.h+=Vu32.h284 Assembly Syntax: if (!Qv4) Vx32.h+=Vu32.h
344 C Intrinsic Prototype: HVX_Vector Q6_Vh_condacc_QnVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)285 C Intrinsic Prototype: HVX_Vector Q6_Vh_condacc_QnVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -347,9 +288,7 @@...@@ -347,9 +288,7 @@
347 ========================================================================== */288 ========================================================================== */
348289
349#define Q6_Vh_condacc_QnVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)290#define Q6_Vh_condacc_QnVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
350#endif /* __HEXAGON_ARCH___ >= 60 */
351291
352#if __HVX_ARCH__ >= 60
353/* ==========================================================================292/* ==========================================================================
354 Assembly Syntax: if (Qv4) Vx32.h+=Vu32.h293 Assembly Syntax: if (Qv4) Vx32.h+=Vu32.h
355 C Intrinsic Prototype: HVX_Vector Q6_Vh_condacc_QVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)294 C Intrinsic Prototype: HVX_Vector Q6_Vh_condacc_QVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -358,9 +297,7 @@...@@ -358,9 +297,7 @@
358 ========================================================================== */297 ========================================================================== */
359298
360#define Q6_Vh_condacc_QVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)299#define Q6_Vh_condacc_QVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
361#endif /* __HEXAGON_ARCH___ >= 60 */
362300
363#if __HVX_ARCH__ >= 60
364/* ==========================================================================301/* ==========================================================================
365 Assembly Syntax: Vd32.h=vadd(Vu32.h,Vv32.h):sat302 Assembly Syntax: Vd32.h=vadd(Vu32.h,Vv32.h):sat
366 C Intrinsic Prototype: HVX_Vector Q6_Vh_vadd_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)303 C Intrinsic Prototype: HVX_Vector Q6_Vh_vadd_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -369,9 +306,7 @@...@@ -369,9 +306,7 @@
369 ========================================================================== */306 ========================================================================== */
370307
371#define Q6_Vh_vadd_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhsat)(Vu,Vv)308#define Q6_Vh_vadd_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhsat)(Vu,Vv)
372#endif /* __HEXAGON_ARCH___ >= 60 */
373309
374#if __HVX_ARCH__ >= 60
375/* ==========================================================================310/* ==========================================================================
376 Assembly Syntax: Vdd32.h=vadd(Vuu32.h,Vvv32.h):sat311 Assembly Syntax: Vdd32.h=vadd(Vuu32.h,Vvv32.h):sat
377 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vadd_WhWh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)312 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vadd_WhWh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -380,9 +315,7 @@...@@ -380,9 +315,7 @@
380 ========================================================================== */315 ========================================================================== */
381316
382#define Q6_Wh_vadd_WhWh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhsat_dv)(Vuu,Vvv)317#define Q6_Wh_vadd_WhWh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhsat_dv)(Vuu,Vvv)
383#endif /* __HEXAGON_ARCH___ >= 60 */
384318
385#if __HVX_ARCH__ >= 60
386/* ==========================================================================319/* ==========================================================================
387 Assembly Syntax: Vdd32.w=vadd(Vu32.h,Vv32.h)320 Assembly Syntax: Vdd32.w=vadd(Vu32.h,Vv32.h)
388 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_VhVh(HVX_Vector Vu, HVX_Vector Vv)321 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -391,9 +324,7 @@...@@ -391,9 +324,7 @@
391 ========================================================================== */324 ========================================================================== */
392325
393#define Q6_Ww_vadd_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhw)(Vu,Vv)326#define Q6_Ww_vadd_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhw)(Vu,Vv)
394#endif /* __HEXAGON_ARCH___ >= 60 */
395327
396#if __HVX_ARCH__ >= 60
397/* ==========================================================================328/* ==========================================================================
398 Assembly Syntax: Vdd32.h=vadd(Vu32.ub,Vv32.ub)329 Assembly Syntax: Vdd32.h=vadd(Vu32.ub,Vv32.ub)
399 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vadd_VubVub(HVX_Vector Vu, HVX_Vector Vv)330 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vadd_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -402,9 +333,7 @@...@@ -402,9 +333,7 @@
402 ========================================================================== */333 ========================================================================== */
403334
404#define Q6_Wh_vadd_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubh)(Vu,Vv)335#define Q6_Wh_vadd_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubh)(Vu,Vv)
405#endif /* __HEXAGON_ARCH___ >= 60 */
406336
407#if __HVX_ARCH__ >= 60
408/* ==========================================================================337/* ==========================================================================
409 Assembly Syntax: Vd32.ub=vadd(Vu32.ub,Vv32.ub):sat338 Assembly Syntax: Vd32.ub=vadd(Vu32.ub,Vv32.ub):sat
410 C Intrinsic Prototype: HVX_Vector Q6_Vub_vadd_VubVub_sat(HVX_Vector Vu, HVX_Vector Vv)339 C Intrinsic Prototype: HVX_Vector Q6_Vub_vadd_VubVub_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -413,9 +342,7 @@...@@ -413,9 +342,7 @@
413 ========================================================================== */342 ========================================================================== */
414343
415#define Q6_Vub_vadd_VubVub_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubsat)(Vu,Vv)344#define Q6_Vub_vadd_VubVub_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubsat)(Vu,Vv)
416#endif /* __HEXAGON_ARCH___ >= 60 */
417345
418#if __HVX_ARCH__ >= 60
419/* ==========================================================================346/* ==========================================================================
420 Assembly Syntax: Vdd32.ub=vadd(Vuu32.ub,Vvv32.ub):sat347 Assembly Syntax: Vdd32.ub=vadd(Vuu32.ub,Vvv32.ub):sat
421 C Intrinsic Prototype: HVX_VectorPair Q6_Wub_vadd_WubWub_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)348 C Intrinsic Prototype: HVX_VectorPair Q6_Wub_vadd_WubWub_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -424,9 +351,7 @@...@@ -424,9 +351,7 @@
424 ========================================================================== */351 ========================================================================== */
425352
426#define Q6_Wub_vadd_WubWub_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubsat_dv)(Vuu,Vvv)353#define Q6_Wub_vadd_WubWub_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubsat_dv)(Vuu,Vvv)
427#endif /* __HEXAGON_ARCH___ >= 60 */
428354
429#if __HVX_ARCH__ >= 60
430/* ==========================================================================355/* ==========================================================================
431 Assembly Syntax: Vd32.uh=vadd(Vu32.uh,Vv32.uh):sat356 Assembly Syntax: Vd32.uh=vadd(Vu32.uh,Vv32.uh):sat
432 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vadd_VuhVuh_sat(HVX_Vector Vu, HVX_Vector Vv)357 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vadd_VuhVuh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -435,9 +360,7 @@...@@ -435,9 +360,7 @@
435 ========================================================================== */360 ========================================================================== */
436361
437#define Q6_Vuh_vadd_VuhVuh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhsat)(Vu,Vv)362#define Q6_Vuh_vadd_VuhVuh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhsat)(Vu,Vv)
438#endif /* __HEXAGON_ARCH___ >= 60 */
439363
440#if __HVX_ARCH__ >= 60
441/* ==========================================================================364/* ==========================================================================
442 Assembly Syntax: Vdd32.uh=vadd(Vuu32.uh,Vvv32.uh):sat365 Assembly Syntax: Vdd32.uh=vadd(Vuu32.uh,Vvv32.uh):sat
443 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vadd_WuhWuh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)366 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vadd_WuhWuh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -446,9 +369,7 @@...@@ -446,9 +369,7 @@
446 ========================================================================== */369 ========================================================================== */
447370
448#define Q6_Wuh_vadd_WuhWuh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhsat_dv)(Vuu,Vvv)371#define Q6_Wuh_vadd_WuhWuh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhsat_dv)(Vuu,Vvv)
449#endif /* __HEXAGON_ARCH___ >= 60 */
450372
451#if __HVX_ARCH__ >= 60
452/* ==========================================================================373/* ==========================================================================
453 Assembly Syntax: Vdd32.w=vadd(Vu32.uh,Vv32.uh)374 Assembly Syntax: Vdd32.w=vadd(Vu32.uh,Vv32.uh)
454 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)375 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -457,9 +378,7 @@...@@ -457,9 +378,7 @@
457 ========================================================================== */378 ========================================================================== */
458379
459#define Q6_Ww_vadd_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhw)(Vu,Vv)380#define Q6_Ww_vadd_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhw)(Vu,Vv)
460#endif /* __HEXAGON_ARCH___ >= 60 */
461381
462#if __HVX_ARCH__ >= 60
463/* ==========================================================================382/* ==========================================================================
464 Assembly Syntax: Vd32.w=vadd(Vu32.w,Vv32.w)383 Assembly Syntax: Vd32.w=vadd(Vu32.w,Vv32.w)
465 C Intrinsic Prototype: HVX_Vector Q6_Vw_vadd_VwVw(HVX_Vector Vu, HVX_Vector Vv)384 C Intrinsic Prototype: HVX_Vector Q6_Vw_vadd_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -468,9 +387,7 @@...@@ -468,9 +387,7 @@
468 ========================================================================== */387 ========================================================================== */
469388
470#define Q6_Vw_vadd_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddw)(Vu,Vv)389#define Q6_Vw_vadd_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddw)(Vu,Vv)
471#endif /* __HEXAGON_ARCH___ >= 60 */
472390
473#if __HVX_ARCH__ >= 60
474/* ==========================================================================391/* ==========================================================================
475 Assembly Syntax: Vdd32.w=vadd(Vuu32.w,Vvv32.w)392 Assembly Syntax: Vdd32.w=vadd(Vuu32.w,Vvv32.w)
476 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_WwWw(HVX_VectorPair Vuu, HVX_VectorPair Vvv)393 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_WwWw(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -479,9 +396,7 @@...@@ -479,9 +396,7 @@
479 ========================================================================== */396 ========================================================================== */
480397
481#define Q6_Ww_vadd_WwWw(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddw_dv)(Vuu,Vvv)398#define Q6_Ww_vadd_WwWw(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddw_dv)(Vuu,Vvv)
482#endif /* __HEXAGON_ARCH___ >= 60 */
483399
484#if __HVX_ARCH__ >= 60
485/* ==========================================================================400/* ==========================================================================
486 Assembly Syntax: if (!Qv4) Vx32.w+=Vu32.w401 Assembly Syntax: if (!Qv4) Vx32.w+=Vu32.w
487 C Intrinsic Prototype: HVX_Vector Q6_Vw_condacc_QnVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)402 C Intrinsic Prototype: HVX_Vector Q6_Vw_condacc_QnVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -490,9 +405,7 @@...@@ -490,9 +405,7 @@
490 ========================================================================== */405 ========================================================================== */
491406
492#define Q6_Vw_condacc_QnVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)407#define Q6_Vw_condacc_QnVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
493#endif /* __HEXAGON_ARCH___ >= 60 */
494408
495#if __HVX_ARCH__ >= 60
496/* ==========================================================================409/* ==========================================================================
497 Assembly Syntax: if (Qv4) Vx32.w+=Vu32.w410 Assembly Syntax: if (Qv4) Vx32.w+=Vu32.w
498 C Intrinsic Prototype: HVX_Vector Q6_Vw_condacc_QVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)411 C Intrinsic Prototype: HVX_Vector Q6_Vw_condacc_QVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -501,9 +414,7 @@...@@ -501,9 +414,7 @@
501 ========================================================================== */414 ========================================================================== */
502415
503#define Q6_Vw_condacc_QVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)416#define Q6_Vw_condacc_QVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
504#endif /* __HEXAGON_ARCH___ >= 60 */
505417
506#if __HVX_ARCH__ >= 60
507/* ==========================================================================418/* ==========================================================================
508 Assembly Syntax: Vd32.w=vadd(Vu32.w,Vv32.w):sat419 Assembly Syntax: Vd32.w=vadd(Vu32.w,Vv32.w):sat
509 C Intrinsic Prototype: HVX_Vector Q6_Vw_vadd_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)420 C Intrinsic Prototype: HVX_Vector Q6_Vw_vadd_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -512,9 +423,7 @@...@@ -512,9 +423,7 @@
512 ========================================================================== */423 ========================================================================== */
513424
514#define Q6_Vw_vadd_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwsat)(Vu,Vv)425#define Q6_Vw_vadd_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwsat)(Vu,Vv)
515#endif /* __HEXAGON_ARCH___ >= 60 */
516426
517#if __HVX_ARCH__ >= 60
518/* ==========================================================================427/* ==========================================================================
519 Assembly Syntax: Vdd32.w=vadd(Vuu32.w,Vvv32.w):sat428 Assembly Syntax: Vdd32.w=vadd(Vuu32.w,Vvv32.w):sat
520 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_WwWw_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)429 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vadd_WwWw_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -523,9 +432,7 @@...@@ -523,9 +432,7 @@
523 ========================================================================== */432 ========================================================================== */
524433
525#define Q6_Ww_vadd_WwWw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwsat_dv)(Vuu,Vvv)434#define Q6_Ww_vadd_WwWw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddwsat_dv)(Vuu,Vvv)
526#endif /* __HEXAGON_ARCH___ >= 60 */
527435
528#if __HVX_ARCH__ >= 60
529/* ==========================================================================436/* ==========================================================================
530 Assembly Syntax: Vd32=valign(Vu32,Vv32,Rt8)437 Assembly Syntax: Vd32=valign(Vu32,Vv32,Rt8)
531 C Intrinsic Prototype: HVX_Vector Q6_V_valign_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)438 C Intrinsic Prototype: HVX_Vector Q6_V_valign_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -534,9 +441,7 @@...@@ -534,9 +441,7 @@
534 ========================================================================== */441 ========================================================================== */
535442
536#define Q6_V_valign_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_valignb)(Vu,Vv,Rt)443#define Q6_V_valign_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_valignb)(Vu,Vv,Rt)
537#endif /* __HEXAGON_ARCH___ >= 60 */
538444
539#if __HVX_ARCH__ >= 60
540/* ==========================================================================445/* ==========================================================================
541 Assembly Syntax: Vd32=valign(Vu32,Vv32,#u3)446 Assembly Syntax: Vd32=valign(Vu32,Vv32,#u3)
542 C Intrinsic Prototype: HVX_Vector Q6_V_valign_VVI(HVX_Vector Vu, HVX_Vector Vv, Word32 Iu3)447 C Intrinsic Prototype: HVX_Vector Q6_V_valign_VVI(HVX_Vector Vu, HVX_Vector Vv, Word32 Iu3)
...@@ -545,9 +450,7 @@...@@ -545,9 +450,7 @@
545 ========================================================================== */450 ========================================================================== */
546451
547#define Q6_V_valign_VVI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_valignbi)(Vu,Vv,Iu3)452#define Q6_V_valign_VVI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_valignbi)(Vu,Vv,Iu3)
548#endif /* __HEXAGON_ARCH___ >= 60 */
549453
550#if __HVX_ARCH__ >= 60
551/* ==========================================================================454/* ==========================================================================
552 Assembly Syntax: Vd32=vand(Vu32,Vv32)455 Assembly Syntax: Vd32=vand(Vu32,Vv32)
553 C Intrinsic Prototype: HVX_Vector Q6_V_vand_VV(HVX_Vector Vu, HVX_Vector Vv)456 C Intrinsic Prototype: HVX_Vector Q6_V_vand_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -556,9 +459,7 @@...@@ -556,9 +459,7 @@
556 ========================================================================== */459 ========================================================================== */
557460
558#define Q6_V_vand_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vand)(Vu,Vv)461#define Q6_V_vand_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vand)(Vu,Vv)
559#endif /* __HEXAGON_ARCH___ >= 60 */
560462
561#if __HVX_ARCH__ >= 60
562/* ==========================================================================463/* ==========================================================================
563 Assembly Syntax: Vd32=vand(Qu4,Rt32)464 Assembly Syntax: Vd32=vand(Qu4,Rt32)
564 C Intrinsic Prototype: HVX_Vector Q6_V_vand_QR(HVX_VectorPred Qu, Word32 Rt)465 C Intrinsic Prototype: HVX_Vector Q6_V_vand_QR(HVX_VectorPred Qu, Word32 Rt)
...@@ -567,9 +468,7 @@...@@ -567,9 +468,7 @@
567 ========================================================================== */468 ========================================================================== */
568469
569#define Q6_V_vand_QR(Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)470#define Q6_V_vand_QR(Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)
570#endif /* __HEXAGON_ARCH___ >= 60 */
571471
572#if __HVX_ARCH__ >= 60
573/* ==========================================================================472/* ==========================================================================
574 Assembly Syntax: Vx32|=vand(Qu4,Rt32)473 Assembly Syntax: Vx32|=vand(Qu4,Rt32)
575 C Intrinsic Prototype: HVX_Vector Q6_V_vandor_VQR(HVX_Vector Vx, HVX_VectorPred Qu, Word32 Rt)474 C Intrinsic Prototype: HVX_Vector Q6_V_vandor_VQR(HVX_Vector Vx, HVX_VectorPred Qu, Word32 Rt)
...@@ -578,9 +477,7 @@...@@ -578,9 +477,7 @@
578 ========================================================================== */477 ========================================================================== */
579478
580#define Q6_V_vandor_VQR(Vx,Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt_acc)(Vx,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)479#define Q6_V_vandor_VQR(Vx,Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt_acc)(Vx,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)
581#endif /* __HEXAGON_ARCH___ >= 60 */
582480
583#if __HVX_ARCH__ >= 60
584/* ==========================================================================481/* ==========================================================================
585 Assembly Syntax: Qd4=vand(Vu32,Rt32)482 Assembly Syntax: Qd4=vand(Vu32,Rt32)
586 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vand_VR(HVX_Vector Vu, Word32 Rt)483 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vand_VR(HVX_Vector Vu, Word32 Rt)
...@@ -589,9 +486,7 @@...@@ -589,9 +486,7 @@
589 ========================================================================== */486 ========================================================================== */
590487
591#define Q6_Q_vand_VR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)(Vu,Rt)),-1)488#define Q6_Q_vand_VR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)(Vu,Rt)),-1)
592#endif /* __HEXAGON_ARCH___ >= 60 */
593489
594#if __HVX_ARCH__ >= 60
595/* ==========================================================================490/* ==========================================================================
596 Assembly Syntax: Qx4|=vand(Vu32,Rt32)491 Assembly Syntax: Qx4|=vand(Vu32,Rt32)
597 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vandor_QVR(HVX_VectorPred Qx, HVX_Vector Vu, Word32 Rt)492 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vandor_QVR(HVX_VectorPred Qx, HVX_Vector Vu, Word32 Rt)
...@@ -600,9 +495,7 @@...@@ -600,9 +495,7 @@
600 ========================================================================== */495 ========================================================================== */
601496
602#define Q6_Q_vandor_QVR(Qx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt_acc)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Rt)),-1)497#define Q6_Q_vandor_QVR(Qx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt_acc)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Rt)),-1)
603#endif /* __HEXAGON_ARCH___ >= 60 */
604498
605#if __HVX_ARCH__ >= 60
606/* ==========================================================================499/* ==========================================================================
607 Assembly Syntax: Vd32.h=vasl(Vu32.h,Rt32)500 Assembly Syntax: Vd32.h=vasl(Vu32.h,Rt32)
608 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasl_VhR(HVX_Vector Vu, Word32 Rt)501 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasl_VhR(HVX_Vector Vu, Word32 Rt)
...@@ -611,9 +504,7 @@...@@ -611,9 +504,7 @@
611 ========================================================================== */504 ========================================================================== */
612505
613#define Q6_Vh_vasl_VhR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslh)(Vu,Rt)506#define Q6_Vh_vasl_VhR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslh)(Vu,Rt)
614#endif /* __HEXAGON_ARCH___ >= 60 */
615507
616#if __HVX_ARCH__ >= 60
617/* ==========================================================================508/* ==========================================================================
618 Assembly Syntax: Vd32.h=vasl(Vu32.h,Vv32.h)509 Assembly Syntax: Vd32.h=vasl(Vu32.h,Vv32.h)
619 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasl_VhVh(HVX_Vector Vu, HVX_Vector Vv)510 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasl_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -622,9 +513,7 @@...@@ -622,9 +513,7 @@
622 ========================================================================== */513 ========================================================================== */
623514
624#define Q6_Vh_vasl_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslhv)(Vu,Vv)515#define Q6_Vh_vasl_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslhv)(Vu,Vv)
625#endif /* __HEXAGON_ARCH___ >= 60 */
626516
627#if __HVX_ARCH__ >= 60
628/* ==========================================================================517/* ==========================================================================
629 Assembly Syntax: Vd32.w=vasl(Vu32.w,Rt32)518 Assembly Syntax: Vd32.w=vasl(Vu32.w,Rt32)
630 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasl_VwR(HVX_Vector Vu, Word32 Rt)519 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasl_VwR(HVX_Vector Vu, Word32 Rt)
...@@ -633,9 +522,7 @@...@@ -633,9 +522,7 @@
633 ========================================================================== */522 ========================================================================== */
634523
635#define Q6_Vw_vasl_VwR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslw)(Vu,Rt)524#define Q6_Vw_vasl_VwR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslw)(Vu,Rt)
636#endif /* __HEXAGON_ARCH___ >= 60 */
637525
638#if __HVX_ARCH__ >= 60
639/* ==========================================================================526/* ==========================================================================
640 Assembly Syntax: Vx32.w+=vasl(Vu32.w,Rt32)527 Assembly Syntax: Vx32.w+=vasl(Vu32.w,Rt32)
641 C Intrinsic Prototype: HVX_Vector Q6_Vw_vaslacc_VwVwR(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)528 C Intrinsic Prototype: HVX_Vector Q6_Vw_vaslacc_VwVwR(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -644,9 +531,7 @@...@@ -644,9 +531,7 @@
644 ========================================================================== */531 ========================================================================== */
645532
646#define Q6_Vw_vaslacc_VwVwR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslw_acc)(Vx,Vu,Rt)533#define Q6_Vw_vaslacc_VwVwR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslw_acc)(Vx,Vu,Rt)
647#endif /* __HEXAGON_ARCH___ >= 60 */
648534
649#if __HVX_ARCH__ >= 60
650/* ==========================================================================535/* ==========================================================================
651 Assembly Syntax: Vd32.w=vasl(Vu32.w,Vv32.w)536 Assembly Syntax: Vd32.w=vasl(Vu32.w,Vv32.w)
652 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasl_VwVw(HVX_Vector Vu, HVX_Vector Vv)537 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasl_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -655,9 +540,7 @@...@@ -655,9 +540,7 @@
655 ========================================================================== */540 ========================================================================== */
656541
657#define Q6_Vw_vasl_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslwv)(Vu,Vv)542#define Q6_Vw_vasl_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslwv)(Vu,Vv)
658#endif /* __HEXAGON_ARCH___ >= 60 */
659543
660#if __HVX_ARCH__ >= 60
661/* ==========================================================================544/* ==========================================================================
662 Assembly Syntax: Vd32.h=vasr(Vu32.h,Rt32)545 Assembly Syntax: Vd32.h=vasr(Vu32.h,Rt32)
663 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VhR(HVX_Vector Vu, Word32 Rt)546 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VhR(HVX_Vector Vu, Word32 Rt)
...@@ -666,9 +549,7 @@...@@ -666,9 +549,7 @@
666 ========================================================================== */549 ========================================================================== */
667550
668#define Q6_Vh_vasr_VhR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrh)(Vu,Rt)551#define Q6_Vh_vasr_VhR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrh)(Vu,Rt)
669#endif /* __HEXAGON_ARCH___ >= 60 */
670552
671#if __HVX_ARCH__ >= 60
672/* ==========================================================================553/* ==========================================================================
673 Assembly Syntax: Vd32.b=vasr(Vu32.h,Vv32.h,Rt8):rnd:sat554 Assembly Syntax: Vd32.b=vasr(Vu32.h,Vv32.h,Rt8):rnd:sat
674 C Intrinsic Prototype: HVX_Vector Q6_Vb_vasr_VhVhR_rnd_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)555 C Intrinsic Prototype: HVX_Vector Q6_Vb_vasr_VhVhR_rnd_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -677,9 +558,7 @@...@@ -677,9 +558,7 @@
677 ========================================================================== */558 ========================================================================== */
678559
679#define Q6_Vb_vasr_VhVhR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhbrndsat)(Vu,Vv,Rt)560#define Q6_Vb_vasr_VhVhR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhbrndsat)(Vu,Vv,Rt)
680#endif /* __HEXAGON_ARCH___ >= 60 */
681561
682#if __HVX_ARCH__ >= 60
683/* ==========================================================================562/* ==========================================================================
684 Assembly Syntax: Vd32.ub=vasr(Vu32.h,Vv32.h,Rt8):rnd:sat563 Assembly Syntax: Vd32.ub=vasr(Vu32.h,Vv32.h,Rt8):rnd:sat
685 C Intrinsic Prototype: HVX_Vector Q6_Vub_vasr_VhVhR_rnd_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)564 C Intrinsic Prototype: HVX_Vector Q6_Vub_vasr_VhVhR_rnd_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -688,9 +567,7 @@...@@ -688,9 +567,7 @@
688 ========================================================================== */567 ========================================================================== */
689568
690#define Q6_Vub_vasr_VhVhR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhubrndsat)(Vu,Vv,Rt)569#define Q6_Vub_vasr_VhVhR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhubrndsat)(Vu,Vv,Rt)
691#endif /* __HEXAGON_ARCH___ >= 60 */
692570
693#if __HVX_ARCH__ >= 60
694/* ==========================================================================571/* ==========================================================================
695 Assembly Syntax: Vd32.ub=vasr(Vu32.h,Vv32.h,Rt8):sat572 Assembly Syntax: Vd32.ub=vasr(Vu32.h,Vv32.h,Rt8):sat
696 C Intrinsic Prototype: HVX_Vector Q6_Vub_vasr_VhVhR_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)573 C Intrinsic Prototype: HVX_Vector Q6_Vub_vasr_VhVhR_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -699,9 +576,7 @@...@@ -699,9 +576,7 @@
699 ========================================================================== */576 ========================================================================== */
700577
701#define Q6_Vub_vasr_VhVhR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhubsat)(Vu,Vv,Rt)578#define Q6_Vub_vasr_VhVhR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhubsat)(Vu,Vv,Rt)
702#endif /* __HEXAGON_ARCH___ >= 60 */
703579
704#if __HVX_ARCH__ >= 60
705/* ==========================================================================580/* ==========================================================================
706 Assembly Syntax: Vd32.h=vasr(Vu32.h,Vv32.h)581 Assembly Syntax: Vd32.h=vasr(Vu32.h,Vv32.h)
707 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VhVh(HVX_Vector Vu, HVX_Vector Vv)582 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -710,9 +585,7 @@...@@ -710,9 +585,7 @@
710 ========================================================================== */585 ========================================================================== */
711586
712#define Q6_Vh_vasr_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhv)(Vu,Vv)587#define Q6_Vh_vasr_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhv)(Vu,Vv)
713#endif /* __HEXAGON_ARCH___ >= 60 */
714588
715#if __HVX_ARCH__ >= 60
716/* ==========================================================================589/* ==========================================================================
717 Assembly Syntax: Vd32.w=vasr(Vu32.w,Rt32)590 Assembly Syntax: Vd32.w=vasr(Vu32.w,Rt32)
718 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasr_VwR(HVX_Vector Vu, Word32 Rt)591 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasr_VwR(HVX_Vector Vu, Word32 Rt)
...@@ -721,9 +594,7 @@...@@ -721,9 +594,7 @@
721 ========================================================================== */594 ========================================================================== */
722595
723#define Q6_Vw_vasr_VwR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrw)(Vu,Rt)596#define Q6_Vw_vasr_VwR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrw)(Vu,Rt)
724#endif /* __HEXAGON_ARCH___ >= 60 */
725597
726#if __HVX_ARCH__ >= 60
727/* ==========================================================================598/* ==========================================================================
728 Assembly Syntax: Vx32.w+=vasr(Vu32.w,Rt32)599 Assembly Syntax: Vx32.w+=vasr(Vu32.w,Rt32)
729 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasracc_VwVwR(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)600 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasracc_VwVwR(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -732,9 +603,7 @@...@@ -732,9 +603,7 @@
732 ========================================================================== */603 ========================================================================== */
733604
734#define Q6_Vw_vasracc_VwVwR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrw_acc)(Vx,Vu,Rt)605#define Q6_Vw_vasracc_VwVwR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrw_acc)(Vx,Vu,Rt)
735#endif /* __HEXAGON_ARCH___ >= 60 */
736606
737#if __HVX_ARCH__ >= 60
738/* ==========================================================================607/* ==========================================================================
739 Assembly Syntax: Vd32.h=vasr(Vu32.w,Vv32.w,Rt8)608 Assembly Syntax: Vd32.h=vasr(Vu32.w,Vv32.w,Rt8)
740 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VwVwR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)609 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VwVwR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -743,9 +612,7 @@...@@ -743,9 +612,7 @@
743 ========================================================================== */612 ========================================================================== */
744613
745#define Q6_Vh_vasr_VwVwR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwh)(Vu,Vv,Rt)614#define Q6_Vh_vasr_VwVwR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwh)(Vu,Vv,Rt)
746#endif /* __HEXAGON_ARCH___ >= 60 */
747615
748#if __HVX_ARCH__ >= 60
749/* ==========================================================================616/* ==========================================================================
750 Assembly Syntax: Vd32.h=vasr(Vu32.w,Vv32.w,Rt8):rnd:sat617 Assembly Syntax: Vd32.h=vasr(Vu32.w,Vv32.w,Rt8):rnd:sat
751 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VwVwR_rnd_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)618 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VwVwR_rnd_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -754,9 +621,7 @@...@@ -754,9 +621,7 @@
754 ========================================================================== */621 ========================================================================== */
755622
756#define Q6_Vh_vasr_VwVwR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwhrndsat)(Vu,Vv,Rt)623#define Q6_Vh_vasr_VwVwR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwhrndsat)(Vu,Vv,Rt)
757#endif /* __HEXAGON_ARCH___ >= 60 */
758624
759#if __HVX_ARCH__ >= 60
760/* ==========================================================================625/* ==========================================================================
761 Assembly Syntax: Vd32.h=vasr(Vu32.w,Vv32.w,Rt8):sat626 Assembly Syntax: Vd32.h=vasr(Vu32.w,Vv32.w,Rt8):sat
762 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VwVwR_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)627 C Intrinsic Prototype: HVX_Vector Q6_Vh_vasr_VwVwR_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -765,9 +630,7 @@...@@ -765,9 +630,7 @@
765 ========================================================================== */630 ========================================================================== */
766631
767#define Q6_Vh_vasr_VwVwR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwhsat)(Vu,Vv,Rt)632#define Q6_Vh_vasr_VwVwR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwhsat)(Vu,Vv,Rt)
768#endif /* __HEXAGON_ARCH___ >= 60 */
769633
770#if __HVX_ARCH__ >= 60
771/* ==========================================================================634/* ==========================================================================
772 Assembly Syntax: Vd32.uh=vasr(Vu32.w,Vv32.w,Rt8):sat635 Assembly Syntax: Vd32.uh=vasr(Vu32.w,Vv32.w,Rt8):sat
773 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vasr_VwVwR_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)636 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vasr_VwVwR_sat(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -776,9 +639,7 @@...@@ -776,9 +639,7 @@
776 ========================================================================== */639 ========================================================================== */
777640
778#define Q6_Vuh_vasr_VwVwR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwuhsat)(Vu,Vv,Rt)641#define Q6_Vuh_vasr_VwVwR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwuhsat)(Vu,Vv,Rt)
779#endif /* __HEXAGON_ARCH___ >= 60 */
780642
781#if __HVX_ARCH__ >= 60
782/* ==========================================================================643/* ==========================================================================
783 Assembly Syntax: Vd32.w=vasr(Vu32.w,Vv32.w)644 Assembly Syntax: Vd32.w=vasr(Vu32.w,Vv32.w)
784 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasr_VwVw(HVX_Vector Vu, HVX_Vector Vv)645 C Intrinsic Prototype: HVX_Vector Q6_Vw_vasr_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -787,9 +648,7 @@...@@ -787,9 +648,7 @@
787 ========================================================================== */648 ========================================================================== */
788649
789#define Q6_Vw_vasr_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwv)(Vu,Vv)650#define Q6_Vw_vasr_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwv)(Vu,Vv)
790#endif /* __HEXAGON_ARCH___ >= 60 */
791651
792#if __HVX_ARCH__ >= 60
793/* ==========================================================================652/* ==========================================================================
794 Assembly Syntax: Vd32=Vu32653 Assembly Syntax: Vd32=Vu32
795 C Intrinsic Prototype: HVX_Vector Q6_V_equals_V(HVX_Vector Vu)654 C Intrinsic Prototype: HVX_Vector Q6_V_equals_V(HVX_Vector Vu)
...@@ -798,9 +657,7 @@...@@ -798,9 +657,7 @@
798 ========================================================================== */657 ========================================================================== */
799658
800#define Q6_V_equals_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vassign)(Vu)659#define Q6_V_equals_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vassign)(Vu)
801#endif /* __HEXAGON_ARCH___ >= 60 */
802660
803#if __HVX_ARCH__ >= 60
804/* ==========================================================================661/* ==========================================================================
805 Assembly Syntax: Vdd32=Vuu32662 Assembly Syntax: Vdd32=Vuu32
806 C Intrinsic Prototype: HVX_VectorPair Q6_W_equals_W(HVX_VectorPair Vuu)663 C Intrinsic Prototype: HVX_VectorPair Q6_W_equals_W(HVX_VectorPair Vuu)
...@@ -809,9 +666,7 @@...@@ -809,9 +666,7 @@
809 ========================================================================== */666 ========================================================================== */
810667
811#define Q6_W_equals_W(Vuu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vassignp)(Vuu)668#define Q6_W_equals_W(Vuu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vassignp)(Vuu)
812#endif /* __HEXAGON_ARCH___ >= 60 */
813669
814#if __HVX_ARCH__ >= 60
815/* ==========================================================================670/* ==========================================================================
816 Assembly Syntax: Vd32.h=vavg(Vu32.h,Vv32.h)671 Assembly Syntax: Vd32.h=vavg(Vu32.h,Vv32.h)
817 C Intrinsic Prototype: HVX_Vector Q6_Vh_vavg_VhVh(HVX_Vector Vu, HVX_Vector Vv)672 C Intrinsic Prototype: HVX_Vector Q6_Vh_vavg_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -820,9 +675,7 @@...@@ -820,9 +675,7 @@
820 ========================================================================== */675 ========================================================================== */
821676
822#define Q6_Vh_vavg_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgh)(Vu,Vv)677#define Q6_Vh_vavg_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgh)(Vu,Vv)
823#endif /* __HEXAGON_ARCH___ >= 60 */
824678
825#if __HVX_ARCH__ >= 60
826/* ==========================================================================679/* ==========================================================================
827 Assembly Syntax: Vd32.h=vavg(Vu32.h,Vv32.h):rnd680 Assembly Syntax: Vd32.h=vavg(Vu32.h,Vv32.h):rnd
828 C Intrinsic Prototype: HVX_Vector Q6_Vh_vavg_VhVh_rnd(HVX_Vector Vu, HVX_Vector Vv)681 C Intrinsic Prototype: HVX_Vector Q6_Vh_vavg_VhVh_rnd(HVX_Vector Vu, HVX_Vector Vv)
...@@ -831,9 +684,7 @@...@@ -831,9 +684,7 @@
831 ========================================================================== */684 ========================================================================== */
832685
833#define Q6_Vh_vavg_VhVh_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavghrnd)(Vu,Vv)686#define Q6_Vh_vavg_VhVh_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavghrnd)(Vu,Vv)
834#endif /* __HEXAGON_ARCH___ >= 60 */
835687
836#if __HVX_ARCH__ >= 60
837/* ==========================================================================688/* ==========================================================================
838 Assembly Syntax: Vd32.ub=vavg(Vu32.ub,Vv32.ub)689 Assembly Syntax: Vd32.ub=vavg(Vu32.ub,Vv32.ub)
839 C Intrinsic Prototype: HVX_Vector Q6_Vub_vavg_VubVub(HVX_Vector Vu, HVX_Vector Vv)690 C Intrinsic Prototype: HVX_Vector Q6_Vub_vavg_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -842,9 +693,7 @@...@@ -842,9 +693,7 @@
842 ========================================================================== */693 ========================================================================== */
843694
844#define Q6_Vub_vavg_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgub)(Vu,Vv)695#define Q6_Vub_vavg_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgub)(Vu,Vv)
845#endif /* __HEXAGON_ARCH___ >= 60 */
846696
847#if __HVX_ARCH__ >= 60
848/* ==========================================================================697/* ==========================================================================
849 Assembly Syntax: Vd32.ub=vavg(Vu32.ub,Vv32.ub):rnd698 Assembly Syntax: Vd32.ub=vavg(Vu32.ub,Vv32.ub):rnd
850 C Intrinsic Prototype: HVX_Vector Q6_Vub_vavg_VubVub_rnd(HVX_Vector Vu, HVX_Vector Vv)699 C Intrinsic Prototype: HVX_Vector Q6_Vub_vavg_VubVub_rnd(HVX_Vector Vu, HVX_Vector Vv)
...@@ -853,9 +702,7 @@...@@ -853,9 +702,7 @@
853 ========================================================================== */702 ========================================================================== */
854703
855#define Q6_Vub_vavg_VubVub_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgubrnd)(Vu,Vv)704#define Q6_Vub_vavg_VubVub_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgubrnd)(Vu,Vv)
856#endif /* __HEXAGON_ARCH___ >= 60 */
857705
858#if __HVX_ARCH__ >= 60
859/* ==========================================================================706/* ==========================================================================
860 Assembly Syntax: Vd32.uh=vavg(Vu32.uh,Vv32.uh)707 Assembly Syntax: Vd32.uh=vavg(Vu32.uh,Vv32.uh)
861 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vavg_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)708 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vavg_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -864,9 +711,7 @@...@@ -864,9 +711,7 @@
864 ========================================================================== */711 ========================================================================== */
865712
866#define Q6_Vuh_vavg_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguh)(Vu,Vv)713#define Q6_Vuh_vavg_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguh)(Vu,Vv)
867#endif /* __HEXAGON_ARCH___ >= 60 */
868714
869#if __HVX_ARCH__ >= 60
870/* ==========================================================================715/* ==========================================================================
871 Assembly Syntax: Vd32.uh=vavg(Vu32.uh,Vv32.uh):rnd716 Assembly Syntax: Vd32.uh=vavg(Vu32.uh,Vv32.uh):rnd
872 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vavg_VuhVuh_rnd(HVX_Vector Vu, HVX_Vector Vv)717 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vavg_VuhVuh_rnd(HVX_Vector Vu, HVX_Vector Vv)
...@@ -875,9 +720,7 @@...@@ -875,9 +720,7 @@
875 ========================================================================== */720 ========================================================================== */
876721
877#define Q6_Vuh_vavg_VuhVuh_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguhrnd)(Vu,Vv)722#define Q6_Vuh_vavg_VuhVuh_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguhrnd)(Vu,Vv)
878#endif /* __HEXAGON_ARCH___ >= 60 */
879723
880#if __HVX_ARCH__ >= 60
881/* ==========================================================================724/* ==========================================================================
882 Assembly Syntax: Vd32.w=vavg(Vu32.w,Vv32.w)725 Assembly Syntax: Vd32.w=vavg(Vu32.w,Vv32.w)
883 C Intrinsic Prototype: HVX_Vector Q6_Vw_vavg_VwVw(HVX_Vector Vu, HVX_Vector Vv)726 C Intrinsic Prototype: HVX_Vector Q6_Vw_vavg_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -886,9 +729,7 @@...@@ -886,9 +729,7 @@
886 ========================================================================== */729 ========================================================================== */
887730
888#define Q6_Vw_vavg_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgw)(Vu,Vv)731#define Q6_Vw_vavg_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgw)(Vu,Vv)
889#endif /* __HEXAGON_ARCH___ >= 60 */
890732
891#if __HVX_ARCH__ >= 60
892/* ==========================================================================733/* ==========================================================================
893 Assembly Syntax: Vd32.w=vavg(Vu32.w,Vv32.w):rnd734 Assembly Syntax: Vd32.w=vavg(Vu32.w,Vv32.w):rnd
894 C Intrinsic Prototype: HVX_Vector Q6_Vw_vavg_VwVw_rnd(HVX_Vector Vu, HVX_Vector Vv)735 C Intrinsic Prototype: HVX_Vector Q6_Vw_vavg_VwVw_rnd(HVX_Vector Vu, HVX_Vector Vv)
...@@ -897,9 +738,7 @@...@@ -897,9 +738,7 @@
897 ========================================================================== */738 ========================================================================== */
898739
899#define Q6_Vw_vavg_VwVw_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgwrnd)(Vu,Vv)740#define Q6_Vw_vavg_VwVw_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgwrnd)(Vu,Vv)
900#endif /* __HEXAGON_ARCH___ >= 60 */
901741
902#if __HVX_ARCH__ >= 60
903/* ==========================================================================742/* ==========================================================================
904 Assembly Syntax: Vd32.uh=vcl0(Vu32.uh)743 Assembly Syntax: Vd32.uh=vcl0(Vu32.uh)
905 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vcl0_Vuh(HVX_Vector Vu)744 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vcl0_Vuh(HVX_Vector Vu)
...@@ -908,9 +747,7 @@...@@ -908,9 +747,7 @@
908 ========================================================================== */747 ========================================================================== */
909748
910#define Q6_Vuh_vcl0_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcl0h)(Vu)749#define Q6_Vuh_vcl0_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcl0h)(Vu)
911#endif /* __HEXAGON_ARCH___ >= 60 */
912750
913#if __HVX_ARCH__ >= 60
914/* ==========================================================================751/* ==========================================================================
915 Assembly Syntax: Vd32.uw=vcl0(Vu32.uw)752 Assembly Syntax: Vd32.uw=vcl0(Vu32.uw)
916 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vcl0_Vuw(HVX_Vector Vu)753 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vcl0_Vuw(HVX_Vector Vu)
...@@ -919,9 +756,7 @@...@@ -919,9 +756,7 @@
919 ========================================================================== */756 ========================================================================== */
920757
921#define Q6_Vuw_vcl0_Vuw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcl0w)(Vu)758#define Q6_Vuw_vcl0_Vuw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcl0w)(Vu)
922#endif /* __HEXAGON_ARCH___ >= 60 */
923759
924#if __HVX_ARCH__ >= 60
925/* ==========================================================================760/* ==========================================================================
926 Assembly Syntax: Vdd32=vcombine(Vu32,Vv32)761 Assembly Syntax: Vdd32=vcombine(Vu32,Vv32)
927 C Intrinsic Prototype: HVX_VectorPair Q6_W_vcombine_VV(HVX_Vector Vu, HVX_Vector Vv)762 C Intrinsic Prototype: HVX_VectorPair Q6_W_vcombine_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -930,9 +765,7 @@...@@ -930,9 +765,7 @@
930 ========================================================================== */765 ========================================================================== */
931766
932#define Q6_W_vcombine_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcombine)(Vu,Vv)767#define Q6_W_vcombine_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcombine)(Vu,Vv)
933#endif /* __HEXAGON_ARCH___ >= 60 */
934768
935#if __HVX_ARCH__ >= 60
936/* ==========================================================================769/* ==========================================================================
937 Assembly Syntax: Vd32=#0770 Assembly Syntax: Vd32=#0
938 C Intrinsic Prototype: HVX_Vector Q6_V_vzero()771 C Intrinsic Prototype: HVX_Vector Q6_V_vzero()
...@@ -941,9 +774,7 @@...@@ -941,9 +774,7 @@
941 ========================================================================== */774 ========================================================================== */
942775
943#define Q6_V_vzero() __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vd0)()776#define Q6_V_vzero() __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vd0)()
944#endif /* __HEXAGON_ARCH___ >= 60 */
945777
946#if __HVX_ARCH__ >= 60
947/* ==========================================================================778/* ==========================================================================
948 Assembly Syntax: Vd32.b=vdeal(Vu32.b)779 Assembly Syntax: Vd32.b=vdeal(Vu32.b)
949 C Intrinsic Prototype: HVX_Vector Q6_Vb_vdeal_Vb(HVX_Vector Vu)780 C Intrinsic Prototype: HVX_Vector Q6_Vb_vdeal_Vb(HVX_Vector Vu)
...@@ -952,9 +783,7 @@...@@ -952,9 +783,7 @@
952 ========================================================================== */783 ========================================================================== */
953784
954#define Q6_Vb_vdeal_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealb)(Vu)785#define Q6_Vb_vdeal_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealb)(Vu)
955#endif /* __HEXAGON_ARCH___ >= 60 */
956786
957#if __HVX_ARCH__ >= 60
958/* ==========================================================================787/* ==========================================================================
959 Assembly Syntax: Vd32.b=vdeale(Vu32.b,Vv32.b)788 Assembly Syntax: Vd32.b=vdeale(Vu32.b,Vv32.b)
960 C Intrinsic Prototype: HVX_Vector Q6_Vb_vdeale_VbVb(HVX_Vector Vu, HVX_Vector Vv)789 C Intrinsic Prototype: HVX_Vector Q6_Vb_vdeale_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -963,9 +792,7 @@...@@ -963,9 +792,7 @@
963 ========================================================================== */792 ========================================================================== */
964793
965#define Q6_Vb_vdeale_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealb4w)(Vu,Vv)794#define Q6_Vb_vdeale_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealb4w)(Vu,Vv)
966#endif /* __HEXAGON_ARCH___ >= 60 */
967795
968#if __HVX_ARCH__ >= 60
969/* ==========================================================================796/* ==========================================================================
970 Assembly Syntax: Vd32.h=vdeal(Vu32.h)797 Assembly Syntax: Vd32.h=vdeal(Vu32.h)
971 C Intrinsic Prototype: HVX_Vector Q6_Vh_vdeal_Vh(HVX_Vector Vu)798 C Intrinsic Prototype: HVX_Vector Q6_Vh_vdeal_Vh(HVX_Vector Vu)
...@@ -974,9 +801,7 @@...@@ -974,9 +801,7 @@
974 ========================================================================== */801 ========================================================================== */
975802
976#define Q6_Vh_vdeal_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealh)(Vu)803#define Q6_Vh_vdeal_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealh)(Vu)
977#endif /* __HEXAGON_ARCH___ >= 60 */
978804
979#if __HVX_ARCH__ >= 60
980/* ==========================================================================805/* ==========================================================================
981 Assembly Syntax: Vdd32=vdeal(Vu32,Vv32,Rt8)806 Assembly Syntax: Vdd32=vdeal(Vu32,Vv32,Rt8)
982 C Intrinsic Prototype: HVX_VectorPair Q6_W_vdeal_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)807 C Intrinsic Prototype: HVX_VectorPair Q6_W_vdeal_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -985,9 +810,7 @@...@@ -985,9 +810,7 @@
985 ========================================================================== */810 ========================================================================== */
986811
987#define Q6_W_vdeal_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealvdd)(Vu,Vv,Rt)812#define Q6_W_vdeal_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdealvdd)(Vu,Vv,Rt)
988#endif /* __HEXAGON_ARCH___ >= 60 */
989813
990#if __HVX_ARCH__ >= 60
991/* ==========================================================================814/* ==========================================================================
992 Assembly Syntax: Vd32=vdelta(Vu32,Vv32)815 Assembly Syntax: Vd32=vdelta(Vu32,Vv32)
993 C Intrinsic Prototype: HVX_Vector Q6_V_vdelta_VV(HVX_Vector Vu, HVX_Vector Vv)816 C Intrinsic Prototype: HVX_Vector Q6_V_vdelta_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -996,9 +819,7 @@...@@ -996,9 +819,7 @@
996 ========================================================================== */819 ========================================================================== */
997820
998#define Q6_V_vdelta_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdelta)(Vu,Vv)821#define Q6_V_vdelta_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdelta)(Vu,Vv)
999#endif /* __HEXAGON_ARCH___ >= 60 */
1000822
1001#if __HVX_ARCH__ >= 60
1002/* ==========================================================================823/* ==========================================================================
1003 Assembly Syntax: Vd32.h=vdmpy(Vu32.ub,Rt32.b)824 Assembly Syntax: Vd32.h=vdmpy(Vu32.ub,Rt32.b)
1004 C Intrinsic Prototype: HVX_Vector Q6_Vh_vdmpy_VubRb(HVX_Vector Vu, Word32 Rt)825 C Intrinsic Prototype: HVX_Vector Q6_Vh_vdmpy_VubRb(HVX_Vector Vu, Word32 Rt)
...@@ -1007,9 +828,7 @@...@@ -1007,9 +828,7 @@
1007 ========================================================================== */828 ========================================================================== */
1008829
1009#define Q6_Vh_vdmpy_VubRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus)(Vu,Rt)830#define Q6_Vh_vdmpy_VubRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus)(Vu,Rt)
1010#endif /* __HEXAGON_ARCH___ >= 60 */
1011831
1012#if __HVX_ARCH__ >= 60
1013/* ==========================================================================832/* ==========================================================================
1014 Assembly Syntax: Vx32.h+=vdmpy(Vu32.ub,Rt32.b)833 Assembly Syntax: Vx32.h+=vdmpy(Vu32.ub,Rt32.b)
1015 C Intrinsic Prototype: HVX_Vector Q6_Vh_vdmpyacc_VhVubRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)834 C Intrinsic Prototype: HVX_Vector Q6_Vh_vdmpyacc_VhVubRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -1018,9 +837,7 @@...@@ -1018,9 +837,7 @@
1018 ========================================================================== */837 ========================================================================== */
1019838
1020#define Q6_Vh_vdmpyacc_VhVubRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus_acc)(Vx,Vu,Rt)839#define Q6_Vh_vdmpyacc_VhVubRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus_acc)(Vx,Vu,Rt)
1021#endif /* __HEXAGON_ARCH___ >= 60 */
1022840
1023#if __HVX_ARCH__ >= 60
1024/* ==========================================================================841/* ==========================================================================
1025 Assembly Syntax: Vdd32.h=vdmpy(Vuu32.ub,Rt32.b)842 Assembly Syntax: Vdd32.h=vdmpy(Vuu32.ub,Rt32.b)
1026 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vdmpy_WubRb(HVX_VectorPair Vuu, Word32 Rt)843 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vdmpy_WubRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1029,9 +846,7 @@...@@ -1029,9 +846,7 @@
1029 ========================================================================== */846 ========================================================================== */
1030847
1031#define Q6_Wh_vdmpy_WubRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus_dv)(Vuu,Rt)848#define Q6_Wh_vdmpy_WubRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus_dv)(Vuu,Rt)
1032#endif /* __HEXAGON_ARCH___ >= 60 */
1033849
1034#if __HVX_ARCH__ >= 60
1035/* ==========================================================================850/* ==========================================================================
1036 Assembly Syntax: Vxx32.h+=vdmpy(Vuu32.ub,Rt32.b)851 Assembly Syntax: Vxx32.h+=vdmpy(Vuu32.ub,Rt32.b)
1037 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vdmpyacc_WhWubRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)852 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vdmpyacc_WhWubRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1040,9 +855,7 @@...@@ -1040,9 +855,7 @@
1040 ========================================================================== */855 ========================================================================== */
1041856
1042#define Q6_Wh_vdmpyacc_WhWubRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus_dv_acc)(Vxx,Vuu,Rt)857#define Q6_Wh_vdmpyacc_WhWubRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpybus_dv_acc)(Vxx,Vuu,Rt)
1043#endif /* __HEXAGON_ARCH___ >= 60 */
1044858
1045#if __HVX_ARCH__ >= 60
1046/* ==========================================================================859/* ==========================================================================
1047 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Rt32.b)860 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Rt32.b)
1048 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhRb(HVX_Vector Vu, Word32 Rt)861 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhRb(HVX_Vector Vu, Word32 Rt)
...@@ -1051,9 +864,7 @@...@@ -1051,9 +864,7 @@
1051 ========================================================================== */864 ========================================================================== */
1052865
1053#define Q6_Vw_vdmpy_VhRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb)(Vu,Rt)866#define Q6_Vw_vdmpy_VhRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb)(Vu,Rt)
1054#endif /* __HEXAGON_ARCH___ >= 60 */
1055867
1056#if __HVX_ARCH__ >= 60
1057/* ==========================================================================868/* ==========================================================================
1058 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Rt32.b)869 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Rt32.b)
1059 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)870 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -1062,9 +873,7 @@...@@ -1062,9 +873,7 @@
1062 ========================================================================== */873 ========================================================================== */
1063874
1064#define Q6_Vw_vdmpyacc_VwVhRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb_acc)(Vx,Vu,Rt)875#define Q6_Vw_vdmpyacc_VwVhRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb_acc)(Vx,Vu,Rt)
1065#endif /* __HEXAGON_ARCH___ >= 60 */
1066876
1067#if __HVX_ARCH__ >= 60
1068/* ==========================================================================877/* ==========================================================================
1069 Assembly Syntax: Vdd32.w=vdmpy(Vuu32.h,Rt32.b)878 Assembly Syntax: Vdd32.w=vdmpy(Vuu32.h,Rt32.b)
1070 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vdmpy_WhRb(HVX_VectorPair Vuu, Word32 Rt)879 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vdmpy_WhRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1073,9 +882,7 @@...@@ -1073,9 +882,7 @@
1073 ========================================================================== */882 ========================================================================== */
1074883
1075#define Q6_Ww_vdmpy_WhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb_dv)(Vuu,Rt)884#define Q6_Ww_vdmpy_WhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb_dv)(Vuu,Rt)
1076#endif /* __HEXAGON_ARCH___ >= 60 */
1077885
1078#if __HVX_ARCH__ >= 60
1079/* ==========================================================================886/* ==========================================================================
1080 Assembly Syntax: Vxx32.w+=vdmpy(Vuu32.h,Rt32.b)887 Assembly Syntax: Vxx32.w+=vdmpy(Vuu32.h,Rt32.b)
1081 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vdmpyacc_WwWhRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)888 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vdmpyacc_WwWhRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1084,9 +891,7 @@...@@ -1084,9 +891,7 @@
1084 ========================================================================== */891 ========================================================================== */
1085892
1086#define Q6_Ww_vdmpyacc_WwWhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb_dv_acc)(Vxx,Vuu,Rt)893#define Q6_Ww_vdmpyacc_WwWhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhb_dv_acc)(Vxx,Vuu,Rt)
1087#endif /* __HEXAGON_ARCH___ >= 60 */
1088894
1089#if __HVX_ARCH__ >= 60
1090/* ==========================================================================895/* ==========================================================================
1091 Assembly Syntax: Vd32.w=vdmpy(Vuu32.h,Rt32.h):sat896 Assembly Syntax: Vd32.w=vdmpy(Vuu32.h,Rt32.h):sat
1092 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_WhRh_sat(HVX_VectorPair Vuu, Word32 Rt)897 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_WhRh_sat(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1095,9 +900,7 @@...@@ -1095,9 +900,7 @@
1095 ========================================================================== */900 ========================================================================== */
1096901
1097#define Q6_Vw_vdmpy_WhRh_sat(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhisat)(Vuu,Rt)902#define Q6_Vw_vdmpy_WhRh_sat(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhisat)(Vuu,Rt)
1098#endif /* __HEXAGON_ARCH___ >= 60 */
1099903
1100#if __HVX_ARCH__ >= 60
1101/* ==========================================================================904/* ==========================================================================
1102 Assembly Syntax: Vx32.w+=vdmpy(Vuu32.h,Rt32.h):sat905 Assembly Syntax: Vx32.w+=vdmpy(Vuu32.h,Rt32.h):sat
1103 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwWhRh_sat(HVX_Vector Vx, HVX_VectorPair Vuu, Word32 Rt)906 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwWhRh_sat(HVX_Vector Vx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1106,9 +909,7 @@...@@ -1106,9 +909,7 @@
1106 ========================================================================== */909 ========================================================================== */
1107910
1108#define Q6_Vw_vdmpyacc_VwWhRh_sat(Vx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhisat_acc)(Vx,Vuu,Rt)911#define Q6_Vw_vdmpyacc_VwWhRh_sat(Vx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhisat_acc)(Vx,Vuu,Rt)
1109#endif /* __HEXAGON_ARCH___ >= 60 */
1110912
1111#if __HVX_ARCH__ >= 60
1112/* ==========================================================================913/* ==========================================================================
1113 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Rt32.h):sat914 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Rt32.h):sat
1114 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhRh_sat(HVX_Vector Vu, Word32 Rt)915 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhRh_sat(HVX_Vector Vu, Word32 Rt)
...@@ -1117,9 +918,7 @@...@@ -1117,9 +918,7 @@
1117 ========================================================================== */918 ========================================================================== */
1118919
1119#define Q6_Vw_vdmpy_VhRh_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsat)(Vu,Rt)920#define Q6_Vw_vdmpy_VhRh_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsat)(Vu,Rt)
1120#endif /* __HEXAGON_ARCH___ >= 60 */
1121921
1122#if __HVX_ARCH__ >= 60
1123/* ==========================================================================922/* ==========================================================================
1124 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Rt32.h):sat923 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Rt32.h):sat
1125 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhRh_sat(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)924 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhRh_sat(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -1128,9 +927,7 @@...@@ -1128,9 +927,7 @@
1128 ========================================================================== */927 ========================================================================== */
1129928
1130#define Q6_Vw_vdmpyacc_VwVhRh_sat(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsat_acc)(Vx,Vu,Rt)929#define Q6_Vw_vdmpyacc_VwVhRh_sat(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsat_acc)(Vx,Vu,Rt)
1131#endif /* __HEXAGON_ARCH___ >= 60 */
1132930
1133#if __HVX_ARCH__ >= 60
1134/* ==========================================================================931/* ==========================================================================
1135 Assembly Syntax: Vd32.w=vdmpy(Vuu32.h,Rt32.uh,#1):sat932 Assembly Syntax: Vd32.w=vdmpy(Vuu32.h,Rt32.uh,#1):sat
1136 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_WhRuh_sat(HVX_VectorPair Vuu, Word32 Rt)933 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_WhRuh_sat(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1139,9 +936,7 @@...@@ -1139,9 +936,7 @@
1139 ========================================================================== */936 ========================================================================== */
1140937
1141#define Q6_Vw_vdmpy_WhRuh_sat(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsuisat)(Vuu,Rt)938#define Q6_Vw_vdmpy_WhRuh_sat(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsuisat)(Vuu,Rt)
1142#endif /* __HEXAGON_ARCH___ >= 60 */
1143939
1144#if __HVX_ARCH__ >= 60
1145/* ==========================================================================940/* ==========================================================================
1146 Assembly Syntax: Vx32.w+=vdmpy(Vuu32.h,Rt32.uh,#1):sat941 Assembly Syntax: Vx32.w+=vdmpy(Vuu32.h,Rt32.uh,#1):sat
1147 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwWhRuh_sat(HVX_Vector Vx, HVX_VectorPair Vuu, Word32 Rt)942 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwWhRuh_sat(HVX_Vector Vx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1150,9 +945,7 @@...@@ -1150,9 +945,7 @@
1150 ========================================================================== */945 ========================================================================== */
1151946
1152#define Q6_Vw_vdmpyacc_VwWhRuh_sat(Vx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsuisat_acc)(Vx,Vuu,Rt)947#define Q6_Vw_vdmpyacc_VwWhRuh_sat(Vx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsuisat_acc)(Vx,Vuu,Rt)
1153#endif /* __HEXAGON_ARCH___ >= 60 */
1154948
1155#if __HVX_ARCH__ >= 60
1156/* ==========================================================================949/* ==========================================================================
1157 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Rt32.uh):sat950 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Rt32.uh):sat
1158 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhRuh_sat(HVX_Vector Vu, Word32 Rt)951 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhRuh_sat(HVX_Vector Vu, Word32 Rt)
...@@ -1161,9 +954,7 @@...@@ -1161,9 +954,7 @@
1161 ========================================================================== */954 ========================================================================== */
1162955
1163#define Q6_Vw_vdmpy_VhRuh_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsusat)(Vu,Rt)956#define Q6_Vw_vdmpy_VhRuh_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsusat)(Vu,Rt)
1164#endif /* __HEXAGON_ARCH___ >= 60 */
1165957
1166#if __HVX_ARCH__ >= 60
1167/* ==========================================================================958/* ==========================================================================
1168 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Rt32.uh):sat959 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Rt32.uh):sat
1169 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhRuh_sat(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)960 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhRuh_sat(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -1172,9 +963,7 @@...@@ -1172,9 +963,7 @@
1172 ========================================================================== */963 ========================================================================== */
1173964
1174#define Q6_Vw_vdmpyacc_VwVhRuh_sat(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsusat_acc)(Vx,Vu,Rt)965#define Q6_Vw_vdmpyacc_VwVhRuh_sat(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhsusat_acc)(Vx,Vu,Rt)
1175#endif /* __HEXAGON_ARCH___ >= 60 */
1176966
1177#if __HVX_ARCH__ >= 60
1178/* ==========================================================================967/* ==========================================================================
1179 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Vv32.h):sat968 Assembly Syntax: Vd32.w=vdmpy(Vu32.h,Vv32.h):sat
1180 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)969 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpy_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1183,9 +972,7 @@...@@ -1183,9 +972,7 @@
1183 ========================================================================== */972 ========================================================================== */
1184973
1185#define Q6_Vw_vdmpy_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhvsat)(Vu,Vv)974#define Q6_Vw_vdmpy_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhvsat)(Vu,Vv)
1186#endif /* __HEXAGON_ARCH___ >= 60 */
1187975
1188#if __HVX_ARCH__ >= 60
1189/* ==========================================================================976/* ==========================================================================
1190 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Vv32.h):sat977 Assembly Syntax: Vx32.w+=vdmpy(Vu32.h,Vv32.h):sat
1191 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhVh_sat(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)978 C Intrinsic Prototype: HVX_Vector Q6_Vw_vdmpyacc_VwVhVh_sat(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1194,9 +981,7 @@...@@ -1194,9 +981,7 @@
1194 ========================================================================== */981 ========================================================================== */
1195982
1196#define Q6_Vw_vdmpyacc_VwVhVh_sat(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhvsat_acc)(Vx,Vu,Vv)983#define Q6_Vw_vdmpyacc_VwVhVh_sat(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpyhvsat_acc)(Vx,Vu,Vv)
1197#endif /* __HEXAGON_ARCH___ >= 60 */
1198984
1199#if __HVX_ARCH__ >= 60
1200/* ==========================================================================985/* ==========================================================================
1201 Assembly Syntax: Vdd32.uw=vdsad(Vuu32.uh,Rt32.uh)986 Assembly Syntax: Vdd32.uw=vdsad(Vuu32.uh,Rt32.uh)
1202 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vdsad_WuhRuh(HVX_VectorPair Vuu, Word32 Rt)987 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vdsad_WuhRuh(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1205,9 +990,7 @@...@@ -1205,9 +990,7 @@
1205 ========================================================================== */990 ========================================================================== */
1206991
1207#define Q6_Wuw_vdsad_WuhRuh(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdsaduh)(Vuu,Rt)992#define Q6_Wuw_vdsad_WuhRuh(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdsaduh)(Vuu,Rt)
1208#endif /* __HEXAGON_ARCH___ >= 60 */
1209993
1210#if __HVX_ARCH__ >= 60
1211/* ==========================================================================994/* ==========================================================================
1212 Assembly Syntax: Vxx32.uw+=vdsad(Vuu32.uh,Rt32.uh)995 Assembly Syntax: Vxx32.uw+=vdsad(Vuu32.uh,Rt32.uh)
1213 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vdsadacc_WuwWuhRuh(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)996 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vdsadacc_WuwWuhRuh(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1216,9 +999,7 @@...@@ -1216,9 +999,7 @@
1216 ========================================================================== */999 ========================================================================== */
12171000
1218#define Q6_Wuw_vdsadacc_WuwWuhRuh(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdsaduh_acc)(Vxx,Vuu,Rt)1001#define Q6_Wuw_vdsadacc_WuwWuhRuh(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdsaduh_acc)(Vxx,Vuu,Rt)
1219#endif /* __HEXAGON_ARCH___ >= 60 */
12201002
1221#if __HVX_ARCH__ >= 60
1222/* ==========================================================================1003/* ==========================================================================
1223 Assembly Syntax: Qd4=vcmp.eq(Vu32.b,Vv32.b)1004 Assembly Syntax: Qd4=vcmp.eq(Vu32.b,Vv32.b)
1224 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VbVb(HVX_Vector Vu, HVX_Vector Vv)1005 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1227,9 +1008,7 @@...@@ -1227,9 +1008,7 @@
1227 ========================================================================== */1008 ========================================================================== */
12281009
1229#define Q6_Q_vcmp_eq_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb)(Vu,Vv)),-1)1010#define Q6_Q_vcmp_eq_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb)(Vu,Vv)),-1)
1230#endif /* __HEXAGON_ARCH___ >= 60 */
12311011
1232#if __HVX_ARCH__ >= 60
1233/* ==========================================================================1012/* ==========================================================================
1234 Assembly Syntax: Qx4&=vcmp.eq(Vu32.b,Vv32.b)1013 Assembly Syntax: Qx4&=vcmp.eq(Vu32.b,Vv32.b)
1235 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1014 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1238,9 +1017,7 @@...@@ -1238,9 +1017,7 @@
1238 ========================================================================== */1017 ========================================================================== */
12391018
1240#define Q6_Q_vcmp_eqand_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1019#define Q6_Q_vcmp_eqand_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1241#endif /* __HEXAGON_ARCH___ >= 60 */
12421020
1243#if __HVX_ARCH__ >= 60
1244/* ==========================================================================1021/* ==========================================================================
1245 Assembly Syntax: Qx4|=vcmp.eq(Vu32.b,Vv32.b)1022 Assembly Syntax: Qx4|=vcmp.eq(Vu32.b,Vv32.b)
1246 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1023 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1249,9 +1026,7 @@...@@ -1249,9 +1026,7 @@
1249 ========================================================================== */1026 ========================================================================== */
12501027
1251#define Q6_Q_vcmp_eqor_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1028#define Q6_Q_vcmp_eqor_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1252#endif /* __HEXAGON_ARCH___ >= 60 */
12531029
1254#if __HVX_ARCH__ >= 60
1255/* ==========================================================================1030/* ==========================================================================
1256 Assembly Syntax: Qx4^=vcmp.eq(Vu32.b,Vv32.b)1031 Assembly Syntax: Qx4^=vcmp.eq(Vu32.b,Vv32.b)
1257 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1032 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1260,9 +1035,7 @@...@@ -1260,9 +1035,7 @@
1260 ========================================================================== */1035 ========================================================================== */
12611036
1262#define Q6_Q_vcmp_eqxacc_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1037#define Q6_Q_vcmp_eqxacc_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqb_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1263#endif /* __HEXAGON_ARCH___ >= 60 */
12641038
1265#if __HVX_ARCH__ >= 60
1266/* ==========================================================================1039/* ==========================================================================
1267 Assembly Syntax: Qd4=vcmp.eq(Vu32.h,Vv32.h)1040 Assembly Syntax: Qd4=vcmp.eq(Vu32.h,Vv32.h)
1268 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VhVh(HVX_Vector Vu, HVX_Vector Vv)1041 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1271,9 +1044,7 @@...@@ -1271,9 +1044,7 @@
1271 ========================================================================== */1044 ========================================================================== */
12721045
1273#define Q6_Q_vcmp_eq_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh)(Vu,Vv)),-1)1046#define Q6_Q_vcmp_eq_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh)(Vu,Vv)),-1)
1274#endif /* __HEXAGON_ARCH___ >= 60 */
12751047
1276#if __HVX_ARCH__ >= 60
1277/* ==========================================================================1048/* ==========================================================================
1278 Assembly Syntax: Qx4&=vcmp.eq(Vu32.h,Vv32.h)1049 Assembly Syntax: Qx4&=vcmp.eq(Vu32.h,Vv32.h)
1279 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1050 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1282,9 +1053,7 @@...@@ -1282,9 +1053,7 @@
1282 ========================================================================== */1053 ========================================================================== */
12831054
1284#define Q6_Q_vcmp_eqand_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1055#define Q6_Q_vcmp_eqand_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1285#endif /* __HEXAGON_ARCH___ >= 60 */
12861056
1287#if __HVX_ARCH__ >= 60
1288/* ==========================================================================1057/* ==========================================================================
1289 Assembly Syntax: Qx4|=vcmp.eq(Vu32.h,Vv32.h)1058 Assembly Syntax: Qx4|=vcmp.eq(Vu32.h,Vv32.h)
1290 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1059 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1293,9 +1062,7 @@...@@ -1293,9 +1062,7 @@
1293 ========================================================================== */1062 ========================================================================== */
12941063
1295#define Q6_Q_vcmp_eqor_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1064#define Q6_Q_vcmp_eqor_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1296#endif /* __HEXAGON_ARCH___ >= 60 */
12971065
1298#if __HVX_ARCH__ >= 60
1299/* ==========================================================================1066/* ==========================================================================
1300 Assembly Syntax: Qx4^=vcmp.eq(Vu32.h,Vv32.h)1067 Assembly Syntax: Qx4^=vcmp.eq(Vu32.h,Vv32.h)
1301 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1068 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1304,9 +1071,7 @@...@@ -1304,9 +1071,7 @@
1304 ========================================================================== */1071 ========================================================================== */
13051072
1306#define Q6_Q_vcmp_eqxacc_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1073#define Q6_Q_vcmp_eqxacc_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqh_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1307#endif /* __HEXAGON_ARCH___ >= 60 */
13081074
1309#if __HVX_ARCH__ >= 60
1310/* ==========================================================================1075/* ==========================================================================
1311 Assembly Syntax: Qd4=vcmp.eq(Vu32.w,Vv32.w)1076 Assembly Syntax: Qd4=vcmp.eq(Vu32.w,Vv32.w)
1312 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VwVw(HVX_Vector Vu, HVX_Vector Vv)1077 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1315,9 +1080,7 @@...@@ -1315,9 +1080,7 @@
1315 ========================================================================== */1080 ========================================================================== */
13161081
1317#define Q6_Q_vcmp_eq_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw)(Vu,Vv)),-1)1082#define Q6_Q_vcmp_eq_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw)(Vu,Vv)),-1)
1318#endif /* __HEXAGON_ARCH___ >= 60 */
13191083
1320#if __HVX_ARCH__ >= 60
1321/* ==========================================================================1084/* ==========================================================================
1322 Assembly Syntax: Qx4&=vcmp.eq(Vu32.w,Vv32.w)1085 Assembly Syntax: Qx4&=vcmp.eq(Vu32.w,Vv32.w)
1323 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1086 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1326,9 +1089,7 @@...@@ -1326,9 +1089,7 @@
1326 ========================================================================== */1089 ========================================================================== */
13271090
1328#define Q6_Q_vcmp_eqand_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1091#define Q6_Q_vcmp_eqand_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1329#endif /* __HEXAGON_ARCH___ >= 60 */
13301092
1331#if __HVX_ARCH__ >= 60
1332/* ==========================================================================1093/* ==========================================================================
1333 Assembly Syntax: Qx4|=vcmp.eq(Vu32.w,Vv32.w)1094 Assembly Syntax: Qx4|=vcmp.eq(Vu32.w,Vv32.w)
1334 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1095 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1337,9 +1098,7 @@...@@ -1337,9 +1098,7 @@
1337 ========================================================================== */1098 ========================================================================== */
13381099
1339#define Q6_Q_vcmp_eqor_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1100#define Q6_Q_vcmp_eqor_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1340#endif /* __HEXAGON_ARCH___ >= 60 */
13411101
1342#if __HVX_ARCH__ >= 60
1343/* ==========================================================================1102/* ==========================================================================
1344 Assembly Syntax: Qx4^=vcmp.eq(Vu32.w,Vv32.w)1103 Assembly Syntax: Qx4^=vcmp.eq(Vu32.w,Vv32.w)
1345 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1104 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1348,9 +1107,7 @@...@@ -1348,9 +1107,7 @@
1348 ========================================================================== */1107 ========================================================================== */
13491108
1350#define Q6_Q_vcmp_eqxacc_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1109#define Q6_Q_vcmp_eqxacc_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqw_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1351#endif /* __HEXAGON_ARCH___ >= 60 */
13521110
1353#if __HVX_ARCH__ >= 60
1354/* ==========================================================================1111/* ==========================================================================
1355 Assembly Syntax: Qd4=vcmp.gt(Vu32.b,Vv32.b)1112 Assembly Syntax: Qd4=vcmp.gt(Vu32.b,Vv32.b)
1356 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VbVb(HVX_Vector Vu, HVX_Vector Vv)1113 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1359,9 +1116,7 @@...@@ -1359,9 +1116,7 @@
1359 ========================================================================== */1116 ========================================================================== */
13601117
1361#define Q6_Q_vcmp_gt_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb)(Vu,Vv)),-1)1118#define Q6_Q_vcmp_gt_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb)(Vu,Vv)),-1)
1362#endif /* __HEXAGON_ARCH___ >= 60 */
13631119
1364#if __HVX_ARCH__ >= 60
1365/* ==========================================================================1120/* ==========================================================================
1366 Assembly Syntax: Qx4&=vcmp.gt(Vu32.b,Vv32.b)1121 Assembly Syntax: Qx4&=vcmp.gt(Vu32.b,Vv32.b)
1367 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1122 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1370,9 +1125,7 @@...@@ -1370,9 +1125,7 @@
1370 ========================================================================== */1125 ========================================================================== */
13711126
1372#define Q6_Q_vcmp_gtand_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1127#define Q6_Q_vcmp_gtand_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1373#endif /* __HEXAGON_ARCH___ >= 60 */
13741128
1375#if __HVX_ARCH__ >= 60
1376/* ==========================================================================1129/* ==========================================================================
1377 Assembly Syntax: Qx4|=vcmp.gt(Vu32.b,Vv32.b)1130 Assembly Syntax: Qx4|=vcmp.gt(Vu32.b,Vv32.b)
1378 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1131 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1381,9 +1134,7 @@...@@ -1381,9 +1134,7 @@
1381 ========================================================================== */1134 ========================================================================== */
13821135
1383#define Q6_Q_vcmp_gtor_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1136#define Q6_Q_vcmp_gtor_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1384#endif /* __HEXAGON_ARCH___ >= 60 */
13851137
1386#if __HVX_ARCH__ >= 60
1387/* ==========================================================================1138/* ==========================================================================
1388 Assembly Syntax: Qx4^=vcmp.gt(Vu32.b,Vv32.b)1139 Assembly Syntax: Qx4^=vcmp.gt(Vu32.b,Vv32.b)
1389 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1140 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVbVb(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1392,9 +1143,7 @@...@@ -1392,9 +1143,7 @@
1392 ========================================================================== */1143 ========================================================================== */
13931144
1394#define Q6_Q_vcmp_gtxacc_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1145#define Q6_Q_vcmp_gtxacc_QVbVb(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtb_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1395#endif /* __HEXAGON_ARCH___ >= 60 */
13961146
1397#if __HVX_ARCH__ >= 60
1398/* ==========================================================================1147/* ==========================================================================
1399 Assembly Syntax: Qd4=vcmp.gt(Vu32.h,Vv32.h)1148 Assembly Syntax: Qd4=vcmp.gt(Vu32.h,Vv32.h)
1400 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VhVh(HVX_Vector Vu, HVX_Vector Vv)1149 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1403,9 +1152,7 @@...@@ -1403,9 +1152,7 @@
1403 ========================================================================== */1152 ========================================================================== */
14041153
1405#define Q6_Q_vcmp_gt_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth)(Vu,Vv)),-1)1154#define Q6_Q_vcmp_gt_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth)(Vu,Vv)),-1)
1406#endif /* __HEXAGON_ARCH___ >= 60 */
14071155
1408#if __HVX_ARCH__ >= 60
1409/* ==========================================================================1156/* ==========================================================================
1410 Assembly Syntax: Qx4&=vcmp.gt(Vu32.h,Vv32.h)1157 Assembly Syntax: Qx4&=vcmp.gt(Vu32.h,Vv32.h)
1411 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1158 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1414,9 +1161,7 @@...@@ -1414,9 +1161,7 @@
1414 ========================================================================== */1161 ========================================================================== */
14151162
1416#define Q6_Q_vcmp_gtand_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1163#define Q6_Q_vcmp_gtand_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1417#endif /* __HEXAGON_ARCH___ >= 60 */
14181164
1419#if __HVX_ARCH__ >= 60
1420/* ==========================================================================1165/* ==========================================================================
1421 Assembly Syntax: Qx4|=vcmp.gt(Vu32.h,Vv32.h)1166 Assembly Syntax: Qx4|=vcmp.gt(Vu32.h,Vv32.h)
1422 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1167 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1425,9 +1170,7 @@...@@ -1425,9 +1170,7 @@
1425 ========================================================================== */1170 ========================================================================== */
14261171
1427#define Q6_Q_vcmp_gtor_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1172#define Q6_Q_vcmp_gtor_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1428#endif /* __HEXAGON_ARCH___ >= 60 */
14291173
1430#if __HVX_ARCH__ >= 60
1431/* ==========================================================================1174/* ==========================================================================
1432 Assembly Syntax: Qx4^=vcmp.gt(Vu32.h,Vv32.h)1175 Assembly Syntax: Qx4^=vcmp.gt(Vu32.h,Vv32.h)
1433 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1176 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVhVh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1436,9 +1179,7 @@...@@ -1436,9 +1179,7 @@
1436 ========================================================================== */1179 ========================================================================== */
14371180
1438#define Q6_Q_vcmp_gtxacc_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1181#define Q6_Q_vcmp_gtxacc_QVhVh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgth_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1439#endif /* __HEXAGON_ARCH___ >= 60 */
14401182
1441#if __HVX_ARCH__ >= 60
1442/* ==========================================================================1183/* ==========================================================================
1443 Assembly Syntax: Qd4=vcmp.gt(Vu32.ub,Vv32.ub)1184 Assembly Syntax: Qd4=vcmp.gt(Vu32.ub,Vv32.ub)
1444 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VubVub(HVX_Vector Vu, HVX_Vector Vv)1185 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1447,9 +1188,7 @@...@@ -1447,9 +1188,7 @@
1447 ========================================================================== */1188 ========================================================================== */
14481189
1449#define Q6_Q_vcmp_gt_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub)(Vu,Vv)),-1)1190#define Q6_Q_vcmp_gt_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub)(Vu,Vv)),-1)
1450#endif /* __HEXAGON_ARCH___ >= 60 */
14511191
1452#if __HVX_ARCH__ >= 60
1453/* ==========================================================================1192/* ==========================================================================
1454 Assembly Syntax: Qx4&=vcmp.gt(Vu32.ub,Vv32.ub)1193 Assembly Syntax: Qx4&=vcmp.gt(Vu32.ub,Vv32.ub)
1455 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVubVub(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1194 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVubVub(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1458,9 +1197,7 @@...@@ -1458,9 +1197,7 @@
1458 ========================================================================== */1197 ========================================================================== */
14591198
1460#define Q6_Q_vcmp_gtand_QVubVub(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1199#define Q6_Q_vcmp_gtand_QVubVub(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1461#endif /* __HEXAGON_ARCH___ >= 60 */
14621200
1463#if __HVX_ARCH__ >= 60
1464/* ==========================================================================1201/* ==========================================================================
1465 Assembly Syntax: Qx4|=vcmp.gt(Vu32.ub,Vv32.ub)1202 Assembly Syntax: Qx4|=vcmp.gt(Vu32.ub,Vv32.ub)
1466 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVubVub(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1203 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVubVub(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1469,9 +1206,7 @@...@@ -1469,9 +1206,7 @@
1469 ========================================================================== */1206 ========================================================================== */
14701207
1471#define Q6_Q_vcmp_gtor_QVubVub(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1208#define Q6_Q_vcmp_gtor_QVubVub(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1472#endif /* __HEXAGON_ARCH___ >= 60 */
14731209
1474#if __HVX_ARCH__ >= 60
1475/* ==========================================================================1210/* ==========================================================================
1476 Assembly Syntax: Qx4^=vcmp.gt(Vu32.ub,Vv32.ub)1211 Assembly Syntax: Qx4^=vcmp.gt(Vu32.ub,Vv32.ub)
1477 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVubVub(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1212 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVubVub(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1480,9 +1215,7 @@...@@ -1480,9 +1215,7 @@
1480 ========================================================================== */1215 ========================================================================== */
14811216
1482#define Q6_Q_vcmp_gtxacc_QVubVub(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1217#define Q6_Q_vcmp_gtxacc_QVubVub(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtub_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1483#endif /* __HEXAGON_ARCH___ >= 60 */
14841218
1485#if __HVX_ARCH__ >= 60
1486/* ==========================================================================1219/* ==========================================================================
1487 Assembly Syntax: Qd4=vcmp.gt(Vu32.uh,Vv32.uh)1220 Assembly Syntax: Qd4=vcmp.gt(Vu32.uh,Vv32.uh)
1488 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)1221 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1491,9 +1224,7 @@...@@ -1491,9 +1224,7 @@
1491 ========================================================================== */1224 ========================================================================== */
14921225
1493#define Q6_Q_vcmp_gt_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh)(Vu,Vv)),-1)1226#define Q6_Q_vcmp_gt_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh)(Vu,Vv)),-1)
1494#endif /* __HEXAGON_ARCH___ >= 60 */
14951227
1496#if __HVX_ARCH__ >= 60
1497/* ==========================================================================1228/* ==========================================================================
1498 Assembly Syntax: Qx4&=vcmp.gt(Vu32.uh,Vv32.uh)1229 Assembly Syntax: Qx4&=vcmp.gt(Vu32.uh,Vv32.uh)
1499 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVuhVuh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1230 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVuhVuh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1502,9 +1233,7 @@...@@ -1502,9 +1233,7 @@
1502 ========================================================================== */1233 ========================================================================== */
15031234
1504#define Q6_Q_vcmp_gtand_QVuhVuh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1235#define Q6_Q_vcmp_gtand_QVuhVuh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1505#endif /* __HEXAGON_ARCH___ >= 60 */
15061236
1507#if __HVX_ARCH__ >= 60
1508/* ==========================================================================1237/* ==========================================================================
1509 Assembly Syntax: Qx4|=vcmp.gt(Vu32.uh,Vv32.uh)1238 Assembly Syntax: Qx4|=vcmp.gt(Vu32.uh,Vv32.uh)
1510 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVuhVuh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1239 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVuhVuh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1513,9 +1242,7 @@...@@ -1513,9 +1242,7 @@
1513 ========================================================================== */1242 ========================================================================== */
15141243
1515#define Q6_Q_vcmp_gtor_QVuhVuh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1244#define Q6_Q_vcmp_gtor_QVuhVuh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1516#endif /* __HEXAGON_ARCH___ >= 60 */
15171245
1518#if __HVX_ARCH__ >= 60
1519/* ==========================================================================1246/* ==========================================================================
1520 Assembly Syntax: Qx4^=vcmp.gt(Vu32.uh,Vv32.uh)1247 Assembly Syntax: Qx4^=vcmp.gt(Vu32.uh,Vv32.uh)
1521 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVuhVuh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1248 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVuhVuh(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1524,9 +1251,7 @@...@@ -1524,9 +1251,7 @@
1524 ========================================================================== */1251 ========================================================================== */
15251252
1526#define Q6_Q_vcmp_gtxacc_QVuhVuh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1253#define Q6_Q_vcmp_gtxacc_QVuhVuh(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuh_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1527#endif /* __HEXAGON_ARCH___ >= 60 */
15281254
1529#if __HVX_ARCH__ >= 60
1530/* ==========================================================================1255/* ==========================================================================
1531 Assembly Syntax: Qd4=vcmp.gt(Vu32.uw,Vv32.uw)1256 Assembly Syntax: Qd4=vcmp.gt(Vu32.uw,Vv32.uw)
1532 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VuwVuw(HVX_Vector Vu, HVX_Vector Vv)1257 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VuwVuw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1535,9 +1260,7 @@...@@ -1535,9 +1260,7 @@
1535 ========================================================================== */1260 ========================================================================== */
15361261
1537#define Q6_Q_vcmp_gt_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw)(Vu,Vv)),-1)1262#define Q6_Q_vcmp_gt_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw)(Vu,Vv)),-1)
1538#endif /* __HEXAGON_ARCH___ >= 60 */
15391263
1540#if __HVX_ARCH__ >= 60
1541/* ==========================================================================1264/* ==========================================================================
1542 Assembly Syntax: Qx4&=vcmp.gt(Vu32.uw,Vv32.uw)1265 Assembly Syntax: Qx4&=vcmp.gt(Vu32.uw,Vv32.uw)
1543 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVuwVuw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1266 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVuwVuw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1546,9 +1269,7 @@...@@ -1546,9 +1269,7 @@
1546 ========================================================================== */1269 ========================================================================== */
15471270
1548#define Q6_Q_vcmp_gtand_QVuwVuw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1271#define Q6_Q_vcmp_gtand_QVuwVuw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1549#endif /* __HEXAGON_ARCH___ >= 60 */
15501272
1551#if __HVX_ARCH__ >= 60
1552/* ==========================================================================1273/* ==========================================================================
1553 Assembly Syntax: Qx4|=vcmp.gt(Vu32.uw,Vv32.uw)1274 Assembly Syntax: Qx4|=vcmp.gt(Vu32.uw,Vv32.uw)
1554 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVuwVuw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1275 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVuwVuw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1557,9 +1278,7 @@...@@ -1557,9 +1278,7 @@
1557 ========================================================================== */1278 ========================================================================== */
15581279
1559#define Q6_Q_vcmp_gtor_QVuwVuw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1280#define Q6_Q_vcmp_gtor_QVuwVuw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1560#endif /* __HEXAGON_ARCH___ >= 60 */
15611281
1562#if __HVX_ARCH__ >= 60
1563/* ==========================================================================1282/* ==========================================================================
1564 Assembly Syntax: Qx4^=vcmp.gt(Vu32.uw,Vv32.uw)1283 Assembly Syntax: Qx4^=vcmp.gt(Vu32.uw,Vv32.uw)
1565 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVuwVuw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1284 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVuwVuw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1568,9 +1287,7 @@...@@ -1568,9 +1287,7 @@
1568 ========================================================================== */1287 ========================================================================== */
15691288
1570#define Q6_Q_vcmp_gtxacc_QVuwVuw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1289#define Q6_Q_vcmp_gtxacc_QVuwVuw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtuw_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1571#endif /* __HEXAGON_ARCH___ >= 60 */
15721290
1573#if __HVX_ARCH__ >= 60
1574/* ==========================================================================1291/* ==========================================================================
1575 Assembly Syntax: Qd4=vcmp.gt(Vu32.w,Vv32.w)1292 Assembly Syntax: Qd4=vcmp.gt(Vu32.w,Vv32.w)
1576 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VwVw(HVX_Vector Vu, HVX_Vector Vv)1293 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1579,9 +1296,7 @@...@@ -1579,9 +1296,7 @@
1579 ========================================================================== */1296 ========================================================================== */
15801297
1581#define Q6_Q_vcmp_gt_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw)(Vu,Vv)),-1)1298#define Q6_Q_vcmp_gt_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw)(Vu,Vv)),-1)
1582#endif /* __HEXAGON_ARCH___ >= 60 */
15831299
1584#if __HVX_ARCH__ >= 60
1585/* ==========================================================================1300/* ==========================================================================
1586 Assembly Syntax: Qx4&=vcmp.gt(Vu32.w,Vv32.w)1301 Assembly Syntax: Qx4&=vcmp.gt(Vu32.w,Vv32.w)
1587 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1302 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1590,9 +1305,7 @@...@@ -1590,9 +1305,7 @@
1590 ========================================================================== */1305 ========================================================================== */
15911306
1592#define Q6_Q_vcmp_gtand_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1307#define Q6_Q_vcmp_gtand_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1593#endif /* __HEXAGON_ARCH___ >= 60 */
15941308
1595#if __HVX_ARCH__ >= 60
1596/* ==========================================================================1309/* ==========================================================================
1597 Assembly Syntax: Qx4|=vcmp.gt(Vu32.w,Vv32.w)1310 Assembly Syntax: Qx4|=vcmp.gt(Vu32.w,Vv32.w)
1598 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1311 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1601,9 +1314,7 @@...@@ -1601,9 +1314,7 @@
1601 ========================================================================== */1314 ========================================================================== */
16021315
1603#define Q6_Q_vcmp_gtor_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1316#define Q6_Q_vcmp_gtor_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1604#endif /* __HEXAGON_ARCH___ >= 60 */
16051317
1606#if __HVX_ARCH__ >= 60
1607/* ==========================================================================1318/* ==========================================================================
1608 Assembly Syntax: Qx4^=vcmp.gt(Vu32.w,Vv32.w)1319 Assembly Syntax: Qx4^=vcmp.gt(Vu32.w,Vv32.w)
1609 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)1320 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVwVw(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1612,9 +1323,7 @@...@@ -1612,9 +1323,7 @@
1612 ========================================================================== */1323 ========================================================================== */
16131324
1614#define Q6_Q_vcmp_gtxacc_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)1325#define Q6_Q_vcmp_gtxacc_QVwVw(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtw_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
1615#endif /* __HEXAGON_ARCH___ >= 60 */
16161326
1617#if __HVX_ARCH__ >= 60
1618/* ==========================================================================1327/* ==========================================================================
1619 Assembly Syntax: Vx32.w=vinsert(Rt32)1328 Assembly Syntax: Vx32.w=vinsert(Rt32)
1620 C Intrinsic Prototype: HVX_Vector Q6_Vw_vinsert_VwR(HVX_Vector Vx, Word32 Rt)1329 C Intrinsic Prototype: HVX_Vector Q6_Vw_vinsert_VwR(HVX_Vector Vx, Word32 Rt)
...@@ -1623,9 +1332,7 @@...@@ -1623,9 +1332,7 @@
1623 ========================================================================== */1332 ========================================================================== */
16241333
1625#define Q6_Vw_vinsert_VwR(Vx,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vinsertwr)(Vx,Rt)1334#define Q6_Vw_vinsert_VwR(Vx,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vinsertwr)(Vx,Rt)
1626#endif /* __HEXAGON_ARCH___ >= 60 */
16271335
1628#if __HVX_ARCH__ >= 60
1629/* ==========================================================================1336/* ==========================================================================
1630 Assembly Syntax: Vd32=vlalign(Vu32,Vv32,Rt8)1337 Assembly Syntax: Vd32=vlalign(Vu32,Vv32,Rt8)
1631 C Intrinsic Prototype: HVX_Vector Q6_V_vlalign_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)1338 C Intrinsic Prototype: HVX_Vector Q6_V_vlalign_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -1634,9 +1341,7 @@...@@ -1634,9 +1341,7 @@
1634 ========================================================================== */1341 ========================================================================== */
16351342
1636#define Q6_V_vlalign_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlalignb)(Vu,Vv,Rt)1343#define Q6_V_vlalign_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlalignb)(Vu,Vv,Rt)
1637#endif /* __HEXAGON_ARCH___ >= 60 */
16381344
1639#if __HVX_ARCH__ >= 60
1640/* ==========================================================================1345/* ==========================================================================
1641 Assembly Syntax: Vd32=vlalign(Vu32,Vv32,#u3)1346 Assembly Syntax: Vd32=vlalign(Vu32,Vv32,#u3)
1642 C Intrinsic Prototype: HVX_Vector Q6_V_vlalign_VVI(HVX_Vector Vu, HVX_Vector Vv, Word32 Iu3)1347 C Intrinsic Prototype: HVX_Vector Q6_V_vlalign_VVI(HVX_Vector Vu, HVX_Vector Vv, Word32 Iu3)
...@@ -1645,9 +1350,7 @@...@@ -1645,9 +1350,7 @@
1645 ========================================================================== */1350 ========================================================================== */
16461351
1647#define Q6_V_vlalign_VVI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlalignbi)(Vu,Vv,Iu3)1352#define Q6_V_vlalign_VVI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlalignbi)(Vu,Vv,Iu3)
1648#endif /* __HEXAGON_ARCH___ >= 60 */
16491353
1650#if __HVX_ARCH__ >= 60
1651/* ==========================================================================1354/* ==========================================================================
1652 Assembly Syntax: Vd32.uh=vlsr(Vu32.uh,Rt32)1355 Assembly Syntax: Vd32.uh=vlsr(Vu32.uh,Rt32)
1653 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vlsr_VuhR(HVX_Vector Vu, Word32 Rt)1356 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vlsr_VuhR(HVX_Vector Vu, Word32 Rt)
...@@ -1656,9 +1359,7 @@...@@ -1656,9 +1359,7 @@
1656 ========================================================================== */1359 ========================================================================== */
16571360
1658#define Q6_Vuh_vlsr_VuhR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrh)(Vu,Rt)1361#define Q6_Vuh_vlsr_VuhR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrh)(Vu,Rt)
1659#endif /* __HEXAGON_ARCH___ >= 60 */
16601362
1661#if __HVX_ARCH__ >= 60
1662/* ==========================================================================1363/* ==========================================================================
1663 Assembly Syntax: Vd32.h=vlsr(Vu32.h,Vv32.h)1364 Assembly Syntax: Vd32.h=vlsr(Vu32.h,Vv32.h)
1664 C Intrinsic Prototype: HVX_Vector Q6_Vh_vlsr_VhVh(HVX_Vector Vu, HVX_Vector Vv)1365 C Intrinsic Prototype: HVX_Vector Q6_Vh_vlsr_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1667,9 +1368,7 @@...@@ -1667,9 +1368,7 @@
1667 ========================================================================== */1368 ========================================================================== */
16681369
1669#define Q6_Vh_vlsr_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrhv)(Vu,Vv)1370#define Q6_Vh_vlsr_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrhv)(Vu,Vv)
1670#endif /* __HEXAGON_ARCH___ >= 60 */
16711371
1672#if __HVX_ARCH__ >= 60
1673/* ==========================================================================1372/* ==========================================================================
1674 Assembly Syntax: Vd32.uw=vlsr(Vu32.uw,Rt32)1373 Assembly Syntax: Vd32.uw=vlsr(Vu32.uw,Rt32)
1675 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vlsr_VuwR(HVX_Vector Vu, Word32 Rt)1374 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vlsr_VuwR(HVX_Vector Vu, Word32 Rt)
...@@ -1678,9 +1377,7 @@...@@ -1678,9 +1377,7 @@
1678 ========================================================================== */1377 ========================================================================== */
16791378
1680#define Q6_Vuw_vlsr_VuwR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrw)(Vu,Rt)1379#define Q6_Vuw_vlsr_VuwR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrw)(Vu,Rt)
1681#endif /* __HEXAGON_ARCH___ >= 60 */
16821380
1683#if __HVX_ARCH__ >= 60
1684/* ==========================================================================1381/* ==========================================================================
1685 Assembly Syntax: Vd32.w=vlsr(Vu32.w,Vv32.w)1382 Assembly Syntax: Vd32.w=vlsr(Vu32.w,Vv32.w)
1686 C Intrinsic Prototype: HVX_Vector Q6_Vw_vlsr_VwVw(HVX_Vector Vu, HVX_Vector Vv)1383 C Intrinsic Prototype: HVX_Vector Q6_Vw_vlsr_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1689,9 +1386,7 @@...@@ -1689,9 +1386,7 @@
1689 ========================================================================== */1386 ========================================================================== */
16901387
1691#define Q6_Vw_vlsr_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrwv)(Vu,Vv)1388#define Q6_Vw_vlsr_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrwv)(Vu,Vv)
1692#endif /* __HEXAGON_ARCH___ >= 60 */
16931389
1694#if __HVX_ARCH__ >= 60
1695/* ==========================================================================1390/* ==========================================================================
1696 Assembly Syntax: Vd32.b=vlut32(Vu32.b,Vv32.b,Rt8)1391 Assembly Syntax: Vd32.b=vlut32(Vu32.b,Vv32.b,Rt8)
1697 C Intrinsic Prototype: HVX_Vector Q6_Vb_vlut32_VbVbR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)1392 C Intrinsic Prototype: HVX_Vector Q6_Vb_vlut32_VbVbR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -1700,9 +1395,7 @@...@@ -1700,9 +1395,7 @@
1700 ========================================================================== */1395 ========================================================================== */
17011396
1702#define Q6_Vb_vlut32_VbVbR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb)(Vu,Vv,Rt)1397#define Q6_Vb_vlut32_VbVbR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb)(Vu,Vv,Rt)
1703#endif /* __HEXAGON_ARCH___ >= 60 */
17041398
1705#if __HVX_ARCH__ >= 60
1706/* ==========================================================================1399/* ==========================================================================
1707 Assembly Syntax: Vx32.b|=vlut32(Vu32.b,Vv32.b,Rt8)1400 Assembly Syntax: Vx32.b|=vlut32(Vu32.b,Vv32.b,Rt8)
1708 C Intrinsic Prototype: HVX_Vector Q6_Vb_vlut32or_VbVbVbR(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)1401 C Intrinsic Prototype: HVX_Vector Q6_Vb_vlut32or_VbVbVbR(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -1711,9 +1404,7 @@...@@ -1711,9 +1404,7 @@
1711 ========================================================================== */1404 ========================================================================== */
17121405
1713#define Q6_Vb_vlut32or_VbVbVbR(Vx,Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb_oracc)(Vx,Vu,Vv,Rt)1406#define Q6_Vb_vlut32or_VbVbVbR(Vx,Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb_oracc)(Vx,Vu,Vv,Rt)
1714#endif /* __HEXAGON_ARCH___ >= 60 */
17151407
1716#if __HVX_ARCH__ >= 60
1717/* ==========================================================================1408/* ==========================================================================
1718 Assembly Syntax: Vdd32.h=vlut16(Vu32.b,Vv32.h,Rt8)1409 Assembly Syntax: Vdd32.h=vlut16(Vu32.b,Vv32.h,Rt8)
1719 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vlut16_VbVhR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)1410 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vlut16_VbVhR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -1722,9 +1413,7 @@...@@ -1722,9 +1413,7 @@
1722 ========================================================================== */1413 ========================================================================== */
17231414
1724#define Q6_Wh_vlut16_VbVhR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh)(Vu,Vv,Rt)1415#define Q6_Wh_vlut16_VbVhR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh)(Vu,Vv,Rt)
1725#endif /* __HEXAGON_ARCH___ >= 60 */
17261416
1727#if __HVX_ARCH__ >= 60
1728/* ==========================================================================1417/* ==========================================================================
1729 Assembly Syntax: Vxx32.h|=vlut16(Vu32.b,Vv32.h,Rt8)1418 Assembly Syntax: Vxx32.h|=vlut16(Vu32.b,Vv32.h,Rt8)
1730 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vlut16or_WhVbVhR(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)1419 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vlut16or_WhVbVhR(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -1733,9 +1422,7 @@...@@ -1733,9 +1422,7 @@
1733 ========================================================================== */1422 ========================================================================== */
17341423
1735#define Q6_Wh_vlut16or_WhVbVhR(Vxx,Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh_oracc)(Vxx,Vu,Vv,Rt)1424#define Q6_Wh_vlut16or_WhVbVhR(Vxx,Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh_oracc)(Vxx,Vu,Vv,Rt)
1736#endif /* __HEXAGON_ARCH___ >= 60 */
17371425
1738#if __HVX_ARCH__ >= 60
1739/* ==========================================================================1426/* ==========================================================================
1740 Assembly Syntax: Vd32.h=vmax(Vu32.h,Vv32.h)1427 Assembly Syntax: Vd32.h=vmax(Vu32.h,Vv32.h)
1741 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmax_VhVh(HVX_Vector Vu, HVX_Vector Vv)1428 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmax_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1744,9 +1431,7 @@...@@ -1744,9 +1431,7 @@
1744 ========================================================================== */1431 ========================================================================== */
17451432
1746#define Q6_Vh_vmax_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxh)(Vu,Vv)1433#define Q6_Vh_vmax_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxh)(Vu,Vv)
1747#endif /* __HEXAGON_ARCH___ >= 60 */
17481434
1749#if __HVX_ARCH__ >= 60
1750/* ==========================================================================1435/* ==========================================================================
1751 Assembly Syntax: Vd32.ub=vmax(Vu32.ub,Vv32.ub)1436 Assembly Syntax: Vd32.ub=vmax(Vu32.ub,Vv32.ub)
1752 C Intrinsic Prototype: HVX_Vector Q6_Vub_vmax_VubVub(HVX_Vector Vu, HVX_Vector Vv)1437 C Intrinsic Prototype: HVX_Vector Q6_Vub_vmax_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1755,9 +1440,7 @@...@@ -1755,9 +1440,7 @@
1755 ========================================================================== */1440 ========================================================================== */
17561441
1757#define Q6_Vub_vmax_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxub)(Vu,Vv)1442#define Q6_Vub_vmax_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxub)(Vu,Vv)
1758#endif /* __HEXAGON_ARCH___ >= 60 */
17591443
1760#if __HVX_ARCH__ >= 60
1761/* ==========================================================================1444/* ==========================================================================
1762 Assembly Syntax: Vd32.uh=vmax(Vu32.uh,Vv32.uh)1445 Assembly Syntax: Vd32.uh=vmax(Vu32.uh,Vv32.uh)
1763 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vmax_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)1446 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vmax_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1766,9 +1449,7 @@...@@ -1766,9 +1449,7 @@
1766 ========================================================================== */1449 ========================================================================== */
17671450
1768#define Q6_Vuh_vmax_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxuh)(Vu,Vv)1451#define Q6_Vuh_vmax_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxuh)(Vu,Vv)
1769#endif /* __HEXAGON_ARCH___ >= 60 */
17701452
1771#if __HVX_ARCH__ >= 60
1772/* ==========================================================================1453/* ==========================================================================
1773 Assembly Syntax: Vd32.w=vmax(Vu32.w,Vv32.w)1454 Assembly Syntax: Vd32.w=vmax(Vu32.w,Vv32.w)
1774 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmax_VwVw(HVX_Vector Vu, HVX_Vector Vv)1455 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmax_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1777,9 +1458,7 @@...@@ -1777,9 +1458,7 @@
1777 ========================================================================== */1458 ========================================================================== */
17781459
1779#define Q6_Vw_vmax_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxw)(Vu,Vv)1460#define Q6_Vw_vmax_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxw)(Vu,Vv)
1780#endif /* __HEXAGON_ARCH___ >= 60 */
17811461
1782#if __HVX_ARCH__ >= 60
1783/* ==========================================================================1462/* ==========================================================================
1784 Assembly Syntax: Vd32.h=vmin(Vu32.h,Vv32.h)1463 Assembly Syntax: Vd32.h=vmin(Vu32.h,Vv32.h)
1785 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmin_VhVh(HVX_Vector Vu, HVX_Vector Vv)1464 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmin_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1788,9 +1467,7 @@...@@ -1788,9 +1467,7 @@
1788 ========================================================================== */1467 ========================================================================== */
17891468
1790#define Q6_Vh_vmin_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminh)(Vu,Vv)1469#define Q6_Vh_vmin_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminh)(Vu,Vv)
1791#endif /* __HEXAGON_ARCH___ >= 60 */
17921470
1793#if __HVX_ARCH__ >= 60
1794/* ==========================================================================1471/* ==========================================================================
1795 Assembly Syntax: Vd32.ub=vmin(Vu32.ub,Vv32.ub)1472 Assembly Syntax: Vd32.ub=vmin(Vu32.ub,Vv32.ub)
1796 C Intrinsic Prototype: HVX_Vector Q6_Vub_vmin_VubVub(HVX_Vector Vu, HVX_Vector Vv)1473 C Intrinsic Prototype: HVX_Vector Q6_Vub_vmin_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1799,9 +1476,7 @@...@@ -1799,9 +1476,7 @@
1799 ========================================================================== */1476 ========================================================================== */
18001477
1801#define Q6_Vub_vmin_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminub)(Vu,Vv)1478#define Q6_Vub_vmin_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminub)(Vu,Vv)
1802#endif /* __HEXAGON_ARCH___ >= 60 */
18031479
1804#if __HVX_ARCH__ >= 60
1805/* ==========================================================================1480/* ==========================================================================
1806 Assembly Syntax: Vd32.uh=vmin(Vu32.uh,Vv32.uh)1481 Assembly Syntax: Vd32.uh=vmin(Vu32.uh,Vv32.uh)
1807 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vmin_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)1482 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vmin_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1810,9 +1485,7 @@...@@ -1810,9 +1485,7 @@
1810 ========================================================================== */1485 ========================================================================== */
18111486
1812#define Q6_Vuh_vmin_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminuh)(Vu,Vv)1487#define Q6_Vuh_vmin_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminuh)(Vu,Vv)
1813#endif /* __HEXAGON_ARCH___ >= 60 */
18141488
1815#if __HVX_ARCH__ >= 60
1816/* ==========================================================================1489/* ==========================================================================
1817 Assembly Syntax: Vd32.w=vmin(Vu32.w,Vv32.w)1490 Assembly Syntax: Vd32.w=vmin(Vu32.w,Vv32.w)
1818 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmin_VwVw(HVX_Vector Vu, HVX_Vector Vv)1491 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmin_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1821,9 +1494,7 @@...@@ -1821,9 +1494,7 @@
1821 ========================================================================== */1494 ========================================================================== */
18221495
1823#define Q6_Vw_vmin_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminw)(Vu,Vv)1496#define Q6_Vw_vmin_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminw)(Vu,Vv)
1824#endif /* __HEXAGON_ARCH___ >= 60 */
18251497
1826#if __HVX_ARCH__ >= 60
1827/* ==========================================================================1498/* ==========================================================================
1828 Assembly Syntax: Vdd32.h=vmpa(Vuu32.ub,Rt32.b)1499 Assembly Syntax: Vdd32.h=vmpa(Vuu32.ub,Rt32.b)
1829 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpa_WubRb(HVX_VectorPair Vuu, Word32 Rt)1500 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpa_WubRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1832,9 +1503,7 @@...@@ -1832,9 +1503,7 @@
1832 ========================================================================== */1503 ========================================================================== */
18331504
1834#define Q6_Wh_vmpa_WubRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabus)(Vuu,Rt)1505#define Q6_Wh_vmpa_WubRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabus)(Vuu,Rt)
1835#endif /* __HEXAGON_ARCH___ >= 60 */
18361506
1837#if __HVX_ARCH__ >= 60
1838/* ==========================================================================1507/* ==========================================================================
1839 Assembly Syntax: Vxx32.h+=vmpa(Vuu32.ub,Rt32.b)1508 Assembly Syntax: Vxx32.h+=vmpa(Vuu32.ub,Rt32.b)
1840 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpaacc_WhWubRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)1509 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpaacc_WhWubRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1843,9 +1512,7 @@...@@ -1843,9 +1512,7 @@
1843 ========================================================================== */1512 ========================================================================== */
18441513
1845#define Q6_Wh_vmpaacc_WhWubRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabus_acc)(Vxx,Vuu,Rt)1514#define Q6_Wh_vmpaacc_WhWubRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabus_acc)(Vxx,Vuu,Rt)
1846#endif /* __HEXAGON_ARCH___ >= 60 */
18471515
1848#if __HVX_ARCH__ >= 60
1849/* ==========================================================================1516/* ==========================================================================
1850 Assembly Syntax: Vdd32.h=vmpa(Vuu32.ub,Vvv32.b)1517 Assembly Syntax: Vdd32.h=vmpa(Vuu32.ub,Vvv32.b)
1851 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpa_WubWb(HVX_VectorPair Vuu, HVX_VectorPair Vvv)1518 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpa_WubWb(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -1854,9 +1521,7 @@...@@ -1854,9 +1521,7 @@
1854 ========================================================================== */1521 ========================================================================== */
18551522
1856#define Q6_Wh_vmpa_WubWb(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabusv)(Vuu,Vvv)1523#define Q6_Wh_vmpa_WubWb(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabusv)(Vuu,Vvv)
1857#endif /* __HEXAGON_ARCH___ >= 60 */
18581524
1859#if __HVX_ARCH__ >= 60
1860/* ==========================================================================1525/* ==========================================================================
1861 Assembly Syntax: Vdd32.h=vmpa(Vuu32.ub,Vvv32.ub)1526 Assembly Syntax: Vdd32.h=vmpa(Vuu32.ub,Vvv32.ub)
1862 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpa_WubWub(HVX_VectorPair Vuu, HVX_VectorPair Vvv)1527 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpa_WubWub(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -1865,9 +1530,7 @@...@@ -1865,9 +1530,7 @@
1865 ========================================================================== */1530 ========================================================================== */
18661531
1867#define Q6_Wh_vmpa_WubWub(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabuuv)(Vuu,Vvv)1532#define Q6_Wh_vmpa_WubWub(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabuuv)(Vuu,Vvv)
1868#endif /* __HEXAGON_ARCH___ >= 60 */
18691533
1870#if __HVX_ARCH__ >= 60
1871/* ==========================================================================1534/* ==========================================================================
1872 Assembly Syntax: Vdd32.w=vmpa(Vuu32.h,Rt32.b)1535 Assembly Syntax: Vdd32.w=vmpa(Vuu32.h,Rt32.b)
1873 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpa_WhRb(HVX_VectorPair Vuu, Word32 Rt)1536 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpa_WhRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -1876,9 +1539,7 @@...@@ -1876,9 +1539,7 @@
1876 ========================================================================== */1539 ========================================================================== */
18771540
1878#define Q6_Ww_vmpa_WhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpahb)(Vuu,Rt)1541#define Q6_Ww_vmpa_WhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpahb)(Vuu,Rt)
1879#endif /* __HEXAGON_ARCH___ >= 60 */
18801542
1881#if __HVX_ARCH__ >= 60
1882/* ==========================================================================1543/* ==========================================================================
1883 Assembly Syntax: Vxx32.w+=vmpa(Vuu32.h,Rt32.b)1544 Assembly Syntax: Vxx32.w+=vmpa(Vuu32.h,Rt32.b)
1884 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpaacc_WwWhRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)1545 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpaacc_WwWhRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -1887,9 +1548,7 @@...@@ -1887,9 +1548,7 @@
1887 ========================================================================== */1548 ========================================================================== */
18881549
1889#define Q6_Ww_vmpaacc_WwWhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpahb_acc)(Vxx,Vuu,Rt)1550#define Q6_Ww_vmpaacc_WwWhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpahb_acc)(Vxx,Vuu,Rt)
1890#endif /* __HEXAGON_ARCH___ >= 60 */
18911551
1892#if __HVX_ARCH__ >= 60
1893/* ==========================================================================1552/* ==========================================================================
1894 Assembly Syntax: Vdd32.h=vmpy(Vu32.ub,Rt32.b)1553 Assembly Syntax: Vdd32.h=vmpy(Vu32.ub,Rt32.b)
1895 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpy_VubRb(HVX_Vector Vu, Word32 Rt)1554 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpy_VubRb(HVX_Vector Vu, Word32 Rt)
...@@ -1898,9 +1557,7 @@...@@ -1898,9 +1557,7 @@
1898 ========================================================================== */1557 ========================================================================== */
18991558
1900#define Q6_Wh_vmpy_VubRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybus)(Vu,Rt)1559#define Q6_Wh_vmpy_VubRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybus)(Vu,Rt)
1901#endif /* __HEXAGON_ARCH___ >= 60 */
19021560
1903#if __HVX_ARCH__ >= 60
1904/* ==========================================================================1561/* ==========================================================================
1905 Assembly Syntax: Vxx32.h+=vmpy(Vu32.ub,Rt32.b)1562 Assembly Syntax: Vxx32.h+=vmpy(Vu32.ub,Rt32.b)
1906 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpyacc_WhVubRb(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)1563 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpyacc_WhVubRb(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)
...@@ -1909,9 +1566,7 @@...@@ -1909,9 +1566,7 @@
1909 ========================================================================== */1566 ========================================================================== */
19101567
1911#define Q6_Wh_vmpyacc_WhVubRb(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybus_acc)(Vxx,Vu,Rt)1568#define Q6_Wh_vmpyacc_WhVubRb(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybus_acc)(Vxx,Vu,Rt)
1912#endif /* __HEXAGON_ARCH___ >= 60 */
19131569
1914#if __HVX_ARCH__ >= 60
1915/* ==========================================================================1570/* ==========================================================================
1916 Assembly Syntax: Vdd32.h=vmpy(Vu32.ub,Vv32.b)1571 Assembly Syntax: Vdd32.h=vmpy(Vu32.ub,Vv32.b)
1917 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpy_VubVb(HVX_Vector Vu, HVX_Vector Vv)1572 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpy_VubVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1920,9 +1575,7 @@...@@ -1920,9 +1575,7 @@
1920 ========================================================================== */1575 ========================================================================== */
19211576
1922#define Q6_Wh_vmpy_VubVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybusv)(Vu,Vv)1577#define Q6_Wh_vmpy_VubVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybusv)(Vu,Vv)
1923#endif /* __HEXAGON_ARCH___ >= 60 */
19241578
1925#if __HVX_ARCH__ >= 60
1926/* ==========================================================================1579/* ==========================================================================
1927 Assembly Syntax: Vxx32.h+=vmpy(Vu32.ub,Vv32.b)1580 Assembly Syntax: Vxx32.h+=vmpy(Vu32.ub,Vv32.b)
1928 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpyacc_WhVubVb(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)1581 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpyacc_WhVubVb(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1931,9 +1584,7 @@...@@ -1931,9 +1584,7 @@
1931 ========================================================================== */1584 ========================================================================== */
19321585
1933#define Q6_Wh_vmpyacc_WhVubVb(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybusv_acc)(Vxx,Vu,Vv)1586#define Q6_Wh_vmpyacc_WhVubVb(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybusv_acc)(Vxx,Vu,Vv)
1934#endif /* __HEXAGON_ARCH___ >= 60 */
19351587
1936#if __HVX_ARCH__ >= 60
1937/* ==========================================================================1588/* ==========================================================================
1938 Assembly Syntax: Vdd32.h=vmpy(Vu32.b,Vv32.b)1589 Assembly Syntax: Vdd32.h=vmpy(Vu32.b,Vv32.b)
1939 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpy_VbVb(HVX_Vector Vu, HVX_Vector Vv)1590 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpy_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1942,9 +1593,7 @@...@@ -1942,9 +1593,7 @@
1942 ========================================================================== */1593 ========================================================================== */
19431594
1944#define Q6_Wh_vmpy_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybv)(Vu,Vv)1595#define Q6_Wh_vmpy_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybv)(Vu,Vv)
1945#endif /* __HEXAGON_ARCH___ >= 60 */
19461596
1947#if __HVX_ARCH__ >= 60
1948/* ==========================================================================1597/* ==========================================================================
1949 Assembly Syntax: Vxx32.h+=vmpy(Vu32.b,Vv32.b)1598 Assembly Syntax: Vxx32.h+=vmpy(Vu32.b,Vv32.b)
1950 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpyacc_WhVbVb(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)1599 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vmpyacc_WhVbVb(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -1953,9 +1602,7 @@...@@ -1953,9 +1602,7 @@
1953 ========================================================================== */1602 ========================================================================== */
19541603
1955#define Q6_Wh_vmpyacc_WhVbVb(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybv_acc)(Vxx,Vu,Vv)1604#define Q6_Wh_vmpyacc_WhVbVb(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpybv_acc)(Vxx,Vu,Vv)
1956#endif /* __HEXAGON_ARCH___ >= 60 */
19571605
1958#if __HVX_ARCH__ >= 60
1959/* ==========================================================================1606/* ==========================================================================
1960 Assembly Syntax: Vd32.w=vmpye(Vu32.w,Vv32.uh)1607 Assembly Syntax: Vd32.w=vmpye(Vu32.w,Vv32.uh)
1961 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpye_VwVuh(HVX_Vector Vu, HVX_Vector Vv)1608 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpye_VwVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -1964,9 +1611,7 @@...@@ -1964,9 +1611,7 @@
1964 ========================================================================== */1611 ========================================================================== */
19651612
1966#define Q6_Vw_vmpye_VwVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyewuh)(Vu,Vv)1613#define Q6_Vw_vmpye_VwVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyewuh)(Vu,Vv)
1967#endif /* __HEXAGON_ARCH___ >= 60 */
19681614
1969#if __HVX_ARCH__ >= 60
1970/* ==========================================================================1615/* ==========================================================================
1971 Assembly Syntax: Vdd32.w=vmpy(Vu32.h,Rt32.h)1616 Assembly Syntax: Vdd32.w=vmpy(Vu32.h,Rt32.h)
1972 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpy_VhRh(HVX_Vector Vu, Word32 Rt)1617 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpy_VhRh(HVX_Vector Vu, Word32 Rt)
...@@ -1975,9 +1620,7 @@...@@ -1975,9 +1620,7 @@
1975 ========================================================================== */1620 ========================================================================== */
19761621
1977#define Q6_Ww_vmpy_VhRh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyh)(Vu,Rt)1622#define Q6_Ww_vmpy_VhRh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyh)(Vu,Rt)
1978#endif /* __HEXAGON_ARCH___ >= 60 */
19791623
1980#if __HVX_ARCH__ >= 60
1981/* ==========================================================================1624/* ==========================================================================
1982 Assembly Syntax: Vxx32.w+=vmpy(Vu32.h,Rt32.h):sat1625 Assembly Syntax: Vxx32.w+=vmpy(Vu32.h,Rt32.h):sat
1983 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpyacc_WwVhRh_sat(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)1626 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpyacc_WwVhRh_sat(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)
...@@ -1986,9 +1629,7 @@...@@ -1986,9 +1629,7 @@
1986 ========================================================================== */1629 ========================================================================== */
19871630
1988#define Q6_Ww_vmpyacc_WwVhRh_sat(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhsat_acc)(Vxx,Vu,Rt)1631#define Q6_Ww_vmpyacc_WwVhRh_sat(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhsat_acc)(Vxx,Vu,Rt)
1989#endif /* __HEXAGON_ARCH___ >= 60 */
19901632
1991#if __HVX_ARCH__ >= 60
1992/* ==========================================================================1633/* ==========================================================================
1993 Assembly Syntax: Vd32.h=vmpy(Vu32.h,Rt32.h):<<1:rnd:sat1634 Assembly Syntax: Vd32.h=vmpy(Vu32.h,Rt32.h):<<1:rnd:sat
1994 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpy_VhRh_s1_rnd_sat(HVX_Vector Vu, Word32 Rt)1635 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpy_VhRh_s1_rnd_sat(HVX_Vector Vu, Word32 Rt)
...@@ -1997,9 +1638,7 @@...@@ -1997,9 +1638,7 @@
1997 ========================================================================== */1638 ========================================================================== */
19981639
1999#define Q6_Vh_vmpy_VhRh_s1_rnd_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhsrs)(Vu,Rt)1640#define Q6_Vh_vmpy_VhRh_s1_rnd_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhsrs)(Vu,Rt)
2000#endif /* __HEXAGON_ARCH___ >= 60 */
20011641
2002#if __HVX_ARCH__ >= 60
2003/* ==========================================================================1642/* ==========================================================================
2004 Assembly Syntax: Vd32.h=vmpy(Vu32.h,Rt32.h):<<1:sat1643 Assembly Syntax: Vd32.h=vmpy(Vu32.h,Rt32.h):<<1:sat
2005 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpy_VhRh_s1_sat(HVX_Vector Vu, Word32 Rt)1644 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpy_VhRh_s1_sat(HVX_Vector Vu, Word32 Rt)
...@@ -2008,9 +1647,7 @@...@@ -2008,9 +1647,7 @@
2008 ========================================================================== */1647 ========================================================================== */
20091648
2010#define Q6_Vh_vmpy_VhRh_s1_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhss)(Vu,Rt)1649#define Q6_Vh_vmpy_VhRh_s1_sat(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhss)(Vu,Rt)
2011#endif /* __HEXAGON_ARCH___ >= 60 */
20121650
2013#if __HVX_ARCH__ >= 60
2014/* ==========================================================================1651/* ==========================================================================
2015 Assembly Syntax: Vdd32.w=vmpy(Vu32.h,Vv32.uh)1652 Assembly Syntax: Vdd32.w=vmpy(Vu32.h,Vv32.uh)
2016 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpy_VhVuh(HVX_Vector Vu, HVX_Vector Vv)1653 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpy_VhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2019,9 +1656,7 @@...@@ -2019,9 +1656,7 @@
2019 ========================================================================== */1656 ========================================================================== */
20201657
2021#define Q6_Ww_vmpy_VhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhus)(Vu,Vv)1658#define Q6_Ww_vmpy_VhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhus)(Vu,Vv)
2022#endif /* __HEXAGON_ARCH___ >= 60 */
20231659
2024#if __HVX_ARCH__ >= 60
2025/* ==========================================================================1660/* ==========================================================================
2026 Assembly Syntax: Vxx32.w+=vmpy(Vu32.h,Vv32.uh)1661 Assembly Syntax: Vxx32.w+=vmpy(Vu32.h,Vv32.uh)
2027 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpyacc_WwVhVuh(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)1662 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpyacc_WwVhVuh(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2030,9 +1665,7 @@...@@ -2030,9 +1665,7 @@
2030 ========================================================================== */1665 ========================================================================== */
20311666
2032#define Q6_Ww_vmpyacc_WwVhVuh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhus_acc)(Vxx,Vu,Vv)1667#define Q6_Ww_vmpyacc_WwVhVuh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhus_acc)(Vxx,Vu,Vv)
2033#endif /* __HEXAGON_ARCH___ >= 60 */
20341668
2035#if __HVX_ARCH__ >= 60
2036/* ==========================================================================1669/* ==========================================================================
2037 Assembly Syntax: Vdd32.w=vmpy(Vu32.h,Vv32.h)1670 Assembly Syntax: Vdd32.w=vmpy(Vu32.h,Vv32.h)
2038 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpy_VhVh(HVX_Vector Vu, HVX_Vector Vv)1671 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpy_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2041,9 +1674,7 @@...@@ -2041,9 +1674,7 @@
2041 ========================================================================== */1674 ========================================================================== */
20421675
2043#define Q6_Ww_vmpy_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhv)(Vu,Vv)1676#define Q6_Ww_vmpy_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhv)(Vu,Vv)
2044#endif /* __HEXAGON_ARCH___ >= 60 */
20451677
2046#if __HVX_ARCH__ >= 60
2047/* ==========================================================================1678/* ==========================================================================
2048 Assembly Syntax: Vxx32.w+=vmpy(Vu32.h,Vv32.h)1679 Assembly Syntax: Vxx32.w+=vmpy(Vu32.h,Vv32.h)
2049 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpyacc_WwVhVh(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)1680 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vmpyacc_WwVhVh(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2052,9 +1683,7 @@...@@ -2052,9 +1683,7 @@
2052 ========================================================================== */1683 ========================================================================== */
20531684
2054#define Q6_Ww_vmpyacc_WwVhVh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhv_acc)(Vxx,Vu,Vv)1685#define Q6_Ww_vmpyacc_WwVhVh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhv_acc)(Vxx,Vu,Vv)
2055#endif /* __HEXAGON_ARCH___ >= 60 */
20561686
2057#if __HVX_ARCH__ >= 60
2058/* ==========================================================================1687/* ==========================================================================
2059 Assembly Syntax: Vd32.h=vmpy(Vu32.h,Vv32.h):<<1:rnd:sat1688 Assembly Syntax: Vd32.h=vmpy(Vu32.h,Vv32.h):<<1:rnd:sat
2060 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpy_VhVh_s1_rnd_sat(HVX_Vector Vu, HVX_Vector Vv)1689 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpy_VhVh_s1_rnd_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2063,9 +1692,7 @@...@@ -2063,9 +1692,7 @@
2063 ========================================================================== */1692 ========================================================================== */
20641693
2065#define Q6_Vh_vmpy_VhVh_s1_rnd_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhvsrs)(Vu,Vv)1694#define Q6_Vh_vmpy_VhVh_s1_rnd_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyhvsrs)(Vu,Vv)
2066#endif /* __HEXAGON_ARCH___ >= 60 */
20671695
2068#if __HVX_ARCH__ >= 60
2069/* ==========================================================================1696/* ==========================================================================
2070 Assembly Syntax: Vd32.w=vmpyieo(Vu32.h,Vv32.h)1697 Assembly Syntax: Vd32.w=vmpyieo(Vu32.h,Vv32.h)
2071 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyieo_VhVh(HVX_Vector Vu, HVX_Vector Vv)1698 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyieo_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2074,9 +1701,7 @@...@@ -2074,9 +1701,7 @@
2074 ========================================================================== */1701 ========================================================================== */
20751702
2076#define Q6_Vw_vmpyieo_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyieoh)(Vu,Vv)1703#define Q6_Vw_vmpyieo_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyieoh)(Vu,Vv)
2077#endif /* __HEXAGON_ARCH___ >= 60 */
20781704
2079#if __HVX_ARCH__ >= 60
2080/* ==========================================================================1705/* ==========================================================================
2081 Assembly Syntax: Vx32.w+=vmpyie(Vu32.w,Vv32.h)1706 Assembly Syntax: Vx32.w+=vmpyie(Vu32.w,Vv32.h)
2082 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyieacc_VwVwVh(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)1707 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyieacc_VwVwVh(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2085,9 +1710,7 @@...@@ -2085,9 +1710,7 @@
2085 ========================================================================== */1710 ========================================================================== */
20861711
2087#define Q6_Vw_vmpyieacc_VwVwVh(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiewh_acc)(Vx,Vu,Vv)1712#define Q6_Vw_vmpyieacc_VwVwVh(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiewh_acc)(Vx,Vu,Vv)
2088#endif /* __HEXAGON_ARCH___ >= 60 */
20891713
2090#if __HVX_ARCH__ >= 60
2091/* ==========================================================================1714/* ==========================================================================
2092 Assembly Syntax: Vd32.w=vmpyie(Vu32.w,Vv32.uh)1715 Assembly Syntax: Vd32.w=vmpyie(Vu32.w,Vv32.uh)
2093 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyie_VwVuh(HVX_Vector Vu, HVX_Vector Vv)1716 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyie_VwVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2096,9 +1719,7 @@...@@ -2096,9 +1719,7 @@
2096 ========================================================================== */1719 ========================================================================== */
20971720
2098#define Q6_Vw_vmpyie_VwVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiewuh)(Vu,Vv)1721#define Q6_Vw_vmpyie_VwVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiewuh)(Vu,Vv)
2099#endif /* __HEXAGON_ARCH___ >= 60 */
21001722
2101#if __HVX_ARCH__ >= 60
2102/* ==========================================================================1723/* ==========================================================================
2103 Assembly Syntax: Vx32.w+=vmpyie(Vu32.w,Vv32.uh)1724 Assembly Syntax: Vx32.w+=vmpyie(Vu32.w,Vv32.uh)
2104 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyieacc_VwVwVuh(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)1725 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyieacc_VwVwVuh(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2107,9 +1728,7 @@...@@ -2107,9 +1728,7 @@
2107 ========================================================================== */1728 ========================================================================== */
21081729
2109#define Q6_Vw_vmpyieacc_VwVwVuh(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiewuh_acc)(Vx,Vu,Vv)1730#define Q6_Vw_vmpyieacc_VwVwVuh(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiewuh_acc)(Vx,Vu,Vv)
2110#endif /* __HEXAGON_ARCH___ >= 60 */
21111731
2112#if __HVX_ARCH__ >= 60
2113/* ==========================================================================1732/* ==========================================================================
2114 Assembly Syntax: Vd32.h=vmpyi(Vu32.h,Vv32.h)1733 Assembly Syntax: Vd32.h=vmpyi(Vu32.h,Vv32.h)
2115 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyi_VhVh(HVX_Vector Vu, HVX_Vector Vv)1734 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyi_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2118,9 +1737,7 @@...@@ -2118,9 +1737,7 @@
2118 ========================================================================== */1737 ========================================================================== */
21191738
2120#define Q6_Vh_vmpyi_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyih)(Vu,Vv)1739#define Q6_Vh_vmpyi_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyih)(Vu,Vv)
2121#endif /* __HEXAGON_ARCH___ >= 60 */
21221740
2123#if __HVX_ARCH__ >= 60
2124/* ==========================================================================1741/* ==========================================================================
2125 Assembly Syntax: Vx32.h+=vmpyi(Vu32.h,Vv32.h)1742 Assembly Syntax: Vx32.h+=vmpyi(Vu32.h,Vv32.h)
2126 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyiacc_VhVhVh(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)1743 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyiacc_VhVhVh(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2129,9 +1746,7 @@...@@ -2129,9 +1746,7 @@
2129 ========================================================================== */1746 ========================================================================== */
21301747
2131#define Q6_Vh_vmpyiacc_VhVhVh(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyih_acc)(Vx,Vu,Vv)1748#define Q6_Vh_vmpyiacc_VhVhVh(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyih_acc)(Vx,Vu,Vv)
2132#endif /* __HEXAGON_ARCH___ >= 60 */
21331749
2134#if __HVX_ARCH__ >= 60
2135/* ==========================================================================1750/* ==========================================================================
2136 Assembly Syntax: Vd32.h=vmpyi(Vu32.h,Rt32.b)1751 Assembly Syntax: Vd32.h=vmpyi(Vu32.h,Rt32.b)
2137 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyi_VhRb(HVX_Vector Vu, Word32 Rt)1752 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyi_VhRb(HVX_Vector Vu, Word32 Rt)
...@@ -2140,9 +1755,7 @@...@@ -2140,9 +1755,7 @@
2140 ========================================================================== */1755 ========================================================================== */
21411756
2142#define Q6_Vh_vmpyi_VhRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyihb)(Vu,Rt)1757#define Q6_Vh_vmpyi_VhRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyihb)(Vu,Rt)
2143#endif /* __HEXAGON_ARCH___ >= 60 */
21441758
2145#if __HVX_ARCH__ >= 60
2146/* ==========================================================================1759/* ==========================================================================
2147 Assembly Syntax: Vx32.h+=vmpyi(Vu32.h,Rt32.b)1760 Assembly Syntax: Vx32.h+=vmpyi(Vu32.h,Rt32.b)
2148 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyiacc_VhVhRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)1761 C Intrinsic Prototype: HVX_Vector Q6_Vh_vmpyiacc_VhVhRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -2151,9 +1764,7 @@...@@ -2151,9 +1764,7 @@
2151 ========================================================================== */1764 ========================================================================== */
21521765
2153#define Q6_Vh_vmpyiacc_VhVhRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyihb_acc)(Vx,Vu,Rt)1766#define Q6_Vh_vmpyiacc_VhVhRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyihb_acc)(Vx,Vu,Rt)
2154#endif /* __HEXAGON_ARCH___ >= 60 */
21551767
2156#if __HVX_ARCH__ >= 60
2157/* ==========================================================================1768/* ==========================================================================
2158 Assembly Syntax: Vd32.w=vmpyio(Vu32.w,Vv32.h)1769 Assembly Syntax: Vd32.w=vmpyio(Vu32.w,Vv32.h)
2159 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyio_VwVh(HVX_Vector Vu, HVX_Vector Vv)1770 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyio_VwVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2162,9 +1773,7 @@...@@ -2162,9 +1773,7 @@
2162 ========================================================================== */1773 ========================================================================== */
21631774
2164#define Q6_Vw_vmpyio_VwVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiowh)(Vu,Vv)1775#define Q6_Vw_vmpyio_VwVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiowh)(Vu,Vv)
2165#endif /* __HEXAGON_ARCH___ >= 60 */
21661776
2167#if __HVX_ARCH__ >= 60
2168/* ==========================================================================1777/* ==========================================================================
2169 Assembly Syntax: Vd32.w=vmpyi(Vu32.w,Rt32.b)1778 Assembly Syntax: Vd32.w=vmpyi(Vu32.w,Rt32.b)
2170 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyi_VwRb(HVX_Vector Vu, Word32 Rt)1779 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyi_VwRb(HVX_Vector Vu, Word32 Rt)
...@@ -2173,9 +1782,7 @@...@@ -2173,9 +1782,7 @@
2173 ========================================================================== */1782 ========================================================================== */
21741783
2175#define Q6_Vw_vmpyi_VwRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwb)(Vu,Rt)1784#define Q6_Vw_vmpyi_VwRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwb)(Vu,Rt)
2176#endif /* __HEXAGON_ARCH___ >= 60 */
21771785
2178#if __HVX_ARCH__ >= 60
2179/* ==========================================================================1786/* ==========================================================================
2180 Assembly Syntax: Vx32.w+=vmpyi(Vu32.w,Rt32.b)1787 Assembly Syntax: Vx32.w+=vmpyi(Vu32.w,Rt32.b)
2181 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyiacc_VwVwRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)1788 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyiacc_VwVwRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -2184,9 +1791,7 @@...@@ -2184,9 +1791,7 @@
2184 ========================================================================== */1791 ========================================================================== */
21851792
2186#define Q6_Vw_vmpyiacc_VwVwRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwb_acc)(Vx,Vu,Rt)1793#define Q6_Vw_vmpyiacc_VwVwRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwb_acc)(Vx,Vu,Rt)
2187#endif /* __HEXAGON_ARCH___ >= 60 */
21881794
2189#if __HVX_ARCH__ >= 60
2190/* ==========================================================================1795/* ==========================================================================
2191 Assembly Syntax: Vd32.w=vmpyi(Vu32.w,Rt32.h)1796 Assembly Syntax: Vd32.w=vmpyi(Vu32.w,Rt32.h)
2192 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyi_VwRh(HVX_Vector Vu, Word32 Rt)1797 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyi_VwRh(HVX_Vector Vu, Word32 Rt)
...@@ -2195,9 +1800,7 @@...@@ -2195,9 +1800,7 @@
2195 ========================================================================== */1800 ========================================================================== */
21961801
2197#define Q6_Vw_vmpyi_VwRh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwh)(Vu,Rt)1802#define Q6_Vw_vmpyi_VwRh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwh)(Vu,Rt)
2198#endif /* __HEXAGON_ARCH___ >= 60 */
21991803
2200#if __HVX_ARCH__ >= 60
2201/* ==========================================================================1804/* ==========================================================================
2202 Assembly Syntax: Vx32.w+=vmpyi(Vu32.w,Rt32.h)1805 Assembly Syntax: Vx32.w+=vmpyi(Vu32.w,Rt32.h)
2203 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyiacc_VwVwRh(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)1806 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyiacc_VwVwRh(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -2206,9 +1809,7 @@...@@ -2206,9 +1809,7 @@
2206 ========================================================================== */1809 ========================================================================== */
22071810
2208#define Q6_Vw_vmpyiacc_VwVwRh(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwh_acc)(Vx,Vu,Rt)1811#define Q6_Vw_vmpyiacc_VwVwRh(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwh_acc)(Vx,Vu,Rt)
2209#endif /* __HEXAGON_ARCH___ >= 60 */
22101812
2211#if __HVX_ARCH__ >= 60
2212/* ==========================================================================1813/* ==========================================================================
2213 Assembly Syntax: Vd32.w=vmpyo(Vu32.w,Vv32.h):<<1:sat1814 Assembly Syntax: Vd32.w=vmpyo(Vu32.w,Vv32.h):<<1:sat
2214 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyo_VwVh_s1_sat(HVX_Vector Vu, HVX_Vector Vv)1815 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyo_VwVh_s1_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2217,9 +1818,7 @@...@@ -2217,9 +1818,7 @@
2217 ========================================================================== */1818 ========================================================================== */
22181819
2219#define Q6_Vw_vmpyo_VwVh_s1_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh)(Vu,Vv)1820#define Q6_Vw_vmpyo_VwVh_s1_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh)(Vu,Vv)
2220#endif /* __HEXAGON_ARCH___ >= 60 */
22211821
2222#if __HVX_ARCH__ >= 60
2223/* ==========================================================================1822/* ==========================================================================
2224 Assembly Syntax: Vd32.w=vmpyo(Vu32.w,Vv32.h):<<1:rnd:sat1823 Assembly Syntax: Vd32.w=vmpyo(Vu32.w,Vv32.h):<<1:rnd:sat
2225 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyo_VwVh_s1_rnd_sat(HVX_Vector Vu, HVX_Vector Vv)1824 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyo_VwVh_s1_rnd_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2228,9 +1827,7 @@...@@ -2228,9 +1827,7 @@
2228 ========================================================================== */1827 ========================================================================== */
22291828
2230#define Q6_Vw_vmpyo_VwVh_s1_rnd_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_rnd)(Vu,Vv)1829#define Q6_Vw_vmpyo_VwVh_s1_rnd_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_rnd)(Vu,Vv)
2231#endif /* __HEXAGON_ARCH___ >= 60 */
22321830
2233#if __HVX_ARCH__ >= 60
2234/* ==========================================================================1831/* ==========================================================================
2235 Assembly Syntax: Vx32.w+=vmpyo(Vu32.w,Vv32.h):<<1:rnd:sat:shift1832 Assembly Syntax: Vx32.w+=vmpyo(Vu32.w,Vv32.h):<<1:rnd:sat:shift
2236 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyoacc_VwVwVh_s1_rnd_sat_shift(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)1833 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyoacc_VwVwVh_s1_rnd_sat_shift(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2239,9 +1836,7 @@...@@ -2239,9 +1836,7 @@
2239 ========================================================================== */1836 ========================================================================== */
22401837
2241#define Q6_Vw_vmpyoacc_VwVwVh_s1_rnd_sat_shift(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_rnd_sacc)(Vx,Vu,Vv)1838#define Q6_Vw_vmpyoacc_VwVwVh_s1_rnd_sat_shift(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_rnd_sacc)(Vx,Vu,Vv)
2242#endif /* __HEXAGON_ARCH___ >= 60 */
22431839
2244#if __HVX_ARCH__ >= 60
2245/* ==========================================================================1840/* ==========================================================================
2246 Assembly Syntax: Vx32.w+=vmpyo(Vu32.w,Vv32.h):<<1:sat:shift1841 Assembly Syntax: Vx32.w+=vmpyo(Vu32.w,Vv32.h):<<1:sat:shift
2247 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyoacc_VwVwVh_s1_sat_shift(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)1842 C Intrinsic Prototype: HVX_Vector Q6_Vw_vmpyoacc_VwVwVh_s1_sat_shift(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2250,9 +1845,7 @@...@@ -2250,9 +1845,7 @@
2250 ========================================================================== */1845 ========================================================================== */
22511846
2252#define Q6_Vw_vmpyoacc_VwVwVh_s1_sat_shift(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_sacc)(Vx,Vu,Vv)1847#define Q6_Vw_vmpyoacc_VwVwVh_s1_sat_shift(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_sacc)(Vx,Vu,Vv)
2253#endif /* __HEXAGON_ARCH___ >= 60 */
22541848
2255#if __HVX_ARCH__ >= 60
2256/* ==========================================================================1849/* ==========================================================================
2257 Assembly Syntax: Vdd32.uh=vmpy(Vu32.ub,Rt32.ub)1850 Assembly Syntax: Vdd32.uh=vmpy(Vu32.ub,Rt32.ub)
2258 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpy_VubRub(HVX_Vector Vu, Word32 Rt)1851 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpy_VubRub(HVX_Vector Vu, Word32 Rt)
...@@ -2261,9 +1854,7 @@...@@ -2261,9 +1854,7 @@
2261 ========================================================================== */1854 ========================================================================== */
22621855
2263#define Q6_Wuh_vmpy_VubRub(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyub)(Vu,Rt)1856#define Q6_Wuh_vmpy_VubRub(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyub)(Vu,Rt)
2264#endif /* __HEXAGON_ARCH___ >= 60 */
22651857
2266#if __HVX_ARCH__ >= 60
2267/* ==========================================================================1858/* ==========================================================================
2268 Assembly Syntax: Vxx32.uh+=vmpy(Vu32.ub,Rt32.ub)1859 Assembly Syntax: Vxx32.uh+=vmpy(Vu32.ub,Rt32.ub)
2269 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpyacc_WuhVubRub(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)1860 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpyacc_WuhVubRub(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)
...@@ -2272,9 +1863,7 @@...@@ -2272,9 +1863,7 @@
2272 ========================================================================== */1863 ========================================================================== */
22731864
2274#define Q6_Wuh_vmpyacc_WuhVubRub(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyub_acc)(Vxx,Vu,Rt)1865#define Q6_Wuh_vmpyacc_WuhVubRub(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyub_acc)(Vxx,Vu,Rt)
2275#endif /* __HEXAGON_ARCH___ >= 60 */
22761866
2277#if __HVX_ARCH__ >= 60
2278/* ==========================================================================1867/* ==========================================================================
2279 Assembly Syntax: Vdd32.uh=vmpy(Vu32.ub,Vv32.ub)1868 Assembly Syntax: Vdd32.uh=vmpy(Vu32.ub,Vv32.ub)
2280 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpy_VubVub(HVX_Vector Vu, HVX_Vector Vv)1869 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpy_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2283,9 +1872,7 @@...@@ -2283,9 +1872,7 @@
2283 ========================================================================== */1872 ========================================================================== */
22841873
2285#define Q6_Wuh_vmpy_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyubv)(Vu,Vv)1874#define Q6_Wuh_vmpy_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyubv)(Vu,Vv)
2286#endif /* __HEXAGON_ARCH___ >= 60 */
22871875
2288#if __HVX_ARCH__ >= 60
2289/* ==========================================================================1876/* ==========================================================================
2290 Assembly Syntax: Vxx32.uh+=vmpy(Vu32.ub,Vv32.ub)1877 Assembly Syntax: Vxx32.uh+=vmpy(Vu32.ub,Vv32.ub)
2291 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpyacc_WuhVubVub(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)1878 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vmpyacc_WuhVubVub(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2294,9 +1881,7 @@...@@ -2294,9 +1881,7 @@
2294 ========================================================================== */1881 ========================================================================== */
22951882
2296#define Q6_Wuh_vmpyacc_WuhVubVub(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyubv_acc)(Vxx,Vu,Vv)1883#define Q6_Wuh_vmpyacc_WuhVubVub(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyubv_acc)(Vxx,Vu,Vv)
2297#endif /* __HEXAGON_ARCH___ >= 60 */
22981884
2299#if __HVX_ARCH__ >= 60
2300/* ==========================================================================1885/* ==========================================================================
2301 Assembly Syntax: Vdd32.uw=vmpy(Vu32.uh,Rt32.uh)1886 Assembly Syntax: Vdd32.uw=vmpy(Vu32.uh,Rt32.uh)
2302 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpy_VuhRuh(HVX_Vector Vu, Word32 Rt)1887 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpy_VuhRuh(HVX_Vector Vu, Word32 Rt)
...@@ -2305,9 +1890,7 @@...@@ -2305,9 +1890,7 @@
2305 ========================================================================== */1890 ========================================================================== */
23061891
2307#define Q6_Wuw_vmpy_VuhRuh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuh)(Vu,Rt)1892#define Q6_Wuw_vmpy_VuhRuh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuh)(Vu,Rt)
2308#endif /* __HEXAGON_ARCH___ >= 60 */
23091893
2310#if __HVX_ARCH__ >= 60
2311/* ==========================================================================1894/* ==========================================================================
2312 Assembly Syntax: Vxx32.uw+=vmpy(Vu32.uh,Rt32.uh)1895 Assembly Syntax: Vxx32.uw+=vmpy(Vu32.uh,Rt32.uh)
2313 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpyacc_WuwVuhRuh(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)1896 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpyacc_WuwVuhRuh(HVX_VectorPair Vxx, HVX_Vector Vu, Word32 Rt)
...@@ -2316,9 +1899,7 @@...@@ -2316,9 +1899,7 @@
2316 ========================================================================== */1899 ========================================================================== */
23171900
2318#define Q6_Wuw_vmpyacc_WuwVuhRuh(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuh_acc)(Vxx,Vu,Rt)1901#define Q6_Wuw_vmpyacc_WuwVuhRuh(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuh_acc)(Vxx,Vu,Rt)
2319#endif /* __HEXAGON_ARCH___ >= 60 */
23201902
2321#if __HVX_ARCH__ >= 60
2322/* ==========================================================================1903/* ==========================================================================
2323 Assembly Syntax: Vdd32.uw=vmpy(Vu32.uh,Vv32.uh)1904 Assembly Syntax: Vdd32.uw=vmpy(Vu32.uh,Vv32.uh)
2324 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpy_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)1905 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpy_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2327,9 +1908,7 @@...@@ -2327,9 +1908,7 @@
2327 ========================================================================== */1908 ========================================================================== */
23281909
2329#define Q6_Wuw_vmpy_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhv)(Vu,Vv)1910#define Q6_Wuw_vmpy_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhv)(Vu,Vv)
2330#endif /* __HEXAGON_ARCH___ >= 60 */
23311911
2332#if __HVX_ARCH__ >= 60
2333/* ==========================================================================1912/* ==========================================================================
2334 Assembly Syntax: Vxx32.uw+=vmpy(Vu32.uh,Vv32.uh)1913 Assembly Syntax: Vxx32.uw+=vmpy(Vu32.uh,Vv32.uh)
2335 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpyacc_WuwVuhVuh(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)1914 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vmpyacc_WuwVuhVuh(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2338,9 +1917,7 @@...@@ -2338,9 +1917,7 @@
2338 ========================================================================== */1917 ========================================================================== */
23391918
2340#define Q6_Wuw_vmpyacc_WuwVuhVuh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhv_acc)(Vxx,Vu,Vv)1919#define Q6_Wuw_vmpyacc_WuwVuhVuh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhv_acc)(Vxx,Vu,Vv)
2341#endif /* __HEXAGON_ARCH___ >= 60 */
23421920
2343#if __HVX_ARCH__ >= 60
2344/* ==========================================================================1921/* ==========================================================================
2345 Assembly Syntax: Vd32=vmux(Qt4,Vu32,Vv32)1922 Assembly Syntax: Vd32=vmux(Qt4,Vu32,Vv32)
2346 C Intrinsic Prototype: HVX_Vector Q6_V_vmux_QVV(HVX_VectorPred Qt, HVX_Vector Vu, HVX_Vector Vv)1923 C Intrinsic Prototype: HVX_Vector Q6_V_vmux_QVV(HVX_VectorPred Qt, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2349,9 +1926,7 @@...@@ -2349,9 +1926,7 @@
2349 ========================================================================== */1926 ========================================================================== */
23501927
2351#define Q6_V_vmux_QVV(Qt,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmux)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1),Vu,Vv)1928#define Q6_V_vmux_QVV(Qt,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmux)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1),Vu,Vv)
2352#endif /* __HEXAGON_ARCH___ >= 60 */
23531929
2354#if __HVX_ARCH__ >= 60
2355/* ==========================================================================1930/* ==========================================================================
2356 Assembly Syntax: Vd32.h=vnavg(Vu32.h,Vv32.h)1931 Assembly Syntax: Vd32.h=vnavg(Vu32.h,Vv32.h)
2357 C Intrinsic Prototype: HVX_Vector Q6_Vh_vnavg_VhVh(HVX_Vector Vu, HVX_Vector Vv)1932 C Intrinsic Prototype: HVX_Vector Q6_Vh_vnavg_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2360,9 +1935,7 @@...@@ -2360,9 +1935,7 @@
2360 ========================================================================== */1935 ========================================================================== */
23611936
2362#define Q6_Vh_vnavg_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgh)(Vu,Vv)1937#define Q6_Vh_vnavg_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgh)(Vu,Vv)
2363#endif /* __HEXAGON_ARCH___ >= 60 */
23641938
2365#if __HVX_ARCH__ >= 60
2366/* ==========================================================================1939/* ==========================================================================
2367 Assembly Syntax: Vd32.b=vnavg(Vu32.ub,Vv32.ub)1940 Assembly Syntax: Vd32.b=vnavg(Vu32.ub,Vv32.ub)
2368 C Intrinsic Prototype: HVX_Vector Q6_Vb_vnavg_VubVub(HVX_Vector Vu, HVX_Vector Vv)1941 C Intrinsic Prototype: HVX_Vector Q6_Vb_vnavg_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2371,9 +1944,7 @@...@@ -2371,9 +1944,7 @@
2371 ========================================================================== */1944 ========================================================================== */
23721945
2373#define Q6_Vb_vnavg_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgub)(Vu,Vv)1946#define Q6_Vb_vnavg_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgub)(Vu,Vv)
2374#endif /* __HEXAGON_ARCH___ >= 60 */
23751947
2376#if __HVX_ARCH__ >= 60
2377/* ==========================================================================1948/* ==========================================================================
2378 Assembly Syntax: Vd32.w=vnavg(Vu32.w,Vv32.w)1949 Assembly Syntax: Vd32.w=vnavg(Vu32.w,Vv32.w)
2379 C Intrinsic Prototype: HVX_Vector Q6_Vw_vnavg_VwVw(HVX_Vector Vu, HVX_Vector Vv)1950 C Intrinsic Prototype: HVX_Vector Q6_Vw_vnavg_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2382,9 +1953,7 @@...@@ -2382,9 +1953,7 @@
2382 ========================================================================== */1953 ========================================================================== */
23831954
2384#define Q6_Vw_vnavg_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgw)(Vu,Vv)1955#define Q6_Vw_vnavg_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgw)(Vu,Vv)
2385#endif /* __HEXAGON_ARCH___ >= 60 */
23861956
2387#if __HVX_ARCH__ >= 60
2388/* ==========================================================================1957/* ==========================================================================
2389 Assembly Syntax: Vd32.h=vnormamt(Vu32.h)1958 Assembly Syntax: Vd32.h=vnormamt(Vu32.h)
2390 C Intrinsic Prototype: HVX_Vector Q6_Vh_vnormamt_Vh(HVX_Vector Vu)1959 C Intrinsic Prototype: HVX_Vector Q6_Vh_vnormamt_Vh(HVX_Vector Vu)
...@@ -2393,9 +1962,7 @@...@@ -2393,9 +1962,7 @@
2393 ========================================================================== */1962 ========================================================================== */
23941963
2395#define Q6_Vh_vnormamt_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnormamth)(Vu)1964#define Q6_Vh_vnormamt_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnormamth)(Vu)
2396#endif /* __HEXAGON_ARCH___ >= 60 */
23971965
2398#if __HVX_ARCH__ >= 60
2399/* ==========================================================================1966/* ==========================================================================
2400 Assembly Syntax: Vd32.w=vnormamt(Vu32.w)1967 Assembly Syntax: Vd32.w=vnormamt(Vu32.w)
2401 C Intrinsic Prototype: HVX_Vector Q6_Vw_vnormamt_Vw(HVX_Vector Vu)1968 C Intrinsic Prototype: HVX_Vector Q6_Vw_vnormamt_Vw(HVX_Vector Vu)
...@@ -2404,9 +1971,7 @@...@@ -2404,9 +1971,7 @@
2404 ========================================================================== */1971 ========================================================================== */
24051972
2406#define Q6_Vw_vnormamt_Vw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnormamtw)(Vu)1973#define Q6_Vw_vnormamt_Vw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnormamtw)(Vu)
2407#endif /* __HEXAGON_ARCH___ >= 60 */
24081974
2409#if __HVX_ARCH__ >= 60
2410/* ==========================================================================1975/* ==========================================================================
2411 Assembly Syntax: Vd32=vnot(Vu32)1976 Assembly Syntax: Vd32=vnot(Vu32)
2412 C Intrinsic Prototype: HVX_Vector Q6_V_vnot_V(HVX_Vector Vu)1977 C Intrinsic Prototype: HVX_Vector Q6_V_vnot_V(HVX_Vector Vu)
...@@ -2415,9 +1980,7 @@...@@ -2415,9 +1980,7 @@
2415 ========================================================================== */1980 ========================================================================== */
24161981
2417#define Q6_V_vnot_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnot)(Vu)1982#define Q6_V_vnot_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnot)(Vu)
2418#endif /* __HEXAGON_ARCH___ >= 60 */
24191983
2420#if __HVX_ARCH__ >= 60
2421/* ==========================================================================1984/* ==========================================================================
2422 Assembly Syntax: Vd32=vor(Vu32,Vv32)1985 Assembly Syntax: Vd32=vor(Vu32,Vv32)
2423 C Intrinsic Prototype: HVX_Vector Q6_V_vor_VV(HVX_Vector Vu, HVX_Vector Vv)1986 C Intrinsic Prototype: HVX_Vector Q6_V_vor_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2426,9 +1989,7 @@...@@ -2426,9 +1989,7 @@
2426 ========================================================================== */1989 ========================================================================== */
24271990
2428#define Q6_V_vor_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vor)(Vu,Vv)1991#define Q6_V_vor_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vor)(Vu,Vv)
2429#endif /* __HEXAGON_ARCH___ >= 60 */
24301992
2431#if __HVX_ARCH__ >= 60
2432/* ==========================================================================1993/* ==========================================================================
2433 Assembly Syntax: Vd32.b=vpacke(Vu32.h,Vv32.h)1994 Assembly Syntax: Vd32.b=vpacke(Vu32.h,Vv32.h)
2434 C Intrinsic Prototype: HVX_Vector Q6_Vb_vpacke_VhVh(HVX_Vector Vu, HVX_Vector Vv)1995 C Intrinsic Prototype: HVX_Vector Q6_Vb_vpacke_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2437,9 +1998,7 @@...@@ -2437,9 +1998,7 @@
2437 ========================================================================== */1998 ========================================================================== */
24381999
2439#define Q6_Vb_vpacke_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackeb)(Vu,Vv)2000#define Q6_Vb_vpacke_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackeb)(Vu,Vv)
2440#endif /* __HEXAGON_ARCH___ >= 60 */
24412001
2442#if __HVX_ARCH__ >= 60
2443/* ==========================================================================2002/* ==========================================================================
2444 Assembly Syntax: Vd32.h=vpacke(Vu32.w,Vv32.w)2003 Assembly Syntax: Vd32.h=vpacke(Vu32.w,Vv32.w)
2445 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpacke_VwVw(HVX_Vector Vu, HVX_Vector Vv)2004 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpacke_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2448,9 +2007,7 @@...@@ -2448,9 +2007,7 @@
2448 ========================================================================== */2007 ========================================================================== */
24492008
2450#define Q6_Vh_vpacke_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackeh)(Vu,Vv)2009#define Q6_Vh_vpacke_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackeh)(Vu,Vv)
2451#endif /* __HEXAGON_ARCH___ >= 60 */
24522010
2453#if __HVX_ARCH__ >= 60
2454/* ==========================================================================2011/* ==========================================================================
2455 Assembly Syntax: Vd32.b=vpack(Vu32.h,Vv32.h):sat2012 Assembly Syntax: Vd32.b=vpack(Vu32.h,Vv32.h):sat
2456 C Intrinsic Prototype: HVX_Vector Q6_Vb_vpack_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)2013 C Intrinsic Prototype: HVX_Vector Q6_Vb_vpack_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2459,9 +2016,7 @@...@@ -2459,9 +2016,7 @@
2459 ========================================================================== */2016 ========================================================================== */
24602017
2461#define Q6_Vb_vpack_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackhb_sat)(Vu,Vv)2018#define Q6_Vb_vpack_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackhb_sat)(Vu,Vv)
2462#endif /* __HEXAGON_ARCH___ >= 60 */
24632019
2464#if __HVX_ARCH__ >= 60
2465/* ==========================================================================2020/* ==========================================================================
2466 Assembly Syntax: Vd32.ub=vpack(Vu32.h,Vv32.h):sat2021 Assembly Syntax: Vd32.ub=vpack(Vu32.h,Vv32.h):sat
2467 C Intrinsic Prototype: HVX_Vector Q6_Vub_vpack_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)2022 C Intrinsic Prototype: HVX_Vector Q6_Vub_vpack_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2470,9 +2025,7 @@...@@ -2470,9 +2025,7 @@
2470 ========================================================================== */2025 ========================================================================== */
24712026
2472#define Q6_Vub_vpack_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackhub_sat)(Vu,Vv)2027#define Q6_Vub_vpack_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackhub_sat)(Vu,Vv)
2473#endif /* __HEXAGON_ARCH___ >= 60 */
24742028
2475#if __HVX_ARCH__ >= 60
2476/* ==========================================================================2029/* ==========================================================================
2477 Assembly Syntax: Vd32.b=vpacko(Vu32.h,Vv32.h)2030 Assembly Syntax: Vd32.b=vpacko(Vu32.h,Vv32.h)
2478 C Intrinsic Prototype: HVX_Vector Q6_Vb_vpacko_VhVh(HVX_Vector Vu, HVX_Vector Vv)2031 C Intrinsic Prototype: HVX_Vector Q6_Vb_vpacko_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2481,9 +2034,7 @@...@@ -2481,9 +2034,7 @@
2481 ========================================================================== */2034 ========================================================================== */
24822035
2483#define Q6_Vb_vpacko_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackob)(Vu,Vv)2036#define Q6_Vb_vpacko_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackob)(Vu,Vv)
2484#endif /* __HEXAGON_ARCH___ >= 60 */
24852037
2486#if __HVX_ARCH__ >= 60
2487/* ==========================================================================2038/* ==========================================================================
2488 Assembly Syntax: Vd32.h=vpacko(Vu32.w,Vv32.w)2039 Assembly Syntax: Vd32.h=vpacko(Vu32.w,Vv32.w)
2489 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpacko_VwVw(HVX_Vector Vu, HVX_Vector Vv)2040 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpacko_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2492,9 +2043,7 @@...@@ -2492,9 +2043,7 @@
2492 ========================================================================== */2043 ========================================================================== */
24932044
2494#define Q6_Vh_vpacko_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackoh)(Vu,Vv)2045#define Q6_Vh_vpacko_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackoh)(Vu,Vv)
2495#endif /* __HEXAGON_ARCH___ >= 60 */
24962046
2497#if __HVX_ARCH__ >= 60
2498/* ==========================================================================2047/* ==========================================================================
2499 Assembly Syntax: Vd32.h=vpack(Vu32.w,Vv32.w):sat2048 Assembly Syntax: Vd32.h=vpack(Vu32.w,Vv32.w):sat
2500 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpack_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)2049 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpack_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2503,9 +2052,7 @@...@@ -2503,9 +2052,7 @@
2503 ========================================================================== */2052 ========================================================================== */
25042053
2505#define Q6_Vh_vpack_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackwh_sat)(Vu,Vv)2054#define Q6_Vh_vpack_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackwh_sat)(Vu,Vv)
2506#endif /* __HEXAGON_ARCH___ >= 60 */
25072055
2508#if __HVX_ARCH__ >= 60
2509/* ==========================================================================2056/* ==========================================================================
2510 Assembly Syntax: Vd32.uh=vpack(Vu32.w,Vv32.w):sat2057 Assembly Syntax: Vd32.uh=vpack(Vu32.w,Vv32.w):sat
2511 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vpack_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)2058 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vpack_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2514,9 +2061,7 @@...@@ -2514,9 +2061,7 @@
2514 ========================================================================== */2061 ========================================================================== */
25152062
2516#define Q6_Vuh_vpack_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackwuh_sat)(Vu,Vv)2063#define Q6_Vuh_vpack_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpackwuh_sat)(Vu,Vv)
2517#endif /* __HEXAGON_ARCH___ >= 60 */
25182064
2519#if __HVX_ARCH__ >= 60
2520/* ==========================================================================2065/* ==========================================================================
2521 Assembly Syntax: Vd32.h=vpopcount(Vu32.h)2066 Assembly Syntax: Vd32.h=vpopcount(Vu32.h)
2522 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpopcount_Vh(HVX_Vector Vu)2067 C Intrinsic Prototype: HVX_Vector Q6_Vh_vpopcount_Vh(HVX_Vector Vu)
...@@ -2525,9 +2070,7 @@...@@ -2525,9 +2070,7 @@
2525 ========================================================================== */2070 ========================================================================== */
25262071
2527#define Q6_Vh_vpopcount_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpopcounth)(Vu)2072#define Q6_Vh_vpopcount_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vpopcounth)(Vu)
2528#endif /* __HEXAGON_ARCH___ >= 60 */
25292073
2530#if __HVX_ARCH__ >= 60
2531/* ==========================================================================2074/* ==========================================================================
2532 Assembly Syntax: Vd32=vrdelta(Vu32,Vv32)2075 Assembly Syntax: Vd32=vrdelta(Vu32,Vv32)
2533 C Intrinsic Prototype: HVX_Vector Q6_V_vrdelta_VV(HVX_Vector Vu, HVX_Vector Vv)2076 C Intrinsic Prototype: HVX_Vector Q6_V_vrdelta_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2536,9 +2079,7 @@...@@ -2536,9 +2079,7 @@
2536 ========================================================================== */2079 ========================================================================== */
25372080
2538#define Q6_V_vrdelta_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrdelta)(Vu,Vv)2081#define Q6_V_vrdelta_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrdelta)(Vu,Vv)
2539#endif /* __HEXAGON_ARCH___ >= 60 */
25402082
2541#if __HVX_ARCH__ >= 60
2542/* ==========================================================================2083/* ==========================================================================
2543 Assembly Syntax: Vd32.w=vrmpy(Vu32.ub,Rt32.b)2084 Assembly Syntax: Vd32.w=vrmpy(Vu32.ub,Rt32.b)
2544 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpy_VubRb(HVX_Vector Vu, Word32 Rt)2085 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpy_VubRb(HVX_Vector Vu, Word32 Rt)
...@@ -2547,9 +2088,7 @@...@@ -2547,9 +2088,7 @@
2547 ========================================================================== */2088 ========================================================================== */
25482089
2549#define Q6_Vw_vrmpy_VubRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybus)(Vu,Rt)2090#define Q6_Vw_vrmpy_VubRb(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybus)(Vu,Rt)
2550#endif /* __HEXAGON_ARCH___ >= 60 */
25512091
2552#if __HVX_ARCH__ >= 60
2553/* ==========================================================================2092/* ==========================================================================
2554 Assembly Syntax: Vx32.w+=vrmpy(Vu32.ub,Rt32.b)2093 Assembly Syntax: Vx32.w+=vrmpy(Vu32.ub,Rt32.b)
2555 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpyacc_VwVubRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)2094 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpyacc_VwVubRb(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -2558,9 +2097,7 @@...@@ -2558,9 +2097,7 @@
2558 ========================================================================== */2097 ========================================================================== */
25592098
2560#define Q6_Vw_vrmpyacc_VwVubRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybus_acc)(Vx,Vu,Rt)2099#define Q6_Vw_vrmpyacc_VwVubRb(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybus_acc)(Vx,Vu,Rt)
2561#endif /* __HEXAGON_ARCH___ >= 60 */
25622100
2563#if __HVX_ARCH__ >= 60
2564/* ==========================================================================2101/* ==========================================================================
2565 Assembly Syntax: Vdd32.w=vrmpy(Vuu32.ub,Rt32.b,#u1)2102 Assembly Syntax: Vdd32.w=vrmpy(Vuu32.ub,Rt32.b,#u1)
2566 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vrmpy_WubRbI(HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)2103 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vrmpy_WubRbI(HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)
...@@ -2569,9 +2106,7 @@...@@ -2569,9 +2106,7 @@
2569 ========================================================================== */2106 ========================================================================== */
25702107
2571#define Q6_Ww_vrmpy_WubRbI(Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusi)(Vuu,Rt,Iu1)2108#define Q6_Ww_vrmpy_WubRbI(Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusi)(Vuu,Rt,Iu1)
2572#endif /* __HEXAGON_ARCH___ >= 60 */
25732109
2574#if __HVX_ARCH__ >= 60
2575/* ==========================================================================2110/* ==========================================================================
2576 Assembly Syntax: Vxx32.w+=vrmpy(Vuu32.ub,Rt32.b,#u1)2111 Assembly Syntax: Vxx32.w+=vrmpy(Vuu32.ub,Rt32.b,#u1)
2577 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vrmpyacc_WwWubRbI(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)2112 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vrmpyacc_WwWubRbI(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)
...@@ -2580,9 +2115,7 @@...@@ -2580,9 +2115,7 @@
2580 ========================================================================== */2115 ========================================================================== */
25812116
2582#define Q6_Ww_vrmpyacc_WwWubRbI(Vxx,Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusi_acc)(Vxx,Vuu,Rt,Iu1)2117#define Q6_Ww_vrmpyacc_WwWubRbI(Vxx,Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusi_acc)(Vxx,Vuu,Rt,Iu1)
2583#endif /* __HEXAGON_ARCH___ >= 60 */
25842118
2585#if __HVX_ARCH__ >= 60
2586/* ==========================================================================2119/* ==========================================================================
2587 Assembly Syntax: Vd32.w=vrmpy(Vu32.ub,Vv32.b)2120 Assembly Syntax: Vd32.w=vrmpy(Vu32.ub,Vv32.b)
2588 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpy_VubVb(HVX_Vector Vu, HVX_Vector Vv)2121 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpy_VubVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2591,9 +2124,7 @@...@@ -2591,9 +2124,7 @@
2591 ========================================================================== */2124 ========================================================================== */
25922125
2593#define Q6_Vw_vrmpy_VubVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusv)(Vu,Vv)2126#define Q6_Vw_vrmpy_VubVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusv)(Vu,Vv)
2594#endif /* __HEXAGON_ARCH___ >= 60 */
25952127
2596#if __HVX_ARCH__ >= 60
2597/* ==========================================================================2128/* ==========================================================================
2598 Assembly Syntax: Vx32.w+=vrmpy(Vu32.ub,Vv32.b)2129 Assembly Syntax: Vx32.w+=vrmpy(Vu32.ub,Vv32.b)
2599 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpyacc_VwVubVb(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)2130 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpyacc_VwVubVb(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2602,9 +2133,7 @@...@@ -2602,9 +2133,7 @@
2602 ========================================================================== */2133 ========================================================================== */
26032134
2604#define Q6_Vw_vrmpyacc_VwVubVb(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusv_acc)(Vx,Vu,Vv)2135#define Q6_Vw_vrmpyacc_VwVubVb(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybusv_acc)(Vx,Vu,Vv)
2605#endif /* __HEXAGON_ARCH___ >= 60 */
26062136
2607#if __HVX_ARCH__ >= 60
2608/* ==========================================================================2137/* ==========================================================================
2609 Assembly Syntax: Vd32.w=vrmpy(Vu32.b,Vv32.b)2138 Assembly Syntax: Vd32.w=vrmpy(Vu32.b,Vv32.b)
2610 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpy_VbVb(HVX_Vector Vu, HVX_Vector Vv)2139 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpy_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2613,9 +2142,7 @@...@@ -2613,9 +2142,7 @@
2613 ========================================================================== */2142 ========================================================================== */
26142143
2615#define Q6_Vw_vrmpy_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybv)(Vu,Vv)2144#define Q6_Vw_vrmpy_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybv)(Vu,Vv)
2616#endif /* __HEXAGON_ARCH___ >= 60 */
26172145
2618#if __HVX_ARCH__ >= 60
2619/* ==========================================================================2146/* ==========================================================================
2620 Assembly Syntax: Vx32.w+=vrmpy(Vu32.b,Vv32.b)2147 Assembly Syntax: Vx32.w+=vrmpy(Vu32.b,Vv32.b)
2621 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpyacc_VwVbVb(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)2148 C Intrinsic Prototype: HVX_Vector Q6_Vw_vrmpyacc_VwVbVb(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2624,9 +2151,7 @@...@@ -2624,9 +2151,7 @@
2624 ========================================================================== */2151 ========================================================================== */
26252152
2626#define Q6_Vw_vrmpyacc_VwVbVb(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybv_acc)(Vx,Vu,Vv)2153#define Q6_Vw_vrmpyacc_VwVbVb(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpybv_acc)(Vx,Vu,Vv)
2627#endif /* __HEXAGON_ARCH___ >= 60 */
26282154
2629#if __HVX_ARCH__ >= 60
2630/* ==========================================================================2155/* ==========================================================================
2631 Assembly Syntax: Vd32.uw=vrmpy(Vu32.ub,Rt32.ub)2156 Assembly Syntax: Vd32.uw=vrmpy(Vu32.ub,Rt32.ub)
2632 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpy_VubRub(HVX_Vector Vu, Word32 Rt)2157 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpy_VubRub(HVX_Vector Vu, Word32 Rt)
...@@ -2635,9 +2160,7 @@...@@ -2635,9 +2160,7 @@
2635 ========================================================================== */2160 ========================================================================== */
26362161
2637#define Q6_Vuw_vrmpy_VubRub(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyub)(Vu,Rt)2162#define Q6_Vuw_vrmpy_VubRub(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyub)(Vu,Rt)
2638#endif /* __HEXAGON_ARCH___ >= 60 */
26392163
2640#if __HVX_ARCH__ >= 60
2641/* ==========================================================================2164/* ==========================================================================
2642 Assembly Syntax: Vx32.uw+=vrmpy(Vu32.ub,Rt32.ub)2165 Assembly Syntax: Vx32.uw+=vrmpy(Vu32.ub,Rt32.ub)
2643 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpyacc_VuwVubRub(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)2166 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpyacc_VuwVubRub(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
...@@ -2646,9 +2169,7 @@...@@ -2646,9 +2169,7 @@
2646 ========================================================================== */2169 ========================================================================== */
26472170
2648#define Q6_Vuw_vrmpyacc_VuwVubRub(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyub_acc)(Vx,Vu,Rt)2171#define Q6_Vuw_vrmpyacc_VuwVubRub(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyub_acc)(Vx,Vu,Rt)
2649#endif /* __HEXAGON_ARCH___ >= 60 */
26502172
2651#if __HVX_ARCH__ >= 60
2652/* ==========================================================================2173/* ==========================================================================
2653 Assembly Syntax: Vdd32.uw=vrmpy(Vuu32.ub,Rt32.ub,#u1)2174 Assembly Syntax: Vdd32.uw=vrmpy(Vuu32.ub,Rt32.ub,#u1)
2654 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrmpy_WubRubI(HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)2175 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrmpy_WubRubI(HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)
...@@ -2657,9 +2178,7 @@...@@ -2657,9 +2178,7 @@
2657 ========================================================================== */2178 ========================================================================== */
26582179
2659#define Q6_Wuw_vrmpy_WubRubI(Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubi)(Vuu,Rt,Iu1)2180#define Q6_Wuw_vrmpy_WubRubI(Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubi)(Vuu,Rt,Iu1)
2660#endif /* __HEXAGON_ARCH___ >= 60 */
26612181
2662#if __HVX_ARCH__ >= 60
2663/* ==========================================================================2182/* ==========================================================================
2664 Assembly Syntax: Vxx32.uw+=vrmpy(Vuu32.ub,Rt32.ub,#u1)2183 Assembly Syntax: Vxx32.uw+=vrmpy(Vuu32.ub,Rt32.ub,#u1)
2665 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrmpyacc_WuwWubRubI(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)2184 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrmpyacc_WuwWubRubI(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)
...@@ -2668,9 +2187,7 @@...@@ -2668,9 +2187,7 @@
2668 ========================================================================== */2187 ========================================================================== */
26692188
2670#define Q6_Wuw_vrmpyacc_WuwWubRubI(Vxx,Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubi_acc)(Vxx,Vuu,Rt,Iu1)2189#define Q6_Wuw_vrmpyacc_WuwWubRubI(Vxx,Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubi_acc)(Vxx,Vuu,Rt,Iu1)
2671#endif /* __HEXAGON_ARCH___ >= 60 */
26722190
2673#if __HVX_ARCH__ >= 60
2674/* ==========================================================================2191/* ==========================================================================
2675 Assembly Syntax: Vd32.uw=vrmpy(Vu32.ub,Vv32.ub)2192 Assembly Syntax: Vd32.uw=vrmpy(Vu32.ub,Vv32.ub)
2676 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpy_VubVub(HVX_Vector Vu, HVX_Vector Vv)2193 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpy_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2679,9 +2196,7 @@...@@ -2679,9 +2196,7 @@
2679 ========================================================================== */2196 ========================================================================== */
26802197
2681#define Q6_Vuw_vrmpy_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubv)(Vu,Vv)2198#define Q6_Vuw_vrmpy_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubv)(Vu,Vv)
2682#endif /* __HEXAGON_ARCH___ >= 60 */
26832199
2684#if __HVX_ARCH__ >= 60
2685/* ==========================================================================2200/* ==========================================================================
2686 Assembly Syntax: Vx32.uw+=vrmpy(Vu32.ub,Vv32.ub)2201 Assembly Syntax: Vx32.uw+=vrmpy(Vu32.ub,Vv32.ub)
2687 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpyacc_VuwVubVub(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)2202 C Intrinsic Prototype: HVX_Vector Q6_Vuw_vrmpyacc_VuwVubVub(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -2690,9 +2205,7 @@...@@ -2690,9 +2205,7 @@
2690 ========================================================================== */2205 ========================================================================== */
26912206
2692#define Q6_Vuw_vrmpyacc_VuwVubVub(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubv_acc)(Vx,Vu,Vv)2207#define Q6_Vuw_vrmpyacc_VuwVubVub(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrmpyubv_acc)(Vx,Vu,Vv)
2693#endif /* __HEXAGON_ARCH___ >= 60 */
26942208
2695#if __HVX_ARCH__ >= 60
2696/* ==========================================================================2209/* ==========================================================================
2697 Assembly Syntax: Vd32=vror(Vu32,Rt32)2210 Assembly Syntax: Vd32=vror(Vu32,Rt32)
2698 C Intrinsic Prototype: HVX_Vector Q6_V_vror_VR(HVX_Vector Vu, Word32 Rt)2211 C Intrinsic Prototype: HVX_Vector Q6_V_vror_VR(HVX_Vector Vu, Word32 Rt)
...@@ -2701,9 +2214,7 @@...@@ -2701,9 +2214,7 @@
2701 ========================================================================== */2214 ========================================================================== */
27022215
2703#define Q6_V_vror_VR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vror)(Vu,Rt)2216#define Q6_V_vror_VR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vror)(Vu,Rt)
2704#endif /* __HEXAGON_ARCH___ >= 60 */
27052217
2706#if __HVX_ARCH__ >= 60
2707/* ==========================================================================2218/* ==========================================================================
2708 Assembly Syntax: Vd32.b=vround(Vu32.h,Vv32.h):sat2219 Assembly Syntax: Vd32.b=vround(Vu32.h,Vv32.h):sat
2709 C Intrinsic Prototype: HVX_Vector Q6_Vb_vround_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)2220 C Intrinsic Prototype: HVX_Vector Q6_Vb_vround_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2712,9 +2223,7 @@...@@ -2712,9 +2223,7 @@
2712 ========================================================================== */2223 ========================================================================== */
27132224
2714#define Q6_Vb_vround_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundhb)(Vu,Vv)2225#define Q6_Vb_vround_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundhb)(Vu,Vv)
2715#endif /* __HEXAGON_ARCH___ >= 60 */
27162226
2717#if __HVX_ARCH__ >= 60
2718/* ==========================================================================2227/* ==========================================================================
2719 Assembly Syntax: Vd32.ub=vround(Vu32.h,Vv32.h):sat2228 Assembly Syntax: Vd32.ub=vround(Vu32.h,Vv32.h):sat
2720 C Intrinsic Prototype: HVX_Vector Q6_Vub_vround_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)2229 C Intrinsic Prototype: HVX_Vector Q6_Vub_vround_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2723,9 +2232,7 @@...@@ -2723,9 +2232,7 @@
2723 ========================================================================== */2232 ========================================================================== */
27242233
2725#define Q6_Vub_vround_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundhub)(Vu,Vv)2234#define Q6_Vub_vround_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundhub)(Vu,Vv)
2726#endif /* __HEXAGON_ARCH___ >= 60 */
27272235
2728#if __HVX_ARCH__ >= 60
2729/* ==========================================================================2236/* ==========================================================================
2730 Assembly Syntax: Vd32.h=vround(Vu32.w,Vv32.w):sat2237 Assembly Syntax: Vd32.h=vround(Vu32.w,Vv32.w):sat
2731 C Intrinsic Prototype: HVX_Vector Q6_Vh_vround_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)2238 C Intrinsic Prototype: HVX_Vector Q6_Vh_vround_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2734,9 +2241,7 @@...@@ -2734,9 +2241,7 @@
2734 ========================================================================== */2241 ========================================================================== */
27352242
2736#define Q6_Vh_vround_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundwh)(Vu,Vv)2243#define Q6_Vh_vround_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundwh)(Vu,Vv)
2737#endif /* __HEXAGON_ARCH___ >= 60 */
27382244
2739#if __HVX_ARCH__ >= 60
2740/* ==========================================================================2245/* ==========================================================================
2741 Assembly Syntax: Vd32.uh=vround(Vu32.w,Vv32.w):sat2246 Assembly Syntax: Vd32.uh=vround(Vu32.w,Vv32.w):sat
2742 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vround_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)2247 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vround_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2745,9 +2250,7 @@...@@ -2745,9 +2250,7 @@
2745 ========================================================================== */2250 ========================================================================== */
27462251
2747#define Q6_Vuh_vround_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundwuh)(Vu,Vv)2252#define Q6_Vuh_vround_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vroundwuh)(Vu,Vv)
2748#endif /* __HEXAGON_ARCH___ >= 60 */
27492253
2750#if __HVX_ARCH__ >= 60
2751/* ==========================================================================2254/* ==========================================================================
2752 Assembly Syntax: Vdd32.uw=vrsad(Vuu32.ub,Rt32.ub,#u1)2255 Assembly Syntax: Vdd32.uw=vrsad(Vuu32.ub,Rt32.ub,#u1)
2753 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrsad_WubRubI(HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)2256 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrsad_WubRubI(HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)
...@@ -2756,9 +2259,7 @@...@@ -2756,9 +2259,7 @@
2756 ========================================================================== */2259 ========================================================================== */
27572260
2758#define Q6_Wuw_vrsad_WubRubI(Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrsadubi)(Vuu,Rt,Iu1)2261#define Q6_Wuw_vrsad_WubRubI(Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrsadubi)(Vuu,Rt,Iu1)
2759#endif /* __HEXAGON_ARCH___ >= 60 */
27602262
2761#if __HVX_ARCH__ >= 60
2762/* ==========================================================================2263/* ==========================================================================
2763 Assembly Syntax: Vxx32.uw+=vrsad(Vuu32.ub,Rt32.ub,#u1)2264 Assembly Syntax: Vxx32.uw+=vrsad(Vuu32.ub,Rt32.ub,#u1)
2764 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrsadacc_WuwWubRubI(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)2265 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vrsadacc_WuwWubRubI(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt, Word32 Iu1)
...@@ -2767,9 +2268,7 @@...@@ -2767,9 +2268,7 @@
2767 ========================================================================== */2268 ========================================================================== */
27682269
2769#define Q6_Wuw_vrsadacc_WuwWubRubI(Vxx,Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrsadubi_acc)(Vxx,Vuu,Rt,Iu1)2270#define Q6_Wuw_vrsadacc_WuwWubRubI(Vxx,Vuu,Rt,Iu1) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrsadubi_acc)(Vxx,Vuu,Rt,Iu1)
2770#endif /* __HEXAGON_ARCH___ >= 60 */
27712271
2772#if __HVX_ARCH__ >= 60
2773/* ==========================================================================2272/* ==========================================================================
2774 Assembly Syntax: Vd32.ub=vsat(Vu32.h,Vv32.h)2273 Assembly Syntax: Vd32.ub=vsat(Vu32.h,Vv32.h)
2775 C Intrinsic Prototype: HVX_Vector Q6_Vub_vsat_VhVh(HVX_Vector Vu, HVX_Vector Vv)2274 C Intrinsic Prototype: HVX_Vector Q6_Vub_vsat_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2778,9 +2277,7 @@...@@ -2778,9 +2277,7 @@
2778 ========================================================================== */2277 ========================================================================== */
27792278
2780#define Q6_Vub_vsat_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsathub)(Vu,Vv)2279#define Q6_Vub_vsat_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsathub)(Vu,Vv)
2781#endif /* __HEXAGON_ARCH___ >= 60 */
27822280
2783#if __HVX_ARCH__ >= 60
2784/* ==========================================================================2281/* ==========================================================================
2785 Assembly Syntax: Vd32.h=vsat(Vu32.w,Vv32.w)2282 Assembly Syntax: Vd32.h=vsat(Vu32.w,Vv32.w)
2786 C Intrinsic Prototype: HVX_Vector Q6_Vh_vsat_VwVw(HVX_Vector Vu, HVX_Vector Vv)2283 C Intrinsic Prototype: HVX_Vector Q6_Vh_vsat_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2789,9 +2286,7 @@...@@ -2789,9 +2286,7 @@
2789 ========================================================================== */2286 ========================================================================== */
27902287
2791#define Q6_Vh_vsat_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsatwh)(Vu,Vv)2288#define Q6_Vh_vsat_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsatwh)(Vu,Vv)
2792#endif /* __HEXAGON_ARCH___ >= 60 */
27932289
2794#if __HVX_ARCH__ >= 60
2795/* ==========================================================================2290/* ==========================================================================
2796 Assembly Syntax: Vdd32.h=vsxt(Vu32.b)2291 Assembly Syntax: Vdd32.h=vsxt(Vu32.b)
2797 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsxt_Vb(HVX_Vector Vu)2292 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsxt_Vb(HVX_Vector Vu)
...@@ -2800,9 +2295,7 @@...@@ -2800,9 +2295,7 @@
2800 ========================================================================== */2295 ========================================================================== */
28012296
2802#define Q6_Wh_vsxt_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsb)(Vu)2297#define Q6_Wh_vsxt_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsb)(Vu)
2803#endif /* __HEXAGON_ARCH___ >= 60 */
28042298
2805#if __HVX_ARCH__ >= 60
2806/* ==========================================================================2299/* ==========================================================================
2807 Assembly Syntax: Vdd32.w=vsxt(Vu32.h)2300 Assembly Syntax: Vdd32.w=vsxt(Vu32.h)
2808 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsxt_Vh(HVX_Vector Vu)2301 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsxt_Vh(HVX_Vector Vu)
...@@ -2811,9 +2304,7 @@...@@ -2811,9 +2304,7 @@
2811 ========================================================================== */2304 ========================================================================== */
28122305
2813#define Q6_Ww_vsxt_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsh)(Vu)2306#define Q6_Ww_vsxt_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsh)(Vu)
2814#endif /* __HEXAGON_ARCH___ >= 60 */
28152307
2816#if __HVX_ARCH__ >= 60
2817/* ==========================================================================2308/* ==========================================================================
2818 Assembly Syntax: Vd32.h=vshuffe(Vu32.h,Vv32.h)2309 Assembly Syntax: Vd32.h=vshuffe(Vu32.h,Vv32.h)
2819 C Intrinsic Prototype: HVX_Vector Q6_Vh_vshuffe_VhVh(HVX_Vector Vu, HVX_Vector Vv)2310 C Intrinsic Prototype: HVX_Vector Q6_Vh_vshuffe_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2822,9 +2313,7 @@...@@ -2822,9 +2313,7 @@
2822 ========================================================================== */2313 ========================================================================== */
28232314
2824#define Q6_Vh_vshuffe_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufeh)(Vu,Vv)2315#define Q6_Vh_vshuffe_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufeh)(Vu,Vv)
2825#endif /* __HEXAGON_ARCH___ >= 60 */
28262316
2827#if __HVX_ARCH__ >= 60
2828/* ==========================================================================2317/* ==========================================================================
2829 Assembly Syntax: Vd32.b=vshuff(Vu32.b)2318 Assembly Syntax: Vd32.b=vshuff(Vu32.b)
2830 C Intrinsic Prototype: HVX_Vector Q6_Vb_vshuff_Vb(HVX_Vector Vu)2319 C Intrinsic Prototype: HVX_Vector Q6_Vb_vshuff_Vb(HVX_Vector Vu)
...@@ -2833,9 +2322,7 @@...@@ -2833,9 +2322,7 @@
2833 ========================================================================== */2322 ========================================================================== */
28342323
2835#define Q6_Vb_vshuff_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffb)(Vu)2324#define Q6_Vb_vshuff_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffb)(Vu)
2836#endif /* __HEXAGON_ARCH___ >= 60 */
28372325
2838#if __HVX_ARCH__ >= 60
2839/* ==========================================================================2326/* ==========================================================================
2840 Assembly Syntax: Vd32.b=vshuffe(Vu32.b,Vv32.b)2327 Assembly Syntax: Vd32.b=vshuffe(Vu32.b,Vv32.b)
2841 C Intrinsic Prototype: HVX_Vector Q6_Vb_vshuffe_VbVb(HVX_Vector Vu, HVX_Vector Vv)2328 C Intrinsic Prototype: HVX_Vector Q6_Vb_vshuffe_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2844,9 +2331,7 @@...@@ -2844,9 +2331,7 @@
2844 ========================================================================== */2331 ========================================================================== */
28452332
2846#define Q6_Vb_vshuffe_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffeb)(Vu,Vv)2333#define Q6_Vb_vshuffe_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffeb)(Vu,Vv)
2847#endif /* __HEXAGON_ARCH___ >= 60 */
28482334
2849#if __HVX_ARCH__ >= 60
2850/* ==========================================================================2335/* ==========================================================================
2851 Assembly Syntax: Vd32.h=vshuff(Vu32.h)2336 Assembly Syntax: Vd32.h=vshuff(Vu32.h)
2852 C Intrinsic Prototype: HVX_Vector Q6_Vh_vshuff_Vh(HVX_Vector Vu)2337 C Intrinsic Prototype: HVX_Vector Q6_Vh_vshuff_Vh(HVX_Vector Vu)
...@@ -2855,9 +2340,7 @@...@@ -2855,9 +2340,7 @@
2855 ========================================================================== */2340 ========================================================================== */
28562341
2857#define Q6_Vh_vshuff_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffh)(Vu)2342#define Q6_Vh_vshuff_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffh)(Vu)
2858#endif /* __HEXAGON_ARCH___ >= 60 */
28592343
2860#if __HVX_ARCH__ >= 60
2861/* ==========================================================================2344/* ==========================================================================
2862 Assembly Syntax: Vd32.b=vshuffo(Vu32.b,Vv32.b)2345 Assembly Syntax: Vd32.b=vshuffo(Vu32.b,Vv32.b)
2863 C Intrinsic Prototype: HVX_Vector Q6_Vb_vshuffo_VbVb(HVX_Vector Vu, HVX_Vector Vv)2346 C Intrinsic Prototype: HVX_Vector Q6_Vb_vshuffo_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2866,9 +2349,7 @@...@@ -2866,9 +2349,7 @@
2866 ========================================================================== */2349 ========================================================================== */
28672350
2868#define Q6_Vb_vshuffo_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffob)(Vu,Vv)2351#define Q6_Vb_vshuffo_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffob)(Vu,Vv)
2869#endif /* __HEXAGON_ARCH___ >= 60 */
28702352
2871#if __HVX_ARCH__ >= 60
2872/* ==========================================================================2353/* ==========================================================================
2873 Assembly Syntax: Vdd32=vshuff(Vu32,Vv32,Rt8)2354 Assembly Syntax: Vdd32=vshuff(Vu32,Vv32,Rt8)
2874 C Intrinsic Prototype: HVX_VectorPair Q6_W_vshuff_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)2355 C Intrinsic Prototype: HVX_VectorPair Q6_W_vshuff_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
...@@ -2877,9 +2358,7 @@...@@ -2877,9 +2358,7 @@
2877 ========================================================================== */2358 ========================================================================== */
28782359
2879#define Q6_W_vshuff_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffvdd)(Vu,Vv,Rt)2360#define Q6_W_vshuff_VVR(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshuffvdd)(Vu,Vv,Rt)
2880#endif /* __HEXAGON_ARCH___ >= 60 */
28812361
2882#if __HVX_ARCH__ >= 60
2883/* ==========================================================================2362/* ==========================================================================
2884 Assembly Syntax: Vdd32.b=vshuffoe(Vu32.b,Vv32.b)2363 Assembly Syntax: Vdd32.b=vshuffoe(Vu32.b,Vv32.b)
2885 C Intrinsic Prototype: HVX_VectorPair Q6_Wb_vshuffoe_VbVb(HVX_Vector Vu, HVX_Vector Vv)2364 C Intrinsic Prototype: HVX_VectorPair Q6_Wb_vshuffoe_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2888,9 +2367,7 @@...@@ -2888,9 +2367,7 @@
2888 ========================================================================== */2367 ========================================================================== */
28892368
2890#define Q6_Wb_vshuffoe_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufoeb)(Vu,Vv)2369#define Q6_Wb_vshuffoe_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufoeb)(Vu,Vv)
2891#endif /* __HEXAGON_ARCH___ >= 60 */
28922370
2893#if __HVX_ARCH__ >= 60
2894/* ==========================================================================2371/* ==========================================================================
2895 Assembly Syntax: Vdd32.h=vshuffoe(Vu32.h,Vv32.h)2372 Assembly Syntax: Vdd32.h=vshuffoe(Vu32.h,Vv32.h)
2896 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vshuffoe_VhVh(HVX_Vector Vu, HVX_Vector Vv)2373 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vshuffoe_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2899,9 +2376,7 @@...@@ -2899,9 +2376,7 @@
2899 ========================================================================== */2376 ========================================================================== */
29002377
2901#define Q6_Wh_vshuffoe_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufoeh)(Vu,Vv)2378#define Q6_Wh_vshuffoe_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufoeh)(Vu,Vv)
2902#endif /* __HEXAGON_ARCH___ >= 60 */
29032379
2904#if __HVX_ARCH__ >= 60
2905/* ==========================================================================2380/* ==========================================================================
2906 Assembly Syntax: Vd32.h=vshuffo(Vu32.h,Vv32.h)2381 Assembly Syntax: Vd32.h=vshuffo(Vu32.h,Vv32.h)
2907 C Intrinsic Prototype: HVX_Vector Q6_Vh_vshuffo_VhVh(HVX_Vector Vu, HVX_Vector Vv)2382 C Intrinsic Prototype: HVX_Vector Q6_Vh_vshuffo_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2910,9 +2385,7 @@...@@ -2910,9 +2385,7 @@
2910 ========================================================================== */2385 ========================================================================== */
29112386
2912#define Q6_Vh_vshuffo_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufoh)(Vu,Vv)2387#define Q6_Vh_vshuffo_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vshufoh)(Vu,Vv)
2913#endif /* __HEXAGON_ARCH___ >= 60 */
29142388
2915#if __HVX_ARCH__ >= 60
2916/* ==========================================================================2389/* ==========================================================================
2917 Assembly Syntax: Vd32.b=vsub(Vu32.b,Vv32.b)2390 Assembly Syntax: Vd32.b=vsub(Vu32.b,Vv32.b)
2918 C Intrinsic Prototype: HVX_Vector Q6_Vb_vsub_VbVb(HVX_Vector Vu, HVX_Vector Vv)2391 C Intrinsic Prototype: HVX_Vector Q6_Vb_vsub_VbVb(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2921,9 +2394,7 @@...@@ -2921,9 +2394,7 @@
2921 ========================================================================== */2394 ========================================================================== */
29222395
2923#define Q6_Vb_vsub_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubb)(Vu,Vv)2396#define Q6_Vb_vsub_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubb)(Vu,Vv)
2924#endif /* __HEXAGON_ARCH___ >= 60 */
29252397
2926#if __HVX_ARCH__ >= 60
2927/* ==========================================================================2398/* ==========================================================================
2928 Assembly Syntax: Vdd32.b=vsub(Vuu32.b,Vvv32.b)2399 Assembly Syntax: Vdd32.b=vsub(Vuu32.b,Vvv32.b)
2929 C Intrinsic Prototype: HVX_VectorPair Q6_Wb_vsub_WbWb(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2400 C Intrinsic Prototype: HVX_VectorPair Q6_Wb_vsub_WbWb(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -2932,9 +2403,7 @@...@@ -2932,9 +2403,7 @@
2932 ========================================================================== */2403 ========================================================================== */
29332404
2934#define Q6_Wb_vsub_WbWb(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubb_dv)(Vuu,Vvv)2405#define Q6_Wb_vsub_WbWb(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubb_dv)(Vuu,Vvv)
2935#endif /* __HEXAGON_ARCH___ >= 60 */
29362406
2937#if __HVX_ARCH__ >= 60
2938/* ==========================================================================2407/* ==========================================================================
2939 Assembly Syntax: if (!Qv4) Vx32.b-=Vu32.b2408 Assembly Syntax: if (!Qv4) Vx32.b-=Vu32.b
2940 C Intrinsic Prototype: HVX_Vector Q6_Vb_condnac_QnVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)2409 C Intrinsic Prototype: HVX_Vector Q6_Vb_condnac_QnVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -2943,9 +2412,7 @@...@@ -2943,9 +2412,7 @@
2943 ========================================================================== */2412 ========================================================================== */
29442413
2945#define Q6_Vb_condnac_QnVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)2414#define Q6_Vb_condnac_QnVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
2946#endif /* __HEXAGON_ARCH___ >= 60 */
29472415
2948#if __HVX_ARCH__ >= 60
2949/* ==========================================================================2416/* ==========================================================================
2950 Assembly Syntax: if (Qv4) Vx32.b-=Vu32.b2417 Assembly Syntax: if (Qv4) Vx32.b-=Vu32.b
2951 C Intrinsic Prototype: HVX_Vector Q6_Vb_condnac_QVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)2418 C Intrinsic Prototype: HVX_Vector Q6_Vb_condnac_QVbVb(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -2954,9 +2421,7 @@...@@ -2954,9 +2421,7 @@
2954 ========================================================================== */2421 ========================================================================== */
29552422
2956#define Q6_Vb_condnac_QVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)2423#define Q6_Vb_condnac_QVbVb(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
2957#endif /* __HEXAGON_ARCH___ >= 60 */
29582424
2959#if __HVX_ARCH__ >= 60
2960/* ==========================================================================2425/* ==========================================================================
2961 Assembly Syntax: Vd32.h=vsub(Vu32.h,Vv32.h)2426 Assembly Syntax: Vd32.h=vsub(Vu32.h,Vv32.h)
2962 C Intrinsic Prototype: HVX_Vector Q6_Vh_vsub_VhVh(HVX_Vector Vu, HVX_Vector Vv)2427 C Intrinsic Prototype: HVX_Vector Q6_Vh_vsub_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -2965,9 +2430,7 @@...@@ -2965,9 +2430,7 @@
2965 ========================================================================== */2430 ========================================================================== */
29662431
2967#define Q6_Vh_vsub_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubh)(Vu,Vv)2432#define Q6_Vh_vsub_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubh)(Vu,Vv)
2968#endif /* __HEXAGON_ARCH___ >= 60 */
29692433
2970#if __HVX_ARCH__ >= 60
2971/* ==========================================================================2434/* ==========================================================================
2972 Assembly Syntax: Vdd32.h=vsub(Vuu32.h,Vvv32.h)2435 Assembly Syntax: Vdd32.h=vsub(Vuu32.h,Vvv32.h)
2973 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsub_WhWh(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2436 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsub_WhWh(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -2976,9 +2439,7 @@...@@ -2976,9 +2439,7 @@
2976 ========================================================================== */2439 ========================================================================== */
29772440
2978#define Q6_Wh_vsub_WhWh(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubh_dv)(Vuu,Vvv)2441#define Q6_Wh_vsub_WhWh(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubh_dv)(Vuu,Vvv)
2979#endif /* __HEXAGON_ARCH___ >= 60 */
29802442
2981#if __HVX_ARCH__ >= 60
2982/* ==========================================================================2443/* ==========================================================================
2983 Assembly Syntax: if (!Qv4) Vx32.h-=Vu32.h2444 Assembly Syntax: if (!Qv4) Vx32.h-=Vu32.h
2984 C Intrinsic Prototype: HVX_Vector Q6_Vh_condnac_QnVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)2445 C Intrinsic Prototype: HVX_Vector Q6_Vh_condnac_QnVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -2987,9 +2448,7 @@...@@ -2987,9 +2448,7 @@
2987 ========================================================================== */2448 ========================================================================== */
29882449
2989#define Q6_Vh_condnac_QnVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)2450#define Q6_Vh_condnac_QnVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
2990#endif /* __HEXAGON_ARCH___ >= 60 */
29912451
2992#if __HVX_ARCH__ >= 60
2993/* ==========================================================================2452/* ==========================================================================
2994 Assembly Syntax: if (Qv4) Vx32.h-=Vu32.h2453 Assembly Syntax: if (Qv4) Vx32.h-=Vu32.h
2995 C Intrinsic Prototype: HVX_Vector Q6_Vh_condnac_QVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)2454 C Intrinsic Prototype: HVX_Vector Q6_Vh_condnac_QVhVh(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -2998,9 +2457,7 @@...@@ -2998,9 +2457,7 @@
2998 ========================================================================== */2457 ========================================================================== */
29992458
3000#define Q6_Vh_condnac_QVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)2459#define Q6_Vh_condnac_QVhVh(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
3001#endif /* __HEXAGON_ARCH___ >= 60 */
30022460
3003#if __HVX_ARCH__ >= 60
3004/* ==========================================================================2461/* ==========================================================================
3005 Assembly Syntax: Vd32.h=vsub(Vu32.h,Vv32.h):sat2462 Assembly Syntax: Vd32.h=vsub(Vu32.h,Vv32.h):sat
3006 C Intrinsic Prototype: HVX_Vector Q6_Vh_vsub_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)2463 C Intrinsic Prototype: HVX_Vector Q6_Vh_vsub_VhVh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3009,9 +2466,7 @@...@@ -3009,9 +2466,7 @@
3009 ========================================================================== */2466 ========================================================================== */
30102467
3011#define Q6_Vh_vsub_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhsat)(Vu,Vv)2468#define Q6_Vh_vsub_VhVh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhsat)(Vu,Vv)
3012#endif /* __HEXAGON_ARCH___ >= 60 */
30132469
3014#if __HVX_ARCH__ >= 60
3015/* ==========================================================================2470/* ==========================================================================
3016 Assembly Syntax: Vdd32.h=vsub(Vuu32.h,Vvv32.h):sat2471 Assembly Syntax: Vdd32.h=vsub(Vuu32.h,Vvv32.h):sat
3017 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsub_WhWh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2472 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsub_WhWh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -3020,9 +2475,7 @@...@@ -3020,9 +2475,7 @@
3020 ========================================================================== */2475 ========================================================================== */
30212476
3022#define Q6_Wh_vsub_WhWh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhsat_dv)(Vuu,Vvv)2477#define Q6_Wh_vsub_WhWh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhsat_dv)(Vuu,Vvv)
3023#endif /* __HEXAGON_ARCH___ >= 60 */
30242478
3025#if __HVX_ARCH__ >= 60
3026/* ==========================================================================2479/* ==========================================================================
3027 Assembly Syntax: Vdd32.w=vsub(Vu32.h,Vv32.h)2480 Assembly Syntax: Vdd32.w=vsub(Vu32.h,Vv32.h)
3028 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_VhVh(HVX_Vector Vu, HVX_Vector Vv)2481 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_VhVh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3031,9 +2484,7 @@...@@ -3031,9 +2484,7 @@
3031 ========================================================================== */2484 ========================================================================== */
30322485
3033#define Q6_Ww_vsub_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhw)(Vu,Vv)2486#define Q6_Ww_vsub_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubhw)(Vu,Vv)
3034#endif /* __HEXAGON_ARCH___ >= 60 */
30352487
3036#if __HVX_ARCH__ >= 60
3037/* ==========================================================================2488/* ==========================================================================
3038 Assembly Syntax: Vdd32.h=vsub(Vu32.ub,Vv32.ub)2489 Assembly Syntax: Vdd32.h=vsub(Vu32.ub,Vv32.ub)
3039 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsub_VubVub(HVX_Vector Vu, HVX_Vector Vv)2490 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vsub_VubVub(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3042,9 +2493,7 @@...@@ -3042,9 +2493,7 @@
3042 ========================================================================== */2493 ========================================================================== */
30432494
3044#define Q6_Wh_vsub_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsububh)(Vu,Vv)2495#define Q6_Wh_vsub_VubVub(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsububh)(Vu,Vv)
3045#endif /* __HEXAGON_ARCH___ >= 60 */
30462496
3047#if __HVX_ARCH__ >= 60
3048/* ==========================================================================2497/* ==========================================================================
3049 Assembly Syntax: Vd32.ub=vsub(Vu32.ub,Vv32.ub):sat2498 Assembly Syntax: Vd32.ub=vsub(Vu32.ub,Vv32.ub):sat
3050 C Intrinsic Prototype: HVX_Vector Q6_Vub_vsub_VubVub_sat(HVX_Vector Vu, HVX_Vector Vv)2499 C Intrinsic Prototype: HVX_Vector Q6_Vub_vsub_VubVub_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3053,9 +2502,7 @@...@@ -3053,9 +2502,7 @@
3053 ========================================================================== */2502 ========================================================================== */
30542503
3055#define Q6_Vub_vsub_VubVub_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsububsat)(Vu,Vv)2504#define Q6_Vub_vsub_VubVub_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsububsat)(Vu,Vv)
3056#endif /* __HEXAGON_ARCH___ >= 60 */
30572505
3058#if __HVX_ARCH__ >= 60
3059/* ==========================================================================2506/* ==========================================================================
3060 Assembly Syntax: Vdd32.ub=vsub(Vuu32.ub,Vvv32.ub):sat2507 Assembly Syntax: Vdd32.ub=vsub(Vuu32.ub,Vvv32.ub):sat
3061 C Intrinsic Prototype: HVX_VectorPair Q6_Wub_vsub_WubWub_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2508 C Intrinsic Prototype: HVX_VectorPair Q6_Wub_vsub_WubWub_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -3064,9 +2511,7 @@...@@ -3064,9 +2511,7 @@
3064 ========================================================================== */2511 ========================================================================== */
30652512
3066#define Q6_Wub_vsub_WubWub_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsububsat_dv)(Vuu,Vvv)2513#define Q6_Wub_vsub_WubWub_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsububsat_dv)(Vuu,Vvv)
3067#endif /* __HEXAGON_ARCH___ >= 60 */
30682514
3069#if __HVX_ARCH__ >= 60
3070/* ==========================================================================2515/* ==========================================================================
3071 Assembly Syntax: Vd32.uh=vsub(Vu32.uh,Vv32.uh):sat2516 Assembly Syntax: Vd32.uh=vsub(Vu32.uh,Vv32.uh):sat
3072 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vsub_VuhVuh_sat(HVX_Vector Vu, HVX_Vector Vv)2517 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vsub_VuhVuh_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3075,9 +2520,7 @@...@@ -3075,9 +2520,7 @@
3075 ========================================================================== */2520 ========================================================================== */
30762521
3077#define Q6_Vuh_vsub_VuhVuh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuhsat)(Vu,Vv)2522#define Q6_Vuh_vsub_VuhVuh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuhsat)(Vu,Vv)
3078#endif /* __HEXAGON_ARCH___ >= 60 */
30792523
3080#if __HVX_ARCH__ >= 60
3081/* ==========================================================================2524/* ==========================================================================
3082 Assembly Syntax: Vdd32.uh=vsub(Vuu32.uh,Vvv32.uh):sat2525 Assembly Syntax: Vdd32.uh=vsub(Vuu32.uh,Vvv32.uh):sat
3083 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vsub_WuhWuh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2526 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vsub_WuhWuh_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -3086,9 +2529,7 @@...@@ -3086,9 +2529,7 @@
3086 ========================================================================== */2529 ========================================================================== */
30872530
3088#define Q6_Wuh_vsub_WuhWuh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuhsat_dv)(Vuu,Vvv)2531#define Q6_Wuh_vsub_WuhWuh_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuhsat_dv)(Vuu,Vvv)
3089#endif /* __HEXAGON_ARCH___ >= 60 */
30902532
3091#if __HVX_ARCH__ >= 60
3092/* ==========================================================================2533/* ==========================================================================
3093 Assembly Syntax: Vdd32.w=vsub(Vu32.uh,Vv32.uh)2534 Assembly Syntax: Vdd32.w=vsub(Vu32.uh,Vv32.uh)
3094 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)2535 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_VuhVuh(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3097,9 +2538,7 @@...@@ -3097,9 +2538,7 @@
3097 ========================================================================== */2538 ========================================================================== */
30982539
3099#define Q6_Ww_vsub_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuhw)(Vu,Vv)2540#define Q6_Ww_vsub_VuhVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuhw)(Vu,Vv)
3100#endif /* __HEXAGON_ARCH___ >= 60 */
31012541
3102#if __HVX_ARCH__ >= 60
3103/* ==========================================================================2542/* ==========================================================================
3104 Assembly Syntax: Vd32.w=vsub(Vu32.w,Vv32.w)2543 Assembly Syntax: Vd32.w=vsub(Vu32.w,Vv32.w)
3105 C Intrinsic Prototype: HVX_Vector Q6_Vw_vsub_VwVw(HVX_Vector Vu, HVX_Vector Vv)2544 C Intrinsic Prototype: HVX_Vector Q6_Vw_vsub_VwVw(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3108,9 +2547,7 @@...@@ -3108,9 +2547,7 @@
3108 ========================================================================== */2547 ========================================================================== */
31092548
3110#define Q6_Vw_vsub_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubw)(Vu,Vv)2549#define Q6_Vw_vsub_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubw)(Vu,Vv)
3111#endif /* __HEXAGON_ARCH___ >= 60 */
31122550
3113#if __HVX_ARCH__ >= 60
3114/* ==========================================================================2551/* ==========================================================================
3115 Assembly Syntax: Vdd32.w=vsub(Vuu32.w,Vvv32.w)2552 Assembly Syntax: Vdd32.w=vsub(Vuu32.w,Vvv32.w)
3116 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_WwWw(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2553 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_WwWw(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -3119,9 +2556,7 @@...@@ -3119,9 +2556,7 @@
3119 ========================================================================== */2556 ========================================================================== */
31202557
3121#define Q6_Ww_vsub_WwWw(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubw_dv)(Vuu,Vvv)2558#define Q6_Ww_vsub_WwWw(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubw_dv)(Vuu,Vvv)
3122#endif /* __HEXAGON_ARCH___ >= 60 */
31232559
3124#if __HVX_ARCH__ >= 60
3125/* ==========================================================================2560/* ==========================================================================
3126 Assembly Syntax: if (!Qv4) Vx32.w-=Vu32.w2561 Assembly Syntax: if (!Qv4) Vx32.w-=Vu32.w
3127 C Intrinsic Prototype: HVX_Vector Q6_Vw_condnac_QnVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)2562 C Intrinsic Prototype: HVX_Vector Q6_Vw_condnac_QnVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -3130,9 +2565,7 @@...@@ -3130,9 +2565,7 @@
3130 ========================================================================== */2565 ========================================================================== */
31312566
3132#define Q6_Vw_condnac_QnVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)2567#define Q6_Vw_condnac_QnVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwnq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
3133#endif /* __HEXAGON_ARCH___ >= 60 */
31342568
3135#if __HVX_ARCH__ >= 60
3136/* ==========================================================================2569/* ==========================================================================
3137 Assembly Syntax: if (Qv4) Vx32.w-=Vu32.w2570 Assembly Syntax: if (Qv4) Vx32.w-=Vu32.w
3138 C Intrinsic Prototype: HVX_Vector Q6_Vw_condnac_QVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)2571 C Intrinsic Prototype: HVX_Vector Q6_Vw_condnac_QVwVw(HVX_VectorPred Qv, HVX_Vector Vx, HVX_Vector Vu)
...@@ -3141,9 +2574,7 @@...@@ -3141,9 +2574,7 @@
3141 ========================================================================== */2574 ========================================================================== */
31422575
3143#define Q6_Vw_condnac_QVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)2576#define Q6_Vw_condnac_QVwVw(Qv,Vx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vx,Vu)
3144#endif /* __HEXAGON_ARCH___ >= 60 */
31452577
3146#if __HVX_ARCH__ >= 60
3147/* ==========================================================================2578/* ==========================================================================
3148 Assembly Syntax: Vd32.w=vsub(Vu32.w,Vv32.w):sat2579 Assembly Syntax: Vd32.w=vsub(Vu32.w,Vv32.w):sat
3149 C Intrinsic Prototype: HVX_Vector Q6_Vw_vsub_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)2580 C Intrinsic Prototype: HVX_Vector Q6_Vw_vsub_VwVw_sat(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3152,9 +2583,7 @@...@@ -3152,9 +2583,7 @@
3152 ========================================================================== */2583 ========================================================================== */
31532584
3154#define Q6_Vw_vsub_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwsat)(Vu,Vv)2585#define Q6_Vw_vsub_VwVw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwsat)(Vu,Vv)
3155#endif /* __HEXAGON_ARCH___ >= 60 */
31562586
3157#if __HVX_ARCH__ >= 60
3158/* ==========================================================================2587/* ==========================================================================
3159 Assembly Syntax: Vdd32.w=vsub(Vuu32.w,Vvv32.w):sat2588 Assembly Syntax: Vdd32.w=vsub(Vuu32.w,Vvv32.w):sat
3160 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_WwWw_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)2589 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vsub_WwWw_sat(HVX_VectorPair Vuu, HVX_VectorPair Vvv)
...@@ -3163,9 +2592,7 @@...@@ -3163,9 +2592,7 @@
3163 ========================================================================== */2592 ========================================================================== */
31642593
3165#define Q6_Ww_vsub_WwWw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwsat_dv)(Vuu,Vvv)2594#define Q6_Ww_vsub_WwWw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubwsat_dv)(Vuu,Vvv)
3166#endif /* __HEXAGON_ARCH___ >= 60 */
31672595
3168#if __HVX_ARCH__ >= 60
3169/* ==========================================================================2596/* ==========================================================================
3170 Assembly Syntax: Vdd32=vswap(Qt4,Vu32,Vv32)2597 Assembly Syntax: Vdd32=vswap(Qt4,Vu32,Vv32)
3171 C Intrinsic Prototype: HVX_VectorPair Q6_W_vswap_QVV(HVX_VectorPred Qt, HVX_Vector Vu, HVX_Vector Vv)2598 C Intrinsic Prototype: HVX_VectorPair Q6_W_vswap_QVV(HVX_VectorPred Qt, HVX_Vector Vu, HVX_Vector Vv)
...@@ -3174,9 +2601,7 @@...@@ -3174,9 +2601,7 @@
3174 ========================================================================== */2601 ========================================================================== */
31752602
3176#define Q6_W_vswap_QVV(Qt,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vswap)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1),Vu,Vv)2603#define Q6_W_vswap_QVV(Qt,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vswap)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1),Vu,Vv)
3177#endif /* __HEXAGON_ARCH___ >= 60 */
31782604
3179#if __HVX_ARCH__ >= 60
3180/* ==========================================================================2605/* ==========================================================================
3181 Assembly Syntax: Vdd32.h=vtmpy(Vuu32.b,Rt32.b)2606 Assembly Syntax: Vdd32.h=vtmpy(Vuu32.b,Rt32.b)
3182 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpy_WbRb(HVX_VectorPair Vuu, Word32 Rt)2607 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpy_WbRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -3185,9 +2610,7 @@...@@ -3185,9 +2610,7 @@
3185 ========================================================================== */2610 ========================================================================== */
31862611
3187#define Q6_Wh_vtmpy_WbRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyb)(Vuu,Rt)2612#define Q6_Wh_vtmpy_WbRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyb)(Vuu,Rt)
3188#endif /* __HEXAGON_ARCH___ >= 60 */
31892613
3190#if __HVX_ARCH__ >= 60
3191/* ==========================================================================2614/* ==========================================================================
3192 Assembly Syntax: Vxx32.h+=vtmpy(Vuu32.b,Rt32.b)2615 Assembly Syntax: Vxx32.h+=vtmpy(Vuu32.b,Rt32.b)
3193 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpyacc_WhWbRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)2616 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpyacc_WhWbRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -3196,9 +2619,7 @@...@@ -3196,9 +2619,7 @@
3196 ========================================================================== */2619 ========================================================================== */
31972620
3198#define Q6_Wh_vtmpyacc_WhWbRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyb_acc)(Vxx,Vuu,Rt)2621#define Q6_Wh_vtmpyacc_WhWbRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyb_acc)(Vxx,Vuu,Rt)
3199#endif /* __HEXAGON_ARCH___ >= 60 */
32002622
3201#if __HVX_ARCH__ >= 60
3202/* ==========================================================================2623/* ==========================================================================
3203 Assembly Syntax: Vdd32.h=vtmpy(Vuu32.ub,Rt32.b)2624 Assembly Syntax: Vdd32.h=vtmpy(Vuu32.ub,Rt32.b)
3204 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpy_WubRb(HVX_VectorPair Vuu, Word32 Rt)2625 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpy_WubRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -3207,9 +2628,7 @@...@@ -3207,9 +2628,7 @@
3207 ========================================================================== */2628 ========================================================================== */
32082629
3209#define Q6_Wh_vtmpy_WubRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpybus)(Vuu,Rt)2630#define Q6_Wh_vtmpy_WubRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpybus)(Vuu,Rt)
3210#endif /* __HEXAGON_ARCH___ >= 60 */
32112631
3212#if __HVX_ARCH__ >= 60
3213/* ==========================================================================2632/* ==========================================================================
3214 Assembly Syntax: Vxx32.h+=vtmpy(Vuu32.ub,Rt32.b)2633 Assembly Syntax: Vxx32.h+=vtmpy(Vuu32.ub,Rt32.b)
3215 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpyacc_WhWubRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)2634 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vtmpyacc_WhWubRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -3218,9 +2637,7 @@...@@ -3218,9 +2637,7 @@
3218 ========================================================================== */2637 ========================================================================== */
32192638
3220#define Q6_Wh_vtmpyacc_WhWubRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpybus_acc)(Vxx,Vuu,Rt)2639#define Q6_Wh_vtmpyacc_WhWubRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpybus_acc)(Vxx,Vuu,Rt)
3221#endif /* __HEXAGON_ARCH___ >= 60 */
32222640
3223#if __HVX_ARCH__ >= 60
3224/* ==========================================================================2641/* ==========================================================================
3225 Assembly Syntax: Vdd32.w=vtmpy(Vuu32.h,Rt32.b)2642 Assembly Syntax: Vdd32.w=vtmpy(Vuu32.h,Rt32.b)
3226 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vtmpy_WhRb(HVX_VectorPair Vuu, Word32 Rt)2643 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vtmpy_WhRb(HVX_VectorPair Vuu, Word32 Rt)
...@@ -3229,9 +2646,7 @@...@@ -3229,9 +2646,7 @@
3229 ========================================================================== */2646 ========================================================================== */
32302647
3231#define Q6_Ww_vtmpy_WhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyhb)(Vuu,Rt)2648#define Q6_Ww_vtmpy_WhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyhb)(Vuu,Rt)
3232#endif /* __HEXAGON_ARCH___ >= 60 */
32332649
3234#if __HVX_ARCH__ >= 60
3235/* ==========================================================================2650/* ==========================================================================
3236 Assembly Syntax: Vxx32.w+=vtmpy(Vuu32.h,Rt32.b)2651 Assembly Syntax: Vxx32.w+=vtmpy(Vuu32.h,Rt32.b)
3237 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vtmpyacc_WwWhRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)2652 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vtmpyacc_WwWhRb(HVX_VectorPair Vxx, HVX_VectorPair Vuu, Word32 Rt)
...@@ -3240,9 +2655,7 @@...@@ -3240,9 +2655,7 @@
3240 ========================================================================== */2655 ========================================================================== */
32412656
3242#define Q6_Ww_vtmpyacc_WwWhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyhb_acc)(Vxx,Vuu,Rt)2657#define Q6_Ww_vtmpyacc_WwWhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vtmpyhb_acc)(Vxx,Vuu,Rt)
3243#endif /* __HEXAGON_ARCH___ >= 60 */
32442658
3245#if __HVX_ARCH__ >= 60
3246/* ==========================================================================2659/* ==========================================================================
3247 Assembly Syntax: Vdd32.h=vunpack(Vu32.b)2660 Assembly Syntax: Vdd32.h=vunpack(Vu32.b)
3248 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vunpack_Vb(HVX_Vector Vu)2661 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vunpack_Vb(HVX_Vector Vu)
...@@ -3251,9 +2664,7 @@...@@ -3251,9 +2664,7 @@
3251 ========================================================================== */2664 ========================================================================== */
32522665
3253#define Q6_Wh_vunpack_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackb)(Vu)2666#define Q6_Wh_vunpack_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackb)(Vu)
3254#endif /* __HEXAGON_ARCH___ >= 60 */
32552667
3256#if __HVX_ARCH__ >= 60
3257/* ==========================================================================2668/* ==========================================================================
3258 Assembly Syntax: Vdd32.w=vunpack(Vu32.h)2669 Assembly Syntax: Vdd32.w=vunpack(Vu32.h)
3259 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vunpack_Vh(HVX_Vector Vu)2670 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vunpack_Vh(HVX_Vector Vu)
...@@ -3262,9 +2673,7 @@...@@ -3262,9 +2673,7 @@
3262 ========================================================================== */2673 ========================================================================== */
32632674
3264#define Q6_Ww_vunpack_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackh)(Vu)2675#define Q6_Ww_vunpack_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackh)(Vu)
3265#endif /* __HEXAGON_ARCH___ >= 60 */
32662676
3267#if __HVX_ARCH__ >= 60
3268/* ==========================================================================2677/* ==========================================================================
3269 Assembly Syntax: Vxx32.h|=vunpacko(Vu32.b)2678 Assembly Syntax: Vxx32.h|=vunpacko(Vu32.b)
3270 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vunpackoor_WhVb(HVX_VectorPair Vxx, HVX_Vector Vu)2679 C Intrinsic Prototype: HVX_VectorPair Q6_Wh_vunpackoor_WhVb(HVX_VectorPair Vxx, HVX_Vector Vu)
...@@ -3273,9 +2682,7 @@...@@ -3273,9 +2682,7 @@
3273 ========================================================================== */2682 ========================================================================== */
32742683
3275#define Q6_Wh_vunpackoor_WhVb(Vxx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackob)(Vxx,Vu)2684#define Q6_Wh_vunpackoor_WhVb(Vxx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackob)(Vxx,Vu)
3276#endif /* __HEXAGON_ARCH___ >= 60 */
32772685
3278#if __HVX_ARCH__ >= 60
3279/* ==========================================================================2686/* ==========================================================================
3280 Assembly Syntax: Vxx32.w|=vunpacko(Vu32.h)2687 Assembly Syntax: Vxx32.w|=vunpacko(Vu32.h)
3281 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vunpackoor_WwVh(HVX_VectorPair Vxx, HVX_Vector Vu)2688 C Intrinsic Prototype: HVX_VectorPair Q6_Ww_vunpackoor_WwVh(HVX_VectorPair Vxx, HVX_Vector Vu)
...@@ -3284,9 +2691,7 @@...@@ -3284,9 +2691,7 @@
3284 ========================================================================== */2691 ========================================================================== */
32852692
3286#define Q6_Ww_vunpackoor_WwVh(Vxx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackoh)(Vxx,Vu)2693#define Q6_Ww_vunpackoor_WwVh(Vxx,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackoh)(Vxx,Vu)
3287#endif /* __HEXAGON_ARCH___ >= 60 */
32882694
3289#if __HVX_ARCH__ >= 60
3290/* ==========================================================================2695/* ==========================================================================
3291 Assembly Syntax: Vdd32.uh=vunpack(Vu32.ub)2696 Assembly Syntax: Vdd32.uh=vunpack(Vu32.ub)
3292 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vunpack_Vub(HVX_Vector Vu)2697 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vunpack_Vub(HVX_Vector Vu)
...@@ -3295,9 +2700,7 @@...@@ -3295,9 +2700,7 @@
3295 ========================================================================== */2700 ========================================================================== */
32962701
3297#define Q6_Wuh_vunpack_Vub(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackub)(Vu)2702#define Q6_Wuh_vunpack_Vub(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackub)(Vu)
3298#endif /* __HEXAGON_ARCH___ >= 60 */
32992703
3300#if __HVX_ARCH__ >= 60
3301/* ==========================================================================2704/* ==========================================================================
3302 Assembly Syntax: Vdd32.uw=vunpack(Vu32.uh)2705 Assembly Syntax: Vdd32.uw=vunpack(Vu32.uh)
3303 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vunpack_Vuh(HVX_Vector Vu)2706 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vunpack_Vuh(HVX_Vector Vu)
...@@ -3306,9 +2709,7 @@...@@ -3306,9 +2709,7 @@
3306 ========================================================================== */2709 ========================================================================== */
33072710
3308#define Q6_Wuw_vunpack_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackuh)(Vu)2711#define Q6_Wuw_vunpack_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vunpackuh)(Vu)
3309#endif /* __HEXAGON_ARCH___ >= 60 */
33102712
3311#if __HVX_ARCH__ >= 60
3312/* ==========================================================================2713/* ==========================================================================
3313 Assembly Syntax: Vd32=vxor(Vu32,Vv32)2714 Assembly Syntax: Vd32=vxor(Vu32,Vv32)
3314 C Intrinsic Prototype: HVX_Vector Q6_V_vxor_VV(HVX_Vector Vu, HVX_Vector Vv)2715 C Intrinsic Prototype: HVX_Vector Q6_V_vxor_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -3317,9 +2718,7 @@...@@ -3317,9 +2718,7 @@
3317 ========================================================================== */2718 ========================================================================== */
33182719
3319#define Q6_V_vxor_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vxor)(Vu,Vv)2720#define Q6_V_vxor_VV(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vxor)(Vu,Vv)
3320#endif /* __HEXAGON_ARCH___ >= 60 */
33212721
3322#if __HVX_ARCH__ >= 60
3323/* ==========================================================================2722/* ==========================================================================
3324 Assembly Syntax: Vdd32.uh=vzxt(Vu32.ub)2723 Assembly Syntax: Vdd32.uh=vzxt(Vu32.ub)
3325 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vzxt_Vub(HVX_Vector Vu)2724 C Intrinsic Prototype: HVX_VectorPair Q6_Wuh_vzxt_Vub(HVX_Vector Vu)
...@@ -3328,9 +2727,7 @@...@@ -3328,9 +2727,7 @@
3328 ========================================================================== */2727 ========================================================================== */
33292728
3330#define Q6_Wuh_vzxt_Vub(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vzb)(Vu)2729#define Q6_Wuh_vzxt_Vub(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vzb)(Vu)
3331#endif /* __HEXAGON_ARCH___ >= 60 */
33322730
3333#if __HVX_ARCH__ >= 60
3334/* ==========================================================================2731/* ==========================================================================
3335 Assembly Syntax: Vdd32.uw=vzxt(Vu32.uh)2732 Assembly Syntax: Vdd32.uw=vzxt(Vu32.uh)
3336 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vzxt_Vuh(HVX_Vector Vu)2733 C Intrinsic Prototype: HVX_VectorPair Q6_Wuw_vzxt_Vuh(HVX_Vector Vu)
...@@ -3339,7 +2736,6 @@...@@ -3339,7 +2736,6 @@
3339 ========================================================================== */2736 ========================================================================== */
33402737
3341#define Q6_Wuw_vzxt_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vzh)(Vu)2738#define Q6_Wuw_vzxt_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vzh)(Vu)
3342#endif /* __HEXAGON_ARCH___ >= 60 */
33432739
3344#if __HVX_ARCH__ >= 622740#if __HVX_ARCH__ >= 62
3345/* ==========================================================================2741/* ==========================================================================
...@@ -3350,7 +2746,7 @@...@@ -3350,7 +2746,7 @@
3350 ========================================================================== */2746 ========================================================================== */
33512747
3352#define Q6_Vb_vsplat_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lvsplatb)(Rt)2748#define Q6_Vb_vsplat_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lvsplatb)(Rt)
3353#endif /* __HEXAGON_ARCH___ >= 62 */2749#endif
33542750
3355#if __HVX_ARCH__ >= 622751#if __HVX_ARCH__ >= 62
3356/* ==========================================================================2752/* ==========================================================================
...@@ -3361,7 +2757,7 @@...@@ -3361,7 +2757,7 @@
3361 ========================================================================== */2757 ========================================================================== */
33622758
3363#define Q6_Vh_vsplat_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lvsplath)(Rt)2759#define Q6_Vh_vsplat_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_lvsplath)(Rt)
3364#endif /* __HEXAGON_ARCH___ >= 62 */2760#endif
33652761
3366#if __HVX_ARCH__ >= 622762#if __HVX_ARCH__ >= 62
3367/* ==========================================================================2763/* ==========================================================================
...@@ -3372,7 +2768,7 @@...@@ -3372,7 +2768,7 @@
3372 ========================================================================== */2768 ========================================================================== */
33732769
3374#define Q6_Q_vsetq2_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_scalar2v2)(Rt)),-1)2770#define Q6_Q_vsetq2_R(Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_pred_scalar2v2)(Rt)),-1)
3375#endif /* __HEXAGON_ARCH___ >= 62 */2771#endif
33762772
3377#if __HVX_ARCH__ >= 622773#if __HVX_ARCH__ >= 62
3378/* ==========================================================================2774/* ==========================================================================
...@@ -3383,7 +2779,7 @@...@@ -3383,7 +2779,7 @@
3383 ========================================================================== */2779 ========================================================================== */
33842780
3385#define Q6_Qb_vshuffe_QhQh(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_shuffeqh)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)2781#define Q6_Qb_vshuffe_QhQh(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_shuffeqh)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
3386#endif /* __HEXAGON_ARCH___ >= 62 */2782#endif
33872783
3388#if __HVX_ARCH__ >= 622784#if __HVX_ARCH__ >= 62
3389/* ==========================================================================2785/* ==========================================================================
...@@ -3394,7 +2790,7 @@...@@ -3394,7 +2790,7 @@
3394 ========================================================================== */2790 ========================================================================== */
33952791
3396#define Q6_Qh_vshuffe_QwQw(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_shuffeqw)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)2792#define Q6_Qh_vshuffe_QwQw(Qs,Qt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_shuffeqw)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qt),-1))),-1)
3397#endif /* __HEXAGON_ARCH___ >= 62 */2793#endif
33982794
3399#if __HVX_ARCH__ >= 622795#if __HVX_ARCH__ >= 62
3400/* ==========================================================================2796/* ==========================================================================
...@@ -3405,7 +2801,7 @@...@@ -3405,7 +2801,7 @@
3405 ========================================================================== */2801 ========================================================================== */
34062802
3407#define Q6_Vb_vadd_VbVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbsat)(Vu,Vv)2803#define Q6_Vb_vadd_VbVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbsat)(Vu,Vv)
3408#endif /* __HEXAGON_ARCH___ >= 62 */2804#endif
34092805
3410#if __HVX_ARCH__ >= 622806#if __HVX_ARCH__ >= 62
3411/* ==========================================================================2807/* ==========================================================================
...@@ -3416,7 +2812,7 @@...@@ -3416,7 +2812,7 @@
3416 ========================================================================== */2812 ========================================================================== */
34172813
3418#define Q6_Wb_vadd_WbWb_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbsat_dv)(Vuu,Vvv)2814#define Q6_Wb_vadd_WbWb_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddbsat_dv)(Vuu,Vvv)
3419#endif /* __HEXAGON_ARCH___ >= 62 */2815#endif
34202816
3421#if __HVX_ARCH__ >= 622817#if __HVX_ARCH__ >= 62
3422/* ==========================================================================2818/* ==========================================================================
...@@ -3427,7 +2823,7 @@...@@ -3427,7 +2823,7 @@
3427 ========================================================================== */2823 ========================================================================== */
34282824
3429#define Q6_Vw_vadd_VwVwQ_carry(Vu,Vv,Qx) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddcarry)(Vu,Vv,Qx)2825#define Q6_Vw_vadd_VwVwQ_carry(Vu,Vv,Qx) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddcarry)(Vu,Vv,Qx)
3430#endif /* __HEXAGON_ARCH___ >= 62 */2826#endif
34312827
3432#if __HVX_ARCH__ >= 622828#if __HVX_ARCH__ >= 62
3433/* ==========================================================================2829/* ==========================================================================
...@@ -3438,7 +2834,7 @@...@@ -3438,7 +2834,7 @@
3438 ========================================================================== */2834 ========================================================================== */
34392835
3440#define Q6_Vh_vadd_vclb_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddclbh)(Vu,Vv)2836#define Q6_Vh_vadd_vclb_VhVh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddclbh)(Vu,Vv)
3441#endif /* __HEXAGON_ARCH___ >= 62 */2837#endif
34422838
3443#if __HVX_ARCH__ >= 622839#if __HVX_ARCH__ >= 62
3444/* ==========================================================================2840/* ==========================================================================
...@@ -3449,7 +2845,7 @@...@@ -3449,7 +2845,7 @@
3449 ========================================================================== */2845 ========================================================================== */
34502846
3451#define Q6_Vw_vadd_vclb_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddclbw)(Vu,Vv)2847#define Q6_Vw_vadd_vclb_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddclbw)(Vu,Vv)
3452#endif /* __HEXAGON_ARCH___ >= 62 */2848#endif
34532849
3454#if __HVX_ARCH__ >= 622850#if __HVX_ARCH__ >= 62
3455/* ==========================================================================2851/* ==========================================================================
...@@ -3460,7 +2856,7 @@...@@ -3460,7 +2856,7 @@
3460 ========================================================================== */2856 ========================================================================== */
34612857
3462#define Q6_Ww_vaddacc_WwVhVh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhw_acc)(Vxx,Vu,Vv)2858#define Q6_Ww_vaddacc_WwVhVh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddhw_acc)(Vxx,Vu,Vv)
3463#endif /* __HEXAGON_ARCH___ >= 62 */2859#endif
34642860
3465#if __HVX_ARCH__ >= 622861#if __HVX_ARCH__ >= 62
3466/* ==========================================================================2862/* ==========================================================================
...@@ -3471,7 +2867,7 @@...@@ -3471,7 +2867,7 @@
3471 ========================================================================== */2867 ========================================================================== */
34722868
3473#define Q6_Wh_vaddacc_WhVubVub(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubh_acc)(Vxx,Vu,Vv)2869#define Q6_Wh_vaddacc_WhVubVub(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddubh_acc)(Vxx,Vu,Vv)
3474#endif /* __HEXAGON_ARCH___ >= 62 */2870#endif
34752871
3476#if __HVX_ARCH__ >= 622872#if __HVX_ARCH__ >= 62
3477/* ==========================================================================2873/* ==========================================================================
...@@ -3482,7 +2878,7 @@...@@ -3482,7 +2878,7 @@
3482 ========================================================================== */2878 ========================================================================== */
34832879
3484#define Q6_Vub_vadd_VubVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddububb_sat)(Vu,Vv)2880#define Q6_Vub_vadd_VubVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddububb_sat)(Vu,Vv)
3485#endif /* __HEXAGON_ARCH___ >= 62 */2881#endif
34862882
3487#if __HVX_ARCH__ >= 622883#if __HVX_ARCH__ >= 62
3488/* ==========================================================================2884/* ==========================================================================
...@@ -3493,7 +2889,7 @@...@@ -3493,7 +2889,7 @@
3493 ========================================================================== */2889 ========================================================================== */
34942890
3495#define Q6_Ww_vaddacc_WwVuhVuh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhw_acc)(Vxx,Vu,Vv)2891#define Q6_Ww_vaddacc_WwVuhVuh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduhw_acc)(Vxx,Vu,Vv)
3496#endif /* __HEXAGON_ARCH___ >= 62 */2892#endif
34972893
3498#if __HVX_ARCH__ >= 622894#if __HVX_ARCH__ >= 62
3499/* ==========================================================================2895/* ==========================================================================
...@@ -3504,7 +2900,7 @@...@@ -3504,7 +2900,7 @@
3504 ========================================================================== */2900 ========================================================================== */
35052901
3506#define Q6_Vuw_vadd_VuwVuw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduwsat)(Vu,Vv)2902#define Q6_Vuw_vadd_VuwVuw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduwsat)(Vu,Vv)
3507#endif /* __HEXAGON_ARCH___ >= 62 */2903#endif
35082904
3509#if __HVX_ARCH__ >= 622905#if __HVX_ARCH__ >= 62
3510/* ==========================================================================2906/* ==========================================================================
...@@ -3515,7 +2911,7 @@...@@ -3515,7 +2911,7 @@
3515 ========================================================================== */2911 ========================================================================== */
35162912
3517#define Q6_Wuw_vadd_WuwWuw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduwsat_dv)(Vuu,Vvv)2913#define Q6_Wuw_vadd_WuwWuw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadduwsat_dv)(Vuu,Vvv)
3518#endif /* __HEXAGON_ARCH___ >= 62 */2914#endif
35192915
3520#if __HVX_ARCH__ >= 622916#if __HVX_ARCH__ >= 62
3521/* ==========================================================================2917/* ==========================================================================
...@@ -3526,7 +2922,7 @@...@@ -3526,7 +2922,7 @@
3526 ========================================================================== */2922 ========================================================================== */
35272923
3528#define Q6_V_vand_QnR(Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandnqrt)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)2924#define Q6_V_vand_QnR(Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandnqrt)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)
3529#endif /* __HEXAGON_ARCH___ >= 62 */2925#endif
35302926
3531#if __HVX_ARCH__ >= 622927#if __HVX_ARCH__ >= 62
3532/* ==========================================================================2928/* ==========================================================================
...@@ -3537,7 +2933,7 @@...@@ -3537,7 +2933,7 @@
3537 ========================================================================== */2933 ========================================================================== */
35382934
3539#define Q6_V_vandor_VQnR(Vx,Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandnqrt_acc)(Vx,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)2935#define Q6_V_vandor_VQnR(Vx,Qu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandnqrt_acc)(Vx,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qu),-1),Rt)
3540#endif /* __HEXAGON_ARCH___ >= 62 */2936#endif
35412937
3542#if __HVX_ARCH__ >= 622938#if __HVX_ARCH__ >= 62
3543/* ==========================================================================2939/* ==========================================================================
...@@ -3548,7 +2944,7 @@...@@ -3548,7 +2944,7 @@
3548 ========================================================================== */2944 ========================================================================== */
35492945
3550#define Q6_V_vand_QnV(Qv,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvnqv)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vu)2946#define Q6_V_vand_QnV(Qv,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvnqv)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vu)
3551#endif /* __HEXAGON_ARCH___ >= 62 */2947#endif
35522948
3553#if __HVX_ARCH__ >= 622949#if __HVX_ARCH__ >= 62
3554/* ==========================================================================2950/* ==========================================================================
...@@ -3559,7 +2955,7 @@...@@ -3559,7 +2955,7 @@
3559 ========================================================================== */2955 ========================================================================== */
35602956
3561#define Q6_V_vand_QV(Qv,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvqv)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vu)2957#define Q6_V_vand_QV(Qv,Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvqv)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1),Vu)
3562#endif /* __HEXAGON_ARCH___ >= 62 */2958#endif
35632959
3564#if __HVX_ARCH__ >= 622960#if __HVX_ARCH__ >= 62
3565/* ==========================================================================2961/* ==========================================================================
...@@ -3570,7 +2966,7 @@...@@ -3570,7 +2966,7 @@
3570 ========================================================================== */2966 ========================================================================== */
35712967
3572#define Q6_Vb_vasr_VhVhR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhbsat)(Vu,Vv,Rt)2968#define Q6_Vb_vasr_VhVhR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrhbsat)(Vu,Vv,Rt)
3573#endif /* __HEXAGON_ARCH___ >= 62 */2969#endif
35742970
3575#if __HVX_ARCH__ >= 622971#if __HVX_ARCH__ >= 62
3576/* ==========================================================================2972/* ==========================================================================
...@@ -3581,7 +2977,7 @@...@@ -3581,7 +2977,7 @@
3581 ========================================================================== */2977 ========================================================================== */
35822978
3583#define Q6_Vuh_vasr_VuwVuwR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruwuhrndsat)(Vu,Vv,Rt)2979#define Q6_Vuh_vasr_VuwVuwR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruwuhrndsat)(Vu,Vv,Rt)
3584#endif /* __HEXAGON_ARCH___ >= 62 */2980#endif
35852981
3586#if __HVX_ARCH__ >= 622982#if __HVX_ARCH__ >= 62
3587/* ==========================================================================2983/* ==========================================================================
...@@ -3592,7 +2988,7 @@...@@ -3592,7 +2988,7 @@
3592 ========================================================================== */2988 ========================================================================== */
35932989
3594#define Q6_Vuh_vasr_VwVwR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwuhrndsat)(Vu,Vv,Rt)2990#define Q6_Vuh_vasr_VwVwR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrwuhrndsat)(Vu,Vv,Rt)
3595#endif /* __HEXAGON_ARCH___ >= 62 */2991#endif
35962992
3597#if __HVX_ARCH__ >= 622993#if __HVX_ARCH__ >= 62
3598/* ==========================================================================2994/* ==========================================================================
...@@ -3603,7 +2999,7 @@...@@ -3603,7 +2999,7 @@
3603 ========================================================================== */2999 ========================================================================== */
36043000
3605#define Q6_Vub_vlsr_VubR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrb)(Vu,Rt)3001#define Q6_Vub_vlsr_VubR(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlsrb)(Vu,Rt)
3606#endif /* __HEXAGON_ARCH___ >= 62 */3002#endif
36073003
3608#if __HVX_ARCH__ >= 623004#if __HVX_ARCH__ >= 62
3609/* ==========================================================================3005/* ==========================================================================
...@@ -3614,7 +3010,7 @@...@@ -3614,7 +3010,7 @@
3614 ========================================================================== */3010 ========================================================================== */
36153011
3616#define Q6_Vb_vlut32_VbVbR_nomatch(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb_nm)(Vu,Vv,Rt)3012#define Q6_Vb_vlut32_VbVbR_nomatch(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb_nm)(Vu,Vv,Rt)
3617#endif /* __HEXAGON_ARCH___ >= 62 */3013#endif
36183014
3619#if __HVX_ARCH__ >= 623015#if __HVX_ARCH__ >= 62
3620/* ==========================================================================3016/* ==========================================================================
...@@ -3625,7 +3021,7 @@...@@ -3625,7 +3021,7 @@
3625 ========================================================================== */3021 ========================================================================== */
36263022
3627#define Q6_Vb_vlut32or_VbVbVbI(Vx,Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb_oracci)(Vx,Vu,Vv,Iu3)3023#define Q6_Vb_vlut32or_VbVbVbI(Vx,Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvb_oracci)(Vx,Vu,Vv,Iu3)
3628#endif /* __HEXAGON_ARCH___ >= 62 */3024#endif
36293025
3630#if __HVX_ARCH__ >= 623026#if __HVX_ARCH__ >= 62
3631/* ==========================================================================3027/* ==========================================================================
...@@ -3636,7 +3032,7 @@...@@ -3636,7 +3032,7 @@
3636 ========================================================================== */3032 ========================================================================== */
36373033
3638#define Q6_Vb_vlut32_VbVbI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvbi)(Vu,Vv,Iu3)3034#define Q6_Vb_vlut32_VbVbI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvvbi)(Vu,Vv,Iu3)
3639#endif /* __HEXAGON_ARCH___ >= 62 */3035#endif
36403036
3641#if __HVX_ARCH__ >= 623037#if __HVX_ARCH__ >= 62
3642/* ==========================================================================3038/* ==========================================================================
...@@ -3647,7 +3043,7 @@...@@ -3647,7 +3043,7 @@
3647 ========================================================================== */3043 ========================================================================== */
36483044
3649#define Q6_Wh_vlut16_VbVhR_nomatch(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh_nm)(Vu,Vv,Rt)3045#define Q6_Wh_vlut16_VbVhR_nomatch(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh_nm)(Vu,Vv,Rt)
3650#endif /* __HEXAGON_ARCH___ >= 62 */3046#endif
36513047
3652#if __HVX_ARCH__ >= 623048#if __HVX_ARCH__ >= 62
3653/* ==========================================================================3049/* ==========================================================================
...@@ -3658,7 +3054,7 @@...@@ -3658,7 +3054,7 @@
3658 ========================================================================== */3054 ========================================================================== */
36593055
3660#define Q6_Wh_vlut16or_WhVbVhI(Vxx,Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh_oracci)(Vxx,Vu,Vv,Iu3)3056#define Q6_Wh_vlut16or_WhVbVhI(Vxx,Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwh_oracci)(Vxx,Vu,Vv,Iu3)
3661#endif /* __HEXAGON_ARCH___ >= 62 */3057#endif
36623058
3663#if __HVX_ARCH__ >= 623059#if __HVX_ARCH__ >= 62
3664/* ==========================================================================3060/* ==========================================================================
...@@ -3669,7 +3065,7 @@...@@ -3669,7 +3065,7 @@
3669 ========================================================================== */3065 ========================================================================== */
36703066
3671#define Q6_Wh_vlut16_VbVhI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwhi)(Vu,Vv,Iu3)3067#define Q6_Wh_vlut16_VbVhI(Vu,Vv,Iu3) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlutvwhi)(Vu,Vv,Iu3)
3672#endif /* __HEXAGON_ARCH___ >= 62 */3068#endif
36733069
3674#if __HVX_ARCH__ >= 623070#if __HVX_ARCH__ >= 62
3675/* ==========================================================================3071/* ==========================================================================
...@@ -3680,7 +3076,7 @@...@@ -3680,7 +3076,7 @@
3680 ========================================================================== */3076 ========================================================================== */
36813077
3682#define Q6_Vb_vmax_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxb)(Vu,Vv)3078#define Q6_Vb_vmax_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmaxb)(Vu,Vv)
3683#endif /* __HEXAGON_ARCH___ >= 62 */3079#endif
36843080
3685#if __HVX_ARCH__ >= 623081#if __HVX_ARCH__ >= 62
3686/* ==========================================================================3082/* ==========================================================================
...@@ -3691,7 +3087,7 @@...@@ -3691,7 +3087,7 @@
3691 ========================================================================== */3087 ========================================================================== */
36923088
3693#define Q6_Vb_vmin_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminb)(Vu,Vv)3089#define Q6_Vb_vmin_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vminb)(Vu,Vv)
3694#endif /* __HEXAGON_ARCH___ >= 62 */3090#endif
36953091
3696#if __HVX_ARCH__ >= 623092#if __HVX_ARCH__ >= 62
3697/* ==========================================================================3093/* ==========================================================================
...@@ -3702,7 +3098,7 @@...@@ -3702,7 +3098,7 @@
3702 ========================================================================== */3098 ========================================================================== */
37033099
3704#define Q6_Ww_vmpa_WuhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpauhb)(Vuu,Rt)3100#define Q6_Ww_vmpa_WuhRb(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpauhb)(Vuu,Rt)
3705#endif /* __HEXAGON_ARCH___ >= 62 */3101#endif
37063102
3707#if __HVX_ARCH__ >= 623103#if __HVX_ARCH__ >= 62
3708/* ==========================================================================3104/* ==========================================================================
...@@ -3713,7 +3109,7 @@...@@ -3713,7 +3109,7 @@
3713 ========================================================================== */3109 ========================================================================== */
37143110
3715#define Q6_Ww_vmpaacc_WwWuhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpauhb_acc)(Vxx,Vuu,Rt)3111#define Q6_Ww_vmpaacc_WwWuhRb(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpauhb_acc)(Vxx,Vuu,Rt)
3716#endif /* __HEXAGON_ARCH___ >= 62 */3112#endif
37173113
3718#if __HVX_ARCH__ >= 623114#if __HVX_ARCH__ >= 62
3719/* ==========================================================================3115/* ==========================================================================
...@@ -3724,7 +3120,7 @@...@@ -3724,7 +3120,7 @@
3724 ========================================================================== */3120 ========================================================================== */
37253121
3726#define Q6_W_vmpye_VwVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyewuh_64)(Vu,Vv)3122#define Q6_W_vmpye_VwVuh(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyewuh_64)(Vu,Vv)
3727#endif /* __HEXAGON_ARCH___ >= 62 */3123#endif
37283124
3729#if __HVX_ARCH__ >= 623125#if __HVX_ARCH__ >= 62
3730/* ==========================================================================3126/* ==========================================================================
...@@ -3735,7 +3131,7 @@...@@ -3735,7 +3131,7 @@
3735 ========================================================================== */3131 ========================================================================== */
37363132
3737#define Q6_Vw_vmpyi_VwRub(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwub)(Vu,Rt)3133#define Q6_Vw_vmpyi_VwRub(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwub)(Vu,Rt)
3738#endif /* __HEXAGON_ARCH___ >= 62 */3134#endif
37393135
3740#if __HVX_ARCH__ >= 623136#if __HVX_ARCH__ >= 62
3741/* ==========================================================================3137/* ==========================================================================
...@@ -3746,7 +3142,7 @@...@@ -3746,7 +3142,7 @@
3746 ========================================================================== */3142 ========================================================================== */
37473143
3748#define Q6_Vw_vmpyiacc_VwVwRub(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwub_acc)(Vx,Vu,Rt)3144#define Q6_Vw_vmpyiacc_VwVwRub(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyiwub_acc)(Vx,Vu,Rt)
3749#endif /* __HEXAGON_ARCH___ >= 62 */3145#endif
37503146
3751#if __HVX_ARCH__ >= 623147#if __HVX_ARCH__ >= 62
3752/* ==========================================================================3148/* ==========================================================================
...@@ -3757,7 +3153,7 @@...@@ -3757,7 +3153,7 @@
3757 ========================================================================== */3153 ========================================================================== */
37583154
3759#define Q6_W_vmpyoacc_WVwVh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_64_acc)(Vxx,Vu,Vv)3155#define Q6_W_vmpyoacc_WVwVh(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyowh_64_acc)(Vxx,Vu,Vv)
3760#endif /* __HEXAGON_ARCH___ >= 62 */3156#endif
37613157
3762#if __HVX_ARCH__ >= 623158#if __HVX_ARCH__ >= 62
3763/* ==========================================================================3159/* ==========================================================================
...@@ -3768,7 +3164,7 @@...@@ -3768,7 +3164,7 @@
3768 ========================================================================== */3164 ========================================================================== */
37693165
3770#define Q6_Vub_vround_VuhVuh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrounduhub)(Vu,Vv)3166#define Q6_Vub_vround_VuhVuh_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrounduhub)(Vu,Vv)
3771#endif /* __HEXAGON_ARCH___ >= 62 */3167#endif
37723168
3773#if __HVX_ARCH__ >= 623169#if __HVX_ARCH__ >= 62
3774/* ==========================================================================3170/* ==========================================================================
...@@ -3779,7 +3175,7 @@...@@ -3779,7 +3175,7 @@
3779 ========================================================================== */3175 ========================================================================== */
37803176
3781#define Q6_Vuh_vround_VuwVuw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrounduwuh)(Vu,Vv)3177#define Q6_Vuh_vround_VuwVuw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrounduwuh)(Vu,Vv)
3782#endif /* __HEXAGON_ARCH___ >= 62 */3178#endif
37833179
3784#if __HVX_ARCH__ >= 623180#if __HVX_ARCH__ >= 62
3785/* ==========================================================================3181/* ==========================================================================
...@@ -3790,7 +3186,7 @@...@@ -3790,7 +3186,7 @@
3790 ========================================================================== */3186 ========================================================================== */
37913187
3792#define Q6_Vuh_vsat_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsatuwuh)(Vu,Vv)3188#define Q6_Vuh_vsat_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsatuwuh)(Vu,Vv)
3793#endif /* __HEXAGON_ARCH___ >= 62 */3189#endif
37943190
3795#if __HVX_ARCH__ >= 623191#if __HVX_ARCH__ >= 62
3796/* ==========================================================================3192/* ==========================================================================
...@@ -3801,7 +3197,7 @@...@@ -3801,7 +3197,7 @@
3801 ========================================================================== */3197 ========================================================================== */
38023198
3803#define Q6_Vb_vsub_VbVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbsat)(Vu,Vv)3199#define Q6_Vb_vsub_VbVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbsat)(Vu,Vv)
3804#endif /* __HEXAGON_ARCH___ >= 62 */3200#endif
38053201
3806#if __HVX_ARCH__ >= 623202#if __HVX_ARCH__ >= 62
3807/* ==========================================================================3203/* ==========================================================================
...@@ -3812,7 +3208,7 @@...@@ -3812,7 +3208,7 @@
3812 ========================================================================== */3208 ========================================================================== */
38133209
3814#define Q6_Wb_vsub_WbWb_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbsat_dv)(Vuu,Vvv)3210#define Q6_Wb_vsub_WbWb_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubbsat_dv)(Vuu,Vvv)
3815#endif /* __HEXAGON_ARCH___ >= 62 */3211#endif
38163212
3817#if __HVX_ARCH__ >= 623213#if __HVX_ARCH__ >= 62
3818/* ==========================================================================3214/* ==========================================================================
...@@ -3823,7 +3219,7 @@...@@ -3823,7 +3219,7 @@
3823 ========================================================================== */3219 ========================================================================== */
38243220
3825#define Q6_Vw_vsub_VwVwQ_carry(Vu,Vv,Qx) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubcarry)(Vu,Vv,Qx)3221#define Q6_Vw_vsub_VwVwQ_carry(Vu,Vv,Qx) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubcarry)(Vu,Vv,Qx)
3826#endif /* __HEXAGON_ARCH___ >= 62 */3222#endif
38273223
3828#if __HVX_ARCH__ >= 623224#if __HVX_ARCH__ >= 62
3829/* ==========================================================================3225/* ==========================================================================
...@@ -3834,7 +3230,7 @@...@@ -3834,7 +3230,7 @@
3834 ========================================================================== */3230 ========================================================================== */
38353231
3836#define Q6_Vub_vsub_VubVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubububb_sat)(Vu,Vv)3232#define Q6_Vub_vsub_VubVb_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubububb_sat)(Vu,Vv)
3837#endif /* __HEXAGON_ARCH___ >= 62 */3233#endif
38383234
3839#if __HVX_ARCH__ >= 623235#if __HVX_ARCH__ >= 62
3840/* ==========================================================================3236/* ==========================================================================
...@@ -3845,7 +3241,7 @@...@@ -3845,7 +3241,7 @@
3845 ========================================================================== */3241 ========================================================================== */
38463242
3847#define Q6_Vuw_vsub_VuwVuw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuwsat)(Vu,Vv)3243#define Q6_Vuw_vsub_VuwVuw_sat(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuwsat)(Vu,Vv)
3848#endif /* __HEXAGON_ARCH___ >= 62 */3244#endif
38493245
3850#if __HVX_ARCH__ >= 623246#if __HVX_ARCH__ >= 62
3851/* ==========================================================================3247/* ==========================================================================
...@@ -3856,7 +3252,7 @@...@@ -3856,7 +3252,7 @@
3856 ========================================================================== */3252 ========================================================================== */
38573253
3858#define Q6_Wuw_vsub_WuwWuw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuwsat_dv)(Vuu,Vvv)3254#define Q6_Wuw_vsub_WuwWuw_sat(Vuu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsubuwsat_dv)(Vuu,Vvv)
3859#endif /* __HEXAGON_ARCH___ >= 62 */3255#endif
38603256
3861#if __HVX_ARCH__ >= 653257#if __HVX_ARCH__ >= 65
3862/* ==========================================================================3258/* ==========================================================================
...@@ -3867,7 +3263,7 @@...@@ -3867,7 +3263,7 @@
3867 ========================================================================== */3263 ========================================================================== */
38683264
3869#define Q6_Vb_vabs_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsb)(Vu)3265#define Q6_Vb_vabs_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsb)(Vu)
3870#endif /* __HEXAGON_ARCH___ >= 65 */3266#endif
38713267
3872#if __HVX_ARCH__ >= 653268#if __HVX_ARCH__ >= 65
3873/* ==========================================================================3269/* ==========================================================================
...@@ -3878,7 +3274,7 @@...@@ -3878,7 +3274,7 @@
3878 ========================================================================== */3274 ========================================================================== */
38793275
3880#define Q6_Vb_vabs_Vb_sat(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsb_sat)(Vu)3276#define Q6_Vb_vabs_Vb_sat(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabsb_sat)(Vu)
3881#endif /* __HEXAGON_ARCH___ >= 65 */3277#endif
38823278
3883#if __HVX_ARCH__ >= 653279#if __HVX_ARCH__ >= 65
3884/* ==========================================================================3280/* ==========================================================================
...@@ -3889,7 +3285,7 @@...@@ -3889,7 +3285,7 @@
3889 ========================================================================== */3285 ========================================================================== */
38903286
3891#define Q6_Vh_vaslacc_VhVhR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslh_acc)(Vx,Vu,Rt)3287#define Q6_Vh_vaslacc_VhVhR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaslh_acc)(Vx,Vu,Rt)
3892#endif /* __HEXAGON_ARCH___ >= 65 */3288#endif
38933289
3894#if __HVX_ARCH__ >= 653290#if __HVX_ARCH__ >= 65
3895/* ==========================================================================3291/* ==========================================================================
...@@ -3900,7 +3296,7 @@...@@ -3900,7 +3296,7 @@
3900 ========================================================================== */3296 ========================================================================== */
39013297
3902#define Q6_Vh_vasracc_VhVhR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrh_acc)(Vx,Vu,Rt)3298#define Q6_Vh_vasracc_VhVhR(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrh_acc)(Vx,Vu,Rt)
3903#endif /* __HEXAGON_ARCH___ >= 65 */3299#endif
39043300
3905#if __HVX_ARCH__ >= 653301#if __HVX_ARCH__ >= 65
3906/* ==========================================================================3302/* ==========================================================================
...@@ -3911,7 +3307,7 @@...@@ -3911,7 +3307,7 @@
3911 ========================================================================== */3307 ========================================================================== */
39123308
3913#define Q6_Vub_vasr_VuhVuhR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruhubrndsat)(Vu,Vv,Rt)3309#define Q6_Vub_vasr_VuhVuhR_rnd_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruhubrndsat)(Vu,Vv,Rt)
3914#endif /* __HEXAGON_ARCH___ >= 65 */3310#endif
39153311
3916#if __HVX_ARCH__ >= 653312#if __HVX_ARCH__ >= 65
3917/* ==========================================================================3313/* ==========================================================================
...@@ -3922,7 +3318,7 @@...@@ -3922,7 +3318,7 @@
3922 ========================================================================== */3318 ========================================================================== */
39233319
3924#define Q6_Vub_vasr_VuhVuhR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruhubsat)(Vu,Vv,Rt)3320#define Q6_Vub_vasr_VuhVuhR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruhubsat)(Vu,Vv,Rt)
3925#endif /* __HEXAGON_ARCH___ >= 65 */3321#endif
39263322
3927#if __HVX_ARCH__ >= 653323#if __HVX_ARCH__ >= 65
3928/* ==========================================================================3324/* ==========================================================================
...@@ -3933,7 +3329,7 @@...@@ -3933,7 +3329,7 @@
3933 ========================================================================== */3329 ========================================================================== */
39343330
3935#define Q6_Vuh_vasr_VuwVuwR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruwuhsat)(Vu,Vv,Rt)3331#define Q6_Vuh_vasr_VuwVuwR_sat(Vu,Vv,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasruwuhsat)(Vu,Vv,Rt)
3936#endif /* __HEXAGON_ARCH___ >= 65 */3332#endif
39373333
3938#if __HVX_ARCH__ >= 653334#if __HVX_ARCH__ >= 65
3939/* ==========================================================================3335/* ==========================================================================
...@@ -3944,7 +3340,7 @@...@@ -3944,7 +3340,7 @@
3944 ========================================================================== */3340 ========================================================================== */
39453341
3946#define Q6_Vb_vavg_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgb)(Vu,Vv)3342#define Q6_Vb_vavg_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgb)(Vu,Vv)
3947#endif /* __HEXAGON_ARCH___ >= 65 */3343#endif
39483344
3949#if __HVX_ARCH__ >= 653345#if __HVX_ARCH__ >= 65
3950/* ==========================================================================3346/* ==========================================================================
...@@ -3955,7 +3351,7 @@...@@ -3955,7 +3351,7 @@
3955 ========================================================================== */3351 ========================================================================== */
39563352
3957#define Q6_Vb_vavg_VbVb_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgbrnd)(Vu,Vv)3353#define Q6_Vb_vavg_VbVb_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavgbrnd)(Vu,Vv)
3958#endif /* __HEXAGON_ARCH___ >= 65 */3354#endif
39593355
3960#if __HVX_ARCH__ >= 653356#if __HVX_ARCH__ >= 65
3961/* ==========================================================================3357/* ==========================================================================
...@@ -3966,7 +3362,7 @@...@@ -3966,7 +3362,7 @@
3966 ========================================================================== */3362 ========================================================================== */
39673363
3968#define Q6_Vuw_vavg_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguw)(Vu,Vv)3364#define Q6_Vuw_vavg_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguw)(Vu,Vv)
3969#endif /* __HEXAGON_ARCH___ >= 65 */3365#endif
39703366
3971#if __HVX_ARCH__ >= 653367#if __HVX_ARCH__ >= 65
3972/* ==========================================================================3368/* ==========================================================================
...@@ -3977,7 +3373,7 @@...@@ -3977,7 +3373,7 @@
3977 ========================================================================== */3373 ========================================================================== */
39783374
3979#define Q6_Vuw_vavg_VuwVuw_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguwrnd)(Vu,Vv)3375#define Q6_Vuw_vavg_VuwVuw_rnd(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vavguwrnd)(Vu,Vv)
3980#endif /* __HEXAGON_ARCH___ >= 65 */3376#endif
39813377
3982#if __HVX_ARCH__ >= 653378#if __HVX_ARCH__ >= 65
3983/* ==========================================================================3379/* ==========================================================================
...@@ -3988,7 +3384,7 @@...@@ -3988,7 +3384,7 @@
3988 ========================================================================== */3384 ========================================================================== */
39893385
3990#define Q6_W_vzero() __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdd0)()3386#define Q6_W_vzero() __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdd0)()
3991#endif /* __HEXAGON_ARCH___ >= 65 */3387#endif
39923388
3993#if __HVX_ARCH__ >= 653389#if __HVX_ARCH__ >= 65
3994/* ==========================================================================3390/* ==========================================================================
...@@ -3999,7 +3395,7 @@...@@ -3999,7 +3395,7 @@
3999 ========================================================================== */3395 ========================================================================== */
40003396
4001#define Q6_vgather_ARMVh(Rs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermh)(Rs,Rt,Mu,Vv)3397#define Q6_vgather_ARMVh(Rs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermh)(Rs,Rt,Mu,Vv)
4002#endif /* __HEXAGON_ARCH___ >= 65 */3398#endif
40033399
4004#if __HVX_ARCH__ >= 653400#if __HVX_ARCH__ >= 65
4005/* ==========================================================================3401/* ==========================================================================
...@@ -4010,7 +3406,7 @@...@@ -4010,7 +3406,7 @@
4010 ========================================================================== */3406 ========================================================================== */
40113407
4012#define Q6_vgather_AQRMVh(Rs,Qs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermhq)(Rs,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv)3408#define Q6_vgather_AQRMVh(Rs,Qs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermhq)(Rs,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv)
4013#endif /* __HEXAGON_ARCH___ >= 65 */3409#endif
40143410
4015#if __HVX_ARCH__ >= 653411#if __HVX_ARCH__ >= 65
4016/* ==========================================================================3412/* ==========================================================================
...@@ -4021,7 +3417,7 @@...@@ -4021,7 +3417,7 @@
4021 ========================================================================== */3417 ========================================================================== */
40223418
4023#define Q6_vgather_ARMWw(Rs,Rt,Mu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermhw)(Rs,Rt,Mu,Vvv)3419#define Q6_vgather_ARMWw(Rs,Rt,Mu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermhw)(Rs,Rt,Mu,Vvv)
4024#endif /* __HEXAGON_ARCH___ >= 65 */3420#endif
40253421
4026#if __HVX_ARCH__ >= 653422#if __HVX_ARCH__ >= 65
4027/* ==========================================================================3423/* ==========================================================================
...@@ -4032,7 +3428,7 @@...@@ -4032,7 +3428,7 @@
4032 ========================================================================== */3428 ========================================================================== */
40333429
4034#define Q6_vgather_AQRMWw(Rs,Qs,Rt,Mu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermhwq)(Rs,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vvv)3430#define Q6_vgather_AQRMWw(Rs,Qs,Rt,Mu,Vvv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermhwq)(Rs,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vvv)
4035#endif /* __HEXAGON_ARCH___ >= 65 */3431#endif
40363432
4037#if __HVX_ARCH__ >= 653433#if __HVX_ARCH__ >= 65
4038/* ==========================================================================3434/* ==========================================================================
...@@ -4043,7 +3439,7 @@...@@ -4043,7 +3439,7 @@
4043 ========================================================================== */3439 ========================================================================== */
40443440
4045#define Q6_vgather_ARMVw(Rs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermw)(Rs,Rt,Mu,Vv)3441#define Q6_vgather_ARMVw(Rs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermw)(Rs,Rt,Mu,Vv)
4046#endif /* __HEXAGON_ARCH___ >= 65 */3442#endif
40473443
4048#if __HVX_ARCH__ >= 653444#if __HVX_ARCH__ >= 65
4049/* ==========================================================================3445/* ==========================================================================
...@@ -4054,7 +3450,7 @@...@@ -4054,7 +3450,7 @@
4054 ========================================================================== */3450 ========================================================================== */
40553451
4056#define Q6_vgather_AQRMVw(Rs,Qs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermwq)(Rs,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv)3452#define Q6_vgather_AQRMVw(Rs,Qs,Rt,Mu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgathermwq)(Rs,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv)
4057#endif /* __HEXAGON_ARCH___ >= 65 */3453#endif
40583454
4059#if __HVX_ARCH__ >= 653455#if __HVX_ARCH__ >= 65
4060/* ==========================================================================3456/* ==========================================================================
...@@ -4065,7 +3461,7 @@...@@ -4065,7 +3461,7 @@
4065 ========================================================================== */3461 ========================================================================== */
40663462
4067#define Q6_Vh_vlut4_VuhPh(Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlut4)(Vu,Rtt)3463#define Q6_Vh_vlut4_VuhPh(Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vlut4)(Vu,Rtt)
4068#endif /* __HEXAGON_ARCH___ >= 65 */3464#endif
40693465
4070#if __HVX_ARCH__ >= 653466#if __HVX_ARCH__ >= 65
4071/* ==========================================================================3467/* ==========================================================================
...@@ -4076,7 +3472,7 @@...@@ -4076,7 +3472,7 @@
4076 ========================================================================== */3472 ========================================================================== */
40773473
4078#define Q6_Wh_vmpa_WubRub(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabuu)(Vuu,Rt)3474#define Q6_Wh_vmpa_WubRub(Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabuu)(Vuu,Rt)
4079#endif /* __HEXAGON_ARCH___ >= 65 */3475#endif
40803476
4081#if __HVX_ARCH__ >= 653477#if __HVX_ARCH__ >= 65
4082/* ==========================================================================3478/* ==========================================================================
...@@ -4087,7 +3483,7 @@...@@ -4087,7 +3483,7 @@
4087 ========================================================================== */3483 ========================================================================== */
40883484
4089#define Q6_Wh_vmpaacc_WhWubRub(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabuu_acc)(Vxx,Vuu,Rt)3485#define Q6_Wh_vmpaacc_WhWubRub(Vxx,Vuu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpabuu_acc)(Vxx,Vuu,Rt)
4090#endif /* __HEXAGON_ARCH___ >= 65 */3486#endif
40913487
4092#if __HVX_ARCH__ >= 653488#if __HVX_ARCH__ >= 65
4093/* ==========================================================================3489/* ==========================================================================
...@@ -4098,7 +3494,7 @@...@@ -4098,7 +3494,7 @@
4098 ========================================================================== */3494 ========================================================================== */
40993495
4100#define Q6_Vh_vmpa_VhVhVhPh_sat(Vx,Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpahhsat)(Vx,Vu,Rtt)3496#define Q6_Vh_vmpa_VhVhVhPh_sat(Vx,Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpahhsat)(Vx,Vu,Rtt)
4101#endif /* __HEXAGON_ARCH___ >= 65 */3497#endif
41023498
4103#if __HVX_ARCH__ >= 653499#if __HVX_ARCH__ >= 65
4104/* ==========================================================================3500/* ==========================================================================
...@@ -4109,7 +3505,7 @@...@@ -4109,7 +3505,7 @@
4109 ========================================================================== */3505 ========================================================================== */
41103506
4111#define Q6_Vh_vmpa_VhVhVuhPuh_sat(Vx,Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpauhuhsat)(Vx,Vu,Rtt)3507#define Q6_Vh_vmpa_VhVhVuhPuh_sat(Vx,Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpauhuhsat)(Vx,Vu,Rtt)
4112#endif /* __HEXAGON_ARCH___ >= 65 */3508#endif
41133509
4114#if __HVX_ARCH__ >= 653510#if __HVX_ARCH__ >= 65
4115/* ==========================================================================3511/* ==========================================================================
...@@ -4120,7 +3516,7 @@...@@ -4120,7 +3516,7 @@
4120 ========================================================================== */3516 ========================================================================== */
41213517
4122#define Q6_Vh_vmps_VhVhVuhPuh_sat(Vx,Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpsuhuhsat)(Vx,Vu,Rtt)3518#define Q6_Vh_vmps_VhVhVuhPuh_sat(Vx,Vu,Rtt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpsuhuhsat)(Vx,Vu,Rtt)
4123#endif /* __HEXAGON_ARCH___ >= 65 */3519#endif
41243520
4125#if __HVX_ARCH__ >= 653521#if __HVX_ARCH__ >= 65
4126/* ==========================================================================3522/* ==========================================================================
...@@ -4131,7 +3527,7 @@...@@ -4131,7 +3527,7 @@
4131 ========================================================================== */3527 ========================================================================== */
41323528
4133#define Q6_Ww_vmpyacc_WwVhRh(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyh_acc)(Vxx,Vu,Rt)3529#define Q6_Ww_vmpyacc_WwVhRh(Vxx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyh_acc)(Vxx,Vu,Rt)
4134#endif /* __HEXAGON_ARCH___ >= 65 */3530#endif
41353531
4136#if __HVX_ARCH__ >= 653532#if __HVX_ARCH__ >= 65
4137/* ==========================================================================3533/* ==========================================================================
...@@ -4142,7 +3538,7 @@...@@ -4142,7 +3538,7 @@
4142 ========================================================================== */3538 ========================================================================== */
41433539
4144#define Q6_Vuw_vmpye_VuhRuh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhe)(Vu,Rt)3540#define Q6_Vuw_vmpye_VuhRuh(Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhe)(Vu,Rt)
4145#endif /* __HEXAGON_ARCH___ >= 65 */3541#endif
41463542
4147#if __HVX_ARCH__ >= 653543#if __HVX_ARCH__ >= 65
4148/* ==========================================================================3544/* ==========================================================================
...@@ -4153,7 +3549,7 @@...@@ -4153,7 +3549,7 @@
4153 ========================================================================== */3549 ========================================================================== */
41543550
4155#define Q6_Vuw_vmpyeacc_VuwVuhRuh(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhe_acc)(Vx,Vu,Rt)3551#define Q6_Vuw_vmpyeacc_VuwVuhRuh(Vx,Vu,Rt) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhe_acc)(Vx,Vu,Rt)
4156#endif /* __HEXAGON_ARCH___ >= 65 */3552#endif
41573553
4158#if __HVX_ARCH__ >= 653554#if __HVX_ARCH__ >= 65
4159/* ==========================================================================3555/* ==========================================================================
...@@ -4164,7 +3560,7 @@...@@ -4164,7 +3560,7 @@
4164 ========================================================================== */3560 ========================================================================== */
41653561
4166#define Q6_Vb_vnavg_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgb)(Vu,Vv)3562#define Q6_Vb_vnavg_VbVb(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vnavgb)(Vu,Vv)
4167#endif /* __HEXAGON_ARCH___ >= 65 */3563#endif
41683564
4169#if __HVX_ARCH__ >= 653565#if __HVX_ARCH__ >= 65
4170/* ==========================================================================3566/* ==========================================================================
...@@ -4175,7 +3571,7 @@...@@ -4175,7 +3571,7 @@
4175 ========================================================================== */3571 ========================================================================== */
41763572
4177#define Q6_Vb_prefixsum_Q(Qv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vprefixqb)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1))3573#define Q6_Vb_prefixsum_Q(Qv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vprefixqb)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1))
4178#endif /* __HEXAGON_ARCH___ >= 65 */3574#endif
41793575
4180#if __HVX_ARCH__ >= 653576#if __HVX_ARCH__ >= 65
4181/* ==========================================================================3577/* ==========================================================================
...@@ -4186,7 +3582,7 @@...@@ -4186,7 +3582,7 @@
4186 ========================================================================== */3582 ========================================================================== */
41873583
4188#define Q6_Vh_prefixsum_Q(Qv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vprefixqh)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1))3584#define Q6_Vh_prefixsum_Q(Qv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vprefixqh)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1))
4189#endif /* __HEXAGON_ARCH___ >= 65 */3585#endif
41903586
4191#if __HVX_ARCH__ >= 653587#if __HVX_ARCH__ >= 65
4192/* ==========================================================================3588/* ==========================================================================
...@@ -4197,7 +3593,7 @@...@@ -4197,7 +3593,7 @@
4197 ========================================================================== */3593 ========================================================================== */
41983594
4199#define Q6_Vw_prefixsum_Q(Qv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vprefixqw)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1))3595#define Q6_Vw_prefixsum_Q(Qv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vprefixqw)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qv),-1))
4200#endif /* __HEXAGON_ARCH___ >= 65 */3596#endif
42013597
4202#if __HVX_ARCH__ >= 653598#if __HVX_ARCH__ >= 65
4203/* ==========================================================================3599/* ==========================================================================
...@@ -4208,7 +3604,7 @@...@@ -4208,7 +3604,7 @@
4208 ========================================================================== */3604 ========================================================================== */
42093605
4210#define Q6_vscatter_RMVhV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermh)(Rt,Mu,Vv,Vw)3606#define Q6_vscatter_RMVhV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermh)(Rt,Mu,Vv,Vw)
4211#endif /* __HEXAGON_ARCH___ >= 65 */3607#endif
42123608
4213#if __HVX_ARCH__ >= 653609#if __HVX_ARCH__ >= 65
4214/* ==========================================================================3610/* ==========================================================================
...@@ -4219,7 +3615,7 @@...@@ -4219,7 +3615,7 @@
4219 ========================================================================== */3615 ========================================================================== */
42203616
4221#define Q6_vscatteracc_RMVhV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermh_add)(Rt,Mu,Vv,Vw)3617#define Q6_vscatteracc_RMVhV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermh_add)(Rt,Mu,Vv,Vw)
4222#endif /* __HEXAGON_ARCH___ >= 65 */3618#endif
42233619
4224#if __HVX_ARCH__ >= 653620#if __HVX_ARCH__ >= 65
4225/* ==========================================================================3621/* ==========================================================================
...@@ -4230,7 +3626,7 @@...@@ -4230,7 +3626,7 @@
4230 ========================================================================== */3626 ========================================================================== */
42313627
4232#define Q6_vscatter_QRMVhV(Qs,Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv,Vw)3628#define Q6_vscatter_QRMVhV(Qs,Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv,Vw)
4233#endif /* __HEXAGON_ARCH___ >= 65 */3629#endif
42343630
4235#if __HVX_ARCH__ >= 653631#if __HVX_ARCH__ >= 65
4236/* ==========================================================================3632/* ==========================================================================
...@@ -4241,7 +3637,7 @@...@@ -4241,7 +3637,7 @@
4241 ========================================================================== */3637 ========================================================================== */
42423638
4243#define Q6_vscatter_RMWwV(Rt,Mu,Vvv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhw)(Rt,Mu,Vvv,Vw)3639#define Q6_vscatter_RMWwV(Rt,Mu,Vvv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhw)(Rt,Mu,Vvv,Vw)
4244#endif /* __HEXAGON_ARCH___ >= 65 */3640#endif
42453641
4246#if __HVX_ARCH__ >= 653642#if __HVX_ARCH__ >= 65
4247/* ==========================================================================3643/* ==========================================================================
...@@ -4252,7 +3648,7 @@...@@ -4252,7 +3648,7 @@
4252 ========================================================================== */3648 ========================================================================== */
42533649
4254#define Q6_vscatteracc_RMWwV(Rt,Mu,Vvv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhw_add)(Rt,Mu,Vvv,Vw)3650#define Q6_vscatteracc_RMWwV(Rt,Mu,Vvv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhw_add)(Rt,Mu,Vvv,Vw)
4255#endif /* __HEXAGON_ARCH___ >= 65 */3651#endif
42563652
4257#if __HVX_ARCH__ >= 653653#if __HVX_ARCH__ >= 65
4258/* ==========================================================================3654/* ==========================================================================
...@@ -4263,7 +3659,7 @@...@@ -4263,7 +3659,7 @@
4263 ========================================================================== */3659 ========================================================================== */
42643660
4265#define Q6_vscatter_QRMWwV(Qs,Rt,Mu,Vvv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vvv,Vw)3661#define Q6_vscatter_QRMWwV(Qs,Rt,Mu,Vvv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermhwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vvv,Vw)
4266#endif /* __HEXAGON_ARCH___ >= 65 */3662#endif
42673663
4268#if __HVX_ARCH__ >= 653664#if __HVX_ARCH__ >= 65
4269/* ==========================================================================3665/* ==========================================================================
...@@ -4274,7 +3670,7 @@...@@ -4274,7 +3670,7 @@
4274 ========================================================================== */3670 ========================================================================== */
42753671
4276#define Q6_vscatter_RMVwV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermw)(Rt,Mu,Vv,Vw)3672#define Q6_vscatter_RMVwV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermw)(Rt,Mu,Vv,Vw)
4277#endif /* __HEXAGON_ARCH___ >= 65 */3673#endif
42783674
4279#if __HVX_ARCH__ >= 653675#if __HVX_ARCH__ >= 65
4280/* ==========================================================================3676/* ==========================================================================
...@@ -4285,7 +3681,7 @@...@@ -4285,7 +3681,7 @@
4285 ========================================================================== */3681 ========================================================================== */
42863682
4287#define Q6_vscatteracc_RMVwV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermw_add)(Rt,Mu,Vv,Vw)3683#define Q6_vscatteracc_RMVwV(Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermw_add)(Rt,Mu,Vv,Vw)
4288#endif /* __HEXAGON_ARCH___ >= 65 */3684#endif
42893685
4290#if __HVX_ARCH__ >= 653686#if __HVX_ARCH__ >= 65
4291/* ==========================================================================3687/* ==========================================================================
...@@ -4296,7 +3692,7 @@...@@ -4296,7 +3692,7 @@
4296 ========================================================================== */3692 ========================================================================== */
42973693
4298#define Q6_vscatter_QRMVwV(Qs,Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv,Vw)3694#define Q6_vscatter_QRMVwV(Qs,Rt,Mu,Vv,Vw) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vscattermwq)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1),Rt,Mu,Vv,Vw)
4299#endif /* __HEXAGON_ARCH___ >= 65 */3695#endif
43003696
4301#if __HVX_ARCH__ >= 663697#if __HVX_ARCH__ >= 66
4302/* ==========================================================================3698/* ==========================================================================
...@@ -4307,7 +3703,7 @@...@@ -4307,7 +3703,7 @@
4307 ========================================================================== */3703 ========================================================================== */
43083704
4309#define Q6_Vw_vadd_VwVwQ_carry_sat(Vu,Vv,Qs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddcarrysat)(Vu,Vv,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1))3705#define Q6_Vw_vadd_VwVwQ_carry_sat(Vu,Vv,Qs) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vaddcarrysat)(Vu,Vv,__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qs),-1))
4310#endif /* __HEXAGON_ARCH___ >= 66 */3706#endif
43113707
4312#if __HVX_ARCH__ >= 663708#if __HVX_ARCH__ >= 66
4313/* ==========================================================================3709/* ==========================================================================
...@@ -4318,7 +3714,7 @@...@@ -4318,7 +3714,7 @@
4318 ========================================================================== */3714 ========================================================================== */
43193715
4320#define Q6_Ww_vasrinto_WwVwVw(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasr_into)(Vxx,Vu,Vv)3716#define Q6_Ww_vasrinto_WwVwVw(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasr_into)(Vxx,Vu,Vv)
4321#endif /* __HEXAGON_ARCH___ >= 66 */3717#endif
43223718
4323#if __HVX_ARCH__ >= 663719#if __HVX_ARCH__ >= 66
4324/* ==========================================================================3720/* ==========================================================================
...@@ -4329,7 +3725,7 @@...@@ -4329,7 +3725,7 @@
4329 ========================================================================== */3725 ========================================================================== */
43303726
4331#define Q6_Vuw_vrotr_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrotr)(Vu,Vv)3727#define Q6_Vuw_vrotr_VuwVuw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vrotr)(Vu,Vv)
4332#endif /* __HEXAGON_ARCH___ >= 66 */3728#endif
43333729
4334#if __HVX_ARCH__ >= 663730#if __HVX_ARCH__ >= 66
4335/* ==========================================================================3731/* ==========================================================================
...@@ -4340,7 +3736,7 @@...@@ -4340,7 +3736,7 @@
4340 ========================================================================== */3736 ========================================================================== */
43413737
4342#define Q6_Vw_vsatdw_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsatdw)(Vu,Vv)3738#define Q6_Vw_vsatdw_VwVw(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsatdw)(Vu,Vv)
4343#endif /* __HEXAGON_ARCH___ >= 66 */3739#endif
43443740
4345#if __HVX_ARCH__ >= 683741#if __HVX_ARCH__ >= 68
4346/* ==========================================================================3742/* ==========================================================================
...@@ -4351,7 +3747,7 @@...@@ -4351,7 +3747,7 @@
4351 ========================================================================== */3747 ========================================================================== */
43523748
4353#define Q6_Ww_v6mpy_WubWbI_h(Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyhubs10)(Vuu,Vvv,Iu2)3749#define Q6_Ww_v6mpy_WubWbI_h(Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyhubs10)(Vuu,Vvv,Iu2)
4354#endif /* __HEXAGON_ARCH___ >= 68 */3750#endif
43553751
4356#if __HVX_ARCH__ >= 683752#if __HVX_ARCH__ >= 68
4357/* ==========================================================================3753/* ==========================================================================
...@@ -4362,7 +3758,7 @@...@@ -4362,7 +3758,7 @@
4362 ========================================================================== */3758 ========================================================================== */
43633759
4364#define Q6_Ww_v6mpyacc_WwWubWbI_h(Vxx,Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyhubs10_vxx)(Vxx,Vuu,Vvv,Iu2)3760#define Q6_Ww_v6mpyacc_WwWubWbI_h(Vxx,Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyhubs10_vxx)(Vxx,Vuu,Vvv,Iu2)
4365#endif /* __HEXAGON_ARCH___ >= 68 */3761#endif
43663762
4367#if __HVX_ARCH__ >= 683763#if __HVX_ARCH__ >= 68
4368/* ==========================================================================3764/* ==========================================================================
...@@ -4373,7 +3769,7 @@...@@ -4373,7 +3769,7 @@
4373 ========================================================================== */3769 ========================================================================== */
43743770
4375#define Q6_Ww_v6mpy_WubWbI_v(Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyvubs10)(Vuu,Vvv,Iu2)3771#define Q6_Ww_v6mpy_WubWbI_v(Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyvubs10)(Vuu,Vvv,Iu2)
4376#endif /* __HEXAGON_ARCH___ >= 68 */3772#endif
43773773
4378#if __HVX_ARCH__ >= 683774#if __HVX_ARCH__ >= 68
4379/* ==========================================================================3775/* ==========================================================================
...@@ -4384,9 +3780,9 @@...@@ -4384,9 +3780,9 @@
4384 ========================================================================== */3780 ========================================================================== */
43853781
4386#define Q6_Ww_v6mpyacc_WwWubWbI_v(Vxx,Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyvubs10_vxx)(Vxx,Vuu,Vvv,Iu2)3782#define Q6_Ww_v6mpyacc_WwWubWbI_v(Vxx,Vuu,Vvv,Iu2) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_v6mpyvubs10_vxx)(Vxx,Vuu,Vvv,Iu2)
4387#endif /* __HEXAGON_ARCH___ >= 68 */3783#endif
43883784
4389#if __HVX_ARCH__ >= 683785#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4390/* ==========================================================================3786/* ==========================================================================
4391 Assembly Syntax: Vd32.hf=vabs(Vu32.hf)3787 Assembly Syntax: Vd32.hf=vabs(Vu32.hf)
4392 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vabs_Vhf(HVX_Vector Vu)3788 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vabs_Vhf(HVX_Vector Vu)
...@@ -4395,9 +3791,9 @@...@@ -4395,9 +3791,9 @@
4395 ========================================================================== */3791 ========================================================================== */
43963792
4397#define Q6_Vhf_vabs_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_hf)(Vu)3793#define Q6_Vhf_vabs_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_hf)(Vu)
4398#endif /* __HEXAGON_ARCH___ >= 68 */3794#endif
43993795
4400#if __HVX_ARCH__ >= 683796#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4401/* ==========================================================================3797/* ==========================================================================
4402 Assembly Syntax: Vd32.sf=vabs(Vu32.sf)3798 Assembly Syntax: Vd32.sf=vabs(Vu32.sf)
4403 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vabs_Vsf(HVX_Vector Vu)3799 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vabs_Vsf(HVX_Vector Vu)
...@@ -4406,7 +3802,7 @@...@@ -4406,7 +3802,7 @@
4406 ========================================================================== */3802 ========================================================================== */
44073803
4408#define Q6_Vsf_vabs_Vsf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_sf)(Vu)3804#define Q6_Vsf_vabs_Vsf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_sf)(Vu)
4409#endif /* __HEXAGON_ARCH___ >= 68 */3805#endif
44103806
4411#if __HVX_ARCH__ >= 683807#if __HVX_ARCH__ >= 68
4412/* ==========================================================================3808/* ==========================================================================
...@@ -4417,9 +3813,9 @@...@@ -4417,9 +3813,9 @@
4417 ========================================================================== */3813 ========================================================================== */
44183814
4419#define Q6_Vqf16_vadd_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf)(Vu,Vv)3815#define Q6_Vqf16_vadd_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf)(Vu,Vv)
4420#endif /* __HEXAGON_ARCH___ >= 68 */3816#endif
44213817
4422#if __HVX_ARCH__ >= 683818#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4423/* ==========================================================================3819/* ==========================================================================
4424 Assembly Syntax: Vd32.hf=vadd(Vu32.hf,Vv32.hf)3820 Assembly Syntax: Vd32.hf=vadd(Vu32.hf,Vv32.hf)
4425 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vadd_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)3821 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vadd_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4428,7 +3824,7 @@...@@ -4428,7 +3824,7 @@
4428 ========================================================================== */3824 ========================================================================== */
44293825
4430#define Q6_Vhf_vadd_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf_hf)(Vu,Vv)3826#define Q6_Vhf_vadd_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf_hf)(Vu,Vv)
4431#endif /* __HEXAGON_ARCH___ >= 68 */3827#endif
44323828
4433#if __HVX_ARCH__ >= 683829#if __HVX_ARCH__ >= 68
4434/* ==========================================================================3830/* ==========================================================================
...@@ -4439,7 +3835,7 @@...@@ -4439,7 +3835,7 @@
4439 ========================================================================== */3835 ========================================================================== */
44403836
4441#define Q6_Vqf16_vadd_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf16)(Vu,Vv)3837#define Q6_Vqf16_vadd_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf16)(Vu,Vv)
4442#endif /* __HEXAGON_ARCH___ >= 68 */3838#endif
44433839
4444#if __HVX_ARCH__ >= 683840#if __HVX_ARCH__ >= 68
4445/* ==========================================================================3841/* ==========================================================================
...@@ -4450,7 +3846,7 @@...@@ -4450,7 +3846,7 @@
4450 ========================================================================== */3846 ========================================================================== */
44513847
4452#define Q6_Vqf16_vadd_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf16_mix)(Vu,Vv)3848#define Q6_Vqf16_vadd_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf16_mix)(Vu,Vv)
4453#endif /* __HEXAGON_ARCH___ >= 68 */3849#endif
44543850
4455#if __HVX_ARCH__ >= 683851#if __HVX_ARCH__ >= 68
4456/* ==========================================================================3852/* ==========================================================================
...@@ -4461,7 +3857,7 @@...@@ -4461,7 +3857,7 @@
4461 ========================================================================== */3857 ========================================================================== */
44623858
4463#define Q6_Vqf32_vadd_Vqf32Vqf32(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf32)(Vu,Vv)3859#define Q6_Vqf32_vadd_Vqf32Vqf32(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf32)(Vu,Vv)
4464#endif /* __HEXAGON_ARCH___ >= 68 */3860#endif
44653861
4466#if __HVX_ARCH__ >= 683862#if __HVX_ARCH__ >= 68
4467/* ==========================================================================3863/* ==========================================================================
...@@ -4472,7 +3868,7 @@...@@ -4472,7 +3868,7 @@
4472 ========================================================================== */3868 ========================================================================== */
44733869
4474#define Q6_Vqf32_vadd_Vqf32Vsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf32_mix)(Vu,Vv)3870#define Q6_Vqf32_vadd_Vqf32Vsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_qf32_mix)(Vu,Vv)
4475#endif /* __HEXAGON_ARCH___ >= 68 */3871#endif
44763872
4477#if __HVX_ARCH__ >= 683873#if __HVX_ARCH__ >= 68
4478/* ==========================================================================3874/* ==========================================================================
...@@ -4483,9 +3879,9 @@...@@ -4483,9 +3879,9 @@
4483 ========================================================================== */3879 ========================================================================== */
44843880
4485#define Q6_Vqf32_vadd_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf)(Vu,Vv)3881#define Q6_Vqf32_vadd_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf)(Vu,Vv)
4486#endif /* __HEXAGON_ARCH___ >= 68 */3882#endif
44873883
4488#if __HVX_ARCH__ >= 683884#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4489/* ==========================================================================3885/* ==========================================================================
4490 Assembly Syntax: Vdd32.sf=vadd(Vu32.hf,Vv32.hf)3886 Assembly Syntax: Vdd32.sf=vadd(Vu32.hf,Vv32.hf)
4491 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vadd_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)3887 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vadd_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4494,9 +3890,9 @@...@@ -4494,9 +3890,9 @@
4494 ========================================================================== */3890 ========================================================================== */
44953891
4496#define Q6_Wsf_vadd_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_hf)(Vu,Vv)3892#define Q6_Wsf_vadd_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_hf)(Vu,Vv)
4497#endif /* __HEXAGON_ARCH___ >= 68 */3893#endif
44983894
4499#if __HVX_ARCH__ >= 683895#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4500/* ==========================================================================3896/* ==========================================================================
4501 Assembly Syntax: Vd32.sf=vadd(Vu32.sf,Vv32.sf)3897 Assembly Syntax: Vd32.sf=vadd(Vu32.sf,Vv32.sf)
4502 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vadd_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)3898 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vadd_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4505,9 +3901,9 @@...@@ -4505,9 +3901,9 @@
4505 ========================================================================== */3901 ========================================================================== */
45063902
4507#define Q6_Vsf_vadd_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_sf)(Vu,Vv)3903#define Q6_Vsf_vadd_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_sf)(Vu,Vv)
4508#endif /* __HEXAGON_ARCH___ >= 68 */3904#endif
45093905
4510#if __HVX_ARCH__ >= 683906#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4511/* ==========================================================================3907/* ==========================================================================
4512 Assembly Syntax: Vd32.w=vfmv(Vu32.w)3908 Assembly Syntax: Vd32.w=vfmv(Vu32.w)
4513 C Intrinsic Prototype: HVX_Vector Q6_Vw_vfmv_Vw(HVX_Vector Vu)3909 C Intrinsic Prototype: HVX_Vector Q6_Vw_vfmv_Vw(HVX_Vector Vu)
...@@ -4516,7 +3912,7 @@...@@ -4516,7 +3912,7 @@
4516 ========================================================================== */3912 ========================================================================== */
45173913
4518#define Q6_Vw_vfmv_Vw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vassign_fp)(Vu)3914#define Q6_Vw_vfmv_Vw(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vassign_fp)(Vu)
4519#endif /* __HEXAGON_ARCH___ >= 68 */3915#endif
45203916
4521#if __HVX_ARCH__ >= 683917#if __HVX_ARCH__ >= 68
4522/* ==========================================================================3918/* ==========================================================================
...@@ -4527,7 +3923,7 @@...@@ -4527,7 +3923,7 @@
4527 ========================================================================== */3923 ========================================================================== */
45283924
4529#define Q6_Vhf_equals_Vqf16(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_qf16)(Vu)3925#define Q6_Vhf_equals_Vqf16(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_qf16)(Vu)
4530#endif /* __HEXAGON_ARCH___ >= 68 */3926#endif
45313927
4532#if __HVX_ARCH__ >= 683928#if __HVX_ARCH__ >= 68
4533/* ==========================================================================3929/* ==========================================================================
...@@ -4538,7 +3934,7 @@...@@ -4538,7 +3934,7 @@
4538 ========================================================================== */3934 ========================================================================== */
45393935
4540#define Q6_Vhf_equals_Wqf32(Vuu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_qf32)(Vuu)3936#define Q6_Vhf_equals_Wqf32(Vuu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_qf32)(Vuu)
4541#endif /* __HEXAGON_ARCH___ >= 68 */3937#endif
45423938
4543#if __HVX_ARCH__ >= 683939#if __HVX_ARCH__ >= 68
4544/* ==========================================================================3940/* ==========================================================================
...@@ -4549,9 +3945,9 @@...@@ -4549,9 +3945,9 @@
4549 ========================================================================== */3945 ========================================================================== */
45503946
4551#define Q6_Vsf_equals_Vqf32(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_sf_qf32)(Vu)3947#define Q6_Vsf_equals_Vqf32(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_sf_qf32)(Vu)
4552#endif /* __HEXAGON_ARCH___ >= 68 */3948#endif
45533949
4554#if __HVX_ARCH__ >= 683950#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4555/* ==========================================================================3951/* ==========================================================================
4556 Assembly Syntax: Vd32.b=vcvt(Vu32.hf,Vv32.hf)3952 Assembly Syntax: Vd32.b=vcvt(Vu32.hf,Vv32.hf)
4557 C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)3953 C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4560,9 +3956,9 @@...@@ -4560,9 +3956,9 @@
4560 ========================================================================== */3956 ========================================================================== */
45613957
4562#define Q6_Vb_vcvt_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_b_hf)(Vu,Vv)3958#define Q6_Vb_vcvt_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_b_hf)(Vu,Vv)
4563#endif /* __HEXAGON_ARCH___ >= 68 */3959#endif
45643960
4565#if __HVX_ARCH__ >= 683961#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4566/* ==========================================================================3962/* ==========================================================================
4567 Assembly Syntax: Vd32.h=vcvt(Vu32.hf)3963 Assembly Syntax: Vd32.h=vcvt(Vu32.hf)
4568 C Intrinsic Prototype: HVX_Vector Q6_Vh_vcvt_Vhf(HVX_Vector Vu)3964 C Intrinsic Prototype: HVX_Vector Q6_Vh_vcvt_Vhf(HVX_Vector Vu)
...@@ -4571,9 +3967,9 @@...@@ -4571,9 +3967,9 @@
4571 ========================================================================== */3967 ========================================================================== */
45723968
4573#define Q6_Vh_vcvt_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_h_hf)(Vu)3969#define Q6_Vh_vcvt_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_h_hf)(Vu)
4574#endif /* __HEXAGON_ARCH___ >= 68 */3970#endif
45753971
4576#if __HVX_ARCH__ >= 683972#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4577/* ==========================================================================3973/* ==========================================================================
4578 Assembly Syntax: Vdd32.hf=vcvt(Vu32.b)3974 Assembly Syntax: Vdd32.hf=vcvt(Vu32.b)
4579 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_Vb(HVX_Vector Vu)3975 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_Vb(HVX_Vector Vu)
...@@ -4582,9 +3978,9 @@...@@ -4582,9 +3978,9 @@
4582 ========================================================================== */3978 ========================================================================== */
45833979
4584#define Q6_Whf_vcvt_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_b)(Vu)3980#define Q6_Whf_vcvt_Vb(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_b)(Vu)
4585#endif /* __HEXAGON_ARCH___ >= 68 */3981#endif
45863982
4587#if __HVX_ARCH__ >= 683983#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4588/* ==========================================================================3984/* ==========================================================================
4589 Assembly Syntax: Vd32.hf=vcvt(Vu32.h)3985 Assembly Syntax: Vd32.hf=vcvt(Vu32.h)
4590 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vcvt_Vh(HVX_Vector Vu)3986 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vcvt_Vh(HVX_Vector Vu)
...@@ -4593,9 +3989,9 @@...@@ -4593,9 +3989,9 @@
4593 ========================================================================== */3989 ========================================================================== */
45943990
4595#define Q6_Vhf_vcvt_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_h)(Vu)3991#define Q6_Vhf_vcvt_Vh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_h)(Vu)
4596#endif /* __HEXAGON_ARCH___ >= 68 */3992#endif
45973993
4598#if __HVX_ARCH__ >= 683994#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4599/* ==========================================================================3995/* ==========================================================================
4600 Assembly Syntax: Vd32.hf=vcvt(Vu32.sf,Vv32.sf)3996 Assembly Syntax: Vd32.hf=vcvt(Vu32.sf,Vv32.sf)
4601 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vcvt_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)3997 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vcvt_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4604,9 +4000,9 @@...@@ -4604,9 +4000,9 @@
4604 ========================================================================== */4000 ========================================================================== */
46054001
4606#define Q6_Vhf_vcvt_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_sf)(Vu,Vv)4002#define Q6_Vhf_vcvt_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_sf)(Vu,Vv)
4607#endif /* __HEXAGON_ARCH___ >= 68 */4003#endif
46084004
4609#if __HVX_ARCH__ >= 684005#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4610/* ==========================================================================4006/* ==========================================================================
4611 Assembly Syntax: Vdd32.hf=vcvt(Vu32.ub)4007 Assembly Syntax: Vdd32.hf=vcvt(Vu32.ub)
4612 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_Vub(HVX_Vector Vu)4008 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_Vub(HVX_Vector Vu)
...@@ -4615,9 +4011,9 @@...@@ -4615,9 +4011,9 @@
4615 ========================================================================== */4011 ========================================================================== */
46164012
4617#define Q6_Whf_vcvt_Vub(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_ub)(Vu)4013#define Q6_Whf_vcvt_Vub(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_ub)(Vu)
4618#endif /* __HEXAGON_ARCH___ >= 68 */4014#endif
46194015
4620#if __HVX_ARCH__ >= 684016#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4621/* ==========================================================================4017/* ==========================================================================
4622 Assembly Syntax: Vd32.hf=vcvt(Vu32.uh)4018 Assembly Syntax: Vd32.hf=vcvt(Vu32.uh)
4623 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vcvt_Vuh(HVX_Vector Vu)4019 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vcvt_Vuh(HVX_Vector Vu)
...@@ -4626,9 +4022,9 @@...@@ -4626,9 +4022,9 @@
4626 ========================================================================== */4022 ========================================================================== */
46274023
4628#define Q6_Vhf_vcvt_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_uh)(Vu)4024#define Q6_Vhf_vcvt_Vuh(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_uh)(Vu)
4629#endif /* __HEXAGON_ARCH___ >= 68 */4025#endif
46304026
4631#if __HVX_ARCH__ >= 684027#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4632/* ==========================================================================4028/* ==========================================================================
4633 Assembly Syntax: Vdd32.sf=vcvt(Vu32.hf)4029 Assembly Syntax: Vdd32.sf=vcvt(Vu32.hf)
4634 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vcvt_Vhf(HVX_Vector Vu)4030 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vcvt_Vhf(HVX_Vector Vu)
...@@ -4637,9 +4033,9 @@...@@ -4637,9 +4033,9 @@
4637 ========================================================================== */4033 ========================================================================== */
46384034
4639#define Q6_Wsf_vcvt_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_sf_hf)(Vu)4035#define Q6_Wsf_vcvt_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_sf_hf)(Vu)
4640#endif /* __HEXAGON_ARCH___ >= 68 */4036#endif
46414037
4642#if __HVX_ARCH__ >= 684038#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4643/* ==========================================================================4039/* ==========================================================================
4644 Assembly Syntax: Vd32.ub=vcvt(Vu32.hf,Vv32.hf)4040 Assembly Syntax: Vd32.ub=vcvt(Vu32.hf,Vv32.hf)
4645 C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4041 C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4648,9 +4044,9 @@...@@ -4648,9 +4044,9 @@
4648 ========================================================================== */4044 ========================================================================== */
46494045
4650#define Q6_Vub_vcvt_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_ub_hf)(Vu,Vv)4046#define Q6_Vub_vcvt_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_ub_hf)(Vu,Vv)
4651#endif /* __HEXAGON_ARCH___ >= 68 */4047#endif
46524048
4653#if __HVX_ARCH__ >= 684049#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4654/* ==========================================================================4050/* ==========================================================================
4655 Assembly Syntax: Vd32.uh=vcvt(Vu32.hf)4051 Assembly Syntax: Vd32.uh=vcvt(Vu32.hf)
4656 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vcvt_Vhf(HVX_Vector Vu)4052 C Intrinsic Prototype: HVX_Vector Q6_Vuh_vcvt_Vhf(HVX_Vector Vu)
...@@ -4659,9 +4055,9 @@...@@ -4659,9 +4055,9 @@
4659 ========================================================================== */4055 ========================================================================== */
46604056
4661#define Q6_Vuh_vcvt_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_uh_hf)(Vu)4057#define Q6_Vuh_vcvt_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_uh_hf)(Vu)
4662#endif /* __HEXAGON_ARCH___ >= 68 */4058#endif
46634059
4664#if __HVX_ARCH__ >= 684060#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4665/* ==========================================================================4061/* ==========================================================================
4666 Assembly Syntax: Vd32.sf=vdmpy(Vu32.hf,Vv32.hf)4062 Assembly Syntax: Vd32.sf=vdmpy(Vu32.hf,Vv32.hf)
4667 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vdmpy_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4063 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vdmpy_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4670,9 +4066,9 @@...@@ -4670,9 +4066,9 @@
4670 ========================================================================== */4066 ========================================================================== */
46714067
4672#define Q6_Vsf_vdmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpy_sf_hf)(Vu,Vv)4068#define Q6_Vsf_vdmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpy_sf_hf)(Vu,Vv)
4673#endif /* __HEXAGON_ARCH___ >= 68 */4069#endif
46744070
4675#if __HVX_ARCH__ >= 684071#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4676/* ==========================================================================4072/* ==========================================================================
4677 Assembly Syntax: Vx32.sf+=vdmpy(Vu32.hf,Vv32.hf)4073 Assembly Syntax: Vx32.sf+=vdmpy(Vu32.hf,Vv32.hf)
4678 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vdmpyacc_VsfVhfVhf(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)4074 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vdmpyacc_VsfVhfVhf(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -4681,9 +4077,9 @@...@@ -4681,9 +4077,9 @@
4681 ========================================================================== */4077 ========================================================================== */
46824078
4683#define Q6_Vsf_vdmpyacc_VsfVhfVhf(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpy_sf_hf_acc)(Vx,Vu,Vv)4079#define Q6_Vsf_vdmpyacc_VsfVhfVhf(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vdmpy_sf_hf_acc)(Vx,Vu,Vv)
4684#endif /* __HEXAGON_ARCH___ >= 68 */4080#endif
46854081
4686#if __HVX_ARCH__ >= 684082#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4687/* ==========================================================================4083/* ==========================================================================
4688 Assembly Syntax: Vd32.hf=vfmax(Vu32.hf,Vv32.hf)4084 Assembly Syntax: Vd32.hf=vfmax(Vu32.hf,Vv32.hf)
4689 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vfmax_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4085 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vfmax_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4692,9 +4088,9 @@...@@ -4692,9 +4088,9 @@
4692 ========================================================================== */4088 ========================================================================== */
46934089
4694#define Q6_Vhf_vfmax_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_hf)(Vu,Vv)4090#define Q6_Vhf_vfmax_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_hf)(Vu,Vv)
4695#endif /* __HEXAGON_ARCH___ >= 68 */4091#endif
46964092
4697#if __HVX_ARCH__ >= 684093#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4698/* ==========================================================================4094/* ==========================================================================
4699 Assembly Syntax: Vd32.sf=vfmax(Vu32.sf,Vv32.sf)4095 Assembly Syntax: Vd32.sf=vfmax(Vu32.sf,Vv32.sf)
4700 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vfmax_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)4096 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vfmax_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4703,9 +4099,9 @@...@@ -4703,9 +4099,9 @@
4703 ========================================================================== */4099 ========================================================================== */
47044100
4705#define Q6_Vsf_vfmax_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_sf)(Vu,Vv)4101#define Q6_Vsf_vfmax_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_sf)(Vu,Vv)
4706#endif /* __HEXAGON_ARCH___ >= 68 */4102#endif
47074103
4708#if __HVX_ARCH__ >= 684104#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4709/* ==========================================================================4105/* ==========================================================================
4710 Assembly Syntax: Vd32.hf=vfmin(Vu32.hf,Vv32.hf)4106 Assembly Syntax: Vd32.hf=vfmin(Vu32.hf,Vv32.hf)
4711 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vfmin_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4107 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vfmin_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4714,9 +4110,9 @@...@@ -4714,9 +4110,9 @@
4714 ========================================================================== */4110 ========================================================================== */
47154111
4716#define Q6_Vhf_vfmin_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_hf)(Vu,Vv)4112#define Q6_Vhf_vfmin_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_hf)(Vu,Vv)
4717#endif /* __HEXAGON_ARCH___ >= 68 */4113#endif
47184114
4719#if __HVX_ARCH__ >= 684115#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4720/* ==========================================================================4116/* ==========================================================================
4721 Assembly Syntax: Vd32.sf=vfmin(Vu32.sf,Vv32.sf)4117 Assembly Syntax: Vd32.sf=vfmin(Vu32.sf,Vv32.sf)
4722 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vfmin_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)4118 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vfmin_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4725,9 +4121,9 @@...@@ -4725,9 +4121,9 @@
4725 ========================================================================== */4121 ========================================================================== */
47264122
4727#define Q6_Vsf_vfmin_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_sf)(Vu,Vv)4123#define Q6_Vsf_vfmin_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_sf)(Vu,Vv)
4728#endif /* __HEXAGON_ARCH___ >= 68 */4124#endif
47294125
4730#if __HVX_ARCH__ >= 684126#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4731/* ==========================================================================4127/* ==========================================================================
4732 Assembly Syntax: Vd32.hf=vfneg(Vu32.hf)4128 Assembly Syntax: Vd32.hf=vfneg(Vu32.hf)
4733 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vfneg_Vhf(HVX_Vector Vu)4129 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vfneg_Vhf(HVX_Vector Vu)
...@@ -4736,9 +4132,9 @@...@@ -4736,9 +4132,9 @@
4736 ========================================================================== */4132 ========================================================================== */
47374133
4738#define Q6_Vhf_vfneg_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_hf)(Vu)4134#define Q6_Vhf_vfneg_Vhf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_hf)(Vu)
4739#endif /* __HEXAGON_ARCH___ >= 68 */4135#endif
47404136
4741#if __HVX_ARCH__ >= 684137#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4742/* ==========================================================================4138/* ==========================================================================
4743 Assembly Syntax: Vd32.sf=vfneg(Vu32.sf)4139 Assembly Syntax: Vd32.sf=vfneg(Vu32.sf)
4744 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vfneg_Vsf(HVX_Vector Vu)4140 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vfneg_Vsf(HVX_Vector Vu)
...@@ -4747,7 +4143,7 @@...@@ -4747,7 +4143,7 @@
4747 ========================================================================== */4143 ========================================================================== */
47484144
4749#define Q6_Vsf_vfneg_Vsf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_sf)(Vu)4145#define Q6_Vsf_vfneg_Vsf(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_sf)(Vu)
4750#endif /* __HEXAGON_ARCH___ >= 68 */4146#endif
47514147
4752#if __HVX_ARCH__ >= 684148#if __HVX_ARCH__ >= 68
4753/* ==========================================================================4149/* ==========================================================================
...@@ -4758,7 +4154,7 @@...@@ -4758,7 +4154,7 @@
4758 ========================================================================== */4154 ========================================================================== */
47594155
4760#define Q6_Q_vcmp_gt_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf)(Vu,Vv)),-1)4156#define Q6_Q_vcmp_gt_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf)(Vu,Vv)),-1)
4761#endif /* __HEXAGON_ARCH___ >= 68 */4157#endif
47624158
4763#if __HVX_ARCH__ >= 684159#if __HVX_ARCH__ >= 68
4764/* ==========================================================================4160/* ==========================================================================
...@@ -4769,7 +4165,7 @@...@@ -4769,7 +4165,7 @@
4769 ========================================================================== */4165 ========================================================================== */
47704166
4771#define Q6_Q_vcmp_gtand_QVhfVhf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)4167#define Q6_Q_vcmp_gtand_QVhfVhf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
4772#endif /* __HEXAGON_ARCH___ >= 68 */4168#endif
47734169
4774#if __HVX_ARCH__ >= 684170#if __HVX_ARCH__ >= 68
4775/* ==========================================================================4171/* ==========================================================================
...@@ -4780,7 +4176,7 @@...@@ -4780,7 +4176,7 @@
4780 ========================================================================== */4176 ========================================================================== */
47814177
4782#define Q6_Q_vcmp_gtor_QVhfVhf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)4178#define Q6_Q_vcmp_gtor_QVhfVhf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
4783#endif /* __HEXAGON_ARCH___ >= 68 */4179#endif
47844180
4785#if __HVX_ARCH__ >= 684181#if __HVX_ARCH__ >= 68
4786/* ==========================================================================4182/* ==========================================================================
...@@ -4791,7 +4187,7 @@...@@ -4791,7 +4187,7 @@
4791 ========================================================================== */4187 ========================================================================== */
47924188
4793#define Q6_Q_vcmp_gtxacc_QVhfVhf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)4189#define Q6_Q_vcmp_gtxacc_QVhfVhf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgthf_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
4794#endif /* __HEXAGON_ARCH___ >= 68 */4190#endif
47954191
4796#if __HVX_ARCH__ >= 684192#if __HVX_ARCH__ >= 68
4797/* ==========================================================================4193/* ==========================================================================
...@@ -4802,7 +4198,7 @@...@@ -4802,7 +4198,7 @@
4802 ========================================================================== */4198 ========================================================================== */
48034199
4804#define Q6_Q_vcmp_gt_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf)(Vu,Vv)),-1)4200#define Q6_Q_vcmp_gt_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf)(Vu,Vv)),-1)
4805#endif /* __HEXAGON_ARCH___ >= 68 */4201#endif
48064202
4807#if __HVX_ARCH__ >= 684203#if __HVX_ARCH__ >= 68
4808/* ==========================================================================4204/* ==========================================================================
...@@ -4813,7 +4209,7 @@...@@ -4813,7 +4209,7 @@
4813 ========================================================================== */4209 ========================================================================== */
48144210
4815#define Q6_Q_vcmp_gtand_QVsfVsf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)4211#define Q6_Q_vcmp_gtand_QVsfVsf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf_and)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
4816#endif /* __HEXAGON_ARCH___ >= 68 */4212#endif
48174213
4818#if __HVX_ARCH__ >= 684214#if __HVX_ARCH__ >= 68
4819/* ==========================================================================4215/* ==========================================================================
...@@ -4824,7 +4220,7 @@...@@ -4824,7 +4220,7 @@
4824 ========================================================================== */4220 ========================================================================== */
48254221
4826#define Q6_Q_vcmp_gtor_QVsfVsf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)4222#define Q6_Q_vcmp_gtor_QVsfVsf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf_or)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
4827#endif /* __HEXAGON_ARCH___ >= 68 */4223#endif
48284224
4829#if __HVX_ARCH__ >= 684225#if __HVX_ARCH__ >= 68
4830/* ==========================================================================4226/* ==========================================================================
...@@ -4835,7 +4231,7 @@...@@ -4835,7 +4231,7 @@
4835 ========================================================================== */4231 ========================================================================== */
48364232
4837#define Q6_Q_vcmp_gtxacc_QVsfVsf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)4233#define Q6_Q_vcmp_gtxacc_QVsfVsf(Qx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtsf_xor)(__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx),-1),Vu,Vv)),-1)
4838#endif /* __HEXAGON_ARCH___ >= 68 */4234#endif
48394235
4840#if __HVX_ARCH__ >= 684236#if __HVX_ARCH__ >= 68
4841/* ==========================================================================4237/* ==========================================================================
...@@ -4846,7 +4242,7 @@...@@ -4846,7 +4242,7 @@
4846 ========================================================================== */4242 ========================================================================== */
48474243
4848#define Q6_Vhf_vmax_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_hf)(Vu,Vv)4244#define Q6_Vhf_vmax_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_hf)(Vu,Vv)
4849#endif /* __HEXAGON_ARCH___ >= 68 */4245#endif
48504246
4851#if __HVX_ARCH__ >= 684247#if __HVX_ARCH__ >= 68
4852/* ==========================================================================4248/* ==========================================================================
...@@ -4857,7 +4253,7 @@...@@ -4857,7 +4253,7 @@
4857 ========================================================================== */4253 ========================================================================== */
48584254
4859#define Q6_Vsf_vmax_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_sf)(Vu,Vv)4255#define Q6_Vsf_vmax_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_sf)(Vu,Vv)
4860#endif /* __HEXAGON_ARCH___ >= 68 */4256#endif
48614257
4862#if __HVX_ARCH__ >= 684258#if __HVX_ARCH__ >= 68
4863/* ==========================================================================4259/* ==========================================================================
...@@ -4868,7 +4264,7 @@...@@ -4868,7 +4264,7 @@
4868 ========================================================================== */4264 ========================================================================== */
48694265
4870#define Q6_Vhf_vmin_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_hf)(Vu,Vv)4266#define Q6_Vhf_vmin_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_hf)(Vu,Vv)
4871#endif /* __HEXAGON_ARCH___ >= 68 */4267#endif
48724268
4873#if __HVX_ARCH__ >= 684269#if __HVX_ARCH__ >= 68
4874/* ==========================================================================4270/* ==========================================================================
...@@ -4879,9 +4275,9 @@...@@ -4879,9 +4275,9 @@
4879 ========================================================================== */4275 ========================================================================== */
48804276
4881#define Q6_Vsf_vmin_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_sf)(Vu,Vv)4277#define Q6_Vsf_vmin_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_sf)(Vu,Vv)
4882#endif /* __HEXAGON_ARCH___ >= 68 */4278#endif
48834279
4884#if __HVX_ARCH__ >= 684280#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4885/* ==========================================================================4281/* ==========================================================================
4886 Assembly Syntax: Vd32.hf=vmpy(Vu32.hf,Vv32.hf)4282 Assembly Syntax: Vd32.hf=vmpy(Vu32.hf,Vv32.hf)
4887 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vmpy_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4283 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vmpy_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -4890,9 +4286,9 @@...@@ -4890,9 +4286,9 @@
4890 ========================================================================== */4286 ========================================================================== */
48914287
4892#define Q6_Vhf_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_hf)(Vu,Vv)4288#define Q6_Vhf_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_hf)(Vu,Vv)
4893#endif /* __HEXAGON_ARCH___ >= 68 */4289#endif
48944290
4895#if __HVX_ARCH__ >= 684291#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4896/* ==========================================================================4292/* ==========================================================================
4897 Assembly Syntax: Vx32.hf+=vmpy(Vu32.hf,Vv32.hf)4293 Assembly Syntax: Vx32.hf+=vmpy(Vu32.hf,Vv32.hf)
4898 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vmpyacc_VhfVhfVhf(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)4294 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vmpyacc_VhfVhfVhf(HVX_Vector Vx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -4901,7 +4297,7 @@...@@ -4901,7 +4297,7 @@
4901 ========================================================================== */4297 ========================================================================== */
49024298
4903#define Q6_Vhf_vmpyacc_VhfVhfVhf(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_hf_acc)(Vx,Vu,Vv)4299#define Q6_Vhf_vmpyacc_VhfVhfVhf(Vx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_hf_acc)(Vx,Vu,Vv)
4904#endif /* __HEXAGON_ARCH___ >= 68 */4300#endif
49054301
4906#if __HVX_ARCH__ >= 684302#if __HVX_ARCH__ >= 68
4907/* ==========================================================================4303/* ==========================================================================
...@@ -4912,7 +4308,7 @@...@@ -4912,7 +4308,7 @@
4912 ========================================================================== */4308 ========================================================================== */
49134309
4914#define Q6_Vqf16_vmpy_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf16)(Vu,Vv)4310#define Q6_Vqf16_vmpy_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf16)(Vu,Vv)
4915#endif /* __HEXAGON_ARCH___ >= 68 */4311#endif
49164312
4917#if __HVX_ARCH__ >= 684313#if __HVX_ARCH__ >= 68
4918/* ==========================================================================4314/* ==========================================================================
...@@ -4923,7 +4319,7 @@...@@ -4923,7 +4319,7 @@
4923 ========================================================================== */4319 ========================================================================== */
49244320
4925#define Q6_Vqf16_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf16_hf)(Vu,Vv)4321#define Q6_Vqf16_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf16_hf)(Vu,Vv)
4926#endif /* __HEXAGON_ARCH___ >= 68 */4322#endif
49274323
4928#if __HVX_ARCH__ >= 684324#if __HVX_ARCH__ >= 68
4929/* ==========================================================================4325/* ==========================================================================
...@@ -4934,7 +4330,7 @@...@@ -4934,7 +4330,7 @@
4934 ========================================================================== */4330 ========================================================================== */
49354331
4936#define Q6_Vqf16_vmpy_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf16_mix_hf)(Vu,Vv)4332#define Q6_Vqf16_vmpy_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf16_mix_hf)(Vu,Vv)
4937#endif /* __HEXAGON_ARCH___ >= 68 */4333#endif
49384334
4939#if __HVX_ARCH__ >= 684335#if __HVX_ARCH__ >= 68
4940/* ==========================================================================4336/* ==========================================================================
...@@ -4945,7 +4341,7 @@...@@ -4945,7 +4341,7 @@
4945 ========================================================================== */4341 ========================================================================== */
49464342
4947#define Q6_Vqf32_vmpy_Vqf32Vqf32(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32)(Vu,Vv)4343#define Q6_Vqf32_vmpy_Vqf32Vqf32(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32)(Vu,Vv)
4948#endif /* __HEXAGON_ARCH___ >= 68 */4344#endif
49494345
4950#if __HVX_ARCH__ >= 684346#if __HVX_ARCH__ >= 68
4951/* ==========================================================================4347/* ==========================================================================
...@@ -4956,7 +4352,7 @@...@@ -4956,7 +4352,7 @@
4956 ========================================================================== */4352 ========================================================================== */
49574353
4958#define Q6_Wqf32_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_hf)(Vu,Vv)4354#define Q6_Wqf32_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_hf)(Vu,Vv)
4959#endif /* __HEXAGON_ARCH___ >= 68 */4355#endif
49604356
4961#if __HVX_ARCH__ >= 684357#if __HVX_ARCH__ >= 68
4962/* ==========================================================================4358/* ==========================================================================
...@@ -4967,7 +4363,7 @@...@@ -4967,7 +4363,7 @@
4967 ========================================================================== */4363 ========================================================================== */
49684364
4969#define Q6_Wqf32_vmpy_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_mix_hf)(Vu,Vv)4365#define Q6_Wqf32_vmpy_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_mix_hf)(Vu,Vv)
4970#endif /* __HEXAGON_ARCH___ >= 68 */4366#endif
49714367
4972#if __HVX_ARCH__ >= 684368#if __HVX_ARCH__ >= 68
4973/* ==========================================================================4369/* ==========================================================================
...@@ -4978,7 +4374,7 @@...@@ -4978,7 +4374,7 @@
4978 ========================================================================== */4374 ========================================================================== */
49794375
4980#define Q6_Wqf32_vmpy_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_qf16)(Vu,Vv)4376#define Q6_Wqf32_vmpy_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_qf16)(Vu,Vv)
4981#endif /* __HEXAGON_ARCH___ >= 68 */4377#endif
49824378
4983#if __HVX_ARCH__ >= 684379#if __HVX_ARCH__ >= 68
4984/* ==========================================================================4380/* ==========================================================================
...@@ -4989,9 +4385,9 @@...@@ -4989,9 +4385,9 @@
4989 ========================================================================== */4385 ========================================================================== */
49904386
4991#define Q6_Vqf32_vmpy_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_sf)(Vu,Vv)4387#define Q6_Vqf32_vmpy_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_qf32_sf)(Vu,Vv)
4992#endif /* __HEXAGON_ARCH___ >= 68 */4388#endif
49934389
4994#if __HVX_ARCH__ >= 684390#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
4995/* ==========================================================================4391/* ==========================================================================
4996 Assembly Syntax: Vdd32.sf=vmpy(Vu32.hf,Vv32.hf)4392 Assembly Syntax: Vdd32.sf=vmpy(Vu32.hf,Vv32.hf)
4997 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4393 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5000,9 +4396,9 @@...@@ -5000,9 +4396,9 @@
5000 ========================================================================== */4396 ========================================================================== */
50014397
5002#define Q6_Wsf_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_hf)(Vu,Vv)4398#define Q6_Wsf_vmpy_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_hf)(Vu,Vv)
5003#endif /* __HEXAGON_ARCH___ >= 68 */4399#endif
50044400
5005#if __HVX_ARCH__ >= 684401#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
5006/* ==========================================================================4402/* ==========================================================================
5007 Assembly Syntax: Vxx32.sf+=vmpy(Vu32.hf,Vv32.hf)4403 Assembly Syntax: Vxx32.sf+=vmpy(Vu32.hf,Vv32.hf)
5008 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVhfVhf(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)4404 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVhfVhf(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
...@@ -5011,9 +4407,9 @@...@@ -5011,9 +4407,9 @@
5011 ========================================================================== */4407 ========================================================================== */
50124408
5013#define Q6_Wsf_vmpyacc_WsfVhfVhf(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_hf_acc)(Vxx,Vu,Vv)4409#define Q6_Wsf_vmpyacc_WsfVhfVhf(Vxx,Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_hf_acc)(Vxx,Vu,Vv)
5014#endif /* __HEXAGON_ARCH___ >= 68 */4410#endif
50154411
5016#if __HVX_ARCH__ >= 684412#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
5017/* ==========================================================================4413/* ==========================================================================
5018 Assembly Syntax: Vd32.sf=vmpy(Vu32.sf,Vv32.sf)4414 Assembly Syntax: Vd32.sf=vmpy(Vu32.sf,Vv32.sf)
5019 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vmpy_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)4415 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vmpy_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5022,7 +4418,7 @@...@@ -5022,7 +4418,7 @@
5022 ========================================================================== */4418 ========================================================================== */
50234419
5024#define Q6_Vsf_vmpy_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_sf)(Vu,Vv)4420#define Q6_Vsf_vmpy_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_sf)(Vu,Vv)
5025#endif /* __HEXAGON_ARCH___ >= 68 */4421#endif
50264422
5027#if __HVX_ARCH__ >= 684423#if __HVX_ARCH__ >= 68
5028/* ==========================================================================4424/* ==========================================================================
...@@ -5033,9 +4429,9 @@...@@ -5033,9 +4429,9 @@
5033 ========================================================================== */4429 ========================================================================== */
50344430
5035#define Q6_Vqf16_vsub_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf)(Vu,Vv)4431#define Q6_Vqf16_vsub_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf)(Vu,Vv)
5036#endif /* __HEXAGON_ARCH___ >= 68 */4432#endif
50374433
5038#if __HVX_ARCH__ >= 684434#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
5039/* ==========================================================================4435/* ==========================================================================
5040 Assembly Syntax: Vd32.hf=vsub(Vu32.hf,Vv32.hf)4436 Assembly Syntax: Vd32.hf=vsub(Vu32.hf,Vv32.hf)
5041 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vsub_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4437 C Intrinsic Prototype: HVX_Vector Q6_Vhf_vsub_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5044,7 +4440,7 @@...@@ -5044,7 +4440,7 @@
5044 ========================================================================== */4440 ========================================================================== */
50454441
5046#define Q6_Vhf_vsub_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf_hf)(Vu,Vv)4442#define Q6_Vhf_vsub_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf_hf)(Vu,Vv)
5047#endif /* __HEXAGON_ARCH___ >= 68 */4443#endif
50484444
5049#if __HVX_ARCH__ >= 684445#if __HVX_ARCH__ >= 68
5050/* ==========================================================================4446/* ==========================================================================
...@@ -5055,7 +4451,7 @@...@@ -5055,7 +4451,7 @@
5055 ========================================================================== */4451 ========================================================================== */
50564452
5057#define Q6_Vqf16_vsub_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf16)(Vu,Vv)4453#define Q6_Vqf16_vsub_Vqf16Vqf16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf16)(Vu,Vv)
5058#endif /* __HEXAGON_ARCH___ >= 68 */4454#endif
50594455
5060#if __HVX_ARCH__ >= 684456#if __HVX_ARCH__ >= 68
5061/* ==========================================================================4457/* ==========================================================================
...@@ -5066,7 +4462,7 @@...@@ -5066,7 +4462,7 @@
5066 ========================================================================== */4462 ========================================================================== */
50674463
5068#define Q6_Vqf16_vsub_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf16_mix)(Vu,Vv)4464#define Q6_Vqf16_vsub_Vqf16Vhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf16_mix)(Vu,Vv)
5069#endif /* __HEXAGON_ARCH___ >= 68 */4465#endif
50704466
5071#if __HVX_ARCH__ >= 684467#if __HVX_ARCH__ >= 68
5072/* ==========================================================================4468/* ==========================================================================
...@@ -5077,7 +4473,7 @@...@@ -5077,7 +4473,7 @@
5077 ========================================================================== */4473 ========================================================================== */
50784474
5079#define Q6_Vqf32_vsub_Vqf32Vqf32(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf32)(Vu,Vv)4475#define Q6_Vqf32_vsub_Vqf32Vqf32(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf32)(Vu,Vv)
5080#endif /* __HEXAGON_ARCH___ >= 68 */4476#endif
50814477
5082#if __HVX_ARCH__ >= 684478#if __HVX_ARCH__ >= 68
5083/* ==========================================================================4479/* ==========================================================================
...@@ -5088,7 +4484,7 @@...@@ -5088,7 +4484,7 @@
5088 ========================================================================== */4484 ========================================================================== */
50894485
5090#define Q6_Vqf32_vsub_Vqf32Vsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf32_mix)(Vu,Vv)4486#define Q6_Vqf32_vsub_Vqf32Vsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_qf32_mix)(Vu,Vv)
5091#endif /* __HEXAGON_ARCH___ >= 68 */4487#endif
50924488
5093#if __HVX_ARCH__ >= 684489#if __HVX_ARCH__ >= 68
5094/* ==========================================================================4490/* ==========================================================================
...@@ -5099,9 +4495,9 @@...@@ -5099,9 +4495,9 @@
5099 ========================================================================== */4495 ========================================================================== */
51004496
5101#define Q6_Vqf32_vsub_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf)(Vu,Vv)4497#define Q6_Vqf32_vsub_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf)(Vu,Vv)
5102#endif /* __HEXAGON_ARCH___ >= 68 */4498#endif
51034499
5104#if __HVX_ARCH__ >= 684500#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
5105/* ==========================================================================4501/* ==========================================================================
5106 Assembly Syntax: Vdd32.sf=vsub(Vu32.hf,Vv32.hf)4502 Assembly Syntax: Vdd32.sf=vsub(Vu32.hf,Vv32.hf)
5107 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)4503 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5110,9 +4506,9 @@...@@ -5110,9 +4506,9 @@
5110 ========================================================================== */4506 ========================================================================== */
51114507
5112#define Q6_Wsf_vsub_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_hf)(Vu,Vv)4508#define Q6_Wsf_vsub_VhfVhf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_hf)(Vu,Vv)
5113#endif /* __HEXAGON_ARCH___ >= 68 */4509#endif
51144510
5115#if __HVX_ARCH__ >= 684511#if __HVX_ARCH__ >= 68 && defined __HVX_IEEE_FP__
5116/* ==========================================================================4512/* ==========================================================================
5117 Assembly Syntax: Vd32.sf=vsub(Vu32.sf,Vv32.sf)4513 Assembly Syntax: Vd32.sf=vsub(Vu32.sf,Vv32.sf)
5118 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vsub_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)4514 C Intrinsic Prototype: HVX_Vector Q6_Vsf_vsub_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5121,7 +4517,7 @@...@@ -5121,7 +4517,7 @@
5121 ========================================================================== */4517 ========================================================================== */
51224518
5123#define Q6_Vsf_vsub_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_sf)(Vu,Vv)4519#define Q6_Vsf_vsub_VsfVsf(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_sf)(Vu,Vv)
5124#endif /* __HEXAGON_ARCH___ >= 68 */4520#endif
51254521
5126#if __HVX_ARCH__ >= 694522#if __HVX_ARCH__ >= 69
5127/* ==========================================================================4523/* ==========================================================================
...@@ -5132,7 +4528,7 @@...@@ -5132,7 +4528,7 @@
5132 ========================================================================== */4528 ========================================================================== */
51334529
5134#define Q6_Vub_vasr_WuhVub_rnd_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvuhubrndsat)(Vuu,Vv)4530#define Q6_Vub_vasr_WuhVub_rnd_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvuhubrndsat)(Vuu,Vv)
5135#endif /* __HEXAGON_ARCH___ >= 69 */4531#endif
51364532
5137#if __HVX_ARCH__ >= 694533#if __HVX_ARCH__ >= 69
5138/* ==========================================================================4534/* ==========================================================================
...@@ -5143,7 +4539,7 @@...@@ -5143,7 +4539,7 @@
5143 ========================================================================== */4539 ========================================================================== */
51444540
5145#define Q6_Vub_vasr_WuhVub_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvuhubsat)(Vuu,Vv)4541#define Q6_Vub_vasr_WuhVub_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvuhubsat)(Vuu,Vv)
5146#endif /* __HEXAGON_ARCH___ >= 69 */4542#endif
51474543
5148#if __HVX_ARCH__ >= 694544#if __HVX_ARCH__ >= 69
5149/* ==========================================================================4545/* ==========================================================================
...@@ -5154,7 +4550,7 @@...@@ -5154,7 +4550,7 @@
5154 ========================================================================== */4550 ========================================================================== */
51554551
5156#define Q6_Vuh_vasr_WwVuh_rnd_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvwuhrndsat)(Vuu,Vv)4552#define Q6_Vuh_vasr_WwVuh_rnd_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvwuhrndsat)(Vuu,Vv)
5157#endif /* __HEXAGON_ARCH___ >= 69 */4553#endif
51584554
5159#if __HVX_ARCH__ >= 694555#if __HVX_ARCH__ >= 69
5160/* ==========================================================================4556/* ==========================================================================
...@@ -5165,7 +4561,7 @@...@@ -5165,7 +4561,7 @@
5165 ========================================================================== */4561 ========================================================================== */
51664562
5167#define Q6_Vuh_vasr_WwVuh_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvwuhsat)(Vuu,Vv)4563#define Q6_Vuh_vasr_WwVuh_sat(Vuu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vasrvwuhsat)(Vuu,Vv)
5168#endif /* __HEXAGON_ARCH___ >= 69 */4564#endif
51694565
5170#if __HVX_ARCH__ >= 694566#if __HVX_ARCH__ >= 69
5171/* ==========================================================================4567/* ==========================================================================
...@@ -5176,9 +4572,9 @@...@@ -5176,9 +4572,9 @@
5176 ========================================================================== */4572 ========================================================================== */
51774573
5178#define Q6_Vuh_vmpy_VuhVuh_rs16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhvs)(Vu,Vv)4574#define Q6_Vuh_vmpy_VuhVuh_rs16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhvs)(Vu,Vv)
5179#endif /* __HEXAGON_ARCH___ >= 69 */4575#endif
51804576
5181#if __HVX_ARCH__ >= 734577#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5182/* ==========================================================================4578/* ==========================================================================
5183 Assembly Syntax: Vdd32.sf=vadd(Vu32.bf,Vv32.bf)4579 Assembly Syntax: Vdd32.sf=vadd(Vu32.bf,Vv32.bf)
5184 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,
...@@ -5187,7 +4583,7 @@...@@ -5187,7 +4583,7 @@
51874583
5188#define Q6_Wsf_vadd_VbfVbf(Vu, Vv) \4584#define Q6_Wsf_vadd_VbfVbf(Vu, Vv) \
5189 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_bf)(Vu, Vv)4585 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_bf)(Vu, Vv)
5190#endif /* __HEXAGON_ARCH___ >= 73 */4586#endif
51914587
5192#if __HVX_ARCH__ >= 734588#if __HVX_ARCH__ >= 73
5193/* ==========================================================================4589/* ==========================================================================
...@@ -5199,7 +4595,7 @@...@@ -5199,7 +4595,7 @@
51994595
5200#define Q6_Vh_equals_Vhf(Vu) \4596#define Q6_Vh_equals_Vhf(Vu) \
5201 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_h_hf)(Vu)4597 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_h_hf)(Vu)
5202#endif /* __HEXAGON_ARCH___ >= 73 */4598#endif
52034599
5204#if __HVX_ARCH__ >= 734600#if __HVX_ARCH__ >= 73
5205/* ==========================================================================4601/* ==========================================================================
...@@ -5211,7 +4607,7 @@...@@ -5211,7 +4607,7 @@
52114607
5212#define Q6_Vhf_equals_Vh(Vu) \4608#define Q6_Vhf_equals_Vh(Vu) \
5213 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_h)(Vu)4609 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_h)(Vu)
5214#endif /* __HEXAGON_ARCH___ >= 73 */4610#endif
52154611
5216#if __HVX_ARCH__ >= 734612#if __HVX_ARCH__ >= 73
5217/* ==========================================================================4613/* ==========================================================================
...@@ -5223,7 +4619,7 @@...@@ -5223,7 +4619,7 @@
52234619
5224#define Q6_Vsf_equals_Vw(Vu) \4620#define Q6_Vsf_equals_Vw(Vu) \
5225 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_sf_w)(Vu)4621 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_sf_w)(Vu)
5226#endif /* __HEXAGON_ARCH___ >= 73 */4622#endif
52274623
5228#if __HVX_ARCH__ >= 734624#if __HVX_ARCH__ >= 73
5229/* ==========================================================================4625/* ==========================================================================
...@@ -5235,9 +4631,9 @@...@@ -5235,9 +4631,9 @@
52354631
5236#define Q6_Vw_equals_Vsf(Vu) \4632#define Q6_Vw_equals_Vsf(Vu) \
5237 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_w_sf)(Vu)4633 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_w_sf)(Vu)
5238#endif /* __HEXAGON_ARCH___ >= 73 */4634#endif
52394635
5240#if __HVX_ARCH__ >= 734636#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5241/* ==========================================================================4637/* ==========================================================================
5242 Assembly Syntax: Vd32.bf=vcvt(Vu32.sf,Vv32.sf)4638 Assembly Syntax: Vd32.bf=vcvt(Vu32.sf,Vv32.sf)
5243 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vcvt_VsfVsf(HVX_Vector Vu,4639 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vcvt_VsfVsf(HVX_Vector Vu,
...@@ -5246,7 +4642,7 @@...@@ -5246,7 +4642,7 @@
52464642
5247#define Q6_Vbf_vcvt_VsfVsf(Vu, Vv) \4643#define Q6_Vbf_vcvt_VsfVsf(Vu, Vv) \
5248 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_bf_sf)(Vu, Vv)4644 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_bf_sf)(Vu, Vv)
5249#endif /* __HEXAGON_ARCH___ >= 73 */4645#endif
52504646
5251#if __HVX_ARCH__ >= 734647#if __HVX_ARCH__ >= 73
5252/* ==========================================================================4648/* ==========================================================================
...@@ -5258,7 +4654,7 @@...@@ -5258,7 +4654,7 @@
5258#define Q6_Q_vcmp_gt_VbfVbf(Vu, Vv) \4654#define Q6_Q_vcmp_gt_VbfVbf(Vu, Vv) \
5259 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt) \4655 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt) \
5260 ((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtbf)(Vu, Vv)), -1)4656 ((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtbf)(Vu, Vv)), -1)
5261#endif /* __HEXAGON_ARCH___ >= 73 */4657#endif
52624658
5263#if __HVX_ARCH__ >= 734659#if __HVX_ARCH__ >= 73
5264/* ==========================================================================4660/* ==========================================================================
...@@ -5274,7 +4670,7 @@...@@ -5274,7 +4670,7 @@
5274 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \4670 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5275 Vv)), \4671 Vv)), \
5276 -1)4672 -1)
5277#endif /* __HEXAGON_ARCH___ >= 73 */4673#endif
52784674
5279#if __HVX_ARCH__ >= 734675#if __HVX_ARCH__ >= 73
5280/* ==========================================================================4676/* ==========================================================================
...@@ -5290,7 +4686,7 @@...@@ -5290,7 +4686,7 @@
5290 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \4686 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5291 Vv)), \4687 Vv)), \
5292 -1)4688 -1)
5293#endif /* __HEXAGON_ARCH___ >= 73 */4689#endif
52944690
5295#if __HVX_ARCH__ >= 734691#if __HVX_ARCH__ >= 73
5296/* ==========================================================================4692/* ==========================================================================
...@@ -5306,9 +4702,9 @@...@@ -5306,9 +4702,9 @@
5306 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \4702 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5307 Vv)), \4703 Vv)), \
5308 -1)4704 -1)
5309#endif /* __HEXAGON_ARCH___ >= 73 */4705#endif
53104706
5311#if __HVX_ARCH__ >= 734707#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5312/* ==========================================================================4708/* ==========================================================================
5313 Assembly Syntax: Vd32.bf=vmax(Vu32.bf,Vv32.bf)4709 Assembly Syntax: Vd32.bf=vmax(Vu32.bf,Vv32.bf)
5314 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmax_VbfVbf(HVX_Vector Vu,4710 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmax_VbfVbf(HVX_Vector Vu,
...@@ -5317,9 +4713,9 @@...@@ -5317,9 +4713,9 @@
53174713
5318#define Q6_Vbf_vmax_VbfVbf(Vu, Vv) \4714#define Q6_Vbf_vmax_VbfVbf(Vu, Vv) \
5319 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_bf)(Vu, Vv)4715 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_bf)(Vu, Vv)
5320#endif /* __HEXAGON_ARCH___ >= 73 */4716#endif
53214717
5322#if __HVX_ARCH__ >= 734718#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5323/* ==========================================================================4719/* ==========================================================================
5324 Assembly Syntax: Vd32.bf=vmin(Vu32.bf,Vv32.bf)4720 Assembly Syntax: Vd32.bf=vmin(Vu32.bf,Vv32.bf)
5325 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmin_VbfVbf(HVX_Vector Vu,4721 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmin_VbfVbf(HVX_Vector Vu,
...@@ -5328,9 +4724,9 @@...@@ -5328,9 +4724,9 @@
53284724
5329#define Q6_Vbf_vmin_VbfVbf(Vu, Vv) \4725#define Q6_Vbf_vmin_VbfVbf(Vu, Vv) \
5330 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_bf)(Vu, Vv)4726 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_bf)(Vu, Vv)
5331#endif /* __HEXAGON_ARCH___ >= 73 */4727#endif
53324728
5333#if __HVX_ARCH__ >= 734729#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5334/* ==========================================================================4730/* ==========================================================================
5335 Assembly Syntax: Vdd32.sf=vmpy(Vu32.bf,Vv32.bf)4731 Assembly Syntax: Vdd32.sf=vmpy(Vu32.bf,Vv32.bf)
5336 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VbfVbf(HVX_Vector Vu,4732 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VbfVbf(HVX_Vector Vu,
...@@ -5339,9 +4735,9 @@...@@ -5339,9 +4735,9 @@
53394735
5340#define Q6_Wsf_vmpy_VbfVbf(Vu, Vv) \4736#define Q6_Wsf_vmpy_VbfVbf(Vu, Vv) \
5341 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_bf)(Vu, Vv)4737 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_bf)(Vu, Vv)
5342#endif /* __HEXAGON_ARCH___ >= 73 */4738#endif
53434739
5344#if __HVX_ARCH__ >= 734740#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5345/* ==========================================================================4741/* ==========================================================================
5346 Assembly Syntax: Vxx32.sf+=vmpy(Vu32.bf,Vv32.bf)4742 Assembly Syntax: Vxx32.sf+=vmpy(Vu32.bf,Vv32.bf)
5347 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVbfVbf(HVX_VectorPair4743 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVbfVbf(HVX_VectorPair
...@@ -5351,9 +4747,9 @@...@@ -5351,9 +4747,9 @@
53514747
5352#define Q6_Wsf_vmpyacc_WsfVbfVbf(Vxx, Vu, Vv) \4748#define Q6_Wsf_vmpyacc_WsfVbfVbf(Vxx, Vu, Vv) \
5353 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_bf_acc)(Vxx, Vu, Vv)4749 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_bf_acc)(Vxx, Vu, Vv)
5354#endif /* __HEXAGON_ARCH___ >= 73 */4750#endif
53554751
5356#if __HVX_ARCH__ >= 734752#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
5357/* ==========================================================================4753/* ==========================================================================
5358 Assembly Syntax: Vdd32.sf=vsub(Vu32.bf,Vv32.bf)4754 Assembly Syntax: Vdd32.sf=vsub(Vu32.bf,Vv32.bf)
5359 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VbfVbf(HVX_Vector Vu,4755 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VbfVbf(HVX_Vector Vu,
...@@ -5362,7 +4758,7 @@...@@ -5362,7 +4758,7 @@
53624758
5363#define Q6_Wsf_vsub_VbfVbf(Vu, Vv) \4759#define Q6_Wsf_vsub_VbfVbf(Vu, Vv) \
5364 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_bf)(Vu, Vv)4760 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_bf)(Vu, Vv)
5365#endif /* __HEXAGON_ARCH___ >= 73 */4761#endif
53664762
5367#if __HVX_ARCH__ >= 794763#if __HVX_ARCH__ >= 79
5368/* ==========================================================================4764/* ==========================================================================
...@@ -5374,7 +4770,7 @@...@@ -5374,7 +4770,7 @@
53744770
5375#define Q6_V_vgetqfext_VR(Vu, Rt) \4771#define Q6_V_vgetqfext_VR(Vu, Rt) \
5376 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_get_qfext)(Vu, Rt)4772 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_get_qfext)(Vu, Rt)
5377#endif /* __HEXAGON_ARCH___ >= 79 */4773#endif
53784774
5379#if __HVX_ARCH__ >= 794775#if __HVX_ARCH__ >= 79
5380/* ==========================================================================4776/* ==========================================================================
...@@ -5386,7 +4782,7 @@...@@ -5386,7 +4782,7 @@
53864782
5387#define Q6_V_vgetqfextor_VVR(Vx, Vu, Rt) \4783#define Q6_V_vgetqfextor_VVR(Vx, Vu, Rt) \
5388 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_get_qfext_oracc)(Vx, Vu, Rt)4784 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_get_qfext_oracc)(Vx, Vu, Rt)
5389#endif /* __HEXAGON_ARCH___ >= 79 */4785#endif
53904786
5391#if __HVX_ARCH__ >= 794787#if __HVX_ARCH__ >= 79
5392/* ==========================================================================4788/* ==========================================================================
...@@ -5398,9 +4794,9 @@...@@ -5398,9 +4794,9 @@
53984794
5399#define Q6_V_vsetqfext_VR(Vu, Rt) \4795#define Q6_V_vsetqfext_VR(Vu, Rt) \
5400 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_set_qfext)(Vu, Rt)4796 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_set_qfext)(Vu, Rt)
5401#endif /* __HEXAGON_ARCH___ >= 79 */4797#endif
54024798
5403#if __HVX_ARCH__ >= 794799#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5404/* ==========================================================================4800/* ==========================================================================
5405 Assembly Syntax: Vd32.f8=vabs(Vu32.f8)4801 Assembly Syntax: Vd32.f8=vabs(Vu32.f8)
5406 C Intrinsic Prototype: HVX_Vector Q6_V_vabs_V(HVX_Vector Vu)4802 C Intrinsic Prototype: HVX_Vector Q6_V_vabs_V(HVX_Vector Vu)
...@@ -5409,9 +4805,9 @@...@@ -5409,9 +4805,9 @@
5409 ========================================================================== */4805 ========================================================================== */
54104806
5411#define Q6_V_vabs_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_f8)(Vu)4807#define Q6_V_vabs_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_f8)(Vu)
5412#endif /* __HEXAGON_ARCH___ >= 79 */4808#endif
54134809
5414#if __HVX_ARCH__ >= 794810#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5415/* ==========================================================================4811/* ==========================================================================
5416 Assembly Syntax: Vdd32.hf=vadd(Vu32.f8,Vv32.f8)4812 Assembly Syntax: Vdd32.hf=vadd(Vu32.f8,Vv32.f8)
5417 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vadd_VV(HVX_Vector Vu,4813 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vadd_VV(HVX_Vector Vu,
...@@ -5420,9 +4816,9 @@...@@ -5420,9 +4816,9 @@
54204816
5421#define Q6_Whf_vadd_VV(Vu, Vv) \4817#define Q6_Whf_vadd_VV(Vu, Vv) \
5422 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf_f8)(Vu, Vv)4818 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf_f8)(Vu, Vv)
5423#endif /* __HEXAGON_ARCH___ >= 79 */4819#endif
54244820
5425#if __HVX_ARCH__ >= 794821#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5426/* ==========================================================================4822/* ==========================================================================
5427 Assembly Syntax: Vd32.b=vcvt2(Vu32.hf,Vv32.hf)4823 Assembly Syntax: Vd32.b=vcvt2(Vu32.hf,Vv32.hf)
5428 C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt2_VhfVhf(HVX_Vector Vu,4824 C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt2_VhfVhf(HVX_Vector Vu,
...@@ -5431,9 +4827,9 @@...@@ -5431,9 +4827,9 @@
54314827
5432#define Q6_Vb_vcvt2_VhfVhf(Vu, Vv) \4828#define Q6_Vb_vcvt2_VhfVhf(Vu, Vv) \
5433 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_b_hf)(Vu, Vv)4829 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_b_hf)(Vu, Vv)
5434#endif /* __HEXAGON_ARCH___ >= 79 */4830#endif
54354831
5436#if __HVX_ARCH__ >= 794832#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5437/* ==========================================================================4833/* ==========================================================================
5438 Assembly Syntax: Vdd32.hf=vcvt2(Vu32.b)4834 Assembly Syntax: Vdd32.hf=vcvt2(Vu32.b)
5439 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt2_Vb(HVX_Vector Vu)4835 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt2_Vb(HVX_Vector Vu)
...@@ -5443,9 +4839,9 @@...@@ -5443,9 +4839,9 @@
54434839
5444#define Q6_Whf_vcvt2_Vb(Vu) \4840#define Q6_Whf_vcvt2_Vb(Vu) \
5445 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_hf_b)(Vu)4841 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_hf_b)(Vu)
5446#endif /* __HEXAGON_ARCH___ >= 79 */4842#endif
54474843
5448#if __HVX_ARCH__ >= 794844#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5449/* ==========================================================================4845/* ==========================================================================
5450 Assembly Syntax: Vdd32.hf=vcvt2(Vu32.ub)4846 Assembly Syntax: Vdd32.hf=vcvt2(Vu32.ub)
5451 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt2_Vub(HVX_Vector Vu)4847 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt2_Vub(HVX_Vector Vu)
...@@ -5455,9 +4851,9 @@...@@ -5455,9 +4851,9 @@
54554851
5456#define Q6_Whf_vcvt2_Vub(Vu) \4852#define Q6_Whf_vcvt2_Vub(Vu) \
5457 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_hf_ub)(Vu)4853 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_hf_ub)(Vu)
5458#endif /* __HEXAGON_ARCH___ >= 79 */4854#endif
54594855
5460#if __HVX_ARCH__ >= 794856#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5461/* ==========================================================================4857/* ==========================================================================
5462 Assembly Syntax: Vd32.ub=vcvt2(Vu32.hf,Vv32.hf)4858 Assembly Syntax: Vd32.ub=vcvt2(Vu32.hf,Vv32.hf)
5463 C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt2_VhfVhf(HVX_Vector Vu,4859 C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt2_VhfVhf(HVX_Vector Vu,
...@@ -5466,9 +4862,9 @@...@@ -5466,9 +4862,9 @@
54664862
5467#define Q6_Vub_vcvt2_VhfVhf(Vu, Vv) \4863#define Q6_Vub_vcvt2_VhfVhf(Vu, Vv) \
5468 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_ub_hf)(Vu, Vv)4864 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_ub_hf)(Vu, Vv)
5469#endif /* __HEXAGON_ARCH___ >= 79 */4865#endif
54704866
5471#if __HVX_ARCH__ >= 794867#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5472/* ==========================================================================4868/* ==========================================================================
5473 Assembly Syntax: Vd32.f8=vcvt(Vu32.hf,Vv32.hf)4869 Assembly Syntax: Vd32.f8=vcvt(Vu32.hf,Vv32.hf)
5474 C Intrinsic Prototype: HVX_Vector Q6_V_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector4870 C Intrinsic Prototype: HVX_Vector Q6_V_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector
...@@ -5477,9 +4873,9 @@...@@ -5477,9 +4873,9 @@
54774873
5478#define Q6_V_vcvt_VhfVhf(Vu, Vv) \4874#define Q6_V_vcvt_VhfVhf(Vu, Vv) \
5479 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_f8_hf)(Vu, Vv)4875 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_f8_hf)(Vu, Vv)
5480#endif /* __HEXAGON_ARCH___ >= 79 */4876#endif
54814877
5482#if __HVX_ARCH__ >= 794878#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5483/* ==========================================================================4879/* ==========================================================================
5484 Assembly Syntax: Vdd32.hf=vcvt(Vu32.f8)4880 Assembly Syntax: Vdd32.hf=vcvt(Vu32.f8)
5485 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_V(HVX_Vector Vu)4881 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_V(HVX_Vector Vu)
...@@ -5489,9 +4885,9 @@...@@ -5489,9 +4885,9 @@
54894885
5490#define Q6_Whf_vcvt_V(Vu) \4886#define Q6_Whf_vcvt_V(Vu) \
5491 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_f8)(Vu)4887 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_f8)(Vu)
5492#endif /* __HEXAGON_ARCH___ >= 79 */4888#endif
54934889
5494#if __HVX_ARCH__ >= 794890#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5495/* ==========================================================================4891/* ==========================================================================
5496 Assembly Syntax: Vd32.f8=vfmax(Vu32.f8,Vv32.f8)4892 Assembly Syntax: Vd32.f8=vfmax(Vu32.f8,Vv32.f8)
5497 C Intrinsic Prototype: HVX_Vector Q6_V_vfmax_VV(HVX_Vector Vu, HVX_Vector Vv)4893 C Intrinsic Prototype: HVX_Vector Q6_V_vfmax_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5501,9 +4897,9 @@...@@ -5501,9 +4897,9 @@
55014897
5502#define Q6_V_vfmax_VV(Vu, Vv) \4898#define Q6_V_vfmax_VV(Vu, Vv) \
5503 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_f8)(Vu, Vv)4899 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_f8)(Vu, Vv)
5504#endif /* __HEXAGON_ARCH___ >= 79 */4900#endif
55054901
5506#if __HVX_ARCH__ >= 794902#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5507/* ==========================================================================4903/* ==========================================================================
5508 Assembly Syntax: Vd32.f8=vfmin(Vu32.f8,Vv32.f8)4904 Assembly Syntax: Vd32.f8=vfmin(Vu32.f8,Vv32.f8)
5509 C Intrinsic Prototype: HVX_Vector Q6_V_vfmin_VV(HVX_Vector Vu, HVX_Vector Vv)4905 C Intrinsic Prototype: HVX_Vector Q6_V_vfmin_VV(HVX_Vector Vu, HVX_Vector Vv)
...@@ -5513,9 +4909,9 @@...@@ -5513,9 +4909,9 @@
55134909
5514#define Q6_V_vfmin_VV(Vu, Vv) \4910#define Q6_V_vfmin_VV(Vu, Vv) \
5515 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_f8)(Vu, Vv)4911 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_f8)(Vu, Vv)
5516#endif /* __HEXAGON_ARCH___ >= 79 */4912#endif
55174913
5518#if __HVX_ARCH__ >= 794914#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5519/* ==========================================================================4915/* ==========================================================================
5520 Assembly Syntax: Vd32.f8=vfneg(Vu32.f8)4916 Assembly Syntax: Vd32.f8=vfneg(Vu32.f8)
5521 C Intrinsic Prototype: HVX_Vector Q6_V_vfneg_V(HVX_Vector Vu)4917 C Intrinsic Prototype: HVX_Vector Q6_V_vfneg_V(HVX_Vector Vu)
...@@ -5525,7 +4921,7 @@...@@ -5525,7 +4921,7 @@
55254921
5526#define Q6_V_vfneg_V(Vu) \4922#define Q6_V_vfneg_V(Vu) \
5527 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_f8)(Vu)4923 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_f8)(Vu)
5528#endif /* __HEXAGON_ARCH___ >= 79 */4924#endif
55294925
5530#if __HVX_ARCH__ >= 794926#if __HVX_ARCH__ >= 79
5531/* ==========================================================================4927/* ==========================================================================
...@@ -5536,9 +4932,9 @@...@@ -5536,9 +4932,9 @@
55364932
5537#define Q6_V_vmerge_VVw(Vu, Vv) \4933#define Q6_V_vmerge_VVw(Vu, Vv) \
5538 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmerge_qf)(Vu, Vv)4934 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmerge_qf)(Vu, Vv)
5539#endif /* __HEXAGON_ARCH___ >= 79 */4935#endif
55404936
5541#if __HVX_ARCH__ >= 794937#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5542/* ==========================================================================4938/* ==========================================================================
5543 Assembly Syntax: Vdd32.hf=vmpy(Vu32.f8,Vv32.f8)4939 Assembly Syntax: Vdd32.hf=vmpy(Vu32.f8,Vv32.f8)
5544 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpy_VV(HVX_Vector Vu,4940 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpy_VV(HVX_Vector Vu,
...@@ -5547,9 +4943,9 @@...@@ -5547,9 +4943,9 @@
55474943
5548#define Q6_Whf_vmpy_VV(Vu, Vv) \4944#define Q6_Whf_vmpy_VV(Vu, Vv) \
5549 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_f8)(Vu, Vv)4945 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_f8)(Vu, Vv)
5550#endif /* __HEXAGON_ARCH___ >= 79 */4946#endif
55514947
5552#if __HVX_ARCH__ >= 794948#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5553/* ==========================================================================4949/* ==========================================================================
5554 Assembly Syntax: Vxx32.hf+=vmpy(Vu32.f8,Vv32.f8)4950 Assembly Syntax: Vxx32.hf+=vmpy(Vu32.f8,Vv32.f8)
5555 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpyacc_WhfVV(HVX_VectorPair4951 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpyacc_WhfVV(HVX_VectorPair
...@@ -5559,7 +4955,7 @@...@@ -5559,7 +4955,7 @@
55594955
5560#define Q6_Whf_vmpyacc_WhfVV(Vxx, Vu, Vv) \4956#define Q6_Whf_vmpyacc_WhfVV(Vxx, Vu, Vv) \
5561 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_f8_acc)(Vxx, Vu, Vv)4957 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_f8_acc)(Vxx, Vu, Vv)
5562#endif /* __HEXAGON_ARCH___ >= 79 */4958#endif
55634959
5564#if __HVX_ARCH__ >= 794960#if __HVX_ARCH__ >= 79
5565/* ==========================================================================4961/* ==========================================================================
...@@ -5570,7 +4966,7 @@...@@ -5570,7 +4966,7 @@
55704966
5571#define Q6_Vqf16_vmpy_VhfRhf(Vu, Rt) \4967#define Q6_Vqf16_vmpy_VhfRhf(Vu, Rt) \
5572 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_hf)(Vu, Rt)4968 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_hf)(Vu, Rt)
5573#endif /* __HEXAGON_ARCH___ >= 79 */4969#endif
55744970
5575#if __HVX_ARCH__ >= 794971#if __HVX_ARCH__ >= 79
5576/* ==========================================================================4972/* ==========================================================================
...@@ -5581,7 +4977,7 @@...@@ -5581,7 +4977,7 @@
55814977
5582#define Q6_Vqf16_vmpy_Vqf16Rhf(Vu, Rt) \4978#define Q6_Vqf16_vmpy_Vqf16Rhf(Vu, Rt) \
5583 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_qf16)(Vu, Rt)4979 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_qf16)(Vu, Rt)
5584#endif /* __HEXAGON_ARCH___ >= 79 */4980#endif
55854981
5586#if __HVX_ARCH__ >= 794982#if __HVX_ARCH__ >= 79
5587/* ==========================================================================4983/* ==========================================================================
...@@ -5592,9 +4988,9 @@...@@ -5592,9 +4988,9 @@
55924988
5593#define Q6_Vqf32_vmpy_VsfRsf(Vu, Rt) \4989#define Q6_Vqf32_vmpy_VsfRsf(Vu, Rt) \
5594 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_sf)(Vu, Rt)4990 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_sf)(Vu, Rt)
5595#endif /* __HEXAGON_ARCH___ >= 79 */4991#endif
55964992
5597#if __HVX_ARCH__ >= 794993#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
5598/* ==========================================================================4994/* ==========================================================================
5599 Assembly Syntax: Vdd32.hf=vsub(Vu32.f8,Vv32.f8)4995 Assembly Syntax: Vdd32.hf=vsub(Vu32.f8,Vv32.f8)
5600 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vsub_VV(HVX_Vector Vu,4996 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vsub_VV(HVX_Vector Vu,
...@@ -5603,7 +4999,400 @@...@@ -5603,7 +4999,400 @@
56034999
5604#define Q6_Whf_vsub_VV(Vu, Vv) \5000#define Q6_Whf_vsub_VV(Vu, Vv) \
5605 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf_f8)(Vu, Vv)5001 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf_f8)(Vu, Vv)
5606#endif /* __HEXAGON_ARCH___ >= 79 */5002#endif
5003
5004#if __HVX_ARCH__ >= 81
5005/* ==========================================================================
5006 Assembly Syntax: Vd32.qf16=vabs(Vu32.hf)
5007 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vabs_Vhf(HVX_Vector Vu)
5008 Instruction Type: CVI_VS
5009 Execution Slots: SLOT0123
5010 ========================================================================== */
5011
5012#define Q6_Vqf16_vabs_Vhf(Vu) \
5013 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_qf16_hf)(Vu)
5014#endif
5015
5016#if __HVX_ARCH__ >= 81
5017/* ==========================================================================
5018 Assembly Syntax: Vd32.qf16=vabs(Vu32.qf16)
5019 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vabs_Vqf16(HVX_Vector Vu)
5020 Instruction Type: CVI_VS
5021 Execution Slots: SLOT0123
5022 ========================================================================== */
5023
5024#define Q6_Vqf16_vabs_Vqf16(Vu) \
5025 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_qf16_qf16)(Vu)
5026#endif
5027
5028#if __HVX_ARCH__ >= 81
5029/* ==========================================================================
5030 Assembly Syntax: Vd32.qf32=vabs(Vu32.qf32)
5031 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vabs_Vqf32(HVX_Vector Vu)
5032 Instruction Type: CVI_VS
5033 Execution Slots: SLOT0123
5034 ========================================================================== */
5035
5036#define Q6_Vqf32_vabs_Vqf32(Vu) \
5037 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_qf32_qf32)(Vu)
5038#endif
5039
5040#if __HVX_ARCH__ >= 81
5041/* ==========================================================================
5042 Assembly Syntax: Vd32.qf32=vabs(Vu32.sf)
5043 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vabs_Vsf(HVX_Vector Vu)
5044 Instruction Type: CVI_VS
5045 Execution Slots: SLOT0123
5046 ========================================================================== */
5047
5048#define Q6_Vqf32_vabs_Vsf(Vu) \
5049 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_qf32_sf)(Vu)
5050#endif
5051
5052#if __HVX_ARCH__ >= 81
5053/* ==========================================================================
5054 Assembly Syntax: Vd32=valign4(Vu32,Vv32,Rt8)
5055 C Intrinsic Prototype: HVX_Vector Q6_V_valign4_VVR(HVX_Vector Vu, HVX_Vector
5056 Vv, Word32 Rt) Instruction Type: CVI_VA Execution Slots: SLOT0123
5057 ========================================================================== */
5058
5059#define Q6_V_valign4_VVR(Vu, Vv, Rt) \
5060 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_valign4)(Vu, Vv, Rt)
5061#endif
5062
5063#if __HVX_ARCH__ >= 81
5064/* ==========================================================================
5065 Assembly Syntax: Vd32.bf=Vuu32.qf32
5066 C Intrinsic Prototype: HVX_Vector Q6_Vbf_equals_Wqf32(HVX_VectorPair Vuu)
5067 Instruction Type: CVI_VS
5068 Execution Slots: SLOT0123
5069 ========================================================================== */
5070
5071#define Q6_Vbf_equals_Wqf32(Vuu) \
5072 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_bf_qf32)(Vuu)
5073#endif
5074
5075#if __HVX_ARCH__ >= 81
5076/* ==========================================================================
5077 Assembly Syntax: Vd32.f8=Vu32.qf16
5078 C Intrinsic Prototype: HVX_Vector Q6_V_equals_Vqf16(HVX_Vector Vu)
5079 Instruction Type: CVI_VS
5080 Execution Slots: SLOT0123
5081 ========================================================================== */
5082
5083#define Q6_V_equals_Vqf16(Vu) \
5084 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_f8_qf16)(Vu)
5085#endif
5086
5087#if __HVX_ARCH__ >= 81
5088/* ==========================================================================
5089 Assembly Syntax: Vd32.h=Vu32.hf:rnd
5090 C Intrinsic Prototype: HVX_Vector Q6_Vh_equals_Vhf_rnd(HVX_Vector Vu)
5091 Instruction Type: CVI_VS
5092 Execution Slots: SLOT0123
5093 ========================================================================== */
5094
5095#define Q6_Vh_equals_Vhf_rnd(Vu) \
5096 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_h_hf_rnd)(Vu)
5097#endif
5098
5099#if __HVX_ARCH__ >= 81
5100/* ==========================================================================
5101 Assembly Syntax: Vdd32.qf16=Vu32.f8
5102 C Intrinsic Prototype: HVX_VectorPair Q6_Wqf16_equals_V(HVX_Vector Vu)
5103 Instruction Type: CVI_VP_VS
5104 Execution Slots: SLOT0123
5105 ========================================================================== */
5106
5107#define Q6_Wqf16_equals_V(Vu) \
5108 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_qf16_f8)(Vu)
5109#endif
5110
5111#if __HVX_ARCH__ >= 81
5112/* ==========================================================================
5113 Assembly Syntax: Vd32.qf16=Vu32.hf
5114 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_equals_Vhf(HVX_Vector Vu)
5115 Instruction Type: CVI_VS
5116 Execution Slots: SLOT0123
5117 ========================================================================== */
5118
5119#define Q6_Vqf16_equals_Vhf(Vu) \
5120 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_qf16_hf)(Vu)
5121#endif
5122
5123#if __HVX_ARCH__ >= 81
5124/* ==========================================================================
5125 Assembly Syntax: Vd32.qf16=Vu32.qf16
5126 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_equals_Vqf16(HVX_Vector Vu)
5127 Instruction Type: CVI_VS
5128 Execution Slots: SLOT0123
5129 ========================================================================== */
5130
5131#define Q6_Vqf16_equals_Vqf16(Vu) \
5132 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_qf16_qf16)(Vu)
5133#endif
5134
5135#if __HVX_ARCH__ >= 81
5136/* ==========================================================================
5137 Assembly Syntax: Vd32.qf32=Vu32.qf32
5138 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_equals_Vqf32(HVX_Vector Vu)
5139 Instruction Type: CVI_VS
5140 Execution Slots: SLOT0123
5141 ========================================================================== */
5142
5143#define Q6_Vqf32_equals_Vqf32(Vu) \
5144 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_qf32_qf32)(Vu)
5145#endif
5146
5147#if __HVX_ARCH__ >= 81
5148/* ==========================================================================
5149 Assembly Syntax: Vd32.qf32=Vu32.sf
5150 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_equals_Vsf(HVX_Vector Vu)
5151 Instruction Type: CVI_VS
5152 Execution Slots: SLOT0123
5153 ========================================================================== */
5154
5155#define Q6_Vqf32_equals_Vsf(Vu) \
5156 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_qf32_sf)(Vu)
5157#endif
5158
5159#if __HVX_ARCH__ >= 81
5160/* ==========================================================================
5161 Assembly Syntax: Qd4=vcmp.eq(Vu32.hf,Vv32.hf)
5162 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VhfVhf(HVX_Vector Vu,
5163 HVX_Vector Vv) Instruction Type: CVI_VA Execution Slots: SLOT0123
5164 ========================================================================== */
5165
5166#define Q6_Q_vcmp_eq_VhfVhf(Vu, Vv) \
5167 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5168 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqhf)(Vu, Vv)), -1)
5169#endif
5170
5171#if __HVX_ARCH__ >= 81
5172/* ==========================================================================
5173 Assembly Syntax: Qx4&=vcmp.eq(Vu32.hf,Vv32.hf)
5174 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVhfVhf(HVX_VectorPred
5175 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution
5176 Slots: SLOT0123
5177 ========================================================================== */
5178
5179#define Q6_Q_vcmp_eqand_QVhfVhf(Qx, Vu, Vv) \
5180 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5181 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqhf_and)( \
5182 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5183 Vv)), \
5184 -1)
5185#endif
5186
5187#if __HVX_ARCH__ >= 81
5188/* ==========================================================================
5189 Assembly Syntax: Qx4|=vcmp.eq(Vu32.hf,Vv32.hf)
5190 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVhfVhf(HVX_VectorPred
5191 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution
5192 Slots: SLOT0123
5193 ========================================================================== */
5194
5195#define Q6_Q_vcmp_eqor_QVhfVhf(Qx, Vu, Vv) \
5196 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5197 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqhf_or)( \
5198 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5199 Vv)), \
5200 -1)
5201#endif
5202
5203#if __HVX_ARCH__ >= 81
5204/* ==========================================================================
5205 Assembly Syntax: Qx4^=vcmp.eq(Vu32.hf,Vv32.hf)
5206 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVhfVhf(HVX_VectorPred
5207 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution
5208 Slots: SLOT0123
5209 ========================================================================== */
5210
5211#define Q6_Q_vcmp_eqxacc_QVhfVhf(Qx, Vu, Vv) \
5212 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5213 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqhf_xor)( \
5214 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5215 Vv)), \
5216 -1)
5217#endif
5218
5219#if __HVX_ARCH__ >= 81
5220/* ==========================================================================
5221 Assembly Syntax: Qd4=vcmp.eq(Vu32.sf,Vv32.sf)
5222 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VsfVsf(HVX_Vector Vu,
5223 HVX_Vector Vv) Instruction Type: CVI_VA Execution Slots: SLOT0123
5224 ========================================================================== */
5225
5226#define Q6_Q_vcmp_eq_VsfVsf(Vu, Vv) \
5227 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5228 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqsf)(Vu, Vv)), -1)
5229#endif
5230
5231#if __HVX_ARCH__ >= 81
5232/* ==========================================================================
5233 Assembly Syntax: Qx4&=vcmp.eq(Vu32.sf,Vv32.sf)
5234 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVsfVsf(HVX_VectorPred
5235 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution
5236 Slots: SLOT0123
5237 ========================================================================== */
5238
5239#define Q6_Q_vcmp_eqand_QVsfVsf(Qx, Vu, Vv) \
5240 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5241 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqsf_and)( \
5242 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5243 Vv)), \
5244 -1)
5245#endif
5246
5247#if __HVX_ARCH__ >= 81
5248/* ==========================================================================
5249 Assembly Syntax: Qx4|=vcmp.eq(Vu32.sf,Vv32.sf)
5250 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVsfVsf(HVX_VectorPred
5251 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution
5252 Slots: SLOT0123
5253 ========================================================================== */
5254
5255#define Q6_Q_vcmp_eqor_QVsfVsf(Qx, Vu, Vv) \
5256 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5257 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqsf_or)( \
5258 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5259 Vv)), \
5260 -1)
5261#endif
5262
5263#if __HVX_ARCH__ >= 81
5264/* ==========================================================================
5265 Assembly Syntax: Qx4^=vcmp.eq(Vu32.sf,Vv32.sf)
5266 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVsfVsf(HVX_VectorPred
5267 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution
5268 Slots: SLOT0123
5269 ========================================================================== */
5270
5271#define Q6_Q_vcmp_eqxacc_QVsfVsf(Qx, Vu, Vv) \
5272 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)( \
5273 (__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_veqsf_xor)( \
5274 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu, \
5275 Vv)), \
5276 -1)
5277#endif
5278
5279#if __HVX_ARCH__ >= 81
5280/* ==========================================================================
5281 Assembly Syntax: Vd32.w=vilog2(Vu32.hf)
5282 C Intrinsic Prototype: HVX_Vector Q6_Vw_vilog2_Vhf(HVX_Vector Vu)
5283 Instruction Type: CVI_VS
5284 Execution Slots: SLOT0123
5285 ========================================================================== */
5286
5287#define Q6_Vw_vilog2_Vhf(Vu) \
5288 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vilog2_hf)(Vu)
5289#endif
5290
5291#if __HVX_ARCH__ >= 81
5292/* ==========================================================================
5293 Assembly Syntax: Vd32.w=vilog2(Vu32.qf16)
5294 C Intrinsic Prototype: HVX_Vector Q6_Vw_vilog2_Vqf16(HVX_Vector Vu)
5295 Instruction Type: CVI_VS
5296 Execution Slots: SLOT0123
5297 ========================================================================== */
5298
5299#define Q6_Vw_vilog2_Vqf16(Vu) \
5300 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vilog2_qf16)(Vu)
5301#endif
5302
5303#if __HVX_ARCH__ >= 81
5304/* ==========================================================================
5305 Assembly Syntax: Vd32.w=vilog2(Vu32.qf32)
5306 C Intrinsic Prototype: HVX_Vector Q6_Vw_vilog2_Vqf32(HVX_Vector Vu)
5307 Instruction Type: CVI_VS
5308 Execution Slots: SLOT0123
5309 ========================================================================== */
5310
5311#define Q6_Vw_vilog2_Vqf32(Vu) \
5312 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vilog2_qf32)(Vu)
5313#endif
5314
5315#if __HVX_ARCH__ >= 81
5316/* ==========================================================================
5317 Assembly Syntax: Vd32.w=vilog2(Vu32.sf)
5318 C Intrinsic Prototype: HVX_Vector Q6_Vw_vilog2_Vsf(HVX_Vector Vu)
5319 Instruction Type: CVI_VS
5320 Execution Slots: SLOT0123
5321 ========================================================================== */
5322
5323#define Q6_Vw_vilog2_Vsf(Vu) \
5324 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vilog2_sf)(Vu)
5325#endif
5326
5327#if __HVX_ARCH__ >= 81
5328/* ==========================================================================
5329 Assembly Syntax: Vd32.qf16=vneg(Vu32.hf)
5330 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vneg_Vhf(HVX_Vector Vu)
5331 Instruction Type: CVI_VS
5332 Execution Slots: SLOT0123
5333 ========================================================================== */
5334
5335#define Q6_Vqf16_vneg_Vhf(Vu) \
5336 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vneg_qf16_hf)(Vu)
5337#endif
5338
5339#if __HVX_ARCH__ >= 81
5340/* ==========================================================================
5341 Assembly Syntax: Vd32.qf16=vneg(Vu32.qf16)
5342 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vneg_Vqf16(HVX_Vector Vu)
5343 Instruction Type: CVI_VS
5344 Execution Slots: SLOT0123
5345 ========================================================================== */
5346
5347#define Q6_Vqf16_vneg_Vqf16(Vu) \
5348 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vneg_qf16_qf16)(Vu)
5349#endif
5350
5351#if __HVX_ARCH__ >= 81
5352/* ==========================================================================
5353 Assembly Syntax: Vd32.qf32=vneg(Vu32.qf32)
5354 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vneg_Vqf32(HVX_Vector Vu)
5355 Instruction Type: CVI_VS
5356 Execution Slots: SLOT0123
5357 ========================================================================== */
5358
5359#define Q6_Vqf32_vneg_Vqf32(Vu) \
5360 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vneg_qf32_qf32)(Vu)
5361#endif
5362
5363#if __HVX_ARCH__ >= 81
5364/* ==========================================================================
5365 Assembly Syntax: Vd32.qf32=vneg(Vu32.sf)
5366 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vneg_Vsf(HVX_Vector Vu)
5367 Instruction Type: CVI_VS
5368 Execution Slots: SLOT0123
5369 ========================================================================== */
5370
5371#define Q6_Vqf32_vneg_Vsf(Vu) \
5372 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vneg_qf32_sf)(Vu)
5373#endif
5374
5375#if __HVX_ARCH__ >= 81
5376/* ==========================================================================
5377 Assembly Syntax: Vd32.qf16=vsub(Vu32.hf,Vv32.qf16)
5378 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vsub_VhfVqf16(HVX_Vector Vu,
5379 HVX_Vector Vv) Instruction Type: CVI_VS Execution Slots: SLOT0123
5380 ========================================================================== */
5381
5382#define Q6_Vqf16_vsub_VhfVqf16(Vu, Vv) \
5383 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf_mix)(Vu, Vv)
5384#endif
5385
5386#if __HVX_ARCH__ >= 81
5387/* ==========================================================================
5388 Assembly Syntax: Vd32.qf32=vsub(Vu32.sf,Vv32.qf32)
5389 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vsub_VsfVqf32(HVX_Vector Vu,
5390 HVX_Vector Vv) Instruction Type: CVI_VS Execution Slots: SLOT0123
5391 ========================================================================== */
5392
5393#define Q6_Vqf32_vsub_VsfVqf32(Vu, Vv) \
5394 __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_mix)(Vu, Vv)
5395#endif
56075396
5608#endif /* __HVX__ */5397#endif /* __HVX__ */
56095398
lib/include/immintrin.h-12
...@@ -475,24 +475,12 @@ _storebe_i64(void * __P, long long __D) {...@@ -475,24 +475,12 @@ _storebe_i64(void * __P, long long __D) {
475475
476#include <amxfp8intrin.h>476#include <amxfp8intrin.h>
477477
478#include <amxtransposeintrin.h>
479
480#include <amxmovrsintrin.h>478#include <amxmovrsintrin.h>
481479
482#include <amxmovrstransposeintrin.h>
483
484#include <amxavx512intrin.h>480#include <amxavx512intrin.h>
485481
486#include <amxtf32intrin.h>482#include <amxtf32intrin.h>
487483
488#include <amxtf32transposeintrin.h>
489
490#include <amxbf16transposeintrin.h>
491
492#include <amxfp16transposeintrin.h>
493
494#include <amxcomplextransposeintrin.h>
495
496#include <avx512vp2intersectintrin.h>484#include <avx512vp2intersectintrin.h>
497485
498#include <avx512vlvp2intersectintrin.h>486#include <avx512vlvp2intersectintrin.h>
lib/include/intrin.h+4
...@@ -30,6 +30,10 @@...@@ -30,6 +30,10 @@
30#include <arm64intr.h>30#include <arm64intr.h>
31#endif31#endif
3232
33#if defined(__ARM_ACLE)
34#include <arm_acle.h>
35#endif
36
33/* For the definition of jmp_buf. */37/* For the definition of jmp_buf. */
34#if __STDC_HOSTED__38#if __STDC_HOSTED__
35#include <setjmp.h>39#include <setjmp.h>
lib/include/lasxintrin.h+113
...@@ -10,6 +10,8 @@...@@ -10,6 +10,8 @@
10#ifndef _LOONGSON_ASXINTRIN_H10#ifndef _LOONGSON_ASXINTRIN_H
11#define _LOONGSON_ASXINTRIN_H 111#define _LOONGSON_ASXINTRIN_H 1
1212
13#include <lsxintrin.h>
14
13#if defined(__loongarch_asx)15#if defined(__loongarch_asx)
1416
15typedef signed char v32i8 __attribute__((vector_size(32), aligned(32)));17typedef signed char v32i8 __attribute__((vector_size(32), aligned(32)));
...@@ -3882,5 +3884,116 @@ extern __inline...@@ -3882,5 +3884,116 @@ extern __inline
38823884
3883#define __lasx_xvrepli_w(/*si10*/ _1) ((__m256i)__builtin_lasx_xvrepli_w((_1)))3885#define __lasx_xvrepli_w(/*si10*/ _1) ((__m256i)__builtin_lasx_xvrepli_w((_1)))
38843886
3887#if defined(__loongarch_asx_sx_conv)
3888
3889extern __inline
3890 __attribute__((__gnu_inline__, __always_inline__,
3891 __artificial__)) __m256 __lasx_cast_128_s(__m128 _1) {
3892 return (__m256)__builtin_lasx_cast_128_s((v4f32)_1);
3893}
3894
3895extern __inline
3896 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256d
3897 __lasx_cast_128_d(__m128d _1) {
3898 return (__m256d)__builtin_lasx_cast_128_d((v2f64)_1);
3899}
3900
3901extern __inline
3902 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256i
3903 __lasx_cast_128(__m128i _1) {
3904 return (__m256i)__builtin_lasx_cast_128((v2i64)_1);
3905}
3906
3907extern __inline
3908 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
3909 __lasx_concat_128_s(__m128 _1, __m128 _2) {
3910 return (__m256)__builtin_lasx_concat_128_s((v4f32)_1, (v4f32)_2);
3911}
3912
3913extern __inline
3914 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256d
3915 __lasx_concat_128_d(__m128d _1, __m128d _2) {
3916 return (__m256d)__builtin_lasx_concat_128_d((v2f64)_1, (v2f64)_2);
3917}
3918
3919extern __inline
3920 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256i
3921 __lasx_concat_128(__m128i _1, __m128i _2) {
3922 return (__m256i)__builtin_lasx_concat_128((v2i64)_1, (v2i64)_2);
3923}
3924
3925extern __inline
3926 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128
3927 __lasx_extract_128_lo_s(__m256 _1) {
3928 return (__m128)__builtin_lasx_extract_128_lo_s((v8f32)_1);
3929}
3930
3931extern __inline
3932 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128d
3933 __lasx_extract_128_lo_d(__m256d _1) {
3934 return (__m128d)__builtin_lasx_extract_128_lo_d((v4f64)_1);
3935}
3936
3937extern __inline
3938 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128i
3939 __lasx_extract_128_lo(__m256i _1) {
3940 return (__m128i)__builtin_lasx_extract_128_lo((v4i64)_1);
3941}
3942
3943extern __inline
3944 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128
3945 __lasx_extract_128_hi_s(__m256 _1) {
3946 return (__m128)__builtin_lasx_extract_128_hi_s((v8f32)_1);
3947}
3948
3949extern __inline
3950 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128d
3951 __lasx_extract_128_hi_d(__m256d _1) {
3952 return (__m128d)__builtin_lasx_extract_128_hi_d((v4f64)_1);
3953}
3954
3955extern __inline
3956 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128i
3957 __lasx_extract_128_hi(__m256i _1) {
3958 return (__m128i)__builtin_lasx_extract_128_hi((v4i64)_1);
3959}
3960
3961extern __inline
3962 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
3963 __lasx_insert_128_lo_s(__m256 _1, __m128 _2) {
3964 return (__m256)__builtin_lasx_insert_128_lo_s((v8f32)_1, (v4f32)_2);
3965}
3966
3967extern __inline
3968 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256d
3969 __lasx_insert_128_lo_d(__m256d _1, __m128d _2) {
3970 return (__m256d)__builtin_lasx_insert_128_lo_d((v4f64)_1, (v2f64)_2);
3971}
3972
3973extern __inline
3974 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256i
3975 __lasx_insert_128_lo(__m256i _1, __m128i _2) {
3976 return (__m256i)__builtin_lasx_insert_128_lo((v4i64)_1, (v2i64)_2);
3977}
3978
3979extern __inline
3980 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
3981 __lasx_insert_128_hi_s(__m256 _1, __m128 _2) {
3982 return (__m256)__builtin_lasx_insert_128_hi_s((v8f32)_1, (v4f32)_2);
3983}
3984
3985extern __inline
3986 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256d
3987 __lasx_insert_128_hi_d(__m256d _1, __m128d _2) {
3988 return (__m256d)__builtin_lasx_insert_128_hi_d((v4f64)_1, (v2f64)_2);
3989}
3990
3991extern __inline
3992 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256i
3993 __lasx_insert_128_hi(__m256i _1, __m128i _2) {
3994 return (__m256i)__builtin_lasx_insert_128_hi((v4i64)_1, (v2i64)_2);
3995}
3996
3997#endif /* defined(__loongarch_asx_sx_conv). */
3885#endif /* defined(__loongarch_asx). */3998#endif /* defined(__loongarch_asx). */
3886#endif /* _LOONGSON_ASXINTRIN_H. */3999#endif /* _LOONGSON_ASXINTRIN_H. */
lib/include/llvm_libc_wrappers/assert.h+3-5
...@@ -19,13 +19,11 @@...@@ -19,13 +19,11 @@
1919
20#if defined(__HIP__) || defined(__CUDA__)20#if defined(__HIP__) || defined(__CUDA__)
21#define __LIBC_ATTRS __attribute__((device))21#define __LIBC_ATTRS __attribute__((device))
22#else
23#define __LIBC_ATTRS
22#endif24#endif
2325
24#pragma omp begin declare target26// TODO: Define these for CUDA / HIP.
25
26#include <llvm-libc-decls/assert.h>
27
28#pragma omp end declare target
2927
30#undef __LIBC_ATTRS28#undef __LIBC_ATTRS
3129
lib/include/llvm_libc_wrappers/ctype.h+3-115
...@@ -13,128 +13,16 @@...@@ -13,128 +13,16 @@
13#error "This file is for GPU offloading compilation only"13#error "This file is for GPU offloading compilation only"
14#endif14#endif
1515
16// The GNU headers like to define 'toupper' and 'tolower' redundantly. This is
17// necessary to prevent it from doing that and remapping our implementation.
18#if (defined(__NVPTX__) || defined(__AMDGPU__)) && defined(__GLIBC__)
19#pragma push_macro("__USE_EXTERN_INLINES")
20#undef __USE_EXTERN_INLINES
21#endif
22
23#include_next <ctype.h>16#include_next <ctype.h>
2417
25#if (defined(__NVPTX__) || defined(__AMDGPU__)) && defined(__GLIBC__)
26#pragma pop_macro("__USE_EXTERN_INLINES")
27#endif
28
29#if __has_include(<llvm-libc-decls/ctype.h>)
30
31#if defined(__HIP__) || defined(__CUDA__)18#if defined(__HIP__) || defined(__CUDA__)
32#define __LIBC_ATTRS __attribute__((device))19#define __LIBC_ATTRS __attribute__((device))
20#else
21#define __LIBC_ATTRS
33#endif22#endif
3423
35// The GNU headers like to provide these as macros, we need to undefine them so24// TODO: Define these for CUDA / HIP.
36// they do not conflict with the following definitions for the GPU.
37
38#pragma push_macro("isalnum")
39#pragma push_macro("isalpha")
40#pragma push_macro("isascii")
41#pragma push_macro("isblank")
42#pragma push_macro("iscntrl")
43#pragma push_macro("isdigit")
44#pragma push_macro("isgraph")
45#pragma push_macro("islower")
46#pragma push_macro("isprint")
47#pragma push_macro("ispunct")
48#pragma push_macro("isspace")
49#pragma push_macro("isupper")
50#pragma push_macro("isxdigit")
51#pragma push_macro("toascii")
52#pragma push_macro("tolower")
53#pragma push_macro("toupper")
54#pragma push_macro("isalnum_l")
55#pragma push_macro("isalpha_l")
56#pragma push_macro("isascii_l")
57#pragma push_macro("isblank_l")
58#pragma push_macro("iscntrl_l")
59#pragma push_macro("isdigit_l")
60#pragma push_macro("isgraph_l")
61#pragma push_macro("islower_l")
62#pragma push_macro("isprint_l")
63#pragma push_macro("ispunct_l")
64#pragma push_macro("isspace_l")
65#pragma push_macro("isupper_l")
66#pragma push_macro("isxdigit_l")
67
68#undef isalnum
69#undef isalpha
70#undef isascii
71#undef iscntrl
72#undef isdigit
73#undef islower
74#undef isgraph
75#undef isprint
76#undef ispunct
77#undef isspace
78#undef isupper
79#undef isblank
80#undef isxdigit
81#undef toascii
82#undef tolower
83#undef toupper
84#undef isalnum_l
85#undef isalpha_l
86#undef iscntrl_l
87#undef isdigit_l
88#undef islower_l
89#undef isgraph_l
90#undef isprint_l
91#undef ispunct_l
92#undef isspace_l
93#undef isupper_l
94#undef isblank_l
95#undef isxdigit_l
96
97#pragma omp begin declare target
98
99#include <llvm-libc-decls/ctype.h>
100
101#pragma omp end declare target
102
103// Restore the original macros when compiling on the host.
104#if !defined(__NVPTX__) && !defined(__AMDGPU__)
105#pragma pop_macro("isalnum")
106#pragma pop_macro("isalpha")
107#pragma pop_macro("isascii")
108#pragma pop_macro("isblank")
109#pragma pop_macro("iscntrl")
110#pragma pop_macro("isdigit")
111#pragma pop_macro("isgraph")
112#pragma pop_macro("islower")
113#pragma pop_macro("isprint")
114#pragma pop_macro("ispunct")
115#pragma pop_macro("isspace")
116#pragma pop_macro("isupper")
117#pragma pop_macro("isxdigit")
118#pragma pop_macro("toascii")
119#pragma pop_macro("tolower")
120#pragma pop_macro("toupper")
121#pragma pop_macro("isalnum_l")
122#pragma pop_macro("isalpha_l")
123#pragma pop_macro("isascii_l")
124#pragma pop_macro("isblank_l")
125#pragma pop_macro("iscntrl_l")
126#pragma pop_macro("isdigit_l")
127#pragma pop_macro("isgraph_l")
128#pragma pop_macro("islower_l")
129#pragma pop_macro("isprint_l")
130#pragma pop_macro("ispunct_l")
131#pragma pop_macro("isspace_l")
132#pragma pop_macro("isupper_l")
133#pragma pop_macro("isxdigit_l")
134#endif
13525
136#undef __LIBC_ATTRS26#undef __LIBC_ATTRS
13727
138#endif
139
140#endif // __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__28#endif // __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
lib/include/llvm_libc_wrappers/inttypes.h+3-5
...@@ -19,13 +19,11 @@...@@ -19,13 +19,11 @@
1919
20#if defined(__HIP__) || defined(__CUDA__)20#if defined(__HIP__) || defined(__CUDA__)
21#define __LIBC_ATTRS __attribute__((device))21#define __LIBC_ATTRS __attribute__((device))
22#else
23#define __LIBC_ATTRS
22#endif24#endif
2325
24#pragma omp begin declare target26// TODO: Define these for CUDA / HIP.
25
26#include <llvm-libc-decls/inttypes.h>
27
28#pragma omp end declare target
2927
30#undef __LIBC_ATTRS28#undef __LIBC_ATTRS
3129
lib/include/llvm_libc_wrappers/stdio.h+10-38
...@@ -6,45 +6,19 @@...@@ -6,45 +6,19 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
10#define __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
11
9#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)12#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
10#error "This file is for GPU offloading compilation only"13#error "This file is for GPU offloading compilation only"
11#endif14#endif
1215
13#include_next <stdio.h>16#include_next <stdio.h>
1417
15// In some old versions of glibc, other standard headers sometimes define
16// special macros (e.g., __need_FILE) before including stdio.h to cause stdio.h
17// to produce special definitions. Future includes of stdio.h when those
18// special macros are undefined are expected to produce the normal definitions
19// from stdio.h.
20//
21// We do not apply our include guard (__CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__)
22// unconditionally to the above include_next. Otherwise, after an occurrence of
23// the first glibc stdio.h use case described above, the include_next would be
24// skipped for remaining includes of stdio.h, leaving required symbols
25// undefined.
26//
27// We make the following assumptions to handle all use cases:
28//
29// 1. If the above include_next produces special glibc definitions, then (a) it
30// does not produce the normal definitions that we must intercept below, (b)
31// the current file was included from a glibc header that already defined
32// __GLIBC__ (usually by including glibc's <features.h>), and (c) the above
33// include_next does not define _STDIO_H. In that case, we skip the rest of
34// the current file and don't guard against future includes.
35// 2. If the above include_next produces the normal stdio.h definitions, then
36// either (a) __GLIBC__ is not defined because C headers are from some other
37// libc implementation or (b) the above include_next defines _STDIO_H to
38// prevent the above include_next from having any effect in the future.
39#if !defined(__GLIBC__) || defined(_STDIO_H)
40
41#ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
42#define __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
43
44#if __has_include(<llvm-libc-decls/stdio.h>)
45
46#if defined(__HIP__) || defined(__CUDA__)18#if defined(__HIP__) || defined(__CUDA__)
47#define __LIBC_ATTRS __attribute__((device))19#define __LIBC_ATTRS __attribute__((device))
20#else
21#define __LIBC_ATTRS
48#endif22#endif
4923
50// Some headers provide these as macros. Temporarily undefine them so they do24// Some headers provide these as macros. Temporarily undefine them so they do
...@@ -60,21 +34,19 @@...@@ -60,21 +34,19 @@
6034
61#pragma omp begin declare target35#pragma omp begin declare target
6236
63#include <llvm-libc-decls/stdio.h>37__LIBC_ATTRS extern FILE *stderr;
38__LIBC_ATTRS extern FILE *stdin;
39__LIBC_ATTRS extern FILE *stdout;
6440
65#pragma omp end declare target41#pragma omp end declare target
6642
67#undef __LIBC_ATTRS
68
69// Restore the original macros when compiling on the host.43// Restore the original macros when compiling on the host.
70#if !defined(__NVPTX__) && !defined(__AMDGPU__)44#if !defined(__NVPTX__) && !defined(__AMDGPU__)
71#pragma pop_macro("stdout")
72#pragma pop_macro("stderr")45#pragma pop_macro("stderr")
73#pragma pop_macro("stdin")46#pragma pop_macro("stdin")
47#pragma pop_macro("stdout")
74#endif48#endif
7549
76#endif50#undef __LIBC_ATTRS
7751
78#endif // __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__52#endif // __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
79
80#endif
lib/include/llvm_libc_wrappers/stdlib.h+3-24
...@@ -15,39 +15,18 @@...@@ -15,39 +15,18 @@
1515
16#include_next <stdlib.h>16#include_next <stdlib.h>
1717
18#if __has_include(<llvm-libc-decls/stdlib.h>)
19
20#if defined(__HIP__) || defined(__CUDA__)18#if defined(__HIP__) || defined(__CUDA__)
21#define __LIBC_ATTRS __attribute__((device))19#define __LIBC_ATTRS __attribute__((device))
20#else
21#define __LIBC_ATTRS
22#endif22#endif
2323
24#pragma omp begin declare target24#pragma omp begin declare target
2525
26// The LLVM C library uses these named types so we forward declare them.26// TODO: Define these for CUDA / HIP.
27typedef void (*__atexithandler_t)(void);
28typedef int (*__search_compare_t)(const void *, const void *);
29typedef int (*__qsortcompare_t)(const void *, const void *);
30typedef int (*__qsortrcompare_t)(const void *, const void *, void *);
31
32// Enforce ABI compatibility with the structs used by the LLVM C library.
33_Static_assert(__builtin_offsetof(div_t, quot) == 0, "ABI mismatch!");
34_Static_assert(__builtin_offsetof(ldiv_t, quot) == 0, "ABI mismatch!");
35_Static_assert(__builtin_offsetof(lldiv_t, quot) == 0, "ABI mismatch!");
36
37#if defined(__GLIBC__) && __cplusplus >= 201703L
38#define at_quick_exit atexit
39#endif
40
41#include <llvm-libc-decls/stdlib.h>
42
43#if defined(__GLIBC__) && __cplusplus >= 201703L
44#undef at_quick_exit
45#endif
4627
47#pragma omp end declare target28#pragma omp end declare target
4829
49#undef __LIBC_ATTRS30#undef __LIBC_ATTRS
5031
51#endif
52
53#endif // __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__32#endif // __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
lib/include/llvm_libc_wrappers/string.h+2-70
...@@ -15,82 +15,14 @@...@@ -15,82 +15,14 @@
1515
16#include_next <string.h>16#include_next <string.h>
1717
18#if __has_include(<llvm-libc-decls/string.h>)
19
20#if defined(__HIP__) || defined(__CUDA__)18#if defined(__HIP__) || defined(__CUDA__)
21#define __LIBC_ATTRS __attribute__((device))19#define __LIBC_ATTRS __attribute__((device))
22#endif
23
24#pragma omp begin declare target
25
26// The GNU headers provide C++ standard compliant headers when in C++ mode and
27// the LLVM libc does not. We need to manually provide the definitions using the
28// same prototypes.
29#if defined(__cplusplus) && defined(__GLIBC__) && \
30 defined(__CORRECT_ISO_CPP_STRING_H_PROTO)
31
32#ifndef __LIBC_ATTRS
33#define __LIBC_ATTRS
34#endif
35
36extern "C" {
37void *memccpy(void *__restrict, const void *__restrict, int,
38 size_t) __LIBC_ATTRS;
39int memcmp(const void *, const void *, size_t) __LIBC_ATTRS;
40void *memcpy(void *__restrict, const void *__restrict, size_t) __LIBC_ATTRS;
41void *memmem(const void *, size_t, const void *, size_t) __LIBC_ATTRS;
42void *memmove(void *, const void *, size_t) __LIBC_ATTRS;
43void *mempcpy(void *__restrict, const void *__restrict, size_t) __LIBC_ATTRS;
44void *memset(void *, int, size_t) __LIBC_ATTRS;
45char *stpcpy(char *__restrict, const char *__restrict) __LIBC_ATTRS;
46char *stpncpy(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
47char *strcat(char *__restrict, const char *__restrict) __LIBC_ATTRS;
48int strcmp(const char *, const char *) __LIBC_ATTRS;
49int strcoll(const char *, const char *) __LIBC_ATTRS;
50char *strcpy(char *__restrict, const char *__restrict) __LIBC_ATTRS;
51size_t strcspn(const char *, const char *) __LIBC_ATTRS;
52char *strdup(const char *) __LIBC_ATTRS;
53size_t strlen(const char *) __LIBC_ATTRS;
54char *strncat(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
55int strncmp(const char *, const char *, size_t) __LIBC_ATTRS;
56char *strncpy(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
57char *strndup(const char *, size_t) __LIBC_ATTRS;
58size_t strnlen(const char *, size_t) __LIBC_ATTRS;
59size_t strspn(const char *, const char *) __LIBC_ATTRS;
60char *strtok(char *__restrict, const char *__restrict) __LIBC_ATTRS;
61char *strtok_r(char *__restrict, const char *__restrict,
62 char **__restrict) __LIBC_ATTRS;
63size_t strxfrm(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
64}
65
66extern "C++" {
67char *strstr(char *, const char *) noexcept __LIBC_ATTRS;
68const char *strstr(const char *, const char *) noexcept __LIBC_ATTRS;
69char *strpbrk(char *, const char *) noexcept __LIBC_ATTRS;
70const char *strpbrk(const char *, const char *) noexcept __LIBC_ATTRS;
71char *strrchr(char *, int) noexcept __LIBC_ATTRS;
72const char *strrchr(const char *, int) noexcept __LIBC_ATTRS;
73char *strchr(char *, int) noexcept __LIBC_ATTRS;
74const char *strchr(const char *, int) noexcept __LIBC_ATTRS;
75char *strchrnul(char *, int) noexcept __LIBC_ATTRS;
76const char *strchrnul(const char *, int) noexcept __LIBC_ATTRS;
77char *strcasestr(char *, const char *) noexcept __LIBC_ATTRS;
78const char *strcasestr(const char *, const char *) noexcept __LIBC_ATTRS;
79void *memrchr(void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
80const void *memrchr(const void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
81void *memchr(void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
82const void *memchr(const void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
83}
84
85#else20#else
86#include <llvm-libc-decls/string.h>21#define __LIBC_ATTRS
87
88#endif22#endif
8923
90#pragma omp end declare target24// TODO: Define these for CUDA / HIP.
9125
92#undef __LIBC_ATTRS26#undef __LIBC_ATTRS
9327
94#endif
95
96#endif // __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__28#endif // __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
lib/include/llvm_libc_wrappers/time.h+4-10
...@@ -15,20 +15,14 @@...@@ -15,20 +15,14 @@
1515
16#include_next <time.h>16#include_next <time.h>
1717
18#if __has_include(<llvm-libc-decls/time.h>)
19
20#if defined(__HIP__) || defined(__CUDA__)18#if defined(__HIP__) || defined(__CUDA__)
21#define __LIBC_ATTRS __attribute__((device))19#define __LIBC_ATTRS __attribute__((device))
20#else
21#define __LIBC_ATTRS
22#endif22#endif
2323
24#pragma omp begin declare target24// TODO: Define these for CUDA / HIP.
25
26_Static_assert(sizeof(clock_t) == sizeof(long), "ABI mismatch!");
27
28#include <llvm-libc-decls/time.h>
2925
30#pragma omp end declare target26#undef __LIBC_ATTRS
31
32#endif
3327
34#endif // __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__28#endif // __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__
lib/include/mmintrin.h+188-257
...@@ -39,27 +39,21 @@ typedef short __v8hi __attribute__((__vector_size__(16)));...@@ -39,27 +39,21 @@ typedef short __v8hi __attribute__((__vector_size__(16)));
39typedef char __v16qi __attribute__((__vector_size__(16)));39typedef char __v16qi __attribute__((__vector_size__(16)));
4040
41/* Define the default attributes for the functions in this file. */41/* Define the default attributes for the functions in this file. */
42#if defined(__EVEX512__) && !defined(__AVX10_1_512__)42#if defined(__cplusplus) && (__cplusplus >= 201103L)
43#define __DEFAULT_FN_ATTRS_SSE2 \43#define __DEFAULT_FN_ATTRS_SSE2 \
44 __attribute__((__always_inline__, __nodebug__, \44 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
45 __target__("sse2,no-evex512"), __min_vector_width__(128)))45 __min_vector_width__(128))) constexpr
46#else46#else
47#define __DEFAULT_FN_ATTRS_SSE2 \47#define __DEFAULT_FN_ATTRS_SSE2 \
48 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \48 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
49 __min_vector_width__(128)))49 __min_vector_width__(128)))
50#endif50#endif
5151
52#if defined(__cplusplus) && (__cplusplus >= 201103L)
53#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2 constexpr
54#else
55#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2
56#endif
57
58#define __trunc64(x) \52#define __trunc64(x) \
59 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)53 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
60#define __anyext128(x) \54#define __zext128(x) \
61 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \55 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
62 1, -1, -1)56 1, 2, 3)
6357
64/// Clears the MMX state by setting the state of the x87 stack registers58/// Clears the MMX state by setting the state of the x87 stack registers
65/// to empty.59/// to empty.
...@@ -68,9 +62,9 @@ typedef char __v16qi __attribute__((__vector_size__(16)));...@@ -68,9 +62,9 @@ typedef char __v16qi __attribute__((__vector_size__(16)));
68///62///
69/// This intrinsic corresponds to the <c> EMMS </c> instruction.63/// This intrinsic corresponds to the <c> EMMS </c> instruction.
70///64///
71static __inline__ void __attribute__((__always_inline__, __nodebug__,65static __inline__ void
72 __target__("mmx,no-evex512")))66 __attribute__((__always_inline__, __nodebug__, __target__("mmx")))
73_mm_empty(void) {67 _mm_empty(void) {
74 __builtin_ia32_emms();68 __builtin_ia32_emms();
75}69}
7670
...@@ -85,10 +79,8 @@ _mm_empty(void) {...@@ -85,10 +79,8 @@ _mm_empty(void) {
85/// A 32-bit integer value.79/// A 32-bit integer value.
86/// \returns A 64-bit integer vector. The lower 32 bits contain the value of the80/// \returns A 64-bit integer vector. The lower 32 bits contain the value of the
87/// parameter. The upper 32 bits are set to 0.81/// parameter. The upper 32 bits are set to 0.
88static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE282static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cvtsi32_si64(int __i) {
89_mm_cvtsi32_si64(int __i)83 return __extension__(__m64)(__v2si){__i, 0};
90{
91 return __extension__ (__m64)(__v2si){__i, 0};
92}84}
9385
94/// Returns the lower 32 bits of a 64-bit integer vector as a 32-bit86/// Returns the lower 32 bits of a 64-bit integer vector as a 32-bit
...@@ -102,10 +94,8 @@ _mm_cvtsi32_si64(int __i)...@@ -102,10 +94,8 @@ _mm_cvtsi32_si64(int __i)
102/// A 64-bit integer vector.94/// A 64-bit integer vector.
103/// \returns A 32-bit signed integer value containing the lower 32 bits of the95/// \returns A 32-bit signed integer value containing the lower 32 bits of the
104/// parameter.96/// parameter.
105static __inline__ int __DEFAULT_FN_ATTRS_SSE297static __inline__ int __DEFAULT_FN_ATTRS_SSE2 _mm_cvtsi64_si32(__m64 __m) {
106_mm_cvtsi64_si32(__m64 __m)98 return ((__v2si)__m)[0];
107{
108 return ((__v2si)__m)[0];
109}99}
110100
111/// Casts a 64-bit signed integer value into a 64-bit integer vector.101/// Casts a 64-bit signed integer value into a 64-bit integer vector.
...@@ -118,10 +108,8 @@ _mm_cvtsi64_si32(__m64 __m)...@@ -118,10 +108,8 @@ _mm_cvtsi64_si32(__m64 __m)
118/// A 64-bit signed integer.108/// A 64-bit signed integer.
119/// \returns A 64-bit integer vector containing the same bitwise pattern as the109/// \returns A 64-bit integer vector containing the same bitwise pattern as the
120/// parameter.110/// parameter.
121static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2111static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cvtsi64_m64(long long __i) {
122_mm_cvtsi64_m64(long long __i)112 return __extension__(__m64)(__v1di){__i};
123{
124 return (__m64)__i;
125}113}
126114
127/// Casts a 64-bit integer vector into a 64-bit signed integer value.115/// Casts a 64-bit integer vector into a 64-bit signed integer value.
...@@ -134,10 +122,8 @@ _mm_cvtsi64_m64(long long __i)...@@ -134,10 +122,8 @@ _mm_cvtsi64_m64(long long __i)
134/// A 64-bit integer vector.122/// A 64-bit integer vector.
135/// \returns A 64-bit signed integer containing the same bitwise pattern as the123/// \returns A 64-bit signed integer containing the same bitwise pattern as the
136/// parameter.124/// parameter.
137static __inline__ long long __DEFAULT_FN_ATTRS_SSE2125static __inline__ long long __DEFAULT_FN_ATTRS_SSE2 _mm_cvtm64_si64(__m64 __m) {
138_mm_cvtm64_si64(__m64 __m)126 return ((__v1di)__m)[0];
139{
140 return (long long)__m;
141}127}
142128
143/// Converts, with saturation, 16-bit signed integers from both 64-bit integer129/// Converts, with saturation, 16-bit signed integers from both 64-bit integer
...@@ -159,11 +145,10 @@ _mm_cvtm64_si64(__m64 __m)...@@ -159,11 +145,10 @@ _mm_cvtm64_si64(__m64 __m)
159/// written to the upper 32 bits of the result.145/// written to the upper 32 bits of the result.
160/// \returns A 64-bit integer vector of [8 x i8] containing the converted146/// \returns A 64-bit integer vector of [8 x i8] containing the converted
161/// values.147/// values.
162static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2148static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_packs_pi16(__m64 __m1,
163_mm_packs_pi16(__m64 __m1, __m64 __m2)149 __m64 __m2) {
164{150 return __trunc64(__builtin_ia32_packsswb128(
165 return __trunc64(__builtin_ia32_packsswb128(151 (__v8hi)__builtin_shufflevector(__m1, __m2, 0, 1), (__v8hi){}));
166 (__v8hi)__builtin_shufflevector(__m1, __m2, 0, 1), (__v8hi){}));
167}152}
168153
169/// Converts, with saturation, 32-bit signed integers from both 64-bit integer154/// Converts, with saturation, 32-bit signed integers from both 64-bit integer
...@@ -185,11 +170,10 @@ _mm_packs_pi16(__m64 __m1, __m64 __m2)...@@ -185,11 +170,10 @@ _mm_packs_pi16(__m64 __m1, __m64 __m2)
185/// written to the upper 32 bits of the result.170/// written to the upper 32 bits of the result.
186/// \returns A 64-bit integer vector of [4 x i16] containing the converted171/// \returns A 64-bit integer vector of [4 x i16] containing the converted
187/// values.172/// values.
188static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2173static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_packs_pi32(__m64 __m1,
189_mm_packs_pi32(__m64 __m1, __m64 __m2)174 __m64 __m2) {
190{175 return __trunc64(__builtin_ia32_packssdw128(
191 return __trunc64(__builtin_ia32_packssdw128(176 (__v4si)__builtin_shufflevector(__m1, __m2, 0, 1), (__v4si){}));
192 (__v4si)__builtin_shufflevector(__m1, __m2, 0, 1), (__v4si){}));
193}177}
194178
195/// Converts, with saturation, 16-bit signed integers from both 64-bit integer179/// Converts, with saturation, 16-bit signed integers from both 64-bit integer
...@@ -211,11 +195,10 @@ _mm_packs_pi32(__m64 __m1, __m64 __m2)...@@ -211,11 +195,10 @@ _mm_packs_pi32(__m64 __m1, __m64 __m2)
211/// written to the upper 32 bits of the result.195/// written to the upper 32 bits of the result.
212/// \returns A 64-bit integer vector of [8 x i8] containing the converted196/// \returns A 64-bit integer vector of [8 x i8] containing the converted
213/// values.197/// values.
214static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2198static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_packs_pu16(__m64 __m1,
215_mm_packs_pu16(__m64 __m1, __m64 __m2)199 __m64 __m2) {
216{200 return __trunc64(__builtin_ia32_packuswb128(
217 return __trunc64(__builtin_ia32_packuswb128(201 (__v8hi)__builtin_shufflevector(__m1, __m2, 0, 1), (__v8hi){}));
218 (__v8hi)__builtin_shufflevector(__m1, __m2, 0, 1), (__v8hi){}));
219}202}
220203
221/// Unpacks the upper 32 bits from two 64-bit integer vectors of [8 x i8]204/// Unpacks the upper 32 bits from two 64-bit integer vectors of [8 x i8]
...@@ -239,11 +222,10 @@ _mm_packs_pu16(__m64 __m1, __m64 __m2)...@@ -239,11 +222,10 @@ _mm_packs_pu16(__m64 __m1, __m64 __m2)
239/// Bits [63:56] are written to bits [63:56] of the result.222/// Bits [63:56] are written to bits [63:56] of the result.
240/// \returns A 64-bit integer vector of [8 x i8] containing the interleaved223/// \returns A 64-bit integer vector of [8 x i8] containing the interleaved
241/// values.224/// values.
242static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2225static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_unpackhi_pi8(__m64 __m1,
243_mm_unpackhi_pi8(__m64 __m1, __m64 __m2)226 __m64 __m2) {
244{227 return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2, 4, 12, 5,
245 return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2,228 13, 6, 14, 7, 15);
246 4, 12, 5, 13, 6, 14, 7, 15);
247}229}
248230
249/// Unpacks the upper 32 bits from two 64-bit integer vectors of231/// Unpacks the upper 32 bits from two 64-bit integer vectors of
...@@ -263,11 +245,9 @@ _mm_unpackhi_pi8(__m64 __m1, __m64 __m2)...@@ -263,11 +245,9 @@ _mm_unpackhi_pi8(__m64 __m1, __m64 __m2)
263/// Bits [63:48] are written to bits [63:48] of the result.245/// Bits [63:48] are written to bits [63:48] of the result.
264/// \returns A 64-bit integer vector of [4 x i16] containing the interleaved246/// \returns A 64-bit integer vector of [4 x i16] containing the interleaved
265/// values.247/// values.
266static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2248static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_unpackhi_pi16(__m64 __m1,
267_mm_unpackhi_pi16(__m64 __m1, __m64 __m2)249 __m64 __m2) {
268{250 return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2, 2, 6, 3, 7);
269 return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2,
270 2, 6, 3, 7);
271}251}
272252
273/// Unpacks the upper 32 bits from two 64-bit integer vectors of253/// Unpacks the upper 32 bits from two 64-bit integer vectors of
...@@ -285,10 +265,9 @@ _mm_unpackhi_pi16(__m64 __m1, __m64 __m2)...@@ -285,10 +265,9 @@ _mm_unpackhi_pi16(__m64 __m1, __m64 __m2)
285/// the upper 32 bits of the result.265/// the upper 32 bits of the result.
286/// \returns A 64-bit integer vector of [2 x i32] containing the interleaved266/// \returns A 64-bit integer vector of [2 x i32] containing the interleaved
287/// values.267/// values.
288static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2268static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_unpackhi_pi32(__m64 __m1,
289_mm_unpackhi_pi32(__m64 __m1, __m64 __m2)269 __m64 __m2) {
290{270 return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 1, 3);
291 return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 1, 3);
292}271}
293272
294/// Unpacks the lower 32 bits from two 64-bit integer vectors of [8 x i8]273/// Unpacks the lower 32 bits from two 64-bit integer vectors of [8 x i8]
...@@ -312,11 +291,10 @@ _mm_unpackhi_pi32(__m64 __m1, __m64 __m2)...@@ -312,11 +291,10 @@ _mm_unpackhi_pi32(__m64 __m1, __m64 __m2)
312/// Bits [31:24] are written to bits [63:56] of the result.291/// Bits [31:24] are written to bits [63:56] of the result.
313/// \returns A 64-bit integer vector of [8 x i8] containing the interleaved292/// \returns A 64-bit integer vector of [8 x i8] containing the interleaved
314/// values.293/// values.
315static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2294static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_unpacklo_pi8(__m64 __m1,
316_mm_unpacklo_pi8(__m64 __m1, __m64 __m2)295 __m64 __m2) {
317{296 return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2, 0, 8, 1, 9,
318 return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2,297 2, 10, 3, 11);
319 0, 8, 1, 9, 2, 10, 3, 11);
320}298}
321299
322/// Unpacks the lower 32 bits from two 64-bit integer vectors of300/// Unpacks the lower 32 bits from two 64-bit integer vectors of
...@@ -336,11 +314,9 @@ _mm_unpacklo_pi8(__m64 __m1, __m64 __m2)...@@ -336,11 +314,9 @@ _mm_unpacklo_pi8(__m64 __m1, __m64 __m2)
336/// Bits [31:16] are written to bits [63:48] of the result.314/// Bits [31:16] are written to bits [63:48] of the result.
337/// \returns A 64-bit integer vector of [4 x i16] containing the interleaved315/// \returns A 64-bit integer vector of [4 x i16] containing the interleaved
338/// values.316/// values.
339static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2317static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_unpacklo_pi16(__m64 __m1,
340_mm_unpacklo_pi16(__m64 __m1, __m64 __m2)318 __m64 __m2) {
341{319 return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2, 0, 4, 1, 5);
342 return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2,
343 0, 4, 1, 5);
344}320}
345321
346/// Unpacks the lower 32 bits from two 64-bit integer vectors of322/// Unpacks the lower 32 bits from two 64-bit integer vectors of
...@@ -358,10 +334,9 @@ _mm_unpacklo_pi16(__m64 __m1, __m64 __m2)...@@ -358,10 +334,9 @@ _mm_unpacklo_pi16(__m64 __m1, __m64 __m2)
358/// the upper 32 bits of the result.334/// the upper 32 bits of the result.
359/// \returns A 64-bit integer vector of [2 x i32] containing the interleaved335/// \returns A 64-bit integer vector of [2 x i32] containing the interleaved
360/// values.336/// values.
361static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2337static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_unpacklo_pi32(__m64 __m1,
362_mm_unpacklo_pi32(__m64 __m1, __m64 __m2)338 __m64 __m2) {
363{339 return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 0, 2);
364 return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 0, 2);
365}340}
366341
367/// Adds each 8-bit integer element of the first 64-bit integer vector342/// Adds each 8-bit integer element of the first 64-bit integer vector
...@@ -379,10 +354,9 @@ _mm_unpacklo_pi32(__m64 __m1, __m64 __m2)...@@ -379,10 +354,9 @@ _mm_unpacklo_pi32(__m64 __m1, __m64 __m2)
379/// A 64-bit integer vector of [8 x i8].354/// A 64-bit integer vector of [8 x i8].
380/// \returns A 64-bit integer vector of [8 x i8] containing the sums of both355/// \returns A 64-bit integer vector of [8 x i8] containing the sums of both
381/// parameters.356/// parameters.
382static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2357static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_add_pi8(__m64 __m1,
383_mm_add_pi8(__m64 __m1, __m64 __m2)358 __m64 __m2) {
384{359 return (__m64)(((__v8qu)__m1) + ((__v8qu)__m2));
385 return (__m64)(((__v8qu)__m1) + ((__v8qu)__m2));
386}360}
387361
388/// Adds each 16-bit integer element of the first 64-bit integer vector362/// Adds each 16-bit integer element of the first 64-bit integer vector
...@@ -400,10 +374,9 @@ _mm_add_pi8(__m64 __m1, __m64 __m2)...@@ -400,10 +374,9 @@ _mm_add_pi8(__m64 __m1, __m64 __m2)
400/// A 64-bit integer vector of [4 x i16].374/// A 64-bit integer vector of [4 x i16].
401/// \returns A 64-bit integer vector of [4 x i16] containing the sums of both375/// \returns A 64-bit integer vector of [4 x i16] containing the sums of both
402/// parameters.376/// parameters.
403static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2377static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_add_pi16(__m64 __m1,
404_mm_add_pi16(__m64 __m1, __m64 __m2)378 __m64 __m2) {
405{379 return (__m64)(((__v4hu)__m1) + ((__v4hu)__m2));
406 return (__m64)(((__v4hu)__m1) + ((__v4hu)__m2));
407}380}
408381
409/// Adds each 32-bit integer element of the first 64-bit integer vector382/// Adds each 32-bit integer element of the first 64-bit integer vector
...@@ -421,10 +394,9 @@ _mm_add_pi16(__m64 __m1, __m64 __m2)...@@ -421,10 +394,9 @@ _mm_add_pi16(__m64 __m1, __m64 __m2)
421/// A 64-bit integer vector of [2 x i32].394/// A 64-bit integer vector of [2 x i32].
422/// \returns A 64-bit integer vector of [2 x i32] containing the sums of both395/// \returns A 64-bit integer vector of [2 x i32] containing the sums of both
423/// parameters.396/// parameters.
424static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2397static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_add_pi32(__m64 __m1,
425_mm_add_pi32(__m64 __m1, __m64 __m2)398 __m64 __m2) {
426{399 return (__m64)(((__v2su)__m1) + ((__v2su)__m2));
427 return (__m64)(((__v2su)__m1) + ((__v2su)__m2));
428}400}
429401
430/// Adds, with saturation, each 8-bit signed integer element of the first402/// Adds, with saturation, each 8-bit signed integer element of the first
...@@ -445,10 +417,9 @@ _mm_add_pi32(__m64 __m1, __m64 __m2)...@@ -445,10 +417,9 @@ _mm_add_pi32(__m64 __m1, __m64 __m2)
445/// A 64-bit integer vector of [8 x i8].417/// A 64-bit integer vector of [8 x i8].
446/// \returns A 64-bit integer vector of [8 x i8] containing the saturated sums418/// \returns A 64-bit integer vector of [8 x i8] containing the saturated sums
447/// of both parameters.419/// of both parameters.
448static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2420static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_adds_pi8(__m64 __m1,
449_mm_adds_pi8(__m64 __m1, __m64 __m2)421 __m64 __m2) {
450{422 return (__m64)__builtin_elementwise_add_sat((__v8qs)__m1, (__v8qs)__m2);
451 return (__m64)__builtin_elementwise_add_sat((__v8qs)__m1, (__v8qs)__m2);
452}423}
453424
454/// Adds, with saturation, each 16-bit signed integer element of the first425/// Adds, with saturation, each 16-bit signed integer element of the first
...@@ -469,10 +440,9 @@ _mm_adds_pi8(__m64 __m1, __m64 __m2)...@@ -469,10 +440,9 @@ _mm_adds_pi8(__m64 __m1, __m64 __m2)
469/// A 64-bit integer vector of [4 x i16].440/// A 64-bit integer vector of [4 x i16].
470/// \returns A 64-bit integer vector of [4 x i16] containing the saturated sums441/// \returns A 64-bit integer vector of [4 x i16] containing the saturated sums
471/// of both parameters.442/// of both parameters.
472static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2443static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_adds_pi16(__m64 __m1,
473_mm_adds_pi16(__m64 __m1, __m64 __m2)444 __m64 __m2) {
474{445 return (__m64)__builtin_elementwise_add_sat((__v4hi)__m1, (__v4hi)__m2);
475 return (__m64)__builtin_elementwise_add_sat((__v4hi)__m1, (__v4hi)__m2);
476}446}
477447
478/// Adds, with saturation, each 8-bit unsigned integer element of the first448/// Adds, with saturation, each 8-bit unsigned integer element of the first
...@@ -492,10 +462,9 @@ _mm_adds_pi16(__m64 __m1, __m64 __m2)...@@ -492,10 +462,9 @@ _mm_adds_pi16(__m64 __m1, __m64 __m2)
492/// A 64-bit integer vector of [8 x i8].462/// A 64-bit integer vector of [8 x i8].
493/// \returns A 64-bit integer vector of [8 x i8] containing the saturated463/// \returns A 64-bit integer vector of [8 x i8] containing the saturated
494/// unsigned sums of both parameters.464/// unsigned sums of both parameters.
495static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2465static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_adds_pu8(__m64 __m1,
496_mm_adds_pu8(__m64 __m1, __m64 __m2)466 __m64 __m2) {
497{467 return (__m64)__builtin_elementwise_add_sat((__v8qu)__m1, (__v8qu)__m2);
498 return (__m64)__builtin_elementwise_add_sat((__v8qu)__m1, (__v8qu)__m2);
499}468}
500469
501/// Adds, with saturation, each 16-bit unsigned integer element of the first470/// Adds, with saturation, each 16-bit unsigned integer element of the first
...@@ -515,10 +484,9 @@ _mm_adds_pu8(__m64 __m1, __m64 __m2)...@@ -515,10 +484,9 @@ _mm_adds_pu8(__m64 __m1, __m64 __m2)
515/// A 64-bit integer vector of [4 x i16].484/// A 64-bit integer vector of [4 x i16].
516/// \returns A 64-bit integer vector of [4 x i16] containing the saturated485/// \returns A 64-bit integer vector of [4 x i16] containing the saturated
517/// unsigned sums of both parameters.486/// unsigned sums of both parameters.
518static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2487static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_adds_pu16(__m64 __m1,
519_mm_adds_pu16(__m64 __m1, __m64 __m2)488 __m64 __m2) {
520{489 return (__m64)__builtin_elementwise_add_sat((__v4hu)__m1, (__v4hu)__m2);
521 return (__m64)__builtin_elementwise_add_sat((__v4hu)__m1, (__v4hu)__m2);
522}490}
523491
524/// Subtracts each 8-bit integer element of the second 64-bit integer492/// Subtracts each 8-bit integer element of the second 64-bit integer
...@@ -536,10 +504,9 @@ _mm_adds_pu16(__m64 __m1, __m64 __m2)...@@ -536,10 +504,9 @@ _mm_adds_pu16(__m64 __m1, __m64 __m2)
536/// A 64-bit integer vector of [8 x i8] containing the subtrahends.504/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
537/// \returns A 64-bit integer vector of [8 x i8] containing the differences of505/// \returns A 64-bit integer vector of [8 x i8] containing the differences of
538/// both parameters.506/// both parameters.
539static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2507static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sub_pi8(__m64 __m1,
540_mm_sub_pi8(__m64 __m1, __m64 __m2)508 __m64 __m2) {
541{509 return (__m64)(((__v8qu)__m1) - ((__v8qu)__m2));
542 return (__m64)(((__v8qu)__m1) - ((__v8qu)__m2));
543}510}
544511
545/// Subtracts each 16-bit integer element of the second 64-bit integer512/// Subtracts each 16-bit integer element of the second 64-bit integer
...@@ -557,10 +524,9 @@ _mm_sub_pi8(__m64 __m1, __m64 __m2)...@@ -557,10 +524,9 @@ _mm_sub_pi8(__m64 __m1, __m64 __m2)
557/// A 64-bit integer vector of [4 x i16] containing the subtrahends.524/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
558/// \returns A 64-bit integer vector of [4 x i16] containing the differences of525/// \returns A 64-bit integer vector of [4 x i16] containing the differences of
559/// both parameters.526/// both parameters.
560static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2527static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sub_pi16(__m64 __m1,
561_mm_sub_pi16(__m64 __m1, __m64 __m2)528 __m64 __m2) {
562{529 return (__m64)(((__v4hu)__m1) - ((__v4hu)__m2));
563 return (__m64)(((__v4hu)__m1) - ((__v4hu)__m2));
564}530}
565531
566/// Subtracts each 32-bit integer element of the second 64-bit integer532/// Subtracts each 32-bit integer element of the second 64-bit integer
...@@ -578,10 +544,9 @@ _mm_sub_pi16(__m64 __m1, __m64 __m2)...@@ -578,10 +544,9 @@ _mm_sub_pi16(__m64 __m1, __m64 __m2)
578/// A 64-bit integer vector of [2 x i32] containing the subtrahends.544/// A 64-bit integer vector of [2 x i32] containing the subtrahends.
579/// \returns A 64-bit integer vector of [2 x i32] containing the differences of545/// \returns A 64-bit integer vector of [2 x i32] containing the differences of
580/// both parameters.546/// both parameters.
581static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2547static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sub_pi32(__m64 __m1,
582_mm_sub_pi32(__m64 __m1, __m64 __m2)548 __m64 __m2) {
583{549 return (__m64)(((__v2su)__m1) - ((__v2su)__m2));
584 return (__m64)(((__v2su)__m1) - ((__v2su)__m2));
585}550}
586551
587/// Subtracts, with saturation, each 8-bit signed integer element of the second552/// Subtracts, with saturation, each 8-bit signed integer element of the second
...@@ -602,10 +567,9 @@ _mm_sub_pi32(__m64 __m1, __m64 __m2)...@@ -602,10 +567,9 @@ _mm_sub_pi32(__m64 __m1, __m64 __m2)
602/// A 64-bit integer vector of [8 x i8] containing the subtrahends.567/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
603/// \returns A 64-bit integer vector of [8 x i8] containing the saturated568/// \returns A 64-bit integer vector of [8 x i8] containing the saturated
604/// differences of both parameters.569/// differences of both parameters.
605static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2570static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_subs_pi8(__m64 __m1,
606_mm_subs_pi8(__m64 __m1, __m64 __m2)571 __m64 __m2) {
607{572 return (__m64)__builtin_elementwise_sub_sat((__v8qs)__m1, (__v8qs)__m2);
608 return (__m64)__builtin_elementwise_sub_sat((__v8qs)__m1, (__v8qs)__m2);
609}573}
610574
611/// Subtracts, with saturation, each 16-bit signed integer element of the575/// Subtracts, with saturation, each 16-bit signed integer element of the
...@@ -626,10 +590,9 @@ _mm_subs_pi8(__m64 __m1, __m64 __m2)...@@ -626,10 +590,9 @@ _mm_subs_pi8(__m64 __m1, __m64 __m2)
626/// A 64-bit integer vector of [4 x i16] containing the subtrahends.590/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
627/// \returns A 64-bit integer vector of [4 x i16] containing the saturated591/// \returns A 64-bit integer vector of [4 x i16] containing the saturated
628/// differences of both parameters.592/// differences of both parameters.
629static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2593static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_subs_pi16(__m64 __m1,
630_mm_subs_pi16(__m64 __m1, __m64 __m2)594 __m64 __m2) {
631{595 return (__m64)__builtin_elementwise_sub_sat((__v4hi)__m1, (__v4hi)__m2);
632 return (__m64)__builtin_elementwise_sub_sat((__v4hi)__m1, (__v4hi)__m2);
633}596}
634597
635/// Subtracts each 8-bit unsigned integer element of the second 64-bit598/// Subtracts each 8-bit unsigned integer element of the second 64-bit
...@@ -650,10 +613,9 @@ _mm_subs_pi16(__m64 __m1, __m64 __m2)...@@ -650,10 +613,9 @@ _mm_subs_pi16(__m64 __m1, __m64 __m2)
650/// A 64-bit integer vector of [8 x i8] containing the subtrahends.613/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
651/// \returns A 64-bit integer vector of [8 x i8] containing the saturated614/// \returns A 64-bit integer vector of [8 x i8] containing the saturated
652/// differences of both parameters.615/// differences of both parameters.
653static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2616static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_subs_pu8(__m64 __m1,
654_mm_subs_pu8(__m64 __m1, __m64 __m2)617 __m64 __m2) {
655{618 return (__m64)__builtin_elementwise_sub_sat((__v8qu)__m1, (__v8qu)__m2);
656 return (__m64)__builtin_elementwise_sub_sat((__v8qu)__m1, (__v8qu)__m2);
657}619}
658620
659/// Subtracts each 16-bit unsigned integer element of the second 64-bit621/// Subtracts each 16-bit unsigned integer element of the second 64-bit
...@@ -674,10 +636,9 @@ _mm_subs_pu8(__m64 __m1, __m64 __m2)...@@ -674,10 +636,9 @@ _mm_subs_pu8(__m64 __m1, __m64 __m2)
674/// A 64-bit integer vector of [4 x i16] containing the subtrahends.636/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
675/// \returns A 64-bit integer vector of [4 x i16] containing the saturated637/// \returns A 64-bit integer vector of [4 x i16] containing the saturated
676/// differences of both parameters.638/// differences of both parameters.
677static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2639static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_subs_pu16(__m64 __m1,
678_mm_subs_pu16(__m64 __m1, __m64 __m2)640 __m64 __m2) {
679{641 return (__m64)__builtin_elementwise_sub_sat((__v4hu)__m1, (__v4hu)__m2);
680 return (__m64)__builtin_elementwise_sub_sat((__v4hu)__m1, (__v4hu)__m2);
681}642}
682643
683/// Multiplies each 16-bit signed integer element of the first 64-bit644/// Multiplies each 16-bit signed integer element of the first 64-bit
...@@ -701,11 +662,10 @@ _mm_subs_pu16(__m64 __m1, __m64 __m2)...@@ -701,11 +662,10 @@ _mm_subs_pu16(__m64 __m1, __m64 __m2)
701/// A 64-bit integer vector of [4 x i16].662/// A 64-bit integer vector of [4 x i16].
702/// \returns A 64-bit integer vector of [2 x i32] containing the sums of663/// \returns A 64-bit integer vector of [2 x i32] containing the sums of
703/// products of both parameters.664/// products of both parameters.
704static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2665static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_madd_pi16(__m64 __m1,
705_mm_madd_pi16(__m64 __m1, __m64 __m2)666 __m64 __m2) {
706{667 return __trunc64(__builtin_ia32_pmaddwd128((__v8hi)__zext128(__m1),
707 return __trunc64(__builtin_ia32_pmaddwd128((__v8hi)__anyext128(__m1),668 (__v8hi)__zext128(__m2)));
708 (__v8hi)__anyext128(__m2)));
709}669}
710670
711/// Multiplies each 16-bit signed integer element of the first 64-bit671/// Multiplies each 16-bit signed integer element of the first 64-bit
...@@ -723,11 +683,10 @@ _mm_madd_pi16(__m64 __m1, __m64 __m2)...@@ -723,11 +683,10 @@ _mm_madd_pi16(__m64 __m1, __m64 __m2)
723/// A 64-bit integer vector of [4 x i16].683/// A 64-bit integer vector of [4 x i16].
724/// \returns A 64-bit integer vector of [4 x i16] containing the upper 16 bits684/// \returns A 64-bit integer vector of [4 x i16] containing the upper 16 bits
725/// of the products of both parameters.685/// of the products of both parameters.
726static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2686static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_mulhi_pi16(__m64 __m1,
727_mm_mulhi_pi16(__m64 __m1, __m64 __m2)687 __m64 __m2) {
728{688 return __trunc64(__builtin_ia32_pmulhw128((__v8hi)__zext128(__m1),
729 return __trunc64(__builtin_ia32_pmulhw128((__v8hi)__anyext128(__m1),689 (__v8hi)__zext128(__m2)));
730 (__v8hi)__anyext128(__m2)));
731}690}
732691
733/// Multiplies each 16-bit signed integer element of the first 64-bit692/// Multiplies each 16-bit signed integer element of the first 64-bit
...@@ -745,10 +704,9 @@ _mm_mulhi_pi16(__m64 __m1, __m64 __m2)...@@ -745,10 +704,9 @@ _mm_mulhi_pi16(__m64 __m1, __m64 __m2)
745/// A 64-bit integer vector of [4 x i16].704/// A 64-bit integer vector of [4 x i16].
746/// \returns A 64-bit integer vector of [4 x i16] containing the lower 16 bits705/// \returns A 64-bit integer vector of [4 x i16] containing the lower 16 bits
747/// of the products of both parameters.706/// of the products of both parameters.
748static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2707static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_mullo_pi16(__m64 __m1,
749_mm_mullo_pi16(__m64 __m1, __m64 __m2)708 __m64 __m2) {
750{709 return (__m64)(((__v4hu)__m1) * ((__v4hu)__m2));
751 return (__m64)(((__v4hu)__m1) * ((__v4hu)__m2));
752}710}
753711
754/// Left-shifts each 16-bit signed integer element of the first712/// Left-shifts each 16-bit signed integer element of the first
...@@ -771,8 +729,8 @@ _mm_mullo_pi16(__m64 __m1, __m64 __m2)...@@ -771,8 +729,8 @@ _mm_mullo_pi16(__m64 __m1, __m64 __m2)
771static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2729static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
772_mm_sll_pi16(__m64 __m, __m64 __count)730_mm_sll_pi16(__m64 __m, __m64 __count)
773{731{
774 return __trunc64(__builtin_ia32_psllw128((__v8hi)__anyext128(__m),732 return __trunc64(__builtin_ia32_psllw128((__v8hi)__zext128(__m),
775 (__v8hi)__anyext128(__count)));733 (__v8hi)__zext128(__count)));
776}734}
777735
778/// Left-shifts each 16-bit signed integer element of a 64-bit integer736/// Left-shifts each 16-bit signed integer element of a 64-bit integer
...@@ -791,11 +749,9 @@ _mm_sll_pi16(__m64 __m, __m64 __count)...@@ -791,11 +749,9 @@ _mm_sll_pi16(__m64 __m, __m64 __count)
791/// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted749/// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted
792/// values. If \a __count is greater or equal to 16, the result is set to all750/// values. If \a __count is greater or equal to 16, the result is set to all
793/// 0.751/// 0.
794static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2752static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_slli_pi16(__m64 __m,
795_mm_slli_pi16(__m64 __m, int __count)753 int __count) {
796{754 return __trunc64(__builtin_ia32_psllwi128((__v8hi)__zext128(__m), __count));
797 return __trunc64(__builtin_ia32_psllwi128((__v8hi)__anyext128(__m),
798 __count));
799}755}
800756
801/// Left-shifts each 32-bit signed integer element of the first757/// Left-shifts each 32-bit signed integer element of the first
...@@ -818,8 +774,8 @@ _mm_slli_pi16(__m64 __m, int __count)...@@ -818,8 +774,8 @@ _mm_slli_pi16(__m64 __m, int __count)
818static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2774static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
819_mm_sll_pi32(__m64 __m, __m64 __count)775_mm_sll_pi32(__m64 __m, __m64 __count)
820{776{
821 return __trunc64(__builtin_ia32_pslld128((__v4si)__anyext128(__m),777 return __trunc64(__builtin_ia32_pslld128((__v4si)__zext128(__m),
822 (__v4si)__anyext128(__count)));778 (__v4si)__zext128(__count)));
823}779}
824780
825/// Left-shifts each 32-bit signed integer element of a 64-bit integer781/// Left-shifts each 32-bit signed integer element of a 64-bit integer
...@@ -838,11 +794,9 @@ _mm_sll_pi32(__m64 __m, __m64 __count)...@@ -838,11 +794,9 @@ _mm_sll_pi32(__m64 __m, __m64 __count)
838/// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted794/// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted
839/// values. If \a __count is greater or equal to 32, the result is set to all795/// values. If \a __count is greater or equal to 32, the result is set to all
840/// 0.796/// 0.
841static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2797static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_slli_pi32(__m64 __m,
842_mm_slli_pi32(__m64 __m, int __count)798 int __count) {
843{799 return __trunc64(__builtin_ia32_pslldi128((__v4si)__zext128(__m), __count));
844 return __trunc64(__builtin_ia32_pslldi128((__v4si)__anyext128(__m),
845 __count));
846}800}
847801
848/// Left-shifts the first 64-bit integer parameter by the number of bits802/// Left-shifts the first 64-bit integer parameter by the number of bits
...@@ -862,8 +816,8 @@ _mm_slli_pi32(__m64 __m, int __count)...@@ -862,8 +816,8 @@ _mm_slli_pi32(__m64 __m, int __count)
862static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2816static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
863_mm_sll_si64(__m64 __m, __m64 __count)817_mm_sll_si64(__m64 __m, __m64 __count)
864{818{
865 return __trunc64(__builtin_ia32_psllq128((__v2di)__anyext128(__m),819 return __trunc64(__builtin_ia32_psllq128((__v2di)__zext128(__m),
866 (__v2di)__anyext128(__count)));820 (__v2di)__zext128(__count)));
867}821}
868822
869/// Left-shifts the first parameter, which is a 64-bit integer, by the823/// Left-shifts the first parameter, which is a 64-bit integer, by the
...@@ -880,11 +834,9 @@ _mm_sll_si64(__m64 __m, __m64 __count)...@@ -880,11 +834,9 @@ _mm_sll_si64(__m64 __m, __m64 __count)
880/// A 32-bit integer value.834/// A 32-bit integer value.
881/// \returns A 64-bit integer vector containing the left-shifted value. If835/// \returns A 64-bit integer vector containing the left-shifted value. If
882/// \a __count is greater or equal to 64, the result is set to 0.836/// \a __count is greater or equal to 64, the result is set to 0.
883static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2837static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_slli_si64(__m64 __m,
884_mm_slli_si64(__m64 __m, int __count)838 int __count) {
885{839 return __trunc64(__builtin_ia32_psllqi128((__v2di)__zext128(__m), __count));
886 return __trunc64(__builtin_ia32_psllqi128((__v2di)__anyext128(__m),
887 __count));
888}840}
889841
890/// Right-shifts each 16-bit integer element of the first parameter,842/// Right-shifts each 16-bit integer element of the first parameter,
...@@ -908,8 +860,8 @@ _mm_slli_si64(__m64 __m, int __count)...@@ -908,8 +860,8 @@ _mm_slli_si64(__m64 __m, int __count)
908static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2860static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
909_mm_sra_pi16(__m64 __m, __m64 __count)861_mm_sra_pi16(__m64 __m, __m64 __count)
910{862{
911 return __trunc64(__builtin_ia32_psraw128((__v8hi)__anyext128(__m),863 return __trunc64(__builtin_ia32_psraw128((__v8hi)__zext128(__m),
912 (__v8hi)__anyext128(__count)));864 (__v8hi)__zext128(__count)));
913}865}
914866
915/// Right-shifts each 16-bit integer element of a 64-bit integer vector867/// Right-shifts each 16-bit integer element of a 64-bit integer vector
...@@ -929,11 +881,9 @@ _mm_sra_pi16(__m64 __m, __m64 __count)...@@ -929,11 +881,9 @@ _mm_sra_pi16(__m64 __m, __m64 __count)
929/// A 32-bit integer value.881/// A 32-bit integer value.
930/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted882/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
931/// values.883/// values.
932static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2884static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srai_pi16(__m64 __m,
933_mm_srai_pi16(__m64 __m, int __count)885 int __count) {
934{886 return __trunc64(__builtin_ia32_psrawi128((__v8hi)__zext128(__m), __count));
935 return __trunc64(__builtin_ia32_psrawi128((__v8hi)__anyext128(__m),
936 __count));
937}887}
938888
939/// Right-shifts each 32-bit integer element of the first parameter,889/// Right-shifts each 32-bit integer element of the first parameter,
...@@ -957,8 +907,8 @@ _mm_srai_pi16(__m64 __m, int __count)...@@ -957,8 +907,8 @@ _mm_srai_pi16(__m64 __m, int __count)
957static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2907static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
958_mm_sra_pi32(__m64 __m, __m64 __count)908_mm_sra_pi32(__m64 __m, __m64 __count)
959{909{
960 return __trunc64(__builtin_ia32_psrad128((__v4si)__anyext128(__m),910 return __trunc64(__builtin_ia32_psrad128((__v4si)__zext128(__m),
961 (__v4si)__anyext128(__count)));911 (__v4si)__zext128(__count)));
962}912}
963913
964/// Right-shifts each 32-bit integer element of a 64-bit integer vector914/// Right-shifts each 32-bit integer element of a 64-bit integer vector
...@@ -978,11 +928,9 @@ _mm_sra_pi32(__m64 __m, __m64 __count)...@@ -978,11 +928,9 @@ _mm_sra_pi32(__m64 __m, __m64 __count)
978/// A 32-bit integer value.928/// A 32-bit integer value.
979/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted929/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
980/// values.930/// values.
981static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2931static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srai_pi32(__m64 __m,
982_mm_srai_pi32(__m64 __m, int __count)932 int __count) {
983{933 return __trunc64(__builtin_ia32_psradi128((__v4si)__zext128(__m), __count));
984 return __trunc64(__builtin_ia32_psradi128((__v4si)__anyext128(__m),
985 __count));
986}934}
987935
988/// Right-shifts each 16-bit integer element of the first parameter,936/// Right-shifts each 16-bit integer element of the first parameter,
...@@ -1005,8 +953,8 @@ _mm_srai_pi32(__m64 __m, int __count)...@@ -1005,8 +953,8 @@ _mm_srai_pi32(__m64 __m, int __count)
1005static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2953static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1006_mm_srl_pi16(__m64 __m, __m64 __count)954_mm_srl_pi16(__m64 __m, __m64 __count)
1007{955{
1008 return __trunc64(__builtin_ia32_psrlw128((__v8hi)__anyext128(__m),956 return __trunc64(__builtin_ia32_psrlw128((__v8hi)__zext128(__m),
1009 (__v8hi)__anyext128(__count)));957 (__v8hi)__zext128(__count)));
1010}958}
1011959
1012/// Right-shifts each 16-bit integer element of a 64-bit integer vector960/// Right-shifts each 16-bit integer element of a 64-bit integer vector
...@@ -1025,11 +973,9 @@ _mm_srl_pi16(__m64 __m, __m64 __count)...@@ -1025,11 +973,9 @@ _mm_srl_pi16(__m64 __m, __m64 __count)
1025/// A 32-bit integer value.973/// A 32-bit integer value.
1026/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted974/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
1027/// values.975/// values.
1028static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2976static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srli_pi16(__m64 __m,
1029_mm_srli_pi16(__m64 __m, int __count)977 int __count) {
1030{978 return __trunc64(__builtin_ia32_psrlwi128((__v8hi)__zext128(__m), __count));
1031 return __trunc64(__builtin_ia32_psrlwi128((__v8hi)__anyext128(__m),
1032 __count));
1033}979}
1034980
1035/// Right-shifts each 32-bit integer element of the first parameter,981/// Right-shifts each 32-bit integer element of the first parameter,
...@@ -1052,8 +998,8 @@ _mm_srli_pi16(__m64 __m, int __count)...@@ -1052,8 +998,8 @@ _mm_srli_pi16(__m64 __m, int __count)
1052static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2998static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1053_mm_srl_pi32(__m64 __m, __m64 __count)999_mm_srl_pi32(__m64 __m, __m64 __count)
1054{1000{
1055 return __trunc64(__builtin_ia32_psrld128((__v4si)__anyext128(__m),1001 return __trunc64(__builtin_ia32_psrld128((__v4si)__zext128(__m),
1056 (__v4si)__anyext128(__count)));1002 (__v4si)__zext128(__count)));
1057}1003}
10581004
1059/// Right-shifts each 32-bit integer element of a 64-bit integer vector1005/// Right-shifts each 32-bit integer element of a 64-bit integer vector
...@@ -1072,11 +1018,9 @@ _mm_srl_pi32(__m64 __m, __m64 __count)...@@ -1072,11 +1018,9 @@ _mm_srl_pi32(__m64 __m, __m64 __count)
1072/// A 32-bit integer value.1018/// A 32-bit integer value.
1073/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted1019/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
1074/// values.1020/// values.
1075static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21021static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srli_pi32(__m64 __m,
1076_mm_srli_pi32(__m64 __m, int __count)1022 int __count) {
1077{1023 return __trunc64(__builtin_ia32_psrldi128((__v4si)__zext128(__m), __count));
1078 return __trunc64(__builtin_ia32_psrldi128((__v4si)__anyext128(__m),
1079 __count));
1080}1024}
10811025
1082/// Right-shifts the first 64-bit integer parameter by the number of bits1026/// Right-shifts the first 64-bit integer parameter by the number of bits
...@@ -1096,8 +1040,8 @@ _mm_srli_pi32(__m64 __m, int __count)...@@ -1096,8 +1040,8 @@ _mm_srli_pi32(__m64 __m, int __count)
1096static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21040static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1097_mm_srl_si64(__m64 __m, __m64 __count)1041_mm_srl_si64(__m64 __m, __m64 __count)
1098{1042{
1099 return __trunc64(__builtin_ia32_psrlq128((__v2di)__anyext128(__m),1043 return __trunc64(__builtin_ia32_psrlq128((__v2di)__zext128(__m),
1100 (__v2di)__anyext128(__count)));1044 (__v2di)__zext128(__count)));
1101}1045}
11021046
1103/// Right-shifts the first parameter, which is a 64-bit integer, by the1047/// Right-shifts the first parameter, which is a 64-bit integer, by the
...@@ -1115,11 +1059,9 @@ _mm_srl_si64(__m64 __m, __m64 __count)...@@ -1115,11 +1059,9 @@ _mm_srl_si64(__m64 __m, __m64 __count)
1115/// \param __count1059/// \param __count
1116/// A 32-bit integer value.1060/// A 32-bit integer value.
1117/// \returns A 64-bit integer vector containing the right-shifted value.1061/// \returns A 64-bit integer vector containing the right-shifted value.
1118static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21062static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srli_si64(__m64 __m,
1119_mm_srli_si64(__m64 __m, int __count)1063 int __count) {
1120{1064 return __trunc64(__builtin_ia32_psrlqi128((__v2di)__zext128(__m), __count));
1121 return __trunc64(__builtin_ia32_psrlqi128((__v2di)__anyext128(__m),
1122 __count));
1123}1065}
11241066
1125/// Performs a bitwise AND of two 64-bit integer vectors.1067/// Performs a bitwise AND of two 64-bit integer vectors.
...@@ -1134,10 +1076,9 @@ _mm_srli_si64(__m64 __m, int __count)...@@ -1134,10 +1076,9 @@ _mm_srli_si64(__m64 __m, int __count)
1134/// A 64-bit integer vector.1076/// A 64-bit integer vector.
1135/// \returns A 64-bit integer vector containing the bitwise AND of both1077/// \returns A 64-bit integer vector containing the bitwise AND of both
1136/// parameters.1078/// parameters.
1137static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21079static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_and_si64(__m64 __m1,
1138_mm_and_si64(__m64 __m1, __m64 __m2)1080 __m64 __m2) {
1139{1081 return (__m64)(((__v1du)__m1) & ((__v1du)__m2));
1140 return (__m64)(((__v1du)__m1) & ((__v1du)__m2));
1141}1082}
11421083
1143/// Performs a bitwise NOT of the first 64-bit integer vector, and then1084/// Performs a bitwise NOT of the first 64-bit integer vector, and then
...@@ -1155,10 +1096,9 @@ _mm_and_si64(__m64 __m1, __m64 __m2)...@@ -1155,10 +1096,9 @@ _mm_and_si64(__m64 __m1, __m64 __m2)
1155/// A 64-bit integer vector.1096/// A 64-bit integer vector.
1156/// \returns A 64-bit integer vector containing the bitwise AND of the second1097/// \returns A 64-bit integer vector containing the bitwise AND of the second
1157/// parameter and the one's complement of the first parameter.1098/// parameter and the one's complement of the first parameter.
1158static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21099static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_andnot_si64(__m64 __m1,
1159_mm_andnot_si64(__m64 __m1, __m64 __m2)1100 __m64 __m2) {
1160{1101 return (__m64)(~((__v1du)__m1) & ((__v1du)__m2));
1161 return (__m64)(~((__v1du)__m1) & ((__v1du)__m2));
1162}1102}
11631103
1164/// Performs a bitwise OR of two 64-bit integer vectors.1104/// Performs a bitwise OR of two 64-bit integer vectors.
...@@ -1173,10 +1113,9 @@ _mm_andnot_si64(__m64 __m1, __m64 __m2)...@@ -1173,10 +1113,9 @@ _mm_andnot_si64(__m64 __m1, __m64 __m2)
1173/// A 64-bit integer vector.1113/// A 64-bit integer vector.
1174/// \returns A 64-bit integer vector containing the bitwise OR of both1114/// \returns A 64-bit integer vector containing the bitwise OR of both
1175/// parameters.1115/// parameters.
1176static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21116static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_or_si64(__m64 __m1,
1177_mm_or_si64(__m64 __m1, __m64 __m2)1117 __m64 __m2) {
1178{1118 return (__m64)(((__v1du)__m1) | ((__v1du)__m2));
1179 return (__m64)(((__v1du)__m1) | ((__v1du)__m2));
1180}1119}
11811120
1182/// Performs a bitwise exclusive OR of two 64-bit integer vectors.1121/// Performs a bitwise exclusive OR of two 64-bit integer vectors.
...@@ -1191,10 +1130,9 @@ _mm_or_si64(__m64 __m1, __m64 __m2)...@@ -1191,10 +1130,9 @@ _mm_or_si64(__m64 __m1, __m64 __m2)
1191/// A 64-bit integer vector.1130/// A 64-bit integer vector.
1192/// \returns A 64-bit integer vector containing the bitwise exclusive OR of both1131/// \returns A 64-bit integer vector containing the bitwise exclusive OR of both
1193/// parameters.1132/// parameters.
1194static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21133static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_xor_si64(__m64 __m1,
1195_mm_xor_si64(__m64 __m1, __m64 __m2)1134 __m64 __m2) {
1196{1135 return (__m64)(((__v1du)__m1) ^ ((__v1du)__m2));
1197 return (__m64)(((__v1du)__m1) ^ ((__v1du)__m2));
1198}1136}
11991137
1200/// Compares the 8-bit integer elements of two 64-bit integer vectors of1138/// Compares the 8-bit integer elements of two 64-bit integer vectors of
...@@ -1213,10 +1151,9 @@ _mm_xor_si64(__m64 __m1, __m64 __m2)...@@ -1213,10 +1151,9 @@ _mm_xor_si64(__m64 __m1, __m64 __m2)
1213/// A 64-bit integer vector of [8 x i8].1151/// A 64-bit integer vector of [8 x i8].
1214/// \returns A 64-bit integer vector of [8 x i8] containing the comparison1152/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
1215/// results.1153/// results.
1216static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21154static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cmpeq_pi8(__m64 __m1,
1217_mm_cmpeq_pi8(__m64 __m1, __m64 __m2)1155 __m64 __m2) {
1218{1156 return (__m64)(((__v8qi)__m1) == ((__v8qi)__m2));
1219 return (__m64)(((__v8qi)__m1) == ((__v8qi)__m2));
1220}1157}
12211158
1222/// Compares the 16-bit integer elements of two 64-bit integer vectors of1159/// Compares the 16-bit integer elements of two 64-bit integer vectors of
...@@ -1235,10 +1172,9 @@ _mm_cmpeq_pi8(__m64 __m1, __m64 __m2)...@@ -1235,10 +1172,9 @@ _mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
1235/// A 64-bit integer vector of [4 x i16].1172/// A 64-bit integer vector of [4 x i16].
1236/// \returns A 64-bit integer vector of [4 x i16] containing the comparison1173/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
1237/// results.1174/// results.
1238static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21175static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cmpeq_pi16(__m64 __m1,
1239_mm_cmpeq_pi16(__m64 __m1, __m64 __m2)1176 __m64 __m2) {
1240{1177 return (__m64)(((__v4hi)__m1) == ((__v4hi)__m2));
1241 return (__m64)(((__v4hi)__m1) == ((__v4hi)__m2));
1242}1178}
12431179
1244/// Compares the 32-bit integer elements of two 64-bit integer vectors of1180/// Compares the 32-bit integer elements of two 64-bit integer vectors of
...@@ -1257,10 +1193,9 @@ _mm_cmpeq_pi16(__m64 __m1, __m64 __m2)...@@ -1257,10 +1193,9 @@ _mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
1257/// A 64-bit integer vector of [2 x i32].1193/// A 64-bit integer vector of [2 x i32].
1258/// \returns A 64-bit integer vector of [2 x i32] containing the comparison1194/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
1259/// results.1195/// results.
1260static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21196static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cmpeq_pi32(__m64 __m1,
1261_mm_cmpeq_pi32(__m64 __m1, __m64 __m2)1197 __m64 __m2) {
1262{1198 return (__m64)(((__v2si)__m1) == ((__v2si)__m2));
1263 return (__m64)(((__v2si)__m1) == ((__v2si)__m2));
1264}1199}
12651200
1266/// Compares the 8-bit integer elements of two 64-bit integer vectors of1201/// Compares the 8-bit integer elements of two 64-bit integer vectors of
...@@ -1279,9 +1214,8 @@ _mm_cmpeq_pi32(__m64 __m1, __m64 __m2)...@@ -1279,9 +1214,8 @@ _mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
1279/// A 64-bit integer vector of [8 x i8].1214/// A 64-bit integer vector of [8 x i8].
1280/// \returns A 64-bit integer vector of [8 x i8] containing the comparison1215/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
1281/// results.1216/// results.
1282static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21217static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cmpgt_pi8(__m64 __m1,
1283_mm_cmpgt_pi8(__m64 __m1, __m64 __m2)1218 __m64 __m2) {
1284{
1285 /* This function always performs a signed comparison, but __v8qi is a char1219 /* This function always performs a signed comparison, but __v8qi is a char
1286 which may be signed or unsigned, so use __v8qs. */1220 which may be signed or unsigned, so use __v8qs. */
1287 return (__m64)((__v8qs)__m1 > (__v8qs)__m2);1221 return (__m64)((__v8qs)__m1 > (__v8qs)__m2);
...@@ -1303,10 +1237,9 @@ _mm_cmpgt_pi8(__m64 __m1, __m64 __m2)...@@ -1303,10 +1237,9 @@ _mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
1303/// A 64-bit integer vector of [4 x i16].1237/// A 64-bit integer vector of [4 x i16].
1304/// \returns A 64-bit integer vector of [4 x i16] containing the comparison1238/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
1305/// results.1239/// results.
1306static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21240static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cmpgt_pi16(__m64 __m1,
1307_mm_cmpgt_pi16(__m64 __m1, __m64 __m2)1241 __m64 __m2) {
1308{1242 return (__m64)((__v4hi)__m1 > (__v4hi)__m2);
1309 return (__m64)((__v4hi)__m1 > (__v4hi)__m2);
1310}1243}
13111244
1312/// Compares the 32-bit integer elements of two 64-bit integer vectors of1245/// Compares the 32-bit integer elements of two 64-bit integer vectors of
...@@ -1325,10 +1258,9 @@ _mm_cmpgt_pi16(__m64 __m1, __m64 __m2)...@@ -1325,10 +1258,9 @@ _mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
1325/// A 64-bit integer vector of [2 x i32].1258/// A 64-bit integer vector of [2 x i32].
1326/// \returns A 64-bit integer vector of [2 x i32] containing the comparison1259/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
1327/// results.1260/// results.
1328static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE21261static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_cmpgt_pi32(__m64 __m1,
1329_mm_cmpgt_pi32(__m64 __m1, __m64 __m2)1262 __m64 __m2) {
1330{1263 return (__m64)((__v2si)__m1 > (__v2si)__m2);
1331 return (__m64)((__v2si)__m1 > (__v2si)__m2);
1332}1264}
13331265
1334/// Constructs a 64-bit integer vector initialized to zero.1266/// Constructs a 64-bit integer vector initialized to zero.
...@@ -1338,8 +1270,7 @@ _mm_cmpgt_pi32(__m64 __m1, __m64 __m2)...@@ -1338,8 +1270,7 @@ _mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
1338/// This intrinsic corresponds to the <c> PXOR </c> instruction.1270/// This intrinsic corresponds to the <c> PXOR </c> instruction.
1339///1271///
1340/// \returns An initialized 64-bit integer vector with all elements set to zero.1272/// \returns An initialized 64-bit integer vector with all elements set to zero.
1341static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1273static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_setzero_si64(void) {
1342_mm_setzero_si64(void) {
1343 return __extension__(__m64){0LL};1274 return __extension__(__m64){0LL};
1344}1275}
13451276
...@@ -1358,8 +1289,8 @@ _mm_setzero_si64(void) {...@@ -1358,8 +1289,8 @@ _mm_setzero_si64(void) {
1358/// A 32-bit integer value used to initialize the lower 32 bits of the1289/// A 32-bit integer value used to initialize the lower 32 bits of the
1359/// result.1290/// result.
1360/// \returns An initialized 64-bit integer vector.1291/// \returns An initialized 64-bit integer vector.
1361static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1292static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_set_pi32(int __i1,
1362_mm_set_pi32(int __i1, int __i0) {1293 int __i0) {
1363 return __extension__(__m64)(__v2si){__i0, __i1};1294 return __extension__(__m64)(__v2si){__i0, __i1};
1364}1295}
13651296
...@@ -1380,8 +1311,10 @@ _mm_set_pi32(int __i1, int __i0) {...@@ -1380,8 +1311,10 @@ _mm_set_pi32(int __i1, int __i0) {
1380/// \param __s01311/// \param __s0
1381/// A 16-bit integer value used to initialize bits [15:0] of the result.1312/// A 16-bit integer value used to initialize bits [15:0] of the result.
1382/// \returns An initialized 64-bit integer vector.1313/// \returns An initialized 64-bit integer vector.
1383static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1314static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_set_pi16(short __s3,
1384_mm_set_pi16(short __s3, short __s2, short __s1, short __s0) {1315 short __s2,
1316 short __s1,
1317 short __s0) {
1385 return __extension__(__m64)(__v4hi){__s0, __s1, __s2, __s3};1318 return __extension__(__m64)(__v4hi){__s0, __s1, __s2, __s3};
1386}1319}
13871320
...@@ -1410,7 +1343,7 @@ _mm_set_pi16(short __s3, short __s2, short __s1, short __s0) {...@@ -1410,7 +1343,7 @@ _mm_set_pi16(short __s3, short __s2, short __s1, short __s0) {
1410/// \param __b01343/// \param __b0
1411/// An 8-bit integer value used to initialize bits [7:0] of the result.1344/// An 8-bit integer value used to initialize bits [7:0] of the result.
1412/// \returns An initialized 64-bit integer vector.1345/// \returns An initialized 64-bit integer vector.
1413static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1346static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1414_mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,1347_mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
1415 char __b1, char __b0) {1348 char __b1, char __b0) {
1416 return __extension__(__m64)(__v8qi){__b0, __b1, __b2, __b3,1349 return __extension__(__m64)(__v8qi){__b0, __b1, __b2, __b3,
...@@ -1430,8 +1363,7 @@ _mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,...@@ -1430,8 +1363,7 @@ _mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
1430/// A 32-bit integer value used to initialize each vector element of the1363/// A 32-bit integer value used to initialize each vector element of the
1431/// result.1364/// result.
1432/// \returns An initialized 64-bit integer vector of [2 x i32].1365/// \returns An initialized 64-bit integer vector of [2 x i32].
1433static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1366static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_set1_pi32(int __i) {
1434_mm_set1_pi32(int __i) {
1435 return _mm_set_pi32(__i, __i);1367 return _mm_set_pi32(__i, __i);
1436}1368}
14371369
...@@ -1448,8 +1380,7 @@ _mm_set1_pi32(int __i) {...@@ -1448,8 +1380,7 @@ _mm_set1_pi32(int __i) {
1448/// A 16-bit integer value used to initialize each vector element of the1380/// A 16-bit integer value used to initialize each vector element of the
1449/// result.1381/// result.
1450/// \returns An initialized 64-bit integer vector of [4 x i16].1382/// \returns An initialized 64-bit integer vector of [4 x i16].
1451static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1383static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_set1_pi16(short __w) {
1452_mm_set1_pi16(short __w) {
1453 return _mm_set_pi16(__w, __w, __w, __w);1384 return _mm_set_pi16(__w, __w, __w, __w);
1454}1385}
14551386
...@@ -1465,8 +1396,7 @@ _mm_set1_pi16(short __w) {...@@ -1465,8 +1396,7 @@ _mm_set1_pi16(short __w) {
1465/// An 8-bit integer value used to initialize each vector element of the1396/// An 8-bit integer value used to initialize each vector element of the
1466/// result.1397/// result.
1467/// \returns An initialized 64-bit integer vector of [8 x i8].1398/// \returns An initialized 64-bit integer vector of [8 x i8].
1468static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1399static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_set1_pi8(char __b) {
1469_mm_set1_pi8(char __b) {
1470 return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b);1400 return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b);
1471}1401}
14721402
...@@ -1485,8 +1415,8 @@ _mm_set1_pi8(char __b) {...@@ -1485,8 +1415,8 @@ _mm_set1_pi8(char __b) {
1485/// A 32-bit integer value used to initialize the upper 32 bits of the1415/// A 32-bit integer value used to initialize the upper 32 bits of the
1486/// result.1416/// result.
1487/// \returns An initialized 64-bit integer vector.1417/// \returns An initialized 64-bit integer vector.
1488static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1418static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_setr_pi32(int __i0,
1489_mm_setr_pi32(int __i0, int __i1) {1419 int __i1) {
1490 return _mm_set_pi32(__i1, __i0);1420 return _mm_set_pi32(__i1, __i0);
1491}1421}
14921422
...@@ -1507,8 +1437,10 @@ _mm_setr_pi32(int __i0, int __i1) {...@@ -1507,8 +1437,10 @@ _mm_setr_pi32(int __i0, int __i1) {
1507/// \param __w31437/// \param __w3
1508/// A 16-bit integer value used to initialize bits [63:48] of the result.1438/// A 16-bit integer value used to initialize bits [63:48] of the result.
1509/// \returns An initialized 64-bit integer vector.1439/// \returns An initialized 64-bit integer vector.
1510static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1440static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_setr_pi16(short __w0,
1511_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) {1441 short __w1,
1442 short __w2,
1443 short __w3) {
1512 return _mm_set_pi16(__w3, __w2, __w1, __w0);1444 return _mm_set_pi16(__w3, __w2, __w1, __w0);
1513}1445}
15141446
...@@ -1537,13 +1469,12 @@ _mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) {...@@ -1537,13 +1469,12 @@ _mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) {
1537/// \param __b71469/// \param __b7
1538/// An 8-bit integer value used to initialize bits [63:56] of the result.1470/// An 8-bit integer value used to initialize bits [63:56] of the result.
1539/// \returns An initialized 64-bit integer vector.1471/// \returns An initialized 64-bit integer vector.
1540static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR1472static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1541_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,1473_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
1542 char __b6, char __b7) {1474 char __b6, char __b7) {
1543 return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);1475 return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
1544}1476}
15451477
1546#undef __anyext128
1547#undef __trunc641478#undef __trunc64
1548#undef __DEFAULT_FN_ATTRS_SSE21479#undef __DEFAULT_FN_ATTRS_SSE2
15491480
lib/include/module.modulemap+23-4
...@@ -171,8 +171,22 @@ module _Builtin_intrinsics [system] [extern_c] {...@@ -171,8 +171,22 @@ module _Builtin_intrinsics [system] [extern_c] {
171// that module. The system float.h (if present) will be treated171// that module. The system float.h (if present) will be treated
172// as a textual header in the sytem module.172// as a textual header in the sytem module.
173module _Builtin_float [system] {173module _Builtin_float [system] {
174 header "float.h"174 textual header "float.h"
175 export *175
176 explicit module float {
177 header "__float_float.h"
178 export *
179 }
180
181 explicit module header_macro {
182 header "__float_header_macro.h"
183 export *
184 }
185
186 explicit module infinity_nan {
187 header "__float_infinity_nan.h"
188 export *
189 }
176}190}
177191
178module _Builtin_inttypes [system] {192module _Builtin_inttypes [system] {
...@@ -239,6 +253,11 @@ module _Builtin_stdbool [system] {...@@ -239,6 +253,11 @@ module _Builtin_stdbool [system] {
239 export *253 export *
240}254}
241255
256module _Builtin_stdckdint [system] {
257 header "stdckdint.h"
258 export *
259}
260
242module _Builtin_stdcountof [system] {261module _Builtin_stdcountof [system] {
243 header "stdcountof.h"262 header "stdcountof.h"
244 export *263 export *
...@@ -329,13 +348,13 @@ module _Builtin_unwind [system] {...@@ -329,13 +348,13 @@ module _Builtin_unwind [system] {
329}348}
330// End -fbuiltin-headers-in-system-modules affected modules349// End -fbuiltin-headers-in-system-modules affected modules
331350
332module opencl_c {351module opencl_c [system] {
333 requires opencl352 requires opencl
334 header "opencl-c.h"353 header "opencl-c.h"
335 header "opencl-c-base.h"354 header "opencl-c-base.h"
336}355}
337356
338module ptrauth {357module ptrauth [system] {
339 header "ptrauth.h"358 header "ptrauth.h"
340 export *359 export *
341}360}
lib/include/movrs_avx10_2_512intrin.h+2-2
...@@ -17,8 +17,8 @@...@@ -17,8 +17,8 @@
1717
18/* Define the default attributes for the functions in this file. */18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS512 \19#define __DEFAULT_FN_ATTRS512 \
20 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("movrs, avx10.2"), \
21 __target__("movrs, avx10.2-512"), __min_vector_width__(512)))21 __min_vector_width__(512)))
2222
23static __inline__ __m512i __DEFAULT_FN_ATTRS51223static __inline__ __m512i __DEFAULT_FN_ATTRS512
24_mm512_loadrs_epi8(void const *__A) {24_mm512_loadrs_epi8(void const *__A) {
lib/include/movrs_avx10_2intrin.h+4-4
...@@ -17,11 +17,11 @@...@@ -17,11 +17,11 @@
1717
18/* Define the default attributes for the functions in this file. */18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS128 \19#define __DEFAULT_FN_ATTRS128 \
20 __attribute__((__always_inline__, __nodebug__, \20 __attribute__((__always_inline__, __nodebug__, __target__("movrs,avx10.2"), \
21 __target__("movrs,avx10.2-256"), __min_vector_width__(128)))21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \23 __attribute__((__always_inline__, __nodebug__, __target__("movrs,avx10.2"), \
24 __target__("movrs,avx10.2-256"), __min_vector_width__(256)))24 __min_vector_width__(256)))
2525
26static __inline__ __m128i __DEFAULT_FN_ATTRS12826static __inline__ __m128i __DEFAULT_FN_ATTRS128
27_mm_loadrs_epi8(void const *__A) {27_mm_loadrs_epi8(void const *__A) {
lib/include/pmmintrin.h+12-24
...@@ -17,15 +17,9 @@...@@ -17,15 +17,9 @@
17#include <emmintrin.h>17#include <emmintrin.h>
1818
19/* Define the default attributes for the functions in this file. */19/* Define the default attributes for the functions in this file. */
20#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
21#define __DEFAULT_FN_ATTRS \
22 __attribute__((__always_inline__, __nodebug__, \
23 __target__("sse3,no-evex512"), __min_vector_width__(128)))
24#else
25#define __DEFAULT_FN_ATTRS \20#define __DEFAULT_FN_ATTRS \
26 __attribute__((__always_inline__, __nodebug__, __target__("sse3"), \21 __attribute__((__always_inline__, __nodebug__, __target__("sse3"), \
27 __min_vector_width__(128)))22 __min_vector_width__(128)))
28#endif
2923
30#if defined(__cplusplus) && (__cplusplus >= 201103L)24#if defined(__cplusplus) && (__cplusplus >= 201103L)
31#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr25#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
...@@ -66,9 +60,8 @@ _mm_lddqu_si128(__m128i_u const *__p)...@@ -66,9 +60,8 @@ _mm_lddqu_si128(__m128i_u const *__p)
66/// A 128-bit vector of [4 x float] containing the right source operand.60/// A 128-bit vector of [4 x float] containing the right source operand.
67/// \returns A 128-bit vector of [4 x float] containing the alternating sums and61/// \returns A 128-bit vector of [4 x float] containing the alternating sums and
68/// differences of both operands.62/// differences of both operands.
69static __inline__ __m128 __DEFAULT_FN_ATTRS63static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
70_mm_addsub_ps(__m128 __a, __m128 __b)64_mm_addsub_ps(__m128 __a, __m128 __b) {
71{
72 return __builtin_ia32_addsubps((__v4sf)__a, (__v4sf)__b);65 return __builtin_ia32_addsubps((__v4sf)__a, (__v4sf)__b);
73}66}
7467
...@@ -89,9 +82,8 @@ _mm_addsub_ps(__m128 __a, __m128 __b)...@@ -89,9 +82,8 @@ _mm_addsub_ps(__m128 __a, __m128 __b)
89/// destination.82/// destination.
90/// \returns A 128-bit vector of [4 x float] containing the horizontal sums of83/// \returns A 128-bit vector of [4 x float] containing the horizontal sums of
91/// both operands.84/// both operands.
92static __inline__ __m128 __DEFAULT_FN_ATTRS85static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hadd_ps(__m128 __a,
93_mm_hadd_ps(__m128 __a, __m128 __b)86 __m128 __b) {
94{
95 return __builtin_ia32_haddps((__v4sf)__a, (__v4sf)__b);87 return __builtin_ia32_haddps((__v4sf)__a, (__v4sf)__b);
96}88}
9789
...@@ -112,9 +104,8 @@ _mm_hadd_ps(__m128 __a, __m128 __b)...@@ -112,9 +104,8 @@ _mm_hadd_ps(__m128 __a, __m128 __b)
112/// bits of the destination.104/// bits of the destination.
113/// \returns A 128-bit vector of [4 x float] containing the horizontal105/// \returns A 128-bit vector of [4 x float] containing the horizontal
114/// differences of both operands.106/// differences of both operands.
115static __inline__ __m128 __DEFAULT_FN_ATTRS107static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hsub_ps(__m128 __a,
116_mm_hsub_ps(__m128 __a, __m128 __b)108 __m128 __b) {
117{
118 return __builtin_ia32_hsubps((__v4sf)__a, (__v4sf)__b);109 return __builtin_ia32_hsubps((__v4sf)__a, (__v4sf)__b);
119}110}
120111
...@@ -174,9 +165,8 @@ _mm_moveldup_ps(__m128 __a)...@@ -174,9 +165,8 @@ _mm_moveldup_ps(__m128 __a)
174/// A 128-bit vector of [2 x double] containing the right source operand.165/// A 128-bit vector of [2 x double] containing the right source operand.
175/// \returns A 128-bit vector of [2 x double] containing the alternating sums166/// \returns A 128-bit vector of [2 x double] containing the alternating sums
176/// and differences of both operands.167/// and differences of both operands.
177static __inline__ __m128d __DEFAULT_FN_ATTRS168static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
178_mm_addsub_pd(__m128d __a, __m128d __b)169_mm_addsub_pd(__m128d __a, __m128d __b) {
179{
180 return __builtin_ia32_addsubpd((__v2df)__a, (__v2df)__b);170 return __builtin_ia32_addsubpd((__v2df)__a, (__v2df)__b);
181}171}
182172
...@@ -197,9 +187,8 @@ _mm_addsub_pd(__m128d __a, __m128d __b)...@@ -197,9 +187,8 @@ _mm_addsub_pd(__m128d __a, __m128d __b)
197/// destination.187/// destination.
198/// \returns A 128-bit vector of [2 x double] containing the horizontal sums of188/// \returns A 128-bit vector of [2 x double] containing the horizontal sums of
199/// both operands.189/// both operands.
200static __inline__ __m128d __DEFAULT_FN_ATTRS190static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
201_mm_hadd_pd(__m128d __a, __m128d __b)191_mm_hadd_pd(__m128d __a, __m128d __b) {
202{
203 return __builtin_ia32_haddpd((__v2df)__a, (__v2df)__b);192 return __builtin_ia32_haddpd((__v2df)__a, (__v2df)__b);
204}193}
205194
...@@ -220,9 +209,8 @@ _mm_hadd_pd(__m128d __a, __m128d __b)...@@ -220,9 +209,8 @@ _mm_hadd_pd(__m128d __a, __m128d __b)
220/// the destination.209/// the destination.
221/// \returns A 128-bit vector of [2 x double] containing the horizontal210/// \returns A 128-bit vector of [2 x double] containing the horizontal
222/// differences of both operands.211/// differences of both operands.
223static __inline__ __m128d __DEFAULT_FN_ATTRS212static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
224_mm_hsub_pd(__m128d __a, __m128d __b)213_mm_hsub_pd(__m128d __a, __m128d __b) {
225{
226 return __builtin_ia32_hsubpd((__v2df)__a, (__v2df)__b);214 return __builtin_ia32_hsubpd((__v2df)__a, (__v2df)__b);
227}215}
228216
lib/include/ptrauth.h+16-2
...@@ -95,7 +95,7 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -95,7 +95,7 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
95 __ptrauth qualifier; the compiler will perform this check95 __ptrauth qualifier; the compiler will perform this check
96 automatically. */96 automatically. */
9797
98#if __has_feature(ptrauth_intrinsics)98#if __has_feature(ptrauth_intrinsics) || defined(__PTRAUTH__)
9999
100/* Strip the signature from a value without authenticating it.100/* Strip the signature from a value without authenticating it.
101101
...@@ -241,6 +241,18 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -241,6 +241,18 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
241#define ptrauth_type_discriminator(__type) \241#define ptrauth_type_discriminator(__type) \
242 __builtin_ptrauth_type_discriminator(__type)242 __builtin_ptrauth_type_discriminator(__type)
243243
244/* Compute the constant discriminator used by Clang to sign pointers with the
245 given C function pointer type.
246
247 A call to this function is an integer constant expression. */
248#if __has_feature(ptrauth_function_pointer_type_discrimination)
249#define ptrauth_function_pointer_type_discriminator(__type) \
250 __builtin_ptrauth_type_discriminator(__type)
251#else
252#define ptrauth_function_pointer_type_discriminator(__type) \
253 ((ptrauth_extra_data_t)0)
254#endif
255
244/* Compute a signature for the given pair of pointer-sized values.256/* Compute a signature for the given pair of pointer-sized values.
245 The order of the arguments is significant.257 The order of the arguments is significant.
246258
...@@ -372,6 +384,8 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -372,6 +384,8 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
372 })384 })
373385
374#define ptrauth_type_discriminator(__type) ((ptrauth_extra_data_t)0)386#define ptrauth_type_discriminator(__type) ((ptrauth_extra_data_t)0)
387#define ptrauth_function_pointer_type_discriminator(__type) \
388 ((ptrauth_extra_data_t)0)
375389
376#define ptrauth_sign_generic_data(__value, __data) \390#define ptrauth_sign_generic_data(__value, __data) \
377 ({ \391 ({ \
...@@ -388,6 +402,6 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -388,6 +402,6 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
388#define __ptrauth_objc_isa_uintptr402#define __ptrauth_objc_isa_uintptr
389#define __ptrauth_objc_super_pointer403#define __ptrauth_objc_super_pointer
390404
391#endif /* __has_feature(ptrauth_intrinsics) */405#endif /* __has_feature(ptrauth_intrinsics) || defined(__PTRAUTH__) */
392406
393#endif /* __PTRAUTH_H */407#endif /* __PTRAUTH_H */
lib/include/riscv_mips.h created+34
...@@ -0,0 +1,34 @@
1//===----- riscv_mips.h - RISC-V MIPS Intrinsic definitions
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 __RISCV_MIPS_H
11#define __RISCV_MIPS_H
12
13#if !defined(__riscv)
14#error "This header is only meant to be used on riscv architecture"
15#endif
16
17#define __DEFAULT_FN_ATTRS \
18 __attribute__((__always_inline__, __nodebug__, __target__("xmipsexectl")))
19
20static __inline__ void __DEFAULT_FN_ATTRS __mips_pause() {
21 __builtin_riscv_mips_pause();
22}
23
24static __inline__ void __DEFAULT_FN_ATTRS __mips_ehb() {
25 __builtin_riscv_mips_ehb();
26}
27
28static __inline__ void __DEFAULT_FN_ATTRS __mips_ihb() {
29 __builtin_riscv_mips_ihb();
30}
31
32#undef __DEFAULT_FN_ATTRS
33
34#endif
lib/include/riscv_nds.h created+89
...@@ -0,0 +1,89 @@
1/*===---- riscv_nds.h - Andes 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_NDS_H
11#define __RISCV_NDS_H
12
13#include <stdint.h>
14
15#if defined(__cplusplus)
16extern "C" {
17#endif
18
19#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
20
21#if defined(__riscv_xandesperf)
22
23#if __riscv_xlen == 32
24
25static __inline__ int32_t __DEFAULT_FN_ATTRS __riscv_nds_ffb_32(uint32_t __a,
26 uint32_t __b) {
27 return __builtin_riscv_nds_ffb_32(__a, __b);
28}
29
30static __inline__ int32_t __DEFAULT_FN_ATTRS
31__riscv_nds_ffzmism_32(uint32_t __a, uint32_t __b) {
32 return __builtin_riscv_nds_ffzmism_32(__a, __b);
33}
34
35static __inline__ int32_t __DEFAULT_FN_ATTRS
36__riscv_nds_ffmism_32(uint32_t __a, uint32_t __b) {
37 return __builtin_riscv_nds_ffmism_32(__a, __b);
38}
39
40static __inline__ int32_t __DEFAULT_FN_ATTRS
41__riscv_nds_flmism_32(uint32_t __a, uint32_t __b) {
42 return __builtin_riscv_nds_flmism_32(__a, __b);
43}
44
45#endif
46
47#if __riscv_xlen == 64
48
49static __inline__ int64_t __DEFAULT_FN_ATTRS __riscv_nds_ffb_64(uint64_t __a,
50 uint64_t __b) {
51 return __builtin_riscv_nds_ffb_64(__a, __b);
52}
53
54static __inline__ int64_t __DEFAULT_FN_ATTRS
55__riscv_nds_ffzmism_64(uint64_t __a, uint64_t __b) {
56 return __builtin_riscv_nds_ffzmism_64(__a, __b);
57}
58
59static __inline__ int64_t __DEFAULT_FN_ATTRS
60__riscv_nds_ffmism_64(uint64_t __a, uint64_t __b) {
61 return __builtin_riscv_nds_ffmism_64(__a, __b);
62}
63
64static __inline__ int64_t __DEFAULT_FN_ATTRS
65__riscv_nds_flmism_64(uint64_t __a, uint64_t __b) {
66 return __builtin_riscv_nds_flmism_64(__a, __b);
67}
68
69#endif
70
71#endif // defined(__riscv_xandesperf)
72
73#if defined(__riscv_xandesbfhcvt)
74
75static __inline__ float __DEFAULT_FN_ATTRS __riscv_nds_fcvt_s_bf16(__bf16 bf) {
76 return __builtin_riscv_nds_fcvt_s_bf16(bf);
77}
78
79static __inline__ __bf16 __DEFAULT_FN_ATTRS __riscv_nds_fcvt_bf16_s(float sf) {
80 return __builtin_riscv_nds_fcvt_bf16_s(sf);
81}
82
83#endif // defined(__riscv_xandesbfhcvt)
84
85#if defined(__cplusplus)
86}
87#endif
88
89#endif // define __RISCV_NDS_H
lib/include/sifive_vector.h+58-2
...@@ -47,9 +47,9 @@...@@ -47,9 +47,9 @@
47 __riscv_sf_vc_x_se(p27_26, p24_20, p11_7, (uint32_t)rs1, 32, 3, vl)47 __riscv_sf_vc_x_se(p27_26, p24_20, p11_7, (uint32_t)rs1, 32, 3, vl)
4848
49#define __riscv_sf_vc_i_se_u8mf4(p27_26, p24_20, p11_7, simm5, vl) \49#define __riscv_sf_vc_i_se_u8mf4(p27_26, p24_20, p11_7, simm5, vl) \
50 __riscv_sf_vc_i_se(p27_26, p24_20, p11_7, simm5, 8, 7, vl)
51#define __riscv_sf_vc_i_se_u8mf2(p27_26, p24_20, p11_7, simm5, vl) \
52 __riscv_sf_vc_i_se(p27_26, p24_20, p11_7, simm5, 8, 6, vl)50 __riscv_sf_vc_i_se(p27_26, p24_20, p11_7, simm5, 8, 6, vl)
51#define __riscv_sf_vc_i_se_u8mf2(p27_26, p24_20, p11_7, simm5, vl) \
52 __riscv_sf_vc_i_se(p27_26, p24_20, p11_7, simm5, 8, 7, vl)
53#define __riscv_sf_vc_i_se_u8m1(p27_26, p24_20, p11_7, simm5, vl) \53#define __riscv_sf_vc_i_se_u8m1(p27_26, p24_20, p11_7, simm5, vl) \
54 __riscv_sf_vc_i_se(p27_26, p24_20, p11_7, simm5, 8, 0, vl)54 __riscv_sf_vc_i_se(p27_26, p24_20, p11_7, simm5, 8, 0, vl)
55#define __riscv_sf_vc_i_se_u8m2(p27_26, p24_20, p11_7, simm5, vl) \55#define __riscv_sf_vc_i_se_u8m2(p27_26, p24_20, p11_7, simm5, vl) \
...@@ -115,4 +115,60 @@...@@ -115,4 +115,60 @@
115#endif115#endif
116#endif116#endif
117117
118#define __riscv_sf_vsettnt_e8w1(atn) __riscv_sf_vsettnt(atn, 0, 1);
119#define __riscv_sf_vsettnt_e8w2(atn) __riscv_sf_vsettnt(atn, 0, 2);
120#define __riscv_sf_vsettnt_e8w4(atn) __riscv_sf_vsettnt(atn, 0, 3);
121#define __riscv_sf_vsettnt_e16w1(atn) __riscv_sf_vsettnt(atn, 1, 1);
122#define __riscv_sf_vsettnt_e16w2(atn) __riscv_sf_vsettnt(atn, 1, 2);
123#define __riscv_sf_vsettnt_e16w4(atn) __riscv_sf_vsettnt(atn, 1, 3);
124#define __riscv_sf_vsettnt_e32w1(atn) __riscv_sf_vsettnt(atn, 2, 1);
125#define __riscv_sf_vsettnt_e32w2(atn) __riscv_sf_vsettnt(atn, 2, 2);
126#define __riscv_sf_vsettm_e8w1(atm) __riscv_sf_vsettm(atm, 0, 1);
127#define __riscv_sf_vsettm_e8w2(atm) __riscv_sf_vsettm(atm, 0, 2);
128#define __riscv_sf_vsettm_e8w4(atm) __riscv_sf_vsettm(atm, 0, 3);
129#define __riscv_sf_vsettm_e16w1(atm) __riscv_sf_vsettm(atm, 1, 1);
130#define __riscv_sf_vsettm_e16w2(atm) __riscv_sf_vsettm(atm, 1, 2);
131#define __riscv_sf_vsettm_e16w4(atm) __riscv_sf_vsettm(atm, 1, 3);
132#define __riscv_sf_vsettm_e32w1(atm) __riscv_sf_vsettm(atm, 2, 1);
133#define __riscv_sf_vsettm_e32w2(atm) __riscv_sf_vsettm(atm, 2, 2);
134#define __riscv_sf_vsettn_e8w1(atn) __riscv_sf_vsettn(atn, 0, 1);
135#define __riscv_sf_vsettn_e8w2(atn) __riscv_sf_vsettn(atn, 0, 2);
136#define __riscv_sf_vsettn_e8w4(atn) __riscv_sf_vsettn(atn, 0, 3);
137#define __riscv_sf_vsettn_e16w1(atn) __riscv_sf_vsettn(atn, 1, 1);
138#define __riscv_sf_vsettn_e16w2(atn) __riscv_sf_vsettn(atn, 1, 2);
139#define __riscv_sf_vsettn_e16w4(atn) __riscv_sf_vsettn(atn, 1, 3);
140#define __riscv_sf_vsettn_e32w1(atn) __riscv_sf_vsettn(atn, 2, 1);
141#define __riscv_sf_vsettn_e32w2(atn) __riscv_sf_vsettn(atn, 2, 2);
142#define __riscv_sf_vsettk_e8w1(atk) __riscv_sf_vsettk(atk, 0, 1);
143#define __riscv_sf_vsettk_e8w2(atk) __riscv_sf_vsettk(atk, 0, 2);
144#define __riscv_sf_vsettk_e8w4(atk) __riscv_sf_vsettk(atk, 0, 3);
145#define __riscv_sf_vsettk_e16w1(atk) __riscv_sf_vsettk(atk, 1, 1);
146#define __riscv_sf_vsettk_e16w2(atk) __riscv_sf_vsettk(atk, 1, 2);
147#define __riscv_sf_vsettk_e16w4(atk) __riscv_sf_vsettk(atk, 1, 3);
148#define __riscv_sf_vsettk_e32w1(atk) __riscv_sf_vsettk(atk, 2, 1);
149#define __riscv_sf_vsettk_e32w2(atk) __riscv_sf_vsettk(atk, 2, 2);
150#define __riscv_sf_vtzero_t_e8w1(tile, atm, atn) \
151 __riscv_sf_vtzero_t(tile, atm, atn, 3, 1);
152#define __riscv_sf_vtzero_t_e8w2(tile, atm, atn) \
153 __riscv_sf_vtzero_t(tile, atm, atn, 3, 2);
154#define __riscv_sf_vtzero_t_e8w4(tile, atm, atn) \
155 __riscv_sf_vtzero_t(tile, atm, atn, 3, 4);
156#define __riscv_sf_vtzero_t_e16w1(tile, atm, atn) \
157 __riscv_sf_vtzero_t(tile, atm, atn, 4, 1);
158#define __riscv_sf_vtzero_t_e16w2(tile, atm, atn) \
159 __riscv_sf_vtzero_t(tile, atm, atn, 4, 2);
160#define __riscv_sf_vtzero_t_e16w4(tile, atm, atn) \
161 __riscv_sf_vtzero_t(tile, atm, atn, 4, 4);
162#define __riscv_sf_vtzero_t_e32w1(tile, atm, atn) \
163 __riscv_sf_vtzero_t(tile, atm, atn, 5, 1);
164#define __riscv_sf_vtzero_t_e32w2(tile, atm, atn) \
165 __riscv_sf_vtzero_t(tile, atm, atn, 5, 2);
166#if __riscv_v_elen >= 64
167#define __riscv_sf_vsettnt_e64w1(atn) __riscv_sf_vsettnt(atn, 3, 1);
168#define __riscv_sf_vsettm_e64w1(atm) __riscv_sf_vsettm(atm, 3, 1);
169#define __riscv_sf_vsettn_e64w1(atn) __riscv_sf_vsettn(atn, 3, 1);
170#define __riscv_sf_vsettk_e64w1(atk) __riscv_sf_vsettk(atk, 3, 1);
171#define __riscv_sf_vtzero_t_e64w1(tile, atm, atn) \
172 __riscv_sf_vtzero_t(tile, atm, atn, 6, 1);
173#endif
118#endif //_SIFIVE_VECTOR_H_174#endif //_SIFIVE_VECTOR_H_
lib/include/sm4evexintrin.h+2-2
...@@ -14,8 +14,8 @@...@@ -14,8 +14,8 @@
14#define __SM4EVEXINTRIN_H14#define __SM4EVEXINTRIN_H
1515
16#define __DEFAULT_FN_ATTRS512 \16#define __DEFAULT_FN_ATTRS512 \
17 __attribute__((__always_inline__, __nodebug__, \17 __attribute__((__always_inline__, __nodebug__, __target__("sm4,avx10.2"), \
18 __target__("sm4,avx10.2-512"), __min_vector_width__(512)))18 __min_vector_width__(512)))
1919
20static __inline__ __m512i __DEFAULT_FN_ATTRS51220static __inline__ __m512i __DEFAULT_FN_ATTRS512
21_mm512_sm4key4_epi32(__m512i __A, __m512i __B) {21_mm512_sm4key4_epi32(__m512i __A, __m512i __B) {
lib/include/smmintrin.h+77-59
...@@ -17,14 +17,14 @@...@@ -17,14 +17,14 @@
17#include <tmmintrin.h>17#include <tmmintrin.h>
1818
19/* Define the default attributes for the functions in this file. */19/* Define the default attributes for the functions in this file. */
20#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
21#define __DEFAULT_FN_ATTRS \
22 __attribute__((__always_inline__, __nodebug__, \
23 __target__("sse4.1,no-evex512"), __min_vector_width__(128)))
24#else
25#define __DEFAULT_FN_ATTRS \20#define __DEFAULT_FN_ATTRS \
26 __attribute__((__always_inline__, __nodebug__, __target__("sse4.1"), \21 __attribute__((__always_inline__, __nodebug__, __target__("sse4.1"), \
27 __min_vector_width__(128)))22 __min_vector_width__(128)))
23
24#if defined(__cplusplus) && (__cplusplus >= 201103L)
25#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
26#else
27#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
28#endif28#endif
2929
30/* SSE4 Rounding macros. */30/* SSE4 Rounding macros. */
...@@ -439,9 +439,8 @@...@@ -439,9 +439,8 @@
439/// position in the result. When a mask bit is 1, the corresponding 64-bit439/// position in the result. When a mask bit is 1, the corresponding 64-bit
440/// element in operand \a __V2 is copied to the same position in the result.440/// element in operand \a __V2 is copied to the same position in the result.
441/// \returns A 128-bit vector of [2 x double] containing the copied values.441/// \returns A 128-bit vector of [2 x double] containing the copied values.
442static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_blendv_pd(__m128d __V1,442static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
443 __m128d __V2,443_mm_blendv_pd(__m128d __V1, __m128d __V2, __m128d __M) {
444 __m128d __M) {
445 return (__m128d)__builtin_ia32_blendvpd((__v2df)__V1, (__v2df)__V2,444 return (__m128d)__builtin_ia32_blendvpd((__v2df)__V1, (__v2df)__V2,
446 (__v2df)__M);445 (__v2df)__M);
447}446}
...@@ -466,9 +465,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_blendv_pd(__m128d __V1,...@@ -466,9 +465,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_blendv_pd(__m128d __V1,
466/// position in the result. When a mask bit is 1, the corresponding 32-bit465/// position in the result. When a mask bit is 1, the corresponding 32-bit
467/// element in operand \a __V2 is copied to the same position in the result.466/// element in operand \a __V2 is copied to the same position in the result.
468/// \returns A 128-bit vector of [4 x float] containing the copied values.467/// \returns A 128-bit vector of [4 x float] containing the copied values.
469static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_blendv_ps(__m128 __V1,468static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
470 __m128 __V2,469_mm_blendv_ps(__m128 __V1, __m128 __V2, __m128 __M) {
471 __m128 __M) {
472 return (__m128)__builtin_ia32_blendvps((__v4sf)__V1, (__v4sf)__V2,470 return (__m128)__builtin_ia32_blendvps((__v4sf)__V1, (__v4sf)__V2,
473 (__v4sf)__M);471 (__v4sf)__M);
474}472}
...@@ -493,9 +491,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_blendv_ps(__m128 __V1,...@@ -493,9 +491,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_blendv_ps(__m128 __V1,
493/// position in the result. When a mask bit is 1, the corresponding 8-bit491/// position in the result. When a mask bit is 1, the corresponding 8-bit
494/// element in operand \a __V2 is copied to the same position in the result.492/// element in operand \a __V2 is copied to the same position in the result.
495/// \returns A 128-bit vector of [16 x i8] containing the copied values.493/// \returns A 128-bit vector of [16 x i8] containing the copied values.
496static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_blendv_epi8(__m128i __V1,494static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
497 __m128i __V2,495_mm_blendv_epi8(__m128i __V1, __m128i __V2, __m128i __M) {
498 __m128i __M) {
499 return (__m128i)__builtin_ia32_pblendvb128((__v16qi)__V1, (__v16qi)__V2,496 return (__m128i)__builtin_ia32_pblendvb128((__v16qi)__V1, (__v16qi)__V2,
500 (__v16qi)__M);497 (__v16qi)__M);
501}498}
...@@ -542,8 +539,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_blendv_epi8(__m128i __V1,...@@ -542,8 +539,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_blendv_epi8(__m128i __V1,
542/// \param __V2539/// \param __V2
543/// A 128-bit integer vector.540/// A 128-bit integer vector.
544/// \returns A 128-bit integer vector containing the products of both operands.541/// \returns A 128-bit integer vector containing the products of both operands.
545static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi32(__m128i __V1,542static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
546 __m128i __V2) {543_mm_mullo_epi32(__m128i __V1, __m128i __V2) {
547 return (__m128i)((__v4su)__V1 * (__v4su)__V2);544 return (__m128i)((__v4su)__V1 * (__v4su)__V2);
548}545}
549546
...@@ -561,8 +558,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi32(__m128i __V1,...@@ -561,8 +558,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi32(__m128i __V1,
561/// A 128-bit vector of [4 x i32].558/// A 128-bit vector of [4 x i32].
562/// \returns A 128-bit vector of [2 x i64] containing the products of both559/// \returns A 128-bit vector of [2 x i64] containing the products of both
563/// operands.560/// operands.
564static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mul_epi32(__m128i __V1,561static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
565 __m128i __V2) {562_mm_mul_epi32(__m128i __V1, __m128i __V2) {
566 return (__m128i)__builtin_ia32_pmuldq128((__v4si)__V1, (__v4si)__V2);563 return (__m128i)__builtin_ia32_pmuldq128((__v4si)__V1, (__v4si)__V2);
567}564}
568565
...@@ -669,8 +666,8 @@ _mm_stream_load_si128(const void *__V) {...@@ -669,8 +666,8 @@ _mm_stream_load_si128(const void *__V) {
669/// \param __V2666/// \param __V2
670/// A 128-bit vector of [16 x i8]667/// A 128-bit vector of [16 x i8]
671/// \returns A 128-bit vector of [16 x i8] containing the lesser values.668/// \returns A 128-bit vector of [16 x i8] containing the lesser values.
672static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi8(__m128i __V1,669static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
673 __m128i __V2) {670_mm_min_epi8(__m128i __V1, __m128i __V2) {
674 return (__m128i)__builtin_elementwise_min((__v16qs)__V1, (__v16qs)__V2);671 return (__m128i)__builtin_elementwise_min((__v16qs)__V1, (__v16qs)__V2);
675}672}
676673
...@@ -687,8 +684,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi8(__m128i __V1,...@@ -687,8 +684,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi8(__m128i __V1,
687/// \param __V2684/// \param __V2
688/// A 128-bit vector of [16 x i8].685/// A 128-bit vector of [16 x i8].
689/// \returns A 128-bit vector of [16 x i8] containing the greater values.686/// \returns A 128-bit vector of [16 x i8] containing the greater values.
690static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi8(__m128i __V1,687static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
691 __m128i __V2) {688_mm_max_epi8(__m128i __V1, __m128i __V2) {
692 return (__m128i)__builtin_elementwise_max((__v16qs)__V1, (__v16qs)__V2);689 return (__m128i)__builtin_elementwise_max((__v16qs)__V1, (__v16qs)__V2);
693}690}
694691
...@@ -705,8 +702,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi8(__m128i __V1,...@@ -705,8 +702,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi8(__m128i __V1,
705/// \param __V2702/// \param __V2
706/// A 128-bit vector of [8 x u16].703/// A 128-bit vector of [8 x u16].
707/// \returns A 128-bit vector of [8 x u16] containing the lesser values.704/// \returns A 128-bit vector of [8 x u16] containing the lesser values.
708static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu16(__m128i __V1,705static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
709 __m128i __V2) {706_mm_min_epu16(__m128i __V1, __m128i __V2) {
710 return (__m128i)__builtin_elementwise_min((__v8hu)__V1, (__v8hu)__V2);707 return (__m128i)__builtin_elementwise_min((__v8hu)__V1, (__v8hu)__V2);
711}708}
712709
...@@ -723,8 +720,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu16(__m128i __V1,...@@ -723,8 +720,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu16(__m128i __V1,
723/// \param __V2720/// \param __V2
724/// A 128-bit vector of [8 x u16].721/// A 128-bit vector of [8 x u16].
725/// \returns A 128-bit vector of [8 x u16] containing the greater values.722/// \returns A 128-bit vector of [8 x u16] containing the greater values.
726static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu16(__m128i __V1,723static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
727 __m128i __V2) {724_mm_max_epu16(__m128i __V1, __m128i __V2) {
728 return (__m128i)__builtin_elementwise_max((__v8hu)__V1, (__v8hu)__V2);725 return (__m128i)__builtin_elementwise_max((__v8hu)__V1, (__v8hu)__V2);
729}726}
730727
...@@ -741,8 +738,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu16(__m128i __V1,...@@ -741,8 +738,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu16(__m128i __V1,
741/// \param __V2738/// \param __V2
742/// A 128-bit vector of [4 x i32].739/// A 128-bit vector of [4 x i32].
743/// \returns A 128-bit vector of [4 x i32] containing the lesser values.740/// \returns A 128-bit vector of [4 x i32] containing the lesser values.
744static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi32(__m128i __V1,741static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
745 __m128i __V2) {742_mm_min_epi32(__m128i __V1, __m128i __V2) {
746 return (__m128i)__builtin_elementwise_min((__v4si)__V1, (__v4si)__V2);743 return (__m128i)__builtin_elementwise_min((__v4si)__V1, (__v4si)__V2);
747}744}
748745
...@@ -759,8 +756,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi32(__m128i __V1,...@@ -759,8 +756,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi32(__m128i __V1,
759/// \param __V2756/// \param __V2
760/// A 128-bit vector of [4 x i32].757/// A 128-bit vector of [4 x i32].
761/// \returns A 128-bit vector of [4 x i32] containing the greater values.758/// \returns A 128-bit vector of [4 x i32] containing the greater values.
762static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi32(__m128i __V1,759static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
763 __m128i __V2) {760_mm_max_epi32(__m128i __V1, __m128i __V2) {
764 return (__m128i)__builtin_elementwise_max((__v4si)__V1, (__v4si)__V2);761 return (__m128i)__builtin_elementwise_max((__v4si)__V1, (__v4si)__V2);
765}762}
766763
...@@ -777,8 +774,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi32(__m128i __V1,...@@ -777,8 +774,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi32(__m128i __V1,
777/// \param __V2774/// \param __V2
778/// A 128-bit vector of [4 x u32].775/// A 128-bit vector of [4 x u32].
779/// \returns A 128-bit vector of [4 x u32] containing the lesser values.776/// \returns A 128-bit vector of [4 x u32] containing the lesser values.
780static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu32(__m128i __V1,777static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
781 __m128i __V2) {778_mm_min_epu32(__m128i __V1, __m128i __V2) {
782 return (__m128i)__builtin_elementwise_min((__v4su)__V1, (__v4su)__V2);779 return (__m128i)__builtin_elementwise_min((__v4su)__V1, (__v4su)__V2);
783}780}
784781
...@@ -795,8 +792,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu32(__m128i __V1,...@@ -795,8 +792,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu32(__m128i __V1,
795/// \param __V2792/// \param __V2
796/// A 128-bit vector of [4 x u32].793/// A 128-bit vector of [4 x u32].
797/// \returns A 128-bit vector of [4 x u32] containing the greater values.794/// \returns A 128-bit vector of [4 x u32] containing the greater values.
798static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu32(__m128i __V1,795static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
799 __m128i __V2) {796_mm_max_epu32(__m128i __V1, __m128i __V2) {
800 return (__m128i)__builtin_elementwise_max((__v4su)__V1, (__v4su)__V2);797 return (__m128i)__builtin_elementwise_max((__v4su)__V1, (__v4su)__V2);
801}798}
802799
...@@ -1096,8 +1093,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu32(__m128i __V1,...@@ -1096,8 +1093,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu32(__m128i __V1,
1096/// \param __V1093/// \param __V
1097/// A 128-bit integer vector selecting which bits to test in operand \a __M.1094/// A 128-bit integer vector selecting which bits to test in operand \a __M.
1098/// \returns TRUE if the specified bits are all zeros; FALSE otherwise.1095/// \returns TRUE if the specified bits are all zeros; FALSE otherwise.
1099static __inline__ int __DEFAULT_FN_ATTRS _mm_testz_si128(__m128i __M,1096static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
1100 __m128i __V) {1097_mm_testz_si128(__m128i __M, __m128i __V) {
1101 return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V);1098 return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V);
1102}1099}
11031100
...@@ -1113,8 +1110,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_testz_si128(__m128i __M,...@@ -1113,8 +1110,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_testz_si128(__m128i __M,
1113/// \param __V1110/// \param __V
1114/// A 128-bit integer vector selecting which bits to test in operand \a __M.1111/// A 128-bit integer vector selecting which bits to test in operand \a __M.
1115/// \returns TRUE if the specified bits are all ones; FALSE otherwise.1112/// \returns TRUE if the specified bits are all ones; FALSE otherwise.
1116static __inline__ int __DEFAULT_FN_ATTRS _mm_testc_si128(__m128i __M,1113static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
1117 __m128i __V) {1114_mm_testc_si128(__m128i __M, __m128i __V) {
1118 return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V);1115 return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V);
1119}1116}
11201117
...@@ -1131,8 +1128,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_testc_si128(__m128i __M,...@@ -1131,8 +1128,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_testc_si128(__m128i __M,
1131/// A 128-bit integer vector selecting which bits to test in operand \a __M.1128/// A 128-bit integer vector selecting which bits to test in operand \a __M.
1132/// \returns TRUE if the specified bits are neither all zeros nor all ones;1129/// \returns TRUE if the specified bits are neither all zeros nor all ones;
1133/// FALSE otherwise.1130/// FALSE otherwise.
1134static __inline__ int __DEFAULT_FN_ATTRS _mm_testnzc_si128(__m128i __M,1131static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
1135 __m128i __V) {1132_mm_testnzc_si128(__m128i __M, __m128i __V) {
1136 return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V);1133 return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V);
1137}1134}
11381135
...@@ -1205,8 +1202,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_testnzc_si128(__m128i __M,...@@ -1205,8 +1202,8 @@ static __inline__ int __DEFAULT_FN_ATTRS _mm_testnzc_si128(__m128i __M,
1205/// \param __V21202/// \param __V2
1206/// A 128-bit integer vector.1203/// A 128-bit integer vector.
1207/// \returns A 128-bit integer vector containing the comparison results.1204/// \returns A 128-bit integer vector containing the comparison results.
1208static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi64(__m128i __V1,1205static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1209 __m128i __V2) {1206_mm_cmpeq_epi64(__m128i __V1, __m128i __V2) {
1210 return (__m128i)((__v2di)__V1 == (__v2di)__V2);1207 return (__m128i)((__v2di)__V1 == (__v2di)__V2);
1211}1208}
12121209
...@@ -1224,7 +1221,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi64(__m128i __V1,...@@ -1224,7 +1221,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi64(__m128i __V1,
1224/// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are1221/// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are
1225/// sign-extended to 16-bit values.1222/// sign-extended to 16-bit values.
1226/// \returns A 128-bit vector of [8 x i16] containing the sign-extended values.1223/// \returns A 128-bit vector of [8 x i16] containing the sign-extended values.
1227static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi16(__m128i __V) {1224static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1225_mm_cvtepi8_epi16(__m128i __V) {
1228 /* This function always performs a signed extension, but __v16qi is a char1226 /* This function always performs a signed extension, but __v16qi is a char
1229 which may be signed or unsigned, so use __v16qs. */1227 which may be signed or unsigned, so use __v16qs. */
1230 return (__m128i) __builtin_convertvector(1228 return (__m128i) __builtin_convertvector(
...@@ -1246,7 +1244,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi16(__m128i __V) {...@@ -1246,7 +1244,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi16(__m128i __V) {
1246/// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are1244/// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are
1247/// sign-extended to 32-bit values.1245/// sign-extended to 32-bit values.
1248/// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.1246/// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
1249static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi32(__m128i __V) {1247static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1248_mm_cvtepi8_epi32(__m128i __V) {
1250 /* This function always performs a signed extension, but __v16qi is a char1249 /* This function always performs a signed extension, but __v16qi is a char
1251 which may be signed or unsigned, so use __v16qs. */1250 which may be signed or unsigned, so use __v16qs. */
1252 return (__m128i) __builtin_convertvector(1251 return (__m128i) __builtin_convertvector(
...@@ -1266,7 +1265,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi32(__m128i __V) {...@@ -1266,7 +1265,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi32(__m128i __V) {
1266/// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are1265/// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are
1267/// sign-extended to 64-bit values.1266/// sign-extended to 64-bit values.
1268/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.1267/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1269static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi64(__m128i __V) {1268static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1269_mm_cvtepi8_epi64(__m128i __V) {
1270 /* This function always performs a signed extension, but __v16qi is a char1270 /* This function always performs a signed extension, but __v16qi is a char
1271 which may be signed or unsigned, so use __v16qs. */1271 which may be signed or unsigned, so use __v16qs. */
1272 return (__m128i) __builtin_convertvector(1272 return (__m128i) __builtin_convertvector(
...@@ -1286,7 +1286,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi64(__m128i __V) {...@@ -1286,7 +1286,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi64(__m128i __V) {
1286/// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are1286/// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are
1287/// sign-extended to 32-bit values.1287/// sign-extended to 32-bit values.
1288/// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.1288/// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
1289static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi32(__m128i __V) {1289static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1290_mm_cvtepi16_epi32(__m128i __V) {
1290 return (__m128i) __builtin_convertvector(1291 return (__m128i) __builtin_convertvector(
1291 __builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4si);1292 __builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4si);
1292}1293}
...@@ -1304,7 +1305,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi32(__m128i __V) {...@@ -1304,7 +1305,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi32(__m128i __V) {
1304/// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are1305/// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are
1305/// sign-extended to 64-bit values.1306/// sign-extended to 64-bit values.
1306/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.1307/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1307static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi64(__m128i __V) {1308static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1309_mm_cvtepi16_epi64(__m128i __V) {
1308 return (__m128i) __builtin_convertvector(1310 return (__m128i) __builtin_convertvector(
1309 __builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1), __v2di);1311 __builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1), __v2di);
1310}1312}
...@@ -1322,7 +1324,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi64(__m128i __V) {...@@ -1322,7 +1324,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi64(__m128i __V) {
1322/// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are1324/// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are
1323/// sign-extended to 64-bit values.1325/// sign-extended to 64-bit values.
1324/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.1326/// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1325static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi32_epi64(__m128i __V) {1327static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1328_mm_cvtepi32_epi64(__m128i __V) {
1326 return (__m128i) __builtin_convertvector(1329 return (__m128i) __builtin_convertvector(
1327 __builtin_shufflevector((__v4si)__V, (__v4si)__V, 0, 1), __v2di);1330 __builtin_shufflevector((__v4si)__V, (__v4si)__V, 0, 1), __v2di);
1328}1331}
...@@ -1341,7 +1344,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi32_epi64(__m128i __V) {...@@ -1341,7 +1344,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi32_epi64(__m128i __V) {
1341/// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are1344/// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are
1342/// zero-extended to 16-bit values.1345/// zero-extended to 16-bit values.
1343/// \returns A 128-bit vector of [8 x i16] containing the zero-extended values.1346/// \returns A 128-bit vector of [8 x i16] containing the zero-extended values.
1344static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi16(__m128i __V) {1347static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1348_mm_cvtepu8_epi16(__m128i __V) {
1345 return (__m128i) __builtin_convertvector(1349 return (__m128i) __builtin_convertvector(
1346 __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6,1350 __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6,
1347 7),1351 7),
...@@ -1361,7 +1365,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi16(__m128i __V) {...@@ -1361,7 +1365,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi16(__m128i __V) {
1361/// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are1365/// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are
1362/// zero-extended to 32-bit values.1366/// zero-extended to 32-bit values.
1363/// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.1367/// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
1364static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi32(__m128i __V) {1368static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1369_mm_cvtepu8_epi32(__m128i __V) {
1365 return (__m128i) __builtin_convertvector(1370 return (__m128i) __builtin_convertvector(
1366 __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4si);1371 __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4si);
1367}1372}
...@@ -1379,7 +1384,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi32(__m128i __V) {...@@ -1379,7 +1384,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi32(__m128i __V) {
1379/// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are1384/// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are
1380/// zero-extended to 64-bit values.1385/// zero-extended to 64-bit values.
1381/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.1386/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1382static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi64(__m128i __V) {1387static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1388_mm_cvtepu8_epi64(__m128i __V) {
1383 return (__m128i) __builtin_convertvector(1389 return (__m128i) __builtin_convertvector(
1384 __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1), __v2di);1390 __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1), __v2di);
1385}1391}
...@@ -1397,7 +1403,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi64(__m128i __V) {...@@ -1397,7 +1403,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi64(__m128i __V) {
1397/// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are1403/// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are
1398/// zero-extended to 32-bit values.1404/// zero-extended to 32-bit values.
1399/// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.1405/// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
1400static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi32(__m128i __V) {1406static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1407_mm_cvtepu16_epi32(__m128i __V) {
1401 return (__m128i) __builtin_convertvector(1408 return (__m128i) __builtin_convertvector(
1402 __builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4si);1409 __builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4si);
1403}1410}
...@@ -1415,7 +1422,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi32(__m128i __V) {...@@ -1415,7 +1422,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi32(__m128i __V) {
1415/// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are1422/// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are
1416/// zero-extended to 64-bit values.1423/// zero-extended to 64-bit values.
1417/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.1424/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1418static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi64(__m128i __V) {1425static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1426_mm_cvtepu16_epi64(__m128i __V) {
1419 return (__m128i) __builtin_convertvector(1427 return (__m128i) __builtin_convertvector(
1420 __builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1), __v2di);1428 __builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1), __v2di);
1421}1429}
...@@ -1433,7 +1441,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi64(__m128i __V) {...@@ -1433,7 +1441,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi64(__m128i __V) {
1433/// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are1441/// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are
1434/// zero-extended to 64-bit values.1442/// zero-extended to 64-bit values.
1435/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.1443/// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1436static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu32_epi64(__m128i __V) {1444static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1445_mm_cvtepu32_epi64(__m128i __V) {
1437 return (__m128i) __builtin_convertvector(1446 return (__m128i) __builtin_convertvector(
1438 __builtin_shufflevector((__v4su)__V, (__v4su)__V, 0, 1), __v2di);1447 __builtin_shufflevector((__v4su)__V, (__v4su)__V, 0, 1), __v2di);
1439}1448}
...@@ -1457,8 +1466,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu32_epi64(__m128i __V) {...@@ -1457,8 +1466,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu32_epi64(__m128i __V) {
1457/// A 128-bit vector of [4 x i32]. The converted [4 x i16] values are1466/// A 128-bit vector of [4 x i32]. The converted [4 x i16] values are
1458/// written to the higher 64 bits of the result.1467/// written to the higher 64 bits of the result.
1459/// \returns A 128-bit vector of [8 x i16] containing the converted values.1468/// \returns A 128-bit vector of [8 x i16] containing the converted values.
1460static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi32(__m128i __V1,1469static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1461 __m128i __V2) {1470_mm_packus_epi32(__m128i __V1, __m128i __V2) {
1462 return (__m128i)__builtin_ia32_packusdw128((__v4si)__V1, (__v4si)__V2);1471 return (__m128i)__builtin_ia32_packusdw128((__v4si)__V1, (__v4si)__V2);
1463}1472}
14641473
...@@ -1515,7 +1524,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi32(__m128i __V1,...@@ -1515,7 +1524,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi32(__m128i __V1,
1515/// \returns A 128-bit value where bits [15:0] contain the minimum value found1524/// \returns A 128-bit value where bits [15:0] contain the minimum value found
1516/// in parameter \a __V, bits [18:16] contain the index of the minimum value1525/// in parameter \a __V, bits [18:16] contain the index of the minimum value
1517/// and the remaining bits are set to 0.1526/// and the remaining bits are set to 0.
1518static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) {1527static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1528_mm_minpos_epu16(__m128i __V) {
1519 return (__m128i)__builtin_ia32_phminposuw128((__v8hi)__V);1529 return (__m128i)__builtin_ia32_phminposuw128((__v8hi)__V);
1520}1530}
15211531
...@@ -1525,9 +1535,16 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) {...@@ -1525,9 +1535,16 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) {
1525 so we'll do the same. */1535 so we'll do the same. */
15261536
1527#undef __DEFAULT_FN_ATTRS1537#undef __DEFAULT_FN_ATTRS
1538#undef __DEFAULT_FN_ATTRS_CONSTEXPR
1528#define __DEFAULT_FN_ATTRS \1539#define __DEFAULT_FN_ATTRS \
1529 __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))1540 __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
15301541
1542#if defined(__cplusplus) && (__cplusplus >= 201103L)
1543#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
1544#else
1545#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
1546#endif
1547
1531/* These specify the type of data that we're comparing. */1548/* These specify the type of data that we're comparing. */
1532#define _SIDD_UBYTE_OPS 0x001549#define _SIDD_UBYTE_OPS 0x00
1533#define _SIDD_UWORD_OPS 0x011550#define _SIDD_UWORD_OPS 0x01
...@@ -2320,12 +2337,13 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) {...@@ -2320,12 +2337,13 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) {
2320/// \param __V22337/// \param __V2
2321/// A 128-bit integer vector.2338/// A 128-bit integer vector.
2322/// \returns A 128-bit integer vector containing the comparison results.2339/// \returns A 128-bit integer vector containing the comparison results.
2323static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi64(__m128i __V1,2340static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2324 __m128i __V2) {2341_mm_cmpgt_epi64(__m128i __V1, __m128i __V2) {
2325 return (__m128i)((__v2di)__V1 > (__v2di)__V2);2342 return (__m128i)((__v2di)__V1 > (__v2di)__V2);
2326}2343}
23272344
2328#undef __DEFAULT_FN_ATTRS2345#undef __DEFAULT_FN_ATTRS
2346#undef __DEFAULT_FN_ATTRS_CONSTEXPR
23292347
2330#include <popcntintrin.h>2348#include <popcntintrin.h>
23312349
lib/include/spirvintrin.h created+194
...@@ -0,0 +1,194 @@
1//===-- spirvintrin.h - SPIR-V intrinsic 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#ifndef __SPIRVINTRIN_H
10#define __SPIRVINTRIN_H
11
12#ifndef __SPIRV__
13#error "This file is intended for SPIR-V targets or offloading to SPIR-V"
14#endif
15
16#ifndef __GPUINTRIN_H
17#error "Never use <spirvintrin.h> directly; include <gpuintrin.h> instead"
18#endif
19
20_Pragma("omp begin declare target device_type(nohost)");
21_Pragma("omp begin declare variant match(device = {arch(spirv64)})");
22
23// Type aliases to the address spaces used by the SPIR-V backend.
24#define __gpu_private __attribute__((address_space(0)))
25#define __gpu_constant __attribute__((address_space(2)))
26#define __gpu_local __attribute__((address_space(3)))
27#define __gpu_global __attribute__((address_space(1)))
28#define __gpu_generic __attribute__((address_space(4)))
29
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.
34_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_x(void) {
35 return __builtin_spirv_num_workgroups(0);
36}
37
38// Returns the number of workgroups in the 'y' dimension of the grid.
39_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_y(void) {
40 return __builtin_spirv_num_workgroups(1);
41}
42
43// Returns the number of workgroups in the 'z' dimension of the grid.
44_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_z(void) {
45 return __builtin_spirv_num_workgroups(2);
46}
47
48// Returns the 'x' dimension of the current workgroup's id.
49_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_x(void) {
50 return __builtin_spirv_workgroup_id(0);
51}
52
53// Returns the 'y' dimension of the current workgroup's id.
54_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_y(void) {
55 return __builtin_spirv_workgroup_id(1);
56}
57
58// Returns the 'z' dimension of the current workgroup's id.
59_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_z(void) {
60 return __builtin_spirv_workgroup_id(2);
61}
62
63// Returns the number of workitems in the 'x' dimension.
64_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_x(void) {
65 return __builtin_spirv_workgroup_size(0);
66}
67
68// Returns the number of workitems in the 'y' dimension.
69_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_y(void) {
70 return __builtin_spirv_workgroup_size(1);
71}
72
73// Returns the number of workitems in the 'z' dimension.
74_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_z(void) {
75 return __builtin_spirv_workgroup_size(2);
76}
77
78// Returns the 'x' dimension id of the workitem in the current workgroup.
79_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_x(void) {
80 return __builtin_spirv_local_invocation_id(0);
81}
82
83// Returns the 'y' dimension id of the workitem in the current workgroup.
84_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_y(void) {
85 return __builtin_spirv_local_invocation_id(1);
86}
87
88// Returns the 'z' dimension id of the workitem in the current workgroup.
89_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_z(void) {
90 return __builtin_spirv_local_invocation_id(2);
91}
92
93// Returns the size of an wavefront, either 32 or 64 depending on hardware
94// and compilation options.
95_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_lanes(void) {
96 return __builtin_spirv_subgroup_size();
97}
98
99// Returns the id of the thread inside of an wavefront executing together.
100_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_lane_id(void) {
101 return __builtin_spirv_subgroup_local_invocation_id();
102}
103
104// Returns the bit-mask of active threads in the current wavefront. This
105// implementation is incorrect if the target uses more than 64 lanes.
106_DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_lane_mask(void) {
107 uint32_t [[clang::ext_vector_type(4)]] __mask =
108 __builtin_spirv_subgroup_ballot(1);
109 return __builtin_bit_cast(uint64_t,
110 __builtin_shufflevector(__mask, __mask, 0, 1));
111}
112
113// Copies the value from the first active thread in the wavefront to the rest.
114_DEFAULT_FN_ATTRS static __inline__ uint32_t
115__gpu_read_first_lane_u32(uint64_t __lane_mask, uint32_t __x) {
116 return __builtin_spirv_subgroup_shuffle(__x,
117 __builtin_ctzg(__gpu_lane_mask()));
118}
119
120// Returns a bitmask of threads in the current lane for which \p x is true. This
121// implementation is incorrect if the target uses more than 64 lanes.
122_DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_ballot(uint64_t __lane_mask,
123 bool __x) {
124 // The lane_mask & gives the nvptx semantics when lane_mask is a subset of
125 // the active threads.
126 uint32_t [[clang::ext_vector_type(4)]] __mask =
127 __builtin_spirv_subgroup_ballot(__x);
128 return __lane_mask & __builtin_bit_cast(uint64_t, __builtin_shufflevector(
129 __mask, __mask, 0, 1));
130}
131
132// Waits for all the threads in the block to converge and issues a fence.
133_DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_threads(void) {
134 __builtin_spirv_group_barrier();
135}
136
137// Wait for all threads in the wavefront to converge, this is a noop on SPIR-V.
138_DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_lane(uint64_t __lane_mask) {
139}
140
141// Shuffles the the lanes inside the wavefront according to the given index.
142_DEFAULT_FN_ATTRS static __inline__ uint32_t
143__gpu_shuffle_idx_u32(uint64_t __lane_mask, uint32_t __idx, uint32_t __x,
144 uint32_t __width) {
145 uint32_t __lane = __idx + (__gpu_lane_id() & ~(__width - 1));
146 return __builtin_spirv_subgroup_shuffle(__x, __lane);
147}
148
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.
174_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(void *ptr) {
175 return 0;
176}
177
178// SPIR-V does not expose this, always return false.
179_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(void *ptr) {
180 return 0;
181}
182
183// SPIR-V only supports 'OpTerminateInvocation' in fragment shaders.
184_DEFAULT_FN_ATTRS [[noreturn]] static __inline__ void __gpu_exit(void) {
185 __builtin_trap();
186}
187
188// This is a no-op as SPIR-V does not support it.
189_DEFAULT_FN_ATTRS static __inline__ void __gpu_thread_suspend(void) {}
190
191_Pragma("omp end declare variant");
192_Pragma("omp end declare target");
193
194#endif // __SPIRVINTRIN_H
lib/include/stddefer.h created+19
...@@ -0,0 +1,19 @@
1/*===---- stddefer.h - Standard header for 'defer' -------------------------===
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_STDDEFER_H
11#define __CLANG_STDDEFER_H
12
13/* Provide 'defer' if '_Defer' is supported. */
14#ifdef __STDC_DEFER_TS25755__
15#define __STDC_VERSION_STDDEFER_H__ 202602L
16#define defer _Defer
17#endif
18
19#endif /* __CLANG_STDDEFER_H */
lib/include/tmmintrin.h+116-147
...@@ -17,21 +17,21 @@...@@ -17,21 +17,21 @@
17#include <pmmintrin.h>17#include <pmmintrin.h>
1818
19/* Define the default attributes for the functions in this file. */19/* Define the default attributes for the functions in this file. */
20#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
21#define __DEFAULT_FN_ATTRS \
22 __attribute__((__always_inline__, __nodebug__, \
23 __target__("ssse3,no-evex512"), __min_vector_width__(128)))
24#else
25#define __DEFAULT_FN_ATTRS \20#define __DEFAULT_FN_ATTRS \
26 __attribute__((__always_inline__, __nodebug__, __target__("ssse3"), \21 __attribute__((__always_inline__, __nodebug__, __target__("ssse3"), \
27 __min_vector_width__(128)))22 __min_vector_width__(128)))
28#endif
2923
30#define __trunc64(x) \24#define __trunc64(x) \
31 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)25 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
32#define __anyext128(x) \26#define __zext128(x) \
33 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \27 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
34 1, -1, -1)28 1, 2, 3)
29
30#if defined(__cplusplus) && (__cplusplus >= 201103L)
31#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
32#else
33#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
34#endif
3535
36/// Computes the absolute value of each of the packed 8-bit signed36/// Computes the absolute value of each of the packed 8-bit signed
37/// integers in the source operand and stores the 8-bit unsigned integer37/// integers in the source operand and stores the 8-bit unsigned integer
...@@ -45,9 +45,7 @@...@@ -45,9 +45,7 @@
45/// A 64-bit vector of [8 x i8].45/// A 64-bit vector of [8 x i8].
46/// \returns A 64-bit integer vector containing the absolute values of the46/// \returns A 64-bit integer vector containing the absolute values of the
47/// elements in the operand.47/// elements in the operand.
48static __inline__ __m64 __DEFAULT_FN_ATTRS48static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_abs_pi8(__m64 __a) {
49_mm_abs_pi8(__m64 __a)
50{
51 return (__m64)__builtin_elementwise_abs((__v8qs)__a);49 return (__m64)__builtin_elementwise_abs((__v8qs)__a);
52}50}
5351
...@@ -63,10 +61,9 @@ _mm_abs_pi8(__m64 __a)...@@ -63,10 +61,9 @@ _mm_abs_pi8(__m64 __a)
63/// A 128-bit vector of [16 x i8].61/// A 128-bit vector of [16 x i8].
64/// \returns A 128-bit integer vector containing the absolute values of the62/// \returns A 128-bit integer vector containing the absolute values of the
65/// elements in the operand.63/// elements in the operand.
66static __inline__ __m128i __DEFAULT_FN_ATTRS64static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
67_mm_abs_epi8(__m128i __a)65_mm_abs_epi8(__m128i __a) {
68{66 return (__m128i)__builtin_elementwise_abs((__v16qs)__a);
69 return (__m128i)__builtin_elementwise_abs((__v16qs)__a);
70}67}
7168
72/// Computes the absolute value of each of the packed 16-bit signed69/// Computes the absolute value of each of the packed 16-bit signed
...@@ -81,10 +78,8 @@ _mm_abs_epi8(__m128i __a)...@@ -81,10 +78,8 @@ _mm_abs_epi8(__m128i __a)
81/// A 64-bit vector of [4 x i16].78/// A 64-bit vector of [4 x i16].
82/// \returns A 64-bit integer vector containing the absolute values of the79/// \returns A 64-bit integer vector containing the absolute values of the
83/// elements in the operand.80/// elements in the operand.
84static __inline__ __m64 __DEFAULT_FN_ATTRS81static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_abs_pi16(__m64 __a) {
85_mm_abs_pi16(__m64 __a)82 return (__m64)__builtin_elementwise_abs((__v4hi)__a);
86{
87 return (__m64)__builtin_elementwise_abs((__v4hi)__a);
88}83}
8984
90/// Computes the absolute value of each of the packed 16-bit signed85/// Computes the absolute value of each of the packed 16-bit signed
...@@ -99,10 +94,9 @@ _mm_abs_pi16(__m64 __a)...@@ -99,10 +94,9 @@ _mm_abs_pi16(__m64 __a)
99/// A 128-bit vector of [8 x i16].94/// A 128-bit vector of [8 x i16].
100/// \returns A 128-bit integer vector containing the absolute values of the95/// \returns A 128-bit integer vector containing the absolute values of the
101/// elements in the operand.96/// elements in the operand.
102static __inline__ __m128i __DEFAULT_FN_ATTRS97static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
103_mm_abs_epi16(__m128i __a)98_mm_abs_epi16(__m128i __a) {
104{99 return (__m128i)__builtin_elementwise_abs((__v8hi)__a);
105 return (__m128i)__builtin_elementwise_abs((__v8hi)__a);
106}100}
107101
108/// Computes the absolute value of each of the packed 32-bit signed102/// Computes the absolute value of each of the packed 32-bit signed
...@@ -117,10 +111,8 @@ _mm_abs_epi16(__m128i __a)...@@ -117,10 +111,8 @@ _mm_abs_epi16(__m128i __a)
117/// A 64-bit vector of [2 x i32].111/// A 64-bit vector of [2 x i32].
118/// \returns A 64-bit integer vector containing the absolute values of the112/// \returns A 64-bit integer vector containing the absolute values of the
119/// elements in the operand.113/// elements in the operand.
120static __inline__ __m64 __DEFAULT_FN_ATTRS114static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_abs_pi32(__m64 __a) {
121_mm_abs_pi32(__m64 __a)115 return (__m64)__builtin_elementwise_abs((__v2si)__a);
122{
123 return (__m64)__builtin_elementwise_abs((__v2si)__a);
124}116}
125117
126/// Computes the absolute value of each of the packed 32-bit signed118/// Computes the absolute value of each of the packed 32-bit signed
...@@ -135,10 +127,9 @@ _mm_abs_pi32(__m64 __a)...@@ -135,10 +127,9 @@ _mm_abs_pi32(__m64 __a)
135/// A 128-bit vector of [4 x i32].127/// A 128-bit vector of [4 x i32].
136/// \returns A 128-bit integer vector containing the absolute values of the128/// \returns A 128-bit integer vector containing the absolute values of the
137/// elements in the operand.129/// elements in the operand.
138static __inline__ __m128i __DEFAULT_FN_ATTRS130static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
139_mm_abs_epi32(__m128i __a)131_mm_abs_epi32(__m128i __a) {
140{132 return (__m128i)__builtin_elementwise_abs((__v4si)__a);
141 return (__m128i)__builtin_elementwise_abs((__v4si)__a);
142}133}
143134
144/// Concatenates the two 128-bit integer vector operands, and135/// Concatenates the two 128-bit integer vector operands, and
...@@ -184,11 +175,12 @@ _mm_abs_epi32(__m128i __a)...@@ -184,11 +175,12 @@ _mm_abs_epi32(__m128i __a)
184/// An immediate operand specifying how many bytes to right-shift the result.175/// An immediate operand specifying how many bytes to right-shift the result.
185/// \returns A 64-bit integer vector containing the concatenated right-shifted176/// \returns A 64-bit integer vector containing the concatenated right-shifted
186/// value.177/// value.
187#define _mm_alignr_pi8(a, b, n) \178#define _mm_alignr_pi8(a, b, n) \
188 ((__m64)__builtin_shufflevector( \179 ((__m64)__builtin_shufflevector( \
189 __builtin_ia32_psrldqi128_byteshift( \180 (__v2di)__builtin_ia32_psrldqi128_byteshift( \
190 __builtin_shufflevector((__v1di)(a), (__v1di)(b), 1, 0), \181 (__v16qi)__builtin_shufflevector((__v1di)(a), (__v1di)(b), 1, 0), \
191 (n)), __extension__ (__v2di){}, 0))182 (n)), \
183 __extension__(__v2di){}, 0))
192184
193/// Horizontally adds the adjacent pairs of values contained in 2 packed185/// Horizontally adds the adjacent pairs of values contained in 2 packed
194/// 128-bit vectors of [8 x i16].186/// 128-bit vectors of [8 x i16].
...@@ -207,10 +199,9 @@ _mm_abs_epi32(__m128i __a)...@@ -207,10 +199,9 @@ _mm_abs_epi32(__m128i __a)
207/// destination.199/// destination.
208/// \returns A 128-bit vector of [8 x i16] containing the horizontal sums of200/// \returns A 128-bit vector of [8 x i16] containing the horizontal sums of
209/// both operands.201/// both operands.
210static __inline__ __m128i __DEFAULT_FN_ATTRS202static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
211_mm_hadd_epi16(__m128i __a, __m128i __b)203_mm_hadd_epi16(__m128i __a, __m128i __b) {
212{204 return (__m128i)__builtin_ia32_phaddw128((__v8hi)__a, (__v8hi)__b);
213 return (__m128i)__builtin_ia32_phaddw128((__v8hi)__a, (__v8hi)__b);
214}205}
215206
216/// Horizontally adds the adjacent pairs of values contained in 2 packed207/// Horizontally adds the adjacent pairs of values contained in 2 packed
...@@ -230,10 +221,9 @@ _mm_hadd_epi16(__m128i __a, __m128i __b)...@@ -230,10 +221,9 @@ _mm_hadd_epi16(__m128i __a, __m128i __b)
230/// destination.221/// destination.
231/// \returns A 128-bit vector of [4 x i32] containing the horizontal sums of222/// \returns A 128-bit vector of [4 x i32] containing the horizontal sums of
232/// both operands.223/// both operands.
233static __inline__ __m128i __DEFAULT_FN_ATTRS224static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
234_mm_hadd_epi32(__m128i __a, __m128i __b)225_mm_hadd_epi32(__m128i __a, __m128i __b) {
235{226 return (__m128i)__builtin_ia32_phaddd128((__v4si)__a, (__v4si)__b);
236 return (__m128i)__builtin_ia32_phaddd128((__v4si)__a, (__v4si)__b);
237}227}
238228
239/// Horizontally adds the adjacent pairs of values contained in 2 packed229/// Horizontally adds the adjacent pairs of values contained in 2 packed
...@@ -253,11 +243,10 @@ _mm_hadd_epi32(__m128i __a, __m128i __b)...@@ -253,11 +243,10 @@ _mm_hadd_epi32(__m128i __a, __m128i __b)
253/// destination.243/// destination.
254/// \returns A 64-bit vector of [4 x i16] containing the horizontal sums of both244/// \returns A 64-bit vector of [4 x i16] containing the horizontal sums of both
255/// operands.245/// operands.
256static __inline__ __m64 __DEFAULT_FN_ATTRS246static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hadd_pi16(__m64 __a,
257_mm_hadd_pi16(__m64 __a, __m64 __b)247 __m64 __b) {
258{248 return __trunc64(__builtin_ia32_phaddw128(
259 return __trunc64(__builtin_ia32_phaddw128(249 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
260 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
261}250}
262251
263/// Horizontally adds the adjacent pairs of values contained in 2 packed252/// Horizontally adds the adjacent pairs of values contained in 2 packed
...@@ -277,11 +266,10 @@ _mm_hadd_pi16(__m64 __a, __m64 __b)...@@ -277,11 +266,10 @@ _mm_hadd_pi16(__m64 __a, __m64 __b)
277/// destination.266/// destination.
278/// \returns A 64-bit vector of [2 x i32] containing the horizontal sums of both267/// \returns A 64-bit vector of [2 x i32] containing the horizontal sums of both
279/// operands.268/// operands.
280static __inline__ __m64 __DEFAULT_FN_ATTRS269static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hadd_pi32(__m64 __a,
281_mm_hadd_pi32(__m64 __a, __m64 __b)270 __m64 __b) {
282{271 return __trunc64(__builtin_ia32_phaddd128(
283 return __trunc64(__builtin_ia32_phaddd128(272 (__v4si)__builtin_shufflevector(__a, __b, 0, 1), (__v4si){}));
284 (__v4si)__builtin_shufflevector(__a, __b, 0, 1), (__v4si){}));
285}273}
286274
287/// Horizontally adds, with saturation, the adjacent pairs of values contained275/// Horizontally adds, with saturation, the adjacent pairs of values contained
...@@ -304,10 +292,9 @@ _mm_hadd_pi32(__m64 __a, __m64 __b)...@@ -304,10 +292,9 @@ _mm_hadd_pi32(__m64 __a, __m64 __b)
304/// destination.292/// destination.
305/// \returns A 128-bit vector of [8 x i16] containing the horizontal saturated293/// \returns A 128-bit vector of [8 x i16] containing the horizontal saturated
306/// sums of both operands.294/// sums of both operands.
307static __inline__ __m128i __DEFAULT_FN_ATTRS295static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
308_mm_hadds_epi16(__m128i __a, __m128i __b)296_mm_hadds_epi16(__m128i __a, __m128i __b) {
309{297 return (__m128i)__builtin_ia32_phaddsw128((__v8hi)__a, (__v8hi)__b);
310 return (__m128i)__builtin_ia32_phaddsw128((__v8hi)__a, (__v8hi)__b);
311}298}
312299
313/// Horizontally adds, with saturation, the adjacent pairs of values contained300/// Horizontally adds, with saturation, the adjacent pairs of values contained
...@@ -330,11 +317,10 @@ _mm_hadds_epi16(__m128i __a, __m128i __b)...@@ -330,11 +317,10 @@ _mm_hadds_epi16(__m128i __a, __m128i __b)
330/// destination.317/// destination.
331/// \returns A 64-bit vector of [4 x i16] containing the horizontal saturated318/// \returns A 64-bit vector of [4 x i16] containing the horizontal saturated
332/// sums of both operands.319/// sums of both operands.
333static __inline__ __m64 __DEFAULT_FN_ATTRS320static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hadds_pi16(__m64 __a,
334_mm_hadds_pi16(__m64 __a, __m64 __b)321 __m64 __b) {
335{322 return __trunc64(__builtin_ia32_phaddsw128(
336 return __trunc64(__builtin_ia32_phaddsw128(323 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
337 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
338}324}
339325
340/// Horizontally subtracts the adjacent pairs of values contained in 2326/// Horizontally subtracts the adjacent pairs of values contained in 2
...@@ -354,10 +340,9 @@ _mm_hadds_pi16(__m64 __a, __m64 __b)...@@ -354,10 +340,9 @@ _mm_hadds_pi16(__m64 __a, __m64 __b)
354/// the destination.340/// the destination.
355/// \returns A 128-bit vector of [8 x i16] containing the horizontal differences341/// \returns A 128-bit vector of [8 x i16] containing the horizontal differences
356/// of both operands.342/// of both operands.
357static __inline__ __m128i __DEFAULT_FN_ATTRS343static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
358_mm_hsub_epi16(__m128i __a, __m128i __b)344_mm_hsub_epi16(__m128i __a, __m128i __b) {
359{345 return (__m128i)__builtin_ia32_phsubw128((__v8hi)__a, (__v8hi)__b);
360 return (__m128i)__builtin_ia32_phsubw128((__v8hi)__a, (__v8hi)__b);
361}346}
362347
363/// Horizontally subtracts the adjacent pairs of values contained in 2348/// Horizontally subtracts the adjacent pairs of values contained in 2
...@@ -377,10 +362,9 @@ _mm_hsub_epi16(__m128i __a, __m128i __b)...@@ -377,10 +362,9 @@ _mm_hsub_epi16(__m128i __a, __m128i __b)
377/// the destination.362/// the destination.
378/// \returns A 128-bit vector of [4 x i32] containing the horizontal differences363/// \returns A 128-bit vector of [4 x i32] containing the horizontal differences
379/// of both operands.364/// of both operands.
380static __inline__ __m128i __DEFAULT_FN_ATTRS365static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
381_mm_hsub_epi32(__m128i __a, __m128i __b)366_mm_hsub_epi32(__m128i __a, __m128i __b) {
382{367 return (__m128i)__builtin_ia32_phsubd128((__v4si)__a, (__v4si)__b);
383 return (__m128i)__builtin_ia32_phsubd128((__v4si)__a, (__v4si)__b);
384}368}
385369
386/// Horizontally subtracts the adjacent pairs of values contained in 2370/// Horizontally subtracts the adjacent pairs of values contained in 2
...@@ -400,11 +384,10 @@ _mm_hsub_epi32(__m128i __a, __m128i __b)...@@ -400,11 +384,10 @@ _mm_hsub_epi32(__m128i __a, __m128i __b)
400/// the destination.384/// the destination.
401/// \returns A 64-bit vector of [4 x i16] containing the horizontal differences385/// \returns A 64-bit vector of [4 x i16] containing the horizontal differences
402/// of both operands.386/// of both operands.
403static __inline__ __m64 __DEFAULT_FN_ATTRS387static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hsub_pi16(__m64 __a,
404_mm_hsub_pi16(__m64 __a, __m64 __b)388 __m64 __b) {
405{389 return __trunc64(__builtin_ia32_phsubw128(
406 return __trunc64(__builtin_ia32_phsubw128(390 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
407 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
408}391}
409392
410/// Horizontally subtracts the adjacent pairs of values contained in 2393/// Horizontally subtracts the adjacent pairs of values contained in 2
...@@ -424,11 +407,10 @@ _mm_hsub_pi16(__m64 __a, __m64 __b)...@@ -424,11 +407,10 @@ _mm_hsub_pi16(__m64 __a, __m64 __b)
424/// the destination.407/// the destination.
425/// \returns A 64-bit vector of [2 x i32] containing the horizontal differences408/// \returns A 64-bit vector of [2 x i32] containing the horizontal differences
426/// of both operands.409/// of both operands.
427static __inline__ __m64 __DEFAULT_FN_ATTRS410static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hsub_pi32(__m64 __a,
428_mm_hsub_pi32(__m64 __a, __m64 __b)411 __m64 __b) {
429{412 return __trunc64(__builtin_ia32_phsubd128(
430 return __trunc64(__builtin_ia32_phsubd128(413 (__v4si)__builtin_shufflevector(__a, __b, 0, 1), (__v4si){}));
431 (__v4si)__builtin_shufflevector(__a, __b, 0, 1), (__v4si){}));
432}414}
433415
434/// Horizontally subtracts, with saturation, the adjacent pairs of values416/// Horizontally subtracts, with saturation, the adjacent pairs of values
...@@ -451,10 +433,9 @@ _mm_hsub_pi32(__m64 __a, __m64 __b)...@@ -451,10 +433,9 @@ _mm_hsub_pi32(__m64 __a, __m64 __b)
451/// the destination.433/// the destination.
452/// \returns A 128-bit vector of [8 x i16] containing the horizontal saturated434/// \returns A 128-bit vector of [8 x i16] containing the horizontal saturated
453/// differences of both operands.435/// differences of both operands.
454static __inline__ __m128i __DEFAULT_FN_ATTRS436static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
455_mm_hsubs_epi16(__m128i __a, __m128i __b)437_mm_hsubs_epi16(__m128i __a, __m128i __b) {
456{438 return (__m128i)__builtin_ia32_phsubsw128((__v8hi)__a, (__v8hi)__b);
457 return (__m128i)__builtin_ia32_phsubsw128((__v8hi)__a, (__v8hi)__b);
458}439}
459440
460/// Horizontally subtracts, with saturation, the adjacent pairs of values441/// Horizontally subtracts, with saturation, the adjacent pairs of values
...@@ -477,11 +458,10 @@ _mm_hsubs_epi16(__m128i __a, __m128i __b)...@@ -477,11 +458,10 @@ _mm_hsubs_epi16(__m128i __a, __m128i __b)
477/// the destination.458/// the destination.
478/// \returns A 64-bit vector of [4 x i16] containing the horizontal saturated459/// \returns A 64-bit vector of [4 x i16] containing the horizontal saturated
479/// differences of both operands.460/// differences of both operands.
480static __inline__ __m64 __DEFAULT_FN_ATTRS461static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_hsubs_pi16(__m64 __a,
481_mm_hsubs_pi16(__m64 __a, __m64 __b)462 __m64 __b) {
482{463 return __trunc64(__builtin_ia32_phsubsw128(
483 return __trunc64(__builtin_ia32_phsubsw128(464 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
484 (__v8hi)__builtin_shufflevector(__a, __b, 0, 1), (__v8hi){}));
485}465}
486466
487/// Multiplies corresponding pairs of packed 8-bit unsigned integer467/// Multiplies corresponding pairs of packed 8-bit unsigned integer
...@@ -512,10 +492,9 @@ _mm_hsubs_pi16(__m64 __a, __m64 __b)...@@ -512,10 +492,9 @@ _mm_hsubs_pi16(__m64 __a, __m64 __b)
512/// \a R5 := (\a __a10 * \a __b10) + (\a __a11 * \a __b11) \n492/// \a R5 := (\a __a10 * \a __b10) + (\a __a11 * \a __b11) \n
513/// \a R6 := (\a __a12 * \a __b12) + (\a __a13 * \a __b13) \n493/// \a R6 := (\a __a12 * \a __b12) + (\a __a13 * \a __b13) \n
514/// \a R7 := (\a __a14 * \a __b14) + (\a __a15 * \a __b15)494/// \a R7 := (\a __a14 * \a __b14) + (\a __a15 * \a __b15)
515static __inline__ __m128i __DEFAULT_FN_ATTRS495static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
516_mm_maddubs_epi16(__m128i __a, __m128i __b)496_mm_maddubs_epi16(__m128i __a, __m128i __b) {
517{497 return (__m128i)__builtin_ia32_pmaddubsw128((__v16qi)__a, (__v16qi)__b);
518 return (__m128i)__builtin_ia32_pmaddubsw128((__v16qi)__a, (__v16qi)__b);
519}498}
520499
521/// Multiplies corresponding pairs of packed 8-bit unsigned integer500/// Multiplies corresponding pairs of packed 8-bit unsigned integer
...@@ -542,11 +521,10 @@ _mm_maddubs_epi16(__m128i __a, __m128i __b)...@@ -542,11 +521,10 @@ _mm_maddubs_epi16(__m128i __a, __m128i __b)
542/// \a R1 := (\a __a2 * \a __b2) + (\a __a3 * \a __b3) \n521/// \a R1 := (\a __a2 * \a __b2) + (\a __a3 * \a __b3) \n
543/// \a R2 := (\a __a4 * \a __b4) + (\a __a5 * \a __b5) \n522/// \a R2 := (\a __a4 * \a __b4) + (\a __a5 * \a __b5) \n
544/// \a R3 := (\a __a6 * \a __b6) + (\a __a7 * \a __b7)523/// \a R3 := (\a __a6 * \a __b6) + (\a __a7 * \a __b7)
545static __inline__ __m64 __DEFAULT_FN_ATTRS524static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR
546_mm_maddubs_pi16(__m64 __a, __m64 __b)525_mm_maddubs_pi16(__m64 __a, __m64 __b) {
547{526 return __trunc64(__builtin_ia32_pmaddubsw128((__v16qi)__zext128(__a),
548 return __trunc64(__builtin_ia32_pmaddubsw128((__v16qi)__anyext128(__a),527 (__v16qi)__zext128(__b)));
549 (__v16qi)__anyext128(__b)));
550}528}
551529
552/// Multiplies packed 16-bit signed integer values, truncates the 32-bit530/// Multiplies packed 16-bit signed integer values, truncates the 32-bit
...@@ -563,10 +541,9 @@ _mm_maddubs_pi16(__m64 __a, __m64 __b)...@@ -563,10 +541,9 @@ _mm_maddubs_pi16(__m64 __a, __m64 __b)
563/// A 128-bit vector of [8 x i16] containing one of the source operands.541/// A 128-bit vector of [8 x i16] containing one of the source operands.
564/// \returns A 128-bit vector of [8 x i16] containing the rounded and scaled542/// \returns A 128-bit vector of [8 x i16] containing the rounded and scaled
565/// products of both operands.543/// products of both operands.
566static __inline__ __m128i __DEFAULT_FN_ATTRS544static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
567_mm_mulhrs_epi16(__m128i __a, __m128i __b)545_mm_mulhrs_epi16(__m128i __a, __m128i __b) {
568{546 return (__m128i)__builtin_ia32_pmulhrsw128((__v8hi)__a, (__v8hi)__b);
569 return (__m128i)__builtin_ia32_pmulhrsw128((__v8hi)__a, (__v8hi)__b);
570}547}
571548
572/// Multiplies packed 16-bit signed integer values, truncates the 32-bit549/// Multiplies packed 16-bit signed integer values, truncates the 32-bit
...@@ -583,11 +560,10 @@ _mm_mulhrs_epi16(__m128i __a, __m128i __b)...@@ -583,11 +560,10 @@ _mm_mulhrs_epi16(__m128i __a, __m128i __b)
583/// A 64-bit vector of [4 x i16] containing one of the source operands.560/// A 64-bit vector of [4 x i16] containing one of the source operands.
584/// \returns A 64-bit vector of [4 x i16] containing the rounded and scaled561/// \returns A 64-bit vector of [4 x i16] containing the rounded and scaled
585/// products of both operands.562/// products of both operands.
586static __inline__ __m64 __DEFAULT_FN_ATTRS563static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR
587_mm_mulhrs_pi16(__m64 __a, __m64 __b)564_mm_mulhrs_pi16(__m64 __a, __m64 __b) {
588{565 return __trunc64(__builtin_ia32_pmulhrsw128((__v8hi)__zext128(__a),
589 return __trunc64(__builtin_ia32_pmulhrsw128((__v8hi)__anyext128(__a),566 (__v8hi)__zext128(__b)));
590 (__v8hi)__anyext128(__b)));
591}567}
592568
593/// Copies the 8-bit integers from a 128-bit integer vector to the569/// Copies the 8-bit integers from a 128-bit integer vector to the
...@@ -610,10 +586,9 @@ _mm_mulhrs_pi16(__m64 __a, __m64 __b)...@@ -610,10 +586,9 @@ _mm_mulhrs_pi16(__m64 __a, __m64 __b)
610/// Bits [6:4] Reserved. \n586/// Bits [6:4] Reserved. \n
611/// Bits [3:0] select the source byte to be copied.587/// Bits [3:0] select the source byte to be copied.
612/// \returns A 128-bit integer vector containing the copied or cleared values.588/// \returns A 128-bit integer vector containing the copied or cleared values.
613static __inline__ __m128i __DEFAULT_FN_ATTRS589static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
614_mm_shuffle_epi8(__m128i __a, __m128i __b)590_mm_shuffle_epi8(__m128i __a, __m128i __b) {
615{591 return (__m128i)__builtin_ia32_pshufb128((__v16qi)__a, (__v16qi)__b);
616 return (__m128i)__builtin_ia32_pshufb128((__v16qi)__a, (__v16qi)__b);
617}592}
618593
619/// Copies the 8-bit integers from a 64-bit integer vector to the594/// Copies the 8-bit integers from a 64-bit integer vector to the
...@@ -635,13 +610,12 @@ _mm_shuffle_epi8(__m128i __a, __m128i __b)...@@ -635,13 +610,12 @@ _mm_shuffle_epi8(__m128i __a, __m128i __b)
635/// destination. \n610/// destination. \n
636/// Bits [2:0] select the source byte to be copied.611/// Bits [2:0] select the source byte to be copied.
637/// \returns A 64-bit integer vector containing the copied or cleared values.612/// \returns A 64-bit integer vector containing the copied or cleared values.
638static __inline__ __m64 __DEFAULT_FN_ATTRS613static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR
639_mm_shuffle_pi8(__m64 __a, __m64 __b)614_mm_shuffle_pi8(__m64 __a, __m64 __b) {
640{615 return __trunc64(__builtin_ia32_pshufb128(
641 return __trunc64(__builtin_ia32_pshufb128(616 (__v16qi)__builtin_shufflevector((__v2si)(__a), __extension__(__v2si){},
642 (__v16qi)__builtin_shufflevector(617 0, 1, 0, 1),
643 (__v2si)(__a), __extension__ (__v2si){}, 0, 1, 0, 1),618 (__v16qi)__zext128(__b)));
644 (__v16qi)__anyext128(__b)));
645}619}
646620
647/// For each 8-bit integer in the first source operand, perform one of621/// For each 8-bit integer in the first source operand, perform one of
...@@ -664,10 +638,9 @@ _mm_shuffle_pi8(__m64 __a, __m64 __b)...@@ -664,10 +638,9 @@ _mm_shuffle_pi8(__m64 __a, __m64 __b)
664/// A 128-bit integer vector containing control bytes corresponding to638/// A 128-bit integer vector containing control bytes corresponding to
665/// positions in the destination.639/// positions in the destination.
666/// \returns A 128-bit integer vector containing the resultant values.640/// \returns A 128-bit integer vector containing the resultant values.
667static __inline__ __m128i __DEFAULT_FN_ATTRS641static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
668_mm_sign_epi8(__m128i __a, __m128i __b)642_mm_sign_epi8(__m128i __a, __m128i __b) {
669{643 return (__m128i)__builtin_ia32_psignb128((__v16qi)__a, (__v16qi)__b);
670 return (__m128i)__builtin_ia32_psignb128((__v16qi)__a, (__v16qi)__b);
671}644}
672645
673/// For each 16-bit integer in the first source operand, perform one of646/// For each 16-bit integer in the first source operand, perform one of
...@@ -690,10 +663,9 @@ _mm_sign_epi8(__m128i __a, __m128i __b)...@@ -690,10 +663,9 @@ _mm_sign_epi8(__m128i __a, __m128i __b)
690/// A 128-bit integer vector containing control words corresponding to663/// A 128-bit integer vector containing control words corresponding to
691/// positions in the destination.664/// positions in the destination.
692/// \returns A 128-bit integer vector containing the resultant values.665/// \returns A 128-bit integer vector containing the resultant values.
693static __inline__ __m128i __DEFAULT_FN_ATTRS666static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
694_mm_sign_epi16(__m128i __a, __m128i __b)667_mm_sign_epi16(__m128i __a, __m128i __b) {
695{668 return (__m128i)__builtin_ia32_psignw128((__v8hi)__a, (__v8hi)__b);
696 return (__m128i)__builtin_ia32_psignw128((__v8hi)__a, (__v8hi)__b);
697}669}
698670
699/// For each 32-bit integer in the first source operand, perform one of671/// For each 32-bit integer in the first source operand, perform one of
...@@ -716,10 +688,9 @@ _mm_sign_epi16(__m128i __a, __m128i __b)...@@ -716,10 +688,9 @@ _mm_sign_epi16(__m128i __a, __m128i __b)
716/// A 128-bit integer vector containing control doublewords corresponding to688/// A 128-bit integer vector containing control doublewords corresponding to
717/// positions in the destination.689/// positions in the destination.
718/// \returns A 128-bit integer vector containing the resultant values.690/// \returns A 128-bit integer vector containing the resultant values.
719static __inline__ __m128i __DEFAULT_FN_ATTRS691static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
720_mm_sign_epi32(__m128i __a, __m128i __b)692_mm_sign_epi32(__m128i __a, __m128i __b) {
721{693 return (__m128i)__builtin_ia32_psignd128((__v4si)__a, (__v4si)__b);
722 return (__m128i)__builtin_ia32_psignd128((__v4si)__a, (__v4si)__b);
723}694}
724695
725/// For each 8-bit integer in the first source operand, perform one of696/// For each 8-bit integer in the first source operand, perform one of
...@@ -742,11 +713,10 @@ _mm_sign_epi32(__m128i __a, __m128i __b)...@@ -742,11 +713,10 @@ _mm_sign_epi32(__m128i __a, __m128i __b)
742/// A 64-bit integer vector containing control bytes corresponding to713/// A 64-bit integer vector containing control bytes corresponding to
743/// positions in the destination.714/// positions in the destination.
744/// \returns A 64-bit integer vector containing the resultant values.715/// \returns A 64-bit integer vector containing the resultant values.
745static __inline__ __m64 __DEFAULT_FN_ATTRS716static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sign_pi8(__m64 __a,
746_mm_sign_pi8(__m64 __a, __m64 __b)717 __m64 __b) {
747{718 return __trunc64(__builtin_ia32_psignb128((__v16qi)__zext128(__a),
748 return __trunc64(__builtin_ia32_psignb128((__v16qi)__anyext128(__a),719 (__v16qi)__zext128(__b)));
749 (__v16qi)__anyext128(__b)));
750}720}
751721
752/// For each 16-bit integer in the first source operand, perform one of722/// For each 16-bit integer in the first source operand, perform one of
...@@ -769,11 +739,10 @@ _mm_sign_pi8(__m64 __a, __m64 __b)...@@ -769,11 +739,10 @@ _mm_sign_pi8(__m64 __a, __m64 __b)
769/// A 64-bit integer vector containing control words corresponding to739/// A 64-bit integer vector containing control words corresponding to
770/// positions in the destination.740/// positions in the destination.
771/// \returns A 64-bit integer vector containing the resultant values.741/// \returns A 64-bit integer vector containing the resultant values.
772static __inline__ __m64 __DEFAULT_FN_ATTRS742static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sign_pi16(__m64 __a,
773_mm_sign_pi16(__m64 __a, __m64 __b)743 __m64 __b) {
774{744 return __trunc64(
775 return __trunc64(__builtin_ia32_psignw128((__v8hi)__anyext128(__a),745 __builtin_ia32_psignw128((__v8hi)__zext128(__a), (__v8hi)__zext128(__b)));
776 (__v8hi)__anyext128(__b)));
777}746}
778747
779/// For each 32-bit integer in the first source operand, perform one of748/// For each 32-bit integer in the first source operand, perform one of
...@@ -796,15 +765,15 @@ _mm_sign_pi16(__m64 __a, __m64 __b)...@@ -796,15 +765,15 @@ _mm_sign_pi16(__m64 __a, __m64 __b)
796/// A 64-bit integer vector containing two control doublewords corresponding765/// A 64-bit integer vector containing two control doublewords corresponding
797/// to positions in the destination.766/// to positions in the destination.
798/// \returns A 64-bit integer vector containing the resultant values.767/// \returns A 64-bit integer vector containing the resultant values.
799static __inline__ __m64 __DEFAULT_FN_ATTRS768static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sign_pi32(__m64 __a,
800_mm_sign_pi32(__m64 __a, __m64 __b)769 __m64 __b) {
801{770 return __trunc64(
802 return __trunc64(__builtin_ia32_psignd128((__v4si)__anyext128(__a),771 __builtin_ia32_psignd128((__v4si)__zext128(__a), (__v4si)__zext128(__b)));
803 (__v4si)__anyext128(__b)));
804}772}
805773
806#undef __anyext128774#undef __zext128
807#undef __trunc64775#undef __trunc64
808#undef __DEFAULT_FN_ATTRS776#undef __DEFAULT_FN_ATTRS
777#undef __DEFAULT_FN_ATTRS_CONSTEXPR
809778
810#endif /* __TMMINTRIN_H */779#endif /* __TMMINTRIN_H */
lib/include/vaesintrin.h+1-2
...@@ -19,8 +19,7 @@...@@ -19,8 +19,7 @@
1919
20/* Default attributes for ZMM forms. */20/* Default attributes for ZMM forms. */
21#define __DEFAULT_FN_ATTRS_F \21#define __DEFAULT_FN_ATTRS_F \
22 __attribute__((__always_inline__, __nodebug__, \22 __attribute__((__always_inline__, __nodebug__, __target__("avx512f,vaes"), \
23 __target__("avx512f,evex512,vaes"), \
24 __min_vector_width__(512)))23 __min_vector_width__(512)))
2524
26static __inline__ __m256i __DEFAULT_FN_ATTRS25static __inline__ __m256i __DEFAULT_FN_ATTRS
lib/include/xmmintrin.h+44-70
...@@ -16,7 +16,6 @@...@@ -16,7 +16,6 @@
1616
17#include <mmintrin.h>17#include <mmintrin.h>
1818
19typedef int __v4si __attribute__((__vector_size__(16)));
20typedef float __v4sf __attribute__((__vector_size__(16)));19typedef float __v4sf __attribute__((__vector_size__(16)));
21typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16)));20typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16)));
2221
...@@ -24,6 +23,8 @@ typedef float __m128_u __attribute__((__vector_size__(16), __aligned__(1)));...@@ -24,6 +23,8 @@ typedef float __m128_u __attribute__((__vector_size__(16), __aligned__(1)));
2423
25/* Unsigned types */24/* Unsigned types */
26typedef unsigned int __v4su __attribute__((__vector_size__(16)));25typedef unsigned int __v4su __attribute__((__vector_size__(16)));
26typedef unsigned short __v8hu __attribute__((__vector_size__(16)));
27typedef unsigned char __v16qu __attribute__((__vector_size__(16)));
2728
28/* This header should only be included in a hosted environment as it depends on29/* This header should only be included in a hosted environment as it depends on
29 * a standard library to provide allocation routines. */30 * a standard library to provide allocation routines. */
...@@ -32,21 +33,12 @@ typedef unsigned int __v4su __attribute__((__vector_size__(16)));...@@ -32,21 +33,12 @@ typedef unsigned int __v4su __attribute__((__vector_size__(16)));
32#endif33#endif
3334
34/* Define the default attributes for the functions in this file. */35/* Define the default attributes for the functions in this file. */
35#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
36#define __DEFAULT_FN_ATTRS \
37 __attribute__((__always_inline__, __nodebug__, __target__("sse,no-evex512"), \
38 __min_vector_width__(128)))
39#define __DEFAULT_FN_ATTRS_SSE2 \
40 __attribute__((__always_inline__, __nodebug__, \
41 __target__("sse2,no-evex512"), __min_vector_width__(128)))
42#else
43#define __DEFAULT_FN_ATTRS \36#define __DEFAULT_FN_ATTRS \
44 __attribute__((__always_inline__, __nodebug__, __target__("sse"), \37 __attribute__((__always_inline__, __nodebug__, __target__("sse"), \
45 __min_vector_width__(128)))38 __min_vector_width__(128)))
46#define __DEFAULT_FN_ATTRS_SSE2 \39#define __DEFAULT_FN_ATTRS_SSE2 \
47 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \40 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
48 __min_vector_width__(128)))41 __min_vector_width__(128)))
49#endif
5042
51#if defined(__cplusplus) && (__cplusplus >= 201103L)43#if defined(__cplusplus) && (__cplusplus >= 201103L)
52#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr44#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
...@@ -239,10 +231,9 @@ _mm_div_ps(__m128 __a, __m128 __b) {...@@ -239,10 +231,9 @@ _mm_div_ps(__m128 __a, __m128 __b) {
239/// used in the calculation.231/// used in the calculation.
240/// \returns A 128-bit vector of [4 x float] containing the square root of the232/// \returns A 128-bit vector of [4 x float] containing the square root of the
241/// value in the low-order bits of the operand.233/// value in the low-order bits of the operand.
242static __inline__ __m128 __DEFAULT_FN_ATTRS234static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ss(__m128 __a) {
243_mm_sqrt_ss(__m128 __a)235 __a[0] = __builtin_elementwise_sqrt(__a[0]);
244{236 return __a;
245 return (__m128)__builtin_ia32_sqrtss((__v4sf)__a);
246}237}
247238
248/// Calculates the square roots of the values stored in a 128-bit vector239/// Calculates the square roots of the values stored in a 128-bit vector
...@@ -256,10 +247,8 @@ _mm_sqrt_ss(__m128 __a)...@@ -256,10 +247,8 @@ _mm_sqrt_ss(__m128 __a)
256/// A 128-bit vector of [4 x float].247/// A 128-bit vector of [4 x float].
257/// \returns A 128-bit vector of [4 x float] containing the square roots of the248/// \returns A 128-bit vector of [4 x float] containing the square roots of the
258/// values in the operand.249/// values in the operand.
259static __inline__ __m128 __DEFAULT_FN_ATTRS250static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ps(__m128 __a) {
260_mm_sqrt_ps(__m128 __a)251 return __builtin_elementwise_sqrt(__a);
261{
262 return __builtin_ia32_sqrtps((__v4sf)__a);
263}252}
264253
265/// Calculates the approximate reciprocal of the value stored in the254/// Calculates the approximate reciprocal of the value stored in the
...@@ -352,9 +341,7 @@ _mm_rsqrt_ps(__m128 __a)...@@ -352,9 +341,7 @@ _mm_rsqrt_ps(__m128 __a)
352/// \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
353/// minimum value between both operands. The upper 96 bits are copied from342/// minimum value between both operands. The upper 96 bits are copied from
354/// the upper 96 bits of the first source operand.343/// the upper 96 bits of the first source operand.
355static __inline__ __m128 __DEFAULT_FN_ATTRS344static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_min_ss(__m128 __a, __m128 __b) {
356_mm_min_ss(__m128 __a, __m128 __b)
357{
358 return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b);345 return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b);
359}346}
360347
...@@ -373,9 +360,8 @@ _mm_min_ss(__m128 __a, __m128 __b)...@@ -373,9 +360,8 @@ _mm_min_ss(__m128 __a, __m128 __b)
373/// A 128-bit vector of [4 x float] containing one of the operands.360/// A 128-bit vector of [4 x float] containing one of the operands.
374/// \returns A 128-bit vector of [4 x float] containing the minimum values361/// \returns A 128-bit vector of [4 x float] containing the minimum values
375/// between both operands.362/// between both operands.
376static __inline__ __m128 __DEFAULT_FN_ATTRS363static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_ps(__m128 __a,
377_mm_min_ps(__m128 __a, __m128 __b)364 __m128 __b) {
378{
379 return __builtin_ia32_minps((__v4sf)__a, (__v4sf)__b);365 return __builtin_ia32_minps((__v4sf)__a, (__v4sf)__b);
380}366}
381367
...@@ -398,9 +384,7 @@ _mm_min_ps(__m128 __a, __m128 __b)...@@ -398,9 +384,7 @@ _mm_min_ps(__m128 __a, __m128 __b)
398/// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the384/// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
399/// maximum value between both operands. The upper 96 bits are copied from385/// maximum value between both operands. The upper 96 bits are copied from
400/// the upper 96 bits of the first source operand.386/// the upper 96 bits of the first source operand.
401static __inline__ __m128 __DEFAULT_FN_ATTRS387static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_max_ss(__m128 __a, __m128 __b) {
402_mm_max_ss(__m128 __a, __m128 __b)
403{
404 return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b);388 return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b);
405}389}
406390
...@@ -419,9 +403,8 @@ _mm_max_ss(__m128 __a, __m128 __b)...@@ -419,9 +403,8 @@ _mm_max_ss(__m128 __a, __m128 __b)
419/// A 128-bit vector of [4 x float] containing one of the operands.403/// A 128-bit vector of [4 x float] containing one of the operands.
420/// \returns A 128-bit vector of [4 x float] containing the maximum values404/// \returns A 128-bit vector of [4 x float] containing the maximum values
421/// between both operands.405/// between both operands.
422static __inline__ __m128 __DEFAULT_FN_ATTRS406static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_max_ps(__m128 __a,
423_mm_max_ps(__m128 __a, __m128 __b)407 __m128 __b) {
424{
425 return __builtin_ia32_maxps((__v4sf)__a, (__v4sf)__b);408 return __builtin_ia32_maxps((__v4sf)__a, (__v4sf)__b);
426}409}
427410
...@@ -1688,7 +1671,7 @@ _mm_cvtsi64_ss(__m128 __a, long long __b) {...@@ -1688,7 +1671,7 @@ _mm_cvtsi64_ss(__m128 __a, long long __b) {
1688/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the1671/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1689/// converted value of the second operand. The upper 64 bits are copied from1672/// converted value of the second operand. The upper 64 bits are copied from
1690/// the upper 64 bits of the first operand.1673/// the upper 64 bits of the first operand.
1691static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE21674static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1692_mm_cvtpi32_ps(__m128 __a, __m64 __b)1675_mm_cvtpi32_ps(__m128 __a, __m64 __b)
1693{1676{
1694 return (__m128)__builtin_shufflevector(1677 return (__m128)__builtin_shufflevector(
...@@ -1714,7 +1697,7 @@ _mm_cvtpi32_ps(__m128 __a, __m64 __b)...@@ -1714,7 +1697,7 @@ _mm_cvtpi32_ps(__m128 __a, __m64 __b)
1714/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the1697/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1715/// converted value from the second operand. The upper 64 bits are copied1698/// converted value from the second operand. The upper 64 bits are copied
1716/// from the upper 64 bits of the first operand.1699/// from the upper 64 bits of the first operand.
1717static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE21700static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1718_mm_cvt_pi2ps(__m128 __a, __m64 __b)1701_mm_cvt_pi2ps(__m128 __a, __m64 __b)
1719{1702{
1720 return _mm_cvtpi32_ps(__a, __b);1703 return _mm_cvtpi32_ps(__a, __b);
...@@ -2353,9 +2336,8 @@ void _mm_sfence(void);...@@ -2353,9 +2336,8 @@ void _mm_sfence(void);
2353/// \param __b2336/// \param __b
2354/// A 64-bit integer vector containing one of the source operands.2337/// A 64-bit integer vector containing one of the source operands.
2355/// \returns A 64-bit integer vector containing the comparison results.2338/// \returns A 64-bit integer vector containing the comparison results.
2356static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22339static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2357_mm_max_pi16(__m64 __a, __m64 __b)2340_mm_max_pi16(__m64 __a, __m64 __b) {
2358{
2359 return (__m64)__builtin_elementwise_max((__v4hi)__a, (__v4hi)__b);2341 return (__m64)__builtin_elementwise_max((__v4hi)__a, (__v4hi)__b);
2360}2342}
23612343
...@@ -2372,9 +2354,8 @@ _mm_max_pi16(__m64 __a, __m64 __b)...@@ -2372,9 +2354,8 @@ _mm_max_pi16(__m64 __a, __m64 __b)
2372/// \param __b2354/// \param __b
2373/// A 64-bit integer vector containing one of the source operands.2355/// A 64-bit integer vector containing one of the source operands.
2374/// \returns A 64-bit integer vector containing the comparison results.2356/// \returns A 64-bit integer vector containing the comparison results.
2375static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22357static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2376_mm_max_pu8(__m64 __a, __m64 __b)2358_mm_max_pu8(__m64 __a, __m64 __b) {
2377{
2378 return (__m64)__builtin_elementwise_max((__v8qu)__a, (__v8qu)__b);2359 return (__m64)__builtin_elementwise_max((__v8qu)__a, (__v8qu)__b);
2379}2360}
23802361
...@@ -2391,9 +2372,8 @@ _mm_max_pu8(__m64 __a, __m64 __b)...@@ -2391,9 +2372,8 @@ _mm_max_pu8(__m64 __a, __m64 __b)
2391/// \param __b2372/// \param __b
2392/// A 64-bit integer vector containing one of the source operands.2373/// A 64-bit integer vector containing one of the source operands.
2393/// \returns A 64-bit integer vector containing the comparison results.2374/// \returns A 64-bit integer vector containing the comparison results.
2394static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22375static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2395_mm_min_pi16(__m64 __a, __m64 __b)2376_mm_min_pi16(__m64 __a, __m64 __b) {
2396{
2397 return (__m64)__builtin_elementwise_min((__v4hi)__a, (__v4hi)__b);2377 return (__m64)__builtin_elementwise_min((__v4hi)__a, (__v4hi)__b);
2398}2378}
23992379
...@@ -2410,9 +2390,8 @@ _mm_min_pi16(__m64 __a, __m64 __b)...@@ -2410,9 +2390,8 @@ _mm_min_pi16(__m64 __a, __m64 __b)
2410/// \param __b2390/// \param __b
2411/// A 64-bit integer vector containing one of the source operands.2391/// A 64-bit integer vector containing one of the source operands.
2412/// \returns A 64-bit integer vector containing the comparison results.2392/// \returns A 64-bit integer vector containing the comparison results.
2413static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22393static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2414_mm_min_pu8(__m64 __a, __m64 __b)2394_mm_min_pu8(__m64 __a, __m64 __b) {
2415{
2416 return (__m64)__builtin_elementwise_min((__v8qu)__a, (__v8qu)__b);2395 return (__m64)__builtin_elementwise_min((__v8qu)__a, (__v8qu)__b);
2417}2396}
24182397
...@@ -2428,9 +2407,8 @@ _mm_min_pu8(__m64 __a, __m64 __b)...@@ -2428,9 +2407,8 @@ _mm_min_pu8(__m64 __a, __m64 __b)
2428/// A 64-bit integer vector containing the values with bits to be extracted.2407/// A 64-bit integer vector containing the values with bits to be extracted.
2429/// \returns The most significant bit from each 8-bit element in \a __a,2408/// \returns The most significant bit from each 8-bit element in \a __a,
2430/// written to bits [7:0].2409/// written to bits [7:0].
2431static __inline__ int __DEFAULT_FN_ATTRS_SSE22410static __inline__ int __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2432_mm_movemask_pi8(__m64 __a)2411_mm_movemask_pi8(__m64 __a) {
2433{
2434 return __builtin_ia32_pmovmskb128((__v16qi)__zext128(__a));2412 return __builtin_ia32_pmovmskb128((__v16qi)__zext128(__a));
2435}2413}
24362414
...@@ -2447,11 +2425,11 @@ _mm_movemask_pi8(__m64 __a)...@@ -2447,11 +2425,11 @@ _mm_movemask_pi8(__m64 __a)
2447/// \param __b2425/// \param __b
2448/// A 64-bit integer vector containing one of the source operands.2426/// A 64-bit integer vector containing one of the source operands.
2449/// \returns A 64-bit integer vector containing the products of both operands.2427/// \returns A 64-bit integer vector containing the products of both operands.
2450static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22428static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2451_mm_mulhi_pu16(__m64 __a, __m64 __b)2429_mm_mulhi_pu16(__m64 __a, __m64 __b)
2452{2430{
2453 return __trunc64(__builtin_ia32_pmulhuw128((__v8hi)__anyext128(__a),2431 return __trunc64(__builtin_ia32_pmulhuw128((__v8hu)__zext128(__a),
2454 (__v8hi)__anyext128(__b)));2432 (__v8hu)__zext128(__b)));
2455}2433}
24562434
2457/// Shuffles the 4 16-bit integers from a 64-bit integer vector to the2435/// Shuffles the 4 16-bit integers from a 64-bit integer vector to the
...@@ -2530,8 +2508,8 @@ _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p)...@@ -2530,8 +2508,8 @@ _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p)
2530 // If there's a risk of spurious trap due to a 128-bit write, back up the2508 // If there's a risk of spurious trap due to a 128-bit write, back up the
2531 // pointer by 8 bytes and shift values in registers to match.2509 // pointer by 8 bytes and shift values in registers to match.
2532 __p -= 8;2510 __p -= 8;
2533 __d128 = __builtin_ia32_pslldqi128_byteshift((__v2di)__d128, 8);2511 __d128 = (__m128i)__builtin_ia32_pslldqi128_byteshift((__v16qi)__d128, 8);
2534 __n128 = __builtin_ia32_pslldqi128_byteshift((__v2di)__n128, 8);2512 __n128 = (__m128i)__builtin_ia32_pslldqi128_byteshift((__v16qi)__n128, 8);
2535 }2513 }
25362514
2537 __builtin_ia32_maskmovdqu((__v16qi)__d128, (__v16qi)__n128, __p);2515 __builtin_ia32_maskmovdqu((__v16qi)__d128, (__v16qi)__n128, __p);
...@@ -2550,11 +2528,10 @@ _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p)...@@ -2550,11 +2528,10 @@ _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p)
2550/// \param __b2528/// \param __b
2551/// A 64-bit integer vector containing one of the source operands.2529/// A 64-bit integer vector containing one of the source operands.
2552/// \returns A 64-bit integer vector containing the averages of both operands.2530/// \returns A 64-bit integer vector containing the averages of both operands.
2553static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22531static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2554_mm_avg_pu8(__m64 __a, __m64 __b)2532_mm_avg_pu8(__m64 __a, __m64 __b) {
2555{2533 return __trunc64(__builtin_ia32_pavgb128((__v16qu)__zext128(__a),
2556 return __trunc64(__builtin_ia32_pavgb128((__v16qi)__anyext128(__a),2534 (__v16qu)__zext128(__b)));
2557 (__v16qi)__anyext128(__b)));
2558}2535}
25592536
2560/// Computes the rounded averages of the packed unsigned 16-bit integer2537/// Computes the rounded averages of the packed unsigned 16-bit integer
...@@ -2570,11 +2547,10 @@ _mm_avg_pu8(__m64 __a, __m64 __b)...@@ -2570,11 +2547,10 @@ _mm_avg_pu8(__m64 __a, __m64 __b)
2570/// \param __b2547/// \param __b
2571/// A 64-bit integer vector containing one of the source operands.2548/// A 64-bit integer vector containing one of the source operands.
2572/// \returns A 64-bit integer vector containing the averages of both operands.2549/// \returns A 64-bit integer vector containing the averages of both operands.
2573static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22550static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2574_mm_avg_pu16(__m64 __a, __m64 __b)2551_mm_avg_pu16(__m64 __a, __m64 __b) {
2575{2552 return __trunc64(
2576 return __trunc64(__builtin_ia32_pavgw128((__v8hi)__anyext128(__a),2553 __builtin_ia32_pavgw128((__v8hu)__zext128(__a), (__v8hu)__zext128(__b)));
2577 (__v8hi)__anyext128(__b)));
2578}2554}
25792555
2580/// Subtracts the corresponding 8-bit unsigned integer values of the two2556/// Subtracts the corresponding 8-bit unsigned integer values of the two
...@@ -2873,7 +2849,7 @@ _mm_movelh_ps(__m128 __a, __m128 __b) {...@@ -2873,7 +2849,7 @@ _mm_movelh_ps(__m128 __a, __m128 __b) {
2873/// from the corresponding elements in this operand.2849/// from the corresponding elements in this operand.
2874/// \returns A 128-bit vector of [4 x float] containing the copied and converted2850/// \returns A 128-bit vector of [4 x float] containing the copied and converted
2875/// values from the operand.2851/// values from the operand.
2876static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE22852static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2877_mm_cvtpi16_ps(__m64 __a)2853_mm_cvtpi16_ps(__m64 __a)
2878{2854{
2879 return __builtin_convertvector((__v4hi)__a, __v4sf);2855 return __builtin_convertvector((__v4hi)__a, __v4sf);
...@@ -2891,7 +2867,7 @@ _mm_cvtpi16_ps(__m64 __a)...@@ -2891,7 +2867,7 @@ _mm_cvtpi16_ps(__m64 __a)
2891/// destination are copied from the corresponding elements in this operand.2867/// destination are copied from the corresponding elements in this operand.
2892/// \returns A 128-bit vector of [4 x float] containing the copied and converted2868/// \returns A 128-bit vector of [4 x float] containing the copied and converted
2893/// values from the operand.2869/// values from the operand.
2894static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE22870static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2895_mm_cvtpu16_ps(__m64 __a)2871_mm_cvtpu16_ps(__m64 __a)
2896{2872{
2897 return __builtin_convertvector((__v4hu)__a, __v4sf);2873 return __builtin_convertvector((__v4hu)__a, __v4sf);
...@@ -2909,7 +2885,7 @@ _mm_cvtpu16_ps(__m64 __a)...@@ -2909,7 +2885,7 @@ _mm_cvtpu16_ps(__m64 __a)
2909/// from the corresponding lower 4 elements in this operand.2885/// from the corresponding lower 4 elements in this operand.
2910/// \returns A 128-bit vector of [4 x float] containing the copied and converted2886/// \returns A 128-bit vector of [4 x float] containing the copied and converted
2911/// values from the operand.2887/// values from the operand.
2912static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE22888static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2913_mm_cvtpi8_ps(__m64 __a)2889_mm_cvtpi8_ps(__m64 __a)
2914{2890{
2915 return __builtin_convertvector(2891 return __builtin_convertvector(
...@@ -2930,7 +2906,7 @@ _mm_cvtpi8_ps(__m64 __a)...@@ -2930,7 +2906,7 @@ _mm_cvtpi8_ps(__m64 __a)
2930/// operand.2906/// operand.
2931/// \returns A 128-bit vector of [4 x float] containing the copied and converted2907/// \returns A 128-bit vector of [4 x float] containing the copied and converted
2932/// values from the source operand.2908/// values from the source operand.
2933static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE22909static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2934_mm_cvtpu8_ps(__m64 __a)2910_mm_cvtpu8_ps(__m64 __a)
2935{2911{
2936 return __builtin_convertvector(2912 return __builtin_convertvector(
...@@ -2954,7 +2930,7 @@ _mm_cvtpu8_ps(__m64 __a)...@@ -2954,7 +2930,7 @@ _mm_cvtpu8_ps(__m64 __a)
2954/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the2930/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
2955/// copied and converted values from the first operand. The upper 64 bits2931/// copied and converted values from the first operand. The upper 64 bits
2956/// contain the copied and converted values from the second operand.2932/// contain the copied and converted values from the second operand.
2957static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE22933static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2958_mm_cvtpi32x2_ps(__m64 __a, __m64 __b)2934_mm_cvtpi32x2_ps(__m64 __a, __m64 __b)
2959{2935{
2960 return __builtin_convertvector(2936 return __builtin_convertvector(
...@@ -3029,9 +3005,7 @@ _mm_cvtps_pi8(__m128 __a)...@@ -3029,9 +3005,7 @@ _mm_cvtps_pi8(__m128 __a)
3029/// \returns A 32-bit integer value. Bits [3:0] contain the sign bits from each3005/// \returns A 32-bit integer value. Bits [3:0] contain the sign bits from each
3030/// single-precision floating-point element of the parameter. Bits [31:4] are3006/// single-precision floating-point element of the parameter. Bits [31:4] are
3031/// set to zero.3007/// set to zero.
3032static __inline__ int __DEFAULT_FN_ATTRS3008static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR _mm_movemask_ps(__m128 __a) {
3033_mm_movemask_ps(__m128 __a)
3034{
3035 return __builtin_ia32_movmskps((__v4sf)__a);3009 return __builtin_ia32_movmskps((__v4sf)__a);
3036}3010}
30373011
lib/include/xopintrin.h+20-10
...@@ -20,6 +20,14 @@...@@ -20,6 +20,14 @@
20#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xop"), __min_vector_width__(128)))20#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xop"), __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("xop"), __min_vector_width__(256)))21#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("xop"), __min_vector_width__(256)))
2222
23#if defined(__cplusplus) && (__cplusplus >= 201103L)
24#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
25#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
26#else
27#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
28#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
29#endif
30
23static __inline__ __m128i __DEFAULT_FN_ATTRS31static __inline__ __m128i __DEFAULT_FN_ATTRS
24_mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C)32_mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C)
25{33{
...@@ -182,13 +190,13 @@ _mm_hsubq_epi32(__m128i __A)...@@ -182,13 +190,13 @@ _mm_hsubq_epi32(__m128i __A)
182 return (__m128i)__builtin_ia32_vphsubdq((__v4si)__A);190 return (__m128i)__builtin_ia32_vphsubdq((__v4si)__A);
183}191}
184192
185static __inline__ __m128i __DEFAULT_FN_ATTRS193static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
186_mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C)194_mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C)
187{195{
188 return (__m128i)(((__v2du)__A & (__v2du)__C) | ((__v2du)__B & ~(__v2du)__C));196 return (__m128i)(((__v2du)__A & (__v2du)__C) | ((__v2du)__B & ~(__v2du)__C));
189}197}
190198
191static __inline__ __m256i __DEFAULT_FN_ATTRS256199static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
192_mm256_cmov_si256(__m256i __A, __m256i __B, __m256i __C)200_mm256_cmov_si256(__m256i __A, __m256i __B, __m256i __C)
193{201{
194 return (__m256i)(((__v4du)__A & (__v4du)__C) | ((__v4du)__B & ~(__v4du)__C));202 return (__m256i)(((__v4du)__A & (__v4du)__C) | ((__v4du)__B & ~(__v4du)__C));
...@@ -200,28 +208,28 @@ _mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C)...@@ -200,28 +208,28 @@ _mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C)
200 return (__m128i)__builtin_ia32_vpperm((__v16qi)__A, (__v16qi)__B, (__v16qi)__C);208 return (__m128i)__builtin_ia32_vpperm((__v16qi)__A, (__v16qi)__B, (__v16qi)__C);
201}209}
202210
203static __inline__ __m128i __DEFAULT_FN_ATTRS211static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
204_mm_rot_epi8(__m128i __A, __m128i __B)212_mm_rot_epi8(__m128i __A, __m128i __B)
205{213{
206 return (__m128i)__builtin_ia32_vprotb((__v16qi)__A, (__v16qi)__B);214 return (__m128i)__builtin_elementwise_fshl((__v16qu)__A, (__v16qu)__A, (__v16qu)__B);
207}215}
208216
209static __inline__ __m128i __DEFAULT_FN_ATTRS217static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
210_mm_rot_epi16(__m128i __A, __m128i __B)218_mm_rot_epi16(__m128i __A, __m128i __B)
211{219{
212 return (__m128i)__builtin_ia32_vprotw((__v8hi)__A, (__v8hi)__B);220 return (__m128i)__builtin_elementwise_fshl((__v8hu)__A, (__v8hu)__A, (__v8hu)__B);
213}221}
214222
215static __inline__ __m128i __DEFAULT_FN_ATTRS223static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
216_mm_rot_epi32(__m128i __A, __m128i __B)224_mm_rot_epi32(__m128i __A, __m128i __B)
217{225{
218 return (__m128i)__builtin_ia32_vprotd((__v4si)__A, (__v4si)__B);226 return (__m128i)__builtin_elementwise_fshl((__v4su)__A, (__v4su)__A, (__v4su)__B);
219}227}
220228
221static __inline__ __m128i __DEFAULT_FN_ATTRS229static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
222_mm_rot_epi64(__m128i __A, __m128i __B)230_mm_rot_epi64(__m128i __A, __m128i __B)
223{231{
224 return (__m128i)__builtin_ia32_vprotq((__v2di)__A, (__v2di)__B);232 return (__m128i)__builtin_elementwise_fshl((__v2du)__A, (__v2du)__A, (__v2du)__B);
225}233}
226234
227#define _mm_roti_epi8(A, N) \235#define _mm_roti_epi8(A, N) \
...@@ -766,5 +774,7 @@ _mm256_frcz_pd(__m256d __A)...@@ -766,5 +774,7 @@ _mm256_frcz_pd(__m256d __A)
766774
767#undef __DEFAULT_FN_ATTRS775#undef __DEFAULT_FN_ATTRS
768#undef __DEFAULT_FN_ATTRS256776#undef __DEFAULT_FN_ATTRS256
777#undef __DEFAULT_FN_ATTRS_CONSTEXPR
778#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
769779
770#endif /* __XOPINTRIN_H */780#endif /* __XOPINTRIN_H */
lib/libcxx/include/__algorithm/all_of.h+11-5
...@@ -10,24 +10,28 @@...@@ -10,24 +10,28 @@
10#ifndef _LIBCPP___ALGORITHM_ALL_OF_H10#ifndef _LIBCPP___ALGORITHM_ALL_OF_H
11#define _LIBCPP___ALGORITHM_ALL_OF_H11#define _LIBCPP___ALGORITHM_ALL_OF_H
1212
13#include <__algorithm/any_of.h>
13#include <__config>14#include <__config>
14#include <__functional/identity.h>15#include <__functional/identity.h>
15#include <__type_traits/invoke.h>16#include <__type_traits/invoke.h>
17#include <__utility/forward.h>
18#include <__utility/move.h>
1619
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header21# pragma GCC system_header
19#endif22#endif
2023
24_LIBCPP_PUSH_MACROS
25#include <__undef_macros>
26
21_LIBCPP_BEGIN_NAMESPACE_STD27_LIBCPP_BEGIN_NAMESPACE_STD
2228
23template <class _Iter, class _Sent, class _Proj, class _Pred>29template <class _Iter, class _Sent, class _Proj, class _Pred>
24_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool30_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
25__all_of(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {31__all_of(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
26 for (; __first != __last; ++__first) {32 using _Ref = decltype(std::__invoke(__proj, *__first));
27 if (!std::__invoke(__pred, std::__invoke(__proj, *__first)))33 auto __negated_pred = [&__pred](_Ref __arg) -> bool { return !std::__invoke(__pred, std::forward<_Ref>(__arg)); };
28 return false;34 return !std::__any_of(std::move(__first), std::move(__last), __negated_pred, __proj);
29 }
30 return true;
31}35}
3236
33template <class _InputIterator, class _Predicate>37template <class _InputIterator, class _Predicate>
...@@ -39,4 +43,6 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {...@@ -39,4 +43,6 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
3943
40_LIBCPP_END_NAMESPACE_STD44_LIBCPP_END_NAMESPACE_STD
4145
46_LIBCPP_POP_MACROS
47
42#endif // _LIBCPP___ALGORITHM_ALL_OF_H48#endif // _LIBCPP___ALGORITHM_ALL_OF_H
lib/libcxx/include/__algorithm/comp.h+4
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__config>12#include <__config>
13#include <__type_traits/desugars_to.h>13#include <__type_traits/desugars_to.h>
14#include <__type_traits/is_generic_transparent_comparator.h>
14#include <__type_traits/is_integral.h>15#include <__type_traits/is_integral.h>
1516
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -48,6 +49,9 @@ inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;...@@ -48,6 +49,9 @@ inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;
48template <class _Tp>49template <class _Tp>
49inline const bool __desugars_to_v<__totally_ordered_less_tag, __less<>, _Tp, _Tp> = is_integral<_Tp>::value;50inline const bool __desugars_to_v<__totally_ordered_less_tag, __less<>, _Tp, _Tp> = is_integral<_Tp>::value;
5051
52template <>
53inline const bool __is_generic_transparent_comparator_v<__less<> > = true;
54
51_LIBCPP_END_NAMESPACE_STD55_LIBCPP_END_NAMESPACE_STD
5256
53#endif // _LIBCPP___ALGORITHM_COMP_H57#endif // _LIBCPP___ALGORITHM_COMP_H
lib/libcxx/include/__algorithm/copy.h+28-147
...@@ -12,11 +12,10 @@...@@ -12,11 +12,10 @@
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/min.h>14#include <__algorithm/min.h>
15#include <__algorithm/specialized_algorithms.h>
15#include <__config>16#include <__config>
16#include <__fwd/bit_reference.h>
17#include <__iterator/iterator_traits.h>17#include <__iterator/iterator_traits.h>
18#include <__iterator/segmented_iterator.h>18#include <__iterator/segmented_iterator.h>
19#include <__memory/pointer_traits.h>
20#include <__type_traits/common_type.h>19#include <__type_traits/common_type.h>
21#include <__type_traits/enable_if.h>20#include <__type_traits/enable_if.h>
22#include <__utility/move.h>21#include <__utility/move.h>
...@@ -38,124 +37,14 @@ copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result);...@@ -38,124 +37,14 @@ copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result);
38template <class _InIter, class _Sent, class _OutIter>37template <class _InIter, class _Sent, class _OutIter>
39inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter);38inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter);
4039
41template <class _Cp, bool _IsConst>
42_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> __copy_aligned(
43 __bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) {
44 using _In = __bit_iterator<_Cp, _IsConst>;
45 using difference_type = typename _In::difference_type;
46 using __storage_type = typename _In::__storage_type;
47
48 const int __bits_per_word = _In::__bits_per_word;
49 difference_type __n = __last - __first;
50 if (__n > 0) {
51 // do first word
52 if (__first.__ctz_ != 0) {
53 unsigned __clz = __bits_per_word - __first.__ctz_;
54 difference_type __dn = std::min(static_cast<difference_type>(__clz), __n);
55 __n -= __dn;
56 __storage_type __m = std::__middle_mask<__storage_type>(__clz - __dn, __first.__ctz_);
57 __storage_type __b = *__first.__seg_ & __m;
58 *__result.__seg_ &= ~__m;
59 *__result.__seg_ |= __b;
60 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
61 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
62 ++__first.__seg_;
63 // __first.__ctz_ = 0;
64 }
65 // __first.__ctz_ == 0;
66 // do middle words
67 __storage_type __nw = __n / __bits_per_word;
68 std::copy(std::__to_address(__first.__seg_),
69 std::__to_address(__first.__seg_ + __nw),
70 std::__to_address(__result.__seg_));
71 __n -= __nw * __bits_per_word;
72 __result.__seg_ += __nw;
73 // do last word
74 if (__n > 0) {
75 __first.__seg_ += __nw;
76 __storage_type __m = std::__trailing_mask<__storage_type>(__bits_per_word - __n);
77 __storage_type __b = *__first.__seg_ & __m;
78 *__result.__seg_ &= ~__m;
79 *__result.__seg_ |= __b;
80 __result.__ctz_ = static_cast<unsigned>(__n);
81 }
82 }
83 return __result;
84}
85
86template <class _Cp, bool _IsConst>
87_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> __copy_unaligned(
88 __bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) {
89 using _In = __bit_iterator<_Cp, _IsConst>;
90 using difference_type = typename _In::difference_type;
91 using __storage_type = typename _In::__storage_type;
92
93 const int __bits_per_word = _In::__bits_per_word;
94 difference_type __n = __last - __first;
95 if (__n > 0) {
96 // do first word
97 if (__first.__ctz_ != 0) {
98 unsigned __clz_f = __bits_per_word - __first.__ctz_;
99 difference_type __dn = std::min(static_cast<difference_type>(__clz_f), __n);
100 __n -= __dn;
101 __storage_type __m = std::__middle_mask<__storage_type>(__clz_f - __dn, __first.__ctz_);
102 __storage_type __b = *__first.__seg_ & __m;
103 unsigned __clz_r = __bits_per_word - __result.__ctz_;
104 __storage_type __ddn = std::min<__storage_type>(__dn, __clz_r);
105 __m = std::__middle_mask<__storage_type>(__clz_r - __ddn, __result.__ctz_);
106 *__result.__seg_ &= ~__m;
107 if (__result.__ctz_ > __first.__ctz_)
108 *__result.__seg_ |= __b << (__result.__ctz_ - __first.__ctz_);
109 else
110 *__result.__seg_ |= __b >> (__first.__ctz_ - __result.__ctz_);
111 __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word;
112 __result.__ctz_ = static_cast<unsigned>((__ddn + __result.__ctz_) % __bits_per_word);
113 __dn -= __ddn;
114 if (__dn > 0) {
115 __m = std::__trailing_mask<__storage_type>(__bits_per_word - __dn);
116 *__result.__seg_ &= ~__m;
117 *__result.__seg_ |= __b >> (__first.__ctz_ + __ddn);
118 __result.__ctz_ = static_cast<unsigned>(__dn);
119 }
120 ++__first.__seg_;
121 // __first.__ctz_ = 0;
122 }
123 // __first.__ctz_ == 0;
124 // do middle words
125 unsigned __clz_r = __bits_per_word - __result.__ctz_;
126 __storage_type __m = std::__leading_mask<__storage_type>(__result.__ctz_);
127 for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) {
128 __storage_type __b = *__first.__seg_;
129 *__result.__seg_ &= ~__m;
130 *__result.__seg_ |= __b << __result.__ctz_;
131 ++__result.__seg_;
132 *__result.__seg_ &= __m;
133 *__result.__seg_ |= __b >> __clz_r;
134 }
135 // do last word
136 if (__n > 0) {
137 __m = std::__trailing_mask<__storage_type>(__bits_per_word - __n);
138 __storage_type __b = *__first.__seg_ & __m;
139 __storage_type __dn = std::min(__n, static_cast<difference_type>(__clz_r));
140 __m = std::__middle_mask<__storage_type>(__clz_r - __dn, __result.__ctz_);
141 *__result.__seg_ &= ~__m;
142 *__result.__seg_ |= __b << __result.__ctz_;
143 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
144 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
145 __n -= __dn;
146 if (__n > 0) {
147 __m = std::__trailing_mask<__storage_type>(__bits_per_word - __n);
148 *__result.__seg_ &= ~__m;
149 *__result.__seg_ |= __b >> __dn;
150 __result.__ctz_ = static_cast<unsigned>(__n);
151 }
152 }
153 }
154 return __result;
155}
156
157struct __copy_impl {40struct __copy_impl {
158 template <class _InIter, class _Sent, class _OutIter>41 template <class _InIter,
42 class _Sent,
43 class _OutIter,
44 __enable_if_t<!__specialized_algorithm<_Algorithm::__copy,
45 __iterator_pair<_InIter, _Sent>,
46 __single_iterator<_OutIter> >::__has_algorithm,
47 int> = 0>
159 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>48 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
160 operator()(_InIter __first, _Sent __last, _OutIter __result) const {49 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
161 while (__first != __last) {50 while (__first != __last) {
...@@ -167,37 +56,39 @@ struct __copy_impl {...@@ -167,37 +56,39 @@ struct __copy_impl {
167 return std::make_pair(std::move(__first), std::move(__result));56 return std::make_pair(std::move(__first), std::move(__result));
168 }57 }
16958
170 template <class _InIter, class _OutIter>59 template <class _InIter,
171 struct _CopySegment {60 class _Sent,
172 using _Traits _LIBCPP_NODEBUG = __segmented_iterator_traits<_InIter>;61 class _OutIter,
17362 __enable_if_t<__specialized_algorithm<_Algorithm::__copy,
174 _OutIter& __result_;63 __iterator_pair<_InIter, _Sent>,
17564 __single_iterator<_OutIter> >::__has_algorithm,
176 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit _CopySegment(_OutIter& __result)65 int> = 0>
177 : __result_(__result) {}66 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static pair<_InIter, _OutIter>
17867 operator()(_InIter __first, _Sent __last, _OutIter __result) {
179 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void68 return __specialized_algorithm<_Algorithm::__copy, __iterator_pair<_InIter, _Sent>, __single_iterator<_OutIter> >()(
180 operator()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) {69 std::move(__first), std::move(__last), std::move(__result));
181 __result_ = std::__copy(__lfirst, __llast, std::move(__result_)).second;70 }
182 }
183 };
18471
185 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>72 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
186 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>73 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
187 operator()(_InIter __first, _InIter __last, _OutIter __result) const {74 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
188 std::__for_each_segment(__first, __last, _CopySegment<_InIter, _OutIter>(__result));75 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 __result = std::__copy(std::move(__lfirst), std::move(__llast), std::move(__result)).second;
78 });
189 return std::make_pair(__last, std::move(__result));79 return std::make_pair(__last, std::move(__result));
190 }80 }
19181
192 template <class _InIter,82 template <class _InIter,
193 class _OutIter,83 class _OutIter,
194 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&84 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
195 !__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,85 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
196 int> = 0>86 int> = 0>
197 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>87 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
198 operator()(_InIter __first, _InIter __last, _OutIter __result) const {88 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
199 using _Traits = __segmented_iterator_traits<_OutIter>;89 using _Traits = __segmented_iterator_traits<_OutIter>;
200 using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;90 using _DiffT =
91 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;
20192
202 if (__first == __last)93 if (__first == __last)
203 return std::make_pair(std::move(__first), std::move(__result));94 return std::make_pair(std::move(__first), std::move(__result));
...@@ -217,16 +108,6 @@ struct __copy_impl {...@@ -217,16 +108,6 @@ struct __copy_impl {
217 }108 }
218 }109 }
219110
220 template <class _Cp, bool _IsConst>
221 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >
222 operator()(__bit_iterator<_Cp, _IsConst> __first,
223 __bit_iterator<_Cp, _IsConst> __last,
224 __bit_iterator<_Cp, false> __result) const {
225 if (__first.__ctz_ == __result.__ctz_)
226 return std::make_pair(__last, std::__copy_aligned(__first, __last, __result));
227 return std::make_pair(__last, std::__copy_unaligned(__first, __last, __result));
228 }
229
230 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.111 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
231 template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>112 template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
232 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>113 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>
lib/libcxx/include/__algorithm/copy_backward.h+9-24
...@@ -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/copy_n.h>13#include <__algorithm/copy_n.h>
14#include <__algorithm/for_each_segment.h>
14#include <__algorithm/iterator_operations.h>15#include <__algorithm/iterator_operations.h>
15#include <__algorithm/min.h>16#include <__algorithm/min.h>
16#include <__config>17#include <__config>
...@@ -170,37 +171,20 @@ struct __copy_backward_impl {...@@ -170,37 +171,20 @@ struct __copy_backward_impl {
170 return std::make_pair(std::move(__original_last_iter), std::move(__result));171 return std::make_pair(std::move(__original_last_iter), std::move(__result));
171 }172 }
172173
173 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>174 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
174 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>175 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
175 operator()(_InIter __first, _InIter __last, _OutIter __result) const {176 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
176 using _Traits = __segmented_iterator_traits<_InIter>;177 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;
177 auto __sfirst = _Traits::__segment(__first);178 std::__for_each_segment_backward(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {
178 auto __slast = _Traits::__segment(__last);179 __result = std::__copy_backward<_AlgPolicy>(std::move(__lfirst), std::move(__llast), std::move(__result)).second;
179 if (__sfirst == __slast) {180 });
180 auto __iters =
181 std::__copy_backward<_AlgPolicy>(_Traits::__local(__first), _Traits::__local(__last), std::move(__result));
182 return std::make_pair(__last, __iters.second);
183 }
184
185 __result =
186 std::__copy_backward<_AlgPolicy>(_Traits::__begin(__slast), _Traits::__local(__last), std::move(__result))
187 .second;
188 --__slast;
189 while (__sfirst != __slast) {
190 __result =
191 std::__copy_backward<_AlgPolicy>(_Traits::__begin(__slast), _Traits::__end(__slast), std::move(__result))
192 .second;
193 --__slast;
194 }
195 __result = std::__copy_backward<_AlgPolicy>(_Traits::__local(__first), _Traits::__end(__slast), std::move(__result))
196 .second;
197 return std::make_pair(__last, std::move(__result));181 return std::make_pair(__last, std::move(__result));
198 }182 }
199183
200 template <class _InIter,184 template <class _InIter,
201 class _OutIter,185 class _OutIter,
202 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&186 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
203 !__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,187 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
204 int> = 0>188 int> = 0>
205 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>189 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
206 operator()(_InIter __first, _InIter __last, _OutIter __result) const {190 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
...@@ -214,7 +198,8 @@ struct __copy_backward_impl {...@@ -214,7 +198,8 @@ struct __copy_backward_impl {
214198
215 auto __local_last = _Traits::__local(__result);199 auto __local_last = _Traits::__local(__result);
216 while (true) {200 while (true) {
217 using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;201 using _DiffT =
202 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;
218203
219 auto __local_first = _Traits::__begin(__segment_iterator);204 auto __local_first = _Traits::__begin(__segment_iterator);
220 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);205 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);
lib/libcxx/include/__algorithm/copy_n.h+50-16
...@@ -10,31 +10,63 @@...@@ -10,31 +10,63 @@
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/iterator_operations.h>
13#include <__config>14#include <__config>
14#include <__iterator/iterator_traits.h>15#include <__iterator/iterator_traits.h>
15#include <__type_traits/enable_if.h>16#include <__type_traits/enable_if.h>
16#include <__utility/convert_to_integral.h>17#include <__utility/convert_to_integral.h>
18#include <__utility/move.h>
19#include <__utility/pair.h>
1720
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19# pragma GCC system_header22# pragma GCC system_header
20#endif23#endif
2124
25_LIBCPP_PUSH_MACROS
26#include <__undef_macros>
27
22_LIBCPP_BEGIN_NAMESPACE_STD28_LIBCPP_BEGIN_NAMESPACE_STD
2329
30template <class _AlgPolicy,
31 class _InIter,
32 class _OutIter,
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>
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));
37}
38
39template <class _AlgPolicy,
40 class _InIter,
41 class _OutIter,
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>
44__copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_type<_InIter> __n, _OutIter __result) {
45 while (__n != 0) {
46 *__result = *__first;
47 ++__first;
48 ++__result;
49 --__n;
50 }
51 return std::make_pair(std::move(__first), std::move(__result));
52}
53
54// The InputIterator case is handled specially here because it's been written in a way to avoid incrementing __first
55// if not absolutely required. This was done to allow its use with istream_iterator and we want to avoid breaking
56// people, at least currently.
57// See https://github.com/llvm/llvm-project/commit/99847d2bf132854fffa019bab19818768102ccad
24template <class _InputIterator,58template <class _InputIterator,
25 class _Size,59 class _Size,
26 class _OutputIterator,60 class _OutputIterator,
27 __enable_if_t<__has_input_iterator_category<_InputIterator>::value &&61 __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
28 !__has_random_access_iterator_category<_InputIterator>::value,62_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
29 int> = 0>63copy_n(_InputIterator __first, _Size __n, _OutputIterator __result) {
30inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator64 using _IntegralSize = decltype(std::__convert_to_integral(__n));
31copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) {65 _IntegralSize __converted = __n;
32 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;66 if (__converted > 0) {
33 _IntegralSize __n = __orig_n;
34 if (__n > 0) {
35 *__result = *__first;67 *__result = *__first;
36 ++__result;68 ++__result;
37 for (--__n; __n > 0; --__n) {69 for (--__converted; __converted > 0; --__converted) {
38 ++__first;70 ++__first;
39 *__result = *__first;71 *__result = *__first;
40 ++__result;72 ++__result;
...@@ -46,15 +78,17 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) {...@@ -46,15 +78,17 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) {
46template <class _InputIterator,78template <class _InputIterator,
47 class _Size,79 class _Size,
48 class _OutputIterator,80 class _OutputIterator,
49 __enable_if_t<__has_random_access_iterator_category<_InputIterator>::value, int> = 0>81 __enable_if_t<!__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
50inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator82_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
51copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) {83copy_n(_InputIterator __first, _Size __n, _OutputIterator __result) {
52 typedef typename iterator_traits<_InputIterator>::difference_type difference_type;84 using _IntegralSize = decltype(std::__convert_to_integral(__n));
53 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;85 _IntegralSize __converted = __n;
54 _IntegralSize __n = __orig_n;86 return std::__copy_n<_ClassicAlgPolicy>(__first, __iterator_difference_type<_InputIterator>(__converted), __result)
55 return std::copy(__first, __first + difference_type(__n), __result);87 .second;
56}88}
5789
58_LIBCPP_END_NAMESPACE_STD90_LIBCPP_END_NAMESPACE_STD
5991
92_LIBCPP_POP_MACROS
93
60#endif // _LIBCPP___ALGORITHM_COPY_N_H94#endif // _LIBCPP___ALGORITHM_COPY_N_H
lib/libcxx/include/__algorithm/count.h+2-2
...@@ -72,7 +72,7 @@ __count_bool(__bit_iterator<_Cp, _IsConst> __first, typename __size_difference_t...@@ -72,7 +72,7 @@ __count_bool(__bit_iterator<_Cp, _IsConst> __first, typename __size_difference_t
72}72}
7373
74template <class, class _Cp, bool _IsConst, class _Tp, class _Proj, __enable_if_t<__is_identity<_Proj>::value, int> = 0>74template <class, class _Cp, bool _IsConst, class _Tp, class _Proj, __enable_if_t<__is_identity<_Proj>::value, int> = 0>
75_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<__bit_iterator<_Cp, _IsConst> >75_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iterator_difference_type<__bit_iterator<_Cp, _IsConst> >
76__count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value, _Proj&) {76__count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value, _Proj&) {
77 if (__value)77 if (__value)
78 return std::__count_bool<true>(78 return std::__count_bool<true>(
...@@ -82,7 +82,7 @@ __count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __l...@@ -82,7 +82,7 @@ __count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __l
82}82}
8383
84template <class _InputIterator, class _Tp>84template <class _InputIterator, class _Tp>
85[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator>85[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iterator_difference_type<_InputIterator>
86count(_InputIterator __first, _InputIterator __last, const _Tp& __value) {86count(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
87 __identity __proj;87 __identity __proj;
88 return std::__count<_ClassicAlgPolicy>(__first, __last, __value, __proj);88 return std::__count<_ClassicAlgPolicy>(__first, __last, __value, __proj);
lib/libcxx/include/__algorithm/equal.h+43-55
...@@ -160,22 +160,28 @@ template <class _Cp,...@@ -160,22 +160,28 @@ template <class _Cp,
160 bool _IsConst1,160 bool _IsConst1,
161 bool _IsConst2,161 bool _IsConst2,
162 class _BinaryPredicate,162 class _BinaryPredicate,
163 __enable_if_t<__desugars_to_v<__equal_tag, _BinaryPredicate, bool, bool>, int> = 0>163 class _Proj1,
164 class _Proj2,
165 __enable_if_t<__is_identity<_Proj1>::value && __is_identity<_Proj2>::value &&
166 __desugars_to_v<__equal_tag, _BinaryPredicate, bool, bool>,
167 int> = 0>
164[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(168[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(
165 __bit_iterator<_Cp, _IsConst1> __first1,169 __bit_iterator<_Cp, _IsConst1> __first1,
166 __bit_iterator<_Cp, _IsConst1> __last1,170 __bit_iterator<_Cp, _IsConst1> __last1,
167 __bit_iterator<_Cp, _IsConst2> __first2,171 __bit_iterator<_Cp, _IsConst2> __first2,
168 _BinaryPredicate) {172 _BinaryPredicate,
173 _Proj1&,
174 _Proj2&) {
169 if (__first1.__ctz_ == __first2.__ctz_)175 if (__first1.__ctz_ == __first2.__ctz_)
170 return std::__equal_aligned(__first1, __last1, __first2);176 return std::__equal_aligned(__first1, __last1, __first2);
171 return std::__equal_unaligned(__first1, __last1, __first2);177 return std::__equal_unaligned(__first1, __last1, __first2);
172}178}
173179
174template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>180template <class _InIter1, class _Sent1, class _InIter2, class _Pred, class _Proj1, class _Proj2>
175[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(181[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(
176 _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate& __pred) {182 _InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
177 for (; __first1 != __last1; ++__first1, (void)++__first2)183 for (; __first1 != __last1; ++__first1, (void)++__first2)
178 if (!__pred(*__first1, *__first2))184 if (!std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
179 return false;185 return false;
180 return true;186 return true;
181}187}
...@@ -183,19 +189,23 @@ template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>...@@ -183,19 +189,23 @@ template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
183template <class _Tp,189template <class _Tp,
184 class _Up,190 class _Up,
185 class _BinaryPredicate,191 class _BinaryPredicate,
186 __enable_if_t<__desugars_to_v<__equal_tag, _BinaryPredicate, _Tp, _Up> && !is_volatile<_Tp>::value &&192 class _Proj1,
187 !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,193 class _Proj2,
194 __enable_if_t<__is_identity<_Proj1>::value && __is_identity<_Proj2>::value &&
195 __desugars_to_v<__equal_tag, _BinaryPredicate, _Tp, _Up> && !is_volatile<_Tp>::value &&
196 !is_volatile<_Up>::value && __is_trivially_equality_comparable_v<_Tp, _Up>,
188 int> = 0>197 int> = 0>
189[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool198[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
190__equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&) {199__equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&, _Proj1&, _Proj2&) {
191 return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));200 return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));
192}201}
193202
194template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>203template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
195[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool204[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
196equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {205equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
206 __identity __proj;
197 return std::__equal_iter_impl(207 return std::__equal_iter_impl(
198 std::__unwrap_iter(__first1), std::__unwrap_iter(__last1), std::__unwrap_iter(__first2), __pred);208 std::__unwrap_iter(__first1), std::__unwrap_iter(__last1), std::__unwrap_iter(__first2), __pred, __proj, __proj);
199}209}
200210
201template <class _InputIterator1, class _InputIterator2>211template <class _InputIterator1, class _InputIterator2>
...@@ -206,52 +216,28 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first...@@ -206,52 +216,28 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
206216
207#if _LIBCPP_STD_VER >= 14217#if _LIBCPP_STD_VER >= 14
208218
209template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>219template <bool __known_equal_length,
210[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(220 class _Iter1,
211 _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __comp, _Proj1& __proj1, _Proj2& __proj2) {221 class _Sent1,
212 while (__first1 != __last1 && __first2 != __last2) {222 class _Iter2,
213 if (!std::__invoke(__comp, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))223 class _Sent2,
214 return false;
215 ++__first1;
216 ++__first2;
217 }
218 return __first1 == __last1 && __first2 == __last2;
219}
220
221template <class _Tp,
222 class _Up,
223 class _Pred,
224 class _Proj1,
225 class _Proj2,
226 __enable_if_t<__desugars_to_v<__equal_tag, _Pred, _Tp, _Up> && __is_identity<_Proj1>::value &&
227 __is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value &&
228 __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
229 int> = 0>
230[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
231__equal_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, _Proj2&) {
232 return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));
233}
234
235template <class _Cp,
236 bool _IsConst1,
237 bool _IsConst2,
238 class _Pred,224 class _Pred,
239 class _Proj1,225 class _Proj1,
240 class _Proj2,226 class _Proj2>
241 __enable_if_t<__desugars_to_v<__equal_tag, _Pred, bool, bool> && __is_identity<_Proj1>::value &&
242 __is_identity<_Proj2>::value,
243 int> = 0>
244[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(227[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(
245 __bit_iterator<_Cp, _IsConst1> __first1,228 _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __comp, _Proj1& __proj1, _Proj2& __proj2) {
246 __bit_iterator<_Cp, _IsConst1> __last1,229 if constexpr (__known_equal_length) {
247 __bit_iterator<_Cp, _IsConst2> __first2,230 return std::__equal_iter_impl(
248 __bit_iterator<_Cp, _IsConst2>,231 std::move(__first1), std::move(__last1), std::move(__first2), __comp, __proj1, __proj2);
249 _Pred&,232 } else {
250 _Proj1&,233 while (__first1 != __last1 && __first2 != __last2) {
251 _Proj2&) {234 if (!std::__invoke(__comp, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
252 if (__first1.__ctz_ == __first2.__ctz_)235 return false;
253 return std::__equal_aligned(__first1, __last1, __first2);236 ++__first1;
254 return std::__equal_unaligned(__first1, __last1, __first2);237 ++__first2;
238 }
239 return __first1 == __last1 && __first2 == __last2;
240 }
255}241}
256242
257template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>243template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
...@@ -261,13 +247,15 @@ equal(_InputIterator1 __first1,...@@ -261,13 +247,15 @@ equal(_InputIterator1 __first1,
261 _InputIterator2 __first2,247 _InputIterator2 __first2,
262 _InputIterator2 __last2,248 _InputIterator2 __last2,
263 _BinaryPredicate __pred) {249 _BinaryPredicate __pred) {
264 if constexpr (__has_random_access_iterator_category<_InputIterator1>::value &&250 static constexpr bool __both_random_access =
265 __has_random_access_iterator_category<_InputIterator2>::value) {251 __has_random_access_iterator_category<_InputIterator1>::value &&
252 __has_random_access_iterator_category<_InputIterator2>::value;
253 if constexpr (__both_random_access) {
266 if (std::distance(__first1, __last1) != std::distance(__first2, __last2))254 if (std::distance(__first1, __last1) != std::distance(__first2, __last2))
267 return false;255 return false;
268 }256 }
269 __identity __proj;257 __identity __proj;
270 return std::__equal_impl(258 return std::__equal_impl<__both_random_access>(
271 std::__unwrap_iter(__first1),259 std::__unwrap_iter(__first1),
272 std::__unwrap_iter(__last1),260 std::__unwrap_iter(__last1),
273 std::__unwrap_iter(__first2),261 std::__unwrap_iter(__first2),
lib/libcxx/include/__algorithm/fill.h+26-8
...@@ -10,8 +10,12 @@...@@ -10,8 +10,12 @@
10#define _LIBCPP___ALGORITHM_FILL_H10#define _LIBCPP___ALGORITHM_FILL_H
1111
12#include <__algorithm/fill_n.h>12#include <__algorithm/fill_n.h>
13#include <__algorithm/for_each_segment.h>
13#include <__config>14#include <__config>
14#include <__iterator/iterator_traits.h>15#include <__iterator/iterator_traits.h>
16#include <__iterator/segmented_iterator.h>
17#include <__type_traits/enable_if.h>
18#include <__type_traits/is_same.h>
1519
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header21# pragma GCC system_header
...@@ -21,23 +25,37 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -21,23 +25,37 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2125
22// fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.26// fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
2327
24template <class _ForwardIterator, class _Tp>28template <class _ForwardIterator, class _Sentinel, class _Tp>
25inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void29inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
26__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, forward_iterator_tag) {30__fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __value) {
31#ifndef _LIBCPP_CXX03_LANG
32 if constexpr (is_same<_ForwardIterator, _Sentinel>::value && __is_segmented_iterator_v<_ForwardIterator>) {
33 using __local_iterator_t = typename __segmented_iterator_traits<_ForwardIterator>::__local_iterator;
34 std::__for_each_segment(__first, __last, [&](__local_iterator_t __lfirst, __local_iterator_t __llast) {
35 std::__fill(__lfirst, __llast, __value);
36 });
37 return __last;
38 }
39#endif
27 for (; __first != __last; ++__first)40 for (; __first != __last; ++__first)
28 *__first = __value;41 *__first = __value;
42 return __first;
29}43}
3044
31template <class _RandomAccessIterator, class _Tp>45template <class _RandomAccessIterator,
32inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void46 class _Tp,
33__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value, random_access_iterator_tag) {47 __enable_if_t<__has_random_access_iterator_category<_RandomAccessIterator>::value &&
34 std::fill_n(__first, __last - __first, __value);48 !__is_segmented_iterator_v<_RandomAccessIterator>,
49 int> = 0>
50inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator
51__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value) {
52 return std::__fill_n(__first, __last - __first, __value);
35}53}
3654
37template <class _ForwardIterator, class _Tp>55template <class _ForwardIterator, class _Tp>
38inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void56inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
39fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {57fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
40 std::__fill(__first, __last, __value, typename iterator_traits<_ForwardIterator>::iterator_category());58 std::__fill(__first, __last, __value);
41}59}
4260
43_LIBCPP_END_NAMESPACE_STD61_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/fill_n.h+32-46
...@@ -9,11 +9,14 @@...@@ -9,11 +9,14 @@
9#ifndef _LIBCPP___ALGORITHM_FILL_N_H9#ifndef _LIBCPP___ALGORITHM_FILL_N_H
10#define _LIBCPP___ALGORITHM_FILL_N_H10#define _LIBCPP___ALGORITHM_FILL_N_H
1111
12#include <__algorithm/min.h>12#include <__algorithm/for_each_n_segment.h>
13#include <__algorithm/specialized_algorithms.h>
13#include <__config>14#include <__config>
14#include <__fwd/bit_reference.h>15#include <__iterator/iterator_traits.h>
15#include <__memory/pointer_traits.h>16#include <__iterator/segmented_iterator.h>
17#include <__type_traits/enable_if.h>
16#include <__utility/convert_to_integral.h>18#include <__utility/convert_to_integral.h>
19#include <__utility/move.h>
1720
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19# pragma GCC system_header22# pragma GCC system_header
...@@ -26,56 +29,39 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -26,56 +29,39 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2629
27// fill_n isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.30// fill_n isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
2831
29template <class _OutputIterator, class _Size, class _Tp>32template <
30inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator33 class _OutputIterator,
31__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value);34 class _Size,
3235 class _Tp,
33template <bool _FillVal, class _Cp>36 __enable_if_t<!__specialized_algorithm<_Algorithm::__fill_n, __single_iterator<_OutputIterator> >::__has_algorithm,
34_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void37 int> = 0>
35__fill_n_bool(__bit_iterator<_Cp, false> __first, typename __size_difference_type_traits<_Cp>::size_type __n) {
36 using _It = __bit_iterator<_Cp, false>;
37 using __storage_type = typename _It::__storage_type;
38
39 const int __bits_per_word = _It::__bits_per_word;
40 // do first partial word
41 if (__first.__ctz_ != 0) {
42 __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
43 __storage_type __dn = std::min(__clz_f, __n);
44 std::__fill_masked_range(std::__to_address(__first.__seg_), __clz_f - __dn, __first.__ctz_, _FillVal);
45 __n -= __dn;
46 ++__first.__seg_;
47 }
48 // do middle whole words
49 __storage_type __nw = __n / __bits_per_word;
50 std::__fill_n(std::__to_address(__first.__seg_), __nw, _FillVal ? static_cast<__storage_type>(-1) : 0);
51 __n -= __nw * __bits_per_word;
52 // do last partial word
53 if (__n > 0) {
54 __first.__seg_ += __nw;
55 std::__fill_masked_range(std::__to_address(__first.__seg_), __bits_per_word - __n, 0u, _FillVal);
56 }
57}
58
59template <class _Cp, class _Size>
60inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cp, false>
61__fill_n(__bit_iterator<_Cp, false> __first, _Size __n, const bool& __value) {
62 if (__n > 0) {
63 if (__value)
64 std::__fill_n_bool<true>(__first, __n);
65 else
66 std::__fill_n_bool<false>(__first, __n);
67 }
68 return __first + __n;
69}
70
71template <class _OutputIterator, class _Size, class _Tp>
72inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator38inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
73__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {39__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {
40#ifndef _LIBCPP_CXX03_LANG
41 if constexpr (__is_segmented_iterator_v<_OutputIterator>) {
42 using __local_iterator = typename __segmented_iterator_traits<_OutputIterator>::__local_iterator;
43 if constexpr (__has_random_access_iterator_category<__local_iterator>::value) {
44 return std::__for_each_n_segment(__first, __n, [&](__local_iterator __lfirst, __local_iterator __llast) {
45 std::__fill_n(__lfirst, __llast - __lfirst, __value);
46 });
47 }
48 }
49#endif
74 for (; __n > 0; ++__first, (void)--__n)50 for (; __n > 0; ++__first, (void)--__n)
75 *__first = __value;51 *__first = __value;
76 return __first;52 return __first;
77}53}
7854
55template <class _OutIter,
56 class _Size,
57 class _Tp,
58 __enable_if_t<__specialized_algorithm<_Algorithm::__fill_n, __single_iterator<_OutIter> >::__has_algorithm,
59 int> = 0>
60_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutIter __fill_n(_OutIter __first, _Size __n, const _Tp& __value) {
61 return __specialized_algorithm<_Algorithm::__fill_n, __single_iterator<_OutIter> >()(
62 std::move(__first), __n, __value);
63}
64
79template <class _OutputIterator, class _Size, class _Tp>65template <class _OutputIterator, class _Size, class _Tp>
80inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator66inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
81fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {67fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {
lib/libcxx/include/__algorithm/find.h+96-39
...@@ -12,16 +12,19 @@...@@ -12,16 +12,19 @@
1212
13#include <__algorithm/find_segment_if.h>13#include <__algorithm/find_segment_if.h>
14#include <__algorithm/min.h>14#include <__algorithm/min.h>
15#include <__algorithm/simd_utils.h>
15#include <__algorithm/unwrap_iter.h>16#include <__algorithm/unwrap_iter.h>
16#include <__bit/countr.h>17#include <__bit/countr.h>
17#include <__bit/invert_if.h>18#include <__bit/invert_if.h>
18#include <__config>19#include <__config>
20#include <__cstddef/size_t.h>
19#include <__functional/identity.h>21#include <__functional/identity.h>
20#include <__fwd/bit_reference.h>22#include <__fwd/bit_reference.h>
21#include <__iterator/segmented_iterator.h>23#include <__iterator/segmented_iterator.h>
22#include <__string/constexpr_c_functions.h>24#include <__string/constexpr_c_functions.h>
23#include <__type_traits/enable_if.h>25#include <__type_traits/enable_if.h>
24#include <__type_traits/invoke.h>26#include <__type_traits/invoke.h>
27#include <__type_traits/is_constant_evaluated.h>
25#include <__type_traits/is_equality_comparable.h>28#include <__type_traits/is_equality_comparable.h>
26#include <__type_traits/is_integral.h>29#include <__type_traits/is_integral.h>
27#include <__type_traits/is_signed.h>30#include <__type_traits/is_signed.h>
...@@ -44,46 +47,108 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -44,46 +47,108 @@ _LIBCPP_BEGIN_NAMESPACE_STD
44// generic implementation47// generic implementation
45template <class _Iter, class _Sent, class _Tp, class _Proj>48template <class _Iter, class _Sent, class _Tp, class _Proj>
46_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter49_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
47__find(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {50__find_loop(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
48 for (; __first != __last; ++__first)51 for (; __first != __last; ++__first)
49 if (std::__invoke(__proj, *__first) == __value)52 if (std::__invoke(__proj, *__first) == __value)
50 break;53 break;
51 return __first;54 return __first;
52}55}
5356
54// trivially equality comparable implementations57template <class _Iter, class _Sent, class _Tp, class _Proj>
55template <class _Tp,58_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
56 class _Up,59__find(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
57 class _Proj,60 return std::__find_loop(std::move(__first), std::move(__last), __value, __proj);
58 __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&
59 sizeof(_Tp) == 1,
60 int> = 0>
61_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
62 if (auto __ret = std::__constexpr_memchr(__first, __value, __last - __first))
63 return __ret;
64 return __last;
65}61}
6662
67#if _LIBCPP_HAS_WIDE_CHARACTERS63#if _LIBCPP_VECTORIZE_ALGORITHMS
64template <class _Tp, class _Up>
65[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
66_LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find_vectorized(_Tp* __first, _Tp* __last, _Up __value) {
67 if (!__libcpp_is_constant_evaluated()) {
68 constexpr size_t __unroll_count = 4;
69 constexpr size_t __vec_size = __native_vector_size<_Tp>;
70 using __vec = __simd_vector<_Tp, __vec_size>;
71
72 auto __orig_first = __first;
73
74 auto __values = static_cast<__simd_vector<_Tp, __vec_size>>(__value); // broadcast the value
75 while (static_cast<size_t>(__last - __first) >= __unroll_count * __vec_size) [[__unlikely__]] {
76 __vec __lhs[__unroll_count];
77
78 for (size_t __i = 0; __i != __unroll_count; ++__i)
79 __lhs[__i] = std::__load_vector<__vec>(__first + __i * __vec_size);
80
81 for (size_t __i = 0; __i != __unroll_count; ++__i) {
82 if (auto __cmp_res = __lhs[__i] == __values; std::__any_of(__cmp_res)) {
83 auto __offset = __i * __vec_size + std::__find_first_set(__cmp_res);
84 return __first + __offset;
85 }
86 }
87
88 __first += __unroll_count * __vec_size;
89 }
90
91 // check the remaining 0-3 vectors
92 while (static_cast<size_t>(__last - __first) >= __vec_size) {
93 if (auto __cmp_res = std::__load_vector<__vec>(__first) == __values; std::__any_of(__cmp_res)) {
94 return __first + std::__find_first_set(__cmp_res);
95 }
96 __first += __vec_size;
97 }
98
99 if (__last - __first == 0)
100 return __first;
101
102 // Check if we can load elements in front of the current pointer. If that's the case load a vector at
103 // (last - vector_size) to check the remaining elements
104 if (static_cast<size_t>(__first - __orig_first) >= __vec_size) {
105 __first = __last - __vec_size;
106 return __first + std::__find_first_set(std::__load_vector<__vec>(__first) == __values);
107 }
108 }
109
110 __identity __proj;
111 return std::__find_loop(__first, __last, __value, __proj);
112}
113#endif
114
115#ifndef _LIBCPP_CXX03_LANG
116// trivially equality comparable implementations
68template <class _Tp,117template <class _Tp,
69 class _Up,118 class _Up,
70 class _Proj,119 class _Proj,
71 __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&120 __enable_if_t<__is_identity<_Proj>::value && __is_trivially_equality_comparable_v<_Tp, _Up>, int> = 0>
72 sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t),
73 int> = 0>
74_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {121_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
75 if (auto __ret = std::__constexpr_wmemchr(__first, __value, __last - __first))122 if constexpr (sizeof(_Tp) == 1) {
76 return __ret;123 if (auto __ret = std::__constexpr_memchr(__first, __value, __last - __first))
77 return __last;124 return __ret;
125 return __last;
126 }
127# if _LIBCPP_HAS_WIDE_CHARACTERS
128 else if constexpr (sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t)) {
129 if (auto __ret = std::__constexpr_wmemchr(__first, __value, __last - __first))
130 return __ret;
131 return __last;
132 }
133# endif
134# if _LIBCPP_VECTORIZE_ALGORITHMS
135 else if constexpr (is_integral<_Tp>::value) {
136 return std::__find_vectorized(__first, __last, __value);
137 }
138# endif
139 else {
140 __identity __proj;
141 return std::__find_loop(__first, __last, __value, __proj);
142 }
78}143}
79#endif // _LIBCPP_HAS_WIDE_CHARACTERS144#endif
80145
81// TODO: This should also be possible to get right with different signedness146// TODO: This should also be possible to get right with different signedness
82// cast integral types to allow vectorization147// cast integral types to allow vectorization
83template <class _Tp,148template <class _Tp,
84 class _Up,149 class _Up,
85 class _Proj,150 class _Proj,
86 __enable_if_t<__is_identity<_Proj>::value && !__libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&151 __enable_if_t<__is_identity<_Proj>::value && !__is_trivially_equality_comparable_v<_Tp, _Up> &&
87 is_integral<_Tp>::value && is_integral<_Up>::value &&152 is_integral<_Tp>::value && is_integral<_Up>::value &&
88 is_signed<_Tp>::value == is_signed<_Up>::value,153 is_signed<_Tp>::value == is_signed<_Up>::value,
89 int> = 0>154 int> = 0>
...@@ -143,31 +208,23 @@ __find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __la...@@ -143,31 +208,23 @@ __find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __la
143208
144// segmented iterator implementation209// segmented iterator implementation
145210
146template <class>
147struct __find_segment;
148
149template <class _SegmentedIterator,211template <class _SegmentedIterator,
150 class _Tp,212 class _Tp,
151 class _Proj,213 class _Proj,
152 __enable_if_t<__is_segmented_iterator<_SegmentedIterator>::value, int> = 0>214 __enable_if_t<__is_segmented_iterator_v<_SegmentedIterator>, int> = 0>
153_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator215_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator
154__find(_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) {216__find(_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) {
155 return std::__find_segment_if(std::move(__first), std::move(__last), __find_segment<_Tp>(__value), __proj);217 using __local_iterator = typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator;
218 return std::__find_segment_if(
219 std::move(__first),
220 std::move(__last),
221 [&__value](__local_iterator __lfirst, __local_iterator __llast, _Proj& __lproj) {
222 return std::__rewrap_iter(
223 __lfirst, std::__find(std::__unwrap_iter(__lfirst), std::__unwrap_iter(__llast), __value, __lproj));
224 },
225 __proj);
156}226}
157227
158template <class _Tp>
159struct __find_segment {
160 const _Tp& __value_;
161
162 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __find_segment(const _Tp& __value) : __value_(__value) {}
163
164 template <class _InputIterator, class _Proj>
165 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _InputIterator
166 operator()(_InputIterator __first, _InputIterator __last, _Proj& __proj) const {
167 return std::__find(__first, __last, __value_, __proj);
168 }
169};
170
171// public API228// public API
172template <class _InputIterator, class _Tp>229template <class _InputIterator, class _Tp>
173[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator230[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
lib/libcxx/include/__algorithm/find_end.h+105
...@@ -76,6 +76,111 @@ _LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1>...@@ -76,6 +76,111 @@ _LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1>
76 }76 }
77}77}
7878
79template <class _AlgPolicy,
80 class _Pred,
81 class _Iter1,
82 class _Sent1,
83 class _Iter2,
84 class _Sent2,
85 class _Proj1,
86 class _Proj2>
87_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter1> __find_end_impl(
88 _Iter1 __first1,
89 _Sent1 __sent1,
90 _Iter2 __first2,
91 _Sent2 __sent2,
92 _Pred& __pred,
93 _Proj1& __proj1,
94 _Proj2& __proj2,
95 bidirectional_iterator_tag,
96 bidirectional_iterator_tag) {
97 auto __last1 = _IterOps<_AlgPolicy>::next(__first1, __sent1);
98 auto __last2 = _IterOps<_AlgPolicy>::next(__first2, __sent2);
99 // modeled after search algorithm (in reverse)
100 if (__first2 == __last2)
101 return std::make_pair(__last1, __last1); // Everything matches an empty sequence
102 _Iter1 __l1 = __last1;
103 _Iter2 __l2 = __last2;
104 --__l2;
105 while (true) {
106 // Find last element in sequence 1 that matches *(__last2-1), with a mininum of loop checks
107 while (true) {
108 if (__first1 == __l1) // return __last1 if no element matches *__first2
109 return std::make_pair(__last1, __last1);
110 if (std::__invoke(__pred, std::__invoke(__proj1, *--__l1), std::__invoke(__proj2, *__l2)))
111 break;
112 }
113 // *__l1 matches *__l2, now match elements before here
114 _Iter1 __match_last = __l1;
115 _Iter1 __m1 = __l1;
116 _Iter2 __m2 = __l2;
117 while (true) {
118 if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern)
119 return std::make_pair(__m1, ++__match_last);
120 if (__m1 == __first1) // Otherwise if source exhaused, pattern not found
121 return std::make_pair(__last1, __last1);
122
123 // if there is a mismatch, restart with a new __l1
124 if (!std::__invoke(__pred, std::__invoke(__proj1, *--__m1), std::__invoke(__proj2, *--__m2))) {
125 break;
126 } // else there is a match, check next elements
127 }
128 }
129}
130
131template <class _AlgPolicy,
132 class _Pred,
133 class _Iter1,
134 class _Sent1,
135 class _Iter2,
136 class _Sent2,
137 class _Proj1,
138 class _Proj2>
139_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __find_end_impl(
140 _Iter1 __first1,
141 _Sent1 __sent1,
142 _Iter2 __first2,
143 _Sent2 __sent2,
144 _Pred& __pred,
145 _Proj1& __proj1,
146 _Proj2& __proj2,
147 random_access_iterator_tag,
148 random_access_iterator_tag) {
149 typedef typename iterator_traits<_Iter1>::difference_type _D1;
150 auto __last1 = _IterOps<_AlgPolicy>::next(__first1, __sent1);
151 auto __last2 = _IterOps<_AlgPolicy>::next(__first2, __sent2);
152 // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
153 auto __len2 = __last2 - __first2;
154 if (__len2 == 0)
155 return std::make_pair(__last1, __last1);
156 auto __len1 = __last1 - __first1;
157 if (__len1 < __len2)
158 return std::make_pair(__last1, __last1);
159 const _Iter1 __s = __first1 + _D1(__len2 - 1); // End of pattern match can't go before here
160 _Iter1 __l1 = __last1;
161 _Iter2 __l2 = __last2;
162 --__l2;
163 while (true) {
164 while (true) {
165 if (__s == __l1)
166 return std::make_pair(__last1, __last1);
167 if (std::__invoke(__pred, std::__invoke(__proj1, *--__l1), std::__invoke(__proj2, *__l2)))
168 break;
169 }
170 _Iter1 __last_match = __l1;
171 _Iter1 __m1 = __l1;
172 _Iter2 __m2 = __l2;
173 while (true) {
174 if (__m2 == __first2)
175 return std::make_pair(__m1, ++__last_match);
176 // no need to check range on __m1 because __s guarantees we have enough source
177 if (!std::__invoke(__pred, std::__invoke(__proj1, *--__m1), std::__invoke(__proj2, *--__m2))) {
178 break;
179 }
180 }
181 }
182}
183
79template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>184template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
80[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator1 __find_end_classic(185[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator1 __find_end_classic(
81 _ForwardIterator1 __first1,186 _ForwardIterator1 __first1,
lib/libcxx/include/__algorithm/for_each.h+18-24
...@@ -11,45 +11,41 @@...@@ -11,45 +11,41 @@
11#define _LIBCPP___ALGORITHM_FOR_EACH_H11#define _LIBCPP___ALGORITHM_FOR_EACH_H
1212
13#include <__algorithm/for_each_segment.h>13#include <__algorithm/for_each_segment.h>
14#include <__algorithm/specialized_algorithms.h>
14#include <__config>15#include <__config>
15#include <__functional/identity.h>16#include <__functional/identity.h>
16#include <__iterator/segmented_iterator.h>17#include <__iterator/segmented_iterator.h>
17#include <__type_traits/enable_if.h>
18#include <__type_traits/invoke.h>18#include <__type_traits/invoke.h>
19#include <__utility/move.h>19#include <__type_traits/is_same.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
23#endif23#endif
2424
25_LIBCPP_PUSH_MACROS
26#include <__undef_macros>
27
28_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2926
30template <class _InputIterator, class _Sent, class _Func, class _Proj>27template <class _InputIterator, class _Sent, class _Func, class _Proj>
31_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
32__for_each(_InputIterator __first, _Sent __last, _Func& __f, _Proj& __proj) {29__for_each(_InputIterator __first, _Sent __last, _Func& __func, _Proj& __proj) {
30#ifndef _LIBCPP_CXX03_LANG
31 if constexpr (using _SpecialAlg =
32 __specialized_algorithm<_Algorithm::__for_each, __iterator_pair<_InputIterator, _Sent>>;
33 _SpecialAlg::__has_algorithm) {
34 _SpecialAlg()(__first, __last, __func, __proj);
35 return __last;
36 } else if constexpr (is_same<_InputIterator, _Sent>::value && __is_segmented_iterator_v<_InputIterator>) {
37 using __local_iterator_t = typename __segmented_iterator_traits<_InputIterator>::__local_iterator;
38 std::__for_each_segment(__first, __last, [&](__local_iterator_t __lfirst, __local_iterator_t __llast) {
39 std::__for_each(__lfirst, __llast, __func, __proj);
40 });
41 return __last;
42 }
43#endif
33 for (; __first != __last; ++__first)44 for (; __first != __last; ++__first)
34 std::__invoke(__f, std::__invoke(__proj, *__first));45 std::__invoke(__func, std::__invoke(__proj, *__first));
35 return __first;46 return __first;
36}47}
3748
38#ifndef _LIBCPP_CXX03_LANG
39template <class _SegmentedIterator,
40 class _Func,
41 class _Proj,
42 __enable_if_t<__is_segmented_iterator<_SegmentedIterator>::value, int> = 0>
43_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _SegmentedIterator
44__for_each(_SegmentedIterator __first, _SegmentedIterator __last, _Func& __func, _Proj& __proj) {
45 using __local_iterator_t = typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator;
46 std::__for_each_segment(__first, __last, [&](__local_iterator_t __lfirst, __local_iterator_t __llast) {
47 std::__for_each(__lfirst, __llast, __func, __proj);
48 });
49 return __last;
50}
51#endif // !_LIBCPP_CXX03_LANG
52
53template <class _InputIterator, class _Func>49template <class _InputIterator, class _Func>
54_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Func50_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Func
55for_each(_InputIterator __first, _InputIterator __last, _Func __f) {51for_each(_InputIterator __first, _InputIterator __last, _Func __f) {
...@@ -60,6 +56,4 @@ for_each(_InputIterator __first, _InputIterator __last, _Func __f) {...@@ -60,6 +56,4 @@ for_each(_InputIterator __first, _InputIterator __last, _Func __f) {
6056
61_LIBCPP_END_NAMESPACE_STD57_LIBCPP_END_NAMESPACE_STD
6258
63_LIBCPP_POP_MACROS
64
65#endif // _LIBCPP___ALGORITHM_FOR_EACH_H59#endif // _LIBCPP___ALGORITHM_FOR_EACH_H
lib/libcxx/include/__algorithm/for_each_n.h+20-47
...@@ -16,10 +16,7 @@...@@ -16,10 +16,7 @@
16#include <__functional/identity.h>16#include <__functional/identity.h>
17#include <__iterator/iterator_traits.h>17#include <__iterator/iterator_traits.h>
18#include <__iterator/segmented_iterator.h>18#include <__iterator/segmented_iterator.h>
19#include <__type_traits/disjunction.h>
20#include <__type_traits/enable_if.h>
21#include <__type_traits/invoke.h>19#include <__type_traits/invoke.h>
22#include <__type_traits/negation.h>
23#include <__utility/convert_to_integral.h>20#include <__utility/convert_to_integral.h>
24#include <__utility/move.h>21#include <__utility/move.h>
2522
...@@ -32,57 +29,33 @@ _LIBCPP_PUSH_MACROS...@@ -32,57 +29,33 @@ _LIBCPP_PUSH_MACROS
3229
33_LIBCPP_BEGIN_NAMESPACE_STD30_LIBCPP_BEGIN_NAMESPACE_STD
3431
35template <class _InputIterator,32template <class _InputIterator, class _Size, class _Func, class _Proj>
36 class _Size,
37 class _Func,
38 class _Proj,
39 __enable_if_t<!__has_random_access_iterator_category<_InputIterator>::value &&
40 _Or< _Not<__is_segmented_iterator<_InputIterator> >,
41 _Not<__has_random_access_local_iterator<_InputIterator> > >::value,
42 int> = 0>
43_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator33_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
44__for_each_n(_InputIterator __first, _Size __orig_n, _Func& __f, _Proj& __proj) {34__for_each_n(_InputIterator __first, _Size __orig_n, _Func& __f, _Proj& __proj) {
45 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;35 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;
46 _IntegralSize __n = __orig_n;36 _IntegralSize __n = __orig_n;
47 while (__n > 0) {
48 std::__invoke(__f, std::__invoke(__proj, *__first));
49 ++__first;
50 --__n;
51 }
52 return std::move(__first);
53}
54
55template <class _RandIter,
56 class _Size,
57 class _Func,
58 class _Proj,
59 __enable_if_t<__has_random_access_iterator_category<_RandIter>::value, int> = 0>
60_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandIter
61__for_each_n(_RandIter __first, _Size __orig_n, _Func& __f, _Proj& __proj) {
62 typename std::iterator_traits<_RandIter>::difference_type __n = __orig_n;
63 auto __last = __first + __n;
64 std::__for_each(__first, __last, __f, __proj);
65 return __last;
66}
6737
68#ifndef _LIBCPP_CXX03_LANG38#ifndef _LIBCPP_CXX03_LANG
69template <class _SegmentedIterator,39 if constexpr (__is_segmented_iterator_v<_InputIterator>) {
70 class _Size,40 using __local_iterator = typename __segmented_iterator_traits<_InputIterator>::__local_iterator;
71 class _Func,41 if constexpr (__has_random_access_iterator_category<__local_iterator>::value) {
72 class _Proj,42 return std::__for_each_n_segment(__first, __orig_n, [&](__local_iterator __lfirst, __local_iterator __llast) {
73 __enable_if_t<!__has_random_access_iterator_category<_SegmentedIterator>::value &&43 std::__for_each(__lfirst, __llast, __f, __proj);
74 __is_segmented_iterator<_SegmentedIterator>::value &&44 });
75 __has_random_access_iterator_category<45 } else {
76 typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator>::value,46 return std::__for_each(__first, __first + __n, __f, __proj);
77 int> = 0>47 }
78_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _SegmentedIterator48 } else
79__for_each_n(_SegmentedIterator __first, _Size __orig_n, _Func& __f, _Proj& __proj) {49#endif
80 using __local_iterator_t = typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator;50 {
81 return std::__for_each_n_segment(__first, __orig_n, [&](__local_iterator_t __lfirst, __local_iterator_t __llast) {51 while (__n > 0) {
82 std::__for_each(__lfirst, __llast, __f, __proj);52 std::__invoke(__f, std::__invoke(__proj, *__first));
83 });53 ++__first;
54 --__n;
55 }
56 return std::move(__first);
57 }
84}58}
85#endif // !_LIBCPP_CXX03_LANG
8659
87#if _LIBCPP_STD_VER >= 1760#if _LIBCPP_STD_VER >= 17
8861
lib/libcxx/include/__algorithm/for_each_n_segment.h+1-1
...@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
27template <class _SegmentedIterator, class _Size, class _Functor>27template <class _SegmentedIterator, class _Size, class _Functor>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator
29__for_each_n_segment(_SegmentedIterator __first, _Size __orig_n, _Functor __func) {29__for_each_n_segment(_SegmentedIterator __first, _Size __orig_n, _Functor __func) {
30 static_assert(__is_segmented_iterator<_SegmentedIterator>::value &&30 static_assert(__is_segmented_iterator_v<_SegmentedIterator> &&
31 __has_random_access_iterator_category<31 __has_random_access_iterator_category<
32 typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator>::value,32 typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator>::value,
33 "__for_each_n_segment only works with segmented iterators with random-access local iterators");33 "__for_each_n_segment only works with segmented iterators with random-access local iterators");
lib/libcxx/include/__algorithm/for_each_segment.h+26
...@@ -48,6 +48,32 @@ __for_each_segment(_SegmentedIterator __first, _SegmentedIterator __last, _Funct...@@ -48,6 +48,32 @@ __for_each_segment(_SegmentedIterator __first, _SegmentedIterator __last, _Funct
48 __func(_Traits::__begin(__sfirst), _Traits::__local(__last));48 __func(_Traits::__begin(__sfirst), _Traits::__local(__last));
49}49}
5050
51template <class _SegmentedIterator, class _Functor>
52_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
53__for_each_segment_backward(_SegmentedIterator __first, _SegmentedIterator __last, _Functor __func) {
54 using _Traits = __segmented_iterator_traits<_SegmentedIterator>;
55
56 auto __sfirst = _Traits::__segment(__first);
57 auto __slast = _Traits::__segment(__last);
58
59 // We are in a single segment, so we might not be at the beginning or end
60 if (__sfirst == __slast) {
61 __func(_Traits::__local(__first), _Traits::__local(__last));
62 return;
63 }
64
65 // We have more than one segment. Iterate over the last segment, since we might not start at the end
66 __func(_Traits::__begin(__slast), _Traits::__local(__last));
67 --__slast;
68 // iterate over the segments which are guaranteed to be completely in the range
69 while (__sfirst != __slast) {
70 __func(_Traits::__begin(__slast), _Traits::__end(__slast));
71 --__slast;
72 }
73 // iterate over the first segment
74 __func(_Traits::__local(__first), _Traits::__end(__slast));
75}
76
51_LIBCPP_END_NAMESPACE_STD77_LIBCPP_END_NAMESPACE_STD
5278
53#endif // _LIBCPP___ALGORITHM_FOR_EACH_SEGMENT_H79#endif // _LIBCPP___ALGORITHM_FOR_EACH_SEGMENT_H
lib/libcxx/include/__algorithm/generate.h+4-2
...@@ -9,7 +9,9 @@...@@ -9,7 +9,9 @@
9#ifndef _LIBCPP___ALGORITHM_GENERATE_H9#ifndef _LIBCPP___ALGORITHM_GENERATE_H
10#define _LIBCPP___ALGORITHM_GENERATE_H10#define _LIBCPP___ALGORITHM_GENERATE_H
1111
12#include <__algorithm/for_each.h>
12#include <__config>13#include <__config>
14#include <__utility/forward.h>
1315
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header17# pragma GCC system_header
...@@ -20,8 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -20,8 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
20template <class _ForwardIterator, class _Generator>22template <class _ForwardIterator, class _Generator>
21inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void23inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
22generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) {24generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) {
23 for (; __first != __last; ++__first)25 using __iter_ref = decltype(*__first);
24 *__first = __gen();26 std::for_each(__first, __last, [&](__iter_ref __element) { std::forward<__iter_ref>(__element) = __gen(); });
25}27}
2628
27_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/generate_n.h+19-6
...@@ -9,25 +9,38 @@...@@ -9,25 +9,38 @@
9#ifndef _LIBCPP___ALGORITHM_GENERATE_N_H9#ifndef _LIBCPP___ALGORITHM_GENERATE_N_H
10#define _LIBCPP___ALGORITHM_GENERATE_N_H10#define _LIBCPP___ALGORITHM_GENERATE_N_H
1111
12#include <__algorithm/for_each_n.h>
12#include <__config>13#include <__config>
13#include <__utility/convert_to_integral.h>14#include <__functional/identity.h>
15#include <__utility/forward.h>
16#include <__utility/move.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
17#endif20#endif
1821
22_LIBCPP_PUSH_MACROS
23#include <__undef_macros>
24
19_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2026
27template <class _OutputIterator, class _Size, class _Generator>
28inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
29__generate_n(_OutputIterator __first, _Size __orig_n, _Generator& __gen) {
30 using __iter_ref = decltype(*__first);
31 __identity __proj;
32 auto __f = [&](__iter_ref __element) { std::forward<__iter_ref>(__element) = __gen(); };
33 return std::__for_each_n(std::move(__first), __orig_n, __f, __proj);
34}
35
21template <class _OutputIterator, class _Size, class _Generator>36template <class _OutputIterator, class _Size, class _Generator>
22inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator37inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
23generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) {38generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) {
24 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;39 return std::__generate_n(std::move(__first), __orig_n, __gen);
25 _IntegralSize __n = __orig_n;
26 for (; __n > 0; ++__first, (void)--__n)
27 *__first = __gen();
28 return __first;
29}40}
3041
31_LIBCPP_END_NAMESPACE_STD42_LIBCPP_END_NAMESPACE_STD
3243
44_LIBCPP_POP_MACROS
45
33#endif // _LIBCPP___ALGORITHM_GENERATE_N_H46#endif // _LIBCPP___ALGORITHM_GENERATE_N_H
lib/libcxx/include/__algorithm/is_permutation.h+4-4
...@@ -78,7 +78,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation_impl(...@@ -78,7 +78,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation_impl(
78 _Pred&& __pred,78 _Pred&& __pred,
79 _Proj1&& __proj1,79 _Proj1&& __proj1,
80 _Proj2&& __proj2) {80 _Proj2&& __proj2) {
81 using _D1 = __iter_diff_t<_Iter1>;81 using _D1 = __iterator_difference_type<_Iter1>;
8282
83 for (auto __i = __first1; __i != __last1; ++__i) {83 for (auto __i = __first1; __i != __last1; ++__i) {
84 // Have we already counted the number of *__i in [f1, l1)?84 // Have we already counted the number of *__i in [f1, l1)?
...@@ -126,7 +126,7 @@ template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _Fo...@@ -126,7 +126,7 @@ template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _Fo
126 return true;126 return true;
127127
128 // __first1 != __last1 && *__first1 != *__first2128 // __first1 != __last1 && *__first1 != *__first2
129 using _D1 = __iter_diff_t<_ForwardIterator1>;129 using _D1 = __iterator_difference_type<_ForwardIterator1>;
130 _D1 __l1 = _IterOps<_AlgPolicy>::distance(__first1, __last1);130 _D1 __l1 = _IterOps<_AlgPolicy>::distance(__first1, __last1);
131 if (__l1 == _D1(1))131 if (__l1 == _D1(1))
132 return false;132 return false;
...@@ -173,10 +173,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation(...@@ -173,10 +173,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation(
173 if (__first2 == __last2) // Second range is shorter173 if (__first2 == __last2) // Second range is shorter
174 return false;174 return false;
175175
176 using _D1 = __iter_diff_t<_Iter1>;176 using _D1 = __iterator_difference_type<_Iter1>;
177 _D1 __l1 = _IterOps<_AlgPolicy>::distance(__first1, __last1);177 _D1 __l1 = _IterOps<_AlgPolicy>::distance(__first1, __last1);
178178
179 using _D2 = __iter_diff_t<_Iter2>;179 using _D2 = __iterator_difference_type<_Iter2>;
180 _D2 __l2 = _IterOps<_AlgPolicy>::distance(__first2, __last2);180 _D2 __l2 = _IterOps<_AlgPolicy>::distance(__first2, __last2);
181 if (__l1 != __l2)181 if (__l1 != __l2)
182 return false;182 return false;
lib/libcxx/include/__algorithm/iterator_operations.h+3
...@@ -219,6 +219,9 @@ private:...@@ -219,6 +219,9 @@ private:
219template <class _AlgPolicy, class _Iter>219template <class _AlgPolicy, class _Iter>
220using __policy_iter_diff_t _LIBCPP_NODEBUG = typename _IterOps<_AlgPolicy>::template __difference_type<_Iter>;220using __policy_iter_diff_t _LIBCPP_NODEBUG = typename _IterOps<_AlgPolicy>::template __difference_type<_Iter>;
221221
222template <class _AlgPolicy, class _Iter>
223using __policy_value_type _LIBCPP_NODEBUG = typename _IterOps<_AlgPolicy>::template __value_type<_Iter>;
224
222_LIBCPP_END_NAMESPACE_STD225_LIBCPP_END_NAMESPACE_STD
223226
224_LIBCPP_POP_MACROS227_LIBCPP_POP_MACROS
lib/libcxx/include/__algorithm/lexicographical_compare.h+2-2
...@@ -66,8 +66,8 @@ template <class _Tp,...@@ -66,8 +66,8 @@ template <class _Tp,
66 class _Proj2,66 class _Proj2,
67 class _Comp,67 class _Comp,
68 __enable_if_t<__desugars_to_v<__totally_ordered_less_tag, _Comp, _Tp, _Tp> && !is_volatile<_Tp>::value &&68 __enable_if_t<__desugars_to_v<__totally_ordered_less_tag, _Comp, _Tp, _Tp> && !is_volatile<_Tp>::value &&
69 __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value &&69 __is_trivially_equality_comparable_v<_Tp, _Tp> && __is_identity<_Proj1>::value &&
70 __is_identity<_Proj1>::value && __is_identity<_Proj2>::value,70 __is_identity<_Proj2>::value,
71 int> = 0>71 int> = 0>
72_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool72_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
73__lexicographical_compare(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Tp* __last2, _Comp&, _Proj1&, _Proj2&) {73__lexicographical_compare(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Tp* __last2, _Comp&, _Proj1&, _Proj2&) {
lib/libcxx/include/__algorithm/lexicographical_compare_three_way.h+6-6
...@@ -37,13 +37,13 @@ template <class _InputIterator1, class _InputIterator2, class _Cmp>...@@ -37,13 +37,13 @@ template <class _InputIterator1, class _InputIterator2, class _Cmp>
37_LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_fast_path(37_LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_fast_path(
38 _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp& __comp)38 _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp& __comp)
39 -> decltype(__comp(*__first1, *__first2)) {39 -> decltype(__comp(*__first1, *__first2)) {
40 static_assert(40 static_assert(signed_integral<__iterator_difference_type<_InputIterator1>>,
41 signed_integral<__iter_diff_t<_InputIterator1>>, "Using a non-integral difference_type is undefined behavior.");41 "Using a non-integral difference_type is undefined behavior.");
42 static_assert(42 static_assert(signed_integral<__iterator_difference_type<_InputIterator2>>,
43 signed_integral<__iter_diff_t<_InputIterator2>>, "Using a non-integral difference_type is undefined behavior.");43 "Using a non-integral difference_type is undefined behavior.");
4444
45 using _Len1 = __iter_diff_t<_InputIterator1>;45 using _Len1 = __iterator_difference_type<_InputIterator1>;
46 using _Len2 = __iter_diff_t<_InputIterator2>;46 using _Len2 = __iterator_difference_type<_InputIterator2>;
47 using _Common = common_type_t<_Len1, _Len2>;47 using _Common = common_type_t<_Len1, _Len2>;
4848
49 _Len1 __len1 = __last1 - __first1;49 _Len1 __len1 = __last1 - __first1;
lib/libcxx/include/__algorithm/make_heap.h+16-4
...@@ -12,9 +12,11 @@...@@ -12,9 +12,11 @@
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/iterator_operations.h>14#include <__algorithm/iterator_operations.h>
15#include <__algorithm/push_heap.h>
15#include <__algorithm/sift_down.h>16#include <__algorithm/sift_down.h>
16#include <__config>17#include <__config>
17#include <__iterator/iterator_traits.h>18#include <__iterator/iterator_traits.h>
19#include <__type_traits/is_arithmetic.h>
18#include <__utility/move.h>20#include <__utility/move.h>
1921
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -31,13 +33,23 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void...@@ -31,13 +33,23 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
31__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp) {33__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp) {
32 __comp_ref_type<_Compare> __comp_ref = __comp;34 __comp_ref_type<_Compare> __comp_ref = __comp;
3335
34 using difference_type = typename iterator_traits<_RandomAccessIterator>::difference_type;36 using __diff_t = __iterator_difference_type<_RandomAccessIterator>;
35 difference_type __n = __last - __first;37 const __diff_t __n = __last - __first;
38
39 const bool __assume_both_children = is_arithmetic<__iterator_value_type<_RandomAccessIterator> >::value;
40
41 // While it would be correct to always assume we have both children, in practice we observed this to be a performance
42 // improvement only for arithmetic types.
43 const __diff_t __sift_down_n = __assume_both_children ? ((__n & 1) ? __n : __n - 1) : __n;
44
36 if (__n > 1) {45 if (__n > 1) {
37 // start from the first parent, there is no need to consider children46 // start from the first parent, there is no need to consider children
38 for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start) {47
39 std::__sift_down<_AlgPolicy>(__first, __comp_ref, __n, __first + __start);48 for (__diff_t __start = (__sift_down_n - 2) / 2; __start >= 0; --__start) {
49 std::__sift_down<_AlgPolicy, __assume_both_children>(__first, __comp_ref, __sift_down_n, __start);
40 }50 }
51 if _LIBCPP_CONSTEXPR (__assume_both_children)
52 std::__sift_up<_AlgPolicy>(__first, __last, __comp, __n);
41 }53 }
42}54}
4355
lib/libcxx/include/__algorithm/mismatch.h+2-2
...@@ -60,7 +60,7 @@ __mismatch(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Pred& __pred, _Pro...@@ -60,7 +60,7 @@ __mismatch(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Pred& __pred, _Pro
60template <class _Iter>60template <class _Iter>
61[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter, _Iter>61[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter, _Iter>
62__mismatch_vectorized(_Iter __first1, _Iter __last1, _Iter __first2) {62__mismatch_vectorized(_Iter __first1, _Iter __last1, _Iter __first2) {
63 using __value_type = __iter_value_type<_Iter>;63 using __value_type = __iterator_value_type<_Iter>;
64 constexpr size_t __unroll_count = 4;64 constexpr size_t __unroll_count = 4;
65 constexpr size_t __vec_size = __native_vector_size<__value_type>;65 constexpr size_t __vec_size = __native_vector_size<__value_type>;
66 using __vec = __simd_vector<__value_type, __vec_size>;66 using __vec = __simd_vector<__value_type, __vec_size>;
...@@ -136,7 +136,7 @@ template <class _Tp,...@@ -136,7 +136,7 @@ template <class _Tp,
136 class _Proj2,136 class _Proj2,
137 __enable_if_t<!is_integral<_Tp>::value && __desugars_to_v<__equal_tag, _Pred, _Tp, _Tp> &&137 __enable_if_t<!is_integral<_Tp>::value && __desugars_to_v<__equal_tag, _Pred, _Tp, _Tp> &&
138 __is_identity<_Proj1>::value && __is_identity<_Proj2>::value &&138 __is_identity<_Proj1>::value && __is_identity<_Proj2>::value &&
139 __can_map_to_integer_v<_Tp> && __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value,139 __can_map_to_integer_v<_Tp> && __is_trivially_equality_comparable_v<_Tp, _Tp>,
140 int> = 0>140 int> = 0>
141[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*>141[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*>
142__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {142__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
lib/libcxx/include/__algorithm/move.h+8-19
...@@ -50,37 +50,26 @@ struct __move_impl {...@@ -50,37 +50,26 @@ struct __move_impl {
50 return std::make_pair(std::move(__first), std::move(__result));50 return std::make_pair(std::move(__first), std::move(__result));
51 }51 }
5252
53 template <class _InIter, class _OutIter>53 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
54 struct _MoveSegment {
55 using _Traits _LIBCPP_NODEBUG = __segmented_iterator_traits<_InIter>;
56
57 _OutIter& __result_;
58
59 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit _MoveSegment(_OutIter& __result)
60 : __result_(__result) {}
61
62 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
63 operator()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) {
64 __result_ = std::__move<_AlgPolicy>(__lfirst, __llast, std::move(__result_)).second;
65 }
66 };
67
68 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>
69 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>54 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
70 operator()(_InIter __first, _InIter __last, _OutIter __result) const {55 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
71 std::__for_each_segment(__first, __last, _MoveSegment<_InIter, _OutIter>(__result));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) {
58 __result = std::__move<_AlgPolicy>(__lfirst, __llast, std::move(__result)).second;
59 });
72 return std::make_pair(__last, std::move(__result));60 return std::make_pair(__last, std::move(__result));
73 }61 }
7462
75 template <class _InIter,63 template <class _InIter,
76 class _OutIter,64 class _OutIter,
77 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&65 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
78 !__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,66 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
79 int> = 0>67 int> = 0>
80 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>68 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
81 operator()(_InIter __first, _InIter __last, _OutIter __result) const {69 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
82 using _Traits = __segmented_iterator_traits<_OutIter>;70 using _Traits = __segmented_iterator_traits<_OutIter>;
83 using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;71 using _DiffT =
72 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;
8473
85 if (__first == __last)74 if (__first == __last)
86 return std::make_pair(std::move(__first), std::move(__result));75 return std::make_pair(std::move(__first), std::move(__result));
lib/libcxx/include/__algorithm/move_backward.h+9-24
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
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/iterator_operations.h>15#include <__algorithm/iterator_operations.h>
15#include <__algorithm/min.h>16#include <__algorithm/min.h>
16#include <__config>17#include <__config>
...@@ -51,42 +52,26 @@ struct __move_backward_impl {...@@ -51,42 +52,26 @@ struct __move_backward_impl {
51 return std::make_pair(std::move(__original_last_iter), std::move(__result));52 return std::make_pair(std::move(__original_last_iter), std::move(__result));
52 }53 }
5354
54 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>55 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
55 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>56 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
56 operator()(_InIter __first, _InIter __last, _OutIter __result) const {57 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
57 using _Traits = __segmented_iterator_traits<_InIter>;58 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;
58 auto __sfirst = _Traits::__segment(__first);59 std::__for_each_segment_backward(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {
59 auto __slast = _Traits::__segment(__last);60 __result = std::__move_backward<_AlgPolicy>(std::move(__lfirst), std::move(__llast), std::move(__result)).second;
60 if (__sfirst == __slast) {61 });
61 auto __iters =
62 std::__move_backward<_AlgPolicy>(_Traits::__local(__first), _Traits::__local(__last), std::move(__result));
63 return std::make_pair(__last, __iters.second);
64 }
65
66 __result =
67 std::__move_backward<_AlgPolicy>(_Traits::__begin(__slast), _Traits::__local(__last), std::move(__result))
68 .second;
69 --__slast;
70 while (__sfirst != __slast) {
71 __result =
72 std::__move_backward<_AlgPolicy>(_Traits::__begin(__slast), _Traits::__end(__slast), std::move(__result))
73 .second;
74 --__slast;
75 }
76 __result = std::__move_backward<_AlgPolicy>(_Traits::__local(__first), _Traits::__end(__slast), std::move(__result))
77 .second;
78 return std::make_pair(__last, std::move(__result));62 return std::make_pair(__last, std::move(__result));
79 }63 }
8064
81 template <class _InIter,65 template <class _InIter,
82 class _OutIter,66 class _OutIter,
83 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&67 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
84 !__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,68 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
85 int> = 0>69 int> = 0>
86 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>70 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
87 operator()(_InIter __first, _InIter __last, _OutIter __result) const {71 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
88 using _Traits = __segmented_iterator_traits<_OutIter>;72 using _Traits = __segmented_iterator_traits<_OutIter>;
89 using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;73 using _DiffT =
74 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;
9075
91 // When the range contains no elements, __result might not be a valid iterator76 // When the range contains no elements, __result might not be a valid iterator
92 if (__first == __last)77 if (__first == __last)
lib/libcxx/include/__algorithm/none_of.h+4-4
...@@ -10,7 +10,9 @@...@@ -10,7 +10,9 @@
10#ifndef _LIBCPP___ALGORITHM_NONE_OF_H10#ifndef _LIBCPP___ALGORITHM_NONE_OF_H
11#define _LIBCPP___ALGORITHM_NONE_OF_H11#define _LIBCPP___ALGORITHM_NONE_OF_H
1212
13#include <__algorithm/any_of.h>
13#include <__config>14#include <__config>
15#include <__functional/identity.h>
1416
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header18# pragma GCC system_header
...@@ -21,10 +23,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -21,10 +23,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
21template <class _InputIterator, class _Predicate>23template <class _InputIterator, class _Predicate>
22[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool24[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
23none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {25none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
24 for (; __first != __last; ++__first)26 __identity __proj;
25 if (__pred(*__first))27 return !std::__any_of(__first, __last, __pred, __proj);
26 return false;
27 return true;
28}28}
2929
30_LIBCPP_END_NAMESPACE_STD30_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/partial_sort.h+1-1
...@@ -45,7 +45,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator __part...@@ -45,7 +45,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator __part
45 for (; __i != __last; ++__i) {45 for (; __i != __last; ++__i) {
46 if (__comp(*__i, *__first)) {46 if (__comp(*__i, *__first)) {
47 _IterOps<_AlgPolicy>::iter_swap(__i, __first);47 _IterOps<_AlgPolicy>::iter_swap(__i, __first);
48 std::__sift_down<_AlgPolicy>(__first, __comp, __len, __first);48 std::__sift_down<_AlgPolicy, false>(__first, __comp, __len, 0);
49 }49 }
50 }50 }
51 std::__sort_heap<_AlgPolicy>(std::move(__first), std::move(__middle), __comp);51 std::__sort_heap<_AlgPolicy>(std::move(__first), std::move(__middle), __comp);
lib/libcxx/include/__algorithm/partial_sort_copy.h+1-1
...@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator, _Random...@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator, _Random
60 for (; __first != __last; ++__first)60 for (; __first != __last; ++__first)
61 if (std::__invoke(__comp, std::__invoke(__proj1, *__first), std::__invoke(__proj2, *__result_first))) {61 if (std::__invoke(__comp, std::__invoke(__proj1, *__first), std::__invoke(__proj2, *__result_first))) {
62 *__result_first = *__first;62 *__result_first = *__first;
63 std::__sift_down<_AlgPolicy>(__result_first, __projected_comp, __len, __result_first);63 std::__sift_down<_AlgPolicy, false>(__result_first, __projected_comp, __len, 0);
64 }64 }
65 std::__sort_heap<_AlgPolicy>(__result_first, __r, __projected_comp);65 std::__sort_heap<_AlgPolicy>(__result_first, __r, __projected_comp);
66 }66 }
lib/libcxx/include/__algorithm/pstl.h+9-9
...@@ -115,7 +115,7 @@ template <class _ExecutionPolicy,...@@ -115,7 +115,7 @@ template <class _ExecutionPolicy,
115 class _Predicate,115 class _Predicate,
116 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,116 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
117 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>117 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
118_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator>118[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __iterator_difference_type<_ForwardIterator>
119count_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {119count_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
120 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(120 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(
121 _ForwardIterator, "count_if(first, last, pred) requires [first, last) to be ForwardIterators");121 _ForwardIterator, "count_if(first, last, pred) requires [first, last) to be ForwardIterators");
...@@ -129,7 +129,7 @@ template <class _ExecutionPolicy,...@@ -129,7 +129,7 @@ template <class _ExecutionPolicy,
129 class _Tp,129 class _Tp,
130 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,130 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
131 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>131 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
132_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator>132[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __iterator_difference_type<_ForwardIterator>
133count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {133count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
134 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(134 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(
135 _ForwardIterator, "count(first, last, val) requires [first, last) to be ForwardIterators");135 _ForwardIterator, "count(first, last, val) requires [first, last) to be ForwardIterators");
...@@ -144,7 +144,7 @@ template <class _ExecutionPolicy,...@@ -144,7 +144,7 @@ template <class _ExecutionPolicy,
144 class _Pred,144 class _Pred,
145 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,145 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
146 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>146 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
147_LIBCPP_HIDE_FROM_ABI bool147[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
148equal(_ExecutionPolicy&& __policy,148equal(_ExecutionPolicy&& __policy,
149 _ForwardIterator1 __first1,149 _ForwardIterator1 __first1,
150 _ForwardIterator1 __last1,150 _ForwardIterator1 __last1,
...@@ -166,7 +166,7 @@ template <class _ExecutionPolicy,...@@ -166,7 +166,7 @@ template <class _ExecutionPolicy,
166 class _ForwardIterator2,166 class _ForwardIterator2,
167 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,167 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
168 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>168 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
169_LIBCPP_HIDE_FROM_ABI bool169[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
170equal(_ExecutionPolicy&& __policy, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) {170equal(_ExecutionPolicy&& __policy, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) {
171 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "equal requires ForwardIterators");171 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "equal requires ForwardIterators");
172 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "equal requires ForwardIterators");172 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "equal requires ForwardIterators");
...@@ -185,7 +185,7 @@ template <class _ExecutionPolicy,...@@ -185,7 +185,7 @@ template <class _ExecutionPolicy,
185 class _Pred,185 class _Pred,
186 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,186 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
187 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>187 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
188_LIBCPP_HIDE_FROM_ABI bool188[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
189equal(_ExecutionPolicy&& __policy,189equal(_ExecutionPolicy&& __policy,
190 _ForwardIterator1 __first1,190 _ForwardIterator1 __first1,
191 _ForwardIterator1 __last1,191 _ForwardIterator1 __last1,
...@@ -209,7 +209,7 @@ template <class _ExecutionPolicy,...@@ -209,7 +209,7 @@ template <class _ExecutionPolicy,
209 class _ForwardIterator2,209 class _ForwardIterator2,
210 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,210 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
211 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>211 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
212_LIBCPP_HIDE_FROM_ABI bool212[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
213equal(_ExecutionPolicy&& __policy,213equal(_ExecutionPolicy&& __policy,
214 _ForwardIterator1 __first1,214 _ForwardIterator1 __first1,
215 _ForwardIterator1 __last1,215 _ForwardIterator1 __last1,
...@@ -259,7 +259,7 @@ template <class _ExecutionPolicy,...@@ -259,7 +259,7 @@ template <class _ExecutionPolicy,
259 class _Predicate,259 class _Predicate,
260 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,260 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
261 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>261 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
262_LIBCPP_HIDE_FROM_ABI _ForwardIterator262[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ForwardIterator
263find_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {263find_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
264 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find_if requires ForwardIterators");264 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find_if requires ForwardIterators");
265 using _Implementation = __pstl::__dispatch<__pstl::__find_if, __pstl::__current_configuration, _RawPolicy>;265 using _Implementation = __pstl::__dispatch<__pstl::__find_if, __pstl::__current_configuration, _RawPolicy>;
...@@ -272,7 +272,7 @@ template <class _ExecutionPolicy,...@@ -272,7 +272,7 @@ template <class _ExecutionPolicy,
272 class _Predicate,272 class _Predicate,
273 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,273 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
274 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>274 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
275_LIBCPP_HIDE_FROM_ABI _ForwardIterator275[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ForwardIterator
276find_if_not(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {276find_if_not(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
277 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find_if_not requires ForwardIterators");277 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find_if_not requires ForwardIterators");
278 using _Implementation = __pstl::__dispatch<__pstl::__find_if_not, __pstl::__current_configuration, _RawPolicy>;278 using _Implementation = __pstl::__dispatch<__pstl::__find_if_not, __pstl::__current_configuration, _RawPolicy>;
...@@ -285,7 +285,7 @@ template <class _ExecutionPolicy,...@@ -285,7 +285,7 @@ template <class _ExecutionPolicy,
285 class _Tp,285 class _Tp,
286 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,286 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
287 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>287 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
288_LIBCPP_HIDE_FROM_ABI _ForwardIterator288[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ForwardIterator
289find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {289find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
290 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find requires ForwardIterators");290 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find requires ForwardIterators");
291 using _Implementation = __pstl::__dispatch<__pstl::__find, __pstl::__current_configuration, _RawPolicy>;291 using _Implementation = __pstl::__dispatch<__pstl::__find, __pstl::__current_configuration, _RawPolicy>;
lib/libcxx/include/__algorithm/radix_sort.h+27-25
...@@ -72,14 +72,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -72,14 +72,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD
72#if _LIBCPP_STD_VER >= 1472#if _LIBCPP_STD_VER >= 14
7373
74template <class _InputIterator, class _OutputIterator>74template <class _InputIterator, class _OutputIterator>
75_LIBCPP_HIDE_FROM_ABI constexpr pair<_OutputIterator, __iter_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) {
77 if (__first == __last)77 if (__first == __last)
78 return {__result, 0};78 return {__result, 0};
7979
80 auto __max = *__first;80 auto __max = *__first;
81 __iter_value_type<_InputIterator> __sum = *__first;81 __iterator_value_type<_InputIterator> __sum = *__first;
82 *__result = __sum;82 *__result = __sum;
8383
84 while (++__first != __last) {84 while (++__first != __last) {
85 if (__max < *__first) {85 if (__max < *__first) {
...@@ -124,7 +124,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __nth_radix(size_t __radix_number, _Radix _...@@ -124,7 +124,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __nth_radix(size_t __radix_number, _Radix _
124template <class _ForwardIterator, class _Map, class _RandomAccessIterator>124template <class _ForwardIterator, class _Map, class _RandomAccessIterator>
125_LIBCPP_HIDE_FROM_ABI constexpr void125_LIBCPP_HIDE_FROM_ABI constexpr void
126__collect(_ForwardIterator __first, _ForwardIterator __last, _Map __map, _RandomAccessIterator __counters) {126__collect(_ForwardIterator __first, _ForwardIterator __last, _Map __map, _RandomAccessIterator __counters) {
127 using __value_type = __iter_value_type<_ForwardIterator>;127 using __value_type = __iterator_value_type<_ForwardIterator>;
128 using __traits = __counting_sort_traits<__value_type, _Map>;128 using __traits = __counting_sort_traits<__value_type, _Map>;
129129
130 std::for_each(__first, __last, [&__counters, &__map](const auto& __preimage) { ++__counters[__map(__preimage)]; });130 std::for_each(__first, __last, [&__counters, &__map](const auto& __preimage) { ++__counters[__map(__preimage)]; });
...@@ -160,7 +160,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __collect_impl(...@@ -160,7 +160,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __collect_impl(
160 _RandomAccessIterator1 __counters,160 _RandomAccessIterator1 __counters,
161 _RandomAccessIterator2 __maximums,161 _RandomAccessIterator2 __maximums,
162 index_sequence<_Radices...>) {162 index_sequence<_Radices...>) {
163 using __value_type = __iter_value_type<_ForwardIterator>;163 using __value_type = __iterator_value_type<_ForwardIterator>;
164 constexpr auto __radix_value_range = __radix_sort_traits<__value_type, _Map, _Radix>::__radix_value_range;164 constexpr auto __radix_value_range = __radix_sort_traits<__value_type, _Map, _Radix>::__radix_value_range;
165165
166 auto __previous = numeric_limits<__invoke_result_t<_Map, __value_type>>::min();166 auto __previous = numeric_limits<__invoke_result_t<_Map, __value_type>>::min();
...@@ -189,7 +189,7 @@ __collect(_ForwardIterator __first,...@@ -189,7 +189,7 @@ __collect(_ForwardIterator __first,
189 _Radix __radix,189 _Radix __radix,
190 _RandomAccessIterator1 __counters,190 _RandomAccessIterator1 __counters,
191 _RandomAccessIterator2 __maximums) {191 _RandomAccessIterator2 __maximums) {
192 using __value_type = __iter_value_type<_ForwardIterator>;192 using __value_type = __iterator_value_type<_ForwardIterator>;
193 constexpr auto __radix_count = __radix_sort_traits<__value_type, _Map, _Radix>::__radix_count;193 constexpr auto __radix_count = __radix_sort_traits<__value_type, _Map, _Radix>::__radix_count;
194 return std::__collect_impl(194 return std::__collect_impl(
195 __first, __last, __map, __radix, __counters, __maximums, make_index_sequence<__radix_count>());195 __first, __last, __map, __radix, __counters, __maximums, make_index_sequence<__radix_count>());
...@@ -213,10 +213,10 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __dispose_backward(...@@ -213,10 +213,10 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __dispose_backward(
213template <class _ForwardIterator, class _RandomAccessIterator, class _Map>213template <class _ForwardIterator, class _RandomAccessIterator, class _Map>
214_LIBCPP_HIDE_FROM_ABI constexpr _RandomAccessIterator214_LIBCPP_HIDE_FROM_ABI constexpr _RandomAccessIterator
215__counting_sort_impl(_ForwardIterator __first, _ForwardIterator __last, _RandomAccessIterator __result, _Map __map) {215__counting_sort_impl(_ForwardIterator __first, _ForwardIterator __last, _RandomAccessIterator __result, _Map __map) {
216 using __value_type = __iter_value_type<_ForwardIterator>;216 using __value_type = __iterator_value_type<_ForwardIterator>;
217 using __traits = __counting_sort_traits<__value_type, _Map>;217 using __traits = __counting_sort_traits<__value_type, _Map>;
218218
219 __iter_diff_t<_RandomAccessIterator> __counters[__traits::__value_range + 1] = {0};219 __iterator_difference_type<_RandomAccessIterator> __counters[__traits::__value_range + 1] = {0};
220220
221 std::__collect(__first, __last, __map, std::next(std::begin(__counters)));221 std::__collect(__first, __last, __map, std::next(std::begin(__counters)));
222 std::__dispose(__first, __last, __result, __map, std::begin(__counters));222 std::__dispose(__first, __last, __result, __map, std::begin(__counters));
...@@ -224,12 +224,13 @@ __counting_sort_impl(_ForwardIterator __first, _ForwardIterator __last, _RandomA...@@ -224,12 +224,13 @@ __counting_sort_impl(_ForwardIterator __first, _ForwardIterator __last, _RandomA
224 return __result + __counters[__traits::__value_range];224 return __result + __counters[__traits::__value_range];
225}225}
226226
227template <class _RandomAccessIterator1,227template <
228 class _RandomAccessIterator2,228 class _RandomAccessIterator1,
229 class _Map,229 class _RandomAccessIterator2,
230 class _Radix,230 class _Map,
231 enable_if_t< __radix_sort_traits<__iter_value_type<_RandomAccessIterator1>, _Map, _Radix>::__radix_count == 1,231 class _Radix,
232 int> = 0>232 enable_if_t<__radix_sort_traits<__iterator_value_type<_RandomAccessIterator1>, _Map, _Radix>::__radix_count == 1,
233 int> = 0>
233_LIBCPP_HIDE_FROM_ABI constexpr void __radix_sort_impl(234_LIBCPP_HIDE_FROM_ABI constexpr void __radix_sort_impl(
234 _RandomAccessIterator1 __first,235 _RandomAccessIterator1 __first,
235 _RandomAccessIterator1 __last,236 _RandomAccessIterator1 __last,
...@@ -243,24 +244,25 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __radix_sort_impl(...@@ -243,24 +244,25 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __radix_sort_impl(
243 std::move(__buffer, __buffer_end, __first);244 std::move(__buffer, __buffer_end, __first);
244}245}
245246
246template <247template <class _RandomAccessIterator1,
247 class _RandomAccessIterator1,248 class _RandomAccessIterator2,
248 class _RandomAccessIterator2,249 class _Map,
249 class _Map,250 class _Radix,
250 class _Radix,251 enable_if_t<
251 enable_if_t< __radix_sort_traits<__iter_value_type<_RandomAccessIterator1>, _Map, _Radix>::__radix_count % 2 == 0,252 __radix_sort_traits<__iterator_value_type<_RandomAccessIterator1>, _Map, _Radix>::__radix_count % 2 == 0,
252 int> = 0 >253 int> = 0>
253_LIBCPP_HIDE_FROM_ABI constexpr void __radix_sort_impl(254_LIBCPP_HIDE_FROM_ABI constexpr void __radix_sort_impl(
254 _RandomAccessIterator1 __first,255 _RandomAccessIterator1 __first,
255 _RandomAccessIterator1 __last,256 _RandomAccessIterator1 __last,
256 _RandomAccessIterator2 __buffer_begin,257 _RandomAccessIterator2 __buffer_begin,
257 _Map __map,258 _Map __map,
258 _Radix __radix) {259 _Radix __radix) {
259 using __value_type = __iter_value_type<_RandomAccessIterator1>;260 using __value_type = __iterator_value_type<_RandomAccessIterator1>;
260 using __traits = __radix_sort_traits<__value_type, _Map, _Radix>;261 using __traits = __radix_sort_traits<__value_type, _Map, _Radix>;
261262
262 __iter_diff_t<_RandomAccessIterator1> __counters[__traits::__radix_count][__traits::__radix_value_range] = {{0}};263 __iterator_difference_type<_RandomAccessIterator1>
263 __iter_diff_t<_RandomAccessIterator1> __maximums[__traits::__radix_count] = {0};264 __counters[__traits::__radix_count][__traits::__radix_value_range] = {{0}};
265 __iterator_difference_type<_RandomAccessIterator1> __maximums[__traits::__radix_count] = {0};
264 const auto __is_sorted = std::__collect(__first, __last, __map, __radix, __counters, __maximums);266 const auto __is_sorted = std::__collect(__first, __last, __map, __radix, __counters, __maximums);
265 if (!__is_sorted) {267 if (!__is_sorted) {
266 const auto __range_size = std::distance(__first, __last);268 const auto __range_size = std::distance(__first, __last);
lib/libcxx/include/__algorithm/ranges_copy_n.h+3-26
...@@ -9,16 +9,12 @@...@@ -9,16 +9,12 @@
9#ifndef _LIBCPP___ALGORITHM_RANGES_COPY_N_H9#ifndef _LIBCPP___ALGORITHM_RANGES_COPY_N_H
10#define _LIBCPP___ALGORITHM_RANGES_COPY_N_H10#define _LIBCPP___ALGORITHM_RANGES_COPY_N_H
1111
12#include <__algorithm/copy.h>12#include <__algorithm/copy_n.h>
13#include <__algorithm/in_out_result.h>13#include <__algorithm/in_out_result.h>
14#include <__algorithm/iterator_operations.h>14#include <__algorithm/iterator_operations.h>
15#include <__algorithm/ranges_copy.h>
16#include <__config>15#include <__config>
17#include <__functional/identity.h>
18#include <__iterator/concepts.h>16#include <__iterator/concepts.h>
19#include <__iterator/incrementable_traits.h>17#include <__iterator/incrementable_traits.h>
20#include <__iterator/unreachable_sentinel.h>
21#include <__iterator/wrap_iter.h>
22#include <__utility/move.h>18#include <__utility/move.h>
2319
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -37,32 +33,13 @@ namespace ranges {...@@ -37,32 +33,13 @@ namespace ranges {
37template <class _Ip, class _Op>33template <class _Ip, class _Op>
38using copy_n_result = in_out_result<_Ip, _Op>;34using copy_n_result = in_out_result<_Ip, _Op>;
3935
40// TODO: Merge this with copy_n
41struct __copy_n {36struct __copy_n {
42 template <class _InIter, class _DiffType, class _OutIter>
43 _LIBCPP_HIDE_FROM_ABI constexpr static copy_n_result<_InIter, _OutIter>
44 __go(_InIter __first, _DiffType __n, _OutIter __result) {
45 while (__n != 0) {
46 *__result = *__first;
47 ++__first;
48 ++__result;
49 --__n;
50 }
51 return {std::move(__first), std::move(__result)};
52 }
53
54 template <random_access_iterator _InIter, class _DiffType, random_access_iterator _OutIter>
55 _LIBCPP_HIDE_FROM_ABI constexpr static copy_n_result<_InIter, _OutIter>
56 __go(_InIter __first, _DiffType __n, _OutIter __result) {
57 auto __ret = std::__copy(__first, __first + __n, __result);
58 return {__ret.first, __ret.second};
59 }
60
61 template <input_iterator _Ip, weakly_incrementable _Op>37 template <input_iterator _Ip, weakly_incrementable _Op>
62 requires indirectly_copyable<_Ip, _Op>38 requires indirectly_copyable<_Ip, _Op>
63 _LIBCPP_HIDE_FROM_ABI constexpr copy_n_result<_Ip, _Op>39 _LIBCPP_HIDE_FROM_ABI constexpr copy_n_result<_Ip, _Op>
64 operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const {40 operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const {
65 return __go(std::move(__first), __n, std::move(__result));41 auto __res = std::__copy_n<_RangeAlgPolicy>(std::move(__first), __n, std::move(__result));
42 return {std::move(__res.first), std::move(__res.second)};
66 }43 }
67};44};
6845
lib/libcxx/include/__algorithm/ranges_equal.h+17-26
...@@ -13,13 +13,12 @@...@@ -13,13 +13,12 @@
13#include <__algorithm/unwrap_range.h>13#include <__algorithm/unwrap_range.h>
14#include <__config>14#include <__config>
15#include <__functional/identity.h>15#include <__functional/identity.h>
16#include <__functional/invoke.h>
17#include <__functional/ranges_operations.h>16#include <__functional/ranges_operations.h>
18#include <__iterator/concepts.h>17#include <__iterator/concepts.h>
19#include <__iterator/distance.h>
20#include <__iterator/indirectly_comparable.h>18#include <__iterator/indirectly_comparable.h>
21#include <__ranges/access.h>19#include <__ranges/access.h>
22#include <__ranges/concepts.h>20#include <__ranges/concepts.h>
21#include <__ranges/size.h>
23#include <__utility/move.h>22#include <__utility/move.h>
2423
25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -51,20 +50,17 @@ struct __equal {...@@ -51,20 +50,17 @@ struct __equal {
51 _Pred __pred = {},50 _Pred __pred = {},
52 _Proj1 __proj1 = {},51 _Proj1 __proj1 = {},
53 _Proj2 __proj2 = {}) const {52 _Proj2 __proj2 = {}) const {
54 if constexpr (sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>) {53 static constexpr bool __both_sized = sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>;
54 if constexpr (__both_sized) {
55 if (__last1 - __first1 != __last2 - __first2)55 if (__last1 - __first1 != __last2 - __first2)
56 return false;56 return false;
57 }57 }
58 auto __unwrapped1 = std::__unwrap_range(std::move(__first1), std::move(__last1));58
59 auto __unwrapped2 = std::__unwrap_range(std::move(__first2), std::move(__last2));59 auto [__ufirst1, __ulast1] = std::__unwrap_range(std::move(__first1), std::move(__last1));
60 return std::__equal_impl(60 auto [__ufirst2, __ulast2] = std::__unwrap_range(std::move(__first2), std::move(__last2));
61 std::move(__unwrapped1.first),61
62 std::move(__unwrapped1.second),62 return std::__equal_impl<__both_sized>(
63 std::move(__unwrapped2.first),63 std::move(__ufirst1), std::move(__ulast1), std::move(__ufirst2), std::move(__ulast2), __pred, __proj1, __proj2);
64 std::move(__unwrapped2.second),
65 __pred,
66 __proj1,
67 __proj2);
68 }64 }
6965
70 template <input_range _Range1,66 template <input_range _Range1,
...@@ -75,21 +71,16 @@ struct __equal {...@@ -75,21 +71,16 @@ struct __equal {
75 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>
76 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(72 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
77 _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {73 _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
78 if constexpr (sized_range<_Range1> && sized_range<_Range2>) {74 static constexpr bool __both_sized = sized_range<_Range1> && sized_range<_Range2>;
79 if (ranges::distance(__range1) != ranges::distance(__range2))75 if constexpr (__both_sized) {
76 if (ranges::size(__range1) != ranges::size(__range2))
80 return false;77 return false;
81 }78 }
82 auto __unwrapped1 = std::__unwrap_range(ranges::begin(__range1), ranges::end(__range1));79
83 auto __unwrapped2 = std::__unwrap_range(ranges::begin(__range2), ranges::end(__range2));80 auto [__ufirst1, __ulast1] = std::__unwrap_range(ranges::begin(__range1), ranges::end(__range1));
84 return std::__equal_impl(81 auto [__ufirst2, __ulast2] = std::__unwrap_range(ranges::begin(__range2), ranges::end(__range2));
85 std::move(__unwrapped1.first),82 return std::__equal_impl<__both_sized>(
86 std::move(__unwrapped1.second),83 std::move(__ufirst1), std::move(__ulast1), std::move(__ufirst2), std::move(__ulast2), __pred, __proj1, __proj2);
87 std::move(__unwrapped2.first),
88 std::move(__unwrapped2.second),
89 __pred,
90 __proj1,
91 __proj2);
92 return false;
93 }84 }
94};85};
9586
lib/libcxx/include/__algorithm/ranges_fill.h+7-6
...@@ -9,12 +9,14 @@...@@ -9,12 +9,14 @@
9#ifndef _LIBCPP___ALGORITHM_RANGES_FILL_H9#ifndef _LIBCPP___ALGORITHM_RANGES_FILL_H
10#define _LIBCPP___ALGORITHM_RANGES_FILL_H10#define _LIBCPP___ALGORITHM_RANGES_FILL_H
1111
12#include <__algorithm/ranges_fill_n.h>12#include <__algorithm/fill.h>
13#include <__algorithm/fill_n.h>
13#include <__config>14#include <__config>
14#include <__iterator/concepts.h>15#include <__iterator/concepts.h>
15#include <__ranges/access.h>16#include <__ranges/access.h>
16#include <__ranges/concepts.h>17#include <__ranges/concepts.h>
17#include <__ranges/dangling.h>18#include <__ranges/dangling.h>
19#include <__utility/move.h>
1820
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header22# pragma GCC system_header
...@@ -31,12 +33,11 @@ namespace ranges {...@@ -31,12 +33,11 @@ namespace ranges {
31struct __fill {33struct __fill {
32 template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent>34 template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent>
33 _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {35 _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {
34 if constexpr (random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) {36 if constexpr (sized_sentinel_for<_Sent, _Iter>) {
35 return ranges::fill_n(__first, __last - __first, __value);37 auto __n = __last - __first;
38 return std::__fill_n(std::move(__first), __n, __value);
36 } else {39 } else {
37 for (; __first != __last; ++__first)40 return std::__fill(std::move(__first), std::move(__last), __value);
38 *__first = __value;
39 return __first;
40 }41 }
41 }42 }
4243
lib/libcxx/include/__algorithm/ranges_for_each.h+9-1
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#include <__algorithm/for_each.h>12#include <__algorithm/for_each.h>
13#include <__algorithm/for_each_n.h>13#include <__algorithm/for_each_n.h>
14#include <__algorithm/in_fun_result.h>14#include <__algorithm/in_fun_result.h>
15#include <__algorithm/specialized_algorithms.h>
15#include <__concepts/assignable.h>16#include <__concepts/assignable.h>
16#include <__config>17#include <__config>
17#include <__functional/identity.h>18#include <__functional/identity.h>
...@@ -20,6 +21,7 @@...@@ -20,6 +21,7 @@
20#include <__ranges/access.h>21#include <__ranges/access.h>
21#include <__ranges/concepts.h>22#include <__ranges/concepts.h>
22#include <__ranges/dangling.h>23#include <__ranges/dangling.h>
24#include <__type_traits/remove_cvref.h>
23#include <__utility/move.h>25#include <__utility/move.h>
2426
25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)27#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -71,7 +73,13 @@ public:...@@ -71,7 +73,13 @@ public:
71 indirectly_unary_invocable<projected<iterator_t<_Range>, _Proj>> _Func>73 indirectly_unary_invocable<projected<iterator_t<_Range>, _Proj>> _Func>
72 _LIBCPP_HIDE_FROM_ABI constexpr for_each_result<borrowed_iterator_t<_Range>, _Func>74 _LIBCPP_HIDE_FROM_ABI constexpr for_each_result<borrowed_iterator_t<_Range>, _Func>
73 operator()(_Range&& __range, _Func __func, _Proj __proj = {}) const {75 operator()(_Range&& __range, _Func __func, _Proj __proj = {}) const {
74 return __for_each_impl(ranges::begin(__range), ranges::end(__range), __func, __proj);76 using _SpecialAlg = __specialized_algorithm<_Algorithm::__for_each, __single_range<remove_cvref_t<_Range>>>;
77 if constexpr (_SpecialAlg::__has_algorithm) {
78 auto [__iter, __func2] = _SpecialAlg()(__range, std::move(__func), std::move(__proj));
79 return {std::move(__iter), std::move(__func)};
80 } else {
81 return __for_each_impl(ranges::begin(__range), ranges::end(__range), __func, __proj);
82 }
75 }83 }
76};84};
7785
lib/libcxx/include/__algorithm/ranges_generate_n.h+2-6
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#ifndef _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H9#ifndef _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
10#define _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H10#define _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
1111
12#include <__algorithm/generate_n.h>
12#include <__concepts/constructible.h>13#include <__concepts/constructible.h>
13#include <__concepts/invocable.h>14#include <__concepts/invocable.h>
14#include <__config>15#include <__config>
...@@ -38,12 +39,7 @@ struct __generate_n {...@@ -38,12 +39,7 @@ struct __generate_n {
38 requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>39 requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
39 _LIBCPP_HIDE_FROM_ABI constexpr _OutIter40 _LIBCPP_HIDE_FROM_ABI constexpr _OutIter
40 operator()(_OutIter __first, iter_difference_t<_OutIter> __n, _Func __gen) const {41 operator()(_OutIter __first, iter_difference_t<_OutIter> __n, _Func __gen) const {
41 for (; __n > 0; --__n) {42 return std::__generate_n(std::move(__first), __n, __gen);
42 *__first = __gen();
43 ++__first;
44 }
45
46 return __first;
47 }43 }
48};44};
4945
lib/libcxx/include/__algorithm/ranges_search_n.h+2-2
...@@ -54,8 +54,8 @@ struct __search_n {...@@ -54,8 +54,8 @@ struct __search_n {
54 }54 }
5555
56 if constexpr (random_access_iterator<_Iter1>) {56 if constexpr (random_access_iterator<_Iter1>) {
57 auto __ret = std::__search_n_random_access_impl<_RangeAlgPolicy>(57 auto __ret =
58 __first, __last, __count, __value, __pred, __proj, __size);58 std::__search_n_random_access_impl<_RangeAlgPolicy>(__first, __count, __value, __pred, __proj, __size);
59 return {std::move(__ret.first), std::move(__ret.second)};59 return {std::move(__ret.first), std::move(__ret.second)};
60 }60 }
61 }61 }
lib/libcxx/include/__algorithm/rotate.h+27-44
...@@ -12,16 +12,13 @@...@@ -12,16 +12,13 @@
12#include <__algorithm/copy.h>12#include <__algorithm/copy.h>
13#include <__algorithm/copy_backward.h>13#include <__algorithm/copy_backward.h>
14#include <__algorithm/iterator_operations.h>14#include <__algorithm/iterator_operations.h>
15#include <__algorithm/min.h>
15#include <__algorithm/move.h>16#include <__algorithm/move.h>
16#include <__algorithm/move_backward.h>17#include <__algorithm/move_backward.h>
17#include <__algorithm/swap_ranges.h>18#include <__algorithm/swap_ranges.h>
18#include <__config>19#include <__config>
19#include <__cstddef/size_t.h>
20#include <__fwd/bit_reference.h>20#include <__fwd/bit_reference.h>
21#include <__iterator/iterator_traits.h>21#include <__iterator/iterator_traits.h>
22#include <__memory/construct_at.h>
23#include <__memory/pointer_traits.h>
24#include <__type_traits/is_constant_evaluated.h>
25#include <__type_traits/is_trivially_assignable.h>22#include <__type_traits/is_trivially_assignable.h>
26#include <__utility/move.h>23#include <__utility/move.h>
27#include <__utility/pair.h>24#include <__utility/pair.h>
...@@ -89,46 +86,32 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt...@@ -89,46 +86,32 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt
89 return __r;86 return __r;
90}87}
9188
92template <typename _Integral>89template <class _AlgPolicy, class _Iter, class _Sent>
93inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Integral __algo_gcd(_Integral __x, _Integral __y) {90_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Iter
94 do {91__rotate_random_access(_Iter __first, _Iter __middle, _Sent __sent) {
95 _Integral __t = __x % __y;92 auto __left = _IterOps<_AlgPolicy>::distance(__first, __middle);
96 __x = __y;93 auto __right = _IterOps<_AlgPolicy>::distance(__middle, __sent);
97 __y = __t;94 auto __last = __first + __right;
98 } while (__y);95
99 return __x;96 auto __min_len = std::min(__left, __right);
100}97
10198 while (__min_len > 0) {
102template <class _AlgPolicy, typename _RandomAccessIterator>99 if (__left <= __right) {
103_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _RandomAccessIterator100 do {
104__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) {101 std::__swap_ranges<_AlgPolicy>(__first, __first + __left, __first + __left);
105 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;102 __first += __left;
106 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;103 __right -= __left;
107 using _Ops = _IterOps<_AlgPolicy>;104 } while (__left <= __right);
108105 __min_len = __right;
109 const difference_type __m1 = __middle - __first;106 } else {
110 const difference_type __m2 = _Ops::distance(__middle, __last);107 do {
111 if (__m1 == __m2) {108 std::__swap_ranges<_AlgPolicy>(__first + (__left - __right), __first + __left, __first + __left);
112 std::__swap_ranges<_AlgPolicy>(__first, __middle, __middle, __last);109 __left -= __right;
113 return __middle;110 } while (__left > __right);
114 }111 __min_len = __left;
115 const difference_type __g = std::__algo_gcd(__m1, __m2);112 }
116 for (_RandomAccessIterator __p = __first + __g; __p != __first;) {
117 value_type __t(_Ops::__iter_move(--__p));
118 _RandomAccessIterator __p1 = __p;
119 _RandomAccessIterator __p2 = __p1 + __m1;
120 do {
121 *__p1 = _Ops::__iter_move(__p2);
122 __p1 = __p2;
123 const difference_type __d = _Ops::distance(__p2, __last);
124 if (__m1 < __d)
125 __p2 += __m1;
126 else
127 __p2 = __first + (__m1 - __d);
128 } while (__p2 != __p);
129 *__p1 = std::move(__t);
130 }113 }
131 return __first + __m2;114 return __last;
132}115}
133116
134template <class _AlgPolicy, class _ForwardIterator>117template <class _AlgPolicy, class _ForwardIterator>
...@@ -170,7 +153,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _RandomAccessIterator...@@ -170,7 +153,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _RandomAccessIterator
170 return std::__rotate_left<_AlgPolicy>(__first, __last);153 return std::__rotate_left<_AlgPolicy>(__first, __last);
171 if (_IterOps<_AlgPolicy>::next(__middle) == __last)154 if (_IterOps<_AlgPolicy>::next(__middle) == __last)
172 return std::__rotate_right<_AlgPolicy>(__first, __last);155 return std::__rotate_right<_AlgPolicy>(__first, __last);
173 return std::__rotate_gcd<_AlgPolicy>(__first, __middle, __last);156 return std::__rotate_random_access<_AlgPolicy>(__first, __middle, __last);
174 }157 }
175 return std::__rotate_forward<_AlgPolicy>(__first, __middle, __last);158 return std::__rotate_forward<_AlgPolicy>(__first, __middle, __last);
176}159}
lib/libcxx/include/__algorithm/search_n.h+49-37
...@@ -14,11 +14,7 @@...@@ -14,11 +14,7 @@
14#include <__algorithm/iterator_operations.h>14#include <__algorithm/iterator_operations.h>
15#include <__config>15#include <__config>
16#include <__functional/identity.h>16#include <__functional/identity.h>
17#include <__iterator/advance.h>
18#include <__iterator/concepts.h>
19#include <__iterator/distance.h>
20#include <__iterator/iterator_traits.h>17#include <__iterator/iterator_traits.h>
21#include <__ranges/concepts.h>
22#include <__type_traits/enable_if.h>18#include <__type_traits/enable_if.h>
23#include <__type_traits/invoke.h>19#include <__type_traits/invoke.h>
24#include <__type_traits/is_callable.h>20#include <__type_traits/is_callable.h>
...@@ -68,44 +64,60 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter> __search_...@@ -68,44 +64,60 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter> __search_
68 }64 }
69}65}
7066
71template <class _AlgPolicy, class _Pred, class _Iter, class _Sent, class _SizeT, class _Type, class _Proj, class _DiffT>67// Finds the longest suffix in [__first, __last) where each element satisfies __pred.
68template <class _RAIter, class _Pred, class _Proj, class _ValueT>
69_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _RAIter
70__find_longest_suffix(_RAIter __first, _RAIter __last, const _ValueT& __value, _Pred& __pred, _Proj& __proj) {
71 while (__first != __last) {
72 if (!std::__invoke(__pred, std::__invoke(__proj, *--__last), __value)) {
73 return ++__last;
74 }
75 }
76 return __first;
77}
78
79template <class _AlgPolicy, class _Pred, class _Iter, class _SizeT, class _Type, class _Proj, class _DiffT>
72_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 std::pair<_Iter, _Iter> __search_n_random_access_impl(80_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 std::pair<_Iter, _Iter> __search_n_random_access_impl(
73 _Iter __first, _Sent __last, _SizeT __count, const _Type& __value, _Pred& __pred, _Proj& __proj, _DiffT __size1) {81 _Iter __first, _SizeT __count_in, const _Type& __value, _Pred& __pred, _Proj& __proj, _DiffT __size) {
74 using difference_type = typename iterator_traits<_Iter>::difference_type;82 auto __last = __first + __size;
83 auto __count = static_cast<_DiffT>(__count_in);
84
75 if (__count == 0)85 if (__count == 0)
76 return std::make_pair(__first, __first);86 return std::make_pair(__first, __first);
77 if (__size1 < static_cast<_DiffT>(__count)) {87 if (__size < __count)
78 _IterOps<_AlgPolicy>::__advance_to(__first, __last);88 return std::make_pair(__last, __last);
79 return std::make_pair(__first, __first);89
80 }90 // [__match_start, __match_start + __count) is the subrange which we currently check whether it only contains matching
91 // elements. This subrange is returned in case all the elements match.
92 // [__match_start, __matched_until) is the longest subrange where all elements are known to match at any given point
93 // in time.
94 // [__matched_until, __match_start + __count) is the subrange where we don't know whether the elements match.
95
96 // This algorithm tries to expand the subrange [__match_start, __matched_until) into a range of sufficient length.
97 // When we fail to do that because we find a mismatching element, we move it forward to the beginning of the next
98 // consecutive sequence that is not known not to match.
99
100 const _Iter __try_match_until = __last - __count;
101 _Iter __match_start = __first;
102 _Iter __matched_until = __first;
81103
82 const auto __s = __first + __size1 - difference_type(__count - 1); // Start of pattern match can't go beyond here
83 while (true) {104 while (true) {
84 // Find first element in sequence that matchs __value, with a mininum of loop checks105 // There's no chance of expanding the subrange into a sequence of sufficient length, since we don't have enough
85 while (true) {106 // elements in the haystack anymore.
86 if (__first >= __s) { // return __last if no element matches __value107 if (__match_start > __try_match_until)
87 _IterOps<_AlgPolicy>::__advance_to(__first, __last);108 return std::make_pair(__last, __last);
88 return std::make_pair(__first, __first);
89 }
90 if (std::__invoke(__pred, std::__invoke(__proj, *__first), __value))
91 break;
92 ++__first;
93 }
94 // *__first matches __value_, now match elements after here
95 auto __m = __first;
96 _SizeT __c(0);
97 while (true) {
98 if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
99 return std::make_pair(__first, __first + _DiffT(__count));
100 ++__m; // no need to check range on __m because __s guarantees we have enough source
101109
102 // if there is a mismatch, restart with a new __first110 auto __mismatch = std::__find_longest_suffix(__matched_until, __match_start + __count, __value, __pred, __proj);
103 if (!std::__invoke(__pred, std::__invoke(__proj, *__m), __value)) {111
104 __first = __m;112 // If all elements in [__matched_until, __match_start + __count) match, we know that
105 ++__first;113 // [__match_start, __match_start + __count) is a full sequence of matching elements, so we're done.
106 break;114 if (__mismatch == __matched_until)
107 } // else there is a match, check next elements115 return std::make_pair(__match_start, __match_start + __count);
108 }116
117 // Otherwise, we have to move the [__match_start, __matched_until) subrange forward past the point where we know for
118 // sure a match is impossible.
119 __matched_until = __match_start + __count;
120 __match_start = __mismatch;
109 }121 }
110}122}
111123
...@@ -119,7 +131,7 @@ template <class _Iter,...@@ -119,7 +131,7 @@ template <class _Iter,
119_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter>131_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter>
120__search_n_impl(_Iter __first, _Sent __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {132__search_n_impl(_Iter __first, _Sent __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
121 return std::__search_n_random_access_impl<_ClassicAlgPolicy>(133 return std::__search_n_random_access_impl<_ClassicAlgPolicy>(
122 __first, __last, __count, __value, __pred, __proj, __last - __first);134 __first, __count, __value, __pred, __proj, __last - __first);
123}135}
124136
125template <class _Iter1,137template <class _Iter1,
lib/libcxx/include/__algorithm/sift_down.h+19-18
...@@ -24,59 +24,60 @@ _LIBCPP_PUSH_MACROS...@@ -24,59 +24,60 @@ _LIBCPP_PUSH_MACROS
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2626
27template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>27template <class _AlgPolicy, bool __assume_both_children, class _Compare, class _RandomAccessIterator>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
29__sift_down(_RandomAccessIterator __first,29__sift_down(_RandomAccessIterator __first,
30 _Compare&& __comp,30 _Compare&& __comp,
31 typename iterator_traits<_RandomAccessIterator>::difference_type __len,31 __iterator_difference_type<_RandomAccessIterator> __len,
32 _RandomAccessIterator __start) {32 __iterator_difference_type<_RandomAccessIterator> __start) {
33 using _Ops = _IterOps<_AlgPolicy>;33 using _Ops = _IterOps<_AlgPolicy>;
3434
35 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;35 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
36 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;36 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
37 // left-child of __start is at 2 * __start + 137 // left-child of __start is at 2 * __start + 1
38 // right-child of __start is at 2 * __start + 238 // right-child of __start is at 2 * __start + 2
39 difference_type __child = __start - __first;39 difference_type __child = __start;
4040
41 if (__len < 2 || (__len - 2) / 2 < __child)41 if (__len < 2 || (__len - 2) / 2 < __child)
42 return;42 return;
4343
44 __child = 2 * __child + 1;44 __child = 2 * __child + 1;
45 _RandomAccessIterator __child_i = __first + __child;
4645
47 if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) {46 if _LIBCPP_CONSTEXPR (__assume_both_children) {
47 // right-child exists and is greater than left-child
48 __child += __comp(__first[__child], __first[__child + 1]);
49 } else if ((__child + 1) < __len && __comp(__first[__child], __first[__child + 1])) {
48 // right-child exists and is greater than left-child50 // right-child exists and is greater than left-child
49 ++__child_i;
50 ++__child;51 ++__child;
51 }52 }
5253
53 // check if we are in heap-order54 // check if we are in heap-order
54 if (__comp(*__child_i, *__start))55 if (__comp(__first[__child], __first[__start]))
55 // we are, __start is larger than its largest child56 // we are, __start is larger than its largest child
56 return;57 return;
5758
58 value_type __top(_Ops::__iter_move(__start));59 value_type __top(_Ops::__iter_move(__first + __start));
59 do {60 do {
60 // we are not in heap-order, swap the parent with its largest child61 // we are not in heap-order, swap the parent with its largest child
61 *__start = _Ops::__iter_move(__child_i);62 __first[__start] = _Ops::__iter_move(__first + __child);
62 __start = __child_i;63 __start = __child;
6364
64 if ((__len - 2) / 2 < __child)65 if ((__len - 2) / 2 < __child)
65 break;66 break;
6667
67 // recompute the child based off of the updated parent68 // recompute the child based off of the updated parent
68 __child = 2 * __child + 1;69 __child = 2 * __child + 1;
69 __child_i = __first + __child;
7070
71 if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) {71 if _LIBCPP_CONSTEXPR (__assume_both_children) {
72 __child += __comp(__first[__child], __first[__child + 1]);
73 } else if ((__child + 1) < __len && __comp(__first[__child], __first[__child + 1])) {
72 // right-child exists and is greater than left-child74 // right-child exists and is greater than left-child
73 ++__child_i;
74 ++__child;75 ++__child;
75 }76 }
7677
77 // check if we are in heap-order78 // check if we are in heap-order
78 } while (!__comp(*__child_i, __top));79 } while (!__comp(__first[__child], __top));
79 *__start = std::move(__top);80 __first[__start] = std::move(__top);
80}81}
8182
82template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>83template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
lib/libcxx/include/__algorithm/simd_utils.h+33-4
...@@ -26,9 +26,7 @@ _LIBCPP_PUSH_MACROS...@@ -26,9 +26,7 @@ _LIBCPP_PUSH_MACROS
26#include <__undef_macros>26#include <__undef_macros>
2727
28// TODO: Find out how altivec changes things and allow vectorizations there too.28// TODO: Find out how altivec changes things and allow vectorizations there too.
29// TODO: Simplify this condition once we stop building with AppleClang 15 in the CI.29#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(__ALTIVEC__)
30#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(__ALTIVEC__) && \
31 !(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1600)
32# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 130# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1
33#else31#else
34# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 032# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0
...@@ -116,16 +114,47 @@ template <class _VecT, class _Iter>...@@ -116,16 +114,47 @@ template <class _VecT, class _Iter>
116 }(make_index_sequence<__simd_vector_size_v<_VecT>>{});114 }(make_index_sequence<__simd_vector_size_v<_VecT>>{});
117}115}
118116
117// 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>
121[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __partial_load(_Iter __iter) noexcept {
122 return [=]<size_t... _LoadIndices, size_t... _ZeroIndices>(
123 index_sequence<_LoadIndices...>, index_sequence<_ZeroIndices...>) _LIBCPP_ALWAYS_INLINE noexcept {
124 return _VecT{__iter[_LoadIndices]..., ((void)_ZeroIndices, 0)...};
125 }(make_index_sequence<_Np>{}, make_index_sequence<__simd_vector_size_v<_VecT> - _Np>{});
126}
127
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>
139[[__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>));
141}
142
119template <class _Tp, size_t _Np>143template <class _Tp, size_t _Np>
120[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __all_of(__simd_vector<_Tp, _Np> __vec) noexcept {144[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __all_of(__simd_vector<_Tp, _Np> __vec) noexcept {
121 return __builtin_reduce_and(__builtin_convertvector(__vec, __simd_vector<bool, _Np>));145 return __builtin_reduce_and(__builtin_convertvector(__vec, __simd_vector<bool, _Np>));
122}146}
123147
148template <class _Tp, size_t _Np>
149[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __none_of(__simd_vector<_Tp, _Np> __vec) noexcept {
150 return !__builtin_reduce_or(__builtin_convertvector(__vec, __simd_vector<bool, _Np>));
151}
152
124template <class _Tp, size_t _Np>153template <class _Tp, size_t _Np>
125[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_set(__simd_vector<_Tp, _Np> __vec) noexcept {154[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_set(__simd_vector<_Tp, _Np> __vec) noexcept {
126 using __mask_vec = __simd_vector<bool, _Np>;155 using __mask_vec = __simd_vector<bool, _Np>;
127156
128 // This has MSan disabled du to https://github.com/llvm/llvm-project/issues/85876157 // This has MSan disabled du to https://llvm.org/PR85876
129 auto __impl = [&]<class _MaskT>(_MaskT) _LIBCPP_NO_SANITIZE("memory") noexcept {158 auto __impl = [&]<class _MaskT>(_MaskT) _LIBCPP_NO_SANITIZE("memory") noexcept {
130# if defined(_LIBCPP_BIG_ENDIAN)159# if defined(_LIBCPP_BIG_ENDIAN)
131 return std::min<size_t>(160 return std::min<size_t>(
lib/libcxx/include/__algorithm/specialized_algorithms.h 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#ifndef _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H
10#define _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_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
20namespace _Algorithm {
21struct __copy {};
22struct __fill_n {};
23struct __for_each {};
24} // namespace _Algorithm
25
26template <class>
27struct __single_iterator;
28
29template <class, class>
30struct __iterator_pair;
31
32template <class>
33struct __single_range;
34
35// This struct allows specializing algorithms for specific arguments. This is useful when we know a more efficient
36// algorithm implementation for e.g. library-defined iterators. _Alg is one of tags defined inside the _Algorithm
37// namespace above. _Ranges is an essentially arbitrary subset of the arguments to the algorithm that are used for
38// dispatching. This set is specific to the algorithm: look at each algorithm to see which arguments they use for
39// dispatching to specialized algorithms.
40//
41// A specialization of `__specialized_algorithm` has to define `__has_algorithm` to true for the specialized algorithm
42// to be used. This is intended for cases where iterators can do generic unwrapping and forward to a different
43// specialization of `__specialized_algorithm`.
44//
45// If __has_algorithm is true, there has to be an operator() which will get called with the actual arguments to the
46// algorithm.
47template <class _Alg, class... _Ranges>
48struct __specialized_algorithm {
49 static const bool __has_algorithm = false;
50};
51
52_LIBCPP_END_NAMESPACE_STD
53
54#endif // _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H
lib/libcxx/include/__algorithm/stable_sort.h+1-1
...@@ -247,7 +247,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __stable_sort(...@@ -247,7 +247,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __stable_sort(
247 constexpr auto __default_comp = __desugars_to_v<__less_tag, _Compare, value_type, value_type >;247 constexpr auto __default_comp = __desugars_to_v<__less_tag, _Compare, value_type, value_type >;
248 constexpr auto __radix_sortable =248 constexpr auto __radix_sortable =
249 __is_ordered_integer_representable_v<value_type> &&249 __is_ordered_integer_representable_v<value_type> &&
250 is_same_v< value_type&, __iter_reference<_RandomAccessIterator>>;250 is_same_v< value_type&, __iterator_reference<_RandomAccessIterator>>;
251 if constexpr (__default_comp && __radix_sortable) {251 if constexpr (__default_comp && __radix_sortable) {
252 if (__len <= __buff_size && __len >= static_cast<difference_type>(std::__radix_sort_min_bound<value_type>()) &&252 if (__len <= __buff_size && __len >= static_cast<difference_type>(std::__radix_sort_min_bound<value_type>()) &&
253 __len <= static_cast<difference_type>(std::__radix_sort_max_bound<value_type>())) {253 __len <= static_cast<difference_type>(std::__radix_sort_max_bound<value_type>())) {
lib/libcxx/include/__assertion_handler+31-4
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16# include <__cxx03/__verbose_trap>16# include <__cxx03/__verbose_trap>
17#else17#else
18# include <__config>18# include <__config>
19# include <__log_hardening_failure>
19# include <__verbose_abort>20# include <__verbose_abort>
20# include <__verbose_trap>21# include <__verbose_trap>
21#endif22#endif
...@@ -24,14 +25,40 @@...@@ -24,14 +25,40 @@
24# pragma GCC system_header25# pragma GCC system_header
25#endif26#endif
2627
27#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG28#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
2829
29# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message)30// Keep the old implementation that doesn't support assertion semantics for backward compatibility with the frozen C++03
31// mode.
32# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
33# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message)
34# else
35# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message)
36# endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
3037
31#else38#else
3239
33# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message)40# if _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE
41# define _LIBCPP_ASSERTION_HANDLER(message) ((void)0)
42
43# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_OBSERVE
44# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_LOG_HARDENING_FAILURE(message)
45
46# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE
47# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message)
48
49# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
50# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message)
51
52# else
53
54# error _LIBCPP_ASSERTION_SEMANTIC must be set to one of the following values: \
55_LIBCPP_ASSERTION_SEMANTIC_IGNORE, \
56_LIBCPP_ASSERTION_SEMANTIC_OBSERVE, \
57_LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE, \
58_LIBCPP_ASSERTION_SEMANTIC_ENFORCE
59
60# endif // _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE
3461
35#endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG62#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
3663
37#endif // _LIBCPP___ASSERTION_HANDLER64#endif // _LIBCPP___ASSERTION_HANDLER
lib/libcxx/include/__atomic/atomic.h+36-60
...@@ -10,7 +10,9 @@...@@ -10,7 +10,9 @@
10#define _LIBCPP___ATOMIC_ATOMIC_H10#define _LIBCPP___ATOMIC_ATOMIC_H
1111
12#include <__atomic/atomic_sync.h>12#include <__atomic/atomic_sync.h>
13#include <__atomic/atomic_waitable_traits.h>
13#include <__atomic/check_memory_order.h>14#include <__atomic/check_memory_order.h>
15#include <__atomic/floating_point_helper.h>
14#include <__atomic/is_always_lock_free.h>16#include <__atomic/is_always_lock_free.h>
15#include <__atomic/memory_order.h>17#include <__atomic/memory_order.h>
16#include <__atomic/support.h>18#include <__atomic/support.h>
...@@ -47,10 +49,10 @@ struct __atomic_base // false...@@ -47,10 +49,10 @@ struct __atomic_base // false
47 static constexpr bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;49 static constexpr bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
48#endif50#endif
4951
50 _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const volatile _NOEXCEPT {52 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const volatile _NOEXCEPT {
51 return __cxx_atomic_is_lock_free(sizeof(__cxx_atomic_impl<_Tp>));53 return __cxx_atomic_is_lock_free(sizeof(__cxx_atomic_impl<_Tp>));
52 }54 }
53 _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const _NOEXCEPT {55 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const _NOEXCEPT {
54 return static_cast<__atomic_base const volatile*>(this)->is_lock_free();56 return static_cast<__atomic_base const volatile*>(this)->is_lock_free();
55 }57 }
56 _LIBCPP_HIDE_FROM_ABI void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT58 _LIBCPP_HIDE_FROM_ABI void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
...@@ -61,11 +63,11 @@ struct __atomic_base // false...@@ -61,11 +63,11 @@ struct __atomic_base // false
61 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) {63 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) {
62 std::__cxx_atomic_store(std::addressof(__a_), __d, __m);64 std::__cxx_atomic_store(std::addressof(__a_), __d, __m);
63 }65 }
64 _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT66 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
65 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {67 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
66 return std::__cxx_atomic_load(std::addressof(__a_), __m);68 return std::__cxx_atomic_load(std::addressof(__a_), __m);
67 }69 }
68 _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT70 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
69 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {71 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
70 return std::__cxx_atomic_load(std::addressof(__a_), __m);72 return std::__cxx_atomic_load(std::addressof(__a_), __m);
71 }73 }
...@@ -113,22 +115,16 @@ struct __atomic_base // false...@@ -113,22 +115,16 @@ struct __atomic_base // false
113 }115 }
114116
115#if _LIBCPP_STD_VER >= 20117#if _LIBCPP_STD_VER >= 20
116 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const118 _LIBCPP_HIDE_FROM_ABI void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {
117 volatile _NOEXCEPT {
118 std::__atomic_wait(*this, __v, __m);119 std::__atomic_wait(*this, __v, __m);
119 }120 }
120 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void121 _LIBCPP_HIDE_FROM_ABI void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
121 wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
122 std::__atomic_wait(*this, __v, __m);122 std::__atomic_wait(*this, __v, __m);
123 }123 }
124 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT {124 _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT { std::__atomic_notify_one(*this); }
125 std::__atomic_notify_one(*this);125 _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }
126 }126 _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT { std::__atomic_notify_all(*this); }
127 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }127 _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); }
128 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT {
129 std::__atomic_notify_all(*this);
130 }
131 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); }
132#endif // _LIBCPP_STD_VER >= 20128#endif // _LIBCPP_STD_VER >= 20
133129
134#if _LIBCPP_STD_VER >= 20130#if _LIBCPP_STD_VER >= 20
...@@ -205,12 +201,15 @@ struct __atomic_base<_Tp, true> : public __atomic_base<_Tp, false> {...@@ -205,12 +201,15 @@ struct __atomic_base<_Tp, true> : public __atomic_base<_Tp, false> {
205 _LIBCPP_HIDE_FROM_ABI _Tp operator^=(_Tp __op) _NOEXCEPT { return fetch_xor(__op) ^ __op; }201 _LIBCPP_HIDE_FROM_ABI _Tp operator^=(_Tp __op) _NOEXCEPT { return fetch_xor(__op) ^ __op; }
206};202};
207203
204#if _LIBCPP_STD_VER >= 20
208// Here we need _IsIntegral because the default template argument is not enough205// Here we need _IsIntegral because the default template argument is not enough
209// e.g __atomic_base<int> is __atomic_base<int, true>, which inherits from206// e.g __atomic_base<int> is __atomic_base<int, true>, which inherits from
210// __atomic_base<int, false> and the caller of the wait function is207// __atomic_base<int, false> and the caller of the wait function is
211// __atomic_base<int, false>. So specializing __atomic_base<_Tp> does not work208// __atomic_base<int, false>. So specializing __atomic_base<_Tp> does not work
212template <class _Tp, bool _IsIntegral>209template <class _Tp, bool _IsIntegral>
213struct __atomic_waitable_traits<__atomic_base<_Tp, _IsIntegral> > {210struct __atomic_waitable_traits<__atomic_base<_Tp, _IsIntegral> > {
211 using __value_type _LIBCPP_NODEBUG = _Tp;
212
214 static _LIBCPP_HIDE_FROM_ABI _Tp __atomic_load(const __atomic_base<_Tp, _IsIntegral>& __a, memory_order __order) {213 static _LIBCPP_HIDE_FROM_ABI _Tp __atomic_load(const __atomic_base<_Tp, _IsIntegral>& __a, memory_order __order) {
215 return __a.load(__order);214 return __a.load(__order);
216 }215 }
...@@ -231,6 +230,8 @@ struct __atomic_waitable_traits<__atomic_base<_Tp, _IsIntegral> > {...@@ -231,6 +230,8 @@ struct __atomic_waitable_traits<__atomic_base<_Tp, _IsIntegral> > {
231 }230 }
232};231};
233232
233#endif // _LIBCPP_STD_VER >= 20
234
234template <typename _Tp>235template <typename _Tp>
235struct __check_atomic_mandates {236struct __check_atomic_mandates {
236 using type _LIBCPP_NODEBUG = _Tp;237 using type _LIBCPP_NODEBUG = _Tp;
...@@ -324,50 +325,26 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> {...@@ -324,50 +325,26 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> {
324 atomic& operator=(const atomic&) volatile = delete;325 atomic& operator=(const atomic&) volatile = delete;
325};326};
326327
328#if _LIBCPP_STD_VER >= 20
327template <class _Tp>329template <class _Tp>
328struct __atomic_waitable_traits<atomic<_Tp> > : __atomic_waitable_traits<__atomic_base<_Tp> > {};330struct __atomic_waitable_traits<atomic<_Tp> > : __atomic_waitable_traits<__atomic_base<_Tp> > {};
329331
330#if _LIBCPP_STD_VER >= 20
331template <class _Tp>332template <class _Tp>
332 requires is_floating_point_v<_Tp>333 requires is_floating_point_v<_Tp>
333struct atomic<_Tp> : __atomic_base<_Tp> {334struct atomic<_Tp> : __atomic_base<_Tp> {
334private:335private:
335 _LIBCPP_HIDE_FROM_ABI static constexpr bool __is_fp80_long_double() {
336 // Only x87-fp80 long double has 64-bit mantissa
337 return __LDBL_MANT_DIG__ == 64 && std::is_same_v<_Tp, long double>;
338 }
339
340 _LIBCPP_HIDE_FROM_ABI static constexpr bool __has_rmw_builtin() {
341# ifndef _LIBCPP_COMPILER_CLANG_BASED
342 return false;
343# else
344 // The builtin __cxx_atomic_fetch_add errors during compilation for
345 // long double on platforms with fp80 format.
346 // For more details, see
347 // lib/Sema/SemaChecking.cpp function IsAllowedValueType
348 // LLVM Parser does not allow atomicrmw with x86_fp80 type.
349 // if (ValType->isSpecificBuiltinType(BuiltinType::LongDouble) &&
350 // &Context.getTargetInfo().getLongDoubleFormat() ==
351 // &llvm::APFloat::x87DoubleExtended())
352 // For more info
353 // https://github.com/llvm/llvm-project/issues/68602
354 // https://reviews.llvm.org/D53965
355 return !__is_fp80_long_double();
356# endif
357 }
358
359 template <class _This, class _Operation, class _BuiltinOp>336 template <class _This, class _Operation, class _BuiltinOp>
360 _LIBCPP_HIDE_FROM_ABI static _Tp337 _LIBCPP_HIDE_FROM_ABI static _Tp
361 __rmw_op(_This&& __self, _Tp __operand, memory_order __m, _Operation __operation, _BuiltinOp __builtin_op) {338 __rmw_op(_This&& __self, _Tp __operand, memory_order __m, _Operation __operation, _BuiltinOp __builtin_op) {
362 if constexpr (__has_rmw_builtin()) {339 if constexpr (std::__has_rmw_builtin<_Tp>()) {
363 return __builtin_op(std::addressof(std::forward<_This>(__self).__a_), __operand, __m);340 return __builtin_op(std::addressof(std::forward<_This>(__self).__a_), __operand, __m);
364 } else {341 } else {
365 _Tp __old = __self.load(memory_order_relaxed);342 _Tp __old = __self.load(memory_order_relaxed);
366 _Tp __new = __operation(__old, __operand);343 _Tp __new = __operation(__old, __operand);
367 while (!__self.compare_exchange_weak(__old, __new, __m, memory_order_relaxed)) {344 while (!__self.compare_exchange_weak(__old, __new, __m, memory_order_relaxed)) {
368# ifdef _LIBCPP_COMPILER_CLANG_BASED345# ifdef _LIBCPP_COMPILER_CLANG_BASED
369 if constexpr (__is_fp80_long_double()) {346 if constexpr (std::__is_fp80_long_double<_Tp>()) {
370 // https://github.com/llvm/llvm-project/issues/47978347 // https://llvm.org/PR47978
371 // clang bug: __old is not updated on failure for atomic<long double>::compare_exchange_weak348 // clang bug: __old is not updated on failure for atomic<long double>::compare_exchange_weak
372 // Note __old = __self.load(memory_order_relaxed) will not work349 // Note __old = __self.load(memory_order_relaxed) will not work
373 std::__cxx_atomic_load_inplace(std::addressof(__self.__a_), std::addressof(__old), memory_order_relaxed);350 std::__cxx_atomic_load_inplace(std::addressof(__self.__a_), std::addressof(__old), memory_order_relaxed);
...@@ -462,12 +439,12 @@ public:...@@ -462,12 +439,12 @@ public:
462// atomic_is_lock_free439// atomic_is_lock_free
463440
464template <class _Tp>441template <class _Tp>
465_LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT {442[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT {
466 return __o->is_lock_free();443 return __o->is_lock_free();
467}444}
468445
469template <class _Tp>446template <class _Tp>
470_LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT {447[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT {
471 return __o->is_lock_free();448 return __o->is_lock_free();
472}449}
473450
...@@ -516,25 +493,25 @@ atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, me...@@ -516,25 +493,25 @@ atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, me
516// atomic_load493// atomic_load
517494
518template <class _Tp>495template <class _Tp>
519_LIBCPP_HIDE_FROM_ABI _Tp atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT {496[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT {
520 return __o->load();497 return __o->load();
521}498}
522499
523template <class _Tp>500template <class _Tp>
524_LIBCPP_HIDE_FROM_ABI _Tp atomic_load(const atomic<_Tp>* __o) _NOEXCEPT {501[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp atomic_load(const atomic<_Tp>* __o) _NOEXCEPT {
525 return __o->load();502 return __o->load();
526}503}
527504
528// atomic_load_explicit505// atomic_load_explicit
529506
530template <class _Tp>507template <class _Tp>
531_LIBCPP_HIDE_FROM_ABI _Tp atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT508[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp
532 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {509atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
533 return __o->load(__m);510 return __o->load(__m);
534}511}
535512
536template <class _Tp>513template <class _Tp>
537_LIBCPP_HIDE_FROM_ABI _Tp atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT514[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
538 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {515 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
539 return __o->load(__m);516 return __o->load(__m);
540}517}
...@@ -642,28 +619,27 @@ _LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_strong_explicit(...@@ -642,28 +619,27 @@ _LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_strong_explicit(
642// atomic_wait619// atomic_wait
643620
644template <class _Tp>621template <class _Tp>
645_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void622_LIBCPP_HIDE_FROM_ABI void
646atomic_wait(const volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v) _NOEXCEPT {623atomic_wait(const volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v) _NOEXCEPT {
647 return __o->wait(__v);624 return __o->wait(__v);
648}625}
649626
650template <class _Tp>627template <class _Tp>
651_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void628_LIBCPP_HIDE_FROM_ABI void atomic_wait(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v) _NOEXCEPT {
652atomic_wait(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v) _NOEXCEPT {
653 return __o->wait(__v);629 return __o->wait(__v);
654}630}
655631
656// atomic_wait_explicit632// atomic_wait_explicit
657633
658template <class _Tp>634template <class _Tp>
659_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void635_LIBCPP_HIDE_FROM_ABI void
660atomic_wait_explicit(const volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v, memory_order __m) _NOEXCEPT636atomic_wait_explicit(const volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v, memory_order __m) _NOEXCEPT
661 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {637 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
662 return __o->wait(__v, __m);638 return __o->wait(__v, __m);
663}639}
664640
665template <class _Tp>641template <class _Tp>
666_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void642_LIBCPP_HIDE_FROM_ABI void
667atomic_wait_explicit(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v, memory_order __m) _NOEXCEPT643atomic_wait_explicit(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __v, memory_order __m) _NOEXCEPT
668 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {644 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
669 return __o->wait(__v, __m);645 return __o->wait(__v, __m);
...@@ -672,22 +648,22 @@ atomic_wait_explicit(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __...@@ -672,22 +648,22 @@ atomic_wait_explicit(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __
672// atomic_notify_one648// atomic_notify_one
673649
674template <class _Tp>650template <class _Tp>
675_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT {651_LIBCPP_HIDE_FROM_ABI void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT {
676 __o->notify_one();652 __o->notify_one();
677}653}
678template <class _Tp>654template <class _Tp>
679_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT {655_LIBCPP_HIDE_FROM_ABI void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT {
680 __o->notify_one();656 __o->notify_one();
681}657}
682658
683// atomic_notify_all659// atomic_notify_all
684660
685template <class _Tp>661template <class _Tp>
686_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT {662_LIBCPP_HIDE_FROM_ABI void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT {
687 __o->notify_all();663 __o->notify_all();
688}664}
689template <class _Tp>665template <class _Tp>
690_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT {666_LIBCPP_HIDE_FROM_ABI void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT {
691 __o->notify_all();667 __o->notify_all();
692}668}
693669
lib/libcxx/include/__atomic/atomic_flag.h+19-37
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#define _LIBCPP___ATOMIC_ATOMIC_FLAG_H10#define _LIBCPP___ATOMIC_ATOMIC_FLAG_H
1111
12#include <__atomic/atomic_sync.h>12#include <__atomic/atomic_sync.h>
13#include <__atomic/atomic_waitable_traits.h>
13#include <__atomic/contention_t.h>14#include <__atomic/contention_t.h>
14#include <__atomic/memory_order.h>15#include <__atomic/memory_order.h>
15#include <__atomic/support.h>16#include <__atomic/support.h>
...@@ -49,22 +50,16 @@ struct atomic_flag {...@@ -49,22 +50,16 @@ struct atomic_flag {
49 }50 }
5051
51#if _LIBCPP_STD_VER >= 2052#if _LIBCPP_STD_VER >= 20
52 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const53 _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {
53 volatile _NOEXCEPT {
54 std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);54 std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);
55 }55 }
56 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void56 _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
57 wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
58 std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);57 std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);
59 }58 }
60 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT {59 _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT { std::__atomic_notify_one(*this); }
61 std::__atomic_notify_one(*this);60 _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }
62 }61 _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT { std::__atomic_notify_all(*this); }
63 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }62 _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); }
64 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT {
65 std::__atomic_notify_all(*this);
66 }
67 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); }
68#endif63#endif
6964
70#if _LIBCPP_STD_VER >= 2065#if _LIBCPP_STD_VER >= 20
...@@ -80,8 +75,11 @@ struct atomic_flag {...@@ -80,8 +75,11 @@ struct atomic_flag {
80 atomic_flag& operator=(const atomic_flag&) volatile = delete;75 atomic_flag& operator=(const atomic_flag&) volatile = delete;
81};76};
8277
78#if _LIBCPP_STD_VER >= 20
83template <>79template <>
84struct __atomic_waitable_traits<atomic_flag> {80struct __atomic_waitable_traits<atomic_flag> {
81 using __value_type _LIBCPP_NODEBUG = _LIBCPP_ATOMIC_FLAG_TYPE;
82
85 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATOMIC_FLAG_TYPE __atomic_load(const atomic_flag& __a, memory_order __order) {83 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATOMIC_FLAG_TYPE __atomic_load(const atomic_flag& __a, memory_order __order) {
86 return std::__cxx_atomic_load(&__a.__a_, __order);84 return std::__cxx_atomic_load(&__a.__a_, __order);
87 }85 }
...@@ -101,6 +99,7 @@ struct __atomic_waitable_traits<atomic_flag> {...@@ -101,6 +99,7 @@ struct __atomic_waitable_traits<atomic_flag> {
101 return std::addressof(__a.__a_);99 return std::addressof(__a.__a_);
102 }100 }
103};101};
102#endif // _LIBCPP_STD_VER >= 20
104103
105inline _LIBCPP_HIDE_FROM_ABI bool atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT { return __o->test(); }104inline _LIBCPP_HIDE_FROM_ABI bool atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT { return __o->test(); }
106105
...@@ -143,43 +142,26 @@ inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_clear_explicit(atomic_flag* __o, m...@@ -143,43 +142,26 @@ inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_clear_explicit(atomic_flag* __o, m
143}142}
144143
145#if _LIBCPP_STD_VER >= 20144#if _LIBCPP_STD_VER >= 20
146inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void145inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT {
147atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT {
148 __o->wait(__v);146 __o->wait(__v);
149}147}
150148
151inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void149inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT { __o->wait(__v); }
152atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT {
153 __o->wait(__v);
154}
155150
156inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void151inline _LIBCPP_HIDE_FROM_ABI void
157atomic_flag_wait_explicit(const volatile atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT {152atomic_flag_wait_explicit(const volatile atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT {
158 __o->wait(__v, __m);153 __o->wait(__v, __m);
159}154}
160155
161inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void156inline _LIBCPP_HIDE_FROM_ABI void
162atomic_flag_wait_explicit(const atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT {157atomic_flag_wait_explicit(const atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT {
163 __o->wait(__v, __m);158 __o->wait(__v, __m);
164}159}
165160
166inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void161inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT { __o->notify_one(); }
167atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT {162inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT { __o->notify_one(); }
168 __o->notify_one();163inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT { __o->notify_all(); }
169}164inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT { __o->notify_all(); }
170
171inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT {
172 __o->notify_one();
173}
174
175inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
176atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT {
177 __o->notify_all();
178}
179
180inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT {
181 __o->notify_all();
182}
183#endif // _LIBCPP_STD_VER >= 20165#endif // _LIBCPP_STD_VER >= 20
184166
185_LIBCPP_END_NAMESPACE_STD167_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__atomic/atomic_ref.h+29-12
...@@ -19,7 +19,9 @@...@@ -19,7 +19,9 @@
1919
20#include <__assert>20#include <__assert>
21#include <__atomic/atomic_sync.h>21#include <__atomic/atomic_sync.h>
22#include <__atomic/atomic_waitable_traits.h>
22#include <__atomic/check_memory_order.h>23#include <__atomic/check_memory_order.h>
24#include <__atomic/floating_point_helper.h>
23#include <__atomic/memory_order.h>25#include <__atomic/memory_order.h>
24#include <__atomic/to_gcc_order.h>26#include <__atomic/to_gcc_order.h>
25#include <__concepts/arithmetic.h>27#include <__concepts/arithmetic.h>
...@@ -121,7 +123,9 @@ public:...@@ -121,7 +123,9 @@ public:
121 static constexpr bool is_always_lock_free =123 static constexpr bool is_always_lock_free =
122 __atomic_always_lock_free(sizeof(_Tp), std::addressof(__get_aligner_instance<required_alignment>::__instance));124 __atomic_always_lock_free(sizeof(_Tp), std::addressof(__get_aligner_instance<required_alignment>::__instance));
123125
124 _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const noexcept { return __atomic_is_lock_free(sizeof(_Tp), __ptr_); }126 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const noexcept {
127 return __atomic_is_lock_free(sizeof(_Tp), __ptr_);
128 }
125129
126 _LIBCPP_HIDE_FROM_ABI void store(_Tp __desired, memory_order __order = memory_order::seq_cst) const noexcept130 _LIBCPP_HIDE_FROM_ABI void store(_Tp __desired, memory_order __order = memory_order::seq_cst) const noexcept
127 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__order) {131 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__order) {
...@@ -136,7 +140,7 @@ public:...@@ -136,7 +140,7 @@ public:
136 return __desired;140 return __desired;
137 }141 }
138142
139 _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __order = memory_order::seq_cst) const noexcept143 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __order = memory_order::seq_cst) const noexcept
140 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__order) {144 _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__order) {
141 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(145 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
142 __order == memory_order::relaxed || __order == memory_order::consume || __order == memory_order::acquire ||146 __order == memory_order::relaxed || __order == memory_order::consume || __order == memory_order::acquire ||
...@@ -219,6 +223,9 @@ public:...@@ -219,6 +223,9 @@ public:
219 }223 }
220 _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); }224 _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); }
221 _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); }225 _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); }
226# if _LIBCPP_STD_VER >= 26
227 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* address() const noexcept { return __ptr_; }
228# endif
222229
223protected:230protected:
224 using _Aligned_Tp [[__gnu__::__aligned__(required_alignment), __gnu__::__nodebug__]] = _Tp;231 using _Aligned_Tp [[__gnu__::__aligned__(required_alignment), __gnu__::__nodebug__]] = _Tp;
...@@ -229,6 +236,8 @@ protected:...@@ -229,6 +236,8 @@ protected:
229236
230template <class _Tp>237template <class _Tp>
231struct __atomic_waitable_traits<__atomic_ref_base<_Tp>> {238struct __atomic_waitable_traits<__atomic_ref_base<_Tp>> {
239 using __value_type _LIBCPP_NODEBUG = _Tp;
240
232 static _LIBCPP_HIDE_FROM_ABI _Tp __atomic_load(const __atomic_ref_base<_Tp>& __a, memory_order __order) {241 static _LIBCPP_HIDE_FROM_ABI _Tp __atomic_load(const __atomic_ref_base<_Tp>& __a, memory_order __order) {
233 return __a.load(__order);242 return __a.load(__order);
234 }243 }
...@@ -322,20 +331,28 @@ struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> {...@@ -322,20 +331,28 @@ struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> {
322 atomic_ref& operator=(const atomic_ref&) = delete;331 atomic_ref& operator=(const atomic_ref&) = delete;
323332
324 _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept {333 _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept {
325 _Tp __old = this->load(memory_order_relaxed);334 if constexpr (std::__has_rmw_builtin<_Tp>()) {
326 _Tp __new = __old + __arg;335 return __atomic_fetch_add(this->__ptr_, __arg, std::__to_gcc_order(__order));
327 while (!this->compare_exchange_weak(__old, __new, __order, memory_order_relaxed)) {336 } else {
328 __new = __old + __arg;337 _Tp __old = this->load(memory_order_relaxed);
338 _Tp __new = __old + __arg;
339 while (!this->compare_exchange_weak(__old, __new, __order, memory_order_relaxed)) {
340 __new = __old + __arg;
341 }
342 return __old;
329 }343 }
330 return __old;
331 }344 }
332 _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept {345 _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept {
333 _Tp __old = this->load(memory_order_relaxed);346 if constexpr (std::__has_rmw_builtin<_Tp>()) {
334 _Tp __new = __old - __arg;347 return __atomic_fetch_sub(this->__ptr_, __arg, std::__to_gcc_order(__order));
335 while (!this->compare_exchange_weak(__old, __new, __order, memory_order_relaxed)) {348 } else {
336 __new = __old - __arg;349 _Tp __old = this->load(memory_order_relaxed);
350 _Tp __new = __old - __arg;
351 while (!this->compare_exchange_weak(__old, __new, __order, memory_order_relaxed)) {
352 __new = __old - __arg;
353 }
354 return __old;
337 }355 }
338 return __old;
339 }356 }
340357
341 _LIBCPP_HIDE_FROM_ABI _Tp operator+=(_Tp __arg) const noexcept { return fetch_add(__arg) + __arg; }358 _LIBCPP_HIDE_FROM_ABI _Tp operator+=(_Tp __arg) const noexcept { return fetch_add(__arg) + __arg; }
lib/libcxx/include/__atomic/atomic_sync.h+127-55
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#ifndef _LIBCPP___ATOMIC_ATOMIC_SYNC_H9#ifndef _LIBCPP___ATOMIC_ATOMIC_SYNC_H
10#define _LIBCPP___ATOMIC_ATOMIC_SYNC_H10#define _LIBCPP___ATOMIC_ATOMIC_SYNC_H
1111
12#include <__atomic/atomic_waitable_traits.h>
12#include <__atomic/contention_t.h>13#include <__atomic/contention_t.h>
13#include <__atomic/memory_order.h>14#include <__atomic/memory_order.h>
14#include <__atomic/to_gcc_order.h>15#include <__atomic/to_gcc_order.h>
...@@ -19,6 +20,7 @@...@@ -19,6 +20,7 @@
19#include <__type_traits/conjunction.h>20#include <__type_traits/conjunction.h>
20#include <__type_traits/decay.h>21#include <__type_traits/decay.h>
21#include <__type_traits/invoke.h>22#include <__type_traits/invoke.h>
23#include <__type_traits/is_same.h>
22#include <__type_traits/void_t.h>24#include <__type_traits/void_t.h>
23#include <__utility/declval.h>25#include <__utility/declval.h>
24#include <cstring>26#include <cstring>
...@@ -29,50 +31,89 @@...@@ -29,50 +31,89 @@
2931
30_LIBCPP_BEGIN_NAMESPACE_STD32_LIBCPP_BEGIN_NAMESPACE_STD
3133
32// The customisation points to enable the following functions:
33// - __atomic_wait
34// - __atomic_wait_unless
35// - __atomic_notify_one
36// - __atomic_notify_all
37// Note that std::atomic<T>::wait was back-ported to C++03
38// The below implementations look ugly to support C++03
39template <class _Tp, class = void>
40struct __atomic_waitable_traits {
41 template <class _AtomicWaitable>
42 static void __atomic_load(_AtomicWaitable&&, memory_order) = delete;
43
44 template <class _AtomicWaitable>
45 static void __atomic_contention_address(_AtomicWaitable&&) = delete;
46};
47
48template <class _Tp, class = void>
49struct __atomic_waitable : false_type {};
50
51template <class _Tp>
52struct __atomic_waitable< _Tp,
53 __void_t<decltype(__atomic_waitable_traits<__decay_t<_Tp> >::__atomic_load(
54 std::declval<const _Tp&>(), std::declval<memory_order>())),
55 decltype(__atomic_waitable_traits<__decay_t<_Tp> >::__atomic_contention_address(
56 std::declval<const _Tp&>()))> > : true_type {};
57
58#if _LIBCPP_STD_VER >= 2034#if _LIBCPP_STD_VER >= 20
59# if _LIBCPP_HAS_THREADS35# if _LIBCPP_HAS_THREADS
6036
61_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*) _NOEXCEPT;37# if !_LIBCPP_AVAILABILITY_HAS_NEW_SYNC
62_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*) _NOEXCEPT;38
63_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t39// old dylib interface kept for backwards compatibility
64__libcpp_atomic_monitor(void const volatile*) _NOEXCEPT;40_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*) _NOEXCEPT;
65_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void41_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*) _NOEXCEPT;
66__libcpp_atomic_wait(void const volatile*, __cxx_contention_t) _NOEXCEPT;42_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*) _NOEXCEPT;
6743_LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t) _NOEXCEPT;
68_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void44
69__cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;45_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;
70_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void46_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;
71__cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;47_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
72_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
73__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;48__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;
74_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void49_LIBCPP_EXPORTED_FROM_ABI void
75__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t) _NOEXCEPT;50__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t) _NOEXCEPT;
51# endif // !_LIBCPP_AVAILABILITY_HAS_NEW_SYNC
52
53// new dylib interface
54
55// return the global contention state's current value for the address
56_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
57__atomic_monitor_global(void const* __address) _NOEXCEPT;
58
59// wait on the global contention state to be changed from the given value for the address
60_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void
61__atomic_wait_global_table(void const* __address, __cxx_contention_t __monitor_value) _NOEXCEPT;
62
63// notify one waiter waiting on the global contention state for the address
64_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_global_table(void const*) _NOEXCEPT;
65
66// notify all waiters waiting on the global contention state for the address
67_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_global_table(void const*) _NOEXCEPT;
68
69// wait on the address directly with the native platform wait
70template <std::size_t _Size>
71_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void
72__atomic_wait_native(void const* __address, void const* __old_value) _NOEXCEPT;
73
74// notify one waiter waiting on the address directly with the native platform wait
75template <std::size_t _Size>
76_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_native(const void*) _NOEXCEPT;
77
78// notify all waiters waiting on the address directly with the native platform wait
79template <std::size_t _Size>
80_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native(const void*) _NOEXCEPT;
81
82# if _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
83
84template <class _AtomicWaitable, class _Poll>
85struct __atomic_wait_backoff_impl {
86 const _AtomicWaitable& __a_;
87 _Poll __poll_;
88 memory_order __order_;
89
90 using __waitable_traits _LIBCPP_NODEBUG = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >;
91 using __value_type _LIBCPP_NODEBUG = typename __waitable_traits::__value_type;
92
93 _LIBCPP_HIDE_FROM_ABI __backoff_results operator()(chrono::nanoseconds __elapsed) const {
94 if (__elapsed > chrono::microseconds(4)) {
95 auto __contention_address = const_cast<const void*>(
96 static_cast<const volatile void*>(__waitable_traits::__atomic_contention_address(__a_)));
97
98 if constexpr (__has_native_atomic_wait<__value_type>) {
99 auto __atomic_value = __waitable_traits::__atomic_load(__a_, __order_);
100 if (__poll_(__atomic_value))
101 return __backoff_results::__poll_success;
102 std::__atomic_wait_native<sizeof(__value_type)>(__contention_address, std::addressof(__atomic_value));
103 } else {
104 __cxx_contention_t __monitor_val = std::__atomic_monitor_global(__contention_address);
105 auto __atomic_value = __waitable_traits::__atomic_load(__a_, __order_);
106 if (__poll_(__atomic_value))
107 return __backoff_results::__poll_success;
108 std::__atomic_wait_global_table(__contention_address, __monitor_val);
109 }
110 } else {
111 } // poll
112 return __backoff_results::__continue_poll;
113 }
114};
115
116# else // _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
76117
77template <class _AtomicWaitable, class _Poll>118template <class _AtomicWaitable, class _Poll>
78struct __atomic_wait_backoff_impl {119struct __atomic_wait_backoff_impl {
...@@ -82,7 +123,6 @@ struct __atomic_wait_backoff_impl {...@@ -82,7 +123,6 @@ struct __atomic_wait_backoff_impl {
82123
83 using __waitable_traits _LIBCPP_NODEBUG = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >;124 using __waitable_traits _LIBCPP_NODEBUG = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >;
84125
85 _LIBCPP_AVAILABILITY_SYNC
86 _LIBCPP_HIDE_FROM_ABI bool126 _LIBCPP_HIDE_FROM_ABI bool
87 __update_monitor_val_and_poll(__cxx_atomic_contention_t const volatile*, __cxx_contention_t& __monitor_val) const {127 __update_monitor_val_and_poll(__cxx_atomic_contention_t const volatile*, __cxx_contention_t& __monitor_val) const {
88 // In case the contention type happens to be __cxx_atomic_contention_t, i.e. __cxx_atomic_impl<int64_t>,128 // In case the contention type happens to be __cxx_atomic_contention_t, i.e. __cxx_atomic_impl<int64_t>,
...@@ -95,7 +135,6 @@ struct __atomic_wait_backoff_impl {...@@ -95,7 +135,6 @@ struct __atomic_wait_backoff_impl {
95 return __poll_(__monitor_val);135 return __poll_(__monitor_val);
96 }136 }
97137
98 _LIBCPP_AVAILABILITY_SYNC
99 _LIBCPP_HIDE_FROM_ABI bool138 _LIBCPP_HIDE_FROM_ABI bool
100 __update_monitor_val_and_poll(void const volatile* __contention_address, __cxx_contention_t& __monitor_val) const {139 __update_monitor_val_and_poll(void const volatile* __contention_address, __cxx_contention_t& __monitor_val) const {
101 // In case the contention type is anything else, platform wait is monitoring a __cxx_atomic_contention_t140 // In case the contention type is anything else, platform wait is monitoring a __cxx_atomic_contention_t
...@@ -105,20 +144,21 @@ struct __atomic_wait_backoff_impl {...@@ -105,20 +144,21 @@ struct __atomic_wait_backoff_impl {
105 return __poll_(__current_val);144 return __poll_(__current_val);
106 }145 }
107146
108 _LIBCPP_AVAILABILITY_SYNC147 _LIBCPP_HIDE_FROM_ABI __backoff_results operator()(chrono::nanoseconds __elapsed) const {
109 _LIBCPP_HIDE_FROM_ABI bool operator()(chrono::nanoseconds __elapsed) const {
110 if (__elapsed > chrono::microseconds(4)) {148 if (__elapsed > chrono::microseconds(4)) {
111 auto __contention_address = __waitable_traits::__atomic_contention_address(__a_);149 auto __contention_address = __waitable_traits::__atomic_contention_address(__a_);
112 __cxx_contention_t __monitor_val;150 __cxx_contention_t __monitor_val;
113 if (__update_monitor_val_and_poll(__contention_address, __monitor_val))151 if (__update_monitor_val_and_poll(__contention_address, __monitor_val))
114 return true;152 return __backoff_results::__poll_success;
115 std::__libcpp_atomic_wait(__contention_address, __monitor_val);153 std::__libcpp_atomic_wait(__contention_address, __monitor_val);
116 } else {154 } else {
117 } // poll155 } // poll
118 return false;156 return __backoff_results::__continue_poll;
119 }157 }
120};158};
121159
160# endif // _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
161
122// The semantics of this function are similar to `atomic`'s162// The semantics of this function are similar to `atomic`'s
123// `.wait(T old, std::memory_order order)`, but instead of having a hardcoded163// `.wait(T old, std::memory_order order)`, but instead of having a hardcoded
124// predicate (is the loaded value unequal to `old`?), the predicate function is164// predicate (is the loaded value unequal to `old`?), the predicate function is
...@@ -128,9 +168,8 @@ struct __atomic_wait_backoff_impl {...@@ -128,9 +168,8 @@ struct __atomic_wait_backoff_impl {
128// `false`, it must set the argument to its current understanding of the atomic168// `false`, it must set the argument to its current understanding of the atomic
129// value. The predicate function must not return `false` spuriously.169// value. The predicate function must not return `false` spuriously.
130template <class _AtomicWaitable, class _Poll>170template <class _AtomicWaitable, class _Poll>
131_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void171_LIBCPP_HIDE_FROM_ABI void __atomic_wait_unless(const _AtomicWaitable& __a, memory_order __order, _Poll&& __poll) {
132__atomic_wait_unless(const _AtomicWaitable& __a, memory_order __order, _Poll&& __poll) {172 static_assert(__atomic_waitable<_AtomicWaitable>);
133 static_assert(__atomic_waitable<_AtomicWaitable>::value, "");
134 __atomic_wait_backoff_impl<_AtomicWaitable, __decay_t<_Poll> > __backoff_fn = {__a, __poll, __order};173 __atomic_wait_backoff_impl<_AtomicWaitable, __decay_t<_Poll> > __backoff_fn = {__a, __poll, __order};
135 std::__libcpp_thread_poll_with_backoff(174 std::__libcpp_thread_poll_with_backoff(
136 /* poll */175 /* poll */
...@@ -141,18 +180,52 @@ __atomic_wait_unless(const _AtomicWaitable& __a, memory_order __order, _Poll&& _...@@ -141,18 +180,52 @@ __atomic_wait_unless(const _AtomicWaitable& __a, memory_order __order, _Poll&& _
141 /* backoff */ __backoff_fn);180 /* backoff */ __backoff_fn);
142}181}
143182
183# if _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
184
144template <class _AtomicWaitable>185template <class _AtomicWaitable>
145_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void __atomic_notify_one(const _AtomicWaitable& __a) {186_LIBCPP_HIDE_FROM_ABI void __atomic_notify_one(const _AtomicWaitable& __a) {
146 static_assert(__atomic_waitable<_AtomicWaitable>::value, "");187 static_assert(__atomic_waitable<_AtomicWaitable>);
188 using __value_type _LIBCPP_NODEBUG = typename __atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__value_type;
189 using __waitable_traits _LIBCPP_NODEBUG = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >;
190 auto __contention_address =
191 const_cast<const void*>(static_cast<const volatile void*>(__waitable_traits::__atomic_contention_address(__a)));
192 if constexpr (__has_native_atomic_wait<__value_type>) {
193 std::__atomic_notify_one_native<sizeof(__value_type)>(__contention_address);
194 } else {
195 std::__atomic_notify_one_global_table(__contention_address);
196 }
197}
198
199template <class _AtomicWaitable>
200_LIBCPP_HIDE_FROM_ABI void __atomic_notify_all(const _AtomicWaitable& __a) {
201 static_assert(__atomic_waitable<_AtomicWaitable>);
202 using __value_type _LIBCPP_NODEBUG = typename __atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__value_type;
203 using __waitable_traits _LIBCPP_NODEBUG = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >;
204 auto __contention_address =
205 const_cast<const void*>(static_cast<const volatile void*>(__waitable_traits::__atomic_contention_address(__a)));
206 if constexpr (__has_native_atomic_wait<__value_type>) {
207 std::__atomic_notify_all_native<sizeof(__value_type)>(__contention_address);
208 } else {
209 std::__atomic_notify_all_global_table(__contention_address);
210 }
211}
212
213# else // _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
214
215template <class _AtomicWaitable>
216_LIBCPP_HIDE_FROM_ABI void __atomic_notify_one(const _AtomicWaitable& __a) {
217 static_assert(__atomic_waitable<_AtomicWaitable>);
147 std::__cxx_atomic_notify_one(__atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_contention_address(__a));218 std::__cxx_atomic_notify_one(__atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_contention_address(__a));
148}219}
149220
150template <class _AtomicWaitable>221template <class _AtomicWaitable>
151_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void __atomic_notify_all(const _AtomicWaitable& __a) {222_LIBCPP_HIDE_FROM_ABI void __atomic_notify_all(const _AtomicWaitable& __a) {
152 static_assert(__atomic_waitable<_AtomicWaitable>::value, "");223 static_assert(__atomic_waitable<_AtomicWaitable>);
153 std::__cxx_atomic_notify_all(__atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_contention_address(__a));224 std::__cxx_atomic_notify_all(__atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_contention_address(__a));
154}225}
155226
227# endif
228
156# else // _LIBCPP_HAS_THREADS229# else // _LIBCPP_HAS_THREADS
157230
158template <class _AtomicWaitable, class _Poll>231template <class _AtomicWaitable, class _Poll>
...@@ -180,9 +253,8 @@ _LIBCPP_HIDE_FROM_ABI bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp c...@@ -180,9 +253,8 @@ _LIBCPP_HIDE_FROM_ABI bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp c
180}253}
181254
182template <class _AtomicWaitable, class _Tp>255template <class _AtomicWaitable, class _Tp>
183_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void256_LIBCPP_HIDE_FROM_ABI void __atomic_wait(_AtomicWaitable& __a, _Tp __val, memory_order __order) {
184__atomic_wait(_AtomicWaitable& __a, _Tp __val, memory_order __order) {257 static_assert(__atomic_waitable<_AtomicWaitable>);
185 static_assert(__atomic_waitable<_AtomicWaitable>::value, "");
186 std::__atomic_wait_unless(__a, __order, [&](_Tp const& __current) {258 std::__atomic_wait_unless(__a, __order, [&](_Tp const& __current) {
187 return !std::__cxx_nonatomic_compare_equal(__current, __val);259 return !std::__cxx_nonatomic_compare_equal(__current, __val);
188 });260 });
lib/libcxx/include/__atomic/atomic_sync_timed.h created+144
...@@ -0,0 +1,144 @@
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___ATOMIC_ATOMIC_SYNC_TIMED_H
10#define _LIBCPP___ATOMIC_ATOMIC_SYNC_TIMED_H
11
12#include <__atomic/atomic_waitable_traits.h>
13#include <__atomic/contention_t.h>
14#include <__atomic/memory_order.h>
15#include <__atomic/to_gcc_order.h>
16#include <__chrono/duration.h>
17#include <__config>
18#include <__memory/addressof.h>
19#include <__thread/poll_with_backoff.h>
20#include <__thread/timed_backoff_policy.h>
21#include <__type_traits/conjunction.h>
22#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>
30#include <cstring>
31
32#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
33# pragma GCC system_header
34#endif
35
36_LIBCPP_BEGIN_NAMESPACE_STD
37
38#if _LIBCPP_STD_VER >= 20
39# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
40
41_LIBCPP_AVAILABILITY_NEW_SYNC
42_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __address) _NOEXCEPT;
43
44// wait on the global contention state to be changed from the given value for the address
45_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_global_table_with_timeout(
46 void const* __address, __cxx_contention_t __monitor_value, uint64_t __timeout_ns) _NOEXCEPT;
47
48// wait on the address directly with the native platform wait
49template <std::size_t _Size>
50_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;
52
53template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>
54struct __atomic_wait_timed_backoff_impl {
55 const _AtomicWaitable& __a_;
56 _Poll __poll_;
57 memory_order __order_;
58 chrono::duration<_Rep, _Period> __rel_time_;
59
60 using __waitable_traits _LIBCPP_NODEBUG = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >;
61 using __value_type _LIBCPP_NODEBUG = typename __waitable_traits::__value_type;
62
63 _LIBCPP_HIDE_FROM_ABI __backoff_results operator()(chrono::nanoseconds __elapsed) const {
64 if (__elapsed > chrono::microseconds(4)) {
65 auto __contention_address = const_cast<const void*>(
66 static_cast<const volatile void*>(__waitable_traits::__atomic_contention_address(__a_)));
67
68 uint64_t __timeout_ns =
69 static_cast<uint64_t>((chrono::duration_cast<chrono::nanoseconds>(__rel_time_) - __elapsed).count());
70
71 if constexpr (__has_native_atomic_wait<__value_type>) {
72 auto __atomic_value = __waitable_traits::__atomic_load(__a_, __order_);
73 if (__poll_(__atomic_value))
74 return __backoff_results::__poll_success;
75 std::__atomic_wait_native_with_timeout<sizeof(__value_type)>(
76 __contention_address, std::addressof(__atomic_value), __timeout_ns);
77 } else {
78 __cxx_contention_t __monitor_val = std::__atomic_monitor_global(__contention_address);
79 auto __atomic_value = __waitable_traits::__atomic_load(__a_, __order_);
80 if (__poll_(__atomic_value))
81 return __backoff_results::__poll_success;
82 std::__atomic_wait_global_table_with_timeout(__contention_address, __monitor_val, __timeout_ns);
83 }
84 } else {
85 } // poll
86 return __backoff_results::__continue_poll;
87 }
88};
89
90// The semantics of this function are similar to `atomic`'s
91// `.wait(T old, std::memory_order order)` with a timeout, but instead of having a hardcoded
92// predicate (is the loaded value unequal to `old`?), the predicate function is
93// specified as an argument. The loaded value is given as an in-out argument to
94// the predicate. If the predicate function returns `true`,
95// `__atomic_wait_unless_with_timeout` will return. If the predicate function returns
96// `false`, it must set the argument to its current understanding of the atomic
97// value. The predicate function must not return `false` spuriously.
98template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>
99_LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(
100 const _AtomicWaitable& __a,
101 memory_order __order,
102 _Poll&& __poll,
103 chrono::duration<_Rep, _Period> const& __rel_time) {
104 static_assert(__atomic_waitable<_AtomicWaitable>, "");
105 __atomic_wait_timed_backoff_impl<_AtomicWaitable, __decay_t<_Poll>, _Rep, _Period> __backoff_fn = {
106 __a, __poll, __order, __rel_time};
107 auto __poll_result = std::__libcpp_thread_poll_with_backoff(
108 /* poll */
109 [&]() {
110 auto __current_val = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_load(__a, __order);
111 return __poll(__current_val);
112 },
113 /* backoff */ __backoff_fn,
114 __rel_time);
115
116 return __poll_result == __poll_with_backoff_results::__poll_success;
117}
118
119# elif _LIBCPP_HAS_THREADS // _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
120
121template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>
122_LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(
123 const _AtomicWaitable& __a,
124 memory_order __order,
125 _Poll&& __poll,
126 chrono::duration<_Rep, _Period> const& __rel_time) {
127 auto __res = std::__libcpp_thread_poll_with_backoff(
128 /* poll */
129 [&]() {
130 auto __current_val = __atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_load(__a, __order);
131 return __poll(__current_val);
132 },
133 /* backoff */ __libcpp_timed_backoff_policy(),
134 __rel_time);
135 return __res == __poll_with_backoff_results::__poll_success;
136}
137
138# endif // _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
139
140#endif // C++20
141
142_LIBCPP_END_NAMESPACE_STD
143
144#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_TIMED_H
lib/libcxx/include/__atomic/atomic_waitable_traits.h created+103
...@@ -0,0 +1,103 @@
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___ATOMIC_ATOMIC_WAITABLE_TRAITS_H
10#define _LIBCPP___ATOMIC_ATOMIC_WAITABLE_TRAITS_H
11
12#include <__atomic/contention_t.h>
13#include <__atomic/memory_order.h>
14#include <__config>
15#include <__type_traits/decay.h>
16#include <__type_traits/has_unique_object_representation.h>
17#include <__type_traits/is_same.h>
18#include <__type_traits/is_trivially_copyable.h>
19#include <__type_traits/void_t.h>
20#include <__utility/declval.h>
21#include <cstring>
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 >= 20
30
31// The customisation points to enable the following functions:
32// - __atomic_wait
33// - __atomic_wait_unless
34// - __atomic_notify_one
35// - __atomic_notify_all
36template <class _Tp, class = void>
37struct __atomic_waitable_traits {
38 using __value_type _LIBCPP_NODEBUG = void;
39
40 template <class _AtomicWaitable>
41 static void __atomic_load(_AtomicWaitable&&, memory_order) = delete;
42
43 template <class _AtomicWaitable>
44 static void __atomic_contention_address(_AtomicWaitable&&) = delete;
45};
46
47template <class _Tp>
48concept __atomic_waitable = requires(const _Tp __t, memory_order __order) {
49 typename __atomic_waitable_traits<__decay_t<_Tp> >::__value_type;
50 { __atomic_waitable_traits<__decay_t<_Tp> >::__atomic_load(__t, __order) };
51 { __atomic_waitable_traits<__decay_t<_Tp> >::__atomic_contention_address(__t) };
52};
53
54# ifdef __linux__
55# define _LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_APPLY) _APPLY(4)
56# elif defined(__APPLE__)
57# define _LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_APPLY) \
58 _APPLY(4) \
59 _APPLY(8)
60# elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
61# define _LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_APPLY) _APPLY(8)
62# elif defined(_WIN32)
63# define _LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_APPLY) _APPLY(8)
64# else
65# define _LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_APPLY) _APPLY(sizeof(__cxx_contention_t))
66# endif // __linux__
67
68// concepts defines the types are supported natively by the platform's wait
69
70# if defined(_LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE)
71
72template <class _Tp>
73_LIBCPP_HIDE_FROM_ABI constexpr bool __has_native_atomic_wait_impl() {
74 if (alignof(_Tp) % sizeof(_Tp) != 0)
75 return false;
76 switch (sizeof(_Tp)) {
77# define _LIBCPP_MAKE_CASE(n) \
78 case n: \
79 return true;
80 _LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_LIBCPP_MAKE_CASE)
81 default:
82 return false;
83# undef _LIBCPP_MAKE_CASE
84 };
85}
86
87template <class _Tp>
88concept __has_native_atomic_wait =
89 has_unique_object_representations_v<_Tp> && is_trivially_copyable_v<_Tp> &&
90 std::__has_native_atomic_wait_impl<_Tp>();
91
92# else // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
93
94template <class _Tp>
95concept __has_native_atomic_wait = is_same_v<_Tp, __cxx_contention_t>;
96
97# endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
98
99#endif // C++20
100
101_LIBCPP_END_NAMESPACE_STD
102
103#endif // _LIBCPP___ATOMIC_ATOMIC_WAITABLE_TRAITS_H
lib/libcxx/include/__atomic/contention_t.h+27-3
...@@ -19,11 +19,35 @@...@@ -19,11 +19,35 @@
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2121
22#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))22// The original definition of `__cxx_contention_t` seemed a bit arbitrary.
23// When we enable the _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE ABI,
24// use definitions that are based on what the underlying platform supports
25// instead.
26#if defined(_LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE)
27
28# ifdef __linux__
29using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
30# elif defined(__APPLE__)
31using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
32# elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
33using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
34# elif defined(_AIX) && !defined(__64BIT__)
35using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
36# elif defined(_WIN32)
37using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
38# else
39using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
40# endif // __linux__
41
42#else // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
43
44# if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
23using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;45using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
24#else46# else
25using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;47using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
26#endif // __linux__ || (_AIX && !__64BIT__)48# endif // __linux__ || (_AIX && !__64BIT__)
49
50#endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
2751
28using __cxx_atomic_contention_t _LIBCPP_NODEBUG = __cxx_atomic_impl<__cxx_contention_t>;52using __cxx_atomic_contention_t _LIBCPP_NODEBUG = __cxx_atomic_impl<__cxx_contention_t>;
2953
lib/libcxx/include/__atomic/floating_point_helper.h created+55
...@@ -0,0 +1,55 @@
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___ATOMIC_FLOATING_POINT_HELPER_H
10#define _LIBCPP___ATOMIC_FLOATING_POINT_HELPER_H
11
12#include <__config>
13#include <__type_traits/is_floating_point.h>
14#include <__type_traits/is_same.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
22#if _LIBCPP_STD_VER >= 20
23
24template <class _Tp>
25_LIBCPP_HIDE_FROM_ABI constexpr bool __is_fp80_long_double() {
26 // Only x87-fp80 long double has 64-bit mantissa
27 return __LDBL_MANT_DIG__ == 64 && std::is_same_v<_Tp, long double>;
28}
29
30template <class _Tp>
31_LIBCPP_HIDE_FROM_ABI constexpr bool __has_rmw_builtin() {
32 static_assert(std::is_floating_point_v<_Tp>);
33# ifndef _LIBCPP_COMPILER_CLANG_BASED
34 return false;
35# else
36 // The builtin __cxx_atomic_fetch_add errors during compilation for
37 // long double on platforms with fp80 format.
38 // For more details, see
39 // lib/Sema/SemaChecking.cpp function IsAllowedValueType
40 // LLVM Parser does not allow atomicrmw with x86_fp80 type.
41 // if (ValType->isSpecificBuiltinType(BuiltinType::LongDouble) &&
42 // &Context.getTargetInfo().getLongDoubleFormat() ==
43 // &llvm::APFloat::x87DoubleExtended())
44 // For more info
45 // https://llvm.org/PR68602
46 // https://reviews.llvm.org/D53965
47 return !std::__is_fp80_long_double<_Tp>();
48# endif
49}
50
51#endif
52
53_LIBCPP_END_NAMESPACE_STD
54
55#endif // _LIBCPP___ATOMIC_FLOATING_POINT_HELPER_H
lib/libcxx/include/__bit/countl.h+1-2
...@@ -24,7 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -24,7 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2424
25template <class _Tp>25template <class _Tp>
26_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _NOEXCEPT {26_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _NOEXCEPT {
27 static_assert(__is_unsigned_integer_v<_Tp>, "__countl_zero requires an unsigned integer type");
28 return __builtin_clzg(__t, numeric_limits<_Tp>::digits);27 return __builtin_clzg(__t, numeric_limits<_Tp>::digits);
29}28}
3029
...@@ -37,7 +36,7 @@ template <__unsigned_integer _Tp>...@@ -37,7 +36,7 @@ template <__unsigned_integer _Tp>
3736
38template <__unsigned_integer _Tp>37template <__unsigned_integer _Tp>
39[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {38[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
40 return __t != numeric_limits<_Tp>::max() ? std::countl_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;39 return std::countl_zero(static_cast<_Tp>(~__t));
41}40}
4241
43#endif // _LIBCPP_STD_VER >= 2042#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__bit/countr.h+1-2
...@@ -24,7 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -24,7 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2424
25template <class _Tp>25template <class _Tp>
26[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __countr_zero(_Tp __t) _NOEXCEPT {26[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __countr_zero(_Tp __t) _NOEXCEPT {
27 static_assert(__is_unsigned_integer_v<_Tp>, "__countr_zero only works with unsigned types");
28 return __builtin_ctzg(__t, numeric_limits<_Tp>::digits);27 return __builtin_ctzg(__t, numeric_limits<_Tp>::digits);
29}28}
3029
...@@ -37,7 +36,7 @@ template <__unsigned_integer _Tp>...@@ -37,7 +36,7 @@ template <__unsigned_integer _Tp>
3736
38template <__unsigned_integer _Tp>37template <__unsigned_integer _Tp>
39[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {38[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
40 return __t != numeric_limits<_Tp>::max() ? std::countr_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;39 return std::countr_zero(static_cast<_Tp>(~__t));
41}40}
4241
43#endif // _LIBCPP_STD_VER >= 2042#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__bit/has_single_bit.h+1-1
...@@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2525
26template <__unsigned_integer _Tp>26template <__unsigned_integer _Tp>
27[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {27[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {
28 return __t != 0 && (((__t & (__t - 1)) == 0));28 return __builtin_popcountg(__t) == 1;
29}29}
3030
31_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__bit/popcount.h-1
...@@ -23,7 +23,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -23,7 +23,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323
24template <class _Tp>24template <class _Tp>
25[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __popcount(_Tp __t) _NOEXCEPT {25[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __popcount(_Tp __t) _NOEXCEPT {
26 static_assert(__is_unsigned_integer_v<_Tp>, "__popcount only works with unsigned types");
27 return __builtin_popcountg(__t);26 return __builtin_popcountg(__t);
28}27}
2928
lib/libcxx/include/__bit/rotate.h+15-26
...@@ -22,46 +22,35 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,46 +22,35 @@ _LIBCPP_BEGIN_NAMESPACE_STD
22// Writing two full functions for rotl and rotr makes it easier for the compiler22// Writing two full functions for rotl and rotr makes it easier for the compiler
23// to optimize the code. On x86 this function becomes the ROL instruction and23// to optimize the code. On x86 this function becomes the ROL instruction and
24// the rotr function becomes the ROR instruction.24// the rotr function becomes the ROR instruction.
25template <class _Tp>25
26_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotl(_Tp __x, int __s) _NOEXCEPT {26#if _LIBCPP_STD_VER >= 20
27 static_assert(__is_unsigned_integer_v<_Tp>, "__rotl requires an unsigned integer type");27
28template <__unsigned_integer _Tp>
29[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, int __cnt) noexcept {
28 const int __n = numeric_limits<_Tp>::digits;30 const int __n = numeric_limits<_Tp>::digits;
29 int __r = __s % __n;31 int __r = __cnt % __n;
3032
31 if (__r == 0)33 if (__r == 0)
32 return __x;34 return __t;
3335
34 if (__r > 0)36 if (__r > 0)
35 return (__x << __r) | (__x >> (__n - __r));37 return (__t << __r) | (__t >> (__n - __r));
3638
37 return (__x >> -__r) | (__x << (__n + __r));39 return (__t >> -__r) | (__t << (__n + __r));
38}40}
3941
40template <class _Tp>42template <__unsigned_integer _Tp>
41_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotr(_Tp __x, int __s) _NOEXCEPT {43[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept {
42 static_assert(__is_unsigned_integer_v<_Tp>, "__rotr requires an unsigned integer type");
43 const int __n = numeric_limits<_Tp>::digits;44 const int __n = numeric_limits<_Tp>::digits;
44 int __r = __s % __n;45 int __r = __cnt % __n;
4546
46 if (__r == 0)47 if (__r == 0)
47 return __x;48 return __t;
4849
49 if (__r > 0)50 if (__r > 0)
50 return (__x >> __r) | (__x << (__n - __r));51 return (__t >> __r) | (__t << (__n - __r));
51
52 return (__x << -__r) | (__x >> (__n + __r));
53}
5452
55#if _LIBCPP_STD_VER >= 2053 return (__t << -__r) | (__t >> (__n + __r));
56
57template <__unsigned_integer _Tp>
58[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, int __cnt) noexcept {
59 return std::__rotl(__t, __cnt);
60}
61
62template <__unsigned_integer _Tp>
63[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept {
64 return std::__rotr(__t, __cnt);
65}54}
6655
67#endif // _LIBCPP_STD_VER >= 2056#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__bit_reference+207-18
...@@ -15,8 +15,10 @@...@@ -15,8 +15,10 @@
15#include <__algorithm/copy_backward.h>15#include <__algorithm/copy_backward.h>
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/min.h>19#include <__algorithm/min.h>
19#include <__algorithm/rotate.h>20#include <__algorithm/rotate.h>
21#include <__algorithm/specialized_algorithms.h>
20#include <__algorithm/swap_ranges.h>22#include <__algorithm/swap_ranges.h>
21#include <__assert>23#include <__assert>
22#include <__bit/countr.h>24#include <__bit/countr.h>
...@@ -137,7 +139,7 @@ public:...@@ -137,7 +139,7 @@ public:
137 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator bool() const _NOEXCEPT {139 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator bool() const _NOEXCEPT {
138 return static_cast<bool>(*__seg_ & __mask_);140 return static_cast<bool>(*__seg_ & __mask_);
139 }141 }
140 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool operator~() const _NOEXCEPT {142 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool operator~() const _NOEXCEPT {
141 return !static_cast<bool>(*this);143 return !static_cast<bool>(*this);
142 }144 }
143145
...@@ -307,6 +309,15 @@ public:...@@ -307,6 +309,15 @@ public:
307 {309 {
308 }310 }
309311
312#ifdef _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR
313 template <bool _IsConstDep = _IsConst, __enable_if_t<_IsConstDep, int> = 0>
314 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
315 : __seg_(__it.__seg_),
316 __ctz_(__it.__ctz_) {}
317
318 _LIBCPP_HIDE_FROM_ABI __bit_iterator(const __bit_iterator&) = default;
319 _LIBCPP_HIDE_FROM_ABI __bit_iterator& operator=(const __bit_iterator&) = default;
320#else
310 // When _IsConst=false, this is the copy constructor.321 // When _IsConst=false, this is the copy constructor.
311 // It is non-trivial. Making it trivial would break ABI.322 // It is non-trivial. Making it trivial would break ABI.
312 // When _IsConst=true, this is a converting constructor;323 // When _IsConst=true, this is a converting constructor;
...@@ -327,6 +338,7 @@ public:...@@ -327,6 +338,7 @@ public:
327 __ctz_ = __it.__ctz_;338 __ctz_ = __it.__ctz_;
328 return *this;339 return *this;
329 }340 }
341#endif
330342
331 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator*() const _NOEXCEPT {343 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator*() const _NOEXCEPT {
332 _LIBCPP_ASSERT_INTERNAL(__ctz_ < __bits_per_word, "Dereferencing an invalid __bit_iterator.");344 _LIBCPP_ASSERT_INTERNAL(__ctz_ < __bits_per_word, "Dereferencing an invalid __bit_iterator.");
...@@ -467,20 +479,6 @@ private:...@@ -467,20 +479,6 @@ private:
467 template <class _Dp>479 template <class _Dp>
468 friend struct __bit_array;480 friend struct __bit_array;
469481
470 template <bool _FillVal, class _Dp>
471 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend void
472 __fill_n_bool(__bit_iterator<_Dp, false> __first, typename __size_difference_type_traits<_Dp>::size_type __n);
473
474 template <class _Dp, bool _IC>
475 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Dp, false> __copy_aligned(
476 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result);
477 template <class _Dp, bool _IC>
478 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Dp, false> __copy_unaligned(
479 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result);
480 template <class _Dp, bool _IC>
481 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend pair<__bit_iterator<_Dp, _IC>, __bit_iterator<_Dp, false> >
482 __copy_impl::operator()(
483 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result) const;
484 template <class _Dp, bool _IC>482 template <class _Dp, bool _IC>
485 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Dp, false> __copy_backward_aligned(483 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Dp, false> __copy_backward_aligned(
486 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result);484 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result);
...@@ -511,10 +509,20 @@ private:...@@ -511,10 +509,20 @@ private:
511 bool _IsConst1,509 bool _IsConst1,
512 bool _IsConst2,510 bool _IsConst2,
513 class _BinaryPredicate,511 class _BinaryPredicate,
514 __enable_if_t<__desugars_to_v<__equal_tag, _BinaryPredicate, bool, bool>, int> >512 class _Proj1,
513 class _Proj2,
514 __enable_if_t<__is_identity<_Proj1>::value && __is_identity<_Proj2>::value &&
515 __desugars_to_v<__equal_tag, _BinaryPredicate, bool, bool>,
516 int> >
515 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool __equal_iter_impl(517 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool __equal_iter_impl(
516 __bit_iterator<_Dp, _IsConst1>, __bit_iterator<_Dp, _IsConst1>, __bit_iterator<_Dp, _IsConst2>, _BinaryPredicate);518 __bit_iterator<_Dp, _IsConst1>,
517 template <class _Dp,519 __bit_iterator<_Dp, _IsConst1>,
520 __bit_iterator<_Dp, _IsConst2>,
521 _BinaryPredicate,
522 _Proj1&,
523 _Proj2&);
524 template <bool,
525 class _Dp,
518 bool _IsConst1,526 bool _IsConst1,
519 bool _IsConst2,527 bool _IsConst2,
520 class _Pred,528 class _Pred,
...@@ -537,6 +545,187 @@ private:...@@ -537,6 +545,187 @@ private:
537 template <bool _ToCount, class _Dp, bool _IC>545 template <bool _ToCount, class _Dp, bool _IC>
538 friend typename __bit_iterator<_Dp, _IC>::difference_type _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20546 friend typename __bit_iterator<_Dp, _IC>::difference_type _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
539 __count_bool(__bit_iterator<_Dp, _IC>, typename __size_difference_type_traits<_Dp>::size_type);547 __count_bool(__bit_iterator<_Dp, _IC>, typename __size_difference_type_traits<_Dp>::size_type);
548
549 template <class, class...>
550 friend struct __specialized_algorithm;
551};
552
553template <class _Cp>
554struct __specialized_algorithm<_Algorithm::__fill_n, __single_iterator<__bit_iterator<_Cp, false> > > {
555 static const bool __has_algorithm = true;
556
557 template <bool _FillVal>
558 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void
559 __impl(__bit_iterator<_Cp, false> __first, typename __size_difference_type_traits<_Cp>::size_type __n) {
560 using _It = __bit_iterator<_Cp, false>;
561 using __storage_type = typename _It::__storage_type;
562
563 const int __bits_per_word = _It::__bits_per_word;
564 // do first partial word
565 if (__first.__ctz_ != 0) {
566 __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
567 __storage_type __dn = std::min(__clz_f, __n);
568 std::__fill_masked_range(std::__to_address(__first.__seg_), __clz_f - __dn, __first.__ctz_, _FillVal);
569 __n -= __dn;
570 ++__first.__seg_;
571 }
572 // do middle whole words
573 __storage_type __nw = __n / __bits_per_word;
574 std::__fill_n(std::__to_address(__first.__seg_), __nw, _FillVal ? static_cast<__storage_type>(-1) : 0);
575 __n -= __nw * __bits_per_word;
576 // do last partial word
577 if (__n > 0) {
578 __first.__seg_ += __nw;
579 std::__fill_masked_range(std::__to_address(__first.__seg_), __bits_per_word - __n, 0u, _FillVal);
580 }
581 }
582
583 template <class _Size, class _Tp>
584 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static __bit_iterator<_Cp, false>
585 operator()(__bit_iterator<_Cp, false> __first, _Size __n, const _Tp& __value) {
586 if (__n > 0) {
587 if (__value)
588 __impl<true>(__first, __n);
589 else
590 __impl<false>(__first, __n);
591 }
592 return __first + __n;
593 }
594};
595
596template <class _Cp, bool _IsConst>
597struct __specialized_algorithm<_Algorithm::__copy,
598 __iterator_pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, _IsConst> >,
599 __single_iterator<__bit_iterator<_Cp, false> > > {
600 static const bool __has_algorithm = true;
601
602 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static __bit_iterator<_Cp, false>
603 __aligned_impl(__bit_iterator<_Cp, _IsConst> __first,
604 __bit_iterator<_Cp, _IsConst> __last,
605 __bit_iterator<_Cp, false> __result) {
606 using _In = __bit_iterator<_Cp, _IsConst>;
607 using difference_type = typename _In::difference_type;
608 using __storage_type = typename _In::__storage_type;
609
610 const int __bits_per_word = _In::__bits_per_word;
611 difference_type __n = __last - __first;
612 if (__n > 0) {
613 // do first word
614 if (__first.__ctz_ != 0) {
615 unsigned __clz = __bits_per_word - __first.__ctz_;
616 difference_type __dn = std::min(static_cast<difference_type>(__clz), __n);
617 __n -= __dn;
618 __storage_type __m = std::__middle_mask<__storage_type>(__clz - __dn, __first.__ctz_);
619 __storage_type __b = *__first.__seg_ & __m;
620 *__result.__seg_ &= ~__m;
621 *__result.__seg_ |= __b;
622 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
623 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
624 ++__first.__seg_;
625 // __first.__ctz_ = 0;
626 }
627 // __first.__ctz_ == 0;
628 // do middle words
629 __storage_type __nw = __n / __bits_per_word;
630 std::copy(std::__to_address(__first.__seg_),
631 std::__to_address(__first.__seg_ + __nw),
632 std::__to_address(__result.__seg_));
633 __n -= __nw * __bits_per_word;
634 __result.__seg_ += __nw;
635 // do last word
636 if (__n > 0) {
637 __first.__seg_ += __nw;
638 __storage_type __m = std::__trailing_mask<__storage_type>(__bits_per_word - __n);
639 __storage_type __b = *__first.__seg_ & __m;
640 *__result.__seg_ &= ~__m;
641 *__result.__seg_ |= __b;
642 __result.__ctz_ = static_cast<unsigned>(__n);
643 }
644 }
645 return __result;
646 }
647
648 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static __bit_iterator<_Cp, false>
649 __unaligned_impl(__bit_iterator<_Cp, _IsConst> __first,
650 __bit_iterator<_Cp, _IsConst> __last,
651 __bit_iterator<_Cp, false> __result) {
652 using _In = __bit_iterator<_Cp, _IsConst>;
653 using difference_type = typename _In::difference_type;
654 using __storage_type = typename _In::__storage_type;
655
656 const int __bits_per_word = _In::__bits_per_word;
657 difference_type __n = __last - __first;
658 if (__n > 0) {
659 // do first word
660 if (__first.__ctz_ != 0) {
661 unsigned __clz_f = __bits_per_word - __first.__ctz_;
662 difference_type __dn = std::min(static_cast<difference_type>(__clz_f), __n);
663 __n -= __dn;
664 __storage_type __m = std::__middle_mask<__storage_type>(__clz_f - __dn, __first.__ctz_);
665 __storage_type __b = *__first.__seg_ & __m;
666 unsigned __clz_r = __bits_per_word - __result.__ctz_;
667 __storage_type __ddn = std::min<__storage_type>(__dn, __clz_r);
668 __m = std::__middle_mask<__storage_type>(__clz_r - __ddn, __result.__ctz_);
669 *__result.__seg_ &= ~__m;
670 if (__result.__ctz_ > __first.__ctz_)
671 *__result.__seg_ |= __b << (__result.__ctz_ - __first.__ctz_);
672 else
673 *__result.__seg_ |= __b >> (__first.__ctz_ - __result.__ctz_);
674 __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word;
675 __result.__ctz_ = static_cast<unsigned>((__ddn + __result.__ctz_) % __bits_per_word);
676 __dn -= __ddn;
677 if (__dn > 0) {
678 __m = std::__trailing_mask<__storage_type>(__bits_per_word - __dn);
679 *__result.__seg_ &= ~__m;
680 *__result.__seg_ |= __b >> (__first.__ctz_ + __ddn);
681 __result.__ctz_ = static_cast<unsigned>(__dn);
682 }
683 ++__first.__seg_;
684 // __first.__ctz_ = 0;
685 }
686 // __first.__ctz_ == 0;
687 // do middle words
688 unsigned __clz_r = __bits_per_word - __result.__ctz_;
689 __storage_type __m = std::__leading_mask<__storage_type>(__result.__ctz_);
690 for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) {
691 __storage_type __b = *__first.__seg_;
692 *__result.__seg_ &= ~__m;
693 *__result.__seg_ |= __b << __result.__ctz_;
694 ++__result.__seg_;
695 *__result.__seg_ &= __m;
696 *__result.__seg_ |= __b >> __clz_r;
697 }
698 // do last word
699 if (__n > 0) {
700 __m = std::__trailing_mask<__storage_type>(__bits_per_word - __n);
701 __storage_type __b = *__first.__seg_ & __m;
702 __storage_type __dn = std::min(__n, static_cast<difference_type>(__clz_r));
703 __m = std::__middle_mask<__storage_type>(__clz_r - __dn, __result.__ctz_);
704 *__result.__seg_ &= ~__m;
705 *__result.__seg_ |= __b << __result.__ctz_;
706 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
707 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
708 __n -= __dn;
709 if (__n > 0) {
710 __m = std::__trailing_mask<__storage_type>(__bits_per_word - __n);
711 *__result.__seg_ &= ~__m;
712 *__result.__seg_ |= __b >> __dn;
713 __result.__ctz_ = static_cast<unsigned>(__n);
714 }
715 }
716 }
717 return __result;
718 }
719
720 _LIBCPP_HIDE_FROM_ABI
721 _LIBCPP_CONSTEXPR_SINCE_CXX20 static pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >
722 operator()(__bit_iterator<_Cp, _IsConst> __first,
723 __bit_iterator<_Cp, _IsConst> __last,
724 __bit_iterator<_Cp, false> __result) {
725 if (__first.__ctz_ == __result.__ctz_)
726 return std::make_pair(__last, __aligned_impl(__first, __last, __result));
727 return std::make_pair(__last, __unaligned_impl(__first, __last, __result));
728 }
540};729};
541730
542_LIBCPP_END_NAMESPACE_STD731_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__charconv/from_chars_integral.h+1-1
...@@ -18,8 +18,8 @@...@@ -18,8 +18,8 @@
18#include <__memory/addressof.h>18#include <__memory/addressof.h>
19#include <__system_error/errc.h>19#include <__system_error/errc.h>
20#include <__type_traits/enable_if.h>20#include <__type_traits/enable_if.h>
21#include <__type_traits/integral_constant.h>
22#include <__type_traits/is_integral.h>21#include <__type_traits/is_integral.h>
22#include <__type_traits/is_signed.h>
23#include <__type_traits/is_unsigned.h>23#include <__type_traits/is_unsigned.h>
24#include <__type_traits/make_unsigned.h>24#include <__type_traits/make_unsigned.h>
25#include <limits>25#include <limits>
lib/libcxx/include/__charconv/from_chars_result.h+1-1
...@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121
22#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2323
24struct _LIBCPP_EXPORTED_FROM_ABI from_chars_result {24struct from_chars_result {
25 const char* ptr;25 const char* ptr;
26 errc ec;26 errc ec;
27# if _LIBCPP_STD_VER >= 2027# if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__charconv/to_chars_integral.h+1
...@@ -24,6 +24,7 @@...@@ -24,6 +24,7 @@
24#include <__type_traits/integral_constant.h>24#include <__type_traits/integral_constant.h>
25#include <__type_traits/is_integral.h>25#include <__type_traits/is_integral.h>
26#include <__type_traits/is_same.h>26#include <__type_traits/is_same.h>
27#include <__type_traits/is_signed.h>
27#include <__type_traits/make_32_64_or_128_bit.h>28#include <__type_traits/make_32_64_or_128_bit.h>
28#include <__type_traits/make_unsigned.h>29#include <__type_traits/make_unsigned.h>
29#include <__utility/unreachable.h>30#include <__utility/unreachable.h>
lib/libcxx/include/__charconv/to_chars_result.h+1-1
...@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121
22#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2323
24struct _LIBCPP_EXPORTED_FROM_ABI to_chars_result {24struct to_chars_result {
25 char* ptr;25 char* ptr;
26 errc ec;26 errc ec;
27# if _LIBCPP_STD_VER >= 2027# if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__charconv/traits.h+3-24
...@@ -113,31 +113,10 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__u...@@ -113,31 +113,10 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__u
113};113};
114# endif114# endif
115115
116template <typename _Tp>
117inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
118__mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r) {
119 auto __c = __a * __b;
120 __r = __c;
121 return __c > numeric_limits<unsigned char>::max();
122}
123
124template <typename _Tp>
125inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
126__mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r) {
127 auto __c = __a * __b;
128 __r = __c;
129 return __c > numeric_limits<unsigned short>::max();
130}
131
132template <typename _Tp>
133inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r) {
134 static_assert(is_unsigned<_Tp>::value, "");
135 return __builtin_mul_overflow(__a, __b, std::addressof(__r));
136}
137
138template <typename _Tp, typename _Up>116template <typename _Tp, typename _Up>
139inline _LIBCPP_HIDE_FROM_ABI bool _LIBCPP_CONSTEXPR_SINCE_CXX23 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r) {117_LIBCPP_HIDE_FROM_ABI bool _LIBCPP_CONSTEXPR_SINCE_CXX23 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r) {
140 return __itoa::__mul_overflowed(__a, static_cast<_Tp>(__b), __r);118 static_assert(is_unsigned<_Tp>::value);
119 return __builtin_mul_overflow(__a, static_cast<_Tp>(__b), std::addressof(__r));
141}120}
142121
143template <typename _Tp>122template <typename _Tp>
lib/libcxx/include/__chrono/day.h+11
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
13#include <__chrono/duration.h>13#include <__chrono/duration.h>
14#include <__compare/ordering.h>14#include <__compare/ordering.h>
15#include <__config>15#include <__config>
16#include <__cstddef/size_t.h>
17#include <__functional/hash.h>
1618
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header20# pragma GCC system_header
...@@ -92,6 +94,15 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr day& day::operator-=(const days& __dd) no...@@ -92,6 +94,15 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr day& day::operator-=(const days& __dd) no
9294
93} // namespace chrono95} // namespace chrono
9496
97# if _LIBCPP_STD_VER >= 26
98
99template <>
100struct hash<chrono::day> {
101 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::day& __d) noexcept { return static_cast<unsigned>(__d); }
102};
103
104# endif // _LIBCPP_STD_VER >= 26
105
95_LIBCPP_END_NAMESPACE_STD106_LIBCPP_END_NAMESPACE_STD
96107
97#endif // _LIBCPP_STD_VER >= 20108#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/duration.h+58-33
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
13#include <__compare/ordering.h>13#include <__compare/ordering.h>
14#include <__compare/three_way_comparable.h>14#include <__compare/three_way_comparable.h>
15#include <__config>15#include <__config>
16#include <__cstddef/size_t.h>
17#include <__functional/hash.h>
16#include <__type_traits/common_type.h>18#include <__type_traits/common_type.h>
17#include <__type_traits/enable_if.h>19#include <__type_traits/enable_if.h>
18#include <__type_traits/is_convertible.h>20#include <__type_traits/is_convertible.h>
...@@ -102,7 +104,8 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false> {...@@ -102,7 +104,8 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false> {
102};104};
103105
104template <class _ToDuration, class _Rep, class _Period, __enable_if_t<__is_duration_v<_ToDuration>, int> = 0>106template <class _ToDuration, class _Rep, class _Period, __enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
105inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration duration_cast(const duration<_Rep, _Period>& __fd) {107[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration
108duration_cast(const duration<_Rep, _Period>& __fd) {
106 return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);109 return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
107}110}
108111
...@@ -117,14 +120,18 @@ inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>:...@@ -117,14 +120,18 @@ inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>:
117template <class _Rep>120template <class _Rep>
118struct duration_values {121struct duration_values {
119public:122public:
120 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep zero() _NOEXCEPT { return _Rep(0); }123 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep zero() _NOEXCEPT { return _Rep(0); }
121 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep max() _NOEXCEPT { return numeric_limits<_Rep>::max(); }124 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep max() _NOEXCEPT {
122 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep min() _NOEXCEPT { return numeric_limits<_Rep>::lowest(); }125 return numeric_limits<_Rep>::max();
126 }
127 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep min() _NOEXCEPT {
128 return numeric_limits<_Rep>::lowest();
129 }
123};130};
124131
125#if _LIBCPP_STD_VER >= 17132#if _LIBCPP_STD_VER >= 17
126template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>133template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
127inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration floor(const duration<_Rep, _Period>& __d) {134[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration floor(const duration<_Rep, _Period>& __d) {
128 _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);135 _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
129 if (__t > __d)136 if (__t > __d)
130 __t = __t - _ToDuration{1};137 __t = __t - _ToDuration{1};
...@@ -132,7 +139,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration floor(const duration<...@@ -132,7 +139,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration floor(const duration<
132}139}
133140
134template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>141template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
135inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration ceil(const duration<_Rep, _Period>& __d) {142[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration ceil(const duration<_Rep, _Period>& __d) {
136 _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);143 _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
137 if (__t < __d)144 if (__t < __d)
138 __t = __t + _ToDuration{1};145 __t = __t + _ToDuration{1};
...@@ -140,7 +147,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration ceil(const duration<_...@@ -140,7 +147,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration ceil(const duration<_
140}147}
141148
142template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>149template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
143inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration round(const duration<_Rep, _Period>& __d) {150[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration round(const duration<_Rep, _Period>& __d) {
144 _ToDuration __lower = chrono::floor<_ToDuration>(__d);151 _ToDuration __lower = chrono::floor<_ToDuration>(__d);
145 _ToDuration __upper = __lower + _ToDuration{1};152 _ToDuration __upper = __lower + _ToDuration{1};
146 auto __lower_diff = __d - __lower;153 auto __lower_diff = __d - __lower;
...@@ -220,14 +227,14 @@ public:...@@ -220,14 +227,14 @@ public:
220227
221 // observer228 // observer
222229
223 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR rep count() const { return __rep_; }230 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR rep count() const { return __rep_; }
224231
225 // arithmetic232 // arithmetic
226233
227 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename common_type<duration>::type operator+() const {234 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename common_type<duration>::type operator+() const {
228 return typename common_type<duration>::type(*this);235 return typename common_type<duration>::type(*this);
229 }236 }
230 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename common_type<duration>::type operator-() const {237 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename common_type<duration>::type operator-() const {
231 return typename common_type<duration>::type(-__rep_);238 return typename common_type<duration>::type(-__rep_);
232 }239 }
233 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 duration& operator++() {240 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 duration& operator++() {
...@@ -269,13 +276,13 @@ public:...@@ -269,13 +276,13 @@ public:
269276
270 // special values277 // special values
271278
272 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR duration zero() _NOEXCEPT {279 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR duration zero() _NOEXCEPT {
273 return duration(duration_values<rep>::zero());280 return duration(duration_values<rep>::zero());
274 }281 }
275 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR duration min() _NOEXCEPT {282 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR duration min() _NOEXCEPT {
276 return duration(duration_values<rep>::min());283 return duration(duration_values<rep>::min());
277 }284 }
278 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR duration max() _NOEXCEPT {285 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR duration max() _NOEXCEPT {
279 return duration(duration_values<rep>::max());286 return duration(duration_values<rep>::max());
280 }287 }
281};288};
...@@ -389,7 +396,7 @@ operator<=>(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Perio...@@ -389,7 +396,7 @@ operator<=>(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Perio
389// Duration +396// Duration +
390397
391template <class _Rep1, class _Period1, class _Rep2, class _Period2>398template <class _Rep1, class _Period1, class _Rep2, class _Period2>
392inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR399[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
393typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type400typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
394operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {401operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
395 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;402 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
...@@ -399,7 +406,7 @@ operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2...@@ -399,7 +406,7 @@ operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
399// Duration -406// Duration -
400407
401template <class _Rep1, class _Period1, class _Rep2, class _Period2>408template <class _Rep1, class _Period1, class _Rep2, class _Period2>
402inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR409[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
403typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type410typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
404operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {411operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
405 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;412 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
...@@ -412,7 +419,8 @@ template <class _Rep1,...@@ -412,7 +419,8 @@ template <class _Rep1,
412 class _Period,419 class _Period,
413 class _Rep2,420 class _Rep2,
414 __enable_if_t<is_convertible<const _Rep2&, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>421 __enable_if_t<is_convertible<const _Rep2&, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
415inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>422[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
423_LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>
416operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {424operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {
417 typedef typename common_type<_Rep1, _Rep2>::type _Cr;425 typedef typename common_type<_Rep1, _Rep2>::type _Cr;
418 typedef duration<_Cr, _Period> _Cd;426 typedef duration<_Cr, _Period> _Cd;
...@@ -423,7 +431,8 @@ template <class _Rep1,...@@ -423,7 +431,8 @@ template <class _Rep1,
423 class _Period,431 class _Period,
424 class _Rep2,432 class _Rep2,
425 __enable_if_t<is_convertible<const _Rep1&, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>433 __enable_if_t<is_convertible<const _Rep1&, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
426inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>434[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
435_LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>
427operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d) {436operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d) {
428 return __d * __s;437 return __d * __s;
429}438}
...@@ -436,7 +445,8 @@ template <class _Rep1,...@@ -436,7 +445,8 @@ template <class _Rep1,
436 __enable_if_t<!__is_duration_v<_Rep2> &&445 __enable_if_t<!__is_duration_v<_Rep2> &&
437 is_convertible<const _Rep2&, typename common_type<_Rep1, _Rep2>::type>::value,446 is_convertible<const _Rep2&, typename common_type<_Rep1, _Rep2>::type>::value,
438 int> = 0>447 int> = 0>
439inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>448[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
449_LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>
440operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {450operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {
441 typedef typename common_type<_Rep1, _Rep2>::type _Cr;451 typedef typename common_type<_Rep1, _Rep2>::type _Cr;
442 typedef duration<_Cr, _Period> _Cd;452 typedef duration<_Cr, _Period> _Cd;
...@@ -444,7 +454,7 @@ operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {...@@ -444,7 +454,7 @@ operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {
444}454}
445455
446template <class _Rep1, class _Period1, class _Rep2, class _Period2>456template <class _Rep1, class _Period1, class _Rep2, class _Period2>
447inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename common_type<_Rep1, _Rep2>::type457[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename common_type<_Rep1, _Rep2>::type
448operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {458operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
449 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Ct;459 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Ct;
450 return _Ct(__lhs).count() / _Ct(__rhs).count();460 return _Ct(__lhs).count() / _Ct(__rhs).count();
...@@ -458,7 +468,8 @@ template <class _Rep1,...@@ -458,7 +468,8 @@ template <class _Rep1,
458 __enable_if_t<!__is_duration_v<_Rep2> &&468 __enable_if_t<!__is_duration_v<_Rep2> &&
459 is_convertible<const _Rep2&, typename common_type<_Rep1, _Rep2>::type>::value,469 is_convertible<const _Rep2&, typename common_type<_Rep1, _Rep2>::type>::value,
460 int> = 0>470 int> = 0>
461inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>471[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
472_LIBCPP_CONSTEXPR duration<typename common_type<_Rep1, _Rep2>::type, _Period>
462operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {473operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {
463 typedef typename common_type<_Rep1, _Rep2>::type _Cr;474 typedef typename common_type<_Rep1, _Rep2>::type _Cr;
464 typedef duration<_Cr, _Period> _Cd;475 typedef duration<_Cr, _Period> _Cd;
...@@ -466,7 +477,7 @@ operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {...@@ -466,7 +477,7 @@ operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {
466}477}
467478
468template <class _Rep1, class _Period1, class _Rep2, class _Period2>479template <class _Rep1, class _Period1, class _Rep2, class _Period2>
469inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR480[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
470typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type481typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
471operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {482operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
472 typedef typename common_type<_Rep1, _Rep2>::type _Cr;483 typedef typename common_type<_Rep1, _Rep2>::type _Cr;
...@@ -481,51 +492,53 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2...@@ -481,51 +492,53 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
481inline namespace literals {492inline namespace literals {
482inline namespace chrono_literals {493inline namespace chrono_literals {
483494
484_LIBCPP_HIDE_FROM_ABI constexpr chrono::hours operator""h(unsigned long long __h) {495[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours operator""h(unsigned long long __h) {
485 return chrono::hours(static_cast<chrono::hours::rep>(__h));496 return chrono::hours(static_cast<chrono::hours::rep>(__h));
486}497}
487498
488_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, ratio<3600, 1>> operator""h(long double __h) {499[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, ratio<3600, 1>>
500operator""h(long double __h) {
489 return chrono::duration<long double, ratio<3600, 1>>(__h);501 return chrono::duration<long double, ratio<3600, 1>>(__h);
490}502}
491503
492_LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes operator""min(unsigned long long __m) {504[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes operator""min(unsigned long long __m) {
493 return chrono::minutes(static_cast<chrono::minutes::rep>(__m));505 return chrono::minutes(static_cast<chrono::minutes::rep>(__m));
494}506}
495507
496_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, ratio<60, 1>> operator""min(long double __m) {508[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, ratio<60, 1>>
509operator""min(long double __m) {
497 return chrono::duration<long double, ratio<60, 1>>(__m);510 return chrono::duration<long double, ratio<60, 1>>(__m);
498}511}
499512
500_LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds operator""s(unsigned long long __s) {513[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds operator""s(unsigned long long __s) {
501 return chrono::seconds(static_cast<chrono::seconds::rep>(__s));514 return chrono::seconds(static_cast<chrono::seconds::rep>(__s));
502}515}
503516
504_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double> operator""s(long double __s) {517[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double> operator""s(long double __s) {
505 return chrono::duration<long double>(__s);518 return chrono::duration<long double>(__s);
506}519}
507520
508_LIBCPP_HIDE_FROM_ABI constexpr chrono::milliseconds operator""ms(unsigned long long __ms) {521[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::milliseconds operator""ms(unsigned long long __ms) {
509 return chrono::milliseconds(static_cast<chrono::milliseconds::rep>(__ms));522 return chrono::milliseconds(static_cast<chrono::milliseconds::rep>(__ms));
510}523}
511524
512_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, milli> operator""ms(long double __ms) {525[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, milli> operator""ms(long double __ms) {
513 return chrono::duration<long double, milli>(__ms);526 return chrono::duration<long double, milli>(__ms);
514}527}
515528
516_LIBCPP_HIDE_FROM_ABI constexpr chrono::microseconds operator""us(unsigned long long __us) {529[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::microseconds operator""us(unsigned long long __us) {
517 return chrono::microseconds(static_cast<chrono::microseconds::rep>(__us));530 return chrono::microseconds(static_cast<chrono::microseconds::rep>(__us));
518}531}
519532
520_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, micro> operator""us(long double __us) {533[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, micro> operator""us(long double __us) {
521 return chrono::duration<long double, micro>(__us);534 return chrono::duration<long double, micro>(__us);
522}535}
523536
524_LIBCPP_HIDE_FROM_ABI constexpr chrono::nanoseconds operator""ns(unsigned long long __ns) {537[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::nanoseconds operator""ns(unsigned long long __ns) {
525 return chrono::nanoseconds(static_cast<chrono::nanoseconds::rep>(__ns));538 return chrono::nanoseconds(static_cast<chrono::nanoseconds::rep>(__ns));
526}539}
527540
528_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, nano> operator""ns(long double __ns) {541[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, nano> operator""ns(long double __ns) {
529 return chrono::duration<long double, nano>(__ns);542 return chrono::duration<long double, nano>(__ns);
530}543}
531544
...@@ -538,6 +551,18 @@ using namespace literals::chrono_literals;...@@ -538,6 +551,18 @@ using namespace literals::chrono_literals;
538551
539#endif // _LIBCPP_STD_VER >= 14552#endif // _LIBCPP_STD_VER >= 14
540553
554#if _LIBCPP_STD_VER >= 26
555
556template <class _Rep, class _Period>
557 requires __has_enabled_hash<_Rep>::value
558struct hash<chrono::duration<_Rep, _Period>> {
559 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::duration<_Rep, _Period>& __d) {
560 return hash<_Rep>{}(__d.count());
561 }
562};
563
564#endif // _LIBCPP_STD_VER >= 26
565
541_LIBCPP_END_NAMESPACE_STD566_LIBCPP_END_NAMESPACE_STD
542567
543_LIBCPP_POP_MACROS568_LIBCPP_POP_MACROS
lib/libcxx/include/__chrono/file_clock.h+4-2
...@@ -60,16 +60,18 @@ struct _FilesystemClock {...@@ -60,16 +60,18 @@ struct _FilesystemClock {
6060
61 _LIBCPP_EXPORTED_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;61 _LIBCPP_EXPORTED_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;
6262
63 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI static time_point now() noexcept;63 [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI static time_point now() noexcept;
6464
65# if _LIBCPP_STD_VER >= 2065# if _LIBCPP_STD_VER >= 20
66 template <class _Duration>66 template <class _Duration>
67 [[nodiscard]]
67 _LIBCPP_HIDE_FROM_ABI static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {68 _LIBCPP_HIDE_FROM_ABI static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {
68 return chrono::sys_time<_Duration>(__t.time_since_epoch());69 return chrono::sys_time<_Duration>(__t.time_since_epoch());
69 }70 }
7071
71 template <class _Duration>72 template <class _Duration>
72 _LIBCPP_HIDE_FROM_ABI static chrono::file_time<_Duration> from_sys(const chrono::sys_time<_Duration>& __t) {73 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static chrono::file_time<_Duration>
74 from_sys(const chrono::sys_time<_Duration>& __t) {
73 return chrono::file_time<_Duration>(__t.time_since_epoch());75 return chrono::file_time<_Duration>(__t.time_since_epoch());
74 }76 }
75# endif // _LIBCPP_STD_VER >= 2077# endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/is_clock.h created+72
...@@ -0,0 +1,72 @@
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___CHRONO_IS_CLOCK_H
11#define _LIBCPP___CHRONO_IS_CLOCK_H
12
13#include <__config>
14
15#include <__chrono/duration.h>
16#include <__chrono/time_point.h>
17#include <__concepts/same_as.h>
18#include <__type_traits/integral_constant.h>
19#include <__type_traits/is_arithmetic.h>
20#include <__type_traits/is_class.h>
21#include <__type_traits/is_union.h>
22#include <ratio>
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28#if _LIBCPP_STD_VER >= 20
29
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32namespace chrono {
33
34// Helper to check that _Tp::time_point has the form time_point<_, typename _Tp::duration>.
35template <class _TimePoint, class _ClockType>
36inline constexpr bool __is_valid_clock_time_point_v = false;
37
38template <class _TimePointClock, class _ClockType>
39inline constexpr bool
40 __is_valid_clock_time_point_v<time_point<_TimePointClock, typename _ClockType::duration>, _ClockType> = true;
41
42// Check if a clock satisfies the Cpp17Clock requirements as defined in [time.clock.req]
43template <class _Tp>
44_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_clock_v = requires {
45 typename _Tp::rep;
46 requires is_arithmetic_v<typename _Tp::rep> || is_class_v<typename _Tp::rep> || is_union_v<typename _Tp::rep>;
47
48 typename _Tp::period;
49 requires __is_ratio_v<typename _Tp::period>;
50
51 typename _Tp::duration;
52 requires same_as<typename _Tp::duration, duration<typename _Tp::rep, typename _Tp::period>>;
53
54 typename _Tp::time_point;
55 requires __is_valid_clock_time_point_v<typename _Tp::time_point, _Tp>;
56
57 _Tp::is_steady;
58 requires same_as<decltype((_Tp::is_steady)), const bool&>;
59
60 _Tp::now();
61 requires same_as<decltype(_Tp::now()), typename _Tp::time_point>;
62};
63
64template <class _Tp>
65struct _LIBCPP_NO_SPECIALIZATIONS is_clock : bool_constant<is_clock_v<_Tp>> {};
66
67} // namespace chrono
68
69_LIBCPP_END_NAMESPACE_STD
70
71#endif // _LIBCPP_STD_VER
72#endif // _LIBCPP___CHRONO_IS_CLOCK_H
lib/libcxx/include/__chrono/leap_second.h+13
...@@ -22,6 +22,8 @@...@@ -22,6 +22,8 @@
22# include <__compare/ordering.h>22# include <__compare/ordering.h>
23# include <__compare/three_way_comparable.h>23# include <__compare/three_way_comparable.h>
24# include <__config>24# include <__config>
25# include <__cstddef/size_t.h>
26# include <__functional/hash.h>
25# include <__utility/private_constructor_tag.h>27# include <__utility/private_constructor_tag.h>
2628
27# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)29# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -122,6 +124,17 @@ private:...@@ -122,6 +124,17 @@ private:
122124
123} // namespace chrono125} // namespace chrono
124126
127# if _LIBCPP_STD_VER >= 26
128
129template <>
130struct hash<chrono::leap_second> {
131 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::leap_second& __lp) noexcept {
132 return std::__hash_combine(hash<chrono::sys_seconds>{}(__lp.date()), hash<chrono::seconds>{}(__lp.value()));
133 }
134};
135
136# endif // _LIBCPP_STD_VER >= 26
137
125# endif // _LIBCPP_STD_VER >= 20138# endif // _LIBCPP_STD_VER >= 20
126139
127_LIBCPP_END_NAMESPACE_STD140_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__chrono/month.h+13
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
13#include <__chrono/duration.h>13#include <__chrono/duration.h>
14#include <__compare/ordering.h>14#include <__compare/ordering.h>
15#include <__config>15#include <__config>
16#include <__cstddef/size_t.h>
17#include <__functional/hash.h>
1618
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header20# pragma GCC system_header
...@@ -108,6 +110,17 @@ inline constexpr month December{12};...@@ -108,6 +110,17 @@ inline constexpr month December{12};
108110
109} // namespace chrono111} // namespace chrono
110112
113# if _LIBCPP_STD_VER >= 26
114
115template <>
116struct hash<chrono::month> {
117 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month& __m) noexcept {
118 return static_cast<unsigned>(__m);
119 }
120};
121
122# endif // _LIBCPP_STD_VER >= 26
123
111_LIBCPP_END_NAMESPACE_STD124_LIBCPP_END_NAMESPACE_STD
112125
113#endif // _LIBCPP_STD_VER >= 20126#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/month_weekday.h+22
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
13#include <__chrono/month.h>13#include <__chrono/month.h>
14#include <__chrono/weekday.h>14#include <__chrono/weekday.h>
15#include <__config>15#include <__config>
16#include <__cstddef/size_t.h>
17#include <__functional/hash.h>
1618
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header20# pragma GCC system_header
...@@ -98,6 +100,26 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekda...@@ -98,6 +100,26 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekda
98}100}
99} // namespace chrono101} // namespace chrono
100102
103# if _LIBCPP_STD_VER >= 26
104
105template <>
106struct hash<chrono::month_weekday> {
107 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday& __mw) noexcept {
108 return std::__hash_combine(
109 hash<chrono::month>{}(__mw.month()), hash<chrono::weekday_indexed>{}(__mw.weekday_indexed()));
110 }
111};
112
113template <>
114struct hash<chrono::month_weekday_last> {
115 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday_last& __mwl) noexcept {
116 return std::__hash_combine(
117 hash<chrono::month>{}(__mwl.month()), hash<chrono::weekday_last>{}(__mwl.weekday_last()));
118 }
119};
120
121# endif // _LIBCPP_STD_VER >= 26
122
101_LIBCPP_END_NAMESPACE_STD123_LIBCPP_END_NAMESPACE_STD
102124
103#endif // _LIBCPP_STD_VER >= 20125#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/monthday.h+20
...@@ -15,6 +15,8 @@...@@ -15,6 +15,8 @@
15#include <__chrono/month.h>15#include <__chrono/month.h>
16#include <__compare/ordering.h>16#include <__compare/ordering.h>
17#include <__config>17#include <__config>
18#include <__cstddef/size_t.h>
19#include <__functional/hash.h>
1820
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header22# pragma GCC system_header
...@@ -126,6 +128,24 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int _...@@ -126,6 +128,24 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int _
126128
127} // namespace chrono129} // namespace chrono
128130
131# if _LIBCPP_STD_VER >= 26
132
133template <>
134struct hash<chrono::month_day> {
135 _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()));
137 }
138};
139
140template <>
141struct hash<chrono::month_day_last> {
142 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day_last& __mdl) noexcept {
143 return hash<chrono::month>{}(__mdl.month());
144 }
145};
146
147# endif // _LIBCPP_STD_VER >= 26
148
129_LIBCPP_END_NAMESPACE_STD149_LIBCPP_END_NAMESPACE_STD
130150
131#endif // _LIBCPP_STD_VER >= 20151#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/steady_clock.h+1-1
...@@ -31,7 +31,7 @@ public:...@@ -31,7 +31,7 @@ public:
31 typedef chrono::time_point<steady_clock, duration> time_point;31 typedef chrono::time_point<steady_clock, duration> time_point;
32 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = true;32 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = true;
3333
34 static time_point now() _NOEXCEPT;34 [[__nodiscard__]] static time_point now() _NOEXCEPT;
35};35};
36#endif36#endif
3737
lib/libcxx/include/__chrono/system_clock.h+3-3
...@@ -31,9 +31,9 @@ public:...@@ -31,9 +31,9 @@ public:
31 typedef chrono::time_point<system_clock> time_point;31 typedef chrono::time_point<system_clock> time_point;
32 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;32 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;
3333
34 static time_point now() _NOEXCEPT;34 [[__nodiscard__]] static time_point now() _NOEXCEPT;
35 static time_t to_time_t(const time_point& __t) _NOEXCEPT;35 [[__nodiscard__]] static time_t to_time_t(const time_point& __t) _NOEXCEPT;
36 static time_point from_time_t(time_t __t) _NOEXCEPT;36 [[__nodiscard__]] static time_point from_time_t(time_t __t) _NOEXCEPT;
37};37};
3838
39#if _LIBCPP_STD_VER >= 2039#if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/time_point.h+37-13
...@@ -14,6 +14,8 @@...@@ -14,6 +14,8 @@
14#include <__compare/ordering.h>14#include <__compare/ordering.h>
15#include <__compare/three_way_comparable.h>15#include <__compare/three_way_comparable.h>
16#include <__config>16#include <__config>
17#include <__cstddef/size_t.h>
18#include <__functional/hash.h>
17#include <__type_traits/common_type.h>19#include <__type_traits/common_type.h>
18#include <__type_traits/enable_if.h>20#include <__type_traits/enable_if.h>
19#include <__type_traits/is_convertible.h>21#include <__type_traits/is_convertible.h>
...@@ -54,7 +56,9 @@ public:...@@ -54,7 +56,9 @@ public:
5456
55 // observer57 // observer
5658
57 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 duration time_since_epoch() const { return __d_; }59 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 duration time_since_epoch() const {
60 return __d_;
61 }
5862
59 // arithmetic63 // arithmetic
6064
...@@ -82,8 +86,12 @@ public:...@@ -82,8 +86,12 @@ public:
8286
83 // special values87 // special values
8488
85 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR time_point min() _NOEXCEPT { return time_point(duration::min()); }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR time_point min() _NOEXCEPT {
86 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR time_point max() _NOEXCEPT { return time_point(duration::max()); }90 return time_point(duration::min());
91 }
92 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR time_point max() _NOEXCEPT {
93 return time_point(duration::max());
94 }
87};95};
8896
89} // namespace chrono97} // namespace chrono
...@@ -95,30 +103,33 @@ struct common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_C...@@ -95,30 +103,33 @@ struct common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_C
95103
96namespace chrono {104namespace chrono {
97105
98template <class _ToDuration, class _Clock, class _Duration>106template <class _ToDuration, class _Clock, class _Duration, __enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
99inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, _ToDuration>107[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, _ToDuration>
100time_point_cast(const time_point<_Clock, _Duration>& __t) {108time_point_cast(const time_point<_Clock, _Duration>& __t) {
101 return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));109 return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
102}110}
103111
104#if _LIBCPP_STD_VER >= 17112#if _LIBCPP_STD_VER >= 17
105template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>113template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
106inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> floor(const time_point<_Clock, _Duration>& __t) {114[[nodiscard]] inline
115 _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> floor(const time_point<_Clock, _Duration>& __t) {
107 return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())};116 return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())};
108}117}
109118
110template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>119template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
111inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> ceil(const time_point<_Clock, _Duration>& __t) {120[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration>
121ceil(const time_point<_Clock, _Duration>& __t) {
112 return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())};122 return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())};
113}123}
114124
115template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>125template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
116inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> round(const time_point<_Clock, _Duration>& __t) {126[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration>
127round(const time_point<_Clock, _Duration>& __t) {
117 return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())};128 return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())};
118}129}
119130
120template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>131template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
121inline _LIBCPP_HIDE_FROM_ABI constexpr duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) {132[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) {
122 return __d >= __d.zero() ? +__d : -__d;133 return __d >= __d.zero() ? +__d : -__d;
123}134}
124#endif // _LIBCPP_STD_VER >= 17135#endif // _LIBCPP_STD_VER >= 17
...@@ -188,7 +199,7 @@ operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock...@@ -188,7 +199,7 @@ operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock
188// time_point operator+(time_point x, duration y);199// time_point operator+(time_point x, duration y);
189200
190template <class _Clock, class _Duration1, class _Rep2, class _Period2>201template <class _Clock, class _Duration1, class _Rep2, class _Period2>
191inline _LIBCPP_HIDE_FROM_ABI202[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
192_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>203_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
193operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {204operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
194 typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr;205 typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr;
...@@ -198,7 +209,7 @@ operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Pe...@@ -198,7 +209,7 @@ operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Pe
198// time_point operator+(duration x, time_point y);209// time_point operator+(duration x, time_point y);
199210
200template <class _Rep1, class _Period1, class _Clock, class _Duration2>211template <class _Rep1, class _Period1, class _Clock, class _Duration2>
201inline _LIBCPP_HIDE_FROM_ABI212[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
202_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>213_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
203operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {214operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
204 return __rhs + __lhs;215 return __rhs + __lhs;
...@@ -207,7 +218,7 @@ operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Dura...@@ -207,7 +218,7 @@ operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Dura
207// time_point operator-(time_point x, duration y);218// time_point operator-(time_point x, duration y);
208219
209template <class _Clock, class _Duration1, class _Rep2, class _Period2>220template <class _Clock, class _Duration1, class _Rep2, class _Period2>
210inline _LIBCPP_HIDE_FROM_ABI221[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
211_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>222_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
212operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {223operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
213 typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret;224 typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret;
...@@ -217,13 +228,26 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Pe...@@ -217,13 +228,26 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Pe
217// duration operator-(time_point x, time_point y);228// duration operator-(time_point x, time_point y);
218229
219template <class _Clock, class _Duration1, class _Duration2>230template <class _Clock, class _Duration1, class _Duration2>
220inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename common_type<_Duration1, _Duration2>::type231[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
232typename common_type<_Duration1, _Duration2>::type
221operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {233operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
222 return __lhs.time_since_epoch() - __rhs.time_since_epoch();234 return __lhs.time_since_epoch() - __rhs.time_since_epoch();
223}235}
224236
225} // namespace chrono237} // namespace chrono
226238
239#if _LIBCPP_STD_VER >= 26
240
241template <class _Clock, class _Duration>
242 requires __has_enabled_hash<_Duration>::value
243struct hash<chrono::time_point<_Clock, _Duration>> {
244 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::time_point<_Clock, _Duration>& __tp) {
245 return hash<_Duration>{}(__tp.time_since_epoch());
246 }
247};
248
249#endif // _LIBCPP_STD_VER >= 26
250
227_LIBCPP_END_NAMESPACE_STD251_LIBCPP_END_NAMESPACE_STD
228252
229_LIBCPP_POP_MACROS253_LIBCPP_POP_MACROS
lib/libcxx/include/__chrono/weekday.h+25
...@@ -15,6 +15,8 @@...@@ -15,6 +15,8 @@
15#include <__chrono/system_clock.h>15#include <__chrono/system_clock.h>
16#include <__chrono/time_point.h>16#include <__chrono/time_point.h>
17#include <__config>17#include <__config>
18#include <__cstddef/size_t.h>
19#include <__functional/hash.h>
1820
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header22# pragma GCC system_header
...@@ -160,6 +162,29 @@ inline constexpr weekday Saturday{6};...@@ -160,6 +162,29 @@ inline constexpr weekday Saturday{6};
160162
161} // namespace chrono163} // namespace chrono
162164
165# if _LIBCPP_STD_VER >= 26
166
167template <>
168struct hash<chrono::weekday> {
169 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday& __w) noexcept { return __w.c_encoding(); }
170};
171
172template <>
173struct hash<chrono::weekday_indexed> {
174 _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());
176 }
177};
178
179template <>
180struct hash<chrono::weekday_last> {
181 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_last& __wl) noexcept {
182 return hash<chrono::weekday>{}(__wl.weekday());
183 }
184};
185
186# endif // _LIBCPP_STD_VER >= 26
187
163_LIBCPP_END_NAMESPACE_STD188_LIBCPP_END_NAMESPACE_STD
164189
165#endif // _LIBCPP_STD_VER >= 20190#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/year.h+11
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
13#include <__chrono/duration.h>13#include <__chrono/duration.h>
14#include <__compare/ordering.h>14#include <__compare/ordering.h>
15#include <__config>15#include <__config>
16#include <__cstddef/size_t.h>
17#include <__functional/hash.h>
16#include <limits>18#include <limits>
1719
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -109,6 +111,15 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {...@@ -109,6 +111,15 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
109111
110} // namespace chrono112} // namespace chrono
111113
114# if _LIBCPP_STD_VER >= 26
115
116template <>
117struct hash<chrono::year> {
118 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year& __y) noexcept { return static_cast<int>(__y); }
119};
120
121# endif // _LIBCPP_STD_VER >= 26
122
112_LIBCPP_END_NAMESPACE_STD123_LIBCPP_END_NAMESPACE_STD
113124
114#endif // _LIBCPP_STD_VER >= 20125#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/year_month.h+13
...@@ -15,6 +15,8 @@...@@ -15,6 +15,8 @@
15#include <__chrono/year.h>15#include <__chrono/year.h>
16#include <__compare/ordering.h>16#include <__compare/ordering.h>
17#include <__config>17#include <__config>
18#include <__cstddef/size_t.h>
19#include <__functional/hash.h>
1820
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header22# pragma GCC system_header
...@@ -116,6 +118,17 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& year_month::operator-=(const...@@ -116,6 +118,17 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& year_month::operator-=(const
116118
117} // namespace chrono119} // namespace chrono
118120
121# if _LIBCPP_STD_VER >= 26
122
123template <>
124struct hash<chrono::year_month> {
125 _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()));
127 }
128};
129
130# endif // _LIBCPP_STD_VER >= 26
131
119_LIBCPP_END_NAMESPACE_STD132_LIBCPP_END_NAMESPACE_STD
120133
121#endif // _LIBCPP_STD_VER >= 20134#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/year_month_day.h+23
...@@ -21,6 +21,8 @@...@@ -21,6 +21,8 @@
21#include <__chrono/year_month.h>21#include <__chrono/year_month.h>
22#include <__compare/ordering.h>22#include <__compare/ordering.h>
23#include <__config>23#include <__config>
24#include <__cstddef/size_t.h>
25#include <__functional/hash.h>
24#include <limits>26#include <limits>
2527
26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -330,6 +332,27 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool year_month_day::ok() const noexcept...@@ -330,6 +332,27 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool year_month_day::ok() const noexcept
330332
331} // namespace chrono333} // namespace chrono
332334
335# if _LIBCPP_STD_VER >= 26
336
337template <>
338struct hash<chrono::year_month_day> {
339 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_day& __ymd) noexcept {
340 return std::__hash_combine(
341 hash<chrono::year>{}(__ymd.year()),
342 std::__hash_combine(hash<chrono::month>{}(__ymd.month()), hash<chrono::day>{}(__ymd.day())));
343 }
344};
345
346template <>
347struct hash<chrono::year_month_day_last> {
348 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_day_last& __ymdl) noexcept {
349 return std::__hash_combine(
350 hash<chrono::year>{}(__ymdl.year()), hash<chrono::month_day_last>{}(__ymdl.month_day_last()));
351 }
352};
353
354# endif // _LIBCPP_STD_VER >= 26
355
333_LIBCPP_END_NAMESPACE_STD356_LIBCPP_END_NAMESPACE_STD
334357
335#endif // _LIBCPP_STD_VER >= 20358#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/year_month_weekday.h+26
...@@ -22,6 +22,8 @@...@@ -22,6 +22,8 @@
22#include <__chrono/year_month.h>22#include <__chrono/year_month.h>
23#include <__chrono/year_month_day.h>23#include <__chrono/year_month_day.h>
24#include <__config>24#include <__config>
25#include <__cstddef/size_t.h>
26#include <__functional/hash.h>
2527
26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
27# pragma GCC system_header29# pragma GCC system_header
...@@ -280,6 +282,30 @@ year_month_weekday_last::operator-=(const years& __dy) noexcept {...@@ -280,6 +282,30 @@ year_month_weekday_last::operator-=(const years& __dy) noexcept {
280282
281} // namespace chrono283} // namespace chrono
282284
285# if _LIBCPP_STD_VER >= 26
286
287template <>
288struct hash<chrono::year_month_weekday> {
289 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_weekday& __ymw) noexcept {
290 return std::__hash_combine(
291 hash<chrono::year>{}(__ymw.year()),
292 std::__hash_combine(
293 hash<chrono::month>{}(__ymw.month()), hash<chrono::weekday_indexed>{}(__ymw.weekday_indexed())));
294 }
295};
296
297template <>
298struct hash<chrono::year_month_weekday_last> {
299 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_weekday_last& __ymwl) noexcept {
300 return std::__hash_combine(
301 hash<chrono::year>{}(__ymwl.year()),
302 std::__hash_combine(
303 hash<chrono::month>{}(__ymwl.month()), hash<chrono::weekday_last>{}(__ymwl.weekday_last())));
304 }
305};
306
307# endif // _LIBCPP_STD_VER >= 26
308
283_LIBCPP_END_NAMESPACE_STD309_LIBCPP_END_NAMESPACE_STD
284310
285#endif // _LIBCPP_STD_VER >= 20311#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__chrono/zoned_time.h+16
...@@ -24,6 +24,8 @@...@@ -24,6 +24,8 @@
24# include <__chrono/tzdb_list.h>24# include <__chrono/tzdb_list.h>
25# include <__concepts/constructible.h>25# include <__concepts/constructible.h>
26# include <__config>26# include <__config>
27# include <__cstddef/size_t.h>
28# include <__functional/hash.h>
27# include <__type_traits/common_type.h>29# include <__type_traits/common_type.h>
28# include <__type_traits/conditional.h>30# include <__type_traits/conditional.h>
29# include <__type_traits/remove_cvref.h>31# include <__type_traits/remove_cvref.h>
...@@ -216,6 +218,20 @@ operator==(const zoned_time<_Duration1, _TimeZonePtr>& __lhs, const zoned_time<_...@@ -216,6 +218,20 @@ operator==(const zoned_time<_Duration1, _TimeZonePtr>& __lhs, const zoned_time<_
216218
217} // namespace chrono219} // namespace chrono
218220
221# if _LIBCPP_STD_VER >= 26
222
223template <class _Duration, class _TimeZonePtr>
224 requires __has_enabled_hash<_Duration>::value && __has_enabled_hash<_TimeZonePtr>::value
225struct hash<chrono::zoned_time<_Duration, _TimeZonePtr>> {
226 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t
227 operator()(const chrono::zoned_time<_Duration, _TimeZonePtr>& __zt) {
228 return std::__hash_combine(
229 hash<chrono::sys_time<_Duration>>{}(__zt.get_sys_time()), hash<_TimeZonePtr>{}(__zt.get_time_zone()));
230 }
231};
232
233# endif // _LIBCPP_STD_VER >= 26
234
219# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&235# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
220 // _LIBCPP_HAS_LOCALIZATION236 // _LIBCPP_HAS_LOCALIZATION
221237
lib/libcxx/include/__compare/is_eq.h+6-6
...@@ -20,12 +20,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -20,12 +20,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2020
21#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2222
23_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }23[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }
24_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }24[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }
25_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; }25[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; }
26_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; }26[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; }
27_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }27[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }
28_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }28[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }
2929
30#endif // _LIBCPP_STD_VER >= 2030#endif // _LIBCPP_STD_VER >= 20
3131
lib/libcxx/include/__compare/strong_order.h+12-30
...@@ -13,7 +13,6 @@...@@ -13,7 +13,6 @@
13#include <__compare/compare_three_way.h>13#include <__compare/compare_three_way.h>
14#include <__compare/ordering.h>14#include <__compare/ordering.h>
15#include <__config>15#include <__config>
16#include <__math/exponential_functions.h>
17#include <__math/traits.h>16#include <__math/traits.h>
18#include <__type_traits/conditional.h>17#include <__type_traits/conditional.h>
19#include <__type_traits/decay.h>18#include <__type_traits/decay.h>
...@@ -53,38 +52,21 @@ struct __fn {...@@ -53,38 +52,21 @@ struct __fn {
53 template <class _Tp, class _Up, class _Dp = decay_t<_Tp>>52 template <class _Tp, class _Up, class _Dp = decay_t<_Tp>>
54 requires is_same_v<_Dp, decay_t<_Up>> && is_floating_point_v<_Dp>53 requires is_same_v<_Dp, decay_t<_Up>> && is_floating_point_v<_Dp>
55 _LIBCPP_HIDE_FROM_ABI static constexpr strong_ordering __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) noexcept {54 _LIBCPP_HIDE_FROM_ABI static constexpr strong_ordering __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) noexcept {
56 if constexpr (numeric_limits<_Dp>::is_iec559 && sizeof(_Dp) == sizeof(int32_t)) {55 if constexpr (numeric_limits<_Dp>::is_iec559 &&
57 int32_t __rx = std::bit_cast<int32_t>(__t);56 (sizeof(_Dp) == sizeof(int32_t) || sizeof(_Dp) == sizeof(int64_t))) {
58 int32_t __ry = std::bit_cast<int32_t>(__u);57 using _IntT = conditional_t<sizeof(_Dp) == sizeof(int32_t), int32_t, int64_t>;
59 __rx = (__rx < 0) ? (numeric_limits<int32_t>::min() - __rx - 1) : __rx;58 _IntT __rx = std::bit_cast<_IntT>(__t);
60 __ry = (__ry < 0) ? (numeric_limits<int32_t>::min() - __ry - 1) : __ry;59 _IntT __ry = std::bit_cast<_IntT>(__u);
61 return (__rx <=> __ry);60 __rx = (__rx < 0) ? (numeric_limits<_IntT>::min() - __rx - 1) : __rx;
62 } else if constexpr (numeric_limits<_Dp>::is_iec559 && sizeof(_Dp) == sizeof(int64_t)) {61 __ry = (__ry < 0) ? (numeric_limits<_IntT>::min() - __ry - 1) : __ry;
63 int64_t __rx = std::bit_cast<int64_t>(__t);
64 int64_t __ry = std::bit_cast<int64_t>(__u);
65 __rx = (__rx < 0) ? (numeric_limits<int64_t>::min() - __rx - 1) : __rx;
66 __ry = (__ry < 0) ? (numeric_limits<int64_t>::min() - __ry - 1) : __ry;
67 return (__rx <=> __ry);62 return (__rx <=> __ry);
68 } else if (__t < __u) {63 } else if (__t < __u) {
69 return strong_ordering::less;64 return strong_ordering::less;
70 } else if (__t > __u) {65 } else if (__t > __u) {
71 return strong_ordering::greater;66 return strong_ordering::greater;
72 } else if (__t == __u) {67 } else if (__t == __u) {
73 if constexpr (numeric_limits<_Dp>::radix == 2) {68 static_assert(numeric_limits<_Dp>::radix == 2, "floating point type with a radix other than 2?");
74 return __math::signbit(__u) <=> __math::signbit(__t);69 return __math::signbit(__u) <=> __math::signbit(__t);
75 } else {
76 // This is bullet 3 of the IEEE754 algorithm, relevant
77 // only for decimal floating-point;
78 // see https://stackoverflow.com/questions/69068075/
79 if (__t == 0 || __math::isinf(__t)) {
80 return __math::signbit(__u) <=> __math::signbit(__t);
81 } else {
82 int __texp, __uexp;
83 (void)__math::frexp(__t, &__texp);
84 (void)__math::frexp(__u, &__uexp);
85 return (__t < 0) ? (__texp <=> __uexp) : (__uexp <=> __texp);
86 }
87 }
88 } else {70 } else {
89 // They're unordered, so one of them must be a NAN.71 // They're unordered, so one of them must be a NAN.
90 // The order is -QNAN, -SNAN, numbers, +SNAN, +QNAN.72 // The order is -QNAN, -SNAN, numbers, +SNAN, +QNAN.
...@@ -93,9 +75,9 @@ struct __fn {...@@ -93,9 +75,9 @@ struct __fn {
93 bool __t_is_negative = __math::signbit(__t);75 bool __t_is_negative = __math::signbit(__t);
94 bool __u_is_negative = __math::signbit(__u);76 bool __u_is_negative = __math::signbit(__u);
95 using _IntType =77 using _IntType =
96 conditional_t< sizeof(__t) == sizeof(int32_t),78 conditional_t<sizeof(__t) == sizeof(int32_t),
97 int32_t,79 int32_t,
98 conditional_t< sizeof(__t) == sizeof(int64_t), int64_t, void> >;80 conditional_t<sizeof(__t) == sizeof(int64_t), int64_t, void>>;
99 if constexpr (is_same_v<_IntType, void>) {81 if constexpr (is_same_v<_IntType, void>) {
100 static_assert(sizeof(_Dp) == 0, "std::strong_order is unimplemented for this floating-point type");82 static_assert(sizeof(_Dp) == 0, "std::strong_order is unimplemented for this floating-point type");
101 } else if (__t_is_nan && __u_is_nan) {83 } else if (__t_is_nan && __u_is_nan) {
lib/libcxx/include/__compare/three_way_comparable.h+2-2
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#include <__compare/common_comparison_category.h>12#include <__compare/common_comparison_category.h>
13#include <__compare/ordering.h>13#include <__compare/ordering.h>
14#include <__concepts/common_reference_with.h>14#include <__concepts/common_reference_with.h>
15#include <__concepts/comparison_common_type.h>
15#include <__concepts/equality_comparable.h>16#include <__concepts/equality_comparable.h>
16#include <__concepts/same_as.h>17#include <__concepts/same_as.h>
17#include <__concepts/totally_ordered.h>18#include <__concepts/totally_ordered.h>
...@@ -39,8 +40,7 @@ concept three_way_comparable =...@@ -39,8 +40,7 @@ concept three_way_comparable =
3940
40template <class _Tp, class _Up, class _Cat = partial_ordering>41template <class _Tp, class _Up, class _Cat = partial_ordering>
41concept three_way_comparable_with =42concept three_way_comparable_with =
42 three_way_comparable<_Tp, _Cat> && three_way_comparable<_Up, _Cat> &&43 three_way_comparable<_Tp, _Cat> && three_way_comparable<_Up, _Cat> && __comparison_common_type_with<_Tp, _Up> &&
43 common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&
44 three_way_comparable<common_reference_t<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>>, _Cat> &&44 three_way_comparable<common_reference_t<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>>, _Cat> &&
45 __weakly_equality_comparable_with<_Tp, _Up> && __partially_ordered_with<_Tp, _Up> &&45 __weakly_equality_comparable_with<_Tp, _Up> && __partially_ordered_with<_Tp, _Up> &&
46 requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {46 requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
lib/libcxx/include/__concepts/comparison_common_type.h created+40
...@@ -0,0 +1,40 @@
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___CONCEPTS_COMPARISON_COMMON_TYPE_H
10#define _LIBCPP___CONCEPTS_COMPARISON_COMMON_TYPE_H
11
12#include <__concepts/convertible_to.h>
13#include <__concepts/same_as.h>
14#include <__config>
15#include <__type_traits/common_reference.h>
16#include <__type_traits/remove_cvref.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#if _LIBCPP_STD_VER >= 20
25
26template <class _Tp, class _Up, class _CommonRef = common_reference_t<const _Tp&, const _Up&>>
27concept __comparison_common_type_with_impl =
28 same_as<common_reference_t<const _Tp&, const _Up&>, common_reference_t<const _Up&, const _Tp&>> && requires {
29 requires convertible_to<const _Tp&, const _CommonRef&> || convertible_to<_Tp, const _CommonRef&>;
30 requires convertible_to<const _Up&, const _CommonRef&> || convertible_to<_Up, const _CommonRef&>;
31 };
32
33template <class _Tp, class _Up>
34concept __comparison_common_type_with = __comparison_common_type_with_impl<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
35
36#endif // _LIBCPP_STD_VER >= 20
37
38_LIBCPP_END_NAMESPACE_STD
39
40#endif // _LIBCPP___CONCEPTS_COMPARISON_COMMON_TYPE_H
lib/libcxx/include/__concepts/equality_comparable.h+2-1
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__concepts/boolean_testable.h>12#include <__concepts/boolean_testable.h>
13#include <__concepts/common_reference_with.h>13#include <__concepts/common_reference_with.h>
14#include <__concepts/comparison_common_type.h>
14#include <__config>15#include <__config>
15#include <__type_traits/common_reference.h>16#include <__type_traits/common_reference.h>
16#include <__type_traits/make_const_lvalue_ref.h>17#include <__type_traits/make_const_lvalue_ref.h>
...@@ -41,7 +42,7 @@ concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;...@@ -41,7 +42,7 @@ concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;
41template <class _Tp, class _Up>42template <class _Tp, class _Up>
42concept equality_comparable_with =43concept equality_comparable_with =
43 equality_comparable<_Tp> && equality_comparable<_Up> &&44 equality_comparable<_Tp> && equality_comparable<_Up> &&
44 common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&45 __comparison_common_type_with<_Tp, _Up> &&
45 equality_comparable<46 equality_comparable<
46 common_reference_t<47 common_reference_t<
47 __make_const_lvalue_ref<_Tp>,48 __make_const_lvalue_ref<_Tp>,
lib/libcxx/include/__condition_variable/condition_variable.h+1-1
...@@ -170,7 +170,7 @@ public:...@@ -170,7 +170,7 @@ public:
170 wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred);170 wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred);
171171
172 typedef __libcpp_condvar_t* native_handle_type;172 typedef __libcpp_condvar_t* native_handle_type;
173 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__cv_; }173 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__cv_; }
174174
175private:175private:
176 void176 void
lib/libcxx/include/__config+63-280
...@@ -14,6 +14,8 @@...@@ -14,6 +14,8 @@
14#include <__configuration/abi.h>14#include <__configuration/abi.h>
15#include <__configuration/availability.h>15#include <__configuration/availability.h>
16#include <__configuration/compiler.h>16#include <__configuration/compiler.h>
17#include <__configuration/experimental.h>
18#include <__configuration/hardening.h>
17#include <__configuration/language.h>19#include <__configuration/language.h>
18#include <__configuration/platform.h>20#include <__configuration/platform.h>
1921
...@@ -28,7 +30,7 @@...@@ -28,7 +30,7 @@
28// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.30// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
29// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is31// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is
30// defined to XXYYZZ.32// defined to XXYYZZ.
31# define _LIBCPP_VERSION 21010033# define _LIBCPP_VERSION 220104
3234
33# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y35# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
34# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)36# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
...@@ -38,195 +40,6 @@...@@ -38,195 +40,6 @@
38# define _LIBCPP_FREESTANDING40# define _LIBCPP_FREESTANDING
39# endif41# endif
4042
41// NOLINTNEXTLINE(libcpp-cpp-version-check)
42# if __cplusplus < 201103L
43# define _LIBCPP_CXX03_LANG
44# endif
45
46# if __has_feature(experimental_library)
47# ifndef _LIBCPP_ENABLE_EXPERIMENTAL
48# define _LIBCPP_ENABLE_EXPERIMENTAL
49# endif
50# endif
51
52// Incomplete features get their own specific disabling flags. This makes it
53// easier to grep for target specific flags once the feature is complete.
54# if defined(_LIBCPP_ENABLE_EXPERIMENTAL) || defined(_LIBCPP_BUILDING_LIBRARY)
55# define _LIBCPP_HAS_EXPERIMENTAL_LIBRARY 1
56# else
57# define _LIBCPP_HAS_EXPERIMENTAL_LIBRARY 0
58# endif
59
60# define _LIBCPP_HAS_EXPERIMENTAL_PSTL _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
61# define _LIBCPP_HAS_EXPERIMENTAL_TZDB _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
62# define _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
63# define _LIBCPP_HAS_EXPERIMENTAL_HARDENING_OBSERVE_SEMANTIC _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
64
65// HARDENING {
66
67// TODO(LLVM 23): Remove this. We're making these an error to catch folks who might not have migrated.
68// Since hardening went through several changes (many of which impacted user-facing macros),
69// we're keeping these checks around for a bit longer than usual. Failure to properly configure
70// hardening results in checks being dropped silently, which is a pretty big deal.
71# if defined(_LIBCPP_ENABLE_ASSERTIONS)
72# error "_LIBCPP_ENABLE_ASSERTIONS has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
73# endif
74# if defined(_LIBCPP_ENABLE_HARDENED_MODE)
75# error "_LIBCPP_ENABLE_HARDENED_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
76# endif
77# if defined(_LIBCPP_ENABLE_SAFE_MODE)
78# error "_LIBCPP_ENABLE_SAFE_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
79# endif
80# if defined(_LIBCPP_ENABLE_DEBUG_MODE)
81# error "_LIBCPP_ENABLE_DEBUG_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
82# endif
83
84// The library provides the macro `_LIBCPP_HARDENING_MODE` which can be set to one of the following values:
85//
86// - `_LIBCPP_HARDENING_MODE_NONE`;
87// - `_LIBCPP_HARDENING_MODE_FAST`;
88// - `_LIBCPP_HARDENING_MODE_EXTENSIVE`;
89// - `_LIBCPP_HARDENING_MODE_DEBUG`.
90//
91// These values have the following effects:
92//
93// - `_LIBCPP_HARDENING_MODE_NONE` -- sets the hardening mode to "none" which disables all runtime hardening checks;
94//
95// - `_LIBCPP_HARDENING_MODE_FAST` -- sets that hardening mode to "fast". The fast mode enables security-critical checks
96// that can be done with relatively little runtime overhead in constant time;
97//
98// - `_LIBCPP_HARDENING_MODE_EXTENSIVE` -- sets the hardening mode to "extensive". The extensive mode is a superset of
99// the fast mode that additionally enables checks that are relatively cheap and prevent common types of logic errors
100// but are not necessarily security-critical;
101//
102// - `_LIBCPP_HARDENING_MODE_DEBUG` -- sets the hardening mode to "debug". The debug mode is a superset of the extensive
103// mode and enables all checks available in the library, including internal assertions. Checks that are part of the
104// debug mode can be very expensive and thus the debug mode is intended to be used for testing, not in production.
105
106// Inside the library, assertions are categorized so they can be cherry-picked based on the chosen hardening mode. These
107// macros are only for internal use -- users should only pick one of the high-level hardening modes described above.
108//
109// - `_LIBCPP_ASSERT_VALID_INPUT_RANGE` -- checks that ranges (whether expressed as an iterator pair, an iterator and
110// a sentinel, an iterator and a count, or a `std::range`) given as input to library functions are valid:
111// - the sentinel is reachable from the begin iterator;
112// - TODO(hardening): both iterators refer to the same container.
113//
114// - `_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS` -- checks that any attempts to access a container element, whether through
115// the container object or through an iterator, are valid and do not attempt to go out of bounds or otherwise access
116// a non-existent element. For iterator checks to work, bounded iterators must be enabled in the ABI. Types like
117// `optional` and `function` are considered one-element containers for the purposes of this check.
118//
119// - `_LIBCPP_ASSERT_NON_NULL` -- checks that the pointer being dereferenced is not null. On most modern platforms zero
120// address does not refer to an actual location in memory, so a null pointer dereference would not compromize the
121// memory security of a program (however, it is still undefined behavior that can result in strange errors due to
122// compiler optimizations).
123//
124// - `_LIBCPP_ASSERT_NON_OVERLAPPING_RANGES` -- for functions that take several ranges as arguments, checks that the
125// given ranges do not overlap.
126//
127// - `_LIBCPP_ASSERT_VALID_DEALLOCATION` -- checks that an attempt to deallocate memory is valid (e.g. the given object
128// was allocated by the given allocator). Violating this category typically results in a memory leak.
129//
130// - `_LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL` -- checks that a call to an external API doesn't fail in
131// an unexpected manner. This includes triggering documented cases of undefined behavior in an external library (like
132// attempting to unlock an unlocked mutex in pthreads). Any API external to the library falls under this category
133// (from system calls to compiler intrinsics). We generally don't expect these failures to compromize memory safety or
134// otherwise create an immediate security issue.
135//
136// - `_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR` -- checks any operations that exchange nodes between containers to make sure
137// the containers have compatible allocators.
138//
139// - `_LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN` -- checks that the given argument is within the domain of valid arguments
140// for the function. Violating this typically produces an incorrect result (e.g. the clamp algorithm returns the
141// original value without clamping it due to incorrect functors) or puts an object into an invalid state (e.g.
142// a string view where only a subset of elements is possible to access). This category is for assertions violating
143// which doesn't cause any immediate issues in the library -- whatever the consequences are, they will happen in the
144// user code.
145//
146// - `_LIBCPP_ASSERT_PEDANTIC` -- checks prerequisites which are imposed by the Standard, but violating which happens to
147// be benign in our implementation.
148//
149// - `_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT` -- checks that the given argument satisfies the semantic requirements imposed
150// by the Standard. Typically, there is no simple way to completely prove that a semantic requirement is satisfied;
151// thus, this would often be a heuristic check and it might be quite expensive.
152//
153// - `_LIBCPP_ASSERT_INTERNAL` -- checks that internal invariants of the library hold. These assertions don't depend on
154// user input.
155//
156// - `_LIBCPP_ASSERT_UNCATEGORIZED` -- for assertions that haven't been properly classified yet.
157
158// clang-format off
159# define _LIBCPP_HARDENING_MODE_NONE (1 << 1)
160# define _LIBCPP_HARDENING_MODE_FAST (1 << 2)
161# define _LIBCPP_HARDENING_MODE_EXTENSIVE (1 << 4) // Deliberately not ordered.
162# define _LIBCPP_HARDENING_MODE_DEBUG (1 << 3)
163// clang-format on
164
165# ifndef _LIBCPP_HARDENING_MODE
166
167# ifndef _LIBCPP_HARDENING_MODE_DEFAULT
168# error _LIBCPP_HARDENING_MODE_DEFAULT is not defined. This definition should be set at configuration time in the \
169`__config_site` header, please make sure your installation of libc++ is not broken.
170# endif
171
172# define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_DEFAULT
173# endif
174
175# if _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_NONE && \
176 _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_FAST && \
177 _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_EXTENSIVE && \
178 _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_DEBUG
179# error _LIBCPP_HARDENING_MODE must be set to one of the following values: \
180_LIBCPP_HARDENING_MODE_NONE, \
181_LIBCPP_HARDENING_MODE_FAST, \
182_LIBCPP_HARDENING_MODE_EXTENSIVE, \
183_LIBCPP_HARDENING_MODE_DEBUG
184# endif
185
186// Hardening assertion semantics generally mirror the evaluation semantics of C++26 Contracts:
187// - `ignore` evaluates the assertion but doesn't do anything if it fails (note that it differs from the Contracts
188// `ignore` semantic which wouldn't evaluate the assertion at all);
189// - `observe` logs an error (indicating, if possible, that the error is fatal) and continues execution;
190// - `quick-enforce` terminates the program as fast as possible (via trapping);
191// - `enforce` logs an error and then terminates the program.
192//
193// Notes:
194// - Continuing execution after a hardening check fails results in undefined behavior; the `observe` semantic is meant
195// to make adopting hardening easier but should not be used outside of this scenario;
196// - C++26 wording for Library Hardening precludes a conforming Hardened implementation from using the Contracts
197// `ignore` semantic when evaluating hardened preconditions in the Library. Libc++ allows using this semantic for
198// hardened preconditions, however, be aware that using `ignore` does not produce a conforming "Hardened"
199// implementation, unlike the other semantics above.
200// clang-format off
201# define _LIBCPP_ASSERTION_SEMANTIC_IGNORE (1 << 1)
202# define _LIBCPP_ASSERTION_SEMANTIC_OBSERVE (1 << 2)
203# define _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE (1 << 3)
204# define _LIBCPP_ASSERTION_SEMANTIC_ENFORCE (1 << 4)
205// clang-format on
206
207// Allow users to define an arbitrary assertion semantic; otherwise, use the default mapping from modes to semantics.
208// The default is for production-capable modes to use `quick-enforce` (i.e., trap) and for the `debug` mode to use
209// `enforce` (i.e., log and abort).
210# ifndef _LIBCPP_ASSERTION_SEMANTIC
211
212# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
213# define _LIBCPP_ASSERTION_SEMANTIC _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
214# else
215# define _LIBCPP_ASSERTION_SEMANTIC _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE
216# endif
217
218# else
219# if !_LIBCPP_HAS_EXPERIMENTAL_LIBRARY
220# error "Assertion semantics are an experimental feature."
221# endif
222# if defined(_LIBCPP_CXX03_LANG)
223# error "Assertion semantics are not available in the C++03 mode."
224# endif
225
226# endif // _LIBCPP_ASSERTION_SEMANTIC
227
228// } HARDENING
229
230# define _LIBCPP_TOSTRING2(x) #x43# define _LIBCPP_TOSTRING2(x) #x
231# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)44# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
23245
...@@ -320,13 +133,6 @@ _LIBCPP_HARDENING_MODE_DEBUG...@@ -320,13 +133,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
320// When this option is used, the token passed to `std::random_device`'s133// When this option is used, the token passed to `std::random_device`'s
321// constructor *must* be "/dev/urandom" -- anything else is an error.134// constructor *must* be "/dev/urandom" -- anything else is an error.
322//135//
323// _LIBCPP_USING_NACL_RANDOM
324// NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
325// including accesses to the special files under `/dev`. This implementation
326// uses the NaCL syscall `nacl_secure_random_init()` to get entropy.
327// When this option is used, the token passed to `std::random_device`'s
328// constructor *must* be "/dev/urandom" -- anything else is an error.
329//
330// _LIBCPP_USING_WIN32_RANDOM136// _LIBCPP_USING_WIN32_RANDOM
331// Use rand_s(), for use on Windows.137// Use rand_s(), for use on Windows.
332// When this option is used, the token passed to `std::random_device`'s138// When this option is used, the token passed to `std::random_device`'s
...@@ -338,8 +144,6 @@ _LIBCPP_HARDENING_MODE_DEBUG...@@ -338,8 +144,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
338# define _LIBCPP_USING_GETENTROPY144# define _LIBCPP_USING_GETENTROPY
339# elif defined(__Fuchsia__)145# elif defined(__Fuchsia__)
340# define _LIBCPP_USING_FUCHSIA_CPRNG146# define _LIBCPP_USING_FUCHSIA_CPRNG
341# elif defined(__native_client__)
342# define _LIBCPP_USING_NACL_RANDOM
343# elif defined(_LIBCPP_WIN32API)147# elif defined(_LIBCPP_WIN32API)
344# define _LIBCPP_USING_WIN32_RANDOM148# define _LIBCPP_USING_WIN32_RANDOM
345# else149# else
...@@ -348,7 +152,7 @@ _LIBCPP_HARDENING_MODE_DEBUG...@@ -348,7 +152,7 @@ _LIBCPP_HARDENING_MODE_DEBUG
348152
349# ifndef _LIBCPP_CXX03_LANG153# ifndef _LIBCPP_CXX03_LANG
350154
351# define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)155# define _LIBCPP_ALIGNOF(...) alignof(__VA_ARGS__)
352# define _ALIGNAS_TYPE(x) alignas(x)156# define _ALIGNAS_TYPE(x) alignas(x)
353# define _ALIGNAS(x) alignas(x)157# define _ALIGNAS(x) alignas(x)
354# define _NOEXCEPT noexcept158# define _NOEXCEPT noexcept
...@@ -357,7 +161,7 @@ _LIBCPP_HARDENING_MODE_DEBUG...@@ -357,7 +161,7 @@ _LIBCPP_HARDENING_MODE_DEBUG
357161
358# else162# else
359163
360# define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)164# define _LIBCPP_ALIGNOF(...) _Alignof(__VA_ARGS__)
361# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))165# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))
362# define _ALIGNAS(x) __attribute__((__aligned__(x)))166# define _ALIGNAS(x) __attribute__((__aligned__(x)))
363# define nullptr __nullptr167# define nullptr __nullptr
...@@ -471,6 +275,12 @@ typedef __char32_t char32_t;...@@ -471,6 +275,12 @@ typedef __char32_t char32_t;
471# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)275# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
472# endif276# endif
473277
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
474# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_FAST284# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_FAST
475# define _LIBCPP_HARDENING_SIG f285# define _LIBCPP_HARDENING_SIG f
476# elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE286# elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE
...@@ -481,6 +291,16 @@ typedef __char32_t char32_t;...@@ -481,6 +291,16 @@ typedef __char32_t char32_t;
481# define _LIBCPP_HARDENING_SIG n // "none"291# define _LIBCPP_HARDENING_SIG n // "none"
482# endif292# endif
483293
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
484# if !_LIBCPP_HAS_EXCEPTIONS304# if !_LIBCPP_HAS_EXCEPTIONS
485# define _LIBCPP_EXCEPTIONS_SIG n305# define _LIBCPP_EXCEPTIONS_SIG n
486# else306# else
...@@ -488,7 +308,9 @@ typedef __char32_t char32_t;...@@ -488,7 +308,9 @@ typedef __char32_t char32_t;
488# endif308# endif
489309
490# define _LIBCPP_ODR_SIGNATURE \310# define _LIBCPP_ODR_SIGNATURE \
491 _LIBCPP_CONCAT(_LIBCPP_CONCAT(_LIBCPP_HARDENING_SIG, _LIBCPP_EXCEPTIONS_SIG), _LIBCPP_VERSION)311 _LIBCPP_CONCAT( \
312 _LIBCPP_CONCAT(_LIBCPP_CONCAT(_LIBCPP_HARDENING_SIG, _LIBCPP_ASSERTION_SEMANTIC_SIG), _LIBCPP_EXCEPTIONS_SIG), \
313 _LIBCPP_VERSION)
492314
493// This macro marks a symbol as being hidden from libc++'s ABI. This is achieved315// This macro marks a symbol as being hidden from libc++'s ABI. This is achieved
494// on two levels:316// on two levels:
...@@ -550,16 +372,6 @@ typedef __char32_t char32_t;...@@ -550,16 +372,6 @@ typedef __char32_t char32_t;
550# endif372# endif
551# define _LIBCPP_HIDE_FROM_ABI_VIRTUAL _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION373# define _LIBCPP_HIDE_FROM_ABI_VIRTUAL _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
552374
553# ifdef _LIBCPP_BUILDING_LIBRARY
554# if _LIBCPP_ABI_VERSION > 1
555# define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
556# else
557# define _LIBCPP_HIDE_FROM_ABI_AFTER_V1
558# endif
559# else
560# define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
561# endif
562
563// Clang modules take a significant compile time hit when pushing and popping diagnostics.375// Clang modules take a significant compile time hit when pushing and popping diagnostics.
564// Since all the headers are marked as system headers unless _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER is defined, we can376// Since all the headers are marked as system headers unless _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER is defined, we can
565// simply disable this pushing and popping when _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER isn't defined.377// simply disable this pushing and popping when _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER isn't defined.
...@@ -676,27 +488,6 @@ typedef __char32_t char32_t;...@@ -676,27 +488,6 @@ typedef __char32_t char32_t;
676# endif488# endif
677# endif489# endif
678490
679// It is not yet possible to use aligned_alloc() on all Apple platforms since
680// 10.15 was the first version to ship an implementation of aligned_alloc().
681# if defined(__APPLE__)
682# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
683 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
684 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
685 __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
686 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
687 __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) || \
688 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000)
689# define _LIBCPP_HAS_C11_ALIGNED_ALLOC 0
690# else
691# define _LIBCPP_HAS_C11_ALIGNED_ALLOC 1
692# endif
693# elif defined(__ANDROID__) && __ANDROID_API__ < 28
694// Android only provides aligned_alloc when targeting API 28 or higher.
695# define _LIBCPP_HAS_C11_ALIGNED_ALLOC 0
696# else
697# define _LIBCPP_HAS_C11_ALIGNED_ALLOC 1
698# endif
699
700# if defined(__APPLE__) || defined(__FreeBSD__)491# if defined(__APPLE__) || defined(__FreeBSD__)
701# define _LIBCPP_WCTYPE_IS_MASK492# define _LIBCPP_WCTYPE_IS_MASK
702# endif493# endif
...@@ -727,6 +518,15 @@ typedef __char32_t char32_t;...@@ -727,6 +518,15 @@ typedef __char32_t char32_t;
727# define _LIBCPP_DEPRECATED_(m)518# define _LIBCPP_DEPRECATED_(m)
728# endif519# endif
729520
521// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
522// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
523// allows suppression in system headers.
524# if defined(__DEPRECATED) && __DEPRECATED && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && 0
525# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 1
526# else
527# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0
528# endif
529
730# if !defined(_LIBCPP_CXX03_LANG)530# if !defined(_LIBCPP_CXX03_LANG)
731# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED531# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
732# else532# else
...@@ -771,17 +571,6 @@ typedef __char32_t char32_t;...@@ -771,17 +571,6 @@ typedef __char32_t char32_t;
771# define _LIBCPP_DEPRECATED_WITH_CHAR8_T571# define _LIBCPP_DEPRECATED_WITH_CHAR8_T
772# endif572# endif
773573
774// Macros to enter and leave a state where deprecation warnings are suppressed.
775# if defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_COMPILER_GCC)
776# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
777 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") \
778 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
779# define _LIBCPP_SUPPRESS_DEPRECATED_POP _Pragma("GCC diagnostic pop")
780# else
781# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH
782# define _LIBCPP_SUPPRESS_DEPRECATED_POP
783# endif
784
785# if _LIBCPP_STD_VER <= 11574# if _LIBCPP_STD_VER <= 11
786# define _LIBCPP_EXPLICIT_SINCE_CXX14575# define _LIBCPP_EXPLICIT_SINCE_CXX14
787# else576# else
...@@ -861,18 +650,10 @@ typedef __char32_t char32_t;...@@ -861,18 +650,10 @@ typedef __char32_t char32_t;
861# endif // _LIBCPP_HAS_THREAD_API650# endif // _LIBCPP_HAS_THREAD_API
862# endif // _LIBCPP_HAS_THREADS651# endif // _LIBCPP_HAS_THREADS
863652
864# if _LIBCPP_HAS_THREAD_API_PTHREAD653# if !_LIBCPP_HAS_THREAD_API_PTHREAD
865# if defined(__ANDROID__) && __ANDROID_API__ >= 30654# define _LIBCPP_HAS_COND_CLOCKWAIT 0
866# define _LIBCPP_HAS_COND_CLOCKWAIT 1655# elif (defined(__ANDROID__) && __ANDROID_API__ >= 30) || _LIBCPP_GLIBC_PREREQ(2, 30)
867# elif defined(_LIBCPP_GLIBC_PREREQ)656# define _LIBCPP_HAS_COND_CLOCKWAIT 1
868# if _LIBCPP_GLIBC_PREREQ(2, 30)
869# define _LIBCPP_HAS_COND_CLOCKWAIT 1
870# else
871# define _LIBCPP_HAS_COND_CLOCKWAIT 0
872# endif
873# else
874# define _LIBCPP_HAS_COND_CLOCKWAIT 0
875# endif
876# else657# else
877# define _LIBCPP_HAS_COND_CLOCKWAIT 0658# define _LIBCPP_HAS_COND_CLOCKWAIT 0
878# endif659# endif
...@@ -951,8 +732,8 @@ typedef __char32_t char32_t;...@@ -951,8 +732,8 @@ typedef __char32_t char32_t;
951# endif732# endif
952# endif733# endif
953734
954# if defined(__FreeBSD__) && defined(__clang__) && __has_attribute(__no_thread_safety_analysis__)735# if __has_cpp_attribute(_Clang::__no_thread_safety_analysis__)
955# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS __attribute__((__no_thread_safety_analysis__))736# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS [[_Clang::__no_thread_safety_analysis__]]
956# else737# else
957# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS738# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
958# endif739# endif
...@@ -1038,12 +819,8 @@ typedef __char32_t char32_t;...@@ -1038,12 +819,8 @@ typedef __char32_t char32_t;
1038// the latter depends on internal GNU libc details that are not appropriate819// the latter depends on internal GNU libc details that are not appropriate
1039// to depend on here, so any declarations present when __cpp_char8_t is not820// to depend on here, so any declarations present when __cpp_char8_t is not
1040// defined are ignored.821// defined are ignored.
1041# if defined(_LIBCPP_GLIBC_PREREQ)822# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
1042# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)823# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
1043# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
1044# else
1045# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
1046# endif
1047# else824# else
1048# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0825# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
1049# endif826# endif
...@@ -1067,8 +844,7 @@ typedef __char32_t char32_t;...@@ -1067,8 +844,7 @@ typedef __char32_t char32_t;
1067# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")844# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
1068# endif845# endif
1069846
1070// TODO(LLVM 22): Remove the workaround847# if defined(__OBJC__) && defined(_LIBCPP_APPLE_CLANG_VER)
1071# if defined(__OBJC__) && (!defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER < 2001)
1072# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS848# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
1073# endif849# endif
1074850
...@@ -1153,12 +929,33 @@ typedef __char32_t char32_t;...@@ -1153,12 +929,33 @@ typedef __char32_t char32_t;
1153# define _LIBCPP_DIAGNOSE_WARNING(...)929# define _LIBCPP_DIAGNOSE_WARNING(...)
1154# endif930# endif
1155931
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
1156# if __has_cpp_attribute(_Clang::__lifetimebound__)946# if __has_cpp_attribute(_Clang::__lifetimebound__)
1157# define _LIBCPP_LIFETIMEBOUND [[_Clang::__lifetimebound__]]947# define _LIBCPP_LIFETIMEBOUND [[_Clang::__lifetimebound__]]
1158# else948# else
1159# define _LIBCPP_LIFETIMEBOUND949# define _LIBCPP_LIFETIMEBOUND
1160# endif950# endif
1161951
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
1162# if __has_cpp_attribute(_Clang::__noescape__)959# if __has_cpp_attribute(_Clang::__noescape__)
1163# define _LIBCPP_NOESCAPE [[_Clang::__noescape__]]960# define _LIBCPP_NOESCAPE [[_Clang::__noescape__]]
1164# else961# else
...@@ -1172,12 +969,6 @@ typedef __char32_t char32_t;...@@ -1172,12 +969,6 @@ typedef __char32_t char32_t;
1172# define _LIBCPP_NO_SPECIALIZATIONS969# define _LIBCPP_NO_SPECIALIZATIONS
1173# endif970# endif
1174971
1175# if __has_cpp_attribute(_Clang::__standalone_debug__)
1176# define _LIBCPP_STANDALONE_DEBUG [[_Clang::__standalone_debug__]]
1177# else
1178# define _LIBCPP_STANDALONE_DEBUG
1179# endif
1180
1181# if __has_cpp_attribute(_Clang::__preferred_name__)972# if __has_cpp_attribute(_Clang::__preferred_name__)
1182# define _LIBCPP_PREFERRED_NAME(x) [[_Clang::__preferred_name__(x)]]973# define _LIBCPP_PREFERRED_NAME(x) [[_Clang::__preferred_name__(x)]]
1183# else974# else
...@@ -1257,14 +1048,6 @@ typedef __char32_t char32_t;...@@ -1257,14 +1048,6 @@ typedef __char32_t char32_t;
1257# define _LIBCPP_DIAGNOSE_NULLPTR1048# define _LIBCPP_DIAGNOSE_NULLPTR
1258# endif1049# endif
12591050
1260// TODO(LLVM 22): Remove this macro once LLVM19 support ends. __cpp_explicit_this_parameter has been set in LLVM20.
1261// Clang-18 has support for deducing this, but it does not set the FTM.
1262# if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1800)
1263# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 1
1264# else
1265# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 0
1266# endif
1267
1268#endif // __cplusplus1051#endif // __cplusplus
12691052
1270#endif // _LIBCPP___CONFIG1053#endif // _LIBCPP___CONFIG
lib/libcxx/include/__configuration/abi.h+14-24
...@@ -61,19 +61,9 @@...@@ -61,19 +61,9 @@
61// According to the Standard, `bitset::operator[] const` returns bool61// According to the Standard, `bitset::operator[] const` returns bool
62# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL62# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
6363
64// In LLVM 20, we've changed to take these ABI breaks unconditionally. These flags only exist in case someone is running
65// into the static_asserts we added to catch the ABI break and don't care that it is one.
66// TODO(LLVM 22): Remove these flags
67# define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
68# define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
69# define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
70# define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
71
72// These flags are documented in ABIGuarantees.rst64// These flags are documented in ABIGuarantees.rst
73# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT65# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
74# define _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON66# define _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
75# define _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
76# define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
77# define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI67# define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI
78# define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI68# define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
79# define _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION69# define _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION
...@@ -84,25 +74,16 @@...@@ -84,25 +74,16 @@
84# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE74# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
85# define _LIBCPP_ABI_NO_ITERATOR_BASES75# define _LIBCPP_ABI_NO_ITERATOR_BASES
86# define _LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT76# define _LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT
77# define _LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER
87# define _LIBCPP_ABI_OPTIMIZED_FUNCTION78# define _LIBCPP_ABI_OPTIMIZED_FUNCTION
88# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO79# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
89# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION80# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
90# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY81# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY
91# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW82# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
92# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION83# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
84# define _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR
9385
94#elif _LIBCPP_ABI_VERSION == 186#elif _LIBCPP_ABI_VERSION == 1
95# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF))
96// Enable compiling copies of now inline methods into the dylib to support
97// applications compiled against older libraries. This is unnecessary with
98// COFF dllexport semantics, since dllexport forces a non-inline definition
99// of inline functions to be emitted anyway. Our own non-inline copy would
100// conflict with the dllexport-emitted copy, so we disable it. For XCOFF,
101// the linker will take issue with the symbols in the shared object if the
102// weak inline methods get visibility (such as from -fvisibility-inlines-hidden),
103// so disable it.
104# define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
105# endif
106// Feature macros for disabling pre ABI v1 features. All of these options87// Feature macros for disabling pre ABI v1 features. All of these options
107// are deprecated.88// are deprecated.
108# if defined(__FreeBSD__)89# if defined(__FreeBSD__)
...@@ -110,11 +91,20 @@...@@ -110,11 +91,20 @@
110# endif91# endif
111#endif92#endif
11293
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
113// We had some bugs where we use [[no_unique_address]] together with construct_at,103// We had some bugs where we use [[no_unique_address]] together with construct_at,
114// which causes UB as the call on construct_at could write to overlapping subobjects104// which causes UB as the call on construct_at could write to overlapping subobjects
115//105//
116// https://github.com/llvm/llvm-project/issues/70506106// https://llvm.org/PR70506
117// https://github.com/llvm/llvm-project/issues/70494107// https://llvm.org/PR70494
118//108//
119// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions.109// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions.
120// The macro below is used for all classes whose ABI have changed as part of fixing these bugs.110// The macro below is used for all classes whose ABI have changed as part of fixing these bugs.
lib/libcxx/include/__configuration/availability.h+65-118
...@@ -17,62 +17,17 @@...@@ -17,62 +17,17 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20// Libc++ is shipped by various vendors. In particular, it is used as a system20// This file defines a framework that can be used by vendors to encode the version of an operating system that various
21// library on macOS, iOS and other Apple platforms. In order for users to be21// features of libc++ has been shipped in. This is primarily intended to allow safely deploying an executable built with
22// able to compile a binary that is intended to be deployed to an older version22// a new version of the library on a platform containing an older version of the built library.
23// of a platform, Clang provides availability attributes [1]. These attributes23// Detailed documentation for this can be found at https://libcxx.llvm.org/VendorDocumentation.html#availability-markup
24// can be placed on declarations and are used to describe the life cycle of a
25// symbol in the library.
26//
27// The main goal is to ensure a compile-time error if a symbol that hasn't been
28// introduced in a previously released library is used in a program that targets
29// that previously released library. Normally, this would be a load-time error
30// when one tries to launch the program against the older library.
31//
32// For example, the filesystem library was introduced in the dylib in LLVM 9.
33// On Apple platforms, this corresponds to macOS 10.15. If a user compiles on
34// a macOS 10.15 host but targets macOS 10.13 with their program, the compiler
35// would normally not complain (because the required declarations are in the
36// headers), but the dynamic loader would fail to find the symbols when actually
37// trying to launch the program on macOS 10.13. To turn this into a compile-time
38// issue instead, declarations are annotated with when they were introduced, and
39// the compiler can produce a diagnostic if the program references something that
40// isn't available on the deployment target.
41//
42// This mechanism is general in nature, and any vendor can add their markup to
43// the library (see below). Whenever a new feature is added that requires support
44// in the shared library, two macros are added below to allow marking the feature
45// as unavailable:
46// 1. A macro named `_LIBCPP_AVAILABILITY_HAS_<feature>` which must be defined
47// to `_LIBCPP_INTRODUCED_IN_<version>` for the appropriate LLVM version.
48// 2. A macro named `_LIBCPP_AVAILABILITY_<feature>`, which must be defined to
49// `_LIBCPP_INTRODUCED_IN_<version>_MARKUP` for the appropriate LLVM version.
50//
51// When vendors decide to ship the feature as part of their shared library, they
52// can update the `_LIBCPP_INTRODUCED_IN_<version>` macro (and the markup counterpart)
53// based on the platform version they shipped that version of LLVM in. The library
54// will then use this markup to provide an optimal user experience on these platforms.
55//
56// Furthermore, many features in the standard library have corresponding
57// feature-test macros. The `_LIBCPP_AVAILABILITY_HAS_<feature>` macros
58// are checked by the corresponding feature-test macros generated by
59// generate_feature_test_macro_components.py to ensure that the library
60// doesn't announce a feature as being implemented if it is unavailable on
61// the deployment target.
62//
63// Note that this mechanism is disabled by default in the "upstream" libc++.
64// Availability annotations are only meaningful when shipping libc++ inside
65// a platform (i.e. as a system library), and so vendors that want them should
66// turn those annotations on at CMake configuration time.
67//
68// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability
6924
70// Availability markup is disabled when building the library, or when a non-Clang25// Availability markup is disabled when building the library, or when a non-Clang
71// compiler is used because only Clang supports the necessary attributes.26// compiler is used because only Clang supports the necessary attributes.
72//27//
73// We also allow users to force-disable availability markup via the `_LIBCPP_DISABLE_AVAILABILITY`28// We also allow users to force-disable availability markup via the `_LIBCPP_DISABLE_AVAILABILITY`
74// macro because that is the only way to work around a Clang bug related to availability29// macro because that is the only way to work around a Clang bug related to availability
75// attributes: https://github.com/llvm/llvm-project/issues/134151.30// attributes: https://llvm.org/PR134151.
76// Once that bug has been fixed, we should remove the macro.31// Once that bug has been fixed, we should remove the macro.
77#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || \32#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || \
78 !defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_DISABLE_AVAILABILITY)33 !defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_DISABLE_AVAILABILITY)
...@@ -84,6 +39,9 @@...@@ -84,6 +39,9 @@
84// in all versions of the library are available.39// in all versions of the library are available.
85#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS40#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
8641
42# define _LIBCPP_INTRODUCED_IN_LLVM_22 1
43# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE /* nothing */
44
87# define _LIBCPP_INTRODUCED_IN_LLVM_21 145# define _LIBCPP_INTRODUCED_IN_LLVM_21 1
88# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE /* nothing */46# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE /* nothing */
8947
...@@ -108,32 +66,55 @@...@@ -108,32 +66,55 @@
108# define _LIBCPP_INTRODUCED_IN_LLVM_12 166# define _LIBCPP_INTRODUCED_IN_LLVM_12 1
109# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE /* nothing */67# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE /* nothing */
11068
111# define _LIBCPP_INTRODUCED_IN_LLVM_11 1
112# define _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE /* nothing */
113
114# define _LIBCPP_INTRODUCED_IN_LLVM_9 1
115# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE /* nothing */
116# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH /* nothing */
117# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP /* nothing */
118
119#elif defined(__APPLE__)69#elif defined(__APPLE__)
12070
121// clang-format off71// clang-format off
12272
73// LLVM 22
74// TODO: Fill this in
75# define _LIBCPP_INTRODUCED_IN_LLVM_22 0
76# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE __attribute__((unavailable))
77
123// LLVM 2178// LLVM 21
124// TODO: Fill this in79// TODO: Fill this in
125# define _LIBCPP_INTRODUCED_IN_LLVM_21 080# define _LIBCPP_INTRODUCED_IN_LLVM_21 0
126# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE __attribute__((unavailable))81# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE __attribute__((unavailable))
12782
128// LLVM 2083// LLVM 20
129// TODO: Fill this in84//
130# define _LIBCPP_INTRODUCED_IN_LLVM_20 085// Note that versions for most Apple OSes were bumped forward and aligned in that release.
131# define _LIBCPP_INTRODUCED_IN_LLVM_20_ATTRIBUTE __attribute__((unavailable))86# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 260000) || \
87 (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) || \
89 (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)
91# define _LIBCPP_INTRODUCED_IN_LLVM_20 0
92# else
93# define _LIBCPP_INTRODUCED_IN_LLVM_20 1
94# endif
95# define _LIBCPP_INTRODUCED_IN_LLVM_20_ATTRIBUTE \
96 __attribute__((availability(macos, strict, introduced = 26.0))) \
97 __attribute__((availability(ios, strict, introduced = 26.0))) \
98 __attribute__((availability(tvos, strict, introduced = 26.0))) \
99 __attribute__((availability(watchos, strict, introduced = 26.0))) \
100 __attribute__((availability(bridgeos, strict, introduced = 10.0)))
132101
133// LLVM 19102// LLVM 19
134// TODO: Fill this in103# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150400) || \
135# define _LIBCPP_INTRODUCED_IN_LLVM_19 0104 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 180400) || \
136# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE __attribute__((unavailable))105 (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) || \
107 (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 90400)
108# define _LIBCPP_INTRODUCED_IN_LLVM_19 0
109# else
110# define _LIBCPP_INTRODUCED_IN_LLVM_19 1
111# endif
112# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE \
113 __attribute__((availability(macos, strict, introduced = 15.4))) \
114 __attribute__((availability(ios, strict, introduced = 18.4))) \
115 __attribute__((availability(tvos, strict, introduced = 18.4))) \
116 __attribute__((availability(watchos, strict, introduced = 11.4))) \
117 __attribute__((availability(bridgeos, strict, introduced = 9.4)))
137118
138// LLVM 18119// LLVM 18
139# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) || \120# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) || \
...@@ -215,47 +196,13 @@...@@ -215,47 +196,13 @@
215 __attribute__((availability(bridgeos, strict, introduced = 6.0))) \196 __attribute__((availability(bridgeos, strict, introduced = 6.0))) \
216 __attribute__((availability(driverkit, strict, introduced = 21.3)))197 __attribute__((availability(driverkit, strict, introduced = 21.3)))
217198
218// LLVM 11199# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \
219# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \200 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 150000) || \
220 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \201 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 150000) || \
221 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \202 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 80000) || \
222 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)203 (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 200000)
223# define _LIBCPP_INTRODUCED_IN_LLVM_11 0204# warning "The selected platform is no longer supported by libc++."
224# else
225# define _LIBCPP_INTRODUCED_IN_LLVM_11 1
226# endif205# endif
227# define _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE \
228 __attribute__((availability(macos, strict, introduced = 11.0))) \
229 __attribute__((availability(ios, strict, introduced = 14.0))) \
230 __attribute__((availability(tvos, strict, introduced = 14.0))) \
231 __attribute__((availability(watchos, strict, introduced = 7.0)))
232
233// LLVM 9
234# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
235 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
236 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
237 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
238# define _LIBCPP_INTRODUCED_IN_LLVM_9 0
239# else
240# define _LIBCPP_INTRODUCED_IN_LLVM_9 1
241# endif
242# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE \
243 __attribute__((availability(macos, strict, introduced = 10.15))) \
244 __attribute__((availability(ios, strict, introduced = 13.0))) \
245 __attribute__((availability(tvos, strict, introduced = 13.0))) \
246 __attribute__((availability(watchos, strict, introduced = 6.0)))
247# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH \
248 _Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \
249 _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
250 _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
251 _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
252# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP \
253 _Pragma("clang attribute pop") \
254 _Pragma("clang attribute pop") \
255 _Pragma("clang attribute pop") \
256 _Pragma("clang attribute pop")
257
258// clang-format on
259206
260#else207#else
261208
...@@ -266,19 +213,12 @@...@@ -266,19 +213,12 @@
266213
267#endif214#endif
268215
269// These macros control the availability of all parts of <filesystem> that216// This controls the availability of new implementation of std::atomic's
270// depend on something in the dylib.217// wait, notify_one and notify_all. The new implementation uses
271#define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9218// the native atomic wait/notify operations on platforms that support them
272#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE219// based on the size of the atomic type, instead of the type itself.
273#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH220#define _LIBCPP_AVAILABILITY_HAS_NEW_SYNC _LIBCPP_INTRODUCED_IN_LLVM_22
274#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP221#define _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE
275
276// This controls the availability of the C++20 synchronization library,
277// which requires shared library support for various operations
278// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,
279// <semaphore>, and notification functions on std::atomic.
280#define _LIBCPP_AVAILABILITY_HAS_SYNC _LIBCPP_INTRODUCED_IN_LLVM_11
281#define _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE
282222
283// Enable additional explicit instantiations of iostreams components. This223// Enable additional explicit instantiations of iostreams components. This
284// reduces the number of weak definitions generated in programs that use224// reduces the number of weak definitions generated in programs that use
...@@ -307,7 +247,7 @@...@@ -307,7 +247,7 @@
307// This controls the availability of the C++17 std::pmr library,247// This controls the availability of the C++17 std::pmr library,
308// which is implemented in large part in the built library.248// which is implemented in large part in the built library.
309//249//
310// TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed250// TODO: Enable std::pmr markup once https://llvm.org/PR40340 has been fixed
311// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support251// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support
312// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we252// 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
313// use availability annotations until that bug has been fixed.253// use availability annotations until that bug has been fixed.
...@@ -364,4 +304,11 @@...@@ -364,4 +304,11 @@
364# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION304# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION
365#endif305#endif
366306
307// 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 < 8
309# define _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8
310# else
311# define _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 _LIBCPP_HIDE_FROM_ABI
312# endif
313
367#endif // _LIBCPP___CONFIGURATION_AVAILABILITY_H314#endif // _LIBCPP___CONFIGURATION_AVAILABILITY_H
lib/libcxx/include/__configuration/compiler.h+6-6
...@@ -33,16 +33,16 @@...@@ -33,16 +33,16 @@
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 < 190036# if _LIBCPP_CLANG_VER < 2001
37# warning "Libc++ only supports Clang 19 and later"37# warning "Libc++ only supports Clang 20 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 < 150040# if _LIBCPP_APPLE_CLANG_VER < 1700
41# warning "Libc++ only supports AppleClang 15 and later"41# warning "Libc++ only supports AppleClang 26 and later"
42# endif42# endif
43# elif defined(_LIBCPP_GCC_VER)43# elif defined(_LIBCPP_GCC_VER)
44# if _LIBCPP_GCC_VER < 140044# if _LIBCPP_GCC_VER < 1500
45# warning "Libc++ only supports GCC 14 and later"45# warning "Libc++ only supports GCC 15 and later"
46# endif46# endif
47# endif47# endif
4848
lib/libcxx/include/__configuration/experimental.h created+38
...@@ -0,0 +1,38 @@
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_EXPERIMENTAL_H
10#define _LIBCPP___CONFIGURATION_EXPERIMENTAL_H
11
12/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
13
14#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
15# pragma GCC system_header
16#endif
17
18#if __has_feature(experimental_library)
19# ifndef _LIBCPP_ENABLE_EXPERIMENTAL
20# define _LIBCPP_ENABLE_EXPERIMENTAL
21# endif
22#endif
23
24// Incomplete features get their own specific disabling flags. This makes it
25// easier to grep for target specific flags once the feature is complete.
26#if defined(_LIBCPP_ENABLE_EXPERIMENTAL) || defined(_LIBCPP_BUILDING_LIBRARY)
27# define _LIBCPP_HAS_EXPERIMENTAL_LIBRARY 1
28#else
29# define _LIBCPP_HAS_EXPERIMENTAL_LIBRARY 0
30#endif
31
32#define _LIBCPP_HAS_EXPERIMENTAL_PSTL _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
33#define _LIBCPP_HAS_EXPERIMENTAL_TZDB _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
34#define _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
35#define _LIBCPP_HAS_EXPERIMENTAL_HARDENING_OBSERVE_SEMANTIC _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
36#define _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
37
38#endif // _LIBCPP___CONFIGURATION_EXPERIMENTAL_H
lib/libcxx/include/__configuration/hardening.h created+215
...@@ -0,0 +1,215 @@
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_HARDENING_H
10#define _LIBCPP___CONFIGURATION_HARDENING_H
11
12/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
13#include <__configuration/experimental.h>
14#include <__configuration/language.h>
15
16#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
17# pragma GCC system_header
18#endif
19
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:
38//
39// - `_LIBCPP_HARDENING_MODE_NONE`;
40// - `_LIBCPP_HARDENING_MODE_FAST`;
41// - `_LIBCPP_HARDENING_MODE_EXTENSIVE`;
42// - `_LIBCPP_HARDENING_MODE_DEBUG`.
43//
44// These values have the following effects:
45//
46// - `_LIBCPP_HARDENING_MODE_NONE` -- sets the hardening mode to "none" which disables all runtime hardening checks;
47//
48// - `_LIBCPP_HARDENING_MODE_FAST` -- sets that hardening mode to "fast". The fast mode enables security-critical checks
49// that can be done with relatively little runtime overhead in constant time;
50//
51// - `_LIBCPP_HARDENING_MODE_EXTENSIVE` -- sets the hardening mode to "extensive". The extensive mode is a superset of
52// the fast mode that additionally enables checks that are relatively cheap and prevent common types of logic errors
53// but are not necessarily security-critical;
54//
55// - `_LIBCPP_HARDENING_MODE_DEBUG` -- sets the hardening mode to "debug". The debug mode is a superset of the extensive
56// mode and enables all checks available in the library, including internal assertions. Checks that are part of the
57// debug mode can be very expensive and thus the debug mode is intended to be used for testing, not in production.
58
59// Inside the library, assertions are categorized so they can be cherry-picked based on the chosen hardening mode. These
60// macros are only for internal use -- users should only pick one of the high-level hardening modes described above.
61//
62// - `_LIBCPP_ASSERT_VALID_INPUT_RANGE` -- checks that ranges (whether expressed as an iterator pair, an iterator and
63// a sentinel, an iterator and a count, or a `std::range`) given as input to library functions are valid:
64// - the sentinel is reachable from the begin iterator;
65// - TODO(hardening): both iterators refer to the same container.
66//
67// - `_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS` -- checks that any attempts to access a container element, whether through
68// the container object or through an iterator, are valid and do not attempt to go out of bounds or otherwise access
69// a non-existent element. For iterator checks to work, bounded iterators must be enabled in the ABI. Types like
70// `optional` and `function` are considered one-element containers for the purposes of this check.
71//
72// - `_LIBCPP_ASSERT_NON_NULL` -- checks that the pointer being dereferenced is not null. On most modern platforms zero
73// address does not refer to an actual location in memory, so a null pointer dereference would not compromize the
74// memory security of a program (however, it is still undefined behavior that can result in strange errors due to
75// compiler optimizations).
76//
77// - `_LIBCPP_ASSERT_NON_OVERLAPPING_RANGES` -- for functions that take several ranges as arguments, checks that the
78// given ranges do not overlap.
79//
80// - `_LIBCPP_ASSERT_VALID_DEALLOCATION` -- checks that an attempt to deallocate memory is valid (e.g. the given object
81// was allocated by the given allocator). Violating this category typically results in a memory leak.
82//
83// - `_LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL` -- checks that a call to an external API doesn't fail in
84// an unexpected manner. This includes triggering documented cases of undefined behavior in an external library (like
85// attempting to unlock an unlocked mutex in pthreads). Any API external to the library falls under this category
86// (from system calls to compiler intrinsics). We generally don't expect these failures to compromize memory safety or
87// otherwise create an immediate security issue.
88//
89// - `_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR` -- checks any operations that exchange nodes between containers to make sure
90// the containers have compatible allocators.
91//
92// - `_LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN` -- checks that the given argument is within the domain of valid arguments
93// for the function. Violating this typically produces an incorrect result (e.g. the clamp algorithm returns the
94// original value without clamping it due to incorrect functors) or puts an object into an invalid state (e.g.
95// a string view where only a subset of elements is possible to access). This category is for assertions violating
96// which doesn't cause any immediate issues in the library -- whatever the consequences are, they will happen in the
97// user code.
98//
99// - `_LIBCPP_ASSERT_PEDANTIC` -- checks prerequisites which are imposed by the Standard, but violating which happens to
100// be benign in our implementation.
101//
102// - `_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT` -- checks that the given argument satisfies the semantic requirements imposed
103// by the Standard. Typically, there is no simple way to completely prove that a semantic requirement is satisfied;
104// thus, this would often be a heuristic check and it might be quite expensive.
105//
106// - `_LIBCPP_ASSERT_INTERNAL` -- checks that internal invariants of the library hold. These assertions don't depend on
107// user input.
108//
109// - `_LIBCPP_ASSERT_UNCATEGORIZED` -- for assertions that haven't been properly classified yet.
110
111// clang-format off
112# define _LIBCPP_HARDENING_MODE_NONE (1 << 1)
113# define _LIBCPP_HARDENING_MODE_FAST (1 << 2)
114# define _LIBCPP_HARDENING_MODE_EXTENSIVE (1 << 4) // Deliberately not ordered.
115# define _LIBCPP_HARDENING_MODE_DEBUG (1 << 3)
116// clang-format on
117
118#ifndef _LIBCPP_HARDENING_MODE
119
120# ifndef _LIBCPP_HARDENING_MODE_DEFAULT
121# error _LIBCPP_HARDENING_MODE_DEFAULT is not defined. This definition should be set at configuration time in the \
122`__config_site` header, please make sure your installation of libc++ is not broken.
123# endif
124
125# define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_DEFAULT
126#endif
127
128#if _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_NONE && _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_FAST && \
129 _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_EXTENSIVE && \
130 _LIBCPP_HARDENING_MODE != _LIBCPP_HARDENING_MODE_DEBUG
131# error _LIBCPP_HARDENING_MODE must be set to one of the following values: \
132_LIBCPP_HARDENING_MODE_NONE, \
133_LIBCPP_HARDENING_MODE_FAST, \
134_LIBCPP_HARDENING_MODE_EXTENSIVE, \
135_LIBCPP_HARDENING_MODE_DEBUG
136#endif
137
138// The library provides the macro `_LIBCPP_ASSERTION_SEMANTIC` for configuring the assertion semantic used by hardening;
139// it can be set to one of the following values:
140//
141// - `_LIBCPP_ASSERTION_SEMANTIC_IGNORE`;
142// - `_LIBCPP_ASSERTION_SEMANTIC_OBSERVE`;
143// - `_LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE`;
144// - `_LIBCPP_ASSERTION_SEMANTIC_ENFORCE`.
145//
146// libc++ assertion semantics generally mirror the evaluation semantics of C++26 Contracts:
147// - `ignore` evaluates the assertion but doesn't do anything if it fails (note that it differs from the Contracts
148// `ignore` semantic which wouldn't evaluate the assertion at all);
149// - `observe` logs an error (indicating, if possible, that the error is fatal) and continues execution;
150// - `quick-enforce` terminates the program as fast as possible (via trapping);
151// - `enforce` logs an error and then terminates the program.
152//
153// Additionally, a special `hardening-dependent` value selects the assertion semantic based on the hardening mode in
154// effect: the production-capable modes (`fast` and `extensive`) map to `quick_enforce` and the `debug` mode maps to
155// `enforce`. The `hardening-dependent` semantic cannot be selected explicitly, it is only used when no assertion
156// semantic is provided by the user _and_ the library's default semantic is configured to be dependent on hardening.
157//
158// Notes:
159// - Continuing execution after a hardening check fails results in undefined behavior; the `observe` semantic is meant
160// to make adopting hardening easier but should not be used outside of this scenario;
161// - C++26 wording for Library Hardening precludes a conforming Hardened implementation from using the Contracts
162// `ignore` semantic when evaluating hardened preconditions in the Library. Libc++ allows using this semantic for
163// hardened preconditions, however, be aware that using `ignore` does not produce a conforming "Hardened"
164// implementation, unlike the other semantics above.
165// clang-format off
166# define _LIBCPP_ASSERTION_SEMANTIC_HARDENING_DEPENDENT (1 << 1)
167# define _LIBCPP_ASSERTION_SEMANTIC_IGNORE (1 << 2)
168# define _LIBCPP_ASSERTION_SEMANTIC_OBSERVE (1 << 3)
169# define _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE (1 << 4)
170# define _LIBCPP_ASSERTION_SEMANTIC_ENFORCE (1 << 5)
171// clang-format on
172
173// If the user attempts to configure the assertion semantic, check that it is allowed in the current environment.
174#if defined(_LIBCPP_ASSERTION_SEMANTIC)
175# if !_LIBCPP_HAS_EXPERIMENTAL_LIBRARY
176# error "Assertion semantics are an experimental feature."
177# endif
178# if defined(_LIBCPP_CXX03_LANG)
179# error "Assertion semantics are not available in the C++03 mode."
180# endif
181#endif // defined(_LIBCPP_ASSERTION_SEMANTIC)
182
183// User-provided semantic takes top priority -- don't override if set.
184#ifndef _LIBCPP_ASSERTION_SEMANTIC
185
186# ifndef _LIBCPP_ASSERTION_SEMANTIC_DEFAULT
187# error _LIBCPP_ASSERTION_SEMANTIC_DEFAULT is not defined. This definition should be set at configuration time in \
188the `__config_site` header, please make sure your installation of libc++ is not broken.
189# endif
190
191# if _LIBCPP_ASSERTION_SEMANTIC_DEFAULT != _LIBCPP_ASSERTION_SEMANTIC_HARDENING_DEPENDENT
192# define _LIBCPP_ASSERTION_SEMANTIC _LIBCPP_ASSERTION_SEMANTIC_DEFAULT
193# else
194# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
195# define _LIBCPP_ASSERTION_SEMANTIC _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
196# else
197# define _LIBCPP_ASSERTION_SEMANTIC _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE
198# endif
199# endif // _LIBCPP_ASSERTION_SEMANTIC_DEFAULT != _LIBCPP_ASSERTION_SEMANTIC_HARDENING_DEPENDENT
200
201#endif // #ifndef _LIBCPP_ASSERTION_SEMANTIC
202
203// Finally, validate the selected semantic (in case the user tries setting it to an incorrect value):
204#if _LIBCPP_ASSERTION_SEMANTIC != _LIBCPP_ASSERTION_SEMANTIC_IGNORE && \
205 _LIBCPP_ASSERTION_SEMANTIC != _LIBCPP_ASSERTION_SEMANTIC_OBSERVE && \
206 _LIBCPP_ASSERTION_SEMANTIC != _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE && \
207 _LIBCPP_ASSERTION_SEMANTIC != _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
208# error _LIBCPP_ASSERTION_SEMANTIC must be set to one of the following values: \
209_LIBCPP_ASSERTION_SEMANTIC_IGNORE, \
210_LIBCPP_ASSERTION_SEMANTIC_OBSERVE, \
211_LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE, \
212_LIBCPP_ASSERTION_SEMANTIC_ENFORCE
213#endif
214
215#endif // _LIBCPP___CONFIGURATION_HARDENING_H
lib/libcxx/include/__configuration/language.h+3
...@@ -18,6 +18,9 @@...@@ -18,6 +18,9 @@
1818
19// NOLINTBEGIN(libcpp-cpp-version-check)19// NOLINTBEGIN(libcpp-cpp-version-check)
20#ifdef __cplusplus20#ifdef __cplusplus
21# if __cplusplus < 201103L
22# define _LIBCPP_CXX03_LANG
23# endif
21# if __cplusplus <= 201103L24# if __cplusplus <= 201103L
22# define _LIBCPP_STD_VER 1125# define _LIBCPP_STD_VER 11
23# elif __cplusplus <= 201402L26# elif __cplusplus <= 201402L
lib/libcxx/include/__configuration/platform.h+9-16
...@@ -31,22 +31,15 @@...@@ -31,22 +31,15 @@
31#endif31#endif
3232
33// Need to detect which libc we're using if we're on Linux.33// Need to detect which libc we're using if we're on Linux.
34#if defined(__linux__) || defined(__AMDGPU__) || defined(__NVPTX__)34#if (defined(__linux__) || defined(__AMDGPU__) || defined(__NVPTX__)) && __has_include(<features.h>)
35# if __has_include(<features.h>)35# include <features.h>
36# include <features.h>36# if defined(__GLIBC_PREREQ)
37# if defined(__GLIBC_PREREQ)37# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
38# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)38# else
39# else39# define _LIBCPP_GLIBC_PREREQ(a, b) 0
40# define _LIBCPP_GLIBC_PREREQ(a, b) 040# endif // defined(__GLIBC_PREREQ)
41# endif // defined(__GLIBC_PREREQ)41#else
42# endif42# define _LIBCPP_GLIBC_PREREQ(a, b) 0
43#endif
44
45// This is required in order for _NEWLIB_VERSION to be defined in places where we use it.
46// TODO: We shouldn't be including arbitrarily-named headers from libc++ since this can break valid
47// user code. Move code paths that need _NEWLIB_VERSION to another customization mechanism.
48#if __has_include(<picolibc.h>)
49# include <picolibc.h>
50#endif43#endif
5144
52#ifndef __BYTE_ORDER__45#ifndef __BYTE_ORDER__
lib/libcxx/include/__coroutine/coroutine_handle.h+9-9
...@@ -44,9 +44,9 @@ public:...@@ -44,9 +44,9 @@ public:
44 }44 }
4545
46 // [coroutine.handle.export.import], export/import46 // [coroutine.handle.export.import], export/import
47 _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; }47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; }
4848
49 _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept {49 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept {
50 coroutine_handle __tmp;50 coroutine_handle __tmp;
51 __tmp.__handle_ = __addr;51 __tmp.__handle_ = __addr;
52 return __tmp;52 return __tmp;
...@@ -55,7 +55,7 @@ public:...@@ -55,7 +55,7 @@ public:
55 // [coroutine.handle.observers], observers55 // [coroutine.handle.observers], observers
56 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __handle_ != nullptr; }56 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __handle_ != nullptr; }
5757
58 _LIBCPP_HIDE_FROM_ABI bool done() const {58 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool done() const {
59 _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(__is_suspended(), "done() can be called only on suspended coroutines");59 _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(__is_suspended(), "done() can be called only on suspended coroutines");
60 return __builtin_coro_done(__handle_);60 return __builtin_coro_done(__handle_);
61 }61 }
...@@ -100,7 +100,7 @@ public:...@@ -100,7 +100,7 @@ public:
100100
101 _LIBCPP_HIDE_FROM_ABI constexpr coroutine_handle(nullptr_t) noexcept {}101 _LIBCPP_HIDE_FROM_ABI constexpr coroutine_handle(nullptr_t) noexcept {}
102102
103 _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise(_Promise& __promise) {103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise(_Promise& __promise) {
104 using _RawPromise = __remove_cv_t<_Promise>;104 using _RawPromise = __remove_cv_t<_Promise>;
105 coroutine_handle __tmp;105 coroutine_handle __tmp;
106 __tmp.__handle_ =106 __tmp.__handle_ =
...@@ -114,9 +114,9 @@ public:...@@ -114,9 +114,9 @@ public:
114 }114 }
115115
116 // [coroutine.handle.export.import], export/import116 // [coroutine.handle.export.import], export/import
117 _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; }117 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; }
118118
119 _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept {119 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept {
120 coroutine_handle __tmp;120 coroutine_handle __tmp;
121 __tmp.__handle_ = __addr;121 __tmp.__handle_ = __addr;
122 return __tmp;122 return __tmp;
...@@ -130,7 +130,7 @@ public:...@@ -130,7 +130,7 @@ public:
130 // [coroutine.handle.observers], observers130 // [coroutine.handle.observers], observers
131 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __handle_ != nullptr; }131 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __handle_ != nullptr; }
132132
133 _LIBCPP_HIDE_FROM_ABI bool done() const {133 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool done() const {
134 _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(__is_suspended(), "done() can be called only on suspended coroutines");134 _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(__is_suspended(), "done() can be called only on suspended coroutines");
135 return __builtin_coro_done(__handle_);135 return __builtin_coro_done(__handle_);
136 }136 }
...@@ -150,7 +150,7 @@ public:...@@ -150,7 +150,7 @@ public:
150 }150 }
151151
152 // [coroutine.handle.promise], promise access152 // [coroutine.handle.promise], promise access
153 _LIBCPP_HIDE_FROM_ABI _Promise& promise() const {153 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Promise& promise() const {
154 return *static_cast<_Promise*>(__builtin_coro_promise(this->__handle_, alignof(_Promise), false));154 return *static_cast<_Promise*>(__builtin_coro_promise(this->__handle_, alignof(_Promise), false));
155 }155 }
156156
...@@ -165,7 +165,7 @@ private:...@@ -165,7 +165,7 @@ private:
165// [coroutine.handle.hash]165// [coroutine.handle.hash]
166template <class _Tp>166template <class _Tp>
167struct hash<coroutine_handle<_Tp>> {167struct hash<coroutine_handle<_Tp>> {
168 _LIBCPP_HIDE_FROM_ABI size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept {168 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept {
169 return hash<void*>()(__v.address());169 return hash<void*>()(__v.address());
170 }170 }
171};171};
lib/libcxx/include/__coroutine/noop_coroutine_handle.h+11-13
...@@ -20,8 +20,6 @@...@@ -20,8 +20,6 @@
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2222
23# if __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)
24
25// [coroutine.noop]23// [coroutine.noop]
26// [coroutine.promise.noop]24// [coroutine.promise.noop]
27struct noop_coroutine_promise {};25struct noop_coroutine_promise {};
...@@ -37,7 +35,7 @@ public:...@@ -37,7 +35,7 @@ public:
3735
38 // [coroutine.handle.noop.observers], observers36 // [coroutine.handle.noop.observers], observers
39 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return true; }37 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return true; }
40 _LIBCPP_HIDE_FROM_ABI constexpr bool done() const noexcept { return false; }38 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool done() const noexcept { return false; }
4139
42 // [coroutine.handle.noop.resumption], resumption40 // [coroutine.handle.noop.resumption], resumption
43 _LIBCPP_HIDE_FROM_ABI constexpr void operator()() const noexcept {}41 _LIBCPP_HIDE_FROM_ABI constexpr void operator()() const noexcept {}
...@@ -45,23 +43,23 @@ public:...@@ -45,23 +43,23 @@ public:
45 _LIBCPP_HIDE_FROM_ABI constexpr void destroy() const noexcept {}43 _LIBCPP_HIDE_FROM_ABI constexpr void destroy() const noexcept {}
4644
47 // [coroutine.handle.noop.promise], promise access45 // [coroutine.handle.noop.promise], promise access
48 _LIBCPP_HIDE_FROM_ABI noop_coroutine_promise& promise() const noexcept {46 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI noop_coroutine_promise& promise() const noexcept {
49 return *static_cast<noop_coroutine_promise*>(47 return *static_cast<noop_coroutine_promise*>(
50 __builtin_coro_promise(this->__handle_, alignof(noop_coroutine_promise), false));48 __builtin_coro_promise(this->__handle_, alignof(noop_coroutine_promise), false));
51 }49 }
5250
53 // [coroutine.handle.noop.address], address51 // [coroutine.handle.noop.address], address
54 _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; }52 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; }
5553
56private:54private:
57 _LIBCPP_HIDE_FROM_ABI friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept;55 _LIBCPP_HIDE_FROM_ABI friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept;
5856
59# if __has_builtin(__builtin_coro_noop)57# if __has_builtin(__builtin_coro_noop)
60 _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept { this->__handle_ = __builtin_coro_noop(); }58 _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept { this->__handle_ = __builtin_coro_noop(); }
6159
62 void* __handle_ = nullptr;60 void* __handle_ = nullptr;
6361
64# elif defined(_LIBCPP_COMPILER_GCC)62# elif defined(_LIBCPP_COMPILER_GCC)
65 // GCC doesn't implement __builtin_coro_noop().63 // GCC doesn't implement __builtin_coro_noop().
66 // Construct the coroutine frame manually instead.64 // Construct the coroutine frame manually instead.
67 struct __noop_coroutine_frame_ty_ {65 struct __noop_coroutine_frame_ty_ {
...@@ -78,19 +76,19 @@ private:...@@ -78,19 +76,19 @@ private:
7876
79 _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept = default;77 _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept = default;
8078
81# endif // __has_builtin(__builtin_coro_noop)79# endif // __has_builtin(__builtin_coro_noop)
82};80};
8381
84using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;82using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
8583
86# if defined(_LIBCPP_COMPILER_GCC)84# if defined(_LIBCPP_COMPILER_GCC)
87inline noop_coroutine_handle::__noop_coroutine_frame_ty_ noop_coroutine_handle::__noop_coroutine_frame_{};85inline noop_coroutine_handle::__noop_coroutine_frame_ty_ noop_coroutine_handle::__noop_coroutine_frame_{};
88# endif86# endif
8987
90// [coroutine.noop.coroutine]88// [coroutine.noop.coroutine]
91inline _LIBCPP_HIDE_FROM_ABI noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle(); }89[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI noop_coroutine_handle noop_coroutine() noexcept {
9290 return noop_coroutine_handle();
93# endif // __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)91}
9492
95_LIBCPP_END_NAMESPACE_STD93_LIBCPP_END_NAMESPACE_STD
9694
lib/libcxx/include/__debug_utils/strict_weak_ordering_check.h+1-1
...@@ -27,7 +27,7 @@ template <class _RandomAccessIterator, class _Comp>...@@ -27,7 +27,7 @@ template <class _RandomAccessIterator, class _Comp>
27_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void27_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
28__check_strict_weak_ordering_sorted(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {28__check_strict_weak_ordering_sorted(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
29#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG29#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
30 using __diff_t = __iter_diff_t<_RandomAccessIterator>;30 using __diff_t = __iterator_difference_type<_RandomAccessIterator>;
31 using _Comp_ref = __comp_ref_type<_Comp>;31 using _Comp_ref = __comp_ref_type<_Comp>;
32 if (!__libcpp_is_constant_evaluated()) {32 if (!__libcpp_is_constant_evaluated()) {
33 // Check if the range is actually sorted.33 // Check if the range is actually sorted.
lib/libcxx/include/__exception/exception.h+6-4
...@@ -48,13 +48,15 @@ public:...@@ -48,13 +48,15 @@ public:
48 __data_._DoFree = true;48 __data_._DoFree = true;
49 }49 }
5050
51 exception(exception const&) _NOEXCEPT {}51 exception(exception const&) _NOEXCEPT : __data_() {}
5252
53 exception& operator=(exception const&) _NOEXCEPT { return *this; }53 exception& operator=(exception const&) _NOEXCEPT { return *this; }
5454
55 virtual ~exception() _NOEXCEPT {}55 virtual ~exception() _NOEXCEPT {}
5656
57 virtual char const* what() const _NOEXCEPT { return __data_._What ? __data_._What : "Unknown exception"; }57 [[__nodiscard__]] virtual char const* what() const _NOEXCEPT {
58 return __data_._What ? __data_._What : "Unknown exception";
59 }
5860
59private:61private:
60 __std_exception_data __data_;62 __std_exception_data __data_;
...@@ -76,7 +78,7 @@ public:...@@ -76,7 +78,7 @@ public:
76 _LIBCPP_HIDE_FROM_ABI exception& operator=(const exception&) _NOEXCEPT = default;78 _LIBCPP_HIDE_FROM_ABI exception& operator=(const exception&) _NOEXCEPT = default;
7779
78 virtual ~exception() _NOEXCEPT;80 virtual ~exception() _NOEXCEPT;
79 virtual const char* what() const _NOEXCEPT;81 [[__nodiscard__]] virtual const char* what() const _NOEXCEPT;
80};82};
8183
82class _LIBCPP_EXPORTED_FROM_ABI bad_exception : public exception {84class _LIBCPP_EXPORTED_FROM_ABI bad_exception : public exception {
...@@ -85,7 +87,7 @@ public:...@@ -85,7 +87,7 @@ public:
85 _LIBCPP_HIDE_FROM_ABI bad_exception(const bad_exception&) _NOEXCEPT = default;87 _LIBCPP_HIDE_FROM_ABI bad_exception(const bad_exception&) _NOEXCEPT = default;
86 _LIBCPP_HIDE_FROM_ABI bad_exception& operator=(const bad_exception&) _NOEXCEPT = default;88 _LIBCPP_HIDE_FROM_ABI bad_exception& operator=(const bad_exception&) _NOEXCEPT = default;
87 ~bad_exception() _NOEXCEPT override;89 ~bad_exception() _NOEXCEPT override;
88 const char* what() const _NOEXCEPT override;90 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
89};91};
90#endif // !_LIBCPP_ABI_VCRUNTIME92#endif // !_LIBCPP_ABI_VCRUNTIME
9193
lib/libcxx/include/__exception/exception_ptr.h+27-5
...@@ -11,18 +11,24 @@...@@ -11,18 +11,24 @@
1111
12#include <__config>12#include <__config>
13#include <__cstddef/nullptr_t.h>13#include <__cstddef/nullptr_t.h>
14#include <__cstddef/size_t.h>
14#include <__exception/operations.h>15#include <__exception/operations.h>
15#include <__memory/addressof.h>16#include <__memory/addressof.h>
16#include <__memory/construct_at.h>17#include <__memory/construct_at.h>
17#include <__type_traits/decay.h>18#include <__type_traits/decay.h>
18#include <__type_traits/is_pointer.h>19#include <__type_traits/is_pointer.h>
19#include <cstdlib>20#include <__utility/move.h>
21#include <__utility/swap.h>
22#include <__verbose_abort>
20#include <typeinfo>23#include <typeinfo>
2124
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
23# pragma GCC system_header26# pragma GCC system_header
24#endif27#endif
2528
29_LIBCPP_PUSH_MACROS
30#include <__undef_macros>
31
26#ifndef _LIBCPP_ABI_MICROSOFT32#ifndef _LIBCPP_ABI_MICROSOFT
2733
28# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION34# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
...@@ -30,7 +36,7 @@...@@ -30,7 +36,7 @@
30namespace __cxxabiv1 {36namespace __cxxabiv1 {
3137
32extern "C" {38extern "C" {
33_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(size_t) throw();39_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(std::size_t) throw();
34_LIBCPP_OVERRIDABLE_FUNC_VIS void __cxa_free_exception(void*) throw();40_LIBCPP_OVERRIDABLE_FUNC_VIS void __cxa_free_exception(void*) throw();
3541
36struct __cxa_exception;42struct __cxa_exception;
...@@ -57,6 +63,8 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD...@@ -57,6 +63,8 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
5763
58#ifndef _LIBCPP_ABI_MICROSOFT64#ifndef _LIBCPP_ABI_MICROSOFT
5965
66inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT;
67
60class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {68class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
61 void* __ptr_;69 void* __ptr_;
6270
...@@ -67,15 +75,21 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {...@@ -67,15 +75,21 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
6775
68public:76public:
69 // exception_ptr is basically a COW string so it is trivially relocatable.77 // exception_ptr is basically a COW string so it is trivially relocatable.
70 // It is also replaceable because assignment has normal value semantics.
71 using __trivially_relocatable _LIBCPP_NODEBUG = exception_ptr;78 using __trivially_relocatable _LIBCPP_NODEBUG = exception_ptr;
72 using __replaceable _LIBCPP_NODEBUG = exception_ptr;
7379
74 _LIBCPP_HIDE_FROM_ABI exception_ptr() _NOEXCEPT : __ptr_() {}80 _LIBCPP_HIDE_FROM_ABI exception_ptr() _NOEXCEPT : __ptr_() {}
75 _LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}81 _LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
7682
77 exception_ptr(const exception_ptr&) _NOEXCEPT;83 exception_ptr(const exception_ptr&) _NOEXCEPT;
84 _LIBCPP_HIDE_FROM_ABI exception_ptr(exception_ptr&& __other) _NOEXCEPT : __ptr_(__other.__ptr_) {
85 __other.__ptr_ = nullptr;
86 }
78 exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;87 exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
88 _LIBCPP_HIDE_FROM_ABI exception_ptr& operator=(exception_ptr&& __other) _NOEXCEPT {
89 exception_ptr __tmp(std::move(__other));
90 std::swap(__tmp, *this);
91 return *this;
92 }
79 ~exception_ptr() _NOEXCEPT;93 ~exception_ptr() _NOEXCEPT;
8094
81 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __ptr_ != nullptr; }95 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __ptr_ != nullptr; }
...@@ -88,10 +102,16 @@ public:...@@ -88,10 +102,16 @@ public:
88 return !(__x == __y);102 return !(__x == __y);
89 }103 }
90104
105 friend _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT;
106
91 friend _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;107 friend _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
92 friend _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);108 friend _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
93};109};
94110
111inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT {
112 std::swap(__x.__ptr_, __y.__ptr_);
113}
114
95# if _LIBCPP_HAS_EXCEPTIONS115# if _LIBCPP_HAS_EXCEPTIONS
96# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION116# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
97template <class _Ep>117template <class _Ep>
...@@ -153,7 +173,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {...@@ -153,7 +173,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
153# else // !_LIBCPP_HAS_EXCEPTIONS173# else // !_LIBCPP_HAS_EXCEPTIONS
154template <class _Ep>174template <class _Ep>
155_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT {175_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT {
156 std::abort();176 _LIBCPP_VERBOSE_ABORT("make_exception_ptr was called in -fno-exceptions mode");
157}177}
158# endif // _LIBCPP_HAS_EXCEPTIONS178# endif // _LIBCPP_HAS_EXCEPTIONS
159179
...@@ -201,4 +221,6 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {...@@ -201,4 +221,6 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
201#endif // _LIBCPP_ABI_MICROSOFT221#endif // _LIBCPP_ABI_MICROSOFT
202_LIBCPP_END_UNVERSIONED_NAMESPACE_STD222_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
203223
224_LIBCPP_POP_MACROS
225
204#endif // _LIBCPP___EXCEPTION_EXCEPTION_PTR_H226#endif // _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
lib/libcxx/include/__exception/nested_exception.h+2-2
...@@ -40,7 +40,7 @@ public:...@@ -40,7 +40,7 @@ public:
4040
41 // access functions41 // access functions
42 [[__noreturn__]] void rethrow_nested() const;42 [[__noreturn__]] void rethrow_nested() const;
43 _LIBCPP_HIDE_FROM_ABI exception_ptr nested_ptr() const _NOEXCEPT { return __ptr_; }43 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI exception_ptr nested_ptr() const _NOEXCEPT { return __ptr_; }
44};44};
4545
46template <class _Tp>46template <class _Tp>
...@@ -73,7 +73,7 @@ template <class _Tp>...@@ -73,7 +73,7 @@ template <class _Tp>
73 __throw_with_nested<_Tp,73 __throw_with_nested<_Tp,
74 _Up,74 _Up,
75 is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value &&75 is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value &&
76 !__libcpp_is_final<_Up>::value>::__do_throw(std::forward<_Tp>(__t));76 !__is_final_v<_Up> >::__do_throw(std::forward<_Tp>(__t));
77#else77#else
78 ((void)__t);78 ((void)__t);
79 // FIXME: Make this abort79 // FIXME: Make this abort
lib/libcxx/include/__exception/operations.h+5-5
...@@ -20,22 +20,22 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD...@@ -20,22 +20,22 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
20 defined(_LIBCPP_BUILDING_LIBRARY)20 defined(_LIBCPP_BUILDING_LIBRARY)
21using unexpected_handler = void (*)();21using unexpected_handler = void (*)();
22_LIBCPP_EXPORTED_FROM_ABI unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;22_LIBCPP_EXPORTED_FROM_ABI unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
23_LIBCPP_EXPORTED_FROM_ABI unexpected_handler get_unexpected() _NOEXCEPT;23[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unexpected_handler get_unexpected() _NOEXCEPT;
24[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void unexpected();24[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void unexpected();
25#endif25#endif
2626
27using terminate_handler = void (*)();27using terminate_handler = void (*)();
28_LIBCPP_EXPORTED_FROM_ABI terminate_handler set_terminate(terminate_handler) _NOEXCEPT;28_LIBCPP_EXPORTED_FROM_ABI terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
29_LIBCPP_EXPORTED_FROM_ABI terminate_handler get_terminate() _NOEXCEPT;29[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI terminate_handler get_terminate() _NOEXCEPT;
3030
31#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION)31#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION)
32_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 bool uncaught_exception() _NOEXCEPT;32[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 bool uncaught_exception() _NOEXCEPT;
33#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION)33#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION)
34_LIBCPP_EXPORTED_FROM_ABI int uncaught_exceptions() _NOEXCEPT;34[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI int uncaught_exceptions() _NOEXCEPT;
3535
36class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;36class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;
3737
38_LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;38[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
39[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);39[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
40_LIBCPP_END_UNVERSIONED_NAMESPACE_STD40_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
4141
lib/libcxx/include/__expected/bad_expected_access.h+8-6
...@@ -43,9 +43,11 @@ protected:...@@ -43,9 +43,11 @@ protected:
4343
44public:44public:
45# if _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION45# if _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION
46 const char* what() const noexcept override;46 [[nodiscard]] const char* what() const noexcept override;
47# else47# else
48 _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const noexcept override { return "bad access to std::expected"; }48 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const noexcept override {
49 return "bad access to std::expected";
50 }
49# endif51# endif
50};52};
51_LIBCPP_DIAGNOSTIC_POP53_LIBCPP_DIAGNOSTIC_POP
...@@ -55,10 +57,10 @@ class bad_expected_access : public bad_expected_access<void> {...@@ -55,10 +57,10 @@ class bad_expected_access : public bad_expected_access<void> {
55public:57public:
56 _LIBCPP_HIDE_FROM_ABI explicit bad_expected_access(_Err __e) : __unex_(std::move(__e)) {}58 _LIBCPP_HIDE_FROM_ABI explicit bad_expected_access(_Err __e) : __unex_(std::move(__e)) {}
5759
58 _LIBCPP_HIDE_FROM_ABI _Err& error() & noexcept { return __unex_; }60 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Err& error() & noexcept { return __unex_; }
59 _LIBCPP_HIDE_FROM_ABI const _Err& error() const& noexcept { return __unex_; }61 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const _Err& error() const& noexcept { return __unex_; }
60 _LIBCPP_HIDE_FROM_ABI _Err&& error() && noexcept { return std::move(__unex_); }62 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Err&& error() && noexcept { return std::move(__unex_); }
61 _LIBCPP_HIDE_FROM_ABI const _Err&& error() const&& noexcept { return std::move(__unex_); }63 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const _Err&& error() const&& noexcept { return std::move(__unex_); }
6264
63private:65private:
64 _Err __unex_;66 _Err __unex_;
lib/libcxx/include/__expected/expected.h+62-64
...@@ -30,7 +30,6 @@...@@ -30,7 +30,6 @@
30#include <__type_traits/is_nothrow_assignable.h>30#include <__type_traits/is_nothrow_assignable.h>
31#include <__type_traits/is_nothrow_constructible.h>31#include <__type_traits/is_nothrow_constructible.h>
32#include <__type_traits/is_reference.h>32#include <__type_traits/is_reference.h>
33#include <__type_traits/is_replaceable.h>
34#include <__type_traits/is_same.h>33#include <__type_traits/is_same.h>
35#include <__type_traits/is_swappable.h>34#include <__type_traits/is_swappable.h>
36#include <__type_traits/is_trivially_constructible.h>35#include <__type_traits/is_trivially_constructible.h>
...@@ -472,8 +471,6 @@ public:...@@ -472,8 +471,6 @@ public:
472 __conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value && __libcpp_is_trivially_relocatable<_Err>::value,471 __conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value && __libcpp_is_trivially_relocatable<_Err>::value,
473 expected,472 expected,
474 void>;473 void>;
475 using __replaceable _LIBCPP_NODEBUG =
476 __conditional_t<__is_replaceable_v<_Tp> && __is_replaceable_v<_Err>, expected, void>;
477474
478 template <class _Up>475 template <class _Up>
479 using rebind = expected<_Up, error_type>;476 using rebind = expected<_Up, error_type>;
...@@ -555,9 +552,10 @@ public:...@@ -555,9 +552,10 @@ public:
555 is_nothrow_constructible_v<_Tp, _Up> && is_nothrow_constructible_v<_Err, _OtherErr>) // strengthened552 is_nothrow_constructible_v<_Tp, _Up> && is_nothrow_constructible_v<_Err, _OtherErr>) // strengthened
556 : __base(__other.__has_val(), std::move(__other.__union())) {}553 : __base(__other.__has_val(), std::move(__other.__union())) {}
557554
558 template <class _Up = _Tp>555 template <class _Up = remove_cv_t<_Tp>>
559 requires(!is_same_v<remove_cvref_t<_Up>, in_place_t> && !is_same_v<expected, remove_cvref_t<_Up>> &&556 requires(!is_same_v<remove_cvref_t<_Up>, in_place_t> && !is_same_v<expected, remove_cvref_t<_Up>> &&
560 is_constructible_v<_Tp, _Up> && !__is_std_unexpected<remove_cvref_t<_Up>>::value &&557 !is_same_v<remove_cvref_t<_Up>, unexpect_t> && is_constructible_v<_Tp, _Up> &&
558 !__is_std_unexpected<remove_cvref_t<_Up>>::value &&
561 (!is_same_v<remove_cv_t<_Tp>, bool> || !__is_std_expected<remove_cvref_t<_Up>>::value))559 (!is_same_v<remove_cv_t<_Tp>, bool> || !__is_std_expected<remove_cvref_t<_Up>>::value))
562 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!is_convertible_v<_Up, _Tp>)560 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!is_convertible_v<_Up, _Tp>)
563 expected(_Up&& __u) noexcept(is_nothrow_constructible_v<_Tp, _Up>) // strengthened561 expected(_Up&& __u) noexcept(is_nothrow_constructible_v<_Tp, _Up>) // strengthened
...@@ -668,7 +666,7 @@ public:...@@ -668,7 +666,7 @@ public:
668 return *this;666 return *this;
669 }667 }
670668
671 template <class _Up = _Tp>669 template <class _Up = remove_cv_t<_Tp>>
672 _LIBCPP_HIDE_FROM_ABI constexpr expected& operator=(_Up&& __v)670 _LIBCPP_HIDE_FROM_ABI constexpr expected& operator=(_Up&& __v)
673 requires(!is_same_v<expected, remove_cvref_t<_Up>> && !__is_std_unexpected<remove_cvref_t<_Up>>::value &&671 requires(!is_same_v<expected, remove_cvref_t<_Up>> && !__is_std_unexpected<remove_cvref_t<_Up>>::value &&
674 is_constructible_v<_Tp, _Up> && is_assignable_v<_Tp&, _Up> &&672 is_constructible_v<_Tp, _Up> && is_assignable_v<_Tp&, _Up> &&
...@@ -800,25 +798,25 @@ public:...@@ -800,25 +798,25 @@ public:
800 return std::addressof(this->__val());798 return std::addressof(this->__val());
801 }799 }
802800
803 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const& noexcept {801 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const& noexcept {
804 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(802 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
805 this->__has_val(), "expected::operator* requires the expected to contain a value");803 this->__has_val(), "expected::operator* requires the expected to contain a value");
806 return this->__val();804 return this->__val();
807 }805 }
808806
809 _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() & noexcept {807 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() & noexcept {
810 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(808 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
811 this->__has_val(), "expected::operator* requires the expected to contain a value");809 this->__has_val(), "expected::operator* requires the expected to contain a value");
812 return this->__val();810 return this->__val();
813 }811 }
814812
815 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& operator*() const&& noexcept {813 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& operator*() const&& noexcept {
816 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(814 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
817 this->__has_val(), "expected::operator* requires the expected to contain a value");815 this->__has_val(), "expected::operator* requires the expected to contain a value");
818 return std::move(this->__val());816 return std::move(this->__val());
819 }817 }
820818
821 _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator*() && noexcept {819 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator*() && noexcept {
822 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(820 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
823 this->__has_val(), "expected::operator* requires the expected to contain a value");821 this->__has_val(), "expected::operator* requires the expected to contain a value");
824 return std::move(this->__val());822 return std::move(this->__val());
...@@ -826,9 +824,9 @@ public:...@@ -826,9 +824,9 @@ public:
826824
827 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return this->__has_val(); }825 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return this->__has_val(); }
828826
829 _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__has_val(); }827 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__has_val(); }
830828
831 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& value() const& {829 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& value() const& {
832 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");830 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");
833 if (!this->__has_val()) {831 if (!this->__has_val()) {
834 std::__throw_bad_expected_access<_Err>(std::as_const(error()));832 std::__throw_bad_expected_access<_Err>(std::as_const(error()));
...@@ -836,7 +834,7 @@ public:...@@ -836,7 +834,7 @@ public:
836 return this->__val();834 return this->__val();
837 }835 }
838836
839 _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() & {837 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() & {
840 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");838 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");
841 if (!this->__has_val()) {839 if (!this->__has_val()) {
842 std::__throw_bad_expected_access<_Err>(std::as_const(error()));840 std::__throw_bad_expected_access<_Err>(std::as_const(error()));
...@@ -844,7 +842,7 @@ public:...@@ -844,7 +842,7 @@ public:
844 return this->__val();842 return this->__val();
845 }843 }
846844
847 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& value() const&& {845 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& value() const&& {
848 static_assert(is_copy_constructible_v<_Err> && is_constructible_v<_Err, decltype(std::move(error()))>,846 static_assert(is_copy_constructible_v<_Err> && is_constructible_v<_Err, decltype(std::move(error()))>,
849 "error_type has to be both copy constructible and constructible from decltype(std::move(error()))");847 "error_type has to be both copy constructible and constructible from decltype(std::move(error()))");
850 if (!this->__has_val()) {848 if (!this->__has_val()) {
...@@ -853,7 +851,7 @@ public:...@@ -853,7 +851,7 @@ public:
853 return std::move(this->__val());851 return std::move(this->__val());
854 }852 }
855853
856 _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& value() && {854 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& value() && {
857 static_assert(is_copy_constructible_v<_Err> && is_constructible_v<_Err, decltype(std::move(error()))>,855 static_assert(is_copy_constructible_v<_Err> && is_constructible_v<_Err, decltype(std::move(error()))>,
858 "error_type has to be both copy constructible and constructible from decltype(std::move(error()))");856 "error_type has to be both copy constructible and constructible from decltype(std::move(error()))");
859 if (!this->__has_val()) {857 if (!this->__has_val()) {
...@@ -862,46 +860,46 @@ public:...@@ -862,46 +860,46 @@ public:
862 return std::move(this->__val());860 return std::move(this->__val());
863 }861 }
864862
865 _LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept {863 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept {
866 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(864 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
867 !this->__has_val(), "expected::error requires the expected to contain an error");865 !this->__has_val(), "expected::error requires the expected to contain an error");
868 return this->__unex();866 return this->__unex();
869 }867 }
870868
871 _LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept {869 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept {
872 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(870 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
873 !this->__has_val(), "expected::error requires the expected to contain an error");871 !this->__has_val(), "expected::error requires the expected to contain an error");
874 return this->__unex();872 return this->__unex();
875 }873 }
876874
877 _LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept {875 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept {
878 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(876 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
879 !this->__has_val(), "expected::error requires the expected to contain an error");877 !this->__has_val(), "expected::error requires the expected to contain an error");
880 return std::move(this->__unex());878 return std::move(this->__unex());
881 }879 }
882880
883 _LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept {881 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept {
884 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(882 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
885 !this->__has_val(), "expected::error requires the expected to contain an error");883 !this->__has_val(), "expected::error requires the expected to contain an error");
886 return std::move(this->__unex());884 return std::move(this->__unex());
887 }885 }
888886
889 template <class _Up>887 template <class _Up = remove_cv_t<_Tp>>
890 _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) const& {888 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) const& {
891 static_assert(is_copy_constructible_v<_Tp>, "value_type has to be copy constructible");889 static_assert(is_copy_constructible_v<_Tp>, "value_type has to be copy constructible");
892 static_assert(is_convertible_v<_Up, _Tp>, "argument has to be convertible to value_type");890 static_assert(is_convertible_v<_Up, _Tp>, "argument has to be convertible to value_type");
893 return this->__has_val() ? this->__val() : static_cast<_Tp>(std::forward<_Up>(__v));891 return this->__has_val() ? this->__val() : static_cast<_Tp>(std::forward<_Up>(__v));
894 }892 }
895893
896 template <class _Up>894 template <class _Up = remove_cv_t<_Tp>>
897 _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) && {895 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) && {
898 static_assert(is_move_constructible_v<_Tp>, "value_type has to be move constructible");896 static_assert(is_move_constructible_v<_Tp>, "value_type has to be move constructible");
899 static_assert(is_convertible_v<_Up, _Tp>, "argument has to be convertible to value_type");897 static_assert(is_convertible_v<_Up, _Tp>, "argument has to be convertible to value_type");
900 return this->__has_val() ? std::move(this->__val()) : static_cast<_Tp>(std::forward<_Up>(__v));898 return this->__has_val() ? std::move(this->__val()) : static_cast<_Tp>(std::forward<_Up>(__v));
901 }899 }
902900
903 template <class _Up = _Err>901 template <class _Up = _Err>
904 _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) const& {902 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) const& {
905 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");903 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");
906 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");904 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");
907 if (has_value())905 if (has_value())
...@@ -910,7 +908,7 @@ public:...@@ -910,7 +908,7 @@ public:
910 }908 }
911909
912 template <class _Up = _Err>910 template <class _Up = _Err>
913 _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) && {911 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) && {
914 static_assert(is_move_constructible_v<_Err>, "error_type has to be move constructible");912 static_assert(is_move_constructible_v<_Err>, "error_type has to be move constructible");
915 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");913 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");
916 if (has_value())914 if (has_value())
...@@ -921,7 +919,7 @@ public:...@@ -921,7 +919,7 @@ public:
921 // [expected.void.monadic], monadic919 // [expected.void.monadic], monadic
922 template <class _Func>920 template <class _Func>
923 requires is_constructible_v<_Err, _Err&>921 requires is_constructible_v<_Err, _Err&>
924 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {922 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {
925 using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&>>;923 using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&>>;
926 static_assert(__is_std_expected<_Up>::value, "The result of f(value()) must be a specialization of std::expected");924 static_assert(__is_std_expected<_Up>::value, "The result of f(value()) must be a specialization of std::expected");
927 static_assert(is_same_v<typename _Up::error_type, _Err>,925 static_assert(is_same_v<typename _Up::error_type, _Err>,
...@@ -934,7 +932,7 @@ public:...@@ -934,7 +932,7 @@ public:
934932
935 template <class _Func>933 template <class _Func>
936 requires is_constructible_v<_Err, const _Err&>934 requires is_constructible_v<_Err, const _Err&>
937 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {935 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {
938 using _Up = remove_cvref_t<invoke_result_t<_Func, const _Tp&>>;936 using _Up = remove_cvref_t<invoke_result_t<_Func, const _Tp&>>;
939 static_assert(__is_std_expected<_Up>::value, "The result of f(value()) must be a specialization of std::expected");937 static_assert(__is_std_expected<_Up>::value, "The result of f(value()) must be a specialization of std::expected");
940 static_assert(is_same_v<typename _Up::error_type, _Err>,938 static_assert(is_same_v<typename _Up::error_type, _Err>,
...@@ -947,7 +945,7 @@ public:...@@ -947,7 +945,7 @@ public:
947945
948 template <class _Func>946 template <class _Func>
949 requires is_constructible_v<_Err, _Err&&>947 requires is_constructible_v<_Err, _Err&&>
950 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {948 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {
951 using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&&>>;949 using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&&>>;
952 static_assert(950 static_assert(
953 __is_std_expected<_Up>::value, "The result of f(std::move(value())) must be a specialization of std::expected");951 __is_std_expected<_Up>::value, "The result of f(std::move(value())) must be a specialization of std::expected");
...@@ -961,7 +959,7 @@ public:...@@ -961,7 +959,7 @@ public:
961959
962 template <class _Func>960 template <class _Func>
963 requires is_constructible_v<_Err, const _Err&&>961 requires is_constructible_v<_Err, const _Err&&>
964 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {962 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
965 using _Up = remove_cvref_t<invoke_result_t<_Func, const _Tp&&>>;963 using _Up = remove_cvref_t<invoke_result_t<_Func, const _Tp&&>>;
966 static_assert(964 static_assert(
967 __is_std_expected<_Up>::value, "The result of f(std::move(value())) must be a specialization of std::expected");965 __is_std_expected<_Up>::value, "The result of f(std::move(value())) must be a specialization of std::expected");
...@@ -975,7 +973,7 @@ public:...@@ -975,7 +973,7 @@ public:
975973
976 template <class _Func>974 template <class _Func>
977 requires is_constructible_v<_Tp, _Tp&>975 requires is_constructible_v<_Tp, _Tp&>
978 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) & {976 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) & {
979 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&>>;977 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&>>;
980 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");978 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
981 static_assert(is_same_v<typename _Gp::value_type, _Tp>,979 static_assert(is_same_v<typename _Gp::value_type, _Tp>,
...@@ -988,7 +986,7 @@ public:...@@ -988,7 +986,7 @@ public:
988986
989 template <class _Func>987 template <class _Func>
990 requires is_constructible_v<_Tp, const _Tp&>988 requires is_constructible_v<_Tp, const _Tp&>
991 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const& {989 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const& {
992 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&>>;990 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&>>;
993 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");991 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
994 static_assert(is_same_v<typename _Gp::value_type, _Tp>,992 static_assert(is_same_v<typename _Gp::value_type, _Tp>,
...@@ -1001,7 +999,7 @@ public:...@@ -1001,7 +999,7 @@ public:
1001999
1002 template <class _Func>1000 template <class _Func>
1003 requires is_constructible_v<_Tp, _Tp&&>1001 requires is_constructible_v<_Tp, _Tp&&>
1004 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) && {1002 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) && {
1005 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&&>>;1003 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&&>>;
1006 static_assert(1004 static_assert(
1007 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");1005 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
...@@ -1015,7 +1013,7 @@ public:...@@ -1015,7 +1013,7 @@ public:
10151013
1016 template <class _Func>1014 template <class _Func>
1017 requires is_constructible_v<_Tp, const _Tp&&>1015 requires is_constructible_v<_Tp, const _Tp&&>
1018 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const&& {1016 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const&& {
1019 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&&>>;1017 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&&>>;
1020 static_assert(1018 static_assert(
1021 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");1019 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
...@@ -1029,7 +1027,7 @@ public:...@@ -1029,7 +1027,7 @@ public:
10291027
1030 template <class _Func>1028 template <class _Func>
1031 requires is_constructible_v<_Err, _Err&>1029 requires is_constructible_v<_Err, _Err&>
1032 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {1030 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {
1033 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&>>;1031 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&>>;
1034 if (!has_value()) {1032 if (!has_value()) {
1035 return expected<_Up, _Err>(unexpect, error());1033 return expected<_Up, _Err>(unexpect, error());
...@@ -1045,7 +1043,7 @@ public:...@@ -1045,7 +1043,7 @@ public:
10451043
1046 template <class _Func>1044 template <class _Func>
1047 requires is_constructible_v<_Err, const _Err&>1045 requires is_constructible_v<_Err, const _Err&>
1048 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {1046 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {
1049 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&>>;1047 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&>>;
1050 if (!has_value()) {1048 if (!has_value()) {
1051 return expected<_Up, _Err>(unexpect, error());1049 return expected<_Up, _Err>(unexpect, error());
...@@ -1061,7 +1059,7 @@ public:...@@ -1061,7 +1059,7 @@ public:
10611059
1062 template <class _Func>1060 template <class _Func>
1063 requires is_constructible_v<_Err, _Err&&>1061 requires is_constructible_v<_Err, _Err&&>
1064 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {1062 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {
1065 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&&>>;1063 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&&>>;
1066 if (!has_value()) {1064 if (!has_value()) {
1067 return expected<_Up, _Err>(unexpect, std::move(error()));1065 return expected<_Up, _Err>(unexpect, std::move(error()));
...@@ -1077,7 +1075,7 @@ public:...@@ -1077,7 +1075,7 @@ public:
10771075
1078 template <class _Func>1076 template <class _Func>
1079 requires is_constructible_v<_Err, const _Err&&>1077 requires is_constructible_v<_Err, const _Err&&>
1080 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {1078 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {
1081 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&&>>;1079 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&&>>;
1082 if (!has_value()) {1080 if (!has_value()) {
1083 return expected<_Up, _Err>(unexpect, std::move(error()));1081 return expected<_Up, _Err>(unexpect, std::move(error()));
...@@ -1093,7 +1091,7 @@ public:...@@ -1093,7 +1091,7 @@ public:
10931091
1094 template <class _Func>1092 template <class _Func>
1095 requires is_constructible_v<_Tp, _Tp&>1093 requires is_constructible_v<_Tp, _Tp&>
1096 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) & {1094 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) & {
1097 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&>>;1095 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&>>;
1098 static_assert(__valid_std_unexpected<_Gp>::value,1096 static_assert(__valid_std_unexpected<_Gp>::value,
1099 "The result of f(error()) must be a valid template argument for unexpected");1097 "The result of f(error()) must be a valid template argument for unexpected");
...@@ -1105,7 +1103,7 @@ public:...@@ -1105,7 +1103,7 @@ public:
11051103
1106 template <class _Func>1104 template <class _Func>
1107 requires is_constructible_v<_Tp, const _Tp&>1105 requires is_constructible_v<_Tp, const _Tp&>
1108 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const& {1106 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const& {
1109 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&>>;1107 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&>>;
1110 static_assert(__valid_std_unexpected<_Gp>::value,1108 static_assert(__valid_std_unexpected<_Gp>::value,
1111 "The result of f(error()) must be a valid template argument for unexpected");1109 "The result of f(error()) must be a valid template argument for unexpected");
...@@ -1117,7 +1115,7 @@ public:...@@ -1117,7 +1115,7 @@ public:
11171115
1118 template <class _Func>1116 template <class _Func>
1119 requires is_constructible_v<_Tp, _Tp&&>1117 requires is_constructible_v<_Tp, _Tp&&>
1120 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) && {1118 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) && {
1121 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&&>>;1119 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&&>>;
1122 static_assert(__valid_std_unexpected<_Gp>::value,1120 static_assert(__valid_std_unexpected<_Gp>::value,
1123 "The result of f(std::move(error())) must be a valid template argument for unexpected");1121 "The result of f(std::move(error())) must be a valid template argument for unexpected");
...@@ -1130,7 +1128,7 @@ public:...@@ -1130,7 +1128,7 @@ public:
11301128
1131 template <class _Func>1129 template <class _Func>
1132 requires is_constructible_v<_Tp, const _Tp&&>1130 requires is_constructible_v<_Tp, const _Tp&&>
1133 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const&& {1131 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const&& {
1134 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&&>>;1132 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&&>>;
1135 static_assert(__valid_std_unexpected<_Gp>::value,1133 static_assert(__valid_std_unexpected<_Gp>::value,
1136 "The result of f(std::move(error())) must be a valid template argument for unexpected");1134 "The result of f(std::move(error())) must be a valid template argument for unexpected");
...@@ -1597,7 +1595,7 @@ public:...@@ -1597,7 +1595,7 @@ public:
1597 // [expected.void.obs], observers1595 // [expected.void.obs], observers
1598 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return this->__has_val(); }1596 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return this->__has_val(); }
15991597
1600 _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__has_val(); }1598 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__has_val(); }
16011599
1602 _LIBCPP_HIDE_FROM_ABI constexpr void operator*() const noexcept {1600 _LIBCPP_HIDE_FROM_ABI constexpr void operator*() const noexcept {
1603 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(1601 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
...@@ -1618,32 +1616,32 @@ public:...@@ -1618,32 +1616,32 @@ public:
1618 }1616 }
1619 }1617 }
16201618
1621 _LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept {1619 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept {
1622 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(1620 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
1623 !this->__has_val(), "expected::error requires the expected to contain an error");1621 !this->__has_val(), "expected::error requires the expected to contain an error");
1624 return this->__unex();1622 return this->__unex();
1625 }1623 }
16261624
1627 _LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept {1625 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept {
1628 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(1626 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
1629 !this->__has_val(), "expected::error requires the expected to contain an error");1627 !this->__has_val(), "expected::error requires the expected to contain an error");
1630 return this->__unex();1628 return this->__unex();
1631 }1629 }
16321630
1633 _LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept {1631 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept {
1634 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(1632 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
1635 !this->__has_val(), "expected::error requires the expected to contain an error");1633 !this->__has_val(), "expected::error requires the expected to contain an error");
1636 return std::move(this->__unex());1634 return std::move(this->__unex());
1637 }1635 }
16381636
1639 _LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept {1637 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept {
1640 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(1638 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
1641 !this->__has_val(), "expected::error requires the expected to contain an error");1639 !this->__has_val(), "expected::error requires the expected to contain an error");
1642 return std::move(this->__unex());1640 return std::move(this->__unex());
1643 }1641 }
16441642
1645 template <class _Up = _Err>1643 template <class _Up = _Err>
1646 _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) const& {1644 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) const& {
1647 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");1645 static_assert(is_copy_constructible_v<_Err>, "error_type has to be copy constructible");
1648 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");1646 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");
1649 if (has_value()) {1647 if (has_value()) {
...@@ -1653,7 +1651,7 @@ public:...@@ -1653,7 +1651,7 @@ public:
1653 }1651 }
16541652
1655 template <class _Up = _Err>1653 template <class _Up = _Err>
1656 _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) && {1654 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err error_or(_Up&& __error) && {
1657 static_assert(is_move_constructible_v<_Err>, "error_type has to be move constructible");1655 static_assert(is_move_constructible_v<_Err>, "error_type has to be move constructible");
1658 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");1656 static_assert(is_convertible_v<_Up, _Err>, "argument has to be convertible to error_type");
1659 if (has_value()) {1657 if (has_value()) {
...@@ -1665,7 +1663,7 @@ public:...@@ -1665,7 +1663,7 @@ public:
1665 // [expected.void.monadic], monadic1663 // [expected.void.monadic], monadic
1666 template <class _Func>1664 template <class _Func>
1667 requires is_constructible_v<_Err, _Err&>1665 requires is_constructible_v<_Err, _Err&>
1668 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {1666 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {
1669 using _Up = remove_cvref_t<invoke_result_t<_Func>>;1667 using _Up = remove_cvref_t<invoke_result_t<_Func>>;
1670 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");1668 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
1671 static_assert(1669 static_assert(
...@@ -1678,7 +1676,7 @@ public:...@@ -1678,7 +1676,7 @@ public:
16781676
1679 template <class _Func>1677 template <class _Func>
1680 requires is_constructible_v<_Err, const _Err&>1678 requires is_constructible_v<_Err, const _Err&>
1681 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {1679 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {
1682 using _Up = remove_cvref_t<invoke_result_t<_Func>>;1680 using _Up = remove_cvref_t<invoke_result_t<_Func>>;
1683 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");1681 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
1684 static_assert(1682 static_assert(
...@@ -1691,7 +1689,7 @@ public:...@@ -1691,7 +1689,7 @@ public:
16911689
1692 template <class _Func>1690 template <class _Func>
1693 requires is_constructible_v<_Err, _Err&&>1691 requires is_constructible_v<_Err, _Err&&>
1694 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {1692 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {
1695 using _Up = remove_cvref_t<invoke_result_t<_Func>>;1693 using _Up = remove_cvref_t<invoke_result_t<_Func>>;
1696 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");1694 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
1697 static_assert(1695 static_assert(
...@@ -1704,7 +1702,7 @@ public:...@@ -1704,7 +1702,7 @@ public:
17041702
1705 template <class _Func>1703 template <class _Func>
1706 requires is_constructible_v<_Err, const _Err&&>1704 requires is_constructible_v<_Err, const _Err&&>
1707 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {1705 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
1708 using _Up = remove_cvref_t<invoke_result_t<_Func>>;1706 using _Up = remove_cvref_t<invoke_result_t<_Func>>;
1709 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");1707 static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
1710 static_assert(1708 static_assert(
...@@ -1716,7 +1714,7 @@ public:...@@ -1716,7 +1714,7 @@ public:
1716 }1714 }
17171715
1718 template <class _Func>1716 template <class _Func>
1719 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) & {1717 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) & {
1720 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&>>;1718 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&>>;
1721 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");1719 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
1722 static_assert(is_same_v<typename _Gp::value_type, _Tp>,1720 static_assert(is_same_v<typename _Gp::value_type, _Tp>,
...@@ -1728,7 +1726,7 @@ public:...@@ -1728,7 +1726,7 @@ public:
1728 }1726 }
17291727
1730 template <class _Func>1728 template <class _Func>
1731 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const& {1729 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const& {
1732 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&>>;1730 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&>>;
1733 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");1731 static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
1734 static_assert(is_same_v<typename _Gp::value_type, _Tp>,1732 static_assert(is_same_v<typename _Gp::value_type, _Tp>,
...@@ -1740,7 +1738,7 @@ public:...@@ -1740,7 +1738,7 @@ public:
1740 }1738 }
17411739
1742 template <class _Func>1740 template <class _Func>
1743 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) && {1741 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) && {
1744 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&&>>;1742 using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&&>>;
1745 static_assert(1743 static_assert(
1746 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");1744 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
...@@ -1753,7 +1751,7 @@ public:...@@ -1753,7 +1751,7 @@ public:
1753 }1751 }
17541752
1755 template <class _Func>1753 template <class _Func>
1756 _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const&& {1754 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const&& {
1757 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&&>>;1755 using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&&>>;
1758 static_assert(1756 static_assert(
1759 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");1757 __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
...@@ -1767,7 +1765,7 @@ public:...@@ -1767,7 +1765,7 @@ public:
17671765
1768 template <class _Func>1766 template <class _Func>
1769 requires is_constructible_v<_Err, _Err&>1767 requires is_constructible_v<_Err, _Err&>
1770 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {1768 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {
1771 using _Up = remove_cv_t<invoke_result_t<_Func>>;1769 using _Up = remove_cv_t<invoke_result_t<_Func>>;
1772 if (!has_value()) {1770 if (!has_value()) {
1773 return expected<_Up, _Err>(unexpect, error());1771 return expected<_Up, _Err>(unexpect, error());
...@@ -1782,7 +1780,7 @@ public:...@@ -1782,7 +1780,7 @@ public:
17821780
1783 template <class _Func>1781 template <class _Func>
1784 requires is_constructible_v<_Err, const _Err&>1782 requires is_constructible_v<_Err, const _Err&>
1785 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {1783 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {
1786 using _Up = remove_cv_t<invoke_result_t<_Func>>;1784 using _Up = remove_cv_t<invoke_result_t<_Func>>;
1787 if (!has_value()) {1785 if (!has_value()) {
1788 return expected<_Up, _Err>(unexpect, error());1786 return expected<_Up, _Err>(unexpect, error());
...@@ -1797,7 +1795,7 @@ public:...@@ -1797,7 +1795,7 @@ public:
17971795
1798 template <class _Func>1796 template <class _Func>
1799 requires is_constructible_v<_Err, _Err&&>1797 requires is_constructible_v<_Err, _Err&&>
1800 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {1798 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {
1801 using _Up = remove_cv_t<invoke_result_t<_Func>>;1799 using _Up = remove_cv_t<invoke_result_t<_Func>>;
1802 if (!has_value()) {1800 if (!has_value()) {
1803 return expected<_Up, _Err>(unexpect, std::move(error()));1801 return expected<_Up, _Err>(unexpect, std::move(error()));
...@@ -1812,7 +1810,7 @@ public:...@@ -1812,7 +1810,7 @@ public:
18121810
1813 template <class _Func>1811 template <class _Func>
1814 requires is_constructible_v<_Err, const _Err&&>1812 requires is_constructible_v<_Err, const _Err&&>
1815 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {1813 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {
1816 using _Up = remove_cv_t<invoke_result_t<_Func>>;1814 using _Up = remove_cv_t<invoke_result_t<_Func>>;
1817 if (!has_value()) {1815 if (!has_value()) {
1818 return expected<_Up, _Err>(unexpect, std::move(error()));1816 return expected<_Up, _Err>(unexpect, std::move(error()));
...@@ -1826,7 +1824,7 @@ public:...@@ -1826,7 +1824,7 @@ public:
1826 }1824 }
18271825
1828 template <class _Func>1826 template <class _Func>
1829 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) & {1827 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) & {
1830 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&>>;1828 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&>>;
1831 static_assert(__valid_std_unexpected<_Gp>::value,1829 static_assert(__valid_std_unexpected<_Gp>::value,
1832 "The result of f(error()) must be a valid template argument for unexpected");1830 "The result of f(error()) must be a valid template argument for unexpected");
...@@ -1837,7 +1835,7 @@ public:...@@ -1837,7 +1835,7 @@ public:
1837 }1835 }
18381836
1839 template <class _Func>1837 template <class _Func>
1840 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const& {1838 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const& {
1841 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&>>;1839 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&>>;
1842 static_assert(__valid_std_unexpected<_Gp>::value,1840 static_assert(__valid_std_unexpected<_Gp>::value,
1843 "The result of f(error()) must be a valid template argument for unexpected");1841 "The result of f(error()) must be a valid template argument for unexpected");
...@@ -1848,7 +1846,7 @@ public:...@@ -1848,7 +1846,7 @@ public:
1848 }1846 }
18491847
1850 template <class _Func>1848 template <class _Func>
1851 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) && {1849 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) && {
1852 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&&>>;1850 using _Gp = remove_cv_t<invoke_result_t<_Func, _Err&&>>;
1853 static_assert(__valid_std_unexpected<_Gp>::value,1851 static_assert(__valid_std_unexpected<_Gp>::value,
1854 "The result of f(std::move(error())) must be a valid template argument for unexpected");1852 "The result of f(std::move(error())) must be a valid template argument for unexpected");
...@@ -1860,7 +1858,7 @@ public:...@@ -1860,7 +1858,7 @@ public:
1860 }1858 }
18611859
1862 template <class _Func>1860 template <class _Func>
1863 _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const&& {1861 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform_error(_Func&& __f) const&& {
1864 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&&>>;1862 using _Gp = remove_cv_t<invoke_result_t<_Func, const _Err&&>>;
1865 static_assert(__valid_std_unexpected<_Gp>::value,1863 static_assert(__valid_std_unexpected<_Gp>::value,
1866 "The result of f(std::move(error())) must be a valid template argument for unexpected");1864 "The result of f(std::move(error())) must be a valid template argument for unexpected");
lib/libcxx/include/__expected/unexpected.h+4-4
...@@ -89,10 +89,10 @@ public:...@@ -89,10 +89,10 @@ public:
89 _LIBCPP_HIDE_FROM_ABI constexpr unexpected& operator=(const unexpected&) = default;89 _LIBCPP_HIDE_FROM_ABI constexpr unexpected& operator=(const unexpected&) = default;
90 _LIBCPP_HIDE_FROM_ABI constexpr unexpected& operator=(unexpected&&) = default;90 _LIBCPP_HIDE_FROM_ABI constexpr unexpected& operator=(unexpected&&) = default;
9191
92 _LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept { return __unex_; }92 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept { return __unex_; }
93 _LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept { return __unex_; }93 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept { return __unex_; }
94 _LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept { return std::move(__unex_); }94 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept { return std::move(__unex_); }
95 _LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept { return std::move(__unex_); }95 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept { return std::move(__unex_); }
9696
97 _LIBCPP_HIDE_FROM_ABI constexpr void swap(unexpected& __other) noexcept(is_nothrow_swappable_v<_Err>) {97 _LIBCPP_HIDE_FROM_ABI constexpr void swap(unexpected& __other) noexcept(is_nothrow_swappable_v<_Err>) {
98 static_assert(is_swappable_v<_Err>, "unexpected::swap requires is_swappable_v<E> to be true");98 static_assert(is_swappable_v<_Err>, "unexpected::swap requires is_swappable_v<E> to be true");
lib/libcxx/include/__filesystem/copy_options.h+4-4
...@@ -34,19 +34,19 @@ enum class copy_options : unsigned short {...@@ -34,19 +34,19 @@ enum class copy_options : unsigned short {
34 __in_recursive_copy = 512,34 __in_recursive_copy = 512,
35};35};
3636
37_LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator&(copy_options __lhs, copy_options __rhs) {37[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator&(copy_options __lhs, copy_options __rhs) {
38 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) & static_cast<unsigned short>(__rhs));38 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) & static_cast<unsigned short>(__rhs));
39}39}
4040
41_LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator|(copy_options __lhs, copy_options __rhs) {41[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator|(copy_options __lhs, copy_options __rhs) {
42 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) | static_cast<unsigned short>(__rhs));42 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) | static_cast<unsigned short>(__rhs));
43}43}
4444
45_LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator^(copy_options __lhs, copy_options __rhs) {45[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator^(copy_options __lhs, copy_options __rhs) {
46 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) ^ static_cast<unsigned short>(__rhs));46 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) ^ static_cast<unsigned short>(__rhs));
47}47}
4848
49_LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator~(copy_options __lhs) {49[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator~(copy_options __lhs) {
50 return static_cast<copy_options>(~static_cast<unsigned short>(__lhs));50 return static_cast<copy_options>(~static_cast<unsigned short>(__lhs));
51}51}
5252
lib/libcxx/include/__filesystem/directory_entry.h+37-33
...@@ -40,8 +40,6 @@ _LIBCPP_PUSH_MACROS...@@ -40,8 +40,6 @@ _LIBCPP_PUSH_MACROS
4040
41_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM41_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
4242
43_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
44
45class directory_entry {43class directory_entry {
46 typedef filesystem::path _Path;44 typedef filesystem::path _Path;
4745
...@@ -89,80 +87,88 @@ public:...@@ -89,80 +87,88 @@ public:
8987
90 _LIBCPP_HIDE_FROM_ABI void refresh(error_code& __ec) noexcept { __refresh(&__ec); }88 _LIBCPP_HIDE_FROM_ABI void refresh(error_code& __ec) noexcept { __refresh(&__ec); }
9189
92 _LIBCPP_HIDE_FROM_ABI _Path const& path() const noexcept { return __p_; }90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Path const& path() const noexcept { return __p_; }
9391
94 _LIBCPP_HIDE_FROM_ABI operator const _Path&() const noexcept { return __p_; }92 _LIBCPP_HIDE_FROM_ABI operator const _Path&() const noexcept { return __p_; }
9593
96 _LIBCPP_HIDE_FROM_ABI bool exists() const { return filesystem::exists(file_status{__get_ft()}); }94 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool exists() const { return filesystem::exists(file_status{__get_ft()}); }
9795
98 _LIBCPP_HIDE_FROM_ABI bool exists(error_code& __ec) const noexcept {96 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool exists(error_code& __ec) const noexcept {
99 return filesystem::exists(file_status{__get_ft(&__ec)});97 return filesystem::exists(file_status{__get_ft(&__ec)});
100 }98 }
10199
102 _LIBCPP_HIDE_FROM_ABI bool is_block_file() const { return __get_ft() == file_type::block; }100 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_block_file() const { return __get_ft() == file_type::block; }
103101
104 _LIBCPP_HIDE_FROM_ABI bool is_block_file(error_code& __ec) const noexcept {102 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_block_file(error_code& __ec) const noexcept {
105 return __get_ft(&__ec) == file_type::block;103 return __get_ft(&__ec) == file_type::block;
106 }104 }
107105
108 _LIBCPP_HIDE_FROM_ABI bool is_character_file() const { return __get_ft() == file_type::character; }106 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_character_file() const { return __get_ft() == file_type::character; }
109107
110 _LIBCPP_HIDE_FROM_ABI bool is_character_file(error_code& __ec) const noexcept {108 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_character_file(error_code& __ec) const noexcept {
111 return __get_ft(&__ec) == file_type::character;109 return __get_ft(&__ec) == file_type::character;
112 }110 }
113111
114 _LIBCPP_HIDE_FROM_ABI bool is_directory() const { return __get_ft() == file_type::directory; }112 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_directory() const { return __get_ft() == file_type::directory; }
115113
116 _LIBCPP_HIDE_FROM_ABI bool is_directory(error_code& __ec) const noexcept {114 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_directory(error_code& __ec) const noexcept {
117 return __get_ft(&__ec) == file_type::directory;115 return __get_ft(&__ec) == file_type::directory;
118 }116 }
119117
120 _LIBCPP_HIDE_FROM_ABI bool is_fifo() const { return __get_ft() == file_type::fifo; }118 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_fifo() const { return __get_ft() == file_type::fifo; }
121119
122 _LIBCPP_HIDE_FROM_ABI bool is_fifo(error_code& __ec) const noexcept { return __get_ft(&__ec) == file_type::fifo; }120 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_fifo(error_code& __ec) const noexcept {
121 return __get_ft(&__ec) == file_type::fifo;
122 }
123123
124 _LIBCPP_HIDE_FROM_ABI bool is_other() const { return filesystem::is_other(file_status{__get_ft()}); }124 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_other() const { return filesystem::is_other(file_status{__get_ft()}); }
125125
126 _LIBCPP_HIDE_FROM_ABI bool is_other(error_code& __ec) const noexcept {126 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_other(error_code& __ec) const noexcept {
127 return filesystem::is_other(file_status{__get_ft(&__ec)});127 return filesystem::is_other(file_status{__get_ft(&__ec)});
128 }128 }
129129
130 _LIBCPP_HIDE_FROM_ABI bool is_regular_file() const { return __get_ft() == file_type::regular; }130 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_regular_file() const { return __get_ft() == file_type::regular; }
131131
132 _LIBCPP_HIDE_FROM_ABI bool is_regular_file(error_code& __ec) const noexcept {132 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_regular_file(error_code& __ec) const noexcept {
133 return __get_ft(&__ec) == file_type::regular;133 return __get_ft(&__ec) == file_type::regular;
134 }134 }
135135
136 _LIBCPP_HIDE_FROM_ABI bool is_socket() const { return __get_ft() == file_type::socket; }136 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_socket() const { return __get_ft() == file_type::socket; }
137137
138 _LIBCPP_HIDE_FROM_ABI bool is_socket(error_code& __ec) const noexcept { return __get_ft(&__ec) == file_type::socket; }138 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_socket(error_code& __ec) const noexcept {
139 return __get_ft(&__ec) == file_type::socket;
140 }
139141
140 _LIBCPP_HIDE_FROM_ABI bool is_symlink() const { return __get_sym_ft() == file_type::symlink; }142 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_symlink() const { return __get_sym_ft() == file_type::symlink; }
141143
142 _LIBCPP_HIDE_FROM_ABI bool is_symlink(error_code& __ec) const noexcept {144 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_symlink(error_code& __ec) const noexcept {
143 return __get_sym_ft(&__ec) == file_type::symlink;145 return __get_sym_ft(&__ec) == file_type::symlink;
144 }146 }
145 _LIBCPP_HIDE_FROM_ABI uintmax_t file_size() const { return __get_size(); }147 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI uintmax_t file_size() const { return __get_size(); }
146148
147 _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(error_code& __ec) const noexcept { return __get_size(&__ec); }149 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(error_code& __ec) const noexcept { return __get_size(&__ec); }
148150
149 _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count() const { return __get_nlink(); }151 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count() const { return __get_nlink(); }
150152
151 _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(error_code& __ec) const noexcept { return __get_nlink(&__ec); }153 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(error_code& __ec) const noexcept {
154 return __get_nlink(&__ec);
155 }
152156
153 _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time() const { return __get_write_time(); }157 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time() const { return __get_write_time(); }
154158
155 _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(error_code& __ec) const noexcept {159 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(error_code& __ec) const noexcept {
156 return __get_write_time(&__ec);160 return __get_write_time(&__ec);
157 }161 }
158162
159 _LIBCPP_HIDE_FROM_ABI file_status status() const { return __get_status(); }163 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_status status() const { return __get_status(); }
160164
161 _LIBCPP_HIDE_FROM_ABI file_status status(error_code& __ec) const noexcept { return __get_status(&__ec); }165 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_status status(error_code& __ec) const noexcept {
166 return __get_status(&__ec);
167 }
162168
163 _LIBCPP_HIDE_FROM_ABI file_status symlink_status() const { return __get_symlink_status(); }169 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_status symlink_status() const { return __get_symlink_status(); }
164170
165 _LIBCPP_HIDE_FROM_ABI file_status symlink_status(error_code& __ec) const noexcept {171 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_status symlink_status(error_code& __ec) const noexcept {
166 return __get_symlink_status(&__ec);172 return __get_symlink_status(&__ec);
167 }173 }
168174
...@@ -459,8 +465,6 @@ private:...@@ -459,8 +465,6 @@ private:
459 directory_entry __elem_;465 directory_entry __elem_;
460};466};
461467
462_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
463
464_LIBCPP_END_NAMESPACE_FILESYSTEM468_LIBCPP_END_NAMESPACE_FILESYSTEM
465469
466#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM470#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
lib/libcxx/include/__filesystem/directory_iterator.h+9-11
...@@ -34,8 +34,6 @@ _LIBCPP_PUSH_MACROS...@@ -34,8 +34,6 @@ _LIBCPP_PUSH_MACROS
3434
35_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM35_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
3636
37_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
38
39class _LIBCPP_HIDDEN __dir_stream;37class _LIBCPP_HIDDEN __dir_stream;
40class directory_iterator {38class directory_iterator {
41public:39public:
...@@ -73,7 +71,7 @@ public:...@@ -73,7 +71,7 @@ public:
7371
74 _LIBCPP_HIDE_FROM_ABI ~directory_iterator() = default;72 _LIBCPP_HIDE_FROM_ABI ~directory_iterator() = default;
7573
76 _LIBCPP_HIDE_FROM_ABI const directory_entry& operator*() const {74 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const directory_entry& operator*() const {
77 // Note: this check duplicates a check in `__dereference()`.75 // Note: this check duplicates a check in `__dereference()`.
78 _LIBCPP_ASSERT_NON_NULL(__imp_, "The end iterator cannot be dereferenced");76 _LIBCPP_ASSERT_NON_NULL(__imp_, "The end iterator cannot be dereferenced");
79 return __dereference();77 return __dereference();
...@@ -123,23 +121,23 @@ operator!=(const directory_iterator& __lhs, const directory_iterator& __rhs) noe...@@ -123,23 +121,23 @@ operator!=(const directory_iterator& __lhs, const directory_iterator& __rhs) noe
123}121}
124122
125// enable directory_iterator range-based for statements123// enable directory_iterator range-based for statements
126inline _LIBCPP_HIDE_FROM_ABI directory_iterator begin(directory_iterator __iter) noexcept { return __iter; }124[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI directory_iterator begin(directory_iterator __iter) noexcept {
127125 return __iter;
128inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept { return directory_iterator(); }126}
129127
130_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP128[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept {
129 return directory_iterator();
130}
131131
132_LIBCPP_END_NAMESPACE_FILESYSTEM132_LIBCPP_END_NAMESPACE_FILESYSTEM
133133
134# if _LIBCPP_STD_VER >= 20134# if _LIBCPP_STD_VER >= 20
135135
136template <>136template <>
137_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY inline constexpr bool137inline constexpr bool std::ranges::enable_borrowed_range<std::filesystem::directory_iterator> = true;
138 std::ranges::enable_borrowed_range<std::filesystem::directory_iterator> = true;
139138
140template <>139template <>
141_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY inline constexpr bool140inline constexpr bool std::ranges::enable_view<std::filesystem::directory_iterator> = true;
142 std::ranges::enable_view<std::filesystem::directory_iterator> = true;
143141
144# endif // _LIBCPP_STD_VER >= 20142# endif // _LIBCPP_STD_VER >= 20
145143
lib/libcxx/include/__filesystem/directory_options.h+7-4
...@@ -22,19 +22,22 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM...@@ -22,19 +22,22 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2222
23enum class directory_options : unsigned char { none = 0, follow_directory_symlink = 1, skip_permission_denied = 2 };23enum class directory_options : unsigned char { none = 0, follow_directory_symlink = 1, skip_permission_denied = 2 };
2424
25_LIBCPP_HIDE_FROM_ABI inline constexpr directory_options operator&(directory_options __lhs, directory_options __rhs) {25[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr directory_options
26operator&(directory_options __lhs, directory_options __rhs) {
26 return static_cast<directory_options>(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs));27 return static_cast<directory_options>(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs));
27}28}
2829
29_LIBCPP_HIDE_FROM_ABI inline constexpr directory_options operator|(directory_options __lhs, directory_options __rhs) {30[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr directory_options
31operator|(directory_options __lhs, directory_options __rhs) {
30 return static_cast<directory_options>(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs));32 return static_cast<directory_options>(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs));
31}33}
3234
33_LIBCPP_HIDE_FROM_ABI inline constexpr directory_options operator^(directory_options __lhs, directory_options __rhs) {35[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr directory_options
36operator^(directory_options __lhs, directory_options __rhs) {
34 return static_cast<directory_options>(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs));37 return static_cast<directory_options>(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs));
35}38}
3639
37_LIBCPP_HIDE_FROM_ABI inline constexpr directory_options operator~(directory_options __lhs) {40[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr directory_options operator~(directory_options __lhs) {
38 return static_cast<directory_options>(~static_cast<unsigned char>(__lhs));41 return static_cast<directory_options>(~static_cast<unsigned char>(__lhs));
39}42}
4043
lib/libcxx/include/__filesystem/file_status.h+3-3
...@@ -22,7 +22,7 @@...@@ -22,7 +22,7 @@
2222
23_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM23_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2424
25class _LIBCPP_EXPORTED_FROM_ABI file_status {25class file_status {
26public:26public:
27 // constructors27 // constructors
28 _LIBCPP_HIDE_FROM_ABI file_status() noexcept : file_status(file_type::none) {}28 _LIBCPP_HIDE_FROM_ABI file_status() noexcept : file_status(file_type::none) {}
...@@ -38,9 +38,9 @@ public:...@@ -38,9 +38,9 @@ public:
38 _LIBCPP_HIDE_FROM_ABI file_status& operator=(file_status&&) noexcept = default;38 _LIBCPP_HIDE_FROM_ABI file_status& operator=(file_status&&) noexcept = default;
3939
40 // observers40 // observers
41 _LIBCPP_HIDE_FROM_ABI file_type type() const noexcept { return __ft_; }41 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI file_type type() const noexcept { return __ft_; }
4242
43 _LIBCPP_HIDE_FROM_ABI perms permissions() const noexcept { return __prms_; }43 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI perms permissions() const noexcept { return __prms_; }
4444
45 // modifiers45 // modifiers
46 _LIBCPP_HIDE_FROM_ABI void type(file_type __ft) noexcept { __ft_ = __ft; }46 _LIBCPP_HIDE_FROM_ABI void type(file_type __ft) noexcept { __ft_ = __ft; }
lib/libcxx/include/__filesystem/filesystem_error.h+9-10
...@@ -27,7 +27,7 @@...@@ -27,7 +27,7 @@
2727
28_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM28_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2929
30class _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {30class _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {
31public:31public:
32 _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, error_code __ec)32 _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, error_code __ec)
33 : system_error(__ec, __what), __storage_(make_shared<_Storage>(path(), path())) {33 : system_error(__ec, __what), __storage_(make_shared<_Storage>(path(), path())) {
...@@ -44,15 +44,16 @@ public:...@@ -44,15 +44,16 @@ public:
44 __create_what(2);44 __create_what(2);
45 }45 }
4646
47 _LIBCPP_HIDE_FROM_ABI const path& path1() const noexcept { return __storage_->__p1_; }47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const path& path1() const noexcept { return __storage_->__p1_; }
4848
49 _LIBCPP_HIDE_FROM_ABI const path& path2() const noexcept { return __storage_->__p2_; }49 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const path& path2() const noexcept { return __storage_->__p2_; }
5050
51 _LIBCPP_HIDE_FROM_ABI filesystem_error(const filesystem_error&) = default;51 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI filesystem_error(const filesystem_error&) = default;
52 ~filesystem_error() override; // key function52 ~filesystem_error() override; // key function
5353
54 _LIBCPP_HIDE_FROM_ABI_VIRTUAL54 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const noexcept override {
55 const char* what() const noexcept override { return __storage_->__what_.c_str(); }55 return __storage_->__what_.c_str();
56 }
5657
57 void __create_what(int __num_paths);58 void __create_what(int __num_paths);
5859
...@@ -69,14 +70,12 @@ private:...@@ -69,14 +70,12 @@ private:
6970
70# if _LIBCPP_HAS_EXCEPTIONS71# if _LIBCPP_HAS_EXCEPTIONS
71template <class... _Args>72template <class... _Args>
72[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void73[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_filesystem_error(_Args&&... __args) {
73__throw_filesystem_error(_Args&&... __args) {
74 throw filesystem_error(std::forward<_Args>(__args)...);74 throw filesystem_error(std::forward<_Args>(__args)...);
75}75}
76# else76# else
77template <class... _Args>77template <class... _Args>
78[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void78[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_filesystem_error(_Args&&...) {
79__throw_filesystem_error(_Args&&...) {
80 _LIBCPP_VERBOSE_ABORT("filesystem_error was thrown in -fno-exceptions mode");79 _LIBCPP_VERBOSE_ABORT("filesystem_error was thrown in -fno-exceptions mode");
81}80}
82# endif81# endif
lib/libcxx/include/__filesystem/operations.h+97-66
...@@ -31,8 +31,6 @@...@@ -31,8 +31,6 @@
3131
32_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM32_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
3333
34_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
35
36_LIBCPP_EXPORTED_FROM_ABI path __absolute(const path&, error_code* __ec = nullptr);34_LIBCPP_EXPORTED_FROM_ABI path __absolute(const path&, error_code* __ec = nullptr);
37_LIBCPP_EXPORTED_FROM_ABI path __canonical(const path&, error_code* __ec = nullptr);35_LIBCPP_EXPORTED_FROM_ABI path __canonical(const path&, error_code* __ec = nullptr);
38_LIBCPP_EXPORTED_FROM_ABI bool36_LIBCPP_EXPORTED_FROM_ABI bool
...@@ -70,10 +68,14 @@ _LIBCPP_EXPORTED_FROM_ABI bool __fs_is_empty(const path& __p, error_code* __ec =...@@ -70,10 +68,14 @@ _LIBCPP_EXPORTED_FROM_ABI bool __fs_is_empty(const path& __p, error_code* __ec =
70_LIBCPP_EXPORTED_FROM_ABI void __permissions(const path&, perms, perm_options, error_code* = nullptr);68_LIBCPP_EXPORTED_FROM_ABI void __permissions(const path&, perms, perm_options, error_code* = nullptr);
71_LIBCPP_EXPORTED_FROM_ABI space_info __space(const path&, error_code* __ec = nullptr);69_LIBCPP_EXPORTED_FROM_ABI space_info __space(const path&, error_code* __ec = nullptr);
7270
73inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }71[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }
74inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) { return __absolute(__p, &__ec); }72[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) {
75inline _LIBCPP_HIDE_FROM_ABI path canonical(const path& __p) { return __canonical(__p); }73 return __absolute(__p, &__ec);
76inline _LIBCPP_HIDE_FROM_ABI path canonical(const path& __p, error_code& __ec) { return __canonical(__p, &__ec); }74}
75[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path canonical(const path& __p) { return __canonical(__p); }
76[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path canonical(const path& __p, error_code& __ec) {
77 return __canonical(__p, &__ec);
78}
77inline _LIBCPP_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to) {79inline _LIBCPP_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to) {
78 return __copy_file(__from, __to, copy_options::none);80 return __copy_file(__from, __to, copy_options::none);
79}81}
...@@ -137,85 +139,112 @@ inline _LIBCPP_HIDE_FROM_ABI void create_symlink(const path& __target, const pat...@@ -137,85 +139,112 @@ inline _LIBCPP_HIDE_FROM_ABI void create_symlink(const path& __target, const pat
137inline _LIBCPP_HIDE_FROM_ABI void create_symlink(const path& __target, const path& __link, error_code& __ec) noexcept {139inline _LIBCPP_HIDE_FROM_ABI void create_symlink(const path& __target, const path& __link, error_code& __ec) noexcept {
138 return __create_symlink(__target, __link, &__ec);140 return __create_symlink(__target, __link, &__ec);
139}141}
140inline _LIBCPP_HIDE_FROM_ABI path current_path() { return __current_path(); }142[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path current_path() { return __current_path(); }
141inline _LIBCPP_HIDE_FROM_ABI path current_path(error_code& __ec) { return __current_path(&__ec); }143[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path current_path(error_code& __ec) { return __current_path(&__ec); }
142inline _LIBCPP_HIDE_FROM_ABI void current_path(const path& __p) { __current_path(__p); }144inline _LIBCPP_HIDE_FROM_ABI void current_path(const path& __p) { __current_path(__p); }
143inline _LIBCPP_HIDE_FROM_ABI void current_path(const path& __p, error_code& __ec) noexcept {145inline _LIBCPP_HIDE_FROM_ABI void current_path(const path& __p, error_code& __ec) noexcept {
144 __current_path(__p, &__ec);146 __current_path(__p, &__ec);
145}147}
146inline _LIBCPP_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2) { return __equivalent(__p1, __p2); }148[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2) {
147inline _LIBCPP_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept {149 return __equivalent(__p1, __p2);
150}
151[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool
152equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept {
148 return __equivalent(__p1, __p2, &__ec);153 return __equivalent(__p1, __p2, &__ec);
149}154}
150inline _LIBCPP_HIDE_FROM_ABI bool status_known(file_status __s) noexcept { return __s.type() != file_type::none; }155[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool status_known(file_status __s) noexcept {
151inline _LIBCPP_HIDE_FROM_ABI bool exists(file_status __s) noexcept {156 return __s.type() != file_type::none;
157}
158[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool exists(file_status __s) noexcept {
152 return status_known(__s) && __s.type() != file_type::not_found;159 return status_known(__s) && __s.type() != file_type::not_found;
153}160}
154inline _LIBCPP_HIDE_FROM_ABI bool exists(const path& __p) { return exists(__status(__p)); }161[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool exists(const path& __p) { return exists(__status(__p)); }
155162
156inline _LIBCPP_HIDE_FROM_ABI bool exists(const path& __p, error_code& __ec) noexcept {163[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool exists(const path& __p, error_code& __ec) noexcept {
157 auto __s = __status(__p, &__ec);164 auto __s = __status(__p, &__ec);
158 if (status_known(__s))165 if (status_known(__s))
159 __ec.clear();166 __ec.clear();
160 return exists(__s);167 return exists(__s);
161}168}
162169
163inline _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(const path& __p) { return __file_size(__p); }170[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(const path& __p) { return __file_size(__p); }
164inline _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(const path& __p, error_code& __ec) noexcept {171[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(const path& __p, error_code& __ec) noexcept {
165 return __file_size(__p, &__ec);172 return __file_size(__p, &__ec);
166}173}
167inline _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p) { return __hard_link_count(__p); }174[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p) { return __hard_link_count(__p); }
168inline _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p, error_code& __ec) noexcept {175[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p, error_code& __ec) noexcept {
169 return __hard_link_count(__p, &__ec);176 return __hard_link_count(__p, &__ec);
170}177}
171inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(file_status __s) noexcept { return __s.type() == file_type::block; }178[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(file_status __s) noexcept {
172inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(const path& __p) { return is_block_file(__status(__p)); }179 return __s.type() == file_type::block;
173inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(const path& __p, error_code& __ec) noexcept {180}
181[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(const path& __p) { return is_block_file(__status(__p)); }
182[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(const path& __p, error_code& __ec) noexcept {
174 return is_block_file(__status(__p, &__ec));183 return is_block_file(__status(__p, &__ec));
175}184}
176inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(file_status __s) noexcept {185[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(file_status __s) noexcept {
177 return __s.type() == file_type::character;186 return __s.type() == file_type::character;
178}187}
179inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p) { return is_character_file(__status(__p)); }188[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p) {
180inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p, error_code& __ec) noexcept {189 return is_character_file(__status(__p));
190}
191[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p, error_code& __ec) noexcept {
181 return is_character_file(__status(__p, &__ec));192 return is_character_file(__status(__p, &__ec));
182}193}
183inline _LIBCPP_HIDE_FROM_ABI bool is_directory(file_status __s) noexcept { return __s.type() == file_type::directory; }194[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_directory(file_status __s) noexcept {
184inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p) { return is_directory(__status(__p)); }195 return __s.type() == file_type::directory;
185inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p, error_code& __ec) noexcept {196}
197[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p) { return is_directory(__status(__p)); }
198[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p, error_code& __ec) noexcept {
186 return is_directory(__status(__p, &__ec));199 return is_directory(__status(__p, &__ec));
187}200}
188inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p) { return __fs_is_empty(__p); }201[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p) { return __fs_is_empty(__p); }
189inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p, error_code& __ec) { return __fs_is_empty(__p, &__ec); }202[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p, error_code& __ec) {
190inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(file_status __s) noexcept { return __s.type() == file_type::fifo; }203 return __fs_is_empty(__p, &__ec);
191inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(const path& __p) { return is_fifo(__status(__p)); }204}
192inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(const path& __p, error_code& __ec) noexcept {205[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(file_status __s) noexcept {
206 return __s.type() == file_type::fifo;
207}
208[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(const path& __p) { return is_fifo(__status(__p)); }
209[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(const path& __p, error_code& __ec) noexcept {
193 return is_fifo(__status(__p, &__ec));210 return is_fifo(__status(__p, &__ec));
194}211}
195inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(file_status __s) noexcept { return __s.type() == file_type::regular; }212[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(file_status __s) noexcept {
196inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(const path& __p) { return is_regular_file(__status(__p)); }213 return __s.type() == file_type::regular;
197inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(const path& __p, error_code& __ec) noexcept {214}
215[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(const path& __p) {
216 return is_regular_file(__status(__p));
217}
218[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(const path& __p, error_code& __ec) noexcept {
198 return is_regular_file(__status(__p, &__ec));219 return is_regular_file(__status(__p, &__ec));
199}220}
200inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(file_status __s) noexcept { return __s.type() == file_type::symlink; }221[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(file_status __s) noexcept {
201inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(const path& __p) { return is_symlink(__symlink_status(__p)); }222 return __s.type() == file_type::symlink;
202inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(const path& __p, error_code& __ec) noexcept {223}
224[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(const path& __p) {
225 return is_symlink(__symlink_status(__p));
226}
227[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(const path& __p, error_code& __ec) noexcept {
203 return is_symlink(__symlink_status(__p, &__ec));228 return is_symlink(__symlink_status(__p, &__ec));
204}229}
205inline _LIBCPP_HIDE_FROM_ABI bool is_other(file_status __s) noexcept {230[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_other(file_status __s) noexcept {
206 return exists(__s) && !is_regular_file(__s) && !is_directory(__s) && !is_symlink(__s);231 return exists(__s) && !is_regular_file(__s) && !is_directory(__s) && !is_symlink(__s);
207}232}
208inline _LIBCPP_HIDE_FROM_ABI bool is_other(const path& __p) { return is_other(__status(__p)); }233[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_other(const path& __p) { return is_other(__status(__p)); }
209inline _LIBCPP_HIDE_FROM_ABI bool is_other(const path& __p, error_code& __ec) noexcept {234[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_other(const path& __p, error_code& __ec) noexcept {
210 return is_other(__status(__p, &__ec));235 return is_other(__status(__p, &__ec));
211}236}
212inline _LIBCPP_HIDE_FROM_ABI bool is_socket(file_status __s) noexcept { return __s.type() == file_type::socket; }237[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_socket(file_status __s) noexcept {
213inline _LIBCPP_HIDE_FROM_ABI bool is_socket(const path& __p) { return is_socket(__status(__p)); }238 return __s.type() == file_type::socket;
214inline _LIBCPP_HIDE_FROM_ABI bool is_socket(const path& __p, error_code& __ec) noexcept {239}
240[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_socket(const path& __p) { return is_socket(__status(__p)); }
241[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool is_socket(const path& __p, error_code& __ec) noexcept {
215 return is_socket(__status(__p, &__ec));242 return is_socket(__status(__p, &__ec));
216}243}
217inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p) { return __last_write_time(__p); }244[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p) {
218inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p, error_code& __ec) noexcept {245 return __last_write_time(__p);
246}
247[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p, error_code& __ec) noexcept {
219 return __last_write_time(__p, &__ec);248 return __last_write_time(__p, &__ec);
220}249}
221inline _LIBCPP_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t) { __last_write_time(__p, __t); }250inline _LIBCPP_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t) { __last_write_time(__p, __t); }
...@@ -233,7 +262,7 @@ inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, per...@@ -233,7 +262,7 @@ inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, per
233 __permissions(__p, __prms, __opts, &__ec);262 __permissions(__p, __prms, __opts, &__ec);
234}263}
235264
236inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base, error_code& __ec) {265[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base, error_code& __ec) {
237 path __tmp = __weakly_canonical(__p, &__ec);266 path __tmp = __weakly_canonical(__p, &__ec);
238 if (__ec)267 if (__ec)
239 return {};268 return {};
...@@ -243,16 +272,18 @@ inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base,...@@ -243,16 +272,18 @@ inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base,
243 return __tmp.lexically_proximate(__tmp_base);272 return __tmp.lexically_proximate(__tmp_base);
244}273}
245274
246inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, error_code& __ec) {275[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, error_code& __ec) {
247 return proximate(__p, current_path(), __ec);276 return proximate(__p, current_path(), __ec);
248}277}
249inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base = current_path()) {278[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base = current_path()) {
250 return __weakly_canonical(__p).lexically_proximate(__weakly_canonical(__base));279 return __weakly_canonical(__p).lexically_proximate(__weakly_canonical(__base));
251}280}
252inline _LIBCPP_HIDE_FROM_ABI path read_symlink(const path& __p) { return __read_symlink(__p); }281[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path read_symlink(const path& __p) { return __read_symlink(__p); }
253inline _LIBCPP_HIDE_FROM_ABI path read_symlink(const path& __p, error_code& __ec) { return __read_symlink(__p, &__ec); }282[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path read_symlink(const path& __p, error_code& __ec) {
283 return __read_symlink(__p, &__ec);
284}
254285
255inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base, error_code& __ec) {286[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base, error_code& __ec) {
256 path __tmp = __weakly_canonical(__p, &__ec);287 path __tmp = __weakly_canonical(__p, &__ec);
257 if (__ec)288 if (__ec)
258 return path();289 return path();
...@@ -262,10 +293,10 @@ inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base,...@@ -262,10 +293,10 @@ inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base,
262 return __tmp.lexically_relative(__tmpbase);293 return __tmp.lexically_relative(__tmpbase);
263}294}
264295
265inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, error_code& __ec) {296[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, error_code& __ec) {
266 return relative(__p, current_path(), __ec);297 return relative(__p, current_path(), __ec);
267}298}
268inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base = current_path()) {299[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base = current_path()) {
269 return __weakly_canonical(__p).lexically_relative(__weakly_canonical(__base));300 return __weakly_canonical(__p).lexically_relative(__weakly_canonical(__base));
270}301}
271inline _LIBCPP_HIDE_FROM_ABI uintmax_t remove_all(const path& __p) { return __remove_all(__p); }302inline _LIBCPP_HIDE_FROM_ABI uintmax_t remove_all(const path& __p) { return __remove_all(__p); }
...@@ -282,27 +313,27 @@ inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns) {...@@ -282,27 +313,27 @@ inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns) {
282inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) noexcept {313inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) noexcept {
283 return __resize_file(__p, __ns, &__ec);314 return __resize_file(__p, __ns, &__ec);
284}315}
285inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p) { return __space(__p); }316[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p) { return __space(__p); }
286inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p, error_code& __ec) noexcept {317[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p, error_code& __ec) noexcept {
287 return __space(__p, &__ec);318 return __space(__p, &__ec);
288}319}
289inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p) { return __status(__p); }320[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p) { return __status(__p); }
290inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p, error_code& __ec) noexcept {321[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p, error_code& __ec) noexcept {
291 return __status(__p, &__ec);322 return __status(__p, &__ec);
292}323}
293inline _LIBCPP_HIDE_FROM_ABI file_status symlink_status(const path& __p) { return __symlink_status(__p); }324[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI file_status symlink_status(const path& __p) { return __symlink_status(__p); }
294inline _LIBCPP_HIDE_FROM_ABI file_status symlink_status(const path& __p, error_code& __ec) noexcept {325[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI file_status symlink_status(const path& __p, error_code& __ec) noexcept {
295 return __symlink_status(__p, &__ec);326 return __symlink_status(__p, &__ec);
296}327}
297inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path() { return __temp_directory_path(); }328[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path() { return __temp_directory_path(); }
298inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path(error_code& __ec) { return __temp_directory_path(&__ec); }329[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path(error_code& __ec) {
299inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p) { return __weakly_canonical(__p); }330 return __temp_directory_path(&__ec);
300inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p, error_code& __ec) {331}
332[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p) { return __weakly_canonical(__p); }
333[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p, error_code& __ec) {
301 return __weakly_canonical(__p, &__ec);334 return __weakly_canonical(__p, &__ec);
302}335}
303336
304_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
305
306_LIBCPP_END_NAMESPACE_FILESYSTEM337_LIBCPP_END_NAMESPACE_FILESYSTEM
307338
308#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM339#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
lib/libcxx/include/__filesystem/path.h+68-64
...@@ -42,8 +42,6 @@ _LIBCPP_PUSH_MACROS...@@ -42,8 +42,6 @@ _LIBCPP_PUSH_MACROS
4242
43_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM43_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
4444
45_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
46
47template <class _Tp>45template <class _Tp>
48struct __can_convert_char {46struct __can_convert_char {
49 static const bool value = false;47 static const bool value = false;
...@@ -326,6 +324,7 @@ struct _PathCVT<char> {...@@ -326,6 +324,7 @@ struct _PathCVT<char> {
326 }324 }
327};325};
328326
327# if _LIBCPP_HAS_LOCALIZATION
329template <class _ECharT>328template <class _ECharT>
330struct _PathExport {329struct _PathExport {
331 typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;330 typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
...@@ -366,7 +365,7 @@ struct _PathExport<char16_t> {...@@ -366,7 +365,7 @@ struct _PathExport<char16_t> {
366 }365 }
367};366};
368367
369# if _LIBCPP_HAS_CHAR8_T368# if _LIBCPP_HAS_CHAR8_T
370template <>369template <>
371struct _PathExport<char8_t> {370struct _PathExport<char8_t> {
372 typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;371 typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
...@@ -376,8 +375,9 @@ struct _PathExport<char8_t> {...@@ -376,8 +375,9 @@ struct _PathExport<char8_t> {
376 _Narrower()(back_inserter(__dest), __src.data(), __src.data() + __src.size());375 _Narrower()(back_inserter(__dest), __src.data(), __src.data() + __src.size());
377 }376 }
378};377};
379# endif // _LIBCPP_HAS_CHAR8_T378# endif // _LIBCPP_HAS_CHAR8_T
380# endif /* _LIBCPP_WIN32API */379# endif // _LIBCPP_HAS_LOCALIZATION
380# endif // _LIBCPP_WIN32API
381381
382class _LIBCPP_EXPORTED_FROM_ABI path {382class _LIBCPP_EXPORTED_FROM_ABI path {
383 template <class _SourceOrIter, class _Tp = path&>383 template <class _SourceOrIter, class _Tp = path&>
...@@ -667,16 +667,16 @@ public:...@@ -667,16 +667,16 @@ public:
667 _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __s) { __pn_.reserve(__s); }667 _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __s) { __pn_.reserve(__s); }
668668
669 // native format observers669 // native format observers
670 _LIBCPP_HIDE_FROM_ABI const string_type& native() const noexcept { return __pn_; }670 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const string_type& native() const noexcept { return __pn_; }
671671
672 _LIBCPP_HIDE_FROM_ABI const value_type* c_str() const noexcept { return __pn_.c_str(); }672 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const value_type* c_str() const noexcept { return __pn_.c_str(); }
673673
674 _LIBCPP_HIDE_FROM_ABI operator string_type() const { return __pn_; }674 _LIBCPP_HIDE_FROM_ABI operator string_type() const { return __pn_; }
675675
676# if defined(_LIBCPP_WIN32API)676# if defined(_LIBCPP_WIN32API)
677 _LIBCPP_HIDE_FROM_ABI std::wstring wstring() const { return __pn_; }677 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::wstring wstring() const { return __pn_; }
678678
679 _LIBCPP_HIDE_FROM_ABI std::wstring generic_wstring() const {679 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::wstring generic_wstring() const {
680 std::wstring __s;680 std::wstring __s;
681 __s.resize(__pn_.size());681 __s.resize(__pn_.size());
682 std::replace_copy(__pn_.begin(), __pn_.end(), __s.begin(), '\\', '/');682 std::replace_copy(__pn_.begin(), __pn_.end(), __s.begin(), '\\', '/');
...@@ -685,6 +685,7 @@ public:...@@ -685,6 +685,7 @@ public:
685685
686# if _LIBCPP_HAS_LOCALIZATION686# if _LIBCPP_HAS_LOCALIZATION
687 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >687 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
688 [[nodiscard]]
688 _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator> string(const _Allocator& __a = _Allocator()) const {689 _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator> string(const _Allocator& __a = _Allocator()) const {
689 using _Str = basic_string<_ECharT, _Traits, _Allocator>;690 using _Str = basic_string<_ECharT, _Traits, _Allocator>;
690 _Str __s(__a);691 _Str __s(__a);
...@@ -693,8 +694,8 @@ public:...@@ -693,8 +694,8 @@ public:
693 return __s;694 return __s;
694 }695 }
695696
696 _LIBCPP_HIDE_FROM_ABI std::string string() const { return string<char>(); }697 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::string string() const { return string<char>(); }
697 _LIBCPP_HIDE_FROM_ABI __u8_string u8string() const {698 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI __u8_string u8string() const {
698 using _CVT = __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__>;699 using _CVT = __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
699 __u8_string __s;700 __u8_string __s;
700 __s.reserve(__pn_.size());701 __s.reserve(__pn_.size());
...@@ -702,12 +703,12 @@ public:...@@ -702,12 +703,12 @@ public:
702 return __s;703 return __s;
703 }704 }
704705
705 _LIBCPP_HIDE_FROM_ABI std::u16string u16string() const { return string<char16_t>(); }706 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u16string u16string() const { return string<char16_t>(); }
706 _LIBCPP_HIDE_FROM_ABI std::u32string u32string() const { return string<char32_t>(); }707 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u32string u32string() const { return string<char32_t>(); }
707708
708 // generic format observers709 // generic format observers
709 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >710 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
710 _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator>711 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator>
711 generic_string(const _Allocator& __a = _Allocator()) const {712 generic_string(const _Allocator& __a = _Allocator()) const {
712 using _Str = basic_string<_ECharT, _Traits, _Allocator>;713 using _Str = basic_string<_ECharT, _Traits, _Allocator>;
713 _Str __s = string<_ECharT, _Traits, _Allocator>(__a);714 _Str __s = string<_ECharT, _Traits, _Allocator>(__a);
...@@ -718,10 +719,10 @@ public:...@@ -718,10 +719,10 @@ public:
718 return __s;719 return __s;
719 }720 }
720721
721 _LIBCPP_HIDE_FROM_ABI std::string generic_string() const { return generic_string<char>(); }722 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::string generic_string() const { return generic_string<char>(); }
722 _LIBCPP_HIDE_FROM_ABI std::u16string generic_u16string() const { return generic_string<char16_t>(); }723 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u16string generic_u16string() const { return generic_string<char16_t>(); }
723 _LIBCPP_HIDE_FROM_ABI std::u32string generic_u32string() const { return generic_string<char32_t>(); }724 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u32string generic_u32string() const { return generic_string<char32_t>(); }
724 _LIBCPP_HIDE_FROM_ABI __u8_string generic_u8string() const {725 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI __u8_string generic_u8string() const {
725 __u8_string __s = u8string();726 __u8_string __s = u8string();
726 std::replace(__s.begin(), __s.end(), '\\', '/');727 std::replace(__s.begin(), __s.end(), '\\', '/');
727 return __s;728 return __s;
...@@ -729,15 +730,18 @@ public:...@@ -729,15 +730,18 @@ public:
729# endif // _LIBCPP_HAS_LOCALIZATION730# endif // _LIBCPP_HAS_LOCALIZATION
730# else /* _LIBCPP_WIN32API */731# else /* _LIBCPP_WIN32API */
731732
732 _LIBCPP_HIDE_FROM_ABI std::string string() const { return __pn_; }733 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::string string() const { return __pn_; }
733# if _LIBCPP_HAS_CHAR8_T734# if _LIBCPP_HAS_CHAR8_T
734 _LIBCPP_HIDE_FROM_ABI std::u8string u8string() const { return std::u8string(__pn_.begin(), __pn_.end()); }735 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u8string u8string() const {
736 return std::u8string(__pn_.begin(), __pn_.end());
737 }
735# else738# else
736 _LIBCPP_HIDE_FROM_ABI std::string u8string() const { return __pn_; }739 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::string u8string() const { return __pn_; }
737# endif740# endif
738741
739# if _LIBCPP_HAS_LOCALIZATION742# if _LIBCPP_HAS_LOCALIZATION
740 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >743 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
744 [[nodiscard]]
741 _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator> string(const _Allocator& __a = _Allocator()) const {745 _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator> string(const _Allocator& __a = _Allocator()) const {
742 using _CVT = __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__>;746 using _CVT = __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__>;
743 using _Str = basic_string<_ECharT, _Traits, _Allocator>;747 using _Str = basic_string<_ECharT, _Traits, _Allocator>;
...@@ -748,32 +752,34 @@ public:...@@ -748,32 +752,34 @@ public:
748 }752 }
749753
750# if _LIBCPP_HAS_WIDE_CHARACTERS754# if _LIBCPP_HAS_WIDE_CHARACTERS
751 _LIBCPP_HIDE_FROM_ABI std::wstring wstring() const { return string<wchar_t>(); }755 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::wstring wstring() const { return string<wchar_t>(); }
752# endif756# endif
753 _LIBCPP_HIDE_FROM_ABI std::u16string u16string() const { return string<char16_t>(); }757 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u16string u16string() const { return string<char16_t>(); }
754 _LIBCPP_HIDE_FROM_ABI std::u32string u32string() const { return string<char32_t>(); }758 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u32string u32string() const { return string<char32_t>(); }
755# endif // _LIBCPP_HAS_LOCALIZATION759# endif // _LIBCPP_HAS_LOCALIZATION
756760
757 // generic format observers761 // generic format observers
758 _LIBCPP_HIDE_FROM_ABI std::string generic_string() const { return __pn_; }762 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::string generic_string() const { return __pn_; }
759# if _LIBCPP_HAS_CHAR8_T763# if _LIBCPP_HAS_CHAR8_T
760 _LIBCPP_HIDE_FROM_ABI std::u8string generic_u8string() const { return std::u8string(__pn_.begin(), __pn_.end()); }764 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u8string generic_u8string() const {
765 return std::u8string(__pn_.begin(), __pn_.end());
766 }
761# else767# else
762 _LIBCPP_HIDE_FROM_ABI std::string generic_u8string() const { return __pn_; }768 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::string generic_u8string() const { return __pn_; }
763# endif769# endif
764770
765# if _LIBCPP_HAS_LOCALIZATION771# if _LIBCPP_HAS_LOCALIZATION
766 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >772 template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
767 _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator>773 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator>
768 generic_string(const _Allocator& __a = _Allocator()) const {774 generic_string(const _Allocator& __a = _Allocator()) const {
769 return string<_ECharT, _Traits, _Allocator>(__a);775 return string<_ECharT, _Traits, _Allocator>(__a);
770 }776 }
771777
772# if _LIBCPP_HAS_WIDE_CHARACTERS778# if _LIBCPP_HAS_WIDE_CHARACTERS
773 _LIBCPP_HIDE_FROM_ABI std::wstring generic_wstring() const { return string<wchar_t>(); }779 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::wstring generic_wstring() const { return string<wchar_t>(); }
774# endif780# endif
775 _LIBCPP_HIDE_FROM_ABI std::u16string generic_u16string() const { return string<char16_t>(); }781 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u16string generic_u16string() const { return string<char16_t>(); }
776 _LIBCPP_HIDE_FROM_ABI std::u32string generic_u32string() const { return string<char32_t>(); }782 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::u32string generic_u32string() const { return string<char32_t>(); }
777# endif // _LIBCPP_HAS_LOCALIZATION783# endif // _LIBCPP_HAS_LOCALIZATION
778# endif /* !_LIBCPP_WIN32API */784# endif /* !_LIBCPP_WIN32API */
779785
...@@ -790,40 +796,40 @@ private:...@@ -790,40 +796,40 @@ private:
790796
791public:797public:
792 // compare798 // compare
793 _LIBCPP_HIDE_FROM_ABI int compare(const path& __p) const noexcept { return __compare(__p.__pn_); }799 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int compare(const path& __p) const noexcept { return __compare(__p.__pn_); }
794 _LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const { return __compare(__s); }800 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const { return __compare(__s); }
795 _LIBCPP_HIDE_FROM_ABI int compare(__string_view __s) const { return __compare(__s); }801 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int compare(__string_view __s) const { return __compare(__s); }
796 _LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const { return __compare(__s); }802 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const { return __compare(__s); }
797803
798 // decomposition804 // decomposition
799 _LIBCPP_HIDE_FROM_ABI path root_name() const { return string_type(__root_name()); }805 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path root_name() const { return string_type(__root_name()); }
800 _LIBCPP_HIDE_FROM_ABI path root_directory() const { return string_type(__root_directory()); }806 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path root_directory() const { return string_type(__root_directory()); }
801 _LIBCPP_HIDE_FROM_ABI path root_path() const {807 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path root_path() const {
802# if defined(_LIBCPP_WIN32API)808# if defined(_LIBCPP_WIN32API)
803 return string_type(__root_path_raw());809 return string_type(__root_path_raw());
804# else810# else
805 return root_name().append(string_type(__root_directory()));811 return root_name().append(string_type(__root_directory()));
806# endif812# endif
807 }813 }
808 _LIBCPP_HIDE_FROM_ABI path relative_path() const { return string_type(__relative_path()); }814 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path relative_path() const { return string_type(__relative_path()); }
809 _LIBCPP_HIDE_FROM_ABI path parent_path() const { return string_type(__parent_path()); }815 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path parent_path() const { return string_type(__parent_path()); }
810 _LIBCPP_HIDE_FROM_ABI path filename() const { return string_type(__filename()); }816 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path filename() const { return string_type(__filename()); }
811 _LIBCPP_HIDE_FROM_ABI path stem() const { return string_type(__stem()); }817 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path stem() const { return string_type(__stem()); }
812 _LIBCPP_HIDE_FROM_ABI path extension() const { return string_type(__extension()); }818 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path extension() const { return string_type(__extension()); }
813819
814 // query820 // query
815 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __pn_.empty(); }821 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __pn_.empty(); }
816822
817 _LIBCPP_HIDE_FROM_ABI bool has_root_name() const { return !__root_name().empty(); }823 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_root_name() const { return !__root_name().empty(); }
818 _LIBCPP_HIDE_FROM_ABI bool has_root_directory() const { return !__root_directory().empty(); }824 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_root_directory() const { return !__root_directory().empty(); }
819 _LIBCPP_HIDE_FROM_ABI bool has_root_path() const { return !__root_path_raw().empty(); }825 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_root_path() const { return !__root_path_raw().empty(); }
820 _LIBCPP_HIDE_FROM_ABI bool has_relative_path() const { return !__relative_path().empty(); }826 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_relative_path() const { return !__relative_path().empty(); }
821 _LIBCPP_HIDE_FROM_ABI bool has_parent_path() const { return !__parent_path().empty(); }827 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_parent_path() const { return !__parent_path().empty(); }
822 _LIBCPP_HIDE_FROM_ABI bool has_filename() const { return !__filename().empty(); }828 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_filename() const { return !__filename().empty(); }
823 _LIBCPP_HIDE_FROM_ABI bool has_stem() const { return !__stem().empty(); }829 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_stem() const { return !__stem().empty(); }
824 _LIBCPP_HIDE_FROM_ABI bool has_extension() const { return !__extension().empty(); }830 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_extension() const { return !__extension().empty(); }
825831
826 _LIBCPP_HIDE_FROM_ABI bool is_absolute() const {832 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_absolute() const {
827# if defined(_LIBCPP_WIN32API)833# if defined(_LIBCPP_WIN32API)
828 __string_view __root_name_str = __root_name();834 __string_view __root_name_str = __root_name();
829 __string_view __root_dir = __root_directory();835 __string_view __root_dir = __root_directory();
...@@ -847,13 +853,13 @@ public:...@@ -847,13 +853,13 @@ public:
847 return has_root_directory();853 return has_root_directory();
848# endif854# endif
849 }855 }
850 _LIBCPP_HIDE_FROM_ABI bool is_relative() const { return !is_absolute(); }856 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_relative() const { return !is_absolute(); }
851857
852 // relative paths858 // relative paths
853 path lexically_normal() const;859 [[nodiscard]] path lexically_normal() const;
854 path lexically_relative(const path& __base) const;860 [[nodiscard]] path lexically_relative(const path& __base) const;
855861
856 _LIBCPP_HIDE_FROM_ABI path lexically_proximate(const path& __base) const {862 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI path lexically_proximate(const path& __base) const {
857 path __result = this->lexically_relative(__base);863 path __result = this->lexically_relative(__base);
858 if (__result.native().empty())864 if (__result.native().empty())
859 return *this;865 return *this;
...@@ -861,11 +867,11 @@ public:...@@ -861,11 +867,11 @@ public:
861 }867 }
862868
863 // iterators869 // iterators
864 class _LIBCPP_EXPORTED_FROM_ABI iterator;870 class iterator;
865 typedef iterator const_iterator;871 typedef iterator const_iterator;
866872
867 iterator begin() const;873 [[nodiscard]] iterator begin() const;
868 iterator end() const;874 [[nodiscard]] iterator end() const;
869875
870# if _LIBCPP_HAS_LOCALIZATION876# if _LIBCPP_HAS_LOCALIZATION
871 template <877 template <
...@@ -908,17 +914,15 @@ private:...@@ -908,17 +914,15 @@ private:
908914
909inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }915inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
910916
911_LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept;917[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept;
912
913_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
914918
915_LIBCPP_END_NAMESPACE_FILESYSTEM919_LIBCPP_END_NAMESPACE_FILESYSTEM
916920
917_LIBCPP_BEGIN_NAMESPACE_STD921_LIBCPP_BEGIN_NAMESPACE_STD
918922
919template <>923template <>
920struct _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY hash<filesystem::path> : __unary_function<filesystem::path, size_t> {924struct hash<filesystem::path> : __unary_function<filesystem::path, size_t> {
921 _LIBCPP_HIDE_FROM_ABI size_t operator()(filesystem::path const& __p) const noexcept {925 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_t operator()(filesystem::path const& __p) const noexcept {
922 return filesystem::hash_value(__p);926 return filesystem::hash_value(__p);
923 }927 }
924};928};
lib/libcxx/include/__filesystem/path_iterator.h+1-3
...@@ -52,7 +52,7 @@ public:...@@ -52,7 +52,7 @@ public:
5252
53 _LIBCPP_HIDE_FROM_ABI iterator& operator=(const iterator&) = default;53 _LIBCPP_HIDE_FROM_ABI iterator& operator=(const iterator&) = default;
5454
55 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __stashed_elem_; }55 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __stashed_elem_; }
5656
57 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return &__stashed_elem_; }57 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return &__stashed_elem_; }
5858
...@@ -95,12 +95,10 @@ private:...@@ -95,12 +95,10 @@ private:
95 _ParserState __state_;95 _ParserState __state_;
96};96};
9797
98_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
99inline _LIBCPP_HIDE_FROM_ABI bool operator==(const path::iterator& __lhs, const path::iterator& __rhs) {98inline _LIBCPP_HIDE_FROM_ABI bool operator==(const path::iterator& __lhs, const path::iterator& __rhs) {
100 return __lhs.__path_ptr_ == __rhs.__path_ptr_ && __lhs.__entry_.data() == __rhs.__entry_.data();99 return __lhs.__path_ptr_ == __rhs.__path_ptr_ && __lhs.__entry_.data() == __rhs.__entry_.data();
101}100}
102101
103_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
104inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const path::iterator& __lhs, const path::iterator& __rhs) {102inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const path::iterator& __lhs, const path::iterator& __rhs) {
105 return !(__lhs == __rhs);103 return !(__lhs == __rhs);
106}104}
lib/libcxx/include/__filesystem/perm_options.h+4-4
...@@ -22,19 +22,19 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM...@@ -22,19 +22,19 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2222
23enum class perm_options : unsigned char { replace = 1, add = 2, remove = 4, nofollow = 8 };23enum class perm_options : unsigned char { replace = 1, add = 2, remove = 4, nofollow = 8 };
2424
25_LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator&(perm_options __lhs, perm_options __rhs) {25[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator&(perm_options __lhs, perm_options __rhs) {
26 return static_cast<perm_options>(static_cast<unsigned>(__lhs) & static_cast<unsigned>(__rhs));26 return static_cast<perm_options>(static_cast<unsigned>(__lhs) & static_cast<unsigned>(__rhs));
27}27}
2828
29_LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator|(perm_options __lhs, perm_options __rhs) {29[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator|(perm_options __lhs, perm_options __rhs) {
30 return static_cast<perm_options>(static_cast<unsigned>(__lhs) | static_cast<unsigned>(__rhs));30 return static_cast<perm_options>(static_cast<unsigned>(__lhs) | static_cast<unsigned>(__rhs));
31}31}
3232
33_LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator^(perm_options __lhs, perm_options __rhs) {33[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator^(perm_options __lhs, perm_options __rhs) {
34 return static_cast<perm_options>(static_cast<unsigned>(__lhs) ^ static_cast<unsigned>(__rhs));34 return static_cast<perm_options>(static_cast<unsigned>(__lhs) ^ static_cast<unsigned>(__rhs));
35}35}
3636
37_LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator~(perm_options __lhs) {37[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perm_options operator~(perm_options __lhs) {
38 return static_cast<perm_options>(~static_cast<unsigned>(__lhs));38 return static_cast<perm_options>(~static_cast<unsigned>(__lhs));
39}39}
4040
lib/libcxx/include/__filesystem/perms.h+4-4
...@@ -51,19 +51,19 @@ enum class perms : unsigned {...@@ -51,19 +51,19 @@ enum class perms : unsigned {
51 unknown = 0xFFFF,51 unknown = 0xFFFF,
52};52};
5353
54_LIBCPP_HIDE_FROM_ABI inline constexpr perms operator&(perms __lhs, perms __rhs) {54[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perms operator&(perms __lhs, perms __rhs) {
55 return static_cast<perms>(static_cast<unsigned>(__lhs) & static_cast<unsigned>(__rhs));55 return static_cast<perms>(static_cast<unsigned>(__lhs) & static_cast<unsigned>(__rhs));
56}56}
5757
58_LIBCPP_HIDE_FROM_ABI inline constexpr perms operator|(perms __lhs, perms __rhs) {58[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perms operator|(perms __lhs, perms __rhs) {
59 return static_cast<perms>(static_cast<unsigned>(__lhs) | static_cast<unsigned>(__rhs));59 return static_cast<perms>(static_cast<unsigned>(__lhs) | static_cast<unsigned>(__rhs));
60}60}
6161
62_LIBCPP_HIDE_FROM_ABI inline constexpr perms operator^(perms __lhs, perms __rhs) {62[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perms operator^(perms __lhs, perms __rhs) {
63 return static_cast<perms>(static_cast<unsigned>(__lhs) ^ static_cast<unsigned>(__rhs));63 return static_cast<perms>(static_cast<unsigned>(__lhs) ^ static_cast<unsigned>(__rhs));
64}64}
6565
66_LIBCPP_HIDE_FROM_ABI inline constexpr perms operator~(perms __lhs) {66[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr perms operator~(perms __lhs) {
67 return static_cast<perms>(~static_cast<unsigned>(__lhs));67 return static_cast<perms>(~static_cast<unsigned>(__lhs));
68}68}
6969
lib/libcxx/include/__filesystem/recursive_directory_iterator.h+9-14
...@@ -33,8 +33,6 @@ _LIBCPP_PUSH_MACROS...@@ -33,8 +33,6 @@ _LIBCPP_PUSH_MACROS
3333
34_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM34_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
3535
36_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
37
38class recursive_directory_iterator {36class recursive_directory_iterator {
39public:37public:
40 using value_type = directory_entry;38 using value_type = directory_entry;
...@@ -73,7 +71,7 @@ public:...@@ -73,7 +71,7 @@ public:
7371
74 _LIBCPP_HIDE_FROM_ABI ~recursive_directory_iterator() = default;72 _LIBCPP_HIDE_FROM_ABI ~recursive_directory_iterator() = default;
7573
76 _LIBCPP_HIDE_FROM_ABI const directory_entry& operator*() const { return __dereference(); }74 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const directory_entry& operator*() const { return __dereference(); }
7775
78 _LIBCPP_HIDE_FROM_ABI const directory_entry* operator->() const { return &__dereference(); }76 _LIBCPP_HIDE_FROM_ABI const directory_entry* operator->() const { return &__dereference(); }
7977
...@@ -87,14 +85,14 @@ public:...@@ -87,14 +85,14 @@ public:
8785
88 _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator& increment(error_code& __ec) { return __increment(&__ec); }86 _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator& increment(error_code& __ec) { return __increment(&__ec); }
8987
90 _LIBCPP_EXPORTED_FROM_ABI directory_options options() const;88 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI directory_options options() const;
91 _LIBCPP_EXPORTED_FROM_ABI int depth() const;89 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI int depth() const;
9290
93 _LIBCPP_HIDE_FROM_ABI void pop() { __pop(); }91 _LIBCPP_HIDE_FROM_ABI void pop() { __pop(); }
9492
95 _LIBCPP_HIDE_FROM_ABI void pop(error_code& __ec) { __pop(&__ec); }93 _LIBCPP_HIDE_FROM_ABI void pop(error_code& __ec) { __pop(&__ec); }
9694
97 _LIBCPP_HIDE_FROM_ABI bool recursion_pending() const { return __rec_; }95 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool recursion_pending() const { return __rec_; }
9896
99 _LIBCPP_HIDE_FROM_ABI void disable_recursion_pending() { __rec_ = false; }97 _LIBCPP_HIDE_FROM_ABI void disable_recursion_pending() { __rec_ = false; }
10098
...@@ -132,27 +130,24 @@ operator!=(const recursive_directory_iterator& __lhs, const recursive_directory_...@@ -132,27 +130,24 @@ operator!=(const recursive_directory_iterator& __lhs, const recursive_directory_
132 return !(__lhs == __rhs);130 return !(__lhs == __rhs);
133}131}
134// enable recursive_directory_iterator range-based for statements132// enable recursive_directory_iterator range-based for statements
135inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator begin(recursive_directory_iterator __iter) noexcept {133[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator
134begin(recursive_directory_iterator __iter) noexcept {
136 return __iter;135 return __iter;
137}136}
138137
139inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_directory_iterator) noexcept {138[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_directory_iterator) noexcept {
140 return recursive_directory_iterator();139 return recursive_directory_iterator();
141}140}
142141
143_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
144
145_LIBCPP_END_NAMESPACE_FILESYSTEM142_LIBCPP_END_NAMESPACE_FILESYSTEM
146143
147# if _LIBCPP_STD_VER >= 20144# if _LIBCPP_STD_VER >= 20
148145
149template <>146template <>
150_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY inline constexpr bool147inline constexpr bool std::ranges::enable_borrowed_range<std::filesystem::recursive_directory_iterator> = true;
151 std::ranges::enable_borrowed_range<std::filesystem::recursive_directory_iterator> = true;
152148
153template <>149template <>
154_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY inline constexpr bool150inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_directory_iterator> = true;
155 std::ranges::enable_view<std::filesystem::recursive_directory_iterator> = true;
156151
157# endif // _LIBCPP_STD_VER >= 20152# endif // _LIBCPP_STD_VER >= 20
158153
lib/libcxx/include/__filesystem/space_info.h+1-1
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
2121
22_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM22_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2323
24struct _LIBCPP_EXPORTED_FROM_ABI space_info {24struct space_info {
25 uintmax_t capacity;25 uintmax_t capacity;
26 uintmax_t free;26 uintmax_t free;
27 uintmax_t available;27 uintmax_t available;
lib/libcxx/include/__filesystem/u8path.h+12-14
...@@ -24,32 +24,32 @@...@@ -24,32 +24,32 @@
2424
25_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM25_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2626
27_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH27# if !defined(_LIBCPP_WIN32API) || _LIBCPP_HAS_LOCALIZATION
28
29template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>28template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>
30_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(_InputIt __f, _InputIt __l) {29[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(_InputIt __f, _InputIt __l) {
31 static_assert(30 static_assert(
32# if _LIBCPP_HAS_CHAR8_T31# if _LIBCPP_HAS_CHAR8_T
33 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||32 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
34# endif33# endif
35 is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,34 is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
36 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"35 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
37 " or 'char8_t'");36 " or 'char8_t'");
38# if defined(_LIBCPP_WIN32API)37# if defined(_LIBCPP_WIN32API)
39 string __tmp(__f, __l);38 string __tmp(__f, __l);
40 using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;39 using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
41 std::wstring __w;40 std::wstring __w;
42 __w.reserve(__tmp.size());41 __w.reserve(__tmp.size());
43 _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());42 _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
44 return path(__w);43 return path(__w);
45# else44# else
46 return path(__f, __l);45 return path(__f, __l);
47# endif /* !_LIBCPP_WIN32API */46# endif // defined(_LIBCPP_WIN32API)
48}47}
48# endif // !defined(_LIBCPP_WIN32API) || _LIBCPP_HAS_LOCALIZATION
4949
50# if defined(_LIBCPP_WIN32API)50# if defined(_LIBCPP_WIN32API) && _LIBCPP_HAS_LOCALIZATION
51template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>51template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>
52_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(_InputIt __f, _NullSentinel) {52[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(_InputIt __f, _NullSentinel) {
53 static_assert(53 static_assert(
54# if _LIBCPP_HAS_CHAR8_T54# if _LIBCPP_HAS_CHAR8_T
55 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||55 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
...@@ -67,10 +67,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(_InputIt __f,...@@ -67,10 +67,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(_InputIt __f,
67 _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());67 _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
68 return path(__w);68 return path(__w);
69}69}
70# endif /* _LIBCPP_WIN32API */70# endif // defined(_LIBCPP_WIN32API) && _LIBCPP_HAS_LOCALIZATION
7171
72template <class _Source, __enable_if_t<__is_pathable<_Source>::value, int> = 0>72template <class _Source, __enable_if_t<__is_pathable<_Source>::value, int> = 0>
73_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(const _Source& __s) {73[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(const _Source& __s) {
74 static_assert(74 static_assert(
75# if _LIBCPP_HAS_CHAR8_T75# if _LIBCPP_HAS_CHAR8_T
76 is_same<typename __is_pathable<_Source>::__char_type, char8_t>::value ||76 is_same<typename __is_pathable<_Source>::__char_type, char8_t>::value ||
...@@ -86,8 +86,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(const _Source&...@@ -86,8 +86,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_WITH_CHAR8_T path u8path(const _Source&
86# endif86# endif
87}87}
8888
89_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
90
91_LIBCPP_END_NAMESPACE_FILESYSTEM89_LIBCPP_END_NAMESPACE_FILESYSTEM
9290
93#endif // _LIBCPP_STD_VER >= 1791#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__flat_map/flat_map.h+88-71
...@@ -29,7 +29,6 @@...@@ -29,7 +29,6 @@
29#include <__flat_map/key_value_iterator.h>29#include <__flat_map/key_value_iterator.h>
30#include <__flat_map/sorted_unique.h>30#include <__flat_map/sorted_unique.h>
31#include <__flat_map/utils.h>31#include <__flat_map/utils.h>
32#include <__functional/invoke.h>
33#include <__functional/is_transparent.h>32#include <__functional/is_transparent.h>
34#include <__functional/operations.h>33#include <__functional/operations.h>
35#include <__fwd/memory.h>34#include <__fwd/memory.h>
...@@ -48,7 +47,7 @@...@@ -48,7 +47,7 @@
48#include <__ranges/container_compatible_range.h>47#include <__ranges/container_compatible_range.h>
49#include <__ranges/drop_view.h>48#include <__ranges/drop_view.h>
50#include <__ranges/from_range.h>49#include <__ranges/from_range.h>
51#include <__ranges/ref_view.h>50#include <__ranges/range_adaptor.h>
52#include <__ranges/size.h>51#include <__ranges/size.h>
53#include <__ranges/subrange.h>52#include <__ranges/subrange.h>
54#include <__ranges/zip_view.h>53#include <__ranges/zip_view.h>
...@@ -410,41 +409,45 @@ public:...@@ -410,41 +409,45 @@ public:
410 }409 }
411410
412 // iterators411 // iterators
413 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {412 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {
414 return iterator(__containers_.keys.begin(), __containers_.values.begin());413 return iterator(__containers_.keys.begin(), __containers_.values.begin());
415 }414 }
416415
417 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {416 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {
418 return const_iterator(__containers_.keys.begin(), __containers_.values.begin());417 return const_iterator(__containers_.keys.begin(), __containers_.values.begin());
419 }418 }
420419
421 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {420 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {
422 return iterator(__containers_.keys.end(), __containers_.values.end());421 return iterator(__containers_.keys.end(), __containers_.values.end());
423 }422 }
424423
425 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {424 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {
426 return const_iterator(__containers_.keys.end(), __containers_.values.end());425 return const_iterator(__containers_.keys.end(), __containers_.values.end());
427 }426 }
428427
429 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {428 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {
430 return reverse_iterator(end());429 return reverse_iterator(end());
431 }430 }
432 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {431 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {
433 return const_reverse_iterator(end());432 return const_reverse_iterator(end());
434 }433 }
435 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {434 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {
436 return reverse_iterator(begin());435 return reverse_iterator(begin());
437 }436 }
438 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {437 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {
439 return const_reverse_iterator(begin());438 return const_reverse_iterator(begin());
440 }439 }
441440
442 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept { return begin(); }441 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept {
443 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept { return end(); }442 return begin();
444 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {443 }
444 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept {
445 return end();
446 }
447 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {
445 return const_reverse_iterator(end());448 return const_reverse_iterator(end());
446 }449 }
447 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {450 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {
448 return const_reverse_iterator(begin());451 return const_reverse_iterator(begin());
449 }452 }
450453
...@@ -453,11 +456,11 @@ public:...@@ -453,11 +456,11 @@ public:
453 return __containers_.keys.empty();456 return __containers_.keys.empty();
454 }457 }
455458
456 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept {459 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept {
457 return __containers_.keys.size();460 return __containers_.keys.size();
458 }461 }
459462
460 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept {463 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept {
461 return std::min<size_type>(__containers_.keys.max_size(), __containers_.values.max_size());464 return std::min<size_type>(__containers_.keys.max_size(), __containers_.values.max_size());
462 }465 }
463466
...@@ -481,7 +484,7 @@ public:...@@ -481,7 +484,7 @@ public:
481 return try_emplace(std::forward<_Kp>(__x)).first->second;484 return try_emplace(std::forward<_Kp>(__x)).first->second;
482 }485 }
483486
484 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const key_type& __x) {487 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const key_type& __x) {
485 auto __it = find(__x);488 auto __it = find(__x);
486 if (__it == end()) {489 if (__it == end()) {
487 std::__throw_out_of_range("flat_map::at(const key_type&): Key does not exist");490 std::__throw_out_of_range("flat_map::at(const key_type&): Key does not exist");
...@@ -489,7 +492,7 @@ public:...@@ -489,7 +492,7 @@ public:
489 return __it->second;492 return __it->second;
490 }493 }
491494
492 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(const key_type& __x) const {495 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(const key_type& __x) const {
493 auto __it = find(__x);496 auto __it = find(__x);
494 if (__it == end()) {497 if (__it == end()) {
495 std::__throw_out_of_range("flat_map::at(const key_type&) const: Key does not exist");498 std::__throw_out_of_range("flat_map::at(const key_type&) const: Key does not exist");
...@@ -499,7 +502,7 @@ public:...@@ -499,7 +502,7 @@ public:
499502
500 template <class _Kp>503 template <class _Kp>
501 requires __is_compare_transparent504 requires __is_compare_transparent
502 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const _Kp& __x) {505 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const _Kp& __x) {
503 auto __it = find(__x);506 auto __it = find(__x);
504 if (__it == end()) {507 if (__it == end()) {
505 std::__throw_out_of_range("flat_map::at(const K&): Key does not exist");508 std::__throw_out_of_range("flat_map::at(const K&): Key does not exist");
...@@ -509,7 +512,7 @@ public:...@@ -509,7 +512,7 @@ public:
509512
510 template <class _Kp>513 template <class _Kp>
511 requires __is_compare_transparent514 requires __is_compare_transparent
512 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(const _Kp& __x) const {515 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(const _Kp& __x) const {
513 auto __it = find(__x);516 auto __it = find(__x);
514 if (__it == end()) {517 if (__it == end()) {
515 std::__throw_out_of_range("flat_map::at(const K&) const: Key does not exist");518 std::__throw_out_of_range("flat_map::at(const K&) const: Key does not exist");
...@@ -589,6 +592,15 @@ public:...@@ -589,6 +592,15 @@ public:
589 __append_sort_merge_unique</*WasSorted = */ false>(ranges::begin(__range), ranges::end(__range));592 __append_sort_merge_unique</*WasSorted = */ false>(ranges::begin(__range), ranges::end(__range));
590 }593 }
591594
595 template <_ContainerCompatibleRange<value_type> _Range>
596 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(sorted_unique_t, _Range&& __range) {
597 if constexpr (ranges::sized_range<_Range>) {
598 __reserve(ranges::size(__range));
599 }
600
601 __append_sort_merge_unique</*WasSorted = */ true>(ranges::begin(__range), ranges::end(__range));
602 }
603
592 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {604 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
593 insert(__il.begin(), __il.end());605 insert(__il.begin(), __il.end());
594 }606 }
...@@ -597,7 +609,7 @@ public:...@@ -597,7 +609,7 @@ public:
597 insert(sorted_unique, __il.begin(), __il.end());609 insert(sorted_unique, __il.begin(), __il.end());
598 }610 }
599611
600 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 containers extract() && {612 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 containers extract() && {
601 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });613 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });
602 auto __ret = std::move(__containers_);614 auto __ret = std::move(__containers_);
603 return __ret;615 return __ret;
...@@ -738,14 +750,17 @@ public:...@@ -738,14 +750,17 @@ public:
738 return iterator(std::move(__key_it), std::move(__mapped_it));750 return iterator(std::move(__key_it), std::move(__mapped_it));
739 }751 }
740752
741 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_map& __y) noexcept {753 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
742 // warning: The spec has unconditional noexcept, which means that754 swap(flat_map& __y) noexcept(is_nothrow_swappable_v<key_container_type> &&
743 // if any of the following functions throw an exception,755 is_nothrow_swappable_v<mapped_container_type> && is_nothrow_swappable_v<key_compare>) {
744 // std::terminate will be called.756 auto __on_failure = std::__make_exception_guard([&]() noexcept {
745 // This is discussed in P2767, which hasn't been voted on yet.757 clear() /* noexcept */;
758 __y.clear() /* noexcept */;
759 });
746 ranges::swap(__compare_, __y.__compare_);760 ranges::swap(__compare_, __y.__compare_);
747 ranges::swap(__containers_.keys, __y.__containers_.keys);761 ranges::swap(__containers_.keys, __y.__containers_.keys);
748 ranges::swap(__containers_.values, __y.__containers_.values);762 ranges::swap(__containers_.values, __y.__containers_.values);
763 __on_failure.__complete();
749 }764 }
750765
751 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept {766 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept {
...@@ -754,116 +769,121 @@ public:...@@ -754,116 +769,121 @@ public:
754 }769 }
755770
756 // observers771 // observers
757 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }772 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }
758 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {773 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
759 return value_compare(__compare_);774 return value_compare(__compare_);
760 }775 }
761776
762 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const key_container_type& keys() const noexcept {777 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const key_container_type& keys() const noexcept {
763 return __containers_.keys;778 return __containers_.keys;
764 }779 }
765 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_container_type& values() const noexcept {780 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_container_type&
781 values() const noexcept {
766 return __containers_.values;782 return __containers_.values;
767 }783 }
768784
769 // map operations785 // map operations
770 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {786 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {
771 return __find_impl(*this, __x);787 return __find_impl(*this, __x);
772 }788 }
773789
774 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {790 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {
775 return __find_impl(*this, __x);791 return __find_impl(*this, __x);
776 }792 }
777793
778 template <class _Kp>794 template <class _Kp>
779 requires __is_compare_transparent795 requires __is_compare_transparent
780 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {796 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {
781 return __find_impl(*this, __x);797 return __find_impl(*this, __x);
782 }798 }
783799
784 template <class _Kp>800 template <class _Kp>
785 requires __is_compare_transparent801 requires __is_compare_transparent
786 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {802 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {
787 return __find_impl(*this, __x);803 return __find_impl(*this, __x);
788 }804 }
789805
790 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {806 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {
791 return contains(__x) ? 1 : 0;807 return contains(__x) ? 1 : 0;
792 }808 }
793809
794 template <class _Kp>810 template <class _Kp>
795 requires __is_compare_transparent811 requires __is_compare_transparent
796 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {812 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {
797 return contains(__x) ? 1 : 0;813 return contains(__x) ? 1 : 0;
798 }814 }
799815
800 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {816 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {
801 return find(__x) != end();817 return find(__x) != end();
802 }818 }
803819
804 template <class _Kp>820 template <class _Kp>
805 requires __is_compare_transparent821 requires __is_compare_transparent
806 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {822 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {
807 return find(__x) != end();823 return find(__x) != end();
808 }824 }
809825
810 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {826 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {
811 return __lower_bound<iterator>(*this, __x);827 return __lower_bound<iterator>(*this, __x);
812 }828 }
813829
814 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const key_type& __x) const {830 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
831 lower_bound(const key_type& __x) const {
815 return __lower_bound<const_iterator>(*this, __x);832 return __lower_bound<const_iterator>(*this, __x);
816 }833 }
817834
818 template <class _Kp>835 template <class _Kp>
819 requires __is_compare_transparent836 requires __is_compare_transparent
820 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {837 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {
821 return __lower_bound<iterator>(*this, __x);838 return __lower_bound<iterator>(*this, __x);
822 }839 }
823840
824 template <class _Kp>841 template <class _Kp>
825 requires __is_compare_transparent842 requires __is_compare_transparent
826 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {843 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {
827 return __lower_bound<const_iterator>(*this, __x);844 return __lower_bound<const_iterator>(*this, __x);
828 }845 }
829846
830 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {847 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {
831 return __upper_bound<iterator>(*this, __x);848 return __upper_bound<iterator>(*this, __x);
832 }849 }
833850
834 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const key_type& __x) const {851 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
852 upper_bound(const key_type& __x) const {
835 return __upper_bound<const_iterator>(*this, __x);853 return __upper_bound<const_iterator>(*this, __x);
836 }854 }
837855
838 template <class _Kp>856 template <class _Kp>
839 requires __is_compare_transparent857 requires __is_compare_transparent
840 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {858 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {
841 return __upper_bound<iterator>(*this, __x);859 return __upper_bound<iterator>(*this, __x);
842 }860 }
843861
844 template <class _Kp>862 template <class _Kp>
845 requires __is_compare_transparent863 requires __is_compare_transparent
846 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {864 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {
847 return __upper_bound<const_iterator>(*this, __x);865 return __upper_bound<const_iterator>(*this, __x);
848 }866 }
849867
850 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __x) {868 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
869 equal_range(const key_type& __x) {
851 return __equal_range_impl(*this, __x);870 return __equal_range_impl(*this, __x);
852 }871 }
853872
854 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>873 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
855 equal_range(const key_type& __x) const {874 equal_range(const key_type& __x) const {
856 return __equal_range_impl(*this, __x);875 return __equal_range_impl(*this, __x);
857 }876 }
858877
859 template <class _Kp>878 template <class _Kp>
860 requires __is_compare_transparent879 requires __is_compare_transparent
861 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _Kp& __x) {880 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
881 equal_range(const _Kp& __x) {
862 return __equal_range_impl(*this, __x);882 return __equal_range_impl(*this, __x);
863 }883 }
864 template <class _Kp>884 template <class _Kp>
865 requires __is_compare_transparent885 requires __is_compare_transparent
866 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>886 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
867 equal_range(const _Kp& __x) const {887 equal_range(const _Kp& __x) const {
868 return __equal_range_impl(*this, __x);888 return __equal_range_impl(*this, __x);
869 }889 }
...@@ -878,7 +898,8 @@ public:...@@ -878,7 +898,8 @@ public:
878 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);898 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
879 }899 }
880900
881 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_map& __x, flat_map& __y) noexcept {901 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
902 swap(flat_map& __x, flat_map& __y) noexcept(noexcept(__x.swap(__y))) {
882 __x.swap(__y);903 __x.swap(__y);
883 }904 }
884905
...@@ -913,7 +934,7 @@ private:...@@ -913,7 +934,7 @@ private:
913 __compare_(std::forward<_CompArg>(__comp)...) {}934 __compare_(std::forward<_CompArg>(__comp)...) {}
914935
915 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_sorted_and_unique(auto&& __key_container) const {936 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_sorted_and_unique(auto&& __key_container) const {
916 auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) { return !__compare_(__x, __y); };937 auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) -> bool { return !__compare_(__x, __y); };
917 return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);938 return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);
918 }939 }
919940
...@@ -946,7 +967,7 @@ private:...@@ -946,7 +967,7 @@ private:
946 auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);967 auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);
947 auto __append_start_offset = __containers_.keys.size() - __num_of_appended;968 auto __append_start_offset = __containers_.keys.size() - __num_of_appended;
948 auto __end = __zv.end();969 auto __end = __zv.end();
949 auto __compare_key = [this](const auto& __p1, const auto& __p2) {970 auto __compare_key = [this](const auto& __p1, const auto& __p2) -> bool {
950 return __compare_(std::get<0>(__p1), std::get<0>(__p2));971 return __compare_(std::get<0>(__p1), std::get<0>(__p2));
951 };972 };
952 if constexpr (!_WasSorted) {973 if constexpr (!_WasSorted) {
...@@ -1125,8 +1146,7 @@ private:...@@ -1125,8 +1146,7 @@ private:
1125};1146};
11261147
1127template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>1148template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
1128 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&1149 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
1129 !__is_allocator<_MappedContainer>::value &&
1130 is_invocable_v<const _Compare&,1150 is_invocable_v<const _Compare&,
1131 const typename _KeyContainer::value_type&,1151 const typename _KeyContainer::value_type&,
1132 const typename _KeyContainer::value_type&>)1152 const typename _KeyContainer::value_type&>)
...@@ -1139,7 +1159,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare = _Compare())...@@ -1139,7 +1159,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare = _Compare())
11391159
1140template <class _KeyContainer, class _MappedContainer, class _Allocator>1160template <class _KeyContainer, class _MappedContainer, class _Allocator>
1141 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&1161 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
1142 !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)1162 !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
1143flat_map(_KeyContainer, _MappedContainer, _Allocator)1163flat_map(_KeyContainer, _MappedContainer, _Allocator)
1144 -> flat_map<typename _KeyContainer::value_type,1164 -> flat_map<typename _KeyContainer::value_type,
1145 typename _MappedContainer::value_type,1165 typename _MappedContainer::value_type,
...@@ -1148,9 +1168,8 @@ flat_map(_KeyContainer, _MappedContainer, _Allocator)...@@ -1148,9 +1168,8 @@ flat_map(_KeyContainer, _MappedContainer, _Allocator)
1148 _MappedContainer>;1168 _MappedContainer>;
11491169
1150template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>1170template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
1151 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&1171 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
1152 !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&1172 uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
1153 uses_allocator_v<_MappedContainer, _Allocator> &&
1154 is_invocable_v<const _Compare&,1173 is_invocable_v<const _Compare&,
1155 const typename _KeyContainer::value_type&,1174 const typename _KeyContainer::value_type&,
1156 const typename _KeyContainer::value_type&>)1175 const typename _KeyContainer::value_type&>)
...@@ -1162,8 +1181,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare, _Allocator)...@@ -1162,8 +1181,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare, _Allocator)
1162 _MappedContainer>;1181 _MappedContainer>;
11631182
1164template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>1183template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
1165 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&1184 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
1166 !__is_allocator<_MappedContainer>::value &&
1167 is_invocable_v<const _Compare&,1185 is_invocable_v<const _Compare&,
1168 const typename _KeyContainer::value_type&,1186 const typename _KeyContainer::value_type&,
1169 const typename _KeyContainer::value_type&>)1187 const typename _KeyContainer::value_type&>)
...@@ -1176,7 +1194,7 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare = _Compare()...@@ -1176,7 +1194,7 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare = _Compare()
11761194
1177template <class _KeyContainer, class _MappedContainer, class _Allocator>1195template <class _KeyContainer, class _MappedContainer, class _Allocator>
1178 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&1196 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
1179 !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)1197 !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
1180flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Allocator)1198flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Allocator)
1181 -> flat_map<typename _KeyContainer::value_type,1199 -> flat_map<typename _KeyContainer::value_type,
1182 typename _MappedContainer::value_type,1200 typename _MappedContainer::value_type,
...@@ -1185,9 +1203,8 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Allocator)...@@ -1185,9 +1203,8 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Allocator)
1185 _MappedContainer>;1203 _MappedContainer>;
11861204
1187template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>1205template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
1188 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&1206 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
1189 !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&1207 uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
1190 uses_allocator_v<_MappedContainer, _Allocator> &&
1191 is_invocable_v<const _Compare&,1208 is_invocable_v<const _Compare&,
1192 const typename _KeyContainer::value_type&,1209 const typename _KeyContainer::value_type&,
1193 const typename _KeyContainer::value_type&>)1210 const typename _KeyContainer::value_type&>)
...@@ -1199,19 +1216,19 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare, _Allocator)...@@ -1199,19 +1216,19 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare, _Allocator)
1199 _MappedContainer>;1216 _MappedContainer>;
12001217
1201template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>1218template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
1202 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)1219 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
1203flat_map(_InputIterator, _InputIterator, _Compare = _Compare())1220flat_map(_InputIterator, _InputIterator, _Compare = _Compare())
1204 -> flat_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;1221 -> flat_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
12051222
1206template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>1223template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
1207 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)1224 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
1208flat_map(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())1225flat_map(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())
1209 -> flat_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;1226 -> flat_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
12101227
1211template <ranges::input_range _Range,1228template <ranges::input_range _Range,
1212 class _Compare = less<__range_key_type<_Range>>,1229 class _Compare = less<__range_key_type<_Range>>,
1213 class _Allocator = allocator<byte>,1230 class _Allocator = allocator<byte>,
1214 class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>1231 class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
1215flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_map<1232flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_map<
1216 __range_key_type<_Range>,1233 __range_key_type<_Range>,
1217 __range_mapped_type<_Range>,1234 __range_mapped_type<_Range>,
...@@ -1219,7 +1236,7 @@ flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(...@@ -1219,7 +1236,7 @@ flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(
1219 vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,1236 vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
1220 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;1237 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
12211238
1222template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>1239template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
1223flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<1240flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<
1224 __range_key_type<_Range>,1241 __range_key_type<_Range>,
1225 __range_mapped_type<_Range>,1242 __range_mapped_type<_Range>,
...@@ -1228,11 +1245,11 @@ flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<...@@ -1228,11 +1245,11 @@ flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<
1228 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;1245 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
12291246
1230template <class _Key, class _Tp, class _Compare = less<_Key>>1247template <class _Key, class _Tp, class _Compare = less<_Key>>
1231 requires(!__is_allocator<_Compare>::value)1248 requires(!__is_allocator_v<_Compare>)
1232flat_map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>;1249flat_map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>;
12331250
1234template <class _Key, class _Tp, class _Compare = less<_Key>>1251template <class _Key, class _Tp, class _Compare = less<_Key>>
1235 requires(!__is_allocator<_Compare>::value)1252 requires(!__is_allocator_v<_Compare>)
1236flat_map(sorted_unique_t, initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>;1253flat_map(sorted_unique_t, initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>;
12371254
1238template <class _Key, class _Tp, class _Compare, class _KeyContainer, class _MappedContainer, class _Allocator>1255template <class _Key, class _Tp, class _Compare, class _KeyContainer, class _MappedContainer, class _Allocator>
lib/libcxx/include/__flat_map/flat_multimap.h+251-172
...@@ -22,7 +22,6 @@...@@ -22,7 +22,6 @@
22#include <__algorithm/upper_bound.h>22#include <__algorithm/upper_bound.h>
23#include <__assert>23#include <__assert>
24#include <__compare/synth_three_way.h>24#include <__compare/synth_three_way.h>
25#include <__concepts/convertible_to.h>
26#include <__concepts/swappable.h>25#include <__concepts/swappable.h>
27#include <__config>26#include <__config>
28#include <__cstddef/byte.h>27#include <__cstddef/byte.h>
...@@ -30,7 +29,6 @@...@@ -30,7 +29,6 @@
30#include <__flat_map/key_value_iterator.h>29#include <__flat_map/key_value_iterator.h>
31#include <__flat_map/sorted_equivalent.h>30#include <__flat_map/sorted_equivalent.h>
32#include <__flat_map/utils.h>31#include <__flat_map/utils.h>
33#include <__functional/invoke.h>
34#include <__functional/is_transparent.h>32#include <__functional/is_transparent.h>
35#include <__functional/operations.h>33#include <__functional/operations.h>
36#include <__fwd/vector.h>34#include <__fwd/vector.h>
...@@ -47,7 +45,7 @@...@@ -47,7 +45,7 @@
47#include <__ranges/container_compatible_range.h>45#include <__ranges/container_compatible_range.h>
48#include <__ranges/drop_view.h>46#include <__ranges/drop_view.h>
49#include <__ranges/from_range.h>47#include <__ranges/from_range.h>
50#include <__ranges/ref_view.h>48#include <__ranges/range_adaptor.h>
51#include <__ranges/size.h>49#include <__ranges/size.h>
52#include <__ranges/subrange.h>50#include <__ranges/subrange.h>
53#include <__ranges/zip_view.h>51#include <__ranges/zip_view.h>
...@@ -57,14 +55,12 @@...@@ -57,14 +55,12 @@
57#include <__type_traits/is_allocator.h>55#include <__type_traits/is_allocator.h>
58#include <__type_traits/is_nothrow_constructible.h>56#include <__type_traits/is_nothrow_constructible.h>
59#include <__type_traits/is_same.h>57#include <__type_traits/is_same.h>
60#include <__type_traits/maybe_const.h>
61#include <__utility/exception_guard.h>58#include <__utility/exception_guard.h>
62#include <__utility/move.h>59#include <__utility/move.h>
63#include <__utility/pair.h>60#include <__utility/pair.h>
64#include <__utility/scope_guard.h>61#include <__utility/scope_guard.h>
65#include <__vector/vector.h>62#include <__vector/vector.h>
66#include <initializer_list>63#include <initializer_list>
67#include <stdexcept>
6864
69#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)65#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
70# pragma GCC system_header66# pragma GCC system_header
...@@ -114,11 +110,12 @@ public:...@@ -114,11 +110,12 @@ public:
114 class value_compare {110 class value_compare {
115 private:111 private:
116 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __comp_;112 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __comp_;
117 _LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : __comp_(__c) {}113 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare(key_compare __c) : __comp_(__c) {}
118 friend flat_multimap;114 friend flat_multimap;
119115
120 public:116 public:
121 _LIBCPP_HIDE_FROM_ABI bool operator()(const_reference __x, const_reference __y) const {117 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
118 operator()(const_reference __x, const_reference __y) const {
122 return __comp_(__x.first, __y.first);119 return __comp_(__x.first, __y.first);
123 }120 }
124 };121 };
...@@ -137,17 +134,17 @@ private:...@@ -137,17 +134,17 @@ private:
137134
138public:135public:
139 // [flat.map.cons], construct/copy/destroy136 // [flat.map.cons], construct/copy/destroy
140 _LIBCPP_HIDE_FROM_ABI flat_multimap() noexcept(137 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap() noexcept(
141 is_nothrow_default_constructible_v<_KeyContainer> && is_nothrow_default_constructible_v<_MappedContainer> &&138 is_nothrow_default_constructible_v<_KeyContainer> && is_nothrow_default_constructible_v<_MappedContainer> &&
142 is_nothrow_default_constructible_v<_Compare>)139 is_nothrow_default_constructible_v<_Compare>)
143 : __containers_(), __compare_() {}140 : __containers_(), __compare_() {}
144141
145 _LIBCPP_HIDE_FROM_ABI flat_multimap(const flat_multimap&) = default;142 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(const flat_multimap&) = default;
146143
147 // The copy/move constructors are not specified in the spec, which means they should be defaulted.144 // The copy/move constructors are not specified in the spec, which means they should be defaulted.
148 // However, the move constructor can potentially leave a moved-from object in an inconsistent145 // However, the move constructor can potentially leave a moved-from object in an inconsistent
149 // state if an exception is thrown.146 // state if an exception is thrown.
150 _LIBCPP_HIDE_FROM_ABI flat_multimap(flat_multimap&& __other) noexcept(147 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(flat_multimap&& __other) noexcept(
151 is_nothrow_move_constructible_v<_KeyContainer> && is_nothrow_move_constructible_v<_MappedContainer> &&148 is_nothrow_move_constructible_v<_KeyContainer> && is_nothrow_move_constructible_v<_MappedContainer> &&
152 is_nothrow_move_constructible_v<_Compare>)149 is_nothrow_move_constructible_v<_Compare>)
153# if _LIBCPP_HAS_EXCEPTIONS150# if _LIBCPP_HAS_EXCEPTIONS
...@@ -168,7 +165,8 @@ public:...@@ -168,7 +165,8 @@ public:
168165
169 template <class _Allocator>166 template <class _Allocator>
170 requires __allocator_ctor_constraint<_Allocator>167 requires __allocator_ctor_constraint<_Allocator>
171 _LIBCPP_HIDE_FROM_ABI flat_multimap(const flat_multimap& __other, const _Allocator& __alloc)168 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
169 flat_multimap(const flat_multimap& __other, const _Allocator& __alloc)
172 : flat_multimap(__ctor_uses_allocator_tag{},170 : flat_multimap(__ctor_uses_allocator_tag{},
173 __alloc,171 __alloc,
174 __other.__containers_.keys,172 __other.__containers_.keys,
...@@ -177,7 +175,7 @@ public:...@@ -177,7 +175,7 @@ public:
177175
178 template <class _Allocator>176 template <class _Allocator>
179 requires __allocator_ctor_constraint<_Allocator>177 requires __allocator_ctor_constraint<_Allocator>
180 _LIBCPP_HIDE_FROM_ABI flat_multimap(flat_multimap&& __other, const _Allocator& __alloc)178 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(flat_multimap&& __other, const _Allocator& __alloc)
181# if _LIBCPP_HAS_EXCEPTIONS179# if _LIBCPP_HAS_EXCEPTIONS
182 try180 try
183# endif // _LIBCPP_HAS_EXCEPTIONS181# endif // _LIBCPP_HAS_EXCEPTIONS
...@@ -194,7 +192,7 @@ public:...@@ -194,7 +192,7 @@ public:
194# endif // _LIBCPP_HAS_EXCEPTIONS192# endif // _LIBCPP_HAS_EXCEPTIONS
195 }193 }
196194
197 _LIBCPP_HIDE_FROM_ABI flat_multimap(195 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
198 key_container_type __key_cont, mapped_container_type __mapped_cont, const key_compare& __comp = key_compare())196 key_container_type __key_cont, mapped_container_type __mapped_cont, const key_compare& __comp = key_compare())
199 : __containers_{.keys = std::move(__key_cont), .values = std::move(__mapped_cont)}, __compare_(__comp) {197 : __containers_{.keys = std::move(__key_cont), .values = std::move(__mapped_cont)}, __compare_(__comp) {
200 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),198 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
...@@ -204,7 +202,7 @@ public:...@@ -204,7 +202,7 @@ public:
204202
205 template <class _Allocator>203 template <class _Allocator>
206 requires __allocator_ctor_constraint<_Allocator>204 requires __allocator_ctor_constraint<_Allocator>
207 _LIBCPP_HIDE_FROM_ABI flat_multimap(205 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
208 const key_container_type& __key_cont, const mapped_container_type& __mapped_cont, const _Allocator& __alloc)206 const key_container_type& __key_cont, const mapped_container_type& __mapped_cont, const _Allocator& __alloc)
209 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont) {207 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont) {
210 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),208 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
...@@ -214,22 +212,22 @@ public:...@@ -214,22 +212,22 @@ public:
214212
215 template <class _Allocator>213 template <class _Allocator>
216 requires __allocator_ctor_constraint<_Allocator>214 requires __allocator_ctor_constraint<_Allocator>
217 _LIBCPP_HIDE_FROM_ABI215 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
218 flat_multimap(const key_container_type& __key_cont,216 const key_container_type& __key_cont,
219 const mapped_container_type& __mapped_cont,217 const mapped_container_type& __mapped_cont,
220 const key_compare& __comp,218 const key_compare& __comp,
221 const _Allocator& __alloc)219 const _Allocator& __alloc)
222 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont, __comp) {220 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont, __comp) {
223 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),221 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
224 "flat_multimap keys and mapped containers have different size");222 "flat_multimap keys and mapped containers have different size");
225 __sort();223 __sort();
226 }224 }
227225
228 _LIBCPP_HIDE_FROM_ABI226 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
229 flat_multimap(sorted_equivalent_t,227 sorted_equivalent_t,
230 key_container_type __key_cont,228 key_container_type __key_cont,
231 mapped_container_type __mapped_cont,229 mapped_container_type __mapped_cont,
232 const key_compare& __comp = key_compare())230 const key_compare& __comp = key_compare())
233 : __containers_{.keys = std::move(__key_cont), .values = std::move(__mapped_cont)}, __compare_(__comp) {231 : __containers_{.keys = std::move(__key_cont), .values = std::move(__mapped_cont)}, __compare_(__comp) {
234 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),232 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
235 "flat_multimap keys and mapped containers have different size");233 "flat_multimap keys and mapped containers have different size");
...@@ -238,11 +236,11 @@ public:...@@ -238,11 +236,11 @@ public:
238236
239 template <class _Allocator>237 template <class _Allocator>
240 requires __allocator_ctor_constraint<_Allocator>238 requires __allocator_ctor_constraint<_Allocator>
241 _LIBCPP_HIDE_FROM_ABI239 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
242 flat_multimap(sorted_equivalent_t,240 sorted_equivalent_t,
243 const key_container_type& __key_cont,241 const key_container_type& __key_cont,
244 const mapped_container_type& __mapped_cont,242 const mapped_container_type& __mapped_cont,
245 const _Allocator& __alloc)243 const _Allocator& __alloc)
246 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont) {244 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont) {
247 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),245 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
248 "flat_multimap keys and mapped containers have different size");246 "flat_multimap keys and mapped containers have different size");
...@@ -251,33 +249,35 @@ public:...@@ -251,33 +249,35 @@ public:
251249
252 template <class _Allocator>250 template <class _Allocator>
253 requires __allocator_ctor_constraint<_Allocator>251 requires __allocator_ctor_constraint<_Allocator>
254 _LIBCPP_HIDE_FROM_ABI252 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
255 flat_multimap(sorted_equivalent_t,253 sorted_equivalent_t,
256 const key_container_type& __key_cont,254 const key_container_type& __key_cont,
257 const mapped_container_type& __mapped_cont,255 const mapped_container_type& __mapped_cont,
258 const key_compare& __comp,256 const key_compare& __comp,
259 const _Allocator& __alloc)257 const _Allocator& __alloc)
260 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont, __comp) {258 : flat_multimap(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont, __comp) {
261 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),259 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
262 "flat_multimap keys and mapped containers have different size");260 "flat_multimap keys and mapped containers have different size");
263 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__is_sorted(__containers_.keys), "Key container is not sorted");261 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__is_sorted(__containers_.keys), "Key container is not sorted");
264 }262 }
265263
266 _LIBCPP_HIDE_FROM_ABI explicit flat_multimap(const key_compare& __comp) : __containers_(), __compare_(__comp) {}264 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_multimap(const key_compare& __comp)
265 : __containers_(), __compare_(__comp) {}
267266
268 template <class _Allocator>267 template <class _Allocator>
269 requires __allocator_ctor_constraint<_Allocator>268 requires __allocator_ctor_constraint<_Allocator>
270 _LIBCPP_HIDE_FROM_ABI flat_multimap(const key_compare& __comp, const _Allocator& __alloc)269 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
270 flat_multimap(const key_compare& __comp, const _Allocator& __alloc)
271 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {}271 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {}
272272
273 template <class _Allocator>273 template <class _Allocator>
274 requires __allocator_ctor_constraint<_Allocator>274 requires __allocator_ctor_constraint<_Allocator>
275 _LIBCPP_HIDE_FROM_ABI explicit flat_multimap(const _Allocator& __alloc)275 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_multimap(const _Allocator& __alloc)
276 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {}276 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {}
277277
278 template <class _InputIterator>278 template <class _InputIterator>
279 requires __has_input_iterator_category<_InputIterator>::value279 requires __has_input_iterator_category<_InputIterator>::value
280 _LIBCPP_HIDE_FROM_ABI280 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
281 flat_multimap(_InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())281 flat_multimap(_InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
282 : __containers_(), __compare_(__comp) {282 : __containers_(), __compare_(__comp) {
283 insert(__first, __last);283 insert(__first, __last);
...@@ -285,7 +285,7 @@ public:...@@ -285,7 +285,7 @@ public:
285285
286 template <class _InputIterator, class _Allocator>286 template <class _InputIterator, class _Allocator>
287 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)287 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
288 _LIBCPP_HIDE_FROM_ABI288 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
289 flat_multimap(_InputIterator __first, _InputIterator __last, const key_compare& __comp, const _Allocator& __alloc)289 flat_multimap(_InputIterator __first, _InputIterator __last, const key_compare& __comp, const _Allocator& __alloc)
290 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {290 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {
291 insert(__first, __last);291 insert(__first, __last);
...@@ -293,91 +293,99 @@ public:...@@ -293,91 +293,99 @@ public:
293293
294 template <class _InputIterator, class _Allocator>294 template <class _InputIterator, class _Allocator>
295 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)295 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
296 _LIBCPP_HIDE_FROM_ABI flat_multimap(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)296 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
297 flat_multimap(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
297 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {298 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {
298 insert(__first, __last);299 insert(__first, __last);
299 }300 }
300301
301 template <_ContainerCompatibleRange<value_type> _Range>302 template <_ContainerCompatibleRange<value_type> _Range>
302 _LIBCPP_HIDE_FROM_ABI flat_multimap(from_range_t __fr, _Range&& __rg)303 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(from_range_t __fr, _Range&& __rg)
303 : flat_multimap(__fr, std::forward<_Range>(__rg), key_compare()) {}304 : flat_multimap(__fr, std::forward<_Range>(__rg), key_compare()) {}
304305
305 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>306 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
306 requires __allocator_ctor_constraint<_Allocator>307 requires __allocator_ctor_constraint<_Allocator>
307 _LIBCPP_HIDE_FROM_ABI flat_multimap(from_range_t, _Range&& __rg, const _Allocator& __alloc)308 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
309 flat_multimap(from_range_t, _Range&& __rg, const _Allocator& __alloc)
308 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {310 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {
309 insert_range(std::forward<_Range>(__rg));311 insert_range(std::forward<_Range>(__rg));
310 }312 }
311313
312 template <_ContainerCompatibleRange<value_type> _Range>314 template <_ContainerCompatibleRange<value_type> _Range>
313 _LIBCPP_HIDE_FROM_ABI flat_multimap(from_range_t, _Range&& __rg, const key_compare& __comp) : flat_multimap(__comp) {315 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
316 flat_multimap(from_range_t, _Range&& __rg, const key_compare& __comp)
317 : flat_multimap(__comp) {
314 insert_range(std::forward<_Range>(__rg));318 insert_range(std::forward<_Range>(__rg));
315 }319 }
316320
317 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>321 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
318 requires __allocator_ctor_constraint<_Allocator>322 requires __allocator_ctor_constraint<_Allocator>
319 _LIBCPP_HIDE_FROM_ABI flat_multimap(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)323 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
324 flat_multimap(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)
320 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {325 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {
321 insert_range(std::forward<_Range>(__rg));326 insert_range(std::forward<_Range>(__rg));
322 }327 }
323328
324 template <class _InputIterator>329 template <class _InputIterator>
325 requires __has_input_iterator_category<_InputIterator>::value330 requires __has_input_iterator_category<_InputIterator>::value
326 _LIBCPP_HIDE_FROM_ABI flat_multimap(331 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
327 sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())332 sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
328 : __containers_(), __compare_(__comp) {333 : __containers_(), __compare_(__comp) {
329 insert(sorted_equivalent, __first, __last);334 insert(sorted_equivalent, __first, __last);
330 }335 }
331 template <class _InputIterator, class _Allocator>336 template <class _InputIterator, class _Allocator>
332 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)337 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
333 _LIBCPP_HIDE_FROM_ABI338 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
334 flat_multimap(sorted_equivalent_t,339 sorted_equivalent_t,
335 _InputIterator __first,340 _InputIterator __first,
336 _InputIterator __last,341 _InputIterator __last,
337 const key_compare& __comp,342 const key_compare& __comp,
338 const _Allocator& __alloc)343 const _Allocator& __alloc)
339 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {344 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {
340 insert(sorted_equivalent, __first, __last);345 insert(sorted_equivalent, __first, __last);
341 }346 }
342347
343 template <class _InputIterator, class _Allocator>348 template <class _InputIterator, class _Allocator>
344 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)349 requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
345 _LIBCPP_HIDE_FROM_ABI350 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
346 flat_multimap(sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const _Allocator& __alloc)351 flat_multimap(sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
347 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {352 : flat_multimap(__ctor_uses_allocator_empty_tag{}, __alloc) {
348 insert(sorted_equivalent, __first, __last);353 insert(sorted_equivalent, __first, __last);
349 }354 }
350355
351 _LIBCPP_HIDE_FROM_ABI flat_multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())356 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
357 flat_multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
352 : flat_multimap(__il.begin(), __il.end(), __comp) {}358 : flat_multimap(__il.begin(), __il.end(), __comp) {}
353359
354 template <class _Allocator>360 template <class _Allocator>
355 requires __allocator_ctor_constraint<_Allocator>361 requires __allocator_ctor_constraint<_Allocator>
356 _LIBCPP_HIDE_FROM_ABI362 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
357 flat_multimap(initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)363 flat_multimap(initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
358 : flat_multimap(__il.begin(), __il.end(), __comp, __alloc) {}364 : flat_multimap(__il.begin(), __il.end(), __comp, __alloc) {}
359365
360 template <class _Allocator>366 template <class _Allocator>
361 requires __allocator_ctor_constraint<_Allocator>367 requires __allocator_ctor_constraint<_Allocator>
362 _LIBCPP_HIDE_FROM_ABI flat_multimap(initializer_list<value_type> __il, const _Allocator& __alloc)368 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
369 flat_multimap(initializer_list<value_type> __il, const _Allocator& __alloc)
363 : flat_multimap(__il.begin(), __il.end(), __alloc) {}370 : flat_multimap(__il.begin(), __il.end(), __alloc) {}
364371
365 _LIBCPP_HIDE_FROM_ABI372 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
366 flat_multimap(sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp = key_compare())373 flat_multimap(sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp = key_compare())
367 : flat_multimap(sorted_equivalent, __il.begin(), __il.end(), __comp) {}374 : flat_multimap(sorted_equivalent, __il.begin(), __il.end(), __comp) {}
368375
369 template <class _Allocator>376 template <class _Allocator>
370 requires __allocator_ctor_constraint<_Allocator>377 requires __allocator_ctor_constraint<_Allocator>
371 _LIBCPP_HIDE_FROM_ABI flat_multimap(378 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
372 sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)379 sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
373 : flat_multimap(sorted_equivalent, __il.begin(), __il.end(), __comp, __alloc) {}380 : flat_multimap(sorted_equivalent, __il.begin(), __il.end(), __comp, __alloc) {}
374381
375 template <class _Allocator>382 template <class _Allocator>
376 requires __allocator_ctor_constraint<_Allocator>383 requires __allocator_ctor_constraint<_Allocator>
377 _LIBCPP_HIDE_FROM_ABI flat_multimap(sorted_equivalent_t, initializer_list<value_type> __il, const _Allocator& __alloc)384 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
385 flat_multimap(sorted_equivalent_t, initializer_list<value_type> __il, const _Allocator& __alloc)
378 : flat_multimap(sorted_equivalent, __il.begin(), __il.end(), __alloc) {}386 : flat_multimap(sorted_equivalent, __il.begin(), __il.end(), __alloc) {}
379387
380 _LIBCPP_HIDE_FROM_ABI flat_multimap& operator=(initializer_list<value_type> __il) {388 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap& operator=(initializer_list<value_type> __il) {
381 clear();389 clear();
382 insert(__il);390 insert(__il);
383 return *this;391 return *this;
...@@ -386,9 +394,9 @@ public:...@@ -386,9 +394,9 @@ public:
386 // copy/move assignment are not specified in the spec (defaulted)394 // copy/move assignment are not specified in the spec (defaulted)
387 // but move assignment can potentially leave moved from object in an inconsistent395 // but move assignment can potentially leave moved from object in an inconsistent
388 // state if an exception is thrown396 // state if an exception is thrown
389 _LIBCPP_HIDE_FROM_ABI flat_multimap& operator=(const flat_multimap&) = default;397 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap& operator=(const flat_multimap&) = default;
390398
391 _LIBCPP_HIDE_FROM_ABI flat_multimap& operator=(flat_multimap&& __other) noexcept(399 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap& operator=(flat_multimap&& __other) noexcept(
392 is_nothrow_move_assignable_v<_KeyContainer> && is_nothrow_move_assignable_v<_MappedContainer> &&400 is_nothrow_move_assignable_v<_KeyContainer> && is_nothrow_move_assignable_v<_MappedContainer> &&
393 is_nothrow_move_assignable_v<_Compare>) {401 is_nothrow_move_assignable_v<_Compare>) {
394 auto __clear_other_guard = std::__make_scope_guard([&]() noexcept { __other.clear() /* noexcept */; });402 auto __clear_other_guard = std::__make_scope_guard([&]() noexcept { __other.clear() /* noexcept */; });
...@@ -400,38 +408,58 @@ public:...@@ -400,38 +408,58 @@ public:
400 }408 }
401409
402 // iterators410 // iterators
403 _LIBCPP_HIDE_FROM_ABI iterator begin() noexcept {411 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {
404 return iterator(__containers_.keys.begin(), __containers_.values.begin());412 return iterator(__containers_.keys.begin(), __containers_.values.begin());
405 }413 }
406414
407 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept {415 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {
408 return const_iterator(__containers_.keys.begin(), __containers_.values.begin());416 return const_iterator(__containers_.keys.begin(), __containers_.values.begin());
409 }417 }
410418
411 _LIBCPP_HIDE_FROM_ABI iterator end() noexcept {419 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {
412 return iterator(__containers_.keys.end(), __containers_.values.end());420 return iterator(__containers_.keys.end(), __containers_.values.end());
413 }421 }
414422
415 _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept {423 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {
416 return const_iterator(__containers_.keys.end(), __containers_.values.end());424 return const_iterator(__containers_.keys.end(), __containers_.values.end());
417 }425 }
418426
419 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }427 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {
420 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }428 return reverse_iterator(end());
421 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() noexcept { return reverse_iterator(begin()); }429 }
422 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }430 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {
431 return const_reverse_iterator(end());
432 }
433 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {
434 return reverse_iterator(begin());
435 }
436 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {
437 return const_reverse_iterator(begin());
438 }
423439
424 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return begin(); }440 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept {
425 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return end(); }441 return begin();
426 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }442 }
427 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }443 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept {
444 return end();
445 }
446 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {
447 return const_reverse_iterator(end());
448 }
449 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {
450 return const_reverse_iterator(begin());
451 }
428452
429 // [flat.map.capacity], capacity453 // [flat.map.capacity], capacity
430 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __containers_.keys.empty(); }454 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const noexcept {
455 return __containers_.keys.empty();
456 }
431457
432 _LIBCPP_HIDE_FROM_ABI size_type size() const noexcept { return __containers_.keys.size(); }458 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept {
459 return __containers_.keys.size();
460 }
433461
434 _LIBCPP_HIDE_FROM_ABI size_type max_size() const noexcept {462 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept {
435 return std::min<size_type>(__containers_.keys.max_size(), __containers_.values.max_size());463 return std::min<size_type>(__containers_.keys.max_size(), __containers_.values.max_size());
436 }464 }
437465
...@@ -439,7 +467,7 @@ public:...@@ -439,7 +467,7 @@ public:
439 template <class... _Args>467 template <class... _Args>
440 requires is_constructible_v<pair<key_type, mapped_type>, _Args...> && is_move_constructible_v<key_type> &&468 requires is_constructible_v<pair<key_type, mapped_type>, _Args...> && is_move_constructible_v<key_type> &&
441 is_move_constructible_v<mapped_type>469 is_move_constructible_v<mapped_type>
442 _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {470 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace(_Args&&... __args) {
443 std::pair<key_type, mapped_type> __pair(std::forward<_Args>(__args)...);471 std::pair<key_type, mapped_type> __pair(std::forward<_Args>(__args)...);
444 auto __key_it = std::upper_bound(__containers_.keys.begin(), __containers_.keys.end(), __pair.first, __compare_);472 auto __key_it = std::upper_bound(__containers_.keys.begin(), __containers_.keys.end(), __pair.first, __compare_);
445 auto __mapped_it = __corresponding_mapped_it(*this, __key_it);473 auto __mapped_it = __corresponding_mapped_it(*this, __key_it);
...@@ -450,7 +478,7 @@ public:...@@ -450,7 +478,7 @@ public:
450478
451 template <class... _Args>479 template <class... _Args>
452 requires is_constructible_v<pair<key_type, mapped_type>, _Args...>480 requires is_constructible_v<pair<key_type, mapped_type>, _Args...>
453 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __hint, _Args&&... __args) {481 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __hint, _Args&&... __args) {
454 std::pair<key_type, mapped_type> __pair(std::forward<_Args>(__args)...);482 std::pair<key_type, mapped_type> __pair(std::forward<_Args>(__args)...);
455483
456 auto __prev_larger = __hint != cbegin() && __compare_(__pair.first, (__hint - 1)->first);484 auto __prev_larger = __hint != cbegin() && __compare_(__pair.first, (__hint - 1)->first);
...@@ -490,33 +518,35 @@ public:...@@ -490,33 +518,35 @@ public:
490 *this, __key_iter, __mapped_iter, std::move(__pair.first), std::move(__pair.second));518 *this, __key_iter, __mapped_iter, std::move(__pair.first), std::move(__pair.second));
491 }519 }
492520
493 _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return emplace(__x); }521 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const value_type& __x) { return emplace(__x); }
494522
495 _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return emplace(std::move(__x)); }523 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(value_type&& __x) {
524 return emplace(std::move(__x));
525 }
496526
497 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, const value_type& __x) {527 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, const value_type& __x) {
498 return emplace_hint(__hint, __x);528 return emplace_hint(__hint, __x);
499 }529 }
500530
501 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, value_type&& __x) {531 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, value_type&& __x) {
502 return emplace_hint(__hint, std::move(__x));532 return emplace_hint(__hint, std::move(__x));
503 }533 }
504534
505 template <class _PairLike>535 template <class _PairLike>
506 requires is_constructible_v<pair<key_type, mapped_type>, _PairLike>536 requires is_constructible_v<pair<key_type, mapped_type>, _PairLike>
507 _LIBCPP_HIDE_FROM_ABI iterator insert(_PairLike&& __x) {537 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(_PairLike&& __x) {
508 return emplace(std::forward<_PairLike>(__x));538 return emplace(std::forward<_PairLike>(__x));
509 }539 }
510540
511 template <class _PairLike>541 template <class _PairLike>
512 requires is_constructible_v<pair<key_type, mapped_type>, _PairLike>542 requires is_constructible_v<pair<key_type, mapped_type>, _PairLike>
513 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, _PairLike&& __x) {543 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, _PairLike&& __x) {
514 return emplace_hint(__hint, std::forward<_PairLike>(__x));544 return emplace_hint(__hint, std::forward<_PairLike>(__x));
515 }545 }
516546
517 template <class _InputIterator>547 template <class _InputIterator>
518 requires __has_input_iterator_category<_InputIterator>::value548 requires __has_input_iterator_category<_InputIterator>::value
519 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {549 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __first, _InputIterator __last) {
520 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {550 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {
521 __reserve(__last - __first);551 __reserve(__last - __first);
522 }552 }
...@@ -525,7 +555,8 @@ public:...@@ -525,7 +555,8 @@ public:
525555
526 template <class _InputIterator>556 template <class _InputIterator>
527 requires __has_input_iterator_category<_InputIterator>::value557 requires __has_input_iterator_category<_InputIterator>::value
528 _LIBCPP_HIDE_FROM_ABI void insert(sorted_equivalent_t, _InputIterator __first, _InputIterator __last) {558 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
559 insert(sorted_equivalent_t, _InputIterator __first, _InputIterator __last) {
529 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {560 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {
530 __reserve(__last - __first);561 __reserve(__last - __first);
531 }562 }
...@@ -534,7 +565,7 @@ public:...@@ -534,7 +565,7 @@ public:
534 }565 }
535566
536 template <_ContainerCompatibleRange<value_type> _Range>567 template <_ContainerCompatibleRange<value_type> _Range>
537 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {568 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
538 if constexpr (ranges::sized_range<_Range>) {569 if constexpr (ranges::sized_range<_Range>) {
539 __reserve(ranges::size(__range));570 __reserve(ranges::size(__range));
540 }571 }
...@@ -542,19 +573,32 @@ public:...@@ -542,19 +573,32 @@ public:
542 __append_sort_merge</*WasSorted = */ false>(ranges::begin(__range), ranges::end(__range));573 __append_sort_merge</*WasSorted = */ false>(ranges::begin(__range), ranges::end(__range));
543 }574 }
544575
545 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }576 template <_ContainerCompatibleRange<value_type> _Range>
577 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(sorted_equivalent_t, _Range&& __range) {
578 if constexpr (ranges::sized_range<_Range>) {
579 __reserve(ranges::size(__range));
580 }
581
582 __append_sort_merge</*WasSorted = */ true>(ranges::begin(__range), ranges::end(__range));
583 }
584
585 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
586 insert(__il.begin(), __il.end());
587 }
546588
547 _LIBCPP_HIDE_FROM_ABI void insert(sorted_equivalent_t, initializer_list<value_type> __il) {589 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
590 insert(sorted_equivalent_t, initializer_list<value_type> __il) {
548 insert(sorted_equivalent, __il.begin(), __il.end());591 insert(sorted_equivalent, __il.begin(), __il.end());
549 }592 }
550593
551 _LIBCPP_HIDE_FROM_ABI containers extract() && {594 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 containers extract() && {
552 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });595 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });
553 auto __ret = std::move(__containers_);596 auto __ret = std::move(__containers_);
554 return __ret;597 return __ret;
555 }598 }
556599
557 _LIBCPP_HIDE_FROM_ABI void replace(key_container_type&& __key_cont, mapped_container_type&& __mapped_cont) {600 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
601 replace(key_container_type&& __key_cont, mapped_container_type&& __mapped_cont) {
558 _LIBCPP_ASSERT_VALID_INPUT_RANGE(602 _LIBCPP_ASSERT_VALID_INPUT_RANGE(
559 __key_cont.size() == __mapped_cont.size(), "flat_multimap keys and mapped containers have different size");603 __key_cont.size() == __mapped_cont.size(), "flat_multimap keys and mapped containers have different size");
560604
...@@ -565,15 +609,15 @@ public:...@@ -565,15 +609,15 @@ public:
565 __guard.__complete();609 __guard.__complete();
566 }610 }
567611
568 _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __position) {612 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(iterator __position) {
569 return __erase(__position.__key_iter_, __position.__mapped_iter_);613 return __erase(__position.__key_iter_, __position.__mapped_iter_);
570 }614 }
571615
572 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __position) {616 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __position) {
573 return __erase(__position.__key_iter_, __position.__mapped_iter_);617 return __erase(__position.__key_iter_, __position.__mapped_iter_);
574 }618 }
575619
576 _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __x) {620 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __x) {
577 auto [__first, __last] = equal_range(__x);621 auto [__first, __last] = equal_range(__x);
578 auto __res = __last - __first;622 auto __res = __last - __first;
579 erase(__first, __last);623 erase(__first, __last);
...@@ -583,14 +627,14 @@ public:...@@ -583,14 +627,14 @@ public:
583 template <class _Kp>627 template <class _Kp>
584 requires(__is_compare_transparent && !is_convertible_v<_Kp &&, iterator> &&628 requires(__is_compare_transparent && !is_convertible_v<_Kp &&, iterator> &&
585 !is_convertible_v<_Kp &&, const_iterator>)629 !is_convertible_v<_Kp &&, const_iterator>)
586 _LIBCPP_HIDE_FROM_ABI size_type erase(_Kp&& __x) {630 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(_Kp&& __x) {
587 auto [__first, __last] = equal_range(__x);631 auto [__first, __last] = equal_range(__x);
588 auto __res = __last - __first;632 auto __res = __last - __first;
589 erase(__first, __last);633 erase(__first, __last);
590 return __res;634 return __res;
591 }635 }
592636
593 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {637 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __first, const_iterator __last) {
594 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });638 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
595 auto __key_it = __containers_.keys.erase(__first.__key_iter_, __last.__key_iter_);639 auto __key_it = __containers_.keys.erase(__first.__key_iter_, __last.__key_iter_);
596 auto __mapped_it = __containers_.values.erase(__first.__mapped_iter_, __last.__mapped_iter_);640 auto __mapped_it = __containers_.values.erase(__first.__mapped_iter_, __last.__mapped_iter_);
...@@ -598,146 +642,178 @@ public:...@@ -598,146 +642,178 @@ public:
598 return iterator(std::move(__key_it), std::move(__mapped_it));642 return iterator(std::move(__key_it), std::move(__mapped_it));
599 }643 }
600644
601 _LIBCPP_HIDE_FROM_ABI void swap(flat_multimap& __y) noexcept {645 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_multimap& __y) noexcept(
602 // warning: The spec has unconditional noexcept, which means that646 is_nothrow_swappable_v<key_container_type> && is_nothrow_swappable_v<mapped_container_type> &&
603 // if any of the following functions throw an exception,647 is_nothrow_swappable_v<key_compare>) {
604 // std::terminate will be called648 auto __on_failure = std::__make_exception_guard([&]() noexcept {
649 clear() /* noexcept */;
650 __y.clear() /* noexcept */;
651 });
605 ranges::swap(__compare_, __y.__compare_);652 ranges::swap(__compare_, __y.__compare_);
606 ranges::swap(__containers_.keys, __y.__containers_.keys);653 ranges::swap(__containers_.keys, __y.__containers_.keys);
607 ranges::swap(__containers_.values, __y.__containers_.values);654 ranges::swap(__containers_.values, __y.__containers_.values);
655 __on_failure.__complete();
608 }656 }
609657
610 _LIBCPP_HIDE_FROM_ABI void clear() noexcept {658 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept {
611 __containers_.keys.clear();659 __containers_.keys.clear();
612 __containers_.values.clear();660 __containers_.values.clear();
613 }661 }
614662
615 // observers663 // observers
616 _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __compare_; }664 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }
617 _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return value_compare(__compare_); }665 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
666 return value_compare(__compare_);
667 }
618668
619 _LIBCPP_HIDE_FROM_ABI const key_container_type& keys() const noexcept { return __containers_.keys; }669 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const key_container_type& keys() const noexcept {
620 _LIBCPP_HIDE_FROM_ABI const mapped_container_type& values() const noexcept { return __containers_.values; }670 return __containers_.keys;
671 }
672 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_container_type&
673 values() const noexcept {
674 return __containers_.values;
675 }
621676
622 // map operations677 // map operations
623 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __x) { return __find_impl(*this, __x); }678 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {
679 return __find_impl(*this, __x);
680 }
624681
625 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __x) const { return __find_impl(*this, __x); }682 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {
683 return __find_impl(*this, __x);
684 }
626685
627 template <class _Kp>686 template <class _Kp>
628 requires __is_compare_transparent687 requires __is_compare_transparent
629 _LIBCPP_HIDE_FROM_ABI iterator find(const _Kp& __x) {688 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {
630 return __find_impl(*this, __x);689 return __find_impl(*this, __x);
631 }690 }
632691
633 template <class _Kp>692 template <class _Kp>
634 requires __is_compare_transparent693 requires __is_compare_transparent
635 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Kp& __x) const {694 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {
636 return __find_impl(*this, __x);695 return __find_impl(*this, __x);
637 }696 }
638697
639 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __x) const {698 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {
640 auto [__first, __last] = equal_range(__x);699 auto [__first, __last] = equal_range(__x);
641 return __last - __first;700 return __last - __first;
642 }701 }
643702
644 template <class _Kp>703 template <class _Kp>
645 requires __is_compare_transparent704 requires __is_compare_transparent
646 _LIBCPP_HIDE_FROM_ABI size_type count(const _Kp& __x) const {705 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {
647 auto [__first, __last] = equal_range(__x);706 auto [__first, __last] = equal_range(__x);
648 return __last - __first;707 return __last - __first;
649 }708 }
650709
651 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __x) const { return find(__x) != end(); }710 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {
711 return find(__x) != end();
712 }
652713
653 template <class _Kp>714 template <class _Kp>
654 requires __is_compare_transparent715 requires __is_compare_transparent
655 _LIBCPP_HIDE_FROM_ABI bool contains(const _Kp& __x) const {716 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {
656 return find(__x) != end();717 return find(__x) != end();
657 }718 }
658719
659 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __x) { return __lower_bound<iterator>(*this, __x); }720 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {
721 return __lower_bound<iterator>(*this, __x);
722 }
660723
661 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __x) const {724 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
725 lower_bound(const key_type& __x) const {
662 return __lower_bound<const_iterator>(*this, __x);726 return __lower_bound<const_iterator>(*this, __x);
663 }727 }
664728
665 template <class _Kp>729 template <class _Kp>
666 requires __is_compare_transparent730 requires __is_compare_transparent
667 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _Kp& __x) {731 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {
668 return __lower_bound<iterator>(*this, __x);732 return __lower_bound<iterator>(*this, __x);
669 }733 }
670734
671 template <class _Kp>735 template <class _Kp>
672 requires __is_compare_transparent736 requires __is_compare_transparent
673 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _Kp& __x) const {737 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {
674 return __lower_bound<const_iterator>(*this, __x);738 return __lower_bound<const_iterator>(*this, __x);
675 }739 }
676740
677 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __x) { return __upper_bound<iterator>(*this, __x); }741 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {
742 return __upper_bound<iterator>(*this, __x);
743 }
678744
679 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __x) const {745 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
746 upper_bound(const key_type& __x) const {
680 return __upper_bound<const_iterator>(*this, __x);747 return __upper_bound<const_iterator>(*this, __x);
681 }748 }
682749
683 template <class _Kp>750 template <class _Kp>
684 requires __is_compare_transparent751 requires __is_compare_transparent
685 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _Kp& __x) {752 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {
686 return __upper_bound<iterator>(*this, __x);753 return __upper_bound<iterator>(*this, __x);
687 }754 }
688755
689 template <class _Kp>756 template <class _Kp>
690 requires __is_compare_transparent757 requires __is_compare_transparent
691 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _Kp& __x) const {758 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {
692 return __upper_bound<const_iterator>(*this, __x);759 return __upper_bound<const_iterator>(*this, __x);
693 }760 }
694761
695 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __x) {762 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
763 equal_range(const key_type& __x) {
696 return __equal_range_impl(*this, __x);764 return __equal_range_impl(*this, __x);
697 }765 }
698766
699 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __x) const {767 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
768 equal_range(const key_type& __x) const {
700 return __equal_range_impl(*this, __x);769 return __equal_range_impl(*this, __x);
701 }770 }
702771
703 template <class _Kp>772 template <class _Kp>
704 requires __is_compare_transparent773 requires __is_compare_transparent
705 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _Kp& __x) {774 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
775 equal_range(const _Kp& __x) {
706 return __equal_range_impl(*this, __x);776 return __equal_range_impl(*this, __x);
707 }777 }
708 template <class _Kp>778 template <class _Kp>
709 requires __is_compare_transparent779 requires __is_compare_transparent
710 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _Kp& __x) const {780 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
781 equal_range(const _Kp& __x) const {
711 return __equal_range_impl(*this, __x);782 return __equal_range_impl(*this, __x);
712 }783 }
713784
714 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const flat_multimap& __x, const flat_multimap& __y) {785 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
786 operator==(const flat_multimap& __x, const flat_multimap& __y) {
715 return ranges::equal(__x, __y);787 return ranges::equal(__x, __y);
716 }788 }
717789
718 friend _LIBCPP_HIDE_FROM_ABI auto operator<=>(const flat_multimap& __x, const flat_multimap& __y) {790 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 auto
791 operator<=>(const flat_multimap& __x, const flat_multimap& __y) {
719 return std::lexicographical_compare_three_way(792 return std::lexicographical_compare_three_way(
720 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);793 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
721 }794 }
722795
723 friend _LIBCPP_HIDE_FROM_ABI void swap(flat_multimap& __x, flat_multimap& __y) noexcept { __x.swap(__y); }796 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
797 swap(flat_multimap& __x, flat_multimap& __y) noexcept(noexcept(__x.swap(__y))) {
798 __x.swap(__y);
799 }
724800
725private:801private:
726 struct __ctor_uses_allocator_tag {802 struct __ctor_uses_allocator_tag {
727 explicit _LIBCPP_HIDE_FROM_ABI __ctor_uses_allocator_tag() = default;803 explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __ctor_uses_allocator_tag() = default;
728 };804 };
729 struct __ctor_uses_allocator_empty_tag {805 struct __ctor_uses_allocator_empty_tag {
730 explicit _LIBCPP_HIDE_FROM_ABI __ctor_uses_allocator_empty_tag() = default;806 explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __ctor_uses_allocator_empty_tag() = default;
731 };807 };
732808
733 template <class _Allocator, class _KeyCont, class _MappedCont, class... _CompArg>809 template <class _Allocator, class _KeyCont, class _MappedCont, class... _CompArg>
734 requires __allocator_ctor_constraint<_Allocator>810 requires __allocator_ctor_constraint<_Allocator>
735 _LIBCPP_HIDE_FROM_ABI811 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multimap(
736 flat_multimap(__ctor_uses_allocator_tag,812 __ctor_uses_allocator_tag,
737 const _Allocator& __alloc,813 const _Allocator& __alloc,
738 _KeyCont&& __key_cont,814 _KeyCont&& __key_cont,
739 _MappedCont&& __mapped_cont,815 _MappedCont&& __mapped_cont,
740 _CompArg&&... __comp)816 _CompArg&&... __comp)
741 : __containers_{.keys = std::make_obj_using_allocator<key_container_type>(817 : __containers_{.keys = std::make_obj_using_allocator<key_container_type>(
742 __alloc, std::forward<_KeyCont>(__key_cont)),818 __alloc, std::forward<_KeyCont>(__key_cont)),
743 .values = std::make_obj_using_allocator<mapped_container_type>(819 .values = std::make_obj_using_allocator<mapped_container_type>(
...@@ -746,36 +822,39 @@ private:...@@ -746,36 +822,39 @@ private:
746822
747 template <class _Allocator, class... _CompArg>823 template <class _Allocator, class... _CompArg>
748 requires __allocator_ctor_constraint<_Allocator>824 requires __allocator_ctor_constraint<_Allocator>
749 _LIBCPP_HIDE_FROM_ABI flat_multimap(__ctor_uses_allocator_empty_tag, const _Allocator& __alloc, _CompArg&&... __comp)825 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
826 flat_multimap(__ctor_uses_allocator_empty_tag, const _Allocator& __alloc, _CompArg&&... __comp)
750 : __containers_{.keys = std::make_obj_using_allocator<key_container_type>(__alloc),827 : __containers_{.keys = std::make_obj_using_allocator<key_container_type>(__alloc),
751 .values = std::make_obj_using_allocator<mapped_container_type>(__alloc)},828 .values = std::make_obj_using_allocator<mapped_container_type>(__alloc)},
752 __compare_(std::forward<_CompArg>(__comp)...) {}829 __compare_(std::forward<_CompArg>(__comp)...) {}
753830
754 _LIBCPP_HIDE_FROM_ABI bool __is_sorted(auto&& __key_container) const {831 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_sorted(auto&& __key_container) const {
755 return ranges::is_sorted(__key_container, __compare_);832 return ranges::is_sorted(__key_container, __compare_);
756 }833 }
757834
758 _LIBCPP_HIDE_FROM_ABI void __sort() {835 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __sort() {
759 auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);836 auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);
760 ranges::sort(__zv, __compare_, [](const auto& __p) -> decltype(auto) { return std::get<0>(__p); });837 ranges::sort(__zv, __compare_, [](const auto& __p) -> decltype(auto) { return std::get<0>(__p); });
761 }838 }
762839
763 template <class _Self, class _KeyIter>840 template <class _Self, class _KeyIter>
764 _LIBCPP_HIDE_FROM_ABI static auto __corresponding_mapped_it(_Self&& __self, _KeyIter&& __key_iter) {841 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto
842 __corresponding_mapped_it(_Self&& __self, _KeyIter&& __key_iter) {
765 return __self.__containers_.values.begin() +843 return __self.__containers_.values.begin() +
766 static_cast<ranges::range_difference_t<mapped_container_type>>(844 static_cast<ranges::range_difference_t<mapped_container_type>>(
767 ranges::distance(__self.__containers_.keys.begin(), __key_iter));845 ranges::distance(__self.__containers_.keys.begin(), __key_iter));
768 }846 }
769847
770 template <bool _WasSorted, class _InputIterator, class _Sentinel>848 template <bool _WasSorted, class _InputIterator, class _Sentinel>
771 _LIBCPP_HIDE_FROM_ABI void __append_sort_merge(_InputIterator __first, _Sentinel __last) {849 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
850 __append_sort_merge(_InputIterator __first, _Sentinel __last) {
772 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });851 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
773 size_t __num_appended = __flat_map_utils::__append(*this, std::move(__first), std::move(__last));852 size_t __num_appended = __flat_map_utils::__append(*this, std::move(__first), std::move(__last));
774 if (__num_appended != 0) {853 if (__num_appended != 0) {
775 auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);854 auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);
776 auto __append_start_offset = __containers_.keys.size() - __num_appended;855 auto __append_start_offset = __containers_.keys.size() - __num_appended;
777 auto __end = __zv.end();856 auto __end = __zv.end();
778 auto __compare_key = [this](const auto& __p1, const auto& __p2) {857 auto __compare_key = [this](const auto& __p1, const auto& __p2) -> bool {
779 return __compare_(std::get<0>(__p1), std::get<0>(__p2));858 return __compare_(std::get<0>(__p1), std::get<0>(__p2));
780 };859 };
781 if constexpr (!_WasSorted) {860 if constexpr (!_WasSorted) {
...@@ -791,7 +870,7 @@ private:...@@ -791,7 +870,7 @@ private:
791 }870 }
792871
793 template <class _Self, class _Kp>872 template <class _Self, class _Kp>
794 _LIBCPP_HIDE_FROM_ABI static auto __find_impl(_Self&& __self, const _Kp& __key) {873 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto __find_impl(_Self&& __self, const _Kp& __key) {
795 auto __it = __self.lower_bound(__key);874 auto __it = __self.lower_bound(__key);
796 auto __last = __self.end();875 auto __last = __self.end();
797 if (__it == __last || __self.__compare_(__key, __it->first)) {876 if (__it == __last || __self.__compare_(__key, __it->first)) {
...@@ -801,7 +880,7 @@ private:...@@ -801,7 +880,7 @@ private:
801 }880 }
802881
803 template <class _Self, class _Kp>882 template <class _Self, class _Kp>
804 _LIBCPP_HIDE_FROM_ABI static auto __equal_range_impl(_Self&& __self, const _Kp& __key) {883 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto __equal_range_impl(_Self&& __self, const _Kp& __key) {
805 auto [__key_first, __key_last] =884 auto [__key_first, __key_last] =
806 std::equal_range(__self.__containers_.keys.begin(), __self.__containers_.keys.end(), __key, __self.__compare_);885 std::equal_range(__self.__containers_.keys.begin(), __self.__containers_.keys.end(), __key, __self.__compare_);
807886
...@@ -811,7 +890,7 @@ private:...@@ -811,7 +890,7 @@ private:
811 }890 }
812891
813 template <class _Res, class _Self, class _Kp>892 template <class _Res, class _Self, class _Kp>
814 _LIBCPP_HIDE_FROM_ABI static _Res __lower_bound(_Self&& __self, _Kp& __x) {893 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static _Res __lower_bound(_Self&& __self, _Kp& __x) {
815 auto __key_iter =894 auto __key_iter =
816 std::lower_bound(__self.__containers_.keys.begin(), __self.__containers_.keys.end(), __x, __self.__compare_);895 std::lower_bound(__self.__containers_.keys.begin(), __self.__containers_.keys.end(), __x, __self.__compare_);
817 auto __mapped_iter = __corresponding_mapped_it(__self, __key_iter);896 auto __mapped_iter = __corresponding_mapped_it(__self, __key_iter);
...@@ -819,14 +898,14 @@ private:...@@ -819,14 +898,14 @@ private:
819 }898 }
820899
821 template <class _Res, class _Self, class _Kp>900 template <class _Res, class _Self, class _Kp>
822 _LIBCPP_HIDE_FROM_ABI static _Res __upper_bound(_Self&& __self, _Kp& __x) {901 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static _Res __upper_bound(_Self&& __self, _Kp& __x) {
823 auto __key_iter =902 auto __key_iter =
824 std::upper_bound(__self.__containers_.keys.begin(), __self.__containers_.keys.end(), __x, __self.__compare_);903 std::upper_bound(__self.__containers_.keys.begin(), __self.__containers_.keys.end(), __x, __self.__compare_);
825 auto __mapped_iter = __corresponding_mapped_it(__self, __key_iter);904 auto __mapped_iter = __corresponding_mapped_it(__self, __key_iter);
826 return _Res(std::move(__key_iter), std::move(__mapped_iter));905 return _Res(std::move(__key_iter), std::move(__mapped_iter));
827 }906 }
828907
829 _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __size) {908 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __reserve(size_t __size) {
830 if constexpr (__container_traits<_KeyContainer>::__reservable) {909 if constexpr (__container_traits<_KeyContainer>::__reservable) {
831 __containers_.keys.reserve(__size);910 __containers_.keys.reserve(__size);
832 }911 }
...@@ -837,7 +916,8 @@ private:...@@ -837,7 +916,8 @@ private:
837 }916 }
838917
839 template <class _KIter, class _MIter>918 template <class _KIter, class _MIter>
840 _LIBCPP_HIDE_FROM_ABI iterator __erase(_KIter __key_iter_to_remove, _MIter __mapped_iter_to_remove) {919 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
920 __erase(_KIter __key_iter_to_remove, _MIter __mapped_iter_to_remove) {
841 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });921 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
842 auto __key_iter = __containers_.keys.erase(__key_iter_to_remove);922 auto __key_iter = __containers_.keys.erase(__key_iter_to_remove);
843 auto __mapped_iter = __containers_.values.erase(__mapped_iter_to_remove);923 auto __mapped_iter = __containers_.values.erase(__mapped_iter_to_remove);
...@@ -847,7 +927,8 @@ private:...@@ -847,7 +927,8 @@ private:
847927
848 template <class _Key2, class _Tp2, class _Compare2, class _KeyContainer2, class _MappedContainer2, class _Predicate>928 template <class _Key2, class _Tp2, class _Compare2, class _KeyContainer2, class _MappedContainer2, class _Predicate>
849 friend typename flat_multimap<_Key2, _Tp2, _Compare2, _KeyContainer2, _MappedContainer2>::size_type929 friend typename flat_multimap<_Key2, _Tp2, _Compare2, _KeyContainer2, _MappedContainer2>::size_type
850 erase_if(flat_multimap<_Key2, _Tp2, _Compare2, _KeyContainer2, _MappedContainer2>&, _Predicate);930 _LIBCPP_CONSTEXPR_SINCE_CXX26
931 erase_if(flat_multimap<_Key2, _Tp2, _Compare2, _KeyContainer2, _MappedContainer2>&, _Predicate);
851932
852 friend __flat_map_utils;933 friend __flat_map_utils;
853934
...@@ -855,8 +936,9 @@ private:...@@ -855,8 +936,9 @@ private:
855 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;936 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;
856937
857 struct __key_equiv {938 struct __key_equiv {
858 _LIBCPP_HIDE_FROM_ABI __key_equiv(key_compare __c) : __comp_(__c) {}939 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __key_equiv(key_compare __c) : __comp_(__c) {}
859 _LIBCPP_HIDE_FROM_ABI bool operator()(const_reference __x, const_reference __y) const {940 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
941 operator()(const_reference __x, const_reference __y) const {
860 return !__comp_(std::get<0>(__x), std::get<0>(__y)) && !__comp_(std::get<0>(__y), std::get<0>(__x));942 return !__comp_(std::get<0>(__x), std::get<0>(__y)) && !__comp_(std::get<0>(__y), std::get<0>(__x));
861 }943 }
862 key_compare __comp_;944 key_compare __comp_;
...@@ -864,8 +946,7 @@ private:...@@ -864,8 +946,7 @@ private:
864};946};
865947
866template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>948template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
867 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&949 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
868 !__is_allocator<_MappedContainer>::value &&
869 is_invocable_v<const _Compare&,950 is_invocable_v<const _Compare&,
870 const typename _KeyContainer::value_type&,951 const typename _KeyContainer::value_type&,
871 const typename _KeyContainer::value_type&>)952 const typename _KeyContainer::value_type&>)
...@@ -878,7 +959,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare = _Compare())...@@ -878,7 +959,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare = _Compare())
878959
879template <class _KeyContainer, class _MappedContainer, class _Allocator>960template <class _KeyContainer, class _MappedContainer, class _Allocator>
880 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&961 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
881 !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)962 !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
882flat_multimap(_KeyContainer, _MappedContainer, _Allocator)963flat_multimap(_KeyContainer, _MappedContainer, _Allocator)
883 -> flat_multimap<typename _KeyContainer::value_type,964 -> flat_multimap<typename _KeyContainer::value_type,
884 typename _MappedContainer::value_type,965 typename _MappedContainer::value_type,
...@@ -887,9 +968,8 @@ flat_multimap(_KeyContainer, _MappedContainer, _Allocator)...@@ -887,9 +968,8 @@ flat_multimap(_KeyContainer, _MappedContainer, _Allocator)
887 _MappedContainer>;968 _MappedContainer>;
888969
889template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>970template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
890 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&971 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
891 !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&972 uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
892 uses_allocator_v<_MappedContainer, _Allocator> &&
893 is_invocable_v<const _Compare&,973 is_invocable_v<const _Compare&,
894 const typename _KeyContainer::value_type&,974 const typename _KeyContainer::value_type&,
895 const typename _KeyContainer::value_type&>)975 const typename _KeyContainer::value_type&>)
...@@ -901,8 +981,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare, _Allocator)...@@ -901,8 +981,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare, _Allocator)
901 _MappedContainer>;981 _MappedContainer>;
902982
903template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>983template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
904 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&984 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
905 !__is_allocator<_MappedContainer>::value &&
906 is_invocable_v<const _Compare&,985 is_invocable_v<const _Compare&,
907 const typename _KeyContainer::value_type&,986 const typename _KeyContainer::value_type&,
908 const typename _KeyContainer::value_type&>)987 const typename _KeyContainer::value_type&>)
...@@ -915,7 +994,7 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare = _...@@ -915,7 +994,7 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare = _
915994
916template <class _KeyContainer, class _MappedContainer, class _Allocator>995template <class _KeyContainer, class _MappedContainer, class _Allocator>
917 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&996 requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
918 !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)997 !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
919flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Allocator)998flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Allocator)
920 -> flat_multimap<typename _KeyContainer::value_type,999 -> flat_multimap<typename _KeyContainer::value_type,
921 typename _MappedContainer::value_type,1000 typename _MappedContainer::value_type,
...@@ -924,9 +1003,8 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Allocator)...@@ -924,9 +1003,8 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Allocator)
924 _MappedContainer>;1003 _MappedContainer>;
9251004
926template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>1005template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
927 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&1006 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
928 !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&1007 uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
929 uses_allocator_v<_MappedContainer, _Allocator> &&
930 is_invocable_v<const _Compare&,1008 is_invocable_v<const _Compare&,
931 const typename _KeyContainer::value_type&,1009 const typename _KeyContainer::value_type&,
932 const typename _KeyContainer::value_type&>)1010 const typename _KeyContainer::value_type&>)
...@@ -938,19 +1016,19 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare, _A...@@ -938,19 +1016,19 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare, _A
938 _MappedContainer>;1016 _MappedContainer>;
9391017
940template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>1018template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
941 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)1019 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
942flat_multimap(_InputIterator, _InputIterator, _Compare = _Compare())1020flat_multimap(_InputIterator, _InputIterator, _Compare = _Compare())
943 -> flat_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;1021 -> flat_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
9441022
945template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>1023template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
946 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)1024 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
947flat_multimap(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())1025flat_multimap(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())
948 -> flat_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;1026 -> flat_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
9491027
950template <ranges::input_range _Range,1028template <ranges::input_range _Range,
951 class _Compare = less<__range_key_type<_Range>>,1029 class _Compare = less<__range_key_type<_Range>>,
952 class _Allocator = allocator<byte>,1030 class _Allocator = allocator<byte>,
953 class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>1031 class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
954flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multimap<1032flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multimap<
955 __range_key_type<_Range>,1033 __range_key_type<_Range>,
956 __range_mapped_type<_Range>,1034 __range_mapped_type<_Range>,
...@@ -958,7 +1036,7 @@ flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Alloc...@@ -958,7 +1036,7 @@ flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Alloc
958 vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,1036 vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
959 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;1037 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
9601038
961template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>1039template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
962flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap<1040flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap<
963 __range_key_type<_Range>,1041 __range_key_type<_Range>,
964 __range_mapped_type<_Range>,1042 __range_mapped_type<_Range>,
...@@ -967,11 +1045,11 @@ flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap<...@@ -967,11 +1045,11 @@ flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap<
967 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;1045 vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
9681046
969template <class _Key, class _Tp, class _Compare = less<_Key>>1047template <class _Key, class _Tp, class _Compare = less<_Key>>
970 requires(!__is_allocator<_Compare>::value)1048 requires(!__is_allocator_v<_Compare>)
971flat_multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_multimap<_Key, _Tp, _Compare>;1049flat_multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_multimap<_Key, _Tp, _Compare>;
9721050
973template <class _Key, class _Tp, class _Compare = less<_Key>>1051template <class _Key, class _Tp, class _Compare = less<_Key>>
974 requires(!__is_allocator<_Compare>::value)1052 requires(!__is_allocator_v<_Compare>)
975flat_multimap(sorted_equivalent_t, initializer_list<pair<_Key, _Tp>>, _Compare = _Compare())1053flat_multimap(sorted_equivalent_t, initializer_list<pair<_Key, _Tp>>, _Compare = _Compare())
976 -> flat_multimap<_Key, _Tp, _Compare>;1054 -> flat_multimap<_Key, _Tp, _Compare>;
9771055
...@@ -980,8 +1058,9 @@ struct uses_allocator<flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedC...@@ -980,8 +1058,9 @@ struct uses_allocator<flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedC
980 : bool_constant<uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator>> {};1058 : bool_constant<uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator>> {};
9811059
982template <class _Key, class _Tp, class _Compare, class _KeyContainer, class _MappedContainer, class _Predicate>1060template <class _Key, class _Tp, class _Compare, class _KeyContainer, class _MappedContainer, class _Predicate>
983_LIBCPP_HIDE_FROM_ABI typename flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>::size_type1061_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
984erase_if(flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>& __flat_multimap, _Predicate __pred) {1062 typename flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>::size_type
1063 erase_if(flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>& __flat_multimap, _Predicate __pred) {
985 auto __zv = ranges::views::zip(__flat_multimap.__containers_.keys, __flat_multimap.__containers_.values);1064 auto __zv = ranges::views::zip(__flat_multimap.__containers_.keys, __flat_multimap.__containers_.values);
986 auto __first = __zv.begin();1065 auto __first = __zv.begin();
987 auto __last = __zv.end();1066 auto __last = __zv.end();
lib/libcxx/include/__flat_map/key_value_iterator.h-1
...@@ -20,7 +20,6 @@...@@ -20,7 +20,6 @@
20#include <__type_traits/conditional.h>20#include <__type_traits/conditional.h>
21#include <__utility/forward.h>21#include <__utility/forward.h>
22#include <__utility/move.h>22#include <__utility/move.h>
23#include <__utility/pair.h>
2423
25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
26# pragma GCC system_header25# pragma GCC system_header
lib/libcxx/include/__flat_map/utils.h+1
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include <__utility/exception_guard.h>16#include <__utility/exception_guard.h>
17#include <__utility/forward.h>17#include <__utility/forward.h>
18#include <__utility/move.h>18#include <__utility/move.h>
19#include <__vector/container_traits.h>
1920
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21# pragma GCC system_header22# pragma GCC system_header
lib/libcxx/include/__flat_set/flat_multiset.h+211-143
...@@ -13,54 +13,41 @@...@@ -13,54 +13,41 @@
13#include <__algorithm/equal_range.h>13#include <__algorithm/equal_range.h>
14#include <__algorithm/lexicographical_compare_three_way.h>14#include <__algorithm/lexicographical_compare_three_way.h>
15#include <__algorithm/lower_bound.h>15#include <__algorithm/lower_bound.h>
16#include <__algorithm/min.h>
17#include <__algorithm/ranges_equal.h>16#include <__algorithm/ranges_equal.h>
18#include <__algorithm/ranges_inplace_merge.h>17#include <__algorithm/ranges_inplace_merge.h>
19#include <__algorithm/ranges_is_sorted.h>18#include <__algorithm/ranges_is_sorted.h>
20#include <__algorithm/ranges_sort.h>19#include <__algorithm/ranges_sort.h>
21#include <__algorithm/ranges_unique.h>
22#include <__algorithm/remove_if.h>20#include <__algorithm/remove_if.h>
23#include <__algorithm/upper_bound.h>21#include <__algorithm/upper_bound.h>
24#include <__assert>22#include <__assert>
25#include <__compare/synth_three_way.h>23#include <__compare/synth_three_way.h>
26#include <__concepts/convertible_to.h>
27#include <__concepts/swappable.h>24#include <__concepts/swappable.h>
28#include <__config>25#include <__config>
29#include <__cstddef/byte.h>
30#include <__cstddef/ptrdiff_t.h>
31#include <__flat_map/key_value_iterator.h>
32#include <__flat_map/sorted_equivalent.h>26#include <__flat_map/sorted_equivalent.h>
33#include <__flat_set/ra_iterator.h>27#include <__flat_set/ra_iterator.h>
34#include <__flat_set/utils.h>28#include <__flat_set/utils.h>
35#include <__functional/invoke.h>
36#include <__functional/is_transparent.h>29#include <__functional/is_transparent.h>
37#include <__functional/operations.h>30#include <__functional/operations.h>
38#include <__fwd/vector.h>31#include <__fwd/vector.h>
39#include <__iterator/concepts.h>32#include <__iterator/concepts.h>
40#include <__iterator/distance.h>
41#include <__iterator/iterator_traits.h>33#include <__iterator/iterator_traits.h>
42#include <__iterator/prev.h>34#include <__iterator/prev.h>
43#include <__iterator/ranges_iterator_traits.h>
44#include <__iterator/reverse_iterator.h>35#include <__iterator/reverse_iterator.h>
45#include <__memory/allocator_traits.h>36#include <__memory/allocator_traits.h>
46#include <__memory/uses_allocator.h>37#include <__memory/uses_allocator.h>
47#include <__memory/uses_allocator_construction.h>38#include <__memory/uses_allocator_construction.h>
48#include <__ranges/access.h>
49#include <__ranges/concepts.h>39#include <__ranges/concepts.h>
50#include <__ranges/container_compatible_range.h>40#include <__ranges/container_compatible_range.h>
51#include <__ranges/drop_view.h>41#include <__ranges/drop_view.h>
52#include <__ranges/from_range.h>42#include <__ranges/from_range.h>
53#include <__ranges/ref_view.h>43#include <__ranges/range_adaptor.h>
54#include <__ranges/size.h>44#include <__ranges/size.h>
55#include <__ranges/subrange.h>45#include <__ranges/subrange.h>
56#include <__ranges/zip_view.h>
57#include <__type_traits/conjunction.h>
58#include <__type_traits/container_traits.h>46#include <__type_traits/container_traits.h>
59#include <__type_traits/invoke.h>47#include <__type_traits/invoke.h>
60#include <__type_traits/is_allocator.h>48#include <__type_traits/is_allocator.h>
61#include <__type_traits/is_nothrow_constructible.h>49#include <__type_traits/is_nothrow_constructible.h>
62#include <__type_traits/is_same.h>50#include <__type_traits/is_same.h>
63#include <__type_traits/maybe_const.h>
64#include <__utility/as_const.h>51#include <__utility/as_const.h>
65#include <__utility/exception_guard.h>52#include <__utility/exception_guard.h>
66#include <__utility/move.h>53#include <__utility/move.h>
...@@ -108,16 +95,16 @@ public:...@@ -108,16 +95,16 @@ public:
10895
109public:96public:
110 // [flat.multiset.cons], constructors97 // [flat.multiset.cons], constructors
111 _LIBCPP_HIDE_FROM_ABI flat_multiset() noexcept(is_nothrow_default_constructible_v<_KeyContainer> &&98 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset() noexcept(
112 is_nothrow_default_constructible_v<_Compare>)99 is_nothrow_default_constructible_v<_KeyContainer> && is_nothrow_default_constructible_v<_Compare>)
113 : __keys_(), __compare_() {}100 : __keys_(), __compare_() {}
114101
115 _LIBCPP_HIDE_FROM_ABI flat_multiset(const flat_multiset&) = default;102 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(const flat_multiset&) = default;
116103
117 // The copy/move constructors are not specified in the spec, which means they should be defaulted.104 // The copy/move constructors are not specified in the spec, which means they should be defaulted.
118 // However, the move constructor can potentially leave a moved-from object in an inconsistent105 // However, the move constructor can potentially leave a moved-from object in an inconsistent
119 // state if an exception is thrown.106 // state if an exception is thrown.
120 _LIBCPP_HIDE_FROM_ABI flat_multiset(flat_multiset&& __other) noexcept(107 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(flat_multiset&& __other) noexcept(
121 is_nothrow_move_constructible_v<_KeyContainer> && is_nothrow_move_constructible_v<_Compare>)108 is_nothrow_move_constructible_v<_KeyContainer> && is_nothrow_move_constructible_v<_Compare>)
122# if _LIBCPP_HAS_EXCEPTIONS109# if _LIBCPP_HAS_EXCEPTIONS
123 try110 try
...@@ -134,14 +121,16 @@ public:...@@ -134,14 +121,16 @@ public:
134# endif // _LIBCPP_HAS_EXCEPTIONS121# endif // _LIBCPP_HAS_EXCEPTIONS
135 }122 }
136123
137 _LIBCPP_HIDE_FROM_ABI explicit flat_multiset(const key_compare& __comp) : __keys_(), __compare_(__comp) {}124 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_multiset(const key_compare& __comp)
125 : __keys_(), __compare_(__comp) {}
138126
139 _LIBCPP_HIDE_FROM_ABI explicit flat_multiset(container_type __keys, const key_compare& __comp = key_compare())127 _LIBCPP_HIDE_FROM_ABI
128 _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_multiset(container_type __keys, const key_compare& __comp = key_compare())
140 : __keys_(std::move(__keys)), __compare_(__comp) {129 : __keys_(std::move(__keys)), __compare_(__comp) {
141 ranges::sort(__keys_, __compare_);130 ranges::sort(__keys_, __compare_);
142 }131 }
143132
144 _LIBCPP_HIDE_FROM_ABI133 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
145 flat_multiset(sorted_equivalent_t, container_type __keys, const key_compare& __comp = key_compare())134 flat_multiset(sorted_equivalent_t, container_type __keys, const key_compare& __comp = key_compare())
146 : __keys_(std::move(__keys)), __compare_(__comp) {135 : __keys_(std::move(__keys)), __compare_(__comp) {
147 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");136 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");
...@@ -149,7 +138,7 @@ public:...@@ -149,7 +138,7 @@ public:
149138
150 template <class _InputIterator>139 template <class _InputIterator>
151 requires __has_input_iterator_category<_InputIterator>::value140 requires __has_input_iterator_category<_InputIterator>::value
152 _LIBCPP_HIDE_FROM_ABI141 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
153 flat_multiset(_InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())142 flat_multiset(_InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
154 : __keys_(), __compare_(__comp) {143 : __keys_(), __compare_(__comp) {
155 insert(__first, __last);144 insert(__first, __last);
...@@ -157,48 +146,53 @@ public:...@@ -157,48 +146,53 @@ public:
157146
158 template <class _InputIterator>147 template <class _InputIterator>
159 requires __has_input_iterator_category<_InputIterator>::value148 requires __has_input_iterator_category<_InputIterator>::value
160 _LIBCPP_HIDE_FROM_ABI flat_multiset(149 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(
161 sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())150 sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
162 : __keys_(__first, __last), __compare_(__comp) {151 : __keys_(__first, __last), __compare_(__comp) {
163 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");152 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");
164 }153 }
165154
166 template <_ContainerCompatibleRange<value_type> _Range>155 template <_ContainerCompatibleRange<value_type> _Range>
167 _LIBCPP_HIDE_FROM_ABI flat_multiset(from_range_t __fr, _Range&& __rg)156 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(from_range_t __fr, _Range&& __rg)
168 : flat_multiset(__fr, std::forward<_Range>(__rg), key_compare()) {}157 : flat_multiset(__fr, std::forward<_Range>(__rg), key_compare()) {}
169158
170 template <_ContainerCompatibleRange<value_type> _Range>159 template <_ContainerCompatibleRange<value_type> _Range>
171 _LIBCPP_HIDE_FROM_ABI flat_multiset(from_range_t, _Range&& __rg, const key_compare& __comp) : flat_multiset(__comp) {160 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
161 flat_multiset(from_range_t, _Range&& __rg, const key_compare& __comp)
162 : flat_multiset(__comp) {
172 insert_range(std::forward<_Range>(__rg));163 insert_range(std::forward<_Range>(__rg));
173 }164 }
174165
175 _LIBCPP_HIDE_FROM_ABI flat_multiset(initializer_list<value_type> __il, const key_compare& __comp = key_compare())166 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
167 flat_multiset(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
176 : flat_multiset(__il.begin(), __il.end(), __comp) {}168 : flat_multiset(__il.begin(), __il.end(), __comp) {}
177169
178 _LIBCPP_HIDE_FROM_ABI170 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
179 flat_multiset(sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp = key_compare())171 flat_multiset(sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp = key_compare())
180 : flat_multiset(sorted_equivalent, __il.begin(), __il.end(), __comp) {}172 : flat_multiset(sorted_equivalent, __il.begin(), __il.end(), __comp) {}
181173
182 template <class _Allocator>174 template <class _Allocator>
183 requires uses_allocator<container_type, _Allocator>::value175 requires uses_allocator<container_type, _Allocator>::value
184 _LIBCPP_HIDE_FROM_ABI explicit flat_multiset(const _Allocator& __alloc)176 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_multiset(const _Allocator& __alloc)
185 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {}177 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {}
186178
187 template <class _Allocator>179 template <class _Allocator>
188 requires uses_allocator<container_type, _Allocator>::value180 requires uses_allocator<container_type, _Allocator>::value
189 _LIBCPP_HIDE_FROM_ABI flat_multiset(const key_compare& __comp, const _Allocator& __alloc)181 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
182 flat_multiset(const key_compare& __comp, const _Allocator& __alloc)
190 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {}183 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {}
191184
192 template <class _Allocator>185 template <class _Allocator>
193 requires uses_allocator<container_type, _Allocator>::value186 requires uses_allocator<container_type, _Allocator>::value
194 _LIBCPP_HIDE_FROM_ABI flat_multiset(const container_type& __keys, const _Allocator& __alloc)187 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
188 flat_multiset(const container_type& __keys, const _Allocator& __alloc)
195 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_() {189 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_() {
196 ranges::sort(__keys_, __compare_);190 ranges::sort(__keys_, __compare_);
197 }191 }
198192
199 template <class _Allocator>193 template <class _Allocator>
200 requires uses_allocator<container_type, _Allocator>::value194 requires uses_allocator<container_type, _Allocator>::value
201 _LIBCPP_HIDE_FROM_ABI195 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
202 flat_multiset(const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)196 flat_multiset(const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)
203 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_(__comp) {197 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_(__comp) {
204 ranges::sort(__keys_, __compare_);198 ranges::sort(__keys_, __compare_);
...@@ -206,14 +200,15 @@ public:...@@ -206,14 +200,15 @@ public:
206200
207 template <class _Allocator>201 template <class _Allocator>
208 requires uses_allocator<container_type, _Allocator>::value202 requires uses_allocator<container_type, _Allocator>::value
209 _LIBCPP_HIDE_FROM_ABI flat_multiset(sorted_equivalent_t, const container_type& __keys, const _Allocator& __alloc)203 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
204 flat_multiset(sorted_equivalent_t, const container_type& __keys, const _Allocator& __alloc)
210 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_() {205 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_() {
211 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");206 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");
212 }207 }
213208
214 template <class _Allocator>209 template <class _Allocator>
215 requires uses_allocator<container_type, _Allocator>::value210 requires uses_allocator<container_type, _Allocator>::value
216 _LIBCPP_HIDE_FROM_ABI211 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
217 flat_multiset(sorted_equivalent_t, const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)212 flat_multiset(sorted_equivalent_t, const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)
218 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_(__comp) {213 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_(__comp) {
219 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");214 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");
...@@ -221,13 +216,14 @@ public:...@@ -221,13 +216,14 @@ public:
221216
222 template <class _Allocator>217 template <class _Allocator>
223 requires uses_allocator<container_type, _Allocator>::value218 requires uses_allocator<container_type, _Allocator>::value
224 _LIBCPP_HIDE_FROM_ABI flat_multiset(const flat_multiset& __other, const _Allocator& __alloc)219 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
220 flat_multiset(const flat_multiset& __other, const _Allocator& __alloc)
225 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __other.__keys_)),221 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __other.__keys_)),
226 __compare_(__other.__compare_) {}222 __compare_(__other.__compare_) {}
227223
228 template <class _Allocator>224 template <class _Allocator>
229 requires uses_allocator<container_type, _Allocator>::value225 requires uses_allocator<container_type, _Allocator>::value
230 _LIBCPP_HIDE_FROM_ABI flat_multiset(flat_multiset&& __other, const _Allocator& __alloc)226 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(flat_multiset&& __other, const _Allocator& __alloc)
231# if _LIBCPP_HAS_EXCEPTIONS227# if _LIBCPP_HAS_EXCEPTIONS
232 try228 try
233# endif // _LIBCPP_HAS_EXCEPTIONS229# endif // _LIBCPP_HAS_EXCEPTIONS
...@@ -243,14 +239,15 @@ public:...@@ -243,14 +239,15 @@ public:
243239
244 template <class _InputIterator, class _Allocator>240 template <class _InputIterator, class _Allocator>
245 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)241 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
246 _LIBCPP_HIDE_FROM_ABI flat_multiset(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)242 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
243 flat_multiset(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
247 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {244 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {
248 insert(__first, __last);245 insert(__first, __last);
249 }246 }
250247
251 template <class _InputIterator, class _Allocator>248 template <class _InputIterator, class _Allocator>
252 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)249 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
253 _LIBCPP_HIDE_FROM_ABI250 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
254 flat_multiset(_InputIterator __first, _InputIterator __last, const key_compare& __comp, const _Allocator& __alloc)251 flat_multiset(_InputIterator __first, _InputIterator __last, const key_compare& __comp, const _Allocator& __alloc)
255 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {252 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {
256 insert(__first, __last);253 insert(__first, __last);
...@@ -258,7 +255,7 @@ public:...@@ -258,7 +255,7 @@ public:
258255
259 template <class _InputIterator, class _Allocator>256 template <class _InputIterator, class _Allocator>
260 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)257 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
261 _LIBCPP_HIDE_FROM_ABI258 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
262 flat_multiset(sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const _Allocator& __alloc)259 flat_multiset(sorted_equivalent_t, _InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
263 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __first, __last)), __compare_() {260 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __first, __last)), __compare_() {
264 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");261 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");
...@@ -266,53 +263,57 @@ public:...@@ -266,53 +263,57 @@ public:
266263
267 template <class _InputIterator, class _Allocator>264 template <class _InputIterator, class _Allocator>
268 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)265 requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
269 _LIBCPP_HIDE_FROM_ABI266 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(
270 flat_multiset(sorted_equivalent_t,267 sorted_equivalent_t,
271 _InputIterator __first,268 _InputIterator __first,
272 _InputIterator __last,269 _InputIterator __last,
273 const key_compare& __comp,270 const key_compare& __comp,
274 const _Allocator& __alloc)271 const _Allocator& __alloc)
275 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __first, __last)), __compare_(__comp) {272 : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __first, __last)), __compare_(__comp) {
276 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");273 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys_, __compare_), "Key container is not sorted");
277 }274 }
278275
279 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>276 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
280 requires uses_allocator<container_type, _Allocator>::value277 requires uses_allocator<container_type, _Allocator>::value
281 _LIBCPP_HIDE_FROM_ABI flat_multiset(from_range_t, _Range&& __rg, const _Allocator& __alloc)278 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
279 flat_multiset(from_range_t, _Range&& __rg, const _Allocator& __alloc)
282 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {280 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {
283 insert_range(std::forward<_Range>(__rg));281 insert_range(std::forward<_Range>(__rg));
284 }282 }
285283
286 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>284 template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
287 requires uses_allocator<container_type, _Allocator>::value285 requires uses_allocator<container_type, _Allocator>::value
288 _LIBCPP_HIDE_FROM_ABI flat_multiset(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)286 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
287 flat_multiset(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)
289 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {288 : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {
290 insert_range(std::forward<_Range>(__rg));289 insert_range(std::forward<_Range>(__rg));
291 }290 }
292291
293 template <class _Allocator>292 template <class _Allocator>
294 requires uses_allocator<container_type, _Allocator>::value293 requires uses_allocator<container_type, _Allocator>::value
295 _LIBCPP_HIDE_FROM_ABI flat_multiset(initializer_list<value_type> __il, const _Allocator& __alloc)294 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
295 flat_multiset(initializer_list<value_type> __il, const _Allocator& __alloc)
296 : flat_multiset(__il.begin(), __il.end(), __alloc) {}296 : flat_multiset(__il.begin(), __il.end(), __alloc) {}
297297
298 template <class _Allocator>298 template <class _Allocator>
299 requires uses_allocator<container_type, _Allocator>::value299 requires uses_allocator<container_type, _Allocator>::value
300 _LIBCPP_HIDE_FROM_ABI300 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
301 flat_multiset(initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)301 flat_multiset(initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
302 : flat_multiset(__il.begin(), __il.end(), __comp, __alloc) {}302 : flat_multiset(__il.begin(), __il.end(), __comp, __alloc) {}
303303
304 template <class _Allocator>304 template <class _Allocator>
305 requires uses_allocator<container_type, _Allocator>::value305 requires uses_allocator<container_type, _Allocator>::value
306 _LIBCPP_HIDE_FROM_ABI flat_multiset(sorted_equivalent_t, initializer_list<value_type> __il, const _Allocator& __alloc)306 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
307 flat_multiset(sorted_equivalent_t, initializer_list<value_type> __il, const _Allocator& __alloc)
307 : flat_multiset(sorted_equivalent, __il.begin(), __il.end(), __alloc) {}308 : flat_multiset(sorted_equivalent, __il.begin(), __il.end(), __alloc) {}
308309
309 template <class _Allocator>310 template <class _Allocator>
310 requires uses_allocator<container_type, _Allocator>::value311 requires uses_allocator<container_type, _Allocator>::value
311 _LIBCPP_HIDE_FROM_ABI flat_multiset(312 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset(
312 sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)313 sorted_equivalent_t, initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
313 : flat_multiset(sorted_equivalent, __il.begin(), __il.end(), __comp, __alloc) {}314 : flat_multiset(sorted_equivalent, __il.begin(), __il.end(), __comp, __alloc) {}
314315
315 _LIBCPP_HIDE_FROM_ABI flat_multiset& operator=(initializer_list<value_type> __il) {316 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset& operator=(initializer_list<value_type> __il) {
316 clear();317 clear();
317 insert(__il);318 insert(__il);
318 return *this;319 return *this;
...@@ -321,9 +322,9 @@ public:...@@ -321,9 +322,9 @@ public:
321 // copy/move assignment are not specified in the spec (defaulted)322 // copy/move assignment are not specified in the spec (defaulted)
322 // but move assignment can potentially leave moved from object in an inconsistent323 // but move assignment can potentially leave moved from object in an inconsistent
323 // state if an exception is thrown324 // state if an exception is thrown
324 _LIBCPP_HIDE_FROM_ABI flat_multiset& operator=(const flat_multiset&) = default;325 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset& operator=(const flat_multiset&) = default;
325326
326 _LIBCPP_HIDE_FROM_ABI flat_multiset& operator=(flat_multiset&& __other) noexcept(327 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_multiset& operator=(flat_multiset&& __other) noexcept(
327 is_nothrow_move_assignable_v<_KeyContainer> && is_nothrow_move_assignable_v<_Compare>) {328 is_nothrow_move_assignable_v<_KeyContainer> && is_nothrow_move_assignable_v<_Compare>) {
328 auto __clear_other_guard = std::__make_scope_guard([&]() noexcept { __other.clear() /* noexcept */; });329 auto __clear_other_guard = std::__make_scope_guard([&]() noexcept { __other.clear() /* noexcept */; });
329 auto __clear_self_guard = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });330 auto __clear_self_guard = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
...@@ -334,30 +335,60 @@ public:...@@ -334,30 +335,60 @@ public:
334 }335 }
335336
336 // iterators337 // iterators
337 _LIBCPP_HIDE_FROM_ABI iterator begin() noexcept { return iterator(std::as_const(__keys_).begin()); }338 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {
338 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept { return const_iterator(__keys_.begin()); }339 return iterator(std::as_const(__keys_).begin());
339 _LIBCPP_HIDE_FROM_ABI iterator end() noexcept { return iterator(std::as_const(__keys_).end()); }340 }
340 _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept { return const_iterator(__keys_.end()); }341 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {
342 return const_iterator(__keys_.begin());
343 }
344 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {
345 return iterator(std::as_const(__keys_).end());
346 }
347 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {
348 return const_iterator(__keys_.end());
349 }
341350
342 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }351 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {
343 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }352 return reverse_iterator(end());
344 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() noexcept { return reverse_iterator(begin()); }353 }
345 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }354 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {
355 return const_reverse_iterator(end());
356 }
357 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {
358 return reverse_iterator(begin());
359 }
360 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {
361 return const_reverse_iterator(begin());
362 }
346363
347 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return begin(); }364 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept {
348 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return end(); }365 return begin();
349 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }366 }
350 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }367 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept {
368 return end();
369 }
370 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {
371 return const_reverse_iterator(end());
372 }
373 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {
374 return const_reverse_iterator(begin());
375 }
351376
352 // capacity377 // capacity
353 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __keys_.empty(); }378 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const noexcept {
354 _LIBCPP_HIDE_FROM_ABI size_type size() const noexcept { return __keys_.size(); }379 return __keys_.empty();
355 _LIBCPP_HIDE_FROM_ABI size_type max_size() const noexcept { return __keys_.max_size(); }380 }
381 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept {
382 return __keys_.size();
383 }
384 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept {
385 return __keys_.max_size();
386 }
356387
357 // [flat.multiset.modifiers], modifiers388 // [flat.multiset.modifiers], modifiers
358 template <class... _Args>389 template <class... _Args>
359 requires is_constructible_v<value_type, _Args...>390 requires is_constructible_v<value_type, _Args...>
360 _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {391 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace(_Args&&... __args) {
361 if constexpr (sizeof...(__args) == 1 && (is_same_v<remove_cvref_t<_Args>, _Key> && ...)) {392 if constexpr (sizeof...(__args) == 1 && (is_same_v<remove_cvref_t<_Args>, _Key> && ...)) {
362 return __emplace(std::forward<_Args>(__args)...);393 return __emplace(std::forward<_Args>(__args)...);
363 } else {394 } else {
...@@ -367,7 +398,7 @@ public:...@@ -367,7 +398,7 @@ public:
367398
368 template <class... _Args>399 template <class... _Args>
369 requires is_constructible_v<value_type, _Args...>400 requires is_constructible_v<value_type, _Args...>
370 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __hint, _Args&&... __args) {401 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __hint, _Args&&... __args) {
371 if constexpr (sizeof...(__args) == 1 && (is_same_v<remove_cvref_t<_Args>, _Key> && ...)) {402 if constexpr (sizeof...(__args) == 1 && (is_same_v<remove_cvref_t<_Args>, _Key> && ...)) {
372 return __emplace_hint(std::move(__hint), std::forward<_Args>(__args)...);403 return __emplace_hint(std::move(__hint), std::forward<_Args>(__args)...);
373 } else {404 } else {
...@@ -375,21 +406,23 @@ public:...@@ -375,21 +406,23 @@ public:
375 }406 }
376 }407 }
377408
378 _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return emplace(__x); }409 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const value_type& __x) { return emplace(__x); }
379410
380 _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return emplace(std::move(__x)); }411 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(value_type&& __x) {
412 return emplace(std::move(__x));
413 }
381414
382 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, const value_type& __x) {415 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, const value_type& __x) {
383 return emplace_hint(__hint, __x);416 return emplace_hint(__hint, __x);
384 }417 }
385418
386 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, value_type&& __x) {419 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, value_type&& __x) {
387 return emplace_hint(__hint, std::move(__x));420 return emplace_hint(__hint, std::move(__x));
388 }421 }
389422
390 template <class _InputIterator>423 template <class _InputIterator>
391 requires __has_input_iterator_category<_InputIterator>::value424 requires __has_input_iterator_category<_InputIterator>::value
392 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {425 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __first, _InputIterator __last) {
393 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {426 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {
394 __reserve(__last - __first);427 __reserve(__last - __first);
395 }428 }
...@@ -398,7 +431,8 @@ public:...@@ -398,7 +431,8 @@ public:
398431
399 template <class _InputIterator>432 template <class _InputIterator>
400 requires __has_input_iterator_category<_InputIterator>::value433 requires __has_input_iterator_category<_InputIterator>::value
401 _LIBCPP_HIDE_FROM_ABI void insert(sorted_equivalent_t, _InputIterator __first, _InputIterator __last) {434 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
435 insert(sorted_equivalent_t, _InputIterator __first, _InputIterator __last) {
402 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {436 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {
403 __reserve(__last - __first);437 __reserve(__last - __first);
404 }438 }
...@@ -407,7 +441,7 @@ public:...@@ -407,7 +441,7 @@ public:
407 }441 }
408442
409 template <_ContainerCompatibleRange<value_type> _Range>443 template <_ContainerCompatibleRange<value_type> _Range>
410 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {444 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
411 if constexpr (ranges::sized_range<_Range>) {445 if constexpr (ranges::sized_range<_Range>) {
412 __reserve(ranges::size(__range));446 __reserve(ranges::size(__range));
413 }447 }
...@@ -415,26 +449,38 @@ public:...@@ -415,26 +449,38 @@ public:
415 __append_sort_merge</*WasSorted = */ false>(std::forward<_Range>(__range));449 __append_sort_merge</*WasSorted = */ false>(std::forward<_Range>(__range));
416 }450 }
417451
418 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }452 template <_ContainerCompatibleRange<value_type> _Range>
453 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(sorted_equivalent_t, _Range&& __range) {
454 if constexpr (ranges::sized_range<_Range>) {
455 __reserve(ranges::size(__range));
456 }
419457
420 _LIBCPP_HIDE_FROM_ABI void insert(sorted_equivalent_t, initializer_list<value_type> __il) {458 __append_sort_merge</*WasSorted = */ true>(std::forward<_Range>(__range));
459 }
460
461 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
462 insert(__il.begin(), __il.end());
463 }
464
465 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
466 insert(sorted_equivalent_t, initializer_list<value_type> __il) {
421 insert(sorted_equivalent, __il.begin(), __il.end());467 insert(sorted_equivalent, __il.begin(), __il.end());
422 }468 }
423469
424 _LIBCPP_HIDE_FROM_ABI container_type extract() && {470 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 container_type extract() && {
425 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });471 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });
426 auto __ret = std::move(__keys_);472 auto __ret = std::move(__keys_);
427 return __ret;473 return __ret;
428 }474 }
429475
430 _LIBCPP_HIDE_FROM_ABI void replace(container_type&& __keys) {476 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void replace(container_type&& __keys) {
431 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys, __compare_), "Key container is not sorted");477 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(ranges::is_sorted(__keys, __compare_), "Key container is not sorted");
432 auto __guard = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });478 auto __guard = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
433 __keys_ = std::move(__keys);479 __keys_ = std::move(__keys);
434 __guard.__complete();480 __guard.__complete();
435 }481 }
436482
437 _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __position) {483 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(iterator __position) {
438 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });484 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
439 auto __key_iter = __keys_.erase(__position.__base());485 auto __key_iter = __keys_.erase(__position.__base());
440 __on_failure.__complete();486 __on_failure.__complete();
...@@ -444,7 +490,7 @@ public:...@@ -444,7 +490,7 @@ public:
444 // The following overload is the same as the iterator overload490 // The following overload is the same as the iterator overload
445 // iterator erase(const_iterator __position);491 // iterator erase(const_iterator __position);
446492
447 _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __x) {493 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __x) {
448 auto [__first, __last] = equal_range(__x);494 auto [__first, __last] = equal_range(__x);
449 auto __res = __last - __first;495 auto __res = __last - __first;
450 erase(__first, __last);496 erase(__first, __last);
...@@ -454,149 +500,170 @@ public:...@@ -454,149 +500,170 @@ public:
454 template <class _Kp>500 template <class _Kp>
455 requires(__is_transparent_v<_Compare> && !is_convertible_v<_Kp &&, iterator> &&501 requires(__is_transparent_v<_Compare> && !is_convertible_v<_Kp &&, iterator> &&
456 !is_convertible_v<_Kp &&, const_iterator>)502 !is_convertible_v<_Kp &&, const_iterator>)
457 _LIBCPP_HIDE_FROM_ABI size_type erase(_Kp&& __x) {503 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(_Kp&& __x) {
458 auto [__first, __last] = equal_range(__x);504 auto [__first, __last] = equal_range(__x);
459 auto __res = __last - __first;505 auto __res = __last - __first;
460 erase(__first, __last);506 erase(__first, __last);
461 return __res;507 return __res;
462 }508 }
463509
464 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {510 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __first, const_iterator __last) {
465 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });511 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
466 auto __key_it = __keys_.erase(__first.__base(), __last.__base());512 auto __key_it = __keys_.erase(__first.__base(), __last.__base());
467 __on_failure.__complete();513 __on_failure.__complete();
468 return iterator(std::move(__key_it));514 return iterator(std::move(__key_it));
469 }515 }
470516
471 _LIBCPP_HIDE_FROM_ABI void swap(flat_multiset& __y) noexcept {517 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
472 // warning: The spec has unconditional noexcept, which means that518 swap(flat_multiset& __y) noexcept(is_nothrow_swappable_v<container_type> && is_nothrow_swappable_v<key_compare>) {
473 // if any of the following functions throw an exception,519 auto __on_failure = std::__make_exception_guard([&]() noexcept {
474 // std::terminate will be called520 clear() /* noexcept */;
475 // This is discussed in P3567, which hasn't been voted on yet.521 __y.clear() /* noexcept */;
522 });
476 ranges::swap(__compare_, __y.__compare_);523 ranges::swap(__compare_, __y.__compare_);
477 ranges::swap(__keys_, __y.__keys_);524 ranges::swap(__keys_, __y.__keys_);
525 __on_failure.__complete();
478 }526 }
479527
480 _LIBCPP_HIDE_FROM_ABI void clear() noexcept { __keys_.clear(); }528 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept { __keys_.clear(); }
481529
482 // observers530 // observers
483 _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __compare_; }531 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }
484 _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __compare_; }532 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
533 return __compare_;
534 }
485535
486 // map operations536 // map operations
487 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __x) { return __find_impl(*this, __x); }537 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {
538 return __find_impl(*this, __x);
539 }
488540
489 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __x) const { return __find_impl(*this, __x); }541 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {
542 return __find_impl(*this, __x);
543 }
490544
491 template <class _Kp>545 template <class _Kp>
492 requires __is_transparent_v<_Compare>546 requires __is_transparent_v<_Compare>
493 _LIBCPP_HIDE_FROM_ABI iterator find(const _Kp& __x) {547 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {
494 return __find_impl(*this, __x);548 return __find_impl(*this, __x);
495 }549 }
496550
497 template <class _Kp>551 template <class _Kp>
498 requires __is_transparent_v<_Compare>552 requires __is_transparent_v<_Compare>
499 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Kp& __x) const {553 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {
500 return __find_impl(*this, __x);554 return __find_impl(*this, __x);
501 }555 }
502556
503 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __x) const {557 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {
504 auto [__first, __last] = equal_range(__x);558 auto [__first, __last] = equal_range(__x);
505 return __last - __first;559 return __last - __first;
506 }560 }
507561
508 template <class _Kp>562 template <class _Kp>
509 requires __is_transparent_v<_Compare>563 requires __is_transparent_v<_Compare>
510 _LIBCPP_HIDE_FROM_ABI size_type count(const _Kp& __x) const {564 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {
511 auto [__first, __last] = equal_range(__x);565 auto [__first, __last] = equal_range(__x);
512 return __last - __first;566 return __last - __first;
513 }567 }
514568
515 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __x) const { return find(__x) != end(); }569 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {
570 return find(__x) != end();
571 }
516572
517 template <class _Kp>573 template <class _Kp>
518 requires __is_transparent_v<_Compare>574 requires __is_transparent_v<_Compare>
519 _LIBCPP_HIDE_FROM_ABI bool contains(const _Kp& __x) const {575 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {
520 return find(__x) != end();576 return find(__x) != end();
521 }577 }
522578
523 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __x) {579 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {
524 const auto& __keys = __keys_;580 const auto& __keys = __keys_;
525 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));581 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));
526 }582 }
527583
528 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __x) const {584 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
585 lower_bound(const key_type& __x) const {
529 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));586 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
530 }587 }
531588
532 template <class _Kp>589 template <class _Kp>
533 requires __is_transparent_v<_Compare>590 requires __is_transparent_v<_Compare>
534 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _Kp& __x) {591 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {
535 const auto& __keys = __keys_;592 const auto& __keys = __keys_;
536 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));593 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));
537 }594 }
538595
539 template <class _Kp>596 template <class _Kp>
540 requires __is_transparent_v<_Compare>597 requires __is_transparent_v<_Compare>
541 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _Kp& __x) const {598 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {
542 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));599 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
543 }600 }
544601
545 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __x) {602 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {
546 const auto& __keys = __keys_;603 const auto& __keys = __keys_;
547 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));604 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));
548 }605 }
549606
550 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __x) const {607 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
608 upper_bound(const key_type& __x) const {
551 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));609 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
552 }610 }
553611
554 template <class _Kp>612 template <class _Kp>
555 requires __is_transparent_v<_Compare>613 requires __is_transparent_v<_Compare>
556 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _Kp& __x) {614 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {
557 const auto& __keys = __keys_;615 const auto& __keys = __keys_;
558 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));616 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));
559 }617 }
560618
561 template <class _Kp>619 template <class _Kp>
562 requires __is_transparent_v<_Compare>620 requires __is_transparent_v<_Compare>
563 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _Kp& __x) const {621 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {
564 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));622 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
565 }623 }
566624
567 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __x) {625 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
626 equal_range(const key_type& __x) {
568 return __equal_range_impl(*this, __x);627 return __equal_range_impl(*this, __x);
569 }628 }
570629
571 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __x) const {630 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
631 equal_range(const key_type& __x) const {
572 return __equal_range_impl(*this, __x);632 return __equal_range_impl(*this, __x);
573 }633 }
574634
575 template <class _Kp>635 template <class _Kp>
576 requires __is_transparent_v<_Compare>636 requires __is_transparent_v<_Compare>
577 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _Kp& __x) {637 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
638 equal_range(const _Kp& __x) {
578 return __equal_range_impl(*this, __x);639 return __equal_range_impl(*this, __x);
579 }640 }
580 template <class _Kp>641 template <class _Kp>
581 requires __is_transparent_v<_Compare>642 requires __is_transparent_v<_Compare>
582 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _Kp& __x) const {643 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
644 equal_range(const _Kp& __x) const {
583 return __equal_range_impl(*this, __x);645 return __equal_range_impl(*this, __x);
584 }646 }
585647
586 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const flat_multiset& __x, const flat_multiset& __y) {648 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
649 operator==(const flat_multiset& __x, const flat_multiset& __y) {
587 return ranges::equal(__x, __y);650 return ranges::equal(__x, __y);
588 }651 }
589652
590 friend _LIBCPP_HIDE_FROM_ABI auto operator<=>(const flat_multiset& __x, const flat_multiset& __y) {653 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 auto
654 operator<=>(const flat_multiset& __x, const flat_multiset& __y) {
591 return std::lexicographical_compare_three_way(655 return std::lexicographical_compare_three_way(
592 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);656 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
593 }657 }
594658
595 friend _LIBCPP_HIDE_FROM_ABI void swap(flat_multiset& __x, flat_multiset& __y) noexcept { __x.swap(__y); }659 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
660 swap(flat_multiset& __x, flat_multiset& __y) noexcept(noexcept(__x.swap(__y))) {
661 __x.swap(__y);
662 }
596663
597private:664private:
598 template <bool _WasSorted, class... _Args>665 template <bool _WasSorted, class... _Args>
599 _LIBCPP_HIDE_FROM_ABI void __append_sort_merge(_Args&&... __args) {666 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append_sort_merge(_Args&&... __args) {
600 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });667 auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
601 size_type __old_size = size();668 size_type __old_size = size();
602 __flat_set_utils::__append(*this, std::forward<_Args>(__args)...);669 __flat_set_utils::__append(*this, std::forward<_Args>(__args)...);
...@@ -604,20 +671,20 @@ private:...@@ -604,20 +671,20 @@ private:
604 ranges::sort(__keys_.begin() + __old_size, __keys_.end(), __compare_);671 ranges::sort(__keys_.begin() + __old_size, __keys_.end(), __compare_);
605 } else {672 } else {
606 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(673 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
607 ranges::is_sorted(__keys_ | ranges::views::drop(__old_size)), "Key container is not sorted");674 ranges::is_sorted(__keys_ | ranges::views::drop(__old_size), __compare_), "Key container is not sorted");
608 }675 }
609 ranges::inplace_merge(__keys_.begin(), __keys_.begin() + __old_size, __keys_.end(), __compare_);676 ranges::inplace_merge(__keys_.begin(), __keys_.begin() + __old_size, __keys_.end(), __compare_);
610 __on_failure.__complete();677 __on_failure.__complete();
611 }678 }
612679
613 template <class _Kp>680 template <class _Kp>
614 _LIBCPP_HIDE_FROM_ABI iterator __emplace(_Kp&& __key) {681 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __emplace(_Kp&& __key) {
615 auto __it = upper_bound(__key);682 auto __it = upper_bound(__key);
616 return __flat_set_utils::__emplace_exact_pos(*this, __it, std::forward<_Kp>(__key));683 return __flat_set_utils::__emplace_exact_pos(*this, __it, std::forward<_Kp>(__key));
617 }684 }
618685
619 template <class _Kp>686 template <class _Kp>
620 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint(const_iterator __hint, _Kp&& __key) {687 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __emplace_hint(const_iterator __hint, _Kp&& __key) {
621 auto __prev_larger = __hint != cbegin() && __compare_(__key, *std::prev(__hint));688 auto __prev_larger = __hint != cbegin() && __compare_(__key, *std::prev(__hint));
622 auto __next_smaller = __hint != cend() && __compare_(*__hint, __key);689 auto __next_smaller = __hint != cend() && __compare_(*__hint, __key);
623690
...@@ -649,7 +716,7 @@ private:...@@ -649,7 +716,7 @@ private:
649 }716 }
650717
651 template <class _Self, class _Kp>718 template <class _Self, class _Kp>
652 _LIBCPP_HIDE_FROM_ABI static auto __find_impl(_Self&& __self, const _Kp& __key) {719 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto __find_impl(_Self&& __self, const _Kp& __key) {
653 auto __it = __self.lower_bound(__key);720 auto __it = __self.lower_bound(__key);
654 auto __last = __self.end();721 auto __last = __self.end();
655 if (__it == __last || __self.__compare_(__key, *__it)) {722 if (__it == __last || __self.__compare_(__key, *__it)) {
...@@ -659,29 +726,30 @@ private:...@@ -659,29 +726,30 @@ private:
659 }726 }
660727
661 template <class _Self, class _Kp>728 template <class _Self, class _Kp>
662 _LIBCPP_HIDE_FROM_ABI static auto __equal_range_impl(_Self&& __self, const _Kp& __key) {729 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto __equal_range_impl(_Self&& __self, const _Kp& __key) {
663 using __iter = _If<is_const_v<__libcpp_remove_reference_t<_Self>>, const_iterator, iterator>;730 using __iter = _If<is_const_v<__libcpp_remove_reference_t<_Self>>, const_iterator, iterator>;
664 auto [__key_first, __key_last] =731 auto [__key_first, __key_last] =
665 std::equal_range(__self.__keys_.begin(), __self.__keys_.end(), __key, __self.__compare_);732 std::equal_range(__self.__keys_.begin(), __self.__keys_.end(), __key, __self.__compare_);
666 return std::make_pair(__iter(__key_first), __iter(__key_last));733 return std::make_pair(__iter(__key_first), __iter(__key_last));
667 }734 }
668735
669 _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __size) {736 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __reserve(size_t __size) {
670 if constexpr (__container_traits<_KeyContainer>::__reservable) {737 if constexpr (__container_traits<_KeyContainer>::__reservable) {
671 __keys_.reserve(__size);738 __keys_.reserve(__size);
672 }739 }
673 }740 }
674741
675 template <class _Key2, class _Compare2, class _KeyContainer2, class _Predicate>742 template <class _Key2, class _Compare2, class _KeyContainer2, class _Predicate>
676 friend typename flat_multiset<_Key2, _Compare2, _KeyContainer2>::size_type743 friend typename flat_multiset<_Key2, _Compare2, _KeyContainer2>::size_type _LIBCPP_CONSTEXPR_SINCE_CXX26
677 erase_if(flat_multiset<_Key2, _Compare2, _KeyContainer2>&, _Predicate);744 erase_if(flat_multiset<_Key2, _Compare2, _KeyContainer2>&, _Predicate);
678745
679 _KeyContainer __keys_;746 _KeyContainer __keys_;
680 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;747 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;
681748
682 struct __key_equiv {749 struct __key_equiv {
683 _LIBCPP_HIDE_FROM_ABI __key_equiv(key_compare __c) : __comp_(__c) {}750 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __key_equiv(key_compare __c) : __comp_(__c) {}
684 _LIBCPP_HIDE_FROM_ABI bool operator()(const_reference __x, const_reference __y) const {751 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
752 operator()(const_reference __x, const_reference __y) const {
685 return !__comp_(std::get<0>(__x), std::get<0>(__y)) && !__comp_(std::get<0>(__y), std::get<0>(__x));753 return !__comp_(std::get<0>(__x), std::get<0>(__y)) && !__comp_(std::get<0>(__y), std::get<0>(__x));
686 }754 }
687 key_compare __comp_;755 key_compare __comp_;
...@@ -689,7 +757,7 @@ private:...@@ -689,7 +757,7 @@ private:
689};757};
690758
691template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>759template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
692 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&760 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
693 is_invocable_v<const _Compare&,761 is_invocable_v<const _Compare&,
694 const typename _KeyContainer::value_type&,762 const typename _KeyContainer::value_type&,
695 const typename _KeyContainer::value_type&>)763 const typename _KeyContainer::value_type&>)
...@@ -697,12 +765,12 @@ flat_multiset(_KeyContainer, _Compare = _Compare())...@@ -697,12 +765,12 @@ flat_multiset(_KeyContainer, _Compare = _Compare())
697 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;765 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
698766
699template <class _KeyContainer, class _Allocator>767template <class _KeyContainer, class _Allocator>
700 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)768 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
701flat_multiset(_KeyContainer, _Allocator)769flat_multiset(_KeyContainer, _Allocator)
702 -> flat_multiset<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;770 -> flat_multiset<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
703771
704template <class _KeyContainer, class _Compare, class _Allocator>772template <class _KeyContainer, class _Compare, class _Allocator>
705 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&773 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
706 uses_allocator_v<_KeyContainer, _Allocator> &&774 uses_allocator_v<_KeyContainer, _Allocator> &&
707 is_invocable_v<const _Compare&,775 is_invocable_v<const _Compare&,
708 const typename _KeyContainer::value_type&,776 const typename _KeyContainer::value_type&,
...@@ -711,7 +779,7 @@ flat_multiset(_KeyContainer, _Compare, _Allocator)...@@ -711,7 +779,7 @@ flat_multiset(_KeyContainer, _Compare, _Allocator)
711 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;779 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
712780
713template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>781template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
714 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&782 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
715 is_invocable_v<const _Compare&,783 is_invocable_v<const _Compare&,
716 const typename _KeyContainer::value_type&,784 const typename _KeyContainer::value_type&,
717 const typename _KeyContainer::value_type&>)785 const typename _KeyContainer::value_type&>)
...@@ -719,12 +787,12 @@ flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare = _Compare())...@@ -719,12 +787,12 @@ flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare = _Compare())
719 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;787 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
720788
721template <class _KeyContainer, class _Allocator>789template <class _KeyContainer, class _Allocator>
722 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)790 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
723flat_multiset(sorted_equivalent_t, _KeyContainer, _Allocator)791flat_multiset(sorted_equivalent_t, _KeyContainer, _Allocator)
724 -> flat_multiset<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;792 -> flat_multiset<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
725793
726template <class _KeyContainer, class _Compare, class _Allocator>794template <class _KeyContainer, class _Compare, class _Allocator>
727 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&795 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
728 uses_allocator_v<_KeyContainer, _Allocator> &&796 uses_allocator_v<_KeyContainer, _Allocator> &&
729 is_invocable_v<const _Compare&,797 is_invocable_v<const _Compare&,
730 const typename _KeyContainer::value_type&,798 const typename _KeyContainer::value_type&,
...@@ -732,37 +800,37 @@ template <class _KeyContainer, class _Compare, class _Allocator>...@@ -732,37 +800,37 @@ template <class _KeyContainer, class _Compare, class _Allocator>
732flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare, _Allocator)800flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare, _Allocator)
733 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;801 -> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
734802
735template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>803template <class _InputIterator, class _Compare = less<__iterator_value_type<_InputIterator>>>
736 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)804 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
737flat_multiset(_InputIterator, _InputIterator, _Compare = _Compare())805flat_multiset(_InputIterator, _InputIterator, _Compare = _Compare())
738 -> flat_multiset<__iter_value_type<_InputIterator>, _Compare>;806 -> flat_multiset<__iterator_value_type<_InputIterator>, _Compare>;
739807
740template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>808template <class _InputIterator, class _Compare = less<__iterator_value_type<_InputIterator>>>
741 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)809 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
742flat_multiset(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())810flat_multiset(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())
743 -> flat_multiset<__iter_value_type<_InputIterator>, _Compare>;811 -> flat_multiset<__iterator_value_type<_InputIterator>, _Compare>;
744812
745template <ranges::input_range _Range,813template <ranges::input_range _Range,
746 class _Compare = less<ranges::range_value_t<_Range>>,814 class _Compare = less<ranges::range_value_t<_Range>>,
747 class _Allocator = allocator<ranges::range_value_t<_Range>>,815 class _Allocator = allocator<ranges::range_value_t<_Range>>,
748 class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>816 class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
749flat_multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multiset<817flat_multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multiset<
750 ranges::range_value_t<_Range>,818 ranges::range_value_t<_Range>,
751 _Compare,819 _Compare,
752 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;820 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
753821
754template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>822template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
755flat_multiset(from_range_t, _Range&&, _Allocator) -> flat_multiset<823flat_multiset(from_range_t, _Range&&, _Allocator) -> flat_multiset<
756 ranges::range_value_t<_Range>,824 ranges::range_value_t<_Range>,
757 less<ranges::range_value_t<_Range>>,825 less<ranges::range_value_t<_Range>>,
758 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;826 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
759827
760template <class _Key, class _Compare = less<_Key>>828template <class _Key, class _Compare = less<_Key>>
761 requires(!__is_allocator<_Compare>::value)829 requires(!__is_allocator_v<_Compare>)
762flat_multiset(initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>;830flat_multiset(initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>;
763831
764template <class _Key, class _Compare = less<_Key>>832template <class _Key, class _Compare = less<_Key>>
765 requires(!__is_allocator<_Compare>::value)833 requires(!__is_allocator_v<_Compare>)
766flat_multiset(sorted_equivalent_t, initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>;834flat_multiset(sorted_equivalent_t, initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>;
767835
768template <class _Key, class _Compare, class _KeyContainer, class _Allocator>836template <class _Key, class _Compare, class _KeyContainer, class _Allocator>
...@@ -770,7 +838,7 @@ struct uses_allocator<flat_multiset<_Key, _Compare, _KeyContainer>, _Allocator>...@@ -770,7 +838,7 @@ struct uses_allocator<flat_multiset<_Key, _Compare, _KeyContainer>, _Allocator>
770 : bool_constant<uses_allocator_v<_KeyContainer, _Allocator> > {};838 : bool_constant<uses_allocator_v<_KeyContainer, _Allocator> > {};
771839
772template <class _Key, class _Compare, class _KeyContainer, class _Predicate>840template <class _Key, class _Compare, class _KeyContainer, class _Predicate>
773_LIBCPP_HIDE_FROM_ABI typename flat_multiset<_Key, _Compare, _KeyContainer>::size_type841_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename flat_multiset<_Key, _Compare, _KeyContainer>::size_type
774erase_if(flat_multiset<_Key, _Compare, _KeyContainer>& __flat_multiset, _Predicate __pred) {842erase_if(flat_multiset<_Key, _Compare, _KeyContainer>& __flat_multiset, _Predicate __pred) {
775 auto __guard = std::__make_exception_guard([&] { __flat_multiset.clear(); });843 auto __guard = std::__make_exception_guard([&] { __flat_multiset.clear(); });
776 auto __it =844 auto __it =
lib/libcxx/include/__flat_set/flat_set.h+86-68
...@@ -12,7 +12,6 @@...@@ -12,7 +12,6 @@
1212
13#include <__algorithm/lexicographical_compare_three_way.h>13#include <__algorithm/lexicographical_compare_three_way.h>
14#include <__algorithm/lower_bound.h>14#include <__algorithm/lower_bound.h>
15#include <__algorithm/min.h>
16#include <__algorithm/ranges_adjacent_find.h>15#include <__algorithm/ranges_adjacent_find.h>
17#include <__algorithm/ranges_equal.h>16#include <__algorithm/ranges_equal.h>
18#include <__algorithm/ranges_inplace_merge.h>17#include <__algorithm/ranges_inplace_merge.h>
...@@ -24,20 +23,16 @@...@@ -24,20 +23,16 @@
24#include <__compare/synth_three_way.h>23#include <__compare/synth_three_way.h>
25#include <__concepts/swappable.h>24#include <__concepts/swappable.h>
26#include <__config>25#include <__config>
27#include <__cstddef/ptrdiff_t.h>
28#include <__flat_map/sorted_unique.h>26#include <__flat_map/sorted_unique.h>
29#include <__flat_set/ra_iterator.h>27#include <__flat_set/ra_iterator.h>
30#include <__flat_set/utils.h>28#include <__flat_set/utils.h>
31#include <__functional/invoke.h>
32#include <__functional/is_transparent.h>29#include <__functional/is_transparent.h>
33#include <__functional/operations.h>30#include <__functional/operations.h>
34#include <__fwd/vector.h>31#include <__fwd/vector.h>
35#include <__iterator/concepts.h>32#include <__iterator/concepts.h>
36#include <__iterator/distance.h>
37#include <__iterator/iterator_traits.h>33#include <__iterator/iterator_traits.h>
38#include <__iterator/next.h>34#include <__iterator/next.h>
39#include <__iterator/prev.h>35#include <__iterator/prev.h>
40#include <__iterator/ranges_iterator_traits.h>
41#include <__iterator/reverse_iterator.h>36#include <__iterator/reverse_iterator.h>
42#include <__memory/allocator_traits.h>37#include <__memory/allocator_traits.h>
43#include <__memory/uses_allocator.h>38#include <__memory/uses_allocator.h>
...@@ -47,10 +42,7 @@...@@ -47,10 +42,7 @@
47#include <__ranges/container_compatible_range.h>42#include <__ranges/container_compatible_range.h>
48#include <__ranges/drop_view.h>43#include <__ranges/drop_view.h>
49#include <__ranges/from_range.h>44#include <__ranges/from_range.h>
50#include <__ranges/ref_view.h>
51#include <__ranges/size.h>45#include <__ranges/size.h>
52#include <__ranges/subrange.h>
53#include <__type_traits/conjunction.h>
54#include <__type_traits/container_traits.h>46#include <__type_traits/container_traits.h>
55#include <__type_traits/invoke.h>47#include <__type_traits/invoke.h>
56#include <__type_traits/is_allocator.h>48#include <__type_traits/is_allocator.h>
...@@ -347,38 +339,42 @@ public:...@@ -347,38 +339,42 @@ public:
347 }339 }
348340
349 // iterators341 // iterators
350 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {342 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {
351 return iterator(std::as_const(__keys_).begin());343 return iterator(std::as_const(__keys_).begin());
352 }344 }
353 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {345 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {
354 return const_iterator(__keys_.begin());346 return const_iterator(__keys_.begin());
355 }347 }
356 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {348 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {
357 return iterator(std::as_const(__keys_).end());349 return iterator(std::as_const(__keys_).end());
358 }350 }
359 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {351 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {
360 return const_iterator(__keys_.end());352 return const_iterator(__keys_.end());
361 }353 }
362354
363 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {355 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {
364 return reverse_iterator(end());356 return reverse_iterator(end());
365 }357 }
366 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {358 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {
367 return const_reverse_iterator(end());359 return const_reverse_iterator(end());
368 }360 }
369 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {361 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {
370 return reverse_iterator(begin());362 return reverse_iterator(begin());
371 }363 }
372 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {364 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {
373 return const_reverse_iterator(begin());365 return const_reverse_iterator(begin());
374 }366 }
375367
376 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept { return begin(); }368 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept {
377 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept { return end(); }369 return begin();
378 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {370 }
371 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept {
372 return end();
373 }
374 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {
379 return const_reverse_iterator(end());375 return const_reverse_iterator(end());
380 }376 }
381 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {377 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {
382 return const_reverse_iterator(begin());378 return const_reverse_iterator(begin());
383 }379 }
384380
...@@ -387,9 +383,13 @@ public:...@@ -387,9 +383,13 @@ public:
387 return __keys_.empty();383 return __keys_.empty();
388 }384 }
389385
390 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept { return __keys_.size(); }386 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept {
387 return __keys_.size();
388 }
391389
392 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept { return __keys_.max_size(); }390 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept {
391 return __keys_.max_size();
392 }
393393
394 // [flat.set.modifiers], modifiers394 // [flat.set.modifiers], modifiers
395 template <class... _Args>395 template <class... _Args>
...@@ -466,6 +466,15 @@ public:...@@ -466,6 +466,15 @@ public:
466 __append_sort_merge_unique</*WasSorted = */ false>(std::forward<_Range>(__range));466 __append_sort_merge_unique</*WasSorted = */ false>(std::forward<_Range>(__range));
467 }467 }
468468
469 template <_ContainerCompatibleRange<value_type> _Range>
470 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(std::sorted_unique_t, _Range&& __range) {
471 if constexpr (ranges::sized_range<_Range>) {
472 __reserve(ranges::size(__range));
473 }
474
475 __append_sort_merge_unique</*WasSorted = */ true>(std::forward<_Range>(__range));
476 }
477
469 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {478 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
470 insert(__il.begin(), __il.end());479 insert(__il.begin(), __il.end());
471 }480 }
...@@ -474,7 +483,7 @@ public:...@@ -474,7 +483,7 @@ public:
474 insert(sorted_unique, __il.begin(), __il.end());483 insert(sorted_unique, __il.begin(), __il.end());
475 }484 }
476485
477 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 container_type extract() && {486 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 container_type extract() && {
478 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });487 auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });
479 auto __ret = std::move(__keys_);488 auto __ret = std::move(__keys_);
480 return __ret;489 return __ret;
...@@ -524,123 +533,131 @@ public:...@@ -524,123 +533,131 @@ public:
524 return iterator(std::move(__key_it));533 return iterator(std::move(__key_it));
525 }534 }
526535
527 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_set& __y) noexcept {536 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
528 // warning: The spec has unconditional noexcept, which means that537 swap(flat_set& __y) noexcept(is_nothrow_swappable_v<container_type> && is_nothrow_swappable_v<key_compare>) {
529 // if any of the following functions throw an exception,538 auto __on_failure = std::__make_exception_guard([&]() noexcept {
530 // std::terminate will be called.539 clear() /* noexcept */;
531 // This is discussed in P2767, which hasn't been voted on yet.540 __y.clear() /* noexcept */;
541 });
532 ranges::swap(__compare_, __y.__compare_);542 ranges::swap(__compare_, __y.__compare_);
533 ranges::swap(__keys_, __y.__keys_);543 ranges::swap(__keys_, __y.__keys_);
544 __on_failure.__complete();
534 }545 }
535546
536 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept { __keys_.clear(); }547 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept { __keys_.clear(); }
537548
538 // observers549 // observers
539 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }550 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }
540 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const { return __compare_; }551 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
552 return __compare_;
553 }
541554
542 // set operations555 // set operations
543 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {556 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {
544 return __find_impl(*this, __x);557 return __find_impl(*this, __x);
545 }558 }
546559
547 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {560 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {
548 return __find_impl(*this, __x);561 return __find_impl(*this, __x);
549 }562 }
550563
551 template <class _Kp>564 template <class _Kp>
552 requires __is_transparent_v<_Compare>565 requires __is_transparent_v<_Compare>
553 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {566 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {
554 return __find_impl(*this, __x);567 return __find_impl(*this, __x);
555 }568 }
556569
557 template <class _Kp>570 template <class _Kp>
558 requires __is_transparent_v<_Compare>571 requires __is_transparent_v<_Compare>
559 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {572 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {
560 return __find_impl(*this, __x);573 return __find_impl(*this, __x);
561 }574 }
562575
563 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {576 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {
564 return contains(__x) ? 1 : 0;577 return contains(__x) ? 1 : 0;
565 }578 }
566579
567 template <class _Kp>580 template <class _Kp>
568 requires __is_transparent_v<_Compare>581 requires __is_transparent_v<_Compare>
569 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {582 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {
570 return contains(__x) ? 1 : 0;583 return contains(__x) ? 1 : 0;
571 }584 }
572585
573 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {586 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {
574 return find(__x) != end();587 return find(__x) != end();
575 }588 }
576589
577 template <class _Kp>590 template <class _Kp>
578 requires __is_transparent_v<_Compare>591 requires __is_transparent_v<_Compare>
579 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {592 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {
580 return find(__x) != end();593 return find(__x) != end();
581 }594 }
582595
583 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {596 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {
584 const auto& __keys = __keys_;597 const auto& __keys = __keys_;
585 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));598 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));
586 }599 }
587600
588 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const key_type& __x) const {601 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
602 lower_bound(const key_type& __x) const {
589 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));603 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
590 }604 }
591605
592 template <class _Kp>606 template <class _Kp>
593 requires __is_transparent_v<_Compare>607 requires __is_transparent_v<_Compare>
594 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {608 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {
595 const auto& __keys = __keys_;609 const auto& __keys = __keys_;
596 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));610 return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));
597 }611 }
598612
599 template <class _Kp>613 template <class _Kp>
600 requires __is_transparent_v<_Compare>614 requires __is_transparent_v<_Compare>
601 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {615 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {
602 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));616 return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
603 }617 }
604618
605 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {619 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {
606 const auto& __keys = __keys_;620 const auto& __keys = __keys_;
607 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));621 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));
608 }622 }
609623
610 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const key_type& __x) const {624 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
625 upper_bound(const key_type& __x) const {
611 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));626 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
612 }627 }
613628
614 template <class _Kp>629 template <class _Kp>
615 requires __is_transparent_v<_Compare>630 requires __is_transparent_v<_Compare>
616 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {631 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {
617 const auto& __keys = __keys_;632 const auto& __keys = __keys_;
618 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));633 return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));
619 }634 }
620635
621 template <class _Kp>636 template <class _Kp>
622 requires __is_transparent_v<_Compare>637 requires __is_transparent_v<_Compare>
623 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {638 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {
624 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));639 return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
625 }640 }
626641
627 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __x) {642 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
643 equal_range(const key_type& __x) {
628 return __equal_range_impl(*this, __x);644 return __equal_range_impl(*this, __x);
629 }645 }
630646
631 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>647 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
632 equal_range(const key_type& __x) const {648 equal_range(const key_type& __x) const {
633 return __equal_range_impl(*this, __x);649 return __equal_range_impl(*this, __x);
634 }650 }
635651
636 template <class _Kp>652 template <class _Kp>
637 requires __is_transparent_v<_Compare>653 requires __is_transparent_v<_Compare>
638 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _Kp& __x) {654 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator>
655 equal_range(const _Kp& __x) {
639 return __equal_range_impl(*this, __x);656 return __equal_range_impl(*this, __x);
640 }657 }
641 template <class _Kp>658 template <class _Kp>
642 requires __is_transparent_v<_Compare>659 requires __is_transparent_v<_Compare>
643 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>660 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
644 equal_range(const _Kp& __x) const {661 equal_range(const _Kp& __x) const {
645 return __equal_range_impl(*this, __x);662 return __equal_range_impl(*this, __x);
646 }663 }
...@@ -655,13 +672,14 @@ public:...@@ -655,13 +672,14 @@ public:
655 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);672 __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
656 }673 }
657674
658 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_set& __x, flat_set& __y) noexcept {675 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
676 swap(flat_set& __x, flat_set& __y) noexcept(noexcept(__x.swap(__y))) {
659 __x.swap(__y);677 __x.swap(__y);
660 }678 }
661679
662private:680private:
663 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_sorted_and_unique(auto&& __key_container) const {681 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_sorted_and_unique(auto&& __key_container) const {
664 auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) { return !__compare_(__x, __y); };682 auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) -> bool { return !__compare_(__x, __y); };
665 return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);683 return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);
666 }684 }
667685
...@@ -774,19 +792,19 @@ private:...@@ -774,19 +792,19 @@ private:
774};792};
775793
776template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>794template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
777 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&795 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
778 is_invocable_v<const _Compare&,796 is_invocable_v<const _Compare&,
779 const typename _KeyContainer::value_type&,797 const typename _KeyContainer::value_type&,
780 const typename _KeyContainer::value_type&>)798 const typename _KeyContainer::value_type&>)
781flat_set(_KeyContainer, _Compare = _Compare()) -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;799flat_set(_KeyContainer, _Compare = _Compare()) -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
782800
783template <class _KeyContainer, class _Allocator>801template <class _KeyContainer, class _Allocator>
784 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)802 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
785flat_set(_KeyContainer, _Allocator)803flat_set(_KeyContainer, _Allocator)
786 -> flat_set<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;804 -> flat_set<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
787805
788template <class _KeyContainer, class _Compare, class _Allocator>806template <class _KeyContainer, class _Compare, class _Allocator>
789 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&807 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
790 uses_allocator_v<_KeyContainer, _Allocator> &&808 uses_allocator_v<_KeyContainer, _Allocator> &&
791 is_invocable_v<const _Compare&,809 is_invocable_v<const _Compare&,
792 const typename _KeyContainer::value_type&,810 const typename _KeyContainer::value_type&,
...@@ -794,7 +812,7 @@ template <class _KeyContainer, class _Compare, class _Allocator>...@@ -794,7 +812,7 @@ template <class _KeyContainer, class _Compare, class _Allocator>
794flat_set(_KeyContainer, _Compare, _Allocator) -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;812flat_set(_KeyContainer, _Compare, _Allocator) -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
795813
796template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>814template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
797 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&815 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
798 is_invocable_v<const _Compare&,816 is_invocable_v<const _Compare&,
799 const typename _KeyContainer::value_type&,817 const typename _KeyContainer::value_type&,
800 const typename _KeyContainer::value_type&>)818 const typename _KeyContainer::value_type&>)
...@@ -802,12 +820,12 @@ flat_set(sorted_unique_t, _KeyContainer, _Compare = _Compare())...@@ -802,12 +820,12 @@ flat_set(sorted_unique_t, _KeyContainer, _Compare = _Compare())
802 -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;820 -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
803821
804template <class _KeyContainer, class _Allocator>822template <class _KeyContainer, class _Allocator>
805 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)823 requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
806flat_set(sorted_unique_t, _KeyContainer, _Allocator)824flat_set(sorted_unique_t, _KeyContainer, _Allocator)
807 -> flat_set<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;825 -> flat_set<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
808826
809template <class _KeyContainer, class _Compare, class _Allocator>827template <class _KeyContainer, class _Compare, class _Allocator>
810 requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&828 requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
811 uses_allocator_v<_KeyContainer, _Allocator> &&829 uses_allocator_v<_KeyContainer, _Allocator> &&
812 is_invocable_v<const _Compare&,830 is_invocable_v<const _Compare&,
813 const typename _KeyContainer::value_type&,831 const typename _KeyContainer::value_type&,
...@@ -815,37 +833,37 @@ template <class _KeyContainer, class _Compare, class _Allocator>...@@ -815,37 +833,37 @@ template <class _KeyContainer, class _Compare, class _Allocator>
815flat_set(sorted_unique_t, _KeyContainer, _Compare, _Allocator)833flat_set(sorted_unique_t, _KeyContainer, _Compare, _Allocator)
816 -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;834 -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
817835
818template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>836template <class _InputIterator, class _Compare = less<__iterator_value_type<_InputIterator>>>
819 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)837 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
820flat_set(_InputIterator, _InputIterator, _Compare = _Compare())838flat_set(_InputIterator, _InputIterator, _Compare = _Compare())
821 -> flat_set<__iter_value_type<_InputIterator>, _Compare>;839 -> flat_set<__iterator_value_type<_InputIterator>, _Compare>;
822840
823template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>841template <class _InputIterator, class _Compare = less<__iterator_value_type<_InputIterator>>>
824 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)842 requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
825flat_set(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())843flat_set(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())
826 -> flat_set<__iter_value_type<_InputIterator>, _Compare>;844 -> flat_set<__iterator_value_type<_InputIterator>, _Compare>;
827845
828template <ranges::input_range _Range,846template <ranges::input_range _Range,
829 class _Compare = less<ranges::range_value_t<_Range>>,847 class _Compare = less<ranges::range_value_t<_Range>>,
830 class _Allocator = allocator<ranges::range_value_t<_Range>>,848 class _Allocator = allocator<ranges::range_value_t<_Range>>,
831 class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>849 class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
832flat_set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_set<850flat_set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_set<
833 ranges::range_value_t<_Range>,851 ranges::range_value_t<_Range>,
834 _Compare,852 _Compare,
835 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;853 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
836854
837template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>855template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
838flat_set(from_range_t, _Range&&, _Allocator) -> flat_set<856flat_set(from_range_t, _Range&&, _Allocator) -> flat_set<
839 ranges::range_value_t<_Range>,857 ranges::range_value_t<_Range>,
840 less<ranges::range_value_t<_Range>>,858 less<ranges::range_value_t<_Range>>,
841 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;859 vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
842860
843template <class _Key, class _Compare = less<_Key>>861template <class _Key, class _Compare = less<_Key>>
844 requires(!__is_allocator<_Compare>::value)862 requires(!__is_allocator_v<_Compare>)
845flat_set(initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>;863flat_set(initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>;
846864
847template <class _Key, class _Compare = less<_Key>>865template <class _Key, class _Compare = less<_Key>>
848 requires(!__is_allocator<_Compare>::value)866 requires(!__is_allocator_v<_Compare>)
849flat_set(sorted_unique_t, initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>;867flat_set(sorted_unique_t, initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>;
850868
851template <class _Key, class _Compare, class _KeyContainer, class _Allocator>869template <class _Key, class _Compare, class _KeyContainer, class _Allocator>
lib/libcxx/include/__format/concepts.h-14
...@@ -15,12 +15,8 @@...@@ -15,12 +15,8 @@
15#include <__config>15#include <__config>
16#include <__format/format_parse_context.h>16#include <__format/format_parse_context.h>
17#include <__fwd/format.h>17#include <__fwd/format.h>
18#include <__fwd/tuple.h>
19#include <__tuple/tuple_size.h>
20#include <__type_traits/is_specialization.h>
21#include <__type_traits/remove_const.h>18#include <__type_traits/remove_const.h>
22#include <__type_traits/remove_reference.h>19#include <__type_traits/remove_reference.h>
23#include <__utility/pair.h>
2420
25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
26# pragma GCC system_header22# pragma GCC system_header
...@@ -65,16 +61,6 @@ concept __formattable =...@@ -65,16 +61,6 @@ concept __formattable =
65# if _LIBCPP_STD_VER >= 2361# if _LIBCPP_STD_VER >= 23
66template <class _Tp, class _CharT>62template <class _Tp, class _CharT>
67concept formattable = __formattable<_Tp, _CharT>;63concept formattable = __formattable<_Tp, _CharT>;
68
69// [tuple.like] defines a tuple-like exposition only concept. This concept is
70// not related to that. Therefore it uses a different name for the concept.
71//
72// TODO FMT Add a test to validate we fail when using that concept after P2165
73// has been implemented.
74template <class _Tp>
75concept __fmt_pair_like =
76 __is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
77
78# endif // _LIBCPP_STD_VER >= 2364# endif // _LIBCPP_STD_VER >= 23
79#endif // _LIBCPP_STD_VER >= 2065#endif // _LIBCPP_STD_VER >= 20
8066
lib/libcxx/include/__format/extended_grapheme_cluster_table.h+3-2
...@@ -61,7 +61,7 @@...@@ -61,7 +61,7 @@
61#ifndef _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H61#ifndef _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H
62#define _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H62#define _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_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 <__iterator/access.h>
...@@ -1647,7 +1647,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[1501] = {...@@ -1647,7 +1647,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[1501] = {
1647 // size. Then the upper bound for code point 3 will return the entry after1647 // size. Then the upper bound for code point 3 will return the entry after
1648 // 0x1810. After moving to the previous entry the algorithm arrives at the1648 // 0x1810. After moving to the previous entry the algorithm arrives at the
1649 // correct entry.1649 // correct entry.
1650 ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 11) | 0x7ffu) - __entries;1650 ptrdiff_t __i =
1651 std::upper_bound(std::begin(__entries), std::end(__entries), (__code_point << 11) | 0x7ffu) - __entries;
1651 if (__i == 0)1652 if (__i == 0)
1652 return __property::__none;1653 return __property::__none;
16531654
lib/libcxx/include/__format/fmt_pair_like.h created+42
...@@ -0,0 +1,42 @@
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_FMT_PAIR_LIKE_H
11#define _LIBCPP___FORMAT_FMT_PAIR_LIKE_H
12
13#include <__config>
14#include <__fwd/pair.h>
15#include <__fwd/tuple.h>
16#include <__tuple/tuple_size.h>
17#include <__type_traits/is_specialization.h>
18
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header
21#endif
22
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 23
26
27// [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.
29//
30// TODO FMT Add a test to validate we fail when using that concept after P2165 has been implemented.
31
32// [format.range.fmtkind]/2.2.1 and [tab:formatter.range.type]:
33// "U is either a specialization of pair or a specialization of tuple such that tuple_size_v<U> is 2."
34template <class _Tp>
35concept __fmt_pair_like =
36 __is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
37
38#endif // _LIBCPP_STD_VER >= 23
39
40_LIBCPP_END_NAMESPACE_STD
41
42#endif // _LIBCPP___FORMAT_FMT_PAIR_LIKE_H
lib/libcxx/include/__format/format_arg.h+7-10
...@@ -149,7 +149,7 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) __visit_format_arg(_Visitor&& __vis, basic_...@@ -149,7 +149,7 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) __visit_format_arg(_Visitor&& __vis, basic_
149 __libcpp_unreachable();149 __libcpp_unreachable();
150}150}
151151
152# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER152# if _LIBCPP_STD_VER >= 26
153153
154template <class _Rp, class _Visitor, class _Context>154template <class _Rp, class _Visitor, class _Context>
155_LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {155_LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
...@@ -200,7 +200,7 @@ _LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<...@@ -200,7 +200,7 @@ _LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<
200 __libcpp_unreachable();200 __libcpp_unreachable();
201}201}
202202
203# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER203# endif // _LIBCPP_STD_VER >= 26
204204
205/// Contains the values used in basic_format_arg.205/// Contains the values used in basic_format_arg.
206///206///
...@@ -285,7 +285,7 @@ public:...@@ -285,7 +285,7 @@ public:
285285
286 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept { return __type_ != __format::__arg_t::__none; }286 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept { return __type_ != __format::__arg_t::__none; }
287287
288# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER288# if _LIBCPP_STD_VER >= 26
289289
290 // This function is user facing, so it must wrap the non-standard types of290 // This function is user facing, so it must wrap the non-standard types of
291 // the "variant" in a handle to stay conforming. See __arg_t for more details.291 // the "variant" in a handle to stay conforming. See __arg_t for more details.
...@@ -329,7 +329,7 @@ public:...@@ -329,7 +329,7 @@ public:
329 }329 }
330 }330 }
331331
332# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER332# endif // _LIBCPP_STD_VER >= 26
333333
334private:334private:
335 using char_type = typename _Context::char_type;335 using char_type = typename _Context::char_type;
...@@ -371,11 +371,8 @@ private:...@@ -371,11 +371,8 @@ private:
371// This function is user facing, so it must wrap the non-standard types of371// This function is user facing, so it must wrap the non-standard types of
372// the "variant" in a handle to stay conforming. See __arg_t for more details.372// the "variant" in a handle to stay conforming. See __arg_t for more details.
373template <class _Visitor, class _Context>373template <class _Visitor, class _Context>
374# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER374_LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_HIDE_FROM_ABI decltype(auto)
375_LIBCPP_DEPRECATED_IN_CXX26375visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
376# endif
377 _LIBCPP_HIDE_FROM_ABI decltype(auto)
378 visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
379 switch (__arg.__type_) {376 switch (__arg.__type_) {
380# if _LIBCPP_HAS_INT128377# if _LIBCPP_HAS_INT128
381 case __format::__arg_t::__i128: {378 case __format::__arg_t::__i128: {
...@@ -387,7 +384,7 @@ _LIBCPP_DEPRECATED_IN_CXX26...@@ -387,7 +384,7 @@ _LIBCPP_DEPRECATED_IN_CXX26
387 typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__u128_};384 typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__u128_};
388 return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});385 return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
389 }386 }
390# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER387# endif // _LIBCPP_HAS_INT128
391 default:388 default:
392 return std::__visit_format_arg(std::forward<_Visitor>(__vis), __arg);389 return std::__visit_format_arg(std::forward<_Visitor>(__vis), __arg);
393 }390 }
lib/libcxx/include/__format/format_args.h+1-1
...@@ -40,7 +40,7 @@ public:...@@ -40,7 +40,7 @@ public:
40 }40 }
41 }41 }
4242
43 _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> get(size_t __id) const noexcept {43 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> get(size_t __id) const noexcept {
44 if (__id >= __size_)44 if (__id >= __size_)
45 return basic_format_arg<_Context>{};45 return basic_format_arg<_Context>{};
4646
lib/libcxx/include/__format/format_context.h+5-5
...@@ -80,17 +80,17 @@ public:...@@ -80,17 +80,17 @@ public:
80 template <class _Tp>80 template <class _Tp>
81 using formatter_type = formatter<_Tp, _CharT>;81 using formatter_type = formatter<_Tp, _CharT>;
8282
83 _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> arg(size_t __id) const noexcept {83 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> arg(size_t __id) const noexcept {
84 return __args_.get(__id);84 return __args_.get(__id);
85 }85 }
86# if _LIBCPP_HAS_LOCALIZATION86# if _LIBCPP_HAS_LOCALIZATION
87 _LIBCPP_HIDE_FROM_ABI std::locale locale() {87 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI std::locale locale() {
88 if (!__loc_)88 if (!__loc_)
89 __loc_ = std::locale{};89 __loc_ = std::locale{};
90 return *__loc_;90 return *__loc_;
91 }91 }
92# endif92# endif
93 _LIBCPP_HIDE_FROM_ABI iterator out() { return std::move(__out_it_); }93 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator out() { return std::move(__out_it_); }
94 _LIBCPP_HIDE_FROM_ABI void advance_to(iterator __it) { __out_it_ = std::move(__it); }94 _LIBCPP_HIDE_FROM_ABI void advance_to(iterator __it) { __out_it_ = std::move(__it); }
9595
96private:96private:
...@@ -175,13 +175,13 @@ public:...@@ -175,13 +175,13 @@ public:
175 __format::__determine_arg_t<basic_format_context, decltype(__arg)>(),175 __format::__determine_arg_t<basic_format_context, decltype(__arg)>(),
176 __basic_format_arg_value<basic_format_context>(__arg)};176 __basic_format_arg_value<basic_format_context>(__arg)};
177 };177 };
178# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER178# if _LIBCPP_STD_VER >= 26
179 return static_cast<_Context*>(__c)->arg(__id).visit(std::move(__visitor));179 return static_cast<_Context*>(__c)->arg(__id).visit(std::move(__visitor));
180# else180# else
181 _LIBCPP_SUPPRESS_DEPRECATED_PUSH181 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
182 return std::visit_format_arg(std::move(__visitor), static_cast<_Context*>(__c)->arg(__id));182 return std::visit_format_arg(std::move(__visitor), static_cast<_Context*>(__c)->arg(__id));
183 _LIBCPP_SUPPRESS_DEPRECATED_POP183 _LIBCPP_SUPPRESS_DEPRECATED_POP
184# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER184# endif // _LIBCPP_STD_VER >= 26
185 }) {185 }) {
186 }186 }
187187
lib/libcxx/include/__format/format_parse_context.h+2-2
...@@ -41,8 +41,8 @@ public:...@@ -41,8 +41,8 @@ public:
41 basic_format_parse_context(const basic_format_parse_context&) = delete;41 basic_format_parse_context(const basic_format_parse_context&) = delete;
42 basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;42 basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;
4343
44 _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept { return __begin_; }44 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept { return __begin_; }
45 _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept { return __end_; }45 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept { return __end_; }
46 _LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) { __begin_ = __it; }46 _LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) { __begin_ = __it; }
4747
48 _LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() {48 _LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() {
lib/libcxx/include/__format/formatter_output.h+30-34
...@@ -45,7 +45,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -45,7 +45,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4545
46namespace __formatter {46namespace __formatter {
4747
48struct _LIBCPP_EXPORTED_FROM_ABI __padding_size_result {48struct __padding_size_result {
49 size_t __before_;49 size_t __before_;
50 size_t __after_;50 size_t __after_;
51};51};
...@@ -151,45 +151,41 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, _CharT __value)...@@ -151,45 +151,41 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, _CharT __value)
151 }151 }
152}152}
153153
154# if _LIBCPP_HAS_UNICODE
155template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>154template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
156 requires(same_as<_CharT, char>)
157_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {155_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
158 std::size_t __bytes = std::countl_one(static_cast<unsigned char>(__value.__data[0]));156# if _LIBCPP_HAS_UNICODE
159 if (__bytes == 0)157 if constexpr (same_as<_CharT, char>) {
160 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);158 std::size_t __bytes = std::countl_one(static_cast<unsigned char>(__value.__data[0]));
161159 if (__bytes == 0)
162 for (size_t __i = 0; __i < __n; ++__i)160 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
163 __out_it = __formatter::__copy(161
164 std::addressof(__value.__data[0]), std::addressof(__value.__data[0]) + __bytes, std::move(__out_it));162 for (size_t __i = 0; __i < __n; ++__i)
165 return __out_it;163 __out_it = __formatter::__copy(
166}164 std::addressof(__value.__data[0]), std::addressof(__value.__data[0]) + __bytes, std::move(__out_it));
167165 return __out_it;
168# if _LIBCPP_HAS_WIDE_CHARACTERS166# if _LIBCPP_HAS_WIDE_CHARACTERS
169template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>167 } else if constexpr (same_as<_CharT, wchar_t>) {
170 requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)168 if constexpr (sizeof(wchar_t) == 2) {
171_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {169 if (!__unicode::__is_high_surrogate(__value.__data[0]))
172 if (!__unicode::__is_high_surrogate(__value.__data[0]))170 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
173 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);171
174172 for (size_t __i = 0; __i < __n; ++__i)
175 for (size_t __i = 0; __i < __n; ++__i)173 __out_it = __formatter::__copy(
176 __out_it = __formatter::__copy(174 std::addressof(__value.__data[0]), std::addressof(__value.__data[0]) + 2, std::move(__out_it));
177 std::addressof(__value.__data[0]), std::addressof(__value.__data[0]) + 2, std::move(__out_it));175 return __out_it;
178 return __out_it;176 } else if constexpr (sizeof(wchar_t) == 4) {
179}177 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
180178 } else {
181template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>179 static_assert(false, "expected sizeof(wchar_t) to be 2 or 4");
182 requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 4)180 }
183_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
184 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
185}
186# endif // _LIBCPP_HAS_WIDE_CHARACTERS181# endif // _LIBCPP_HAS_WIDE_CHARACTERS
187# else // _LIBCPP_HAS_UNICODE182 } else {
188template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>183 static_assert(false, "Unexpected CharT");
189_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {184 }
185# else // _LIBCPP_HAS_UNICODE
190 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);186 return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
187# endif // _LIBCPP_HAS_UNICODE
191}188}
192# endif // _LIBCPP_HAS_UNICODE
193189
194/// Writes the input to the output with the required padding.190/// Writes the input to the output with the required padding.
195///191///
lib/libcxx/include/__format/indic_conjunct_break_table.h+3-2
...@@ -61,7 +61,7 @@...@@ -61,7 +61,7 @@
61#ifndef _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H61#ifndef _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H
62#define _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H62#define _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_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 <__iterator/access.h>
...@@ -531,7 +531,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[403] = {...@@ -531,7 +531,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[403] = {
531 // size. Then the upper bound for code point 3 will return the entry after531 // size. Then the upper bound for code point 3 will return the entry after
532 // 0x1810. After moving to the previous entry the algorithm arrives at the532 // 0x1810. After moving to the previous entry the algorithm arrives at the
533 // correct entry.533 // correct entry.
534 ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 11) | 0x7ffu) - __entries;534 ptrdiff_t __i =
535 std::upper_bound(std::begin(__entries), std::end(__entries), (__code_point << 11) | 0x7ffu) - __entries;
535 if (__i == 0)536 if (__i == 0)
536 return __property::__none;537 return __property::__none;
537538
lib/libcxx/include/__format/range_default_formatter.h+2-41
...@@ -16,10 +16,11 @@...@@ -16,10 +16,11 @@
1616
17#include <__algorithm/ranges_copy.h>17#include <__algorithm/ranges_copy.h>
18#include <__chrono/statically_widen.h>18#include <__chrono/statically_widen.h>
19#include <__concepts/same_as.h>
20#include <__config>19#include <__config>
21#include <__format/concepts.h>20#include <__format/concepts.h>
21#include <__format/fmt_pair_like.h>
22#include <__format/formatter.h>22#include <__format/formatter.h>
23#include <__format/range_format.h>
23#include <__format/range_formatter.h>24#include <__format/range_formatter.h>
24#include <__iterator/back_insert_iterator.h>25#include <__iterator/back_insert_iterator.h>
25#include <__ranges/concepts.h>26#include <__ranges/concepts.h>
...@@ -42,51 +43,11 @@ concept __const_formattable_range =...@@ -42,51 +43,11 @@ concept __const_formattable_range =
42template <class _Rp, class _CharT>43template <class _Rp, class _CharT>
43using __fmt_maybe_const _LIBCPP_NODEBUG = conditional_t<__const_formattable_range<_Rp, _CharT>, const _Rp, _Rp>;44using __fmt_maybe_const _LIBCPP_NODEBUG = conditional_t<__const_formattable_range<_Rp, _CharT>, const _Rp, _Rp>;
4445
45_LIBCPP_DIAGNOSTIC_PUSH
46_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wshadow")
47_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshadow")
48// This shadows map, set, and string.
49enum class range_format { disabled, map, set, sequence, string, debug_string };
50_LIBCPP_DIAGNOSTIC_POP
51
52// There is no definition of this struct, it's purely intended to be used to46// There is no definition of this struct, it's purely intended to be used to
53// generate diagnostics.47// generate diagnostics.
54template <class _Rp>48template <class _Rp>
55struct __instantiated_the_primary_template_of_format_kind;49struct __instantiated_the_primary_template_of_format_kind;
5650
57template <class _Rp>
58constexpr range_format format_kind = [] {
59 // [format.range.fmtkind]/1
60 // A program that instantiates the primary template of format_kind is ill-formed.
61 static_assert(sizeof(_Rp) != sizeof(_Rp), "create a template specialization of format_kind for your type");
62 return range_format::disabled;
63}();
64
65template <ranges::input_range _Rp>
66 requires same_as<_Rp, remove_cvref_t<_Rp>>
67inline constexpr range_format format_kind<_Rp> = [] {
68 // [format.range.fmtkind]/2
69
70 // 2.1 If same_as<remove_cvref_t<ranges::range_reference_t<R>>, R> is true,
71 // Otherwise format_kind<R> is range_format::disabled.
72 if constexpr (same_as<remove_cvref_t<ranges::range_reference_t<_Rp>>, _Rp>)
73 return range_format::disabled;
74 // 2.2 Otherwise, if the qualified-id R::key_type is valid and denotes a type:
75 else if constexpr (requires { typename _Rp::key_type; }) {
76 // 2.2.1 If the qualified-id R::mapped_type is valid and denotes a type ...
77 if constexpr (requires { typename _Rp::mapped_type; } &&
78 // 2.2.1 ... If either U is a specialization of pair or U is a specialization
79 // of tuple and tuple_size_v<U> == 2
80 __fmt_pair_like<remove_cvref_t<ranges::range_reference_t<_Rp>>>)
81 return range_format::map;
82 else
83 // 2.2.2 Otherwise format_kind<R> is range_format::set.
84 return range_format::set;
85 } else
86 // 2.3 Otherwise, format_kind<R> is range_format::sequence.
87 return range_format::sequence;
88}();
89
90template <range_format _Kp, ranges::input_range _Rp, class _CharT>51template <range_format _Kp, ranges::input_range _Rp, class _CharT>
91struct __range_default_formatter;52struct __range_default_formatter;
9253
lib/libcxx/include/__format/range_format.h created+71
...@@ -0,0 +1,71 @@
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_RANGE_FORMAT_H
11#define _LIBCPP___FORMAT_RANGE_FORMAT_H
12
13#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
14# pragma GCC system_header
15#endif
16
17#include <__concepts/same_as.h>
18#include <__config>
19#include <__format/fmt_pair_like.h>
20#include <__ranges/concepts.h>
21#include <__type_traits/remove_cvref.h>
22
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 23
26
27_LIBCPP_DIAGNOSTIC_PUSH
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}();
41
42template <ranges::input_range _Rp>
43 requires same_as<_Rp, remove_cvref_t<_Rp>>
44inline constexpr range_format format_kind<_Rp> = [] {
45 // [format.range.fmtkind]/2
46
47 // 2.1 If same_as<remove_cvref_t<ranges::range_reference_t<R>>, R> is true,
48 // Otherwise format_kind<R> is range_format::disabled.
49 if constexpr (same_as<remove_cvref_t<ranges::range_reference_t<_Rp>>, _Rp>)
50 return range_format::disabled;
51 // 2.2 Otherwise, if the qualified-id R::key_type is valid and denotes a type:
52 else if constexpr (requires { typename _Rp::key_type; }) {
53 // 2.2.1 If the qualified-id R::mapped_type is valid and denotes a type ...
54 if constexpr (requires { typename _Rp::mapped_type; } &&
55 // 2.2.1 ... If either U is a specialization of pair or U is a specialization
56 // of tuple and tuple_size_v<U> == 2
57 __fmt_pair_like<remove_cvref_t<ranges::range_reference_t<_Rp>>>)
58 return range_format::map;
59 else
60 // 2.2.2 Otherwise format_kind<R> is range_format::set.
61 return range_format::set;
62 } else
63 // 2.3 Otherwise, format_kind<R> is range_format::sequence.
64 return range_format::sequence;
65}();
66
67#endif // _LIBCPP_STD_VER >= 23
68
69_LIBCPP_END_NAMESPACE_STD
70
71#endif
lib/libcxx/include/__format/range_formatter.h+1
...@@ -20,6 +20,7 @@...@@ -20,6 +20,7 @@
20#include <__config>20#include <__config>
21#include <__format/buffer.h>21#include <__format/buffer.h>
22#include <__format/concepts.h>22#include <__format/concepts.h>
23#include <__format/fmt_pair_like.h>
23#include <__format/format_context.h>24#include <__format/format_context.h>
24#include <__format/format_error.h>25#include <__format/format_error.h>
25#include <__format/formatter.h>26#include <__format/formatter.h>
lib/libcxx/include/__format/width_estimation_table.h+4-2
...@@ -61,9 +61,10 @@...@@ -61,9 +61,10 @@
61#ifndef _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H61#ifndef _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H
62#define _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H62#define _LIBCPP___FORMAT_WIDTH_ESTIMATION_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)
...@@ -255,7 +256,8 @@ inline constexpr uint32_t __table_upper_bound = 0x0003fffd;...@@ -255,7 +256,8 @@ inline constexpr uint32_t __table_upper_bound = 0x0003fffd;
255 if (__code_point < (__entries[0] >> 14))256 if (__code_point < (__entries[0] >> 14))
256 return 1;257 return 1;
257258
258 ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 14) | 0x3fffu) - __entries;259 ptrdiff_t __i =
260 std::upper_bound(std::begin(__entries), std::end(__entries), (__code_point << 14) | 0x3fffu) - __entries;
259 if (__i == 0)261 if (__i == 0)
260 return 1;262 return 1;
261263
lib/libcxx/include/__functional/bind.h+10-15
...@@ -81,17 +81,12 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __mu(reference_w...@@ -81,17 +81,12 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __mu(reference_w
81 return __t.get();81 return __t.get();
82}82}
8383
84template <class _Ti, class... _Uj, size_t... _Indx>
85inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<_Ti&, _Uj...>
86__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) {
87 return __ti(std::forward<_Uj>(std::get<_Indx>(__uj))...);
88}
89
90template <class _Ti, class... _Uj, __enable_if_t<is_bind_expression<_Ti>::value, int> = 0>84template <class _Ti, class... _Uj, __enable_if_t<is_bind_expression<_Ti>::value, int> = 0>
91inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<_Ti&, _Uj...>85inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<_Ti&, _Uj...>
92__mu(_Ti& __ti, tuple<_Uj...>& __uj) {86__mu(_Ti& __ti, tuple<_Uj...>& __uj) {
93 typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;87 return [&]<size_t... _Indices>(__index_sequence<_Indices...>) -> __invoke_result_t<_Ti&, _Uj...> {
94 return std::__mu_expand(__ti, __uj, __indices());88 return __ti(std::forward<_Uj>(std::get<_Indices>(__uj))...);
89 }(__index_sequence_for<_Uj...>{});
95}90}
9691
97template <bool _IsPh, class _Ti, class _Uj>92template <bool _IsPh, class _Ti, class _Uj>
...@@ -191,7 +186,7 @@ struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true> {...@@ -191,7 +186,7 @@ struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true> {
191186
192template <class _Fp, class _BoundArgs, size_t... _Indx, class _Args>187template <class _Fp, class _BoundArgs, size_t... _Indx, class _Args>
193inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fp, _BoundArgs, _Args>::type188inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fp, _BoundArgs, _Args>::type
194__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, _Args&& __args) {189__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __index_sequence<_Indx...>, _Args&& __args) {
195 return std::__invoke(__f, std::__mu(std::get<_Indx>(__bound_args), __args)...);190 return std::__invoke(__f, std::__mu(std::get<_Indx>(__bound_args), __args)...);
196}191}
197192
...@@ -205,8 +200,6 @@ private:...@@ -205,8 +200,6 @@ private:
205 _Fd __f_;200 _Fd __f_;
206 _Td __bound_args_;201 _Td __bound_args_;
207202
208 typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
209
210public:203public:
211 template <204 template <
212 class _Gp,205 class _Gp,
...@@ -219,14 +212,16 @@ public:...@@ -219,14 +212,16 @@ public:
219 template <class... _Args>212 template <class... _Args>
220 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type213 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
221 operator()(_Args&&... __args) {214 operator()(_Args&&... __args) {
222 return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...));215 return std::__apply_functor(
216 __f_, __bound_args_, __index_sequence_for<_BoundArgs...>(), tuple<_Args&&...>(std::forward<_Args>(__args)...));
223 }217 }
224218
225 template <class... _Args>219 template <class... _Args>
226 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20220 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
227 typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type221 typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
228 operator()(_Args&&... __args) const {222 operator()(_Args&&... __args) const {
229 return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...));223 return std::__apply_functor(
224 __f_, __bound_args_, __index_sequence_for<_BoundArgs...>(), tuple<_Args&&...>(std::forward<_Args>(__args)...));
230 }225 }
231};226};
232227
...@@ -273,14 +268,14 @@ template <class _Rp, class _Fp, class... _BoundArgs>...@@ -273,14 +268,14 @@ template <class _Rp, class _Fp, class... _BoundArgs>
273struct is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};268struct is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
274269
275template <class _Fp, class... _BoundArgs>270template <class _Fp, class... _BoundArgs>
276inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind<_Fp, _BoundArgs...>271[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind<_Fp, _BoundArgs...>
277bind(_Fp&& __f, _BoundArgs&&... __bound_args) {272bind(_Fp&& __f, _BoundArgs&&... __bound_args) {
278 typedef __bind<_Fp, _BoundArgs...> type;273 typedef __bind<_Fp, _BoundArgs...> type;
279 return type(std::forward<_Fp>(__f), std::forward<_BoundArgs>(__bound_args)...);274 return type(std::forward<_Fp>(__f), std::forward<_BoundArgs>(__bound_args)...);
280}275}
281276
282template <class _Rp, class _Fp, class... _BoundArgs>277template <class _Rp, class _Fp, class... _BoundArgs>
283inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind_r<_Rp, _Fp, _BoundArgs...>278[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind_r<_Rp, _Fp, _BoundArgs...>
284bind(_Fp&& __f, _BoundArgs&&... __bound_args) {279bind(_Fp&& __f, _BoundArgs&&... __bound_args) {
285 typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;280 typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
286 return type(std::forward<_Fp>(__f), std::forward<_BoundArgs>(__bound_args)...);281 return type(std::forward<_Fp>(__f), std::forward<_BoundArgs>(__bound_args)...);
lib/libcxx/include/__functional/bind_back.h+1-1
...@@ -64,7 +64,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __bind_back(_Fn&& __f, _Args&&... __args) n...@@ -64,7 +64,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __bind_back(_Fn&& __f, _Args&&... __args) n
6464
65# if _LIBCPP_STD_VER >= 2365# if _LIBCPP_STD_VER >= 23
66template <class _Fn, class... _Args>66template <class _Fn, class... _Args>
67_LIBCPP_HIDE_FROM_ABI constexpr auto bind_back(_Fn&& __f, _Args&&... __args) {67[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto bind_back(_Fn&& __f, _Args&&... __args) {
68 static_assert(is_constructible_v<decay_t<_Fn>, _Fn>, "bind_back requires decay_t<F> to be constructible from F");68 static_assert(is_constructible_v<decay_t<_Fn>, _Fn>, "bind_back requires decay_t<F> to be constructible from F");
69 static_assert(is_move_constructible_v<decay_t<_Fn>>, "bind_back requires decay_t<F> to be move constructible");69 static_assert(is_move_constructible_v<decay_t<_Fn>>, "bind_back requires decay_t<F> to be move constructible");
70 static_assert((is_constructible_v<decay_t<_Args>, _Args> && ...),70 static_assert((is_constructible_v<decay_t<_Args>, _Args> && ...),
lib/libcxx/include/__functional/bind_front.h+1-1
...@@ -43,7 +43,7 @@ struct __bind_front_t : __perfect_forward<__bind_front_op, _Fn, _BoundArgs...> {...@@ -43,7 +43,7 @@ struct __bind_front_t : __perfect_forward<__bind_front_op, _Fn, _BoundArgs...> {
43template <class _Fn, class... _Args>43template <class _Fn, class... _Args>
44 requires is_constructible_v<decay_t<_Fn>, _Fn> && is_move_constructible_v<decay_t<_Fn>> &&44 requires is_constructible_v<decay_t<_Fn>, _Fn> && is_move_constructible_v<decay_t<_Fn>> &&
45 (is_constructible_v<decay_t<_Args>, _Args> && ...) && (is_move_constructible_v<decay_t<_Args>> && ...)45 (is_constructible_v<decay_t<_Args>, _Args> && ...) && (is_move_constructible_v<decay_t<_Args>> && ...)
46_LIBCPP_HIDE_FROM_ABI constexpr auto bind_front(_Fn&& __f, _Args&&... __args) {46[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto bind_front(_Fn&& __f, _Args&&... __args) {
47 return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);47 return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
48}48}
4949
lib/libcxx/include/__functional/function.h+57-75
...@@ -15,16 +15,14 @@...@@ -15,16 +15,14 @@
15#include <__cstddef/nullptr_t.h>15#include <__cstddef/nullptr_t.h>
16#include <__exception/exception.h>16#include <__exception/exception.h>
17#include <__functional/binary_function.h>17#include <__functional/binary_function.h>
18#include <__functional/invoke.h>
19#include <__functional/unary_function.h>18#include <__functional/unary_function.h>
20#include <__memory/addressof.h>19#include <__memory/addressof.h>
21#include <__type_traits/aligned_storage.h>20#include <__type_traits/aligned_storage.h>
22#include <__type_traits/decay.h>21#include <__type_traits/decay.h>
23#include <__type_traits/is_core_convertible.h>22#include <__type_traits/invoke.h>
24#include <__type_traits/is_scalar.h>23#include <__type_traits/is_scalar.h>
25#include <__type_traits/is_trivially_constructible.h>24#include <__type_traits/is_trivially_constructible.h>
26#include <__type_traits/is_trivially_destructible.h>25#include <__type_traits/is_trivially_destructible.h>
27#include <__type_traits/is_void.h>
28#include <__type_traits/strip_signature.h>26#include <__type_traits/strip_signature.h>
29#include <__utility/forward.h>27#include <__utility/forward.h>
30#include <__utility/move.h>28#include <__utility/move.h>
...@@ -95,29 +93,29 @@ template <class _Rp, class _A1, class _A2>...@@ -95,29 +93,29 @@ template <class _Rp, class _A1, class _A2>
95struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> : public __binary_function<_A1, _A2, _Rp> {};93struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> : public __binary_function<_A1, _A2, _Rp> {};
9694
97template <class _Fp>95template <class _Fp>
98_LIBCPP_HIDE_FROM_ABI bool __not_null(_Fp const&) {96_LIBCPP_HIDE_FROM_ABI bool __is_null(_Fp const&) {
99 return true;97 return false;
100}98}
10199
102template <class _Fp>100template <class _Fp>
103_LIBCPP_HIDE_FROM_ABI bool __not_null(_Fp* __ptr) {101_LIBCPP_HIDE_FROM_ABI bool __is_null(_Fp* __ptr) {
104 return __ptr;102 return !__ptr;
105}103}
106104
107template <class _Ret, class _Class>105template <class _Ret, class _Class>
108_LIBCPP_HIDE_FROM_ABI bool __not_null(_Ret _Class::*__ptr) {106_LIBCPP_HIDE_FROM_ABI bool __is_null(_Ret _Class::* __ptr) {
109 return __ptr;107 return !__ptr;
110}108}
111109
112template <class _Fp>110template <class _Fp>
113_LIBCPP_HIDE_FROM_ABI bool __not_null(function<_Fp> const& __f) {111_LIBCPP_HIDE_FROM_ABI bool __is_null(function<_Fp> const& __f) {
114 return !!__f;112 return !__f;
115}113}
116114
117# if __has_extension(blocks)115# if __has_extension(blocks)
118template <class _Rp, class... _Args>116template <class _Rp, class... _Args>
119_LIBCPP_HIDE_FROM_ABI bool __not_null(_Rp (^__p)(_Args...)) {117_LIBCPP_HIDE_FROM_ABI bool __is_null(_Rp (^__p)(_Args...)) {
120 return __p;118 return !__p;
121}119}
122# endif120# endif
123121
...@@ -206,12 +204,13 @@ public:...@@ -206,12 +204,13 @@ public:
206 _LIBCPP_HIDE_FROM_ABI explicit __value_func(_Fp&& __f) : __f_(nullptr) {204 _LIBCPP_HIDE_FROM_ABI explicit __value_func(_Fp&& __f) : __f_(nullptr) {
207 typedef __function::__func<_Fp, _Rp(_ArgTypes...)> _Fun;205 typedef __function::__func<_Fp, _Rp(_ArgTypes...)> _Fun;
208206
209 if (__function::__not_null(__f)) {207 if (__function::__is_null(__f))
210 if (sizeof(_Fun) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value) {208 return;
211 __f_ = ::new (std::addressof(__buf_)) _Fun(std::move(__f));209
212 } else {210 if (sizeof(_Fun) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value) {
213 __f_ = new _Fun(std::move(__f));211 __f_ = ::new (std::addressof(__buf_)) _Fun(std::move(__f));
214 }212 } else {
213 __f_ = new _Fun(std::move(__f));
215 }214 }
216 }215 }
217216
...@@ -356,7 +355,31 @@ struct __policy {...@@ -356,7 +355,31 @@ struct __policy {
356 // type.355 // type.
357 template <typename _Fun>356 template <typename _Fun>
358 _LIBCPP_HIDE_FROM_ABI static const __policy* __create() {357 _LIBCPP_HIDE_FROM_ABI static const __policy* __create() {
359 return __choose_policy<_Fun>(__use_small_storage<_Fun>());358 if constexpr (__use_small_storage<_Fun>::value) {
359 static constexpr __policy __policy = {
360 nullptr,
361 nullptr,
362 false,
363# if _LIBCPP_HAS_RTTI
364 &typeid(_Fun)
365# else
366 nullptr
367# endif
368 };
369 return &__policy;
370 } else {
371 static constexpr __policy __policy = {
372 std::addressof(__large_clone<_Fun>),
373 std::addressof(__large_destroy<_Fun>),
374 false,
375# if _LIBCPP_HAS_RTTI
376 &typeid(_Fun)
377# else
378 nullptr
379# endif
380 };
381 return &__policy;
382 }
360 }383 }
361384
362 _LIBCPP_HIDE_FROM_ABI static const __policy* __create_empty() {385 _LIBCPP_HIDE_FROM_ABI static const __policy* __create_empty() {
...@@ -384,36 +407,6 @@ private:...@@ -384,36 +407,6 @@ private:
384 _LIBCPP_HIDE_FROM_ABI static void __large_destroy(void* __s) {407 _LIBCPP_HIDE_FROM_ABI static void __large_destroy(void* __s) {
385 delete static_cast<_Fun*>(__s);408 delete static_cast<_Fun*>(__s);
386 }409 }
387
388 template <typename _Fun>
389 _LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ false_type) {
390 static constexpr __policy __policy = {
391 std::addressof(__large_clone<_Fun>),
392 std::addressof(__large_destroy<_Fun>),
393 false,
394# if _LIBCPP_HAS_RTTI
395 &typeid(_Fun)
396# else
397 nullptr
398# endif
399 };
400 return &__policy;
401 }
402
403 template <typename _Fun>
404 _LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ true_type) {
405 static constexpr __policy __policy = {
406 nullptr,
407 nullptr,
408 false,
409# if _LIBCPP_HAS_RTTI
410 &typeid(_Fun)
411# else
412 nullptr
413# endif
414 };
415 return &__policy;
416 }
417};410};
418411
419// Used to choose between perfect forwarding or pass-by-value. Pass-by-value is412// Used to choose between perfect forwarding or pass-by-value. Pass-by-value is
...@@ -455,14 +448,15 @@ public:...@@ -455,14 +448,15 @@ public:
455448
456 template <class _Fp, __enable_if_t<!is_same<__decay_t<_Fp>, __policy_func>::value, int> = 0>449 template <class _Fp, __enable_if_t<!is_same<__decay_t<_Fp>, __policy_func>::value, int> = 0>
457 _LIBCPP_HIDE_FROM_ABI explicit __policy_func(_Fp&& __f) : __policy_(__policy::__create_empty()) {450 _LIBCPP_HIDE_FROM_ABI explicit __policy_func(_Fp&& __f) : __policy_(__policy::__create_empty()) {
458 if (__function::__not_null(__f)) {451 if (__function::__is_null(__f))
459 __func_ = __call_func<_Fp>;452 return;
460 __policy_ = __policy::__create<_Fp>();453
461 if (__use_small_storage<_Fp>()) {454 __func_ = __call_func<_Fp>;
462 ::new ((void*)&__buf_.__small) _Fp(std::move(__f));455 __policy_ = __policy::__create<_Fp>();
463 } else {456 if (__use_small_storage<_Fp>()) {
464 __buf_.__large = ::new _Fp(std::move(__f));457 ::new ((void*)&__buf_.__small) _Fp(std::move(__f));
465 }458 } else {
459 __buf_.__large = ::new _Fp(std::move(__f));
466 }460 }
467 }461 }
468462
...@@ -615,21 +609,9 @@ class function<_Rp(_ArgTypes...)>...@@ -615,21 +609,9 @@ class function<_Rp(_ArgTypes...)>
615609
616 __func __f_;610 __func __f_;
617611
618 template <class _Fp,
619 bool = _And<_IsNotSame<__remove_cvref_t<_Fp>, function>, __is_invocable<_Fp, _ArgTypes...> >::value>
620 struct __callable;
621 template <class _Fp>
622 struct __callable<_Fp, true> {
623 static const bool value =
624 is_void<_Rp>::value || __is_core_convertible<__invoke_result_t<_Fp, _ArgTypes...>, _Rp>::value;
625 };
626 template <class _Fp>
627 struct __callable<_Fp, false> {
628 static const bool value = false;
629 };
630
631 template <class _Fp>612 template <class _Fp>
632 using _EnableIfLValueCallable _LIBCPP_NODEBUG = __enable_if_t<__callable<_Fp&>::value>;613 using _EnableIfLValueCallable _LIBCPP_NODEBUG = __enable_if_t<
614 _And<_IsNotSame<__remove_cvref_t<_Fp>, function>, __is_invocable_r<_Rp, _Fp&, _ArgTypes...>>::value>;
633615
634public:616public:
635 typedef _Rp result_type;617 typedef _Rp result_type;
...@@ -690,11 +672,11 @@ public:...@@ -690,11 +672,11 @@ public:
690672
691# if _LIBCPP_HAS_RTTI673# if _LIBCPP_HAS_RTTI
692 // function target access:674 // function target access:
693 _LIBCPP_HIDE_FROM_ABI const std::type_info& target_type() const _NOEXCEPT;675 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const std::type_info& target_type() const _NOEXCEPT;
694 template <typename _Tp>676 template <typename _Tp>
695 _LIBCPP_HIDE_FROM_ABI _Tp* target() _NOEXCEPT;677 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Tp* target() _NOEXCEPT;
696 template <typename _Tp>678 template <typename _Tp>
697 _LIBCPP_HIDE_FROM_ABI const _Tp* target() const _NOEXCEPT;679 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Tp* target() const _NOEXCEPT;
698# endif // _LIBCPP_HAS_RTTI680# endif // _LIBCPP_HAS_RTTI
699};681};
700682
lib/libcxx/include/__functional/hash.h+1-10
...@@ -433,13 +433,10 @@ struct __hash_impl<long double> : __scalar_hash<long double> {...@@ -433,13 +433,10 @@ struct __hash_impl<long double> : __scalar_hash<long double> {
433template <class _Tp>433template <class _Tp>
434struct hash : public __hash_impl<_Tp> {};434struct hash : public __hash_impl<_Tp> {};
435435
436#if _LIBCPP_STD_VER >= 17
437
438template <>436template <>
439struct hash<nullptr_t> : public __unary_function<nullptr_t, size_t> {437struct hash<nullptr_t> : public __unary_function<nullptr_t, size_t> {
440 _LIBCPP_HIDE_FROM_ABI size_t operator()(nullptr_t) const _NOEXCEPT { return 662607004ull; }438 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t operator()(nullptr_t) const _NOEXCEPT { return 662607004ull; }
441};439};
442#endif
443440
444#ifndef _LIBCPP_CXX03_LANG441#ifndef _LIBCPP_CXX03_LANG
445template <class _Key, class _Hash>442template <class _Key, class _Hash>
...@@ -452,18 +449,12 @@ template <class _Key, class _Hash = hash<_Key> >...@@ -452,18 +449,12 @@ template <class _Key, class _Hash = hash<_Key> >
452using __has_enabled_hash _LIBCPP_NODEBUG =449using __has_enabled_hash _LIBCPP_NODEBUG =
453 integral_constant<bool, __check_hash_requirements<_Key, _Hash>::value && is_default_constructible<_Hash>::value >;450 integral_constant<bool, __check_hash_requirements<_Key, _Hash>::value && is_default_constructible<_Hash>::value >;
454451
455# if _LIBCPP_STD_VER >= 17
456template <class _Type, class>452template <class _Type, class>
457using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type;453using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type;
458454
459template <class _Type, class... _Keys>455template <class _Type, class... _Keys>
460using __enable_hash_helper _LIBCPP_NODEBUG =456using __enable_hash_helper _LIBCPP_NODEBUG =
461 __enable_hash_helper_imp<_Type, __enable_if_t<__all<__has_enabled_hash<_Keys>::value...>::value> >;457 __enable_hash_helper_imp<_Type, __enable_if_t<__all<__has_enabled_hash<_Keys>::value...>::value> >;
462# else
463template <class _Type, class...>
464using __enable_hash_helper _LIBCPP_NODEBUG = _Type;
465# endif
466
467#endif // !_LIBCPP_CXX03_LANG458#endif // !_LIBCPP_CXX03_LANG
468459
469_LIBCPP_END_NAMESPACE_STD460_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__functional/identity.h+1-1
...@@ -44,7 +44,7 @@ struct __is_identity<reference_wrapper<const __identity> > : true_type {};...@@ -44,7 +44,7 @@ struct __is_identity<reference_wrapper<const __identity> > : true_type {};
4444
45struct identity {45struct identity {
46 template <class _Tp>46 template <class _Tp>
47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_Tp&& __t) const noexcept {47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_LIBCPP_LIFETIMEBOUND _Tp&& __t) const noexcept {
48 return std::forward<_Tp>(__t);48 return std::forward<_Tp>(__t);
49 }49 }
5050
lib/libcxx/include/__functional/is_transparent.h+8
...@@ -29,6 +29,14 @@ inline const bool __is_transparent_v<_Tp, _Key, __void_t<typename _Tp::is_transp...@@ -29,6 +29,14 @@ inline const bool __is_transparent_v<_Tp, _Key, __void_t<typename _Tp::is_transp
2929
30#endif30#endif
3131
32// Two types are considered transparently comparable if `comparator(key, arg)` is equivalent to `comparator(key,
33// <implicit cast to KeyT>(arg))`.
34//
35// This is different from `__is_transparent_v`, which is only a property of the comparator and doesn't provide
36// additional semantic guarantees.
37template <class _Comparator, class _KeyT, class _Arg, class = void>
38inline const bool __is_transparently_comparable_v = false;
39
32_LIBCPP_END_NAMESPACE_STD40_LIBCPP_END_NAMESPACE_STD
3341
34#endif // _LIBCPP___FUNCTIONAL_IS_TRANSPARENT42#endif // _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
lib/libcxx/include/__functional/mem_fn.h+2-1
...@@ -43,7 +43,8 @@ public:...@@ -43,7 +43,8 @@ public:
43};43};
4444
45template <class _Rp, class _Tp>45template <class _Rp, class _Tp>
46inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __mem_fn<_Rp _Tp::*> mem_fn(_Rp _Tp::*__pm) _NOEXCEPT {46[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __mem_fn<_Rp _Tp::*>
47mem_fn(_Rp _Tp::* __pm) _NOEXCEPT {
47 return __mem_fn<_Rp _Tp::*>(__pm);48 return __mem_fn<_Rp _Tp::*>(__pm);
48}49}
4950
lib/libcxx/include/__functional/operations.h+18
...@@ -15,7 +15,9 @@...@@ -15,7 +15,9 @@
15#include <__functional/unary_function.h>15#include <__functional/unary_function.h>
16#include <__fwd/functional.h>16#include <__fwd/functional.h>
17#include <__type_traits/desugars_to.h>17#include <__type_traits/desugars_to.h>
18#include <__type_traits/is_generic_transparent_comparator.h>
18#include <__type_traits/is_integral.h>19#include <__type_traits/is_integral.h>
20#include <__type_traits/make_transparent.h>
19#include <__utility/forward.h>21#include <__utility/forward.h>
2022
21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -377,6 +379,14 @@ struct less<void> {...@@ -377,6 +379,14 @@ struct less<void> {
377 typedef void is_transparent;379 typedef void is_transparent;
378};380};
379381
382template <class _Tp>
383struct __make_transparent<_Tp, less<_Tp> > {
384 using type _LIBCPP_NODEBUG = less<>;
385};
386
387template <>
388inline const bool __is_generic_transparent_comparator_v<less<>> = true;
389
380template <class _Tp, class _Up>390template <class _Tp, class _Up>
381inline const bool __desugars_to_v<__less_tag, less<>, _Tp, _Up> = true;391inline const bool __desugars_to_v<__less_tag, less<>, _Tp, _Up> = true;
382392
...@@ -466,6 +476,14 @@ struct greater<void> {...@@ -466,6 +476,14 @@ struct greater<void> {
466476
467template <class _Tp, class _Up>477template <class _Tp, class _Up>
468inline const bool __desugars_to_v<__greater_tag, greater<>, _Tp, _Up> = true;478inline const bool __desugars_to_v<__greater_tag, greater<>, _Tp, _Up> = true;
479
480template <class _Tp>
481struct __make_transparent<_Tp, greater<_Tp>> {
482 using type _LIBCPP_NODEBUG = greater<>;
483};
484
485template <>
486inline const bool __is_generic_transparent_comparator_v<greater<>> = true;
469#endif487#endif
470488
471// Logical operations489// Logical operations
lib/libcxx/include/__functional/ranges_operations.h+7
...@@ -14,6 +14,7 @@...@@ -14,6 +14,7 @@
14#include <__concepts/totally_ordered.h>14#include <__concepts/totally_ordered.h>
15#include <__config>15#include <__config>
16#include <__type_traits/desugars_to.h>16#include <__type_traits/desugars_to.h>
17#include <__type_traits/is_generic_transparent_comparator.h>
17#include <__utility/forward.h>18#include <__utility/forward.h>
1819
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -108,6 +109,12 @@ inline const bool __desugars_to_v<__less_tag, ranges::less, _Tp, _Up> = true;...@@ -108,6 +109,12 @@ inline const bool __desugars_to_v<__less_tag, ranges::less, _Tp, _Up> = true;
108template <class _Tp, class _Up>109template <class _Tp, class _Up>
109inline const bool __desugars_to_v<__greater_tag, ranges::greater, _Tp, _Up> = true;110inline const bool __desugars_to_v<__greater_tag, ranges::greater, _Tp, _Up> = true;
110111
112template <>
113inline const bool __is_generic_transparent_comparator_v<ranges::less> = true;
114
115template <>
116inline const bool __is_generic_transparent_comparator_v<ranges::greater> = true;
117
111#endif // _LIBCPP_STD_VER >= 20118#endif // _LIBCPP_STD_VER >= 20
112119
113_LIBCPP_END_NAMESPACE_STD120_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__functional/reference_wrapper.h+7-5
...@@ -58,7 +58,7 @@ public:...@@ -58,7 +58,7 @@ public:
5858
59 // access59 // access
60 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator type&() const _NOEXCEPT { return *__f_; }60 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator type&() const _NOEXCEPT { return *__f_; }
61 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 type& get() const _NOEXCEPT { return *__f_; }61 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 type& get() const _NOEXCEPT { return *__f_; }
6262
63 // invoke63 // invoke
64 template <class... _ArgTypes>64 template <class... _ArgTypes>
...@@ -128,23 +128,25 @@ reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;...@@ -128,23 +128,25 @@ reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
128#endif128#endif
129129
130template <class _Tp>130template <class _Tp>
131inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<_Tp> ref(_Tp& __t) _NOEXCEPT {131[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
132_LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<_Tp> ref(_Tp& __t) _NOEXCEPT {
132 return reference_wrapper<_Tp>(__t);133 return reference_wrapper<_Tp>(__t);
133}134}
134135
135template <class _Tp>136template <class _Tp>
136inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<_Tp>137[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<_Tp>
137ref(reference_wrapper<_Tp> __t) _NOEXCEPT {138ref(reference_wrapper<_Tp> __t) _NOEXCEPT {
138 return __t;139 return __t;
139}140}
140141
141template <class _Tp>142template <class _Tp>
142inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<const _Tp> cref(const _Tp& __t) _NOEXCEPT {143[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<const _Tp>
144cref(const _Tp& __t) _NOEXCEPT {
143 return reference_wrapper<const _Tp>(__t);145 return reference_wrapper<const _Tp>(__t);
144}146}
145147
146template <class _Tp>148template <class _Tp>
147inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<const _Tp>149[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<const _Tp>
148cref(reference_wrapper<_Tp> __t) _NOEXCEPT {150cref(reference_wrapper<_Tp> __t) _NOEXCEPT {
149 return __t;151 return __t;
150}152}
lib/libcxx/include/__functional/weak_result_type.h+14-28
...@@ -13,9 +13,9 @@...@@ -13,9 +13,9 @@
13#include <__config>13#include <__config>
14#include <__functional/binary_function.h>14#include <__functional/binary_function.h>
15#include <__functional/unary_function.h>15#include <__functional/unary_function.h>
16#include <__type_traits/integral_constant.h>
17#include <__type_traits/invoke.h>16#include <__type_traits/invoke.h>
18#include <__type_traits/is_same.h>17#include <__type_traits/is_same.h>
18#include <__type_traits/void_t.h>
19#include <__utility/declval.h>19#include <__utility/declval.h>
2020
21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -24,50 +24,36 @@...@@ -24,50 +24,36 @@
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2626
27template <class _Tp>27template <class _Tp, class = void>
28struct __has_result_type {28inline const bool __has_result_type_v = false;
29private:
30 template <class _Up>
31 static false_type __test(...);
32 template <class _Up>
33 static true_type __test(typename _Up::result_type* = 0);
3429
35public:30template <class _Tp>
36 static const bool value = decltype(__test<_Tp>(0))::value;31inline const bool __has_result_type_v<_Tp, __void_t<typename _Tp::result_type*> > = true;
37};
3832
39// __weak_result_type33// __weak_result_type
4034
41template <class _Tp>35template <class _Tp>
42struct __derives_from_unary_function {36struct __derives_from_unary_function {
43private:37private:
44 struct __two {38 static void __find_base(...);
45 char __lx;
46 char __lxx;
47 };
48 static __two __test(...);
49 template <class _Ap, class _Rp>39 template <class _Ap, class _Rp>
50 static __unary_function<_Ap, _Rp> __test(const volatile __unary_function<_Ap, _Rp>*);40 static __unary_function<_Ap, _Rp> __find_base(const volatile __unary_function<_Ap, _Rp>*);
5141
52public:42public:
53 static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;43 using type = decltype(__find_base(static_cast<_Tp*>(nullptr)));
54 typedef decltype(__test((_Tp*)0)) type;44 static const bool value = !is_same<type, void>::value;
55};45};
5646
57template <class _Tp>47template <class _Tp>
58struct __derives_from_binary_function {48struct __derives_from_binary_function {
59private:49private:
60 struct __two {50 static void __find_base(...);
61 char __lx;
62 char __lxx;
63 };
64 static __two __test(...);
65 template <class _A1, class _A2, class _Rp>51 template <class _A1, class _A2, class _Rp>
66 static __binary_function<_A1, _A2, _Rp> __test(const volatile __binary_function<_A1, _A2, _Rp>*);52 static __binary_function<_A1, _A2, _Rp> __find_base(const volatile __binary_function<_A1, _A2, _Rp>*);
6753
68public:54public:
69 static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;55 using type = decltype(__find_base(static_cast<_Tp*>(nullptr)));
70 typedef decltype(__test((_Tp*)0)) type;56 static const bool value = !is_same<type, void>::value;
71};57};
7258
73template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>59template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>
...@@ -85,7 +71,7 @@ struct __maybe_derive_from_binary_function // bool is true...@@ -85,7 +71,7 @@ struct __maybe_derive_from_binary_function // bool is true
85template <class _Tp>71template <class _Tp>
86struct __maybe_derive_from_binary_function<_Tp, false> {};72struct __maybe_derive_from_binary_function<_Tp, false> {};
8773
88template <class _Tp, bool = __has_result_type<_Tp>::value>74template <class _Tp, bool = __has_result_type_v<_Tp> >
89struct __weak_result_type_imp // bool is true75struct __weak_result_type_imp // bool is true
90 : public __maybe_derive_from_unary_function<_Tp>,76 : public __maybe_derive_from_unary_function<_Tp>,
91 public __maybe_derive_from_binary_function<_Tp> {77 public __maybe_derive_from_binary_function<_Tp> {
lib/libcxx/include/__fwd/ios.h+1-1
...@@ -31,7 +31,7 @@ using wios = basic_ios<wchar_t>;...@@ -31,7 +31,7 @@ using wios = basic_ios<wchar_t>;
31template <class _CharT, class _Traits>31template <class _CharT, class _Traits>
32class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios;32class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios;
3333
34#if defined(_NEWLIB_VERSION)34#if _LIBCPP_LIBC_NEWLIB
35// On newlib, off_t is 'long int'35// On newlib, off_t is 'long int'
36using streamoff = long int; // for char_traits in <string>36using streamoff = long int; // for char_traits in <string>
37#else37#else
lib/libcxx/include/__fwd/tuple.h+14
...@@ -21,11 +21,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -21,11 +21,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD
21template <size_t, class>21template <size_t, class>
22struct tuple_element;22struct tuple_element;
2323
24template <size_t _Np, class _Tp>
25using __tuple_element_t _LIBCPP_NODEBUG = typename tuple_element<_Np, _Tp>::type;
26
24#ifndef _LIBCPP_CXX03_LANG27#ifndef _LIBCPP_CXX03_LANG
2528
26template <class...>29template <class...>
27class tuple;30class tuple;
2831
32template <class>
33inline const bool __is_tuple_v = false;
34
35template <class... _Tp>
36inline const bool __is_tuple_v<tuple<_Tp...>> = true;
37
38template <size_t _Ip, class... _Tp>
39struct tuple_element<_Ip, tuple<_Tp...> > {
40 using type _LIBCPP_NODEBUG = __type_pack_element<_Ip, _Tp...>;
41};
42
29template <class>43template <class>
30struct tuple_size;44struct tuple_size;
3145
lib/libcxx/include/__hash_table+371-357
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#ifndef _LIBCPP___HASH_TABLE10#ifndef _LIBCPP___HASH_TABLE
11#define _LIBCPP___HASH_TABLE11#define _LIBCPP___HASH_TABLE
1212
13#include <__algorithm/fill_n.h>
13#include <__algorithm/max.h>14#include <__algorithm/max.h>
14#include <__algorithm/min.h>15#include <__algorithm/min.h>
15#include <__assert>16#include <__assert>
...@@ -28,7 +29,6 @@...@@ -28,7 +29,6 @@
28#include <__memory/swap_allocator.h>29#include <__memory/swap_allocator.h>
29#include <__memory/unique_ptr.h>30#include <__memory/unique_ptr.h>
30#include <__new/launder.h>31#include <__new/launder.h>
31#include <__type_traits/can_extract_key.h>
32#include <__type_traits/copy_cvref.h>32#include <__type_traits/copy_cvref.h>
33#include <__type_traits/enable_if.h>33#include <__type_traits/enable_if.h>
34#include <__type_traits/invoke.h>34#include <__type_traits/invoke.h>
...@@ -44,7 +44,9 @@...@@ -44,7 +44,9 @@
44#include <__utility/forward.h>44#include <__utility/forward.h>
45#include <__utility/move.h>45#include <__utility/move.h>
46#include <__utility/pair.h>46#include <__utility/pair.h>
47#include <__utility/scope_guard.h>
47#include <__utility/swap.h>48#include <__utility/swap.h>
49#include <__utility/try_key_extraction.h>
48#include <limits>50#include <limits>
4951
50#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)52#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -81,18 +83,6 @@ struct __hash_node_base {...@@ -81,18 +83,6 @@ struct __hash_node_base {
81 typedef _NodePtr __node_pointer;83 typedef _NodePtr __node_pointer;
82 typedef __node_base_pointer __next_pointer;84 typedef __node_base_pointer __next_pointer;
8385
84// TODO(LLVM 22): Remove this check
85#ifndef _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
86 static_assert(sizeof(__node_base_pointer) == sizeof(__node_pointer) && _LIBCPP_ALIGNOF(__node_base_pointer) ==
87 _LIBCPP_ALIGNOF(__node_pointer),
88 "It looks like you are using std::__hash_table (an implementation detail for the unordered containers) "
89 "with a fancy pointer type that thas a different representation depending on whether it points to a "
90 "__hash_table base pointer or a __hash_table node pointer (both of which are implementation details of "
91 "the standard library). This means that your ABI is being broken between LLVM 19 and LLVM 20. If you "
92 "don't care about your ABI being broken, define the _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB macro to "
93 "silence this diagnostic.");
94#endif
95
96 __next_pointer __next_;86 __next_pointer __next_;
9787
98 _LIBCPP_HIDE_FROM_ABI __next_pointer __ptr() _NOEXCEPT {88 _LIBCPP_HIDE_FROM_ABI __next_pointer __ptr() _NOEXCEPT {
...@@ -122,6 +112,19 @@ struct __get_hash_node_value_type<__hash_value_type<_Key, _Tp> > {...@@ -122,6 +112,19 @@ struct __get_hash_node_value_type<__hash_value_type<_Key, _Tp> > {
122template <class _Tp>112template <class _Tp>
123using __get_hash_node_value_type_t _LIBCPP_NODEBUG = typename __get_hash_node_value_type<_Tp>::type;113using __get_hash_node_value_type_t _LIBCPP_NODEBUG = typename __get_hash_node_value_type<_Tp>::type;
124114
115template <class _Tp>
116struct __get_hash_node_key_type {
117 using type _LIBCPP_NODEBUG = _Tp;
118};
119
120template <class _Key, class _Tp>
121struct __get_hash_node_key_type<__hash_value_type<_Key, _Tp> > {
122 using type _LIBCPP_NODEBUG = _Key;
123};
124
125template <class _Tp>
126using __get_hash_node_key_type_t _LIBCPP_NODEBUG = typename __get_hash_node_key_type<_Tp>::type;
127
125template <class _Tp, class _VoidPtr>128template <class _Tp, class _VoidPtr>
126struct __hash_node : public __hash_node_base< __rebind_pointer_t<_VoidPtr, __hash_node<_Tp, _VoidPtr> > > {129struct __hash_node : public __hash_node_base< __rebind_pointer_t<_VoidPtr, __hash_node<_Tp, _VoidPtr> > > {
127 using __node_value_type _LIBCPP_NODEBUG = __get_hash_node_value_type_t<_Tp>;130 using __node_value_type _LIBCPP_NODEBUG = __get_hash_node_value_type_t<_Tp>;
...@@ -152,7 +155,12 @@ public:...@@ -152,7 +155,12 @@ public:
152 }155 }
153#endif156#endif
154157
155 _LIBCPP_HIDE_FROM_ABI explicit __hash_node(__next_pointer __next, size_t __hash) : _Base(__next), __hash_(__hash) {}158 template <class _Alloc, class... _Args>
159 _LIBCPP_HIDE_FROM_ABI explicit __hash_node(size_t __hash, _Alloc& __na, _Args&&... __args)
160 : _Base(nullptr), __hash_(__hash) {
161 allocator_traits<_Alloc>::construct(__na, std::addressof(__get_value()), std::forward<_Args>(__args)...);
162 }
163
156 _LIBCPP_HIDE_FROM_ABI ~__hash_node() {}164 _LIBCPP_HIDE_FROM_ABI ~__hash_node() {}
157};165};
158166
...@@ -182,85 +190,16 @@ class __hash_map_iterator;...@@ -182,85 +190,16 @@ class __hash_map_iterator;
182template <class _HashIterator>190template <class _HashIterator>
183class __hash_map_const_iterator;191class __hash_map_const_iterator;
184192
185template <class _Tp>
186struct __hash_key_value_types {
187 static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, "");
188 typedef _Tp key_type;
189 typedef _Tp __node_value_type;
190 typedef _Tp __container_value_type;
191 static const bool __is_map = false;
192
193 _LIBCPP_HIDE_FROM_ABI static key_type const& __get_key(_Tp const& __v) { return __v; }
194 _LIBCPP_HIDE_FROM_ABI static __container_value_type const& __get_value(__node_value_type const& __v) { return __v; }
195 _LIBCPP_HIDE_FROM_ABI static __container_value_type* __get_ptr(__node_value_type& __n) { return std::addressof(__n); }
196 _LIBCPP_HIDE_FROM_ABI static __container_value_type&& __move(__node_value_type& __v) { return std::move(__v); }
197};
198
199template <class _Key, class _Tp>
200struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
201 typedef _Key key_type;
202 typedef _Tp mapped_type;
203 typedef __hash_value_type<_Key, _Tp> __node_value_type;
204 typedef pair<const _Key, _Tp> __container_value_type;
205 typedef __container_value_type __map_value_type;
206 static const bool __is_map = true;
207
208 _LIBCPP_HIDE_FROM_ABI static key_type const& __get_key(__container_value_type const& __v) { return __v.first; }
209
210 template <class _Up, __enable_if_t<is_same<__remove_cvref_t<_Up>, __node_value_type>::value, int> = 0>
211 _LIBCPP_HIDE_FROM_ABI static __container_value_type const& __get_value(_Up& __t) {
212 return __t.__get_value();
213 }
214
215 template <class _Up, __enable_if_t<is_same<__remove_cvref_t<_Up>, __container_value_type>::value, int> = 0>
216 _LIBCPP_HIDE_FROM_ABI static __container_value_type const& __get_value(_Up& __t) {
217 return __t;
218 }
219
220 _LIBCPP_HIDE_FROM_ABI static __container_value_type* __get_ptr(__container_value_type& __n) {
221 return std::addressof(__n);
222 }
223 _LIBCPP_HIDE_FROM_ABI static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) { return __v.__move(); }
224};
225
226template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>, bool = _KVTypes::__is_map>
227struct __hash_map_pointer_types {};
228
229template <class _Tp, class _AllocPtr, class _KVTypes>
230struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
231 typedef typename _KVTypes::__map_value_type _Mv;
232 typedef __rebind_pointer_t<_AllocPtr, _Mv> __map_value_type_pointer;
233 typedef __rebind_pointer_t<_AllocPtr, const _Mv> __const_map_value_type_pointer;
234};
235
236template <class _NodePtr, class _NodeT = typename pointer_traits<_NodePtr>::element_type>193template <class _NodePtr, class _NodeT = typename pointer_traits<_NodePtr>::element_type>
237struct __hash_node_types;194struct __hash_node_types;
238195
239template <class _NodePtr, class _Tp, class _VoidPtr>196template <class _NodePtr, class _Tp, class _VoidPtr>
240struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> >197struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> > {
241 : public __hash_key_value_types<_Tp>,
242 __hash_map_pointer_types<_Tp, _VoidPtr>
243
244{
245 typedef __hash_key_value_types<_Tp> __base;
246
247public:
248 typedef ptrdiff_t difference_type;
249 typedef size_t size_type;
250
251 typedef __rebind_pointer_t<_NodePtr, void> __void_pointer;
252
253 typedef typename pointer_traits<_NodePtr>::element_type __node_type;198 typedef typename pointer_traits<_NodePtr>::element_type __node_type;
254 typedef _NodePtr __node_pointer;
255199
256 typedef __hash_node_base<__node_pointer> __node_base_type;200 typedef typename __hash_node_base<_NodePtr>::__next_pointer __next_pointer;
257 typedef __rebind_pointer_t<_NodePtr, __node_base_type> __node_base_pointer;
258
259 typedef typename __node_base_type::__next_pointer __next_pointer;
260201
261 using __node_value_type _LIBCPP_NODEBUG = __get_hash_node_value_type_t<_Tp>;202 using __node_value_type _LIBCPP_NODEBUG = __get_hash_node_value_type_t<_Tp>;
262 typedef __rebind_pointer_t<_VoidPtr, __node_value_type> __node_value_type_pointer;
263 typedef __rebind_pointer_t<_VoidPtr, const __node_value_type> __const_node_value_type_pointer;
264203
265private:204private:
266 static_assert(!is_const<__node_type>::value, "_NodePtr should never be a pointer to const");205 static_assert(!is_const<__node_type>::value, "_NodePtr should never be a pointer to const");
...@@ -281,13 +220,6 @@ struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr> > : __has...@@ -281,13 +220,6 @@ struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr> > : __has
281template <class _NodePtr>220template <class _NodePtr>
282struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};221struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
283222
284template <class _NodeValueTp, class _VoidPtr>
285struct __make_hash_node_types {
286 typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp;
287 typedef __rebind_pointer_t<_VoidPtr, _NodeTp> _NodePtr;
288 typedef __hash_node_types<_NodePtr> type;
289};
290
291template <class _NodePtr>223template <class _NodePtr>
292class __hash_iterator {224class __hash_iterator {
293 typedef __hash_node_types<_NodePtr> _NodeTypes;225 typedef __hash_node_types<_NodePtr> _NodeTypes;
...@@ -299,9 +231,9 @@ class __hash_iterator {...@@ -299,9 +231,9 @@ class __hash_iterator {
299public:231public:
300 typedef forward_iterator_tag iterator_category;232 typedef forward_iterator_tag iterator_category;
301 typedef typename _NodeTypes::__node_value_type value_type;233 typedef typename _NodeTypes::__node_value_type value_type;
302 typedef typename _NodeTypes::difference_type difference_type;234 using difference_type = ptrdiff_t;
303 typedef value_type& reference;235 typedef value_type& reference;
304 typedef typename _NodeTypes::__node_value_type_pointer pointer;236 using pointer = __rebind_pointer_t<_NodePtr, value_type>;
305237
306 _LIBCPP_HIDE_FROM_ABI __hash_iterator() _NOEXCEPT : __node_(nullptr) {}238 _LIBCPP_HIDE_FROM_ABI __hash_iterator() _NOEXCEPT : __node_(nullptr) {}
307239
...@@ -366,9 +298,9 @@ public:...@@ -366,9 +298,9 @@ public:
366298
367 typedef forward_iterator_tag iterator_category;299 typedef forward_iterator_tag iterator_category;
368 typedef typename _NodeTypes::__node_value_type value_type;300 typedef typename _NodeTypes::__node_value_type value_type;
369 typedef typename _NodeTypes::difference_type difference_type;301 using difference_type = ptrdiff_t;
370 typedef const value_type& reference;302 typedef const value_type& reference;
371 typedef typename _NodeTypes::__const_node_value_type_pointer pointer;303 using pointer = __rebind_pointer_t<_NodePtr, const value_type>;
372304
373 _LIBCPP_HIDE_FROM_ABI __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {}305 _LIBCPP_HIDE_FROM_ABI __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {}
374306
...@@ -431,9 +363,9 @@ class __hash_local_iterator {...@@ -431,9 +363,9 @@ class __hash_local_iterator {
431public:363public:
432 typedef forward_iterator_tag iterator_category;364 typedef forward_iterator_tag iterator_category;
433 typedef typename _NodeTypes::__node_value_type value_type;365 typedef typename _NodeTypes::__node_value_type value_type;
434 typedef typename _NodeTypes::difference_type difference_type;366 using difference_type = ptrdiff_t;
435 typedef value_type& reference;367 typedef value_type& reference;
436 typedef typename _NodeTypes::__node_value_type_pointer pointer;368 using pointer = __rebind_pointer_t<_NodePtr, value_type>;
437369
438 _LIBCPP_HIDE_FROM_ABI __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {}370 _LIBCPP_HIDE_FROM_ABI __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {}
439371
...@@ -509,9 +441,9 @@ public:...@@ -509,9 +441,9 @@ public:
509441
510 typedef forward_iterator_tag iterator_category;442 typedef forward_iterator_tag iterator_category;
511 typedef typename _NodeTypes::__node_value_type value_type;443 typedef typename _NodeTypes::__node_value_type value_type;
512 typedef typename _NodeTypes::difference_type difference_type;444 using difference_type = ptrdiff_t;
513 typedef const value_type& reference;445 typedef const value_type& reference;
514 typedef typename _NodeTypes::__const_node_value_type_pointer pointer;446 using pointer = __rebind_pointer_t<_ConstNodePtr, const value_type>;
515447
516 _LIBCPP_HIDE_FROM_ABI __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {}448 _LIBCPP_HIDE_FROM_ABI __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {}
517449
...@@ -617,8 +549,6 @@ public:...@@ -617,8 +549,6 @@ public:
617 typedef typename __alloc_traits::pointer pointer;549 typedef typename __alloc_traits::pointer pointer;
618550
619private:551private:
620 typedef __hash_node_types<pointer> _NodeTypes;
621
622 allocator_type& __na_;552 allocator_type& __na_;
623553
624public:554public:
...@@ -633,7 +563,7 @@ public:...@@ -633,7 +563,7 @@ public:
633563
634 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {564 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {
635 if (__value_constructed) {565 if (__value_constructed) {
636 __alloc_traits::destroy(__na_, _NodeTypes::__get_ptr(__p->__get_value()));566 __alloc_traits::destroy(__na_, std::addressof(__p->__get_value()));
637 std::__destroy_at(std::addressof(*__p));567 std::__destroy_at(std::addressof(*__p));
638 }568 }
639 if (__p)569 if (__p)
...@@ -684,18 +614,16 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>...@@ -684,18 +614,16 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
684class __hash_table {614class __hash_table {
685public:615public:
686 using value_type = __get_hash_node_value_type_t<_Tp>;616 using value_type = __get_hash_node_value_type_t<_Tp>;
617 using key_type = __get_hash_node_key_type_t<_Tp>;
618
687 typedef _Hash hasher;619 typedef _Hash hasher;
688 typedef _Equal key_equal;620 typedef _Equal key_equal;
689 typedef _Alloc allocator_type;621 typedef _Alloc allocator_type;
690622
691private:623private:
692 typedef allocator_traits<allocator_type> __alloc_traits;624 typedef allocator_traits<allocator_type> __alloc_traits;
693 typedef typename __make_hash_node_types<_Tp, typename __alloc_traits::void_pointer>::type _NodeTypes;
694625
695public:626public:
696 typedef typename _NodeTypes::__node_value_type __node_value_type;
697 typedef typename _NodeTypes::__container_value_type __container_value_type;
698 typedef typename _NodeTypes::key_type key_type;
699 typedef value_type& reference;627 typedef value_type& reference;
700 typedef const value_type& const_reference;628 typedef const value_type& const_reference;
701 typedef typename __alloc_traits::pointer pointer;629 typedef typename __alloc_traits::pointer pointer;
...@@ -703,22 +631,23 @@ public:...@@ -703,22 +631,23 @@ public:
703#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE631#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
704 typedef typename __alloc_traits::size_type size_type;632 typedef typename __alloc_traits::size_type size_type;
705#else633#else
706 typedef typename _NodeTypes::size_type size_type;634 using size_type = size_t;
707#endif635#endif
708 typedef typename _NodeTypes::difference_type difference_type;636 using difference_type = ptrdiff_t;
709637
710public:638public:
711 // Create __node639 // Create __node
712640
713 typedef typename _NodeTypes::__node_type __node;641 using __void_pointer _LIBCPP_NODEBUG = typename __alloc_traits::void_pointer;
714 typedef __rebind_alloc<__alloc_traits, __node> __node_allocator;642
715 typedef allocator_traits<__node_allocator> __node_traits;643 using __node _LIBCPP_NODEBUG = __hash_node<_Tp, __void_pointer>;
716 typedef typename _NodeTypes::__void_pointer __void_pointer;644 using __node_allocator _LIBCPP_NODEBUG = __rebind_alloc<__alloc_traits, __node>;
717 typedef typename _NodeTypes::__node_pointer __node_pointer;645 using __node_traits _LIBCPP_NODEBUG = allocator_traits<__node_allocator>;
718 typedef typename _NodeTypes::__node_pointer __node_const_pointer;646 using __node_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<__void_pointer, __node>;
719 typedef typename _NodeTypes::__node_base_type __first_node;647
720 typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;648 using __first_node _LIBCPP_NODEBUG = __hash_node_base<__node_pointer>;
721 typedef typename _NodeTypes::__next_pointer __next_pointer;649 using __node_base_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<__void_pointer, __first_node>;
650 using __next_pointer _LIBCPP_NODEBUG = __node_base_pointer;
722651
723private:652private:
724 // check for sane allocator pointer rebinding semantics. Rebinding the653 // check for sane allocator pointer rebinding semantics. Rebinding the
...@@ -747,6 +676,38 @@ private:...@@ -747,6 +676,38 @@ private:
747676
748 _LIBCPP_HIDE_FROM_ABI size_type& size() _NOEXCEPT { return __size_; }677 _LIBCPP_HIDE_FROM_ABI size_type& size() _NOEXCEPT { return __size_; }
749678
679 _LIBCPP_HIDE_FROM_ABI void
680 __copy_construct(__next_pointer __other_iter, __next_pointer __own_iter, size_t __current_chash) {
681 auto __bucket_count = bucket_count();
682
683 for (; __other_iter; __other_iter = __other_iter->__next_) {
684 __node_holder __new_node = __construct_node_hash(__other_iter->__hash(), __other_iter->__upcast()->__get_value());
685
686 size_t __new_chash = std::__constrain_hash(__new_node->__hash(), __bucket_count);
687 if (__new_chash != __current_chash) {
688 __bucket_list_[__new_chash] = __own_iter;
689 __current_chash = __new_chash;
690 }
691
692 __own_iter->__next_ = static_cast<__next_pointer>(__new_node.release());
693 __own_iter = __own_iter->__next_;
694 }
695 }
696
697 _LIBCPP_HIDE_FROM_ABI void __copy_construct(__next_pointer __other_iter) {
698 __next_pointer __own_iter = __first_node_.__ptr();
699 {
700 __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());
702 }
703
704 size_t __current_chash = std::__constrain_hash(__own_iter->__next_->__hash(), bucket_count());
705 __bucket_list_[__current_chash] = __own_iter;
706 __other_iter = __other_iter->__next_;
707 __own_iter = __own_iter->__next_;
708 __copy_construct(__other_iter, __own_iter, __current_chash);
709 }
710
750public:711public:
751 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }712 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }
752713
...@@ -811,40 +772,66 @@ public:...@@ -811,40 +772,66 @@ public:
811 _LIBCPP_HIDE_FROM_ABI iterator __node_insert_multi(__node_pointer __nd);772 _LIBCPP_HIDE_FROM_ABI iterator __node_insert_multi(__node_pointer __nd);
812 _LIBCPP_HIDE_FROM_ABI iterator __node_insert_multi(const_iterator __p, __node_pointer __nd);773 _LIBCPP_HIDE_FROM_ABI iterator __node_insert_multi(const_iterator __p, __node_pointer __nd);
813774
814 template <class _Key, class... _Args>
815 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
816
817 template <class... _Args>
818 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
819
820 template <class _Pp>
821 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Pp&& __x) {
822 return __emplace_unique_extract_key(std::forward<_Pp>(__x), __can_extract_key<_Pp, key_type>());
823 }
824
825 template <class _First,
826 class _Second,
827 __enable_if_t<__can_extract_map_key<_First, key_type, __container_value_type>::value, int> = 0>
828 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_First&& __f, _Second&& __s) {
829 return __emplace_unique_key_args(__f, std::forward<_First>(__f), std::forward<_Second>(__s));
830 }
831
832 template <class... _Args>775 template <class... _Args>
833 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {776 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {
834 return __emplace_unique_impl(std::forward<_Args>(__args)...);777 return std::__try_key_extraction<key_type>(
835 }778 [this](const key_type& __key, _Args&&... __args2) {
836779 size_t __hash = hash_function()(__key);
837 template <class _Pp>780 size_type __bc = bucket_count();
838 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {781 bool __inserted = false;
839 return __emplace_unique_impl(std::forward<_Pp>(__x));782 __next_pointer __nd;
840 }783 size_t __chash;
841 template <class _Pp>784 if (__bc != 0) {
842 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {785 __chash = std::__constrain_hash(__hash, __bc);
843 return __emplace_unique_key_args(__x, std::forward<_Pp>(__x));786 __nd = __bucket_list_[__chash];
844 }787 if (__nd != nullptr) {
845 template <class _Pp>788 for (__nd = __nd->__next_;
846 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {789 __nd != nullptr &&
847 return __emplace_unique_key_args(__x.first, std::forward<_Pp>(__x));790 (__nd->__hash() == __hash || std::__constrain_hash(__nd->__hash(), __bc) == __chash);
791 __nd = __nd->__next_) {
792 if ((__nd->__hash() == __hash) && key_eq()(__nd->__upcast()->__get_value(), __key))
793 goto __done;
794 }
795 }
796 }
797 {
798 __node_holder __h = __construct_node_hash(__hash, std::forward<_Args>(__args2)...);
799 if (size() + 1 > __bc * max_load_factor()) {
800 __rehash_unique(std::max<size_type>(2 * __bc + !std::__is_hash_power2(__bc),
801 size_type(__math::ceil(float(size() + 1) / max_load_factor()))));
802 __bc = bucket_count();
803 __chash = std::__constrain_hash(__hash, __bc);
804 }
805 // insert_after __bucket_list_[__chash], or __first_node if bucket is null
806 __next_pointer __pn = __bucket_list_[__chash];
807 if (__pn == nullptr) {
808 __pn = __first_node_.__ptr();
809 __h->__next_ = __pn->__next_;
810 __pn->__next_ = __h.get()->__ptr();
811 // fix up __bucket_list_
812 __bucket_list_[__chash] = __pn;
813 if (__h->__next_ != nullptr)
814 __bucket_list_[std::__constrain_hash(__h->__next_->__hash(), __bc)] = __h.get()->__ptr();
815 } else {
816 __h->__next_ = __pn->__next_;
817 __pn->__next_ = static_cast<__next_pointer>(__h.get());
818 }
819 __nd = static_cast<__next_pointer>(__h.release());
820 // increment size
821 ++size();
822 __inserted = true;
823 }
824 __done:
825 return pair<iterator, bool>(iterator(__nd), __inserted);
826 },
827 [this](_Args&&... __args2) {
828 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
829 pair<iterator, bool> __r = __node_insert_unique(__h.get());
830 if (__r.second)
831 __h.release();
832 return __r;
833 },
834 std::forward<_Args>(__args)...);
848 }835 }
849836
850 template <class... _Args>837 template <class... _Args>
...@@ -854,9 +841,7 @@ public:...@@ -854,9 +841,7 @@ public:
854841
855 template <class _ValueT = _Tp, __enable_if_t<__is_hash_value_type<_ValueT>::value, int> = 0>842 template <class _ValueT = _Tp, __enable_if_t<__is_hash_value_type<_ValueT>::value, int> = 0>
856 _LIBCPP_HIDE_FROM_ABI void __insert_unique_from_orphaned_node(value_type&& __value) {843 _LIBCPP_HIDE_FROM_ABI void __insert_unique_from_orphaned_node(value_type&& __value) {
857 using __key_type = typename _NodeTypes::key_type;844 __node_holder __h = __construct_node(const_cast<key_type&&>(__value.first), std::move(__value.second));
858
859 __node_holder __h = __construct_node(const_cast<__key_type&&>(__value.first), std::move(__value.second));
860 __node_insert_unique(__h.get());845 __node_insert_unique(__h.get());
861 __h.release();846 __h.release();
862 }847 }
...@@ -870,9 +855,7 @@ public:...@@ -870,9 +855,7 @@ public:
870855
871 template <class _ValueT = _Tp, __enable_if_t<__is_hash_value_type<_ValueT>::value, int> = 0>856 template <class _ValueT = _Tp, __enable_if_t<__is_hash_value_type<_ValueT>::value, int> = 0>
872 _LIBCPP_HIDE_FROM_ABI void __insert_multi_from_orphaned_node(value_type&& __value) {857 _LIBCPP_HIDE_FROM_ABI void __insert_multi_from_orphaned_node(value_type&& __value) {
873 using __key_type = typename _NodeTypes::key_type;858 __node_holder __h = __construct_node(const_cast<key_type&&>(__value.first), std::move(__value.second));
874
875 __node_holder __h = __construct_node(const_cast<__key_type&&>(__value.first), std::move(__value.second));
876 __node_insert_multi(__h.get());859 __node_insert_multi(__h.get());
877 __h.release();860 __h.release();
878 }861 }
...@@ -1017,8 +1000,8 @@ private:...@@ -1017,8 +1000,8 @@ private:
1017 template <class... _Args>1000 template <class... _Args>
1018 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&&... __args);1001 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&&... __args);
10191002
1020 template <class _First, class... _Rest>1003 template <class... _Args>
1021 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);1004 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_hash(size_t __hash, _Args&&... __args);
10221005
1023 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __hash_table& __u) {1006 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __hash_table& __u) {
1024 __copy_assign_alloc(__u, integral_constant<bool, __node_traits::propagate_on_container_copy_assignment::value>());1007 __copy_assign_alloc(__u, integral_constant<bool, __node_traits::propagate_on_container_copy_assignment::value>());
...@@ -1042,17 +1025,29 @@ private:...@@ -1042,17 +1025,29 @@ private:
1042 }1025 }
1043 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}1026 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
10441027
1045 _LIBCPP_HIDE_FROM_ABI void __deallocate_node(__next_pointer __np) _NOEXCEPT;1028 _LIBCPP_HIDE_FROM_ABI void __deallocate_node(__node_pointer __nd) _NOEXCEPT {
1029 auto& __alloc = __node_alloc();
1030 __node_traits::destroy(__alloc, std::addressof(__nd->__get_value()));
1031 std::__destroy_at(std::__to_address(__nd));
1032 __node_traits::deallocate(__alloc, __nd, 1);
1033 }
1034
1035 _LIBCPP_HIDE_FROM_ABI void __deallocate_node_list(__next_pointer __np) _NOEXCEPT {
1036 while (__np != nullptr) {
1037 __next_pointer __next = __np->__next_;
1038 __deallocate_node(__np->__upcast());
1039 __np = __next;
1040 }
1041 }
1042
1046 _LIBCPP_HIDE_FROM_ABI __next_pointer __detach() _NOEXCEPT;1043 _LIBCPP_HIDE_FROM_ABI __next_pointer __detach() _NOEXCEPT;
10471044
1048 template <class _From, class _ValueT = _Tp, __enable_if_t<__is_hash_value_type<_ValueT>::value, int> = 0>1045 template <class _From, class _ValueT = _Tp, __enable_if_t<__is_hash_value_type<_ValueT>::value, int> = 0>
1049 _LIBCPP_HIDE_FROM_ABI void __assign_value(__get_hash_node_value_type_t<_Tp>& __lhs, _From&& __rhs) {1046 _LIBCPP_HIDE_FROM_ABI void __assign_value(__get_hash_node_value_type_t<_Tp>& __lhs, _From&& __rhs) {
1050 using __key_type = typename _NodeTypes::key_type;
1051
1052 // This is technically UB, since the object was constructed as `const`.1047 // This is technically UB, since the object was constructed as `const`.
1053 // Clang doesn't optimize on this currently though.1048 // Clang doesn't optimize on this currently though.
1054 const_cast<__key_type&>(__lhs.first) = const_cast<__copy_cvref_t<_From, __key_type>&&>(__rhs.first);1049 const_cast<key_type&>(__lhs.first) = const_cast<__copy_cvref_t<_From, key_type>&&>(__rhs.first);
1055 __lhs.second = std::forward<_From>(__rhs).second;1050 __lhs.second = std::forward<_From>(__rhs).second;
1056 }1051 }
10571052
1058 template <class _From, class _ValueT = _Tp, __enable_if_t<!__is_hash_value_type<_ValueT>::value, int> = 0>1053 template <class _From, class _ValueT = _Tp, __enable_if_t<!__is_hash_value_type<_ValueT>::value, int> = 0>
...@@ -1101,16 +1096,29 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const allocator_type& __a...@@ -1101,16 +1096,29 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const allocator_type& __a
1101 __max_load_factor_(1.0f) {}1096 __max_load_factor_(1.0f) {}
11021097
1103template <class _Tp, class _Hash, class _Equal, class _Alloc>1098template <class _Tp, class _Hash, class _Equal, class _Alloc>
1104__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u)1099__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __other)
1105 : __bucket_list_(nullptr,1100 : __bucket_list_(nullptr,
1106 __bucket_list_deleter(allocator_traits<__pointer_allocator>::select_on_container_copy_construction(1101 __bucket_list_deleter(__pointer_alloc_traits::select_on_container_copy_construction(
1107 __u.__bucket_list_.get_deleter().__alloc()),1102 __other.__bucket_list_.get_deleter().__alloc()),
1108 0)),1103 0)),
1109 __node_alloc_(allocator_traits<__node_allocator>::select_on_container_copy_construction(__u.__node_alloc())),1104 __node_alloc_(__node_traits::select_on_container_copy_construction(__other.__node_alloc())),
1110 __size_(0),1105 __size_(0),
1111 __hasher_(__u.hash_function()),1106 __hasher_(__other.hash_function()),
1112 __max_load_factor_(__u.__max_load_factor_),1107 __max_load_factor_(__other.__max_load_factor_),
1113 __key_eq_(__u.__key_eq_) {}1108 __key_eq_(__other.__key_eq_) {
1109 if (__other.size() == 0)
1110 return;
1111
1112 auto& __bucket_list_del = __bucket_list_.get_deleter();
1113 auto __bucket_count = __other.bucket_count();
1114 __bucket_list_.reset(__pointer_alloc_traits::allocate(__bucket_list_del.__alloc(), __bucket_count));
1115 __bucket_list_del.size() = __bucket_count;
1116
1117 std::fill_n(__bucket_list_.get(), __bucket_count, nullptr);
1118
1119 __copy_construct(__other.__first_node_.__next_);
1120 __size_ = __other.size();
1121}
11141122
1115template <class _Tp, class _Hash, class _Equal, class _Alloc>1123template <class _Tp, class _Hash, class _Equal, class _Alloc>
1116__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u, const allocator_type& __a)1124__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u, const allocator_type& __a)
...@@ -1169,7 +1177,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table() {...@@ -1169,7 +1177,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table() {
1169 static_assert(is_copy_constructible<hasher>::value, "Hasher must be copy-constructible.");1177 static_assert(is_copy_constructible<hasher>::value, "Hasher must be copy-constructible.");
1170#endif1178#endif
11711179
1172 __deallocate_node(__first_node_.__next_);1180 __deallocate_node_list(__first_node_.__next_);
1173}1181}
11741182
1175template <class _Tp, class _Hash, class _Equal, class _Alloc>1183template <class _Tp, class _Hash, class _Equal, class _Alloc>
...@@ -1184,28 +1192,76 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__copy_assign_alloc(const __hash_...@@ -1184,28 +1192,76 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__copy_assign_alloc(const __hash_
1184}1192}
11851193
1186template <class _Tp, class _Hash, class _Equal, class _Alloc>1194template <class _Tp, class _Hash, class _Equal, class _Alloc>
1187__hash_table<_Tp, _Hash, _Equal, _Alloc>& __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __u) {1195__hash_table<_Tp, _Hash, _Equal, _Alloc>&
1188 if (this != std::addressof(__u)) {1196__hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __other) {
1189 __copy_assign_alloc(__u);1197 if (this == std::addressof(__other))
1190 hash_function() = __u.hash_function();1198 return *this;
1191 key_eq() = __u.key_eq();1199
1192 max_load_factor() = __u.max_load_factor();1200 __copy_assign_alloc(__other);
1193 __assign_multi(__u.begin(), __u.end());1201 hash_function() = __other.hash_function();
1202 key_eq() = __other.key_eq();
1203 max_load_factor() = __other.max_load_factor();
1204
1205 if (__other.size() == 0) {
1206 clear();
1207 return *this;
1194 }1208 }
1195 return *this;
1196}
11971209
1198template <class _Tp, class _Hash, class _Equal, class _Alloc>1210 auto __bucket_count = __other.bucket_count();
1199void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np) _NOEXCEPT {1211 if (__bucket_count != bucket_count()) {
1200 __node_allocator& __na = __node_alloc();1212 auto& __bucket_list_del = __bucket_list_.get_deleter();
1201 while (__np != nullptr) {1213 __bucket_list_.reset(__pointer_alloc_traits::allocate(__bucket_list_del.__alloc(), __bucket_count));
1202 __next_pointer __next = __np->__next_;1214 __bucket_list_del.size() = __bucket_count;
1203 __node_pointer __real_np = __np->__upcast();1215 }
1204 __node_traits::destroy(__na, _NodeTypes::__get_ptr(__real_np->__get_value()));1216 std::fill_n(__bucket_list_.get(), __bucket_count, nullptr);
1205 std::__destroy_at(std::addressof(*__real_np));1217
1206 __node_traits::deallocate(__na, __real_np, 1);1218 if (!__first_node_.__next_) {
1207 __np = __next;1219 __copy_construct(__other.__first_node_.__next_);
1220 __size_ = __other.size();
1221 return *this;
1222 }
1223
1224 __next_pointer __other_iter = __other.__first_node_.__next_;
1225 __next_pointer __own_iter = __first_node_.__ptr();
1226 {
1227 __node_pointer __next = __own_iter->__next_->__upcast();
1228 __assign_value(__next->__get_value(), __other_iter->__upcast()->__get_value());
1229 __next->__hash_ = __other_iter->__hash();
1230 }
1231 size_t __current_chash = std::__constrain_hash(__own_iter->__next_->__hash(), __bucket_count);
1232 __bucket_list_[__current_chash] = __own_iter;
1233 __other_iter = __other_iter->__next_;
1234 __own_iter = __own_iter->__next_;
1235
1236 // Go through the nodes of the incoming hash table and copy then into the destination hash table, reusing as many
1237 // existing nodes as posssible in the destination.
1238 while (__other_iter && __own_iter->__next_) {
1239 __node_pointer __next = __own_iter->__next_->__upcast();
1240 __assign_value(__next->__get_value(), __other_iter->__upcast()->__get_value());
1241 __next->__hash_ = __other_iter->__hash();
1242
1243 size_t __new_chash = std::__constrain_hash(__next->__hash_, __bucket_count);
1244 if (__new_chash != __current_chash) {
1245 __bucket_list_[__new_chash] = __own_iter;
1246 __current_chash = __new_chash;
1247 }
1248
1249 __other_iter = __other_iter->__next_;
1250 __own_iter = __own_iter->__next_;
1208 }1251 }
1252
1253 // At this point we either have consumed the whole incoming hash table, or we don't have any more nodes to reuse in
1254 // the destination. Either continue with constructing new nodes, or deallocate the left over nodes.
1255 if (__own_iter->__next_) {
1256 __deallocate_node_list(__own_iter->__next_);
1257 __own_iter->__next_ = nullptr;
1258 } else {
1259 __copy_construct(__other_iter, __own_iter, __current_chash);
1260 }
1261
1262 __size_ = __other.size();
1263
1264 return *this;
1209}1265}
12101266
1211template <class _Tp, class _Hash, class _Equal, class _Alloc>1267template <class _Tp, class _Hash, class _Equal, class _Alloc>
...@@ -1251,23 +1307,14 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(__hash_table& __u,...@@ -1251,23 +1307,14 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(__hash_table& __u,
1251 max_load_factor() = __u.max_load_factor();1307 max_load_factor() = __u.max_load_factor();
1252 if (bucket_count() != 0) {1308 if (bucket_count() != 0) {
1253 __next_pointer __cache = __detach();1309 __next_pointer __cache = __detach();
1254#if _LIBCPP_HAS_EXCEPTIONS1310 auto __guard = std::__make_scope_guard([&] { __deallocate_node_list(__cache); });
1255 try {1311 const_iterator __i = __u.begin();
1256#endif // _LIBCPP_HAS_EXCEPTIONS1312 while (__cache != nullptr && __u.size() != 0) {
1257 const_iterator __i = __u.begin();1313 __assign_value(__cache->__upcast()->__get_value(), std::move(__u.remove(__i++)->__get_value()));
1258 while (__cache != nullptr && __u.size() != 0) {1314 __next_pointer __next = __cache->__next_;
1259 __assign_value(__cache->__upcast()->__get_value(), std::move(__u.remove(__i++)->__get_value()));1315 __node_insert_multi(__cache->__upcast());
1260 __next_pointer __next = __cache->__next_;1316 __cache = __next;
1261 __node_insert_multi(__cache->__upcast());
1262 __cache = __next;
1263 }
1264#if _LIBCPP_HAS_EXCEPTIONS
1265 } catch (...) {
1266 __deallocate_node(__cache);
1267 throw;
1268 }1317 }
1269#endif // _LIBCPP_HAS_EXCEPTIONS
1270 __deallocate_node(__cache);
1271 }1318 }
1272 const_iterator __i = __u.begin();1319 const_iterator __i = __u.begin();
1273 while (__u.size() != 0)1320 while (__u.size() != 0)
...@@ -1290,27 +1337,18 @@ template <class _InputIterator>...@@ -1290,27 +1337,18 @@ template <class _InputIterator>
1290void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first, _InputIterator __last) {1337void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first, _InputIterator __last) {
1291 typedef iterator_traits<_InputIterator> _ITraits;1338 typedef iterator_traits<_InputIterator> _ITraits;
1292 typedef typename _ITraits::value_type _ItValueType;1339 typedef typename _ITraits::value_type _ItValueType;
1293 static_assert(is_same<_ItValueType, __container_value_type>::value,1340 static_assert(
1294 "__assign_unique may only be called with the containers value type");1341 is_same<_ItValueType, value_type>::value, "__assign_unique may only be called with the containers value type");
12951342
1296 if (bucket_count() != 0) {1343 if (bucket_count() != 0) {
1297 __next_pointer __cache = __detach();1344 __next_pointer __cache = __detach();
1298#if _LIBCPP_HAS_EXCEPTIONS1345 auto __guard = std::__make_scope_guard([&] { __deallocate_node_list(__cache); });
1299 try {1346 for (; __cache != nullptr && __first != __last; ++__first) {
1300#endif // _LIBCPP_HAS_EXCEPTIONS1347 __assign_value(__cache->__upcast()->__get_value(), *__first);
1301 for (; __cache != nullptr && __first != __last; ++__first) {1348 __next_pointer __next = __cache->__next_;
1302 __assign_value(__cache->__upcast()->__get_value(), *__first);1349 __node_insert_unique(__cache->__upcast());
1303 __next_pointer __next = __cache->__next_;1350 __cache = __next;
1304 __node_insert_unique(__cache->__upcast());
1305 __cache = __next;
1306 }
1307#if _LIBCPP_HAS_EXCEPTIONS
1308 } catch (...) {
1309 __deallocate_node(__cache);
1310 throw;
1311 }1351 }
1312#endif // _LIBCPP_HAS_EXCEPTIONS
1313 __deallocate_node(__cache);
1314 }1352 }
1315 for (; __first != __last; ++__first)1353 for (; __first != __last; ++__first)
1316 __emplace_unique(*__first);1354 __emplace_unique(*__first);
...@@ -1321,31 +1359,20 @@ template <class _InputIterator>...@@ -1321,31 +1359,20 @@ template <class _InputIterator>
1321void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first, _InputIterator __last) {1359void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first, _InputIterator __last) {
1322 typedef iterator_traits<_InputIterator> _ITraits;1360 typedef iterator_traits<_InputIterator> _ITraits;
1323 typedef typename _ITraits::value_type _ItValueType;1361 typedef typename _ITraits::value_type _ItValueType;
1324 static_assert(1362 static_assert(is_same<_ItValueType, value_type>::value,
1325 (is_same<_ItValueType, __container_value_type>::value || is_same<_ItValueType, __node_value_type>::value),1363 "__assign_multi may only be called with the containers value type or the nodes value type");
1326 "__assign_multi may only be called with the containers value type"
1327 " or the nodes value type");
1328 if (bucket_count() != 0) {1364 if (bucket_count() != 0) {
1329 __next_pointer __cache = __detach();1365 __next_pointer __cache = __detach();
1330#if _LIBCPP_HAS_EXCEPTIONS1366 auto __guard = std::__make_scope_guard([&] { __deallocate_node_list(__cache); });
1331 try {1367 for (; __cache != nullptr && __first != __last; ++__first) {
1332#endif // _LIBCPP_HAS_EXCEPTIONS1368 __assign_value(__cache->__upcast()->__get_value(), *__first);
1333 for (; __cache != nullptr && __first != __last; ++__first) {1369 __next_pointer __next = __cache->__next_;
1334 __assign_value(__cache->__upcast()->__get_value(), *__first);1370 __node_insert_multi(__cache->__upcast());
1335 __next_pointer __next = __cache->__next_;1371 __cache = __next;
1336 __node_insert_multi(__cache->__upcast());
1337 __cache = __next;
1338 }
1339#if _LIBCPP_HAS_EXCEPTIONS
1340 } catch (...) {
1341 __deallocate_node(__cache);
1342 throw;
1343 }1372 }
1344#endif // _LIBCPP_HAS_EXCEPTIONS
1345 __deallocate_node(__cache);
1346 }1373 }
1347 for (; __first != __last; ++__first)1374 for (; __first != __last; ++__first)
1348 __emplace_multi(_NodeTypes::__get_value(*__first));1375 __emplace_multi(*__first);
1349}1376}
13501377
1351template <class _Tp, class _Hash, class _Equal, class _Alloc>1378template <class _Tp, class _Hash, class _Equal, class _Alloc>
...@@ -1375,7 +1402,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT {...@@ -1375,7 +1402,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT {
1375template <class _Tp, class _Hash, class _Equal, class _Alloc>1402template <class _Tp, class _Hash, class _Equal, class _Alloc>
1376void __hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT {1403void __hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT {
1377 if (size() > 0) {1404 if (size() > 0) {
1378 __deallocate_node(__first_node_.__next_);1405 __deallocate_node_list(__first_node_.__next_);
1379 __first_node_.__next_ = nullptr;1406 __first_node_.__next_ = nullptr;
1380 size_type __bc = bucket_count();1407 size_type __bc = bucket_count();
1381 for (size_type __i = 0; __i < __bc; ++__i)1408 for (size_type __i = 0; __i < __bc; ++__i)
...@@ -1561,69 +1588,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(const_iterator __p...@@ -1561,69 +1588,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(const_iterator __p
1561 return __node_insert_multi(__cp);1588 return __node_insert_multi(__cp);
1562}1589}
15631590
1564template <class _Tp, class _Hash, class _Equal, class _Alloc>
1565template <class _Key, class... _Args>
1566pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
1567__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args) {
1568 size_t __hash = hash_function()(__k);
1569 size_type __bc = bucket_count();
1570 bool __inserted = false;
1571 __next_pointer __nd;
1572 size_t __chash;
1573 if (__bc != 0) {
1574 __chash = std::__constrain_hash(__hash, __bc);
1575 __nd = __bucket_list_[__chash];
1576 if (__nd != nullptr) {
1577 for (__nd = __nd->__next_;
1578 __nd != nullptr && (__nd->__hash() == __hash || std::__constrain_hash(__nd->__hash(), __bc) == __chash);
1579 __nd = __nd->__next_) {
1580 if ((__nd->__hash() == __hash) && key_eq()(__nd->__upcast()->__get_value(), __k))
1581 goto __done;
1582 }
1583 }
1584 }
1585 {
1586 __node_holder __h = __construct_node_hash(__hash, std::forward<_Args>(__args)...);
1587 if (size() + 1 > __bc * max_load_factor() || __bc == 0) {
1588 __rehash_unique(std::max<size_type>(
1589 2 * __bc + !std::__is_hash_power2(__bc), size_type(__math::ceil(float(size() + 1) / max_load_factor()))));
1590 __bc = bucket_count();
1591 __chash = std::__constrain_hash(__hash, __bc);
1592 }
1593 // insert_after __bucket_list_[__chash], or __first_node if bucket is null
1594 __next_pointer __pn = __bucket_list_[__chash];
1595 if (__pn == nullptr) {
1596 __pn = __first_node_.__ptr();
1597 __h->__next_ = __pn->__next_;
1598 __pn->__next_ = __h.get()->__ptr();
1599 // fix up __bucket_list_
1600 __bucket_list_[__chash] = __pn;
1601 if (__h->__next_ != nullptr)
1602 __bucket_list_[std::__constrain_hash(__h->__next_->__hash(), __bc)] = __h.get()->__ptr();
1603 } else {
1604 __h->__next_ = __pn->__next_;
1605 __pn->__next_ = static_cast<__next_pointer>(__h.get());
1606 }
1607 __nd = static_cast<__next_pointer>(__h.release());
1608 // increment size
1609 ++size();
1610 __inserted = true;
1611 }
1612__done:
1613 return pair<iterator, bool>(iterator(__nd), __inserted);
1614}
1615
1616template <class _Tp, class _Hash, class _Equal, class _Alloc>
1617template <class... _Args>
1618pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
1619__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_impl(_Args&&... __args) {
1620 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1621 pair<iterator, bool> __r = __node_insert_unique(__h.get());
1622 if (__r.second)
1623 __h.release();
1624 return __r;
1625}
1626
1627template <class _Tp, class _Hash, class _Equal, class _Alloc>1591template <class _Tp, class _Hash, class _Equal, class _Alloc>
1628template <class... _Args>1592template <class... _Args>
1629typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator1593typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
...@@ -1764,41 +1728,45 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __n) _LIBCPP_D...@@ -1764,41 +1728,45 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __n) _LIBCPP_D
17641728
1765template <class _Tp, class _Hash, class _Equal, class _Alloc>1729template <class _Tp, class _Hash, class _Equal, class _Alloc>
1766template <bool _UniqueKeys>1730template <bool _UniqueKeys>
1767void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__do_rehash(size_type __nbc) {1731void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__do_rehash(size_type __bucket_count) {
1768 __pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();1732 __pointer_allocator& __ptr_alloc = __bucket_list_.get_deleter().__alloc();
1769 __bucket_list_.reset(__nbc > 0 ? __pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);1733 __bucket_list_.reset(__bucket_count > 0 ? __pointer_alloc_traits::allocate(__ptr_alloc, __bucket_count) : nullptr);
1770 __bucket_list_.get_deleter().size() = __nbc;1734 __bucket_list_.get_deleter().size() = __bucket_count;
1771 if (__nbc > 0) {1735
1772 for (size_type __i = 0; __i < __nbc; ++__i)1736 if (__bucket_count == 0)
1773 __bucket_list_[__i] = nullptr;1737 return;
1774 __next_pointer __pp = __first_node_.__ptr();1738
1775 __next_pointer __cp = __pp->__next_;1739 for (size_type __i = 0; __i < __bucket_count; ++__i)
1776 if (__cp != nullptr) {1740 __bucket_list_[__i] = nullptr;
1777 size_type __chash = std::__constrain_hash(__cp->__hash(), __nbc);1741 __next_pointer __pp = __first_node_.__ptr();
1778 __bucket_list_[__chash] = __pp;1742 __next_pointer __cp = __pp->__next_;
1779 size_type __phash = __chash;1743
1780 for (__pp = __cp, void(), __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) {1744 if (!__cp)
1781 __chash = std::__constrain_hash(__cp->__hash(), __nbc);1745 return;
1782 if (__chash == __phash)1746
1783 __pp = __cp;1747 size_type __chash = std::__constrain_hash(__cp->__hash(), __bucket_count);
1784 else {1748 __bucket_list_[__chash] = __pp;
1785 if (__bucket_list_[__chash] == nullptr) {1749 size_type __phash = __chash;
1786 __bucket_list_[__chash] = __pp;1750 for (__pp = __cp, void(), __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) {
1787 __pp = __cp;1751 __chash = std::__constrain_hash(__cp->__hash(), __bucket_count);
1788 __phash = __chash;1752 if (__chash == __phash)
1789 } else {1753 __pp = __cp;
1790 __next_pointer __np = __cp;1754 else {
1791 if _LIBCPP_CONSTEXPR_SINCE_CXX17 (!_UniqueKeys) {1755 if (__bucket_list_[__chash] == nullptr) {
1792 for (; __np->__next_ != nullptr &&1756 __bucket_list_[__chash] = __pp;
1793 key_eq()(__cp->__upcast()->__get_value(), __np->__next_->__upcast()->__get_value());1757 __pp = __cp;
1794 __np = __np->__next_)1758 __phash = __chash;
1795 ;1759 } else {
1796 }1760 __next_pointer __np = __cp;
1797 __pp->__next_ = __np->__next_;1761 if _LIBCPP_CONSTEXPR (!_UniqueKeys) {
1798 __np->__next_ = __bucket_list_[__chash]->__next_;1762 for (; __np->__next_ != nullptr &&
1799 __bucket_list_[__chash]->__next_ = __cp;1763 key_eq()(__cp->__upcast()->__get_value(), __np->__next_->__upcast()->__get_value());
1800 }1764 __np = __np->__next_)
1765 ;
1801 }1766 }
1767 __pp->__next_ = __np->__next_;
1768 __np->__next_ = __bucket_list_[__chash]->__next_;
1769 __bucket_list_[__chash]->__next_ = __cp;
1802 }1770 }
1803 }1771 }
1804 }1772 }
...@@ -1854,16 +1822,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&&... __args) {...@@ -1854,16 +1822,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&&... __args) {
1854 __node_allocator& __na = __node_alloc();1822 __node_allocator& __na = __node_alloc();
1855 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));1823 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
18561824
1857 // Begin the lifetime of the node itself. Note that this doesn't begin the lifetime of the value1825 // Begin the lifetime of the node itself and the value_type contained within.
1858 // held inside the node, since we need to use the allocator's construct() method for that.
1859 //1826 //
1860 // We don't use the allocator's construct() method to construct the node itself since the1827 // We don't use the allocator's construct() method to construct the node itself since the
1861 // Cpp17FooInsertable named requirements don't require the allocator's construct() method1828 // Cpp17FooInsertable named requirements don't require the allocator's construct() method
1862 // to work on anything other than the value_type.1829 // to work on anything other than the value_type.
1863 std::__construct_at(std::addressof(*__h), /* next = */ nullptr, /* hash = */ 0);1830 std::__construct_at(std::addressof(*__h), /* hash = */ 0, __na, std::forward<_Args>(__args)...);
18641831
1865 // Now construct the value_type using the allocator's construct() method.
1866 __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__get_value()), std::forward<_Args>(__args)...);
1867 __h.get_deleter().__value_constructed = true;1832 __h.get_deleter().__value_constructed = true;
18681833
1869 __h->__hash_ = hash_function()(__h->__get_value());1834 __h->__hash_ = hash_function()(__h->__get_value());
...@@ -1871,15 +1836,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&&... __args) {...@@ -1871,15 +1836,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&&... __args) {
1871}1836}
18721837
1873template <class _Tp, class _Hash, class _Equal, class _Alloc>1838template <class _Tp, class _Hash, class _Equal, class _Alloc>
1874template <class _First, class... _Rest>1839template <class... _Args>
1875typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder1840typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
1876__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest) {1841__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash, _Args&&... __args) {
1877 static_assert(!__is_hash_value_type<_First, _Rest...>::value, "Construct cannot be called with a hash value type");1842 static_assert(!__is_hash_value_type<_Args...>::value, "Construct cannot be called with a hash value type");
1878 __node_allocator& __na = __node_alloc();1843 __node_allocator& __na = __node_alloc();
1879 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));1844 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1880 std::__construct_at(std::addressof(*__h), /* next = */ nullptr, /* hash = */ __hash);1845 std::__construct_at(std::addressof(*__h), /* hash = */ __hash, __na, std::forward<_Args>(__args)...);
1881 __node_traits::construct(
1882 __na, _NodeTypes::__get_ptr(__h->__get_value()), std::forward<_First>(__f), std::forward<_Rest>(__rest)...);
1883 __h.get_deleter().__value_constructed = true;1846 __h.get_deleter().__value_constructed = true;
1884 return __h;1847 return __h;
1885}1848}
...@@ -1899,12 +1862,63 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p) {...@@ -1899,12 +1862,63 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p) {
1899template <class _Tp, class _Hash, class _Equal, class _Alloc>1862template <class _Tp, class _Hash, class _Equal, class _Alloc>
1900typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator1863typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
1901__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first, const_iterator __last) {1864__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first, const_iterator __last) {
1902 for (const_iterator __p = __first; __first != __last; __p = __first) {1865 if (__first == __last)
1903 ++__first;1866 return iterator(__last.__node_);
1904 erase(__p);1867
1868 // current node
1869 __next_pointer __current = __first.__node_;
1870 size_type __bucket_count = bucket_count();
1871 size_t __chash = std::__constrain_hash(__current->__hash(), __bucket_count);
1872 // find previous node
1873 __next_pointer __before_first = __bucket_list_[__chash];
1874 for (; __before_first->__next_ != __current; __before_first = __before_first->__next_)
1875 ;
1876
1877 __next_pointer __last_node = __last.__node_;
1878
1879 // If __before_first is in the same bucket (i.e. the first element we erase is not the first in the bucket), clear
1880 // this bucket first without re-linking it
1881 if (__before_first != __first_node_.__ptr() &&
1882 std::__constrain_hash(__before_first->__hash(), __bucket_count) == __chash) {
1883 while (__current != __last_node) {
1884 auto __next = __current->__next_;
1885 __deallocate_node(__current->__upcast());
1886 __current = __next;
1887 --__size_;
1888
1889 if (__next) {
1890 if (auto __next_chash = std::__constrain_hash(__next->__hash(), __bucket_count); __next_chash != __chash) {
1891 __bucket_list_[__next_chash] = __before_first;
1892 __chash = __next_chash;
1893 break;
1894 }
1895 }
1896 }
1905 }1897 }
1906 __next_pointer __np = __last.__node_;1898
1907 return iterator(__np);1899 while (__current != __last_node) {
1900 auto __next = __current->__next_;
1901 __deallocate_node(__current->__upcast());
1902 __current = __next;
1903 --__size_;
1904
1905 // When switching buckets, set the old bucket to be empty and update the next bucket to have __before_first as its
1906 // before-first element
1907 if (__next) {
1908 if (auto __next_chash = std::__constrain_hash(__next->__hash(), __bucket_count); __next_chash != __chash) {
1909 __bucket_list_[__chash] = nullptr;
1910 __bucket_list_[__next_chash] = __before_first;
1911 __chash = __next_chash;
1912 }
1913 } else { // When __next is a nullptr we've fully erased the last bucket. Update the bucket list accordingly.
1914 __bucket_list_[__chash] = nullptr;
1915 }
1916 }
1917
1918 // re-link __before_first with __last
1919 __before_first->__next_ = __current;
1920
1921 return iterator(__last.__node_);
1908}1922}
19091923
1910template <class _Tp, class _Hash, class _Equal, class _Alloc>1924template <class _Tp, class _Hash, class _Equal, class _Alloc>
lib/libcxx/include/__ios/fpos.h+4-4
...@@ -30,7 +30,7 @@ public:...@@ -30,7 +30,7 @@ public:
3030
31 _LIBCPP_HIDE_FROM_ABI operator streamoff() const { return __off_; }31 _LIBCPP_HIDE_FROM_ABI operator streamoff() const { return __off_; }
3232
33 _LIBCPP_HIDE_FROM_ABI _StateT state() const { return __st_; }33 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _StateT state() const { return __st_; }
34 _LIBCPP_HIDE_FROM_ABI void state(_StateT __st) { __st_ = __st; }34 _LIBCPP_HIDE_FROM_ABI void state(_StateT __st) { __st_ = __st; }
3535
36 _LIBCPP_HIDE_FROM_ABI fpos& operator+=(streamoff __off) {36 _LIBCPP_HIDE_FROM_ABI fpos& operator+=(streamoff __off) {
...@@ -38,7 +38,7 @@ public:...@@ -38,7 +38,7 @@ public:
38 return *this;38 return *this;
39 }39 }
4040
41 _LIBCPP_HIDE_FROM_ABI fpos operator+(streamoff __off) const {41 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI fpos operator+(streamoff __off) const {
42 fpos __t(*this);42 fpos __t(*this);
43 __t += __off;43 __t += __off;
44 return __t;44 return __t;
...@@ -49,7 +49,7 @@ public:...@@ -49,7 +49,7 @@ public:
49 return *this;49 return *this;
50 }50 }
5151
52 _LIBCPP_HIDE_FROM_ABI fpos operator-(streamoff __off) const {52 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI fpos operator-(streamoff __off) const {
53 fpos __t(*this);53 fpos __t(*this);
54 __t -= __off;54 __t -= __off;
55 return __t;55 return __t;
...@@ -57,7 +57,7 @@ public:...@@ -57,7 +57,7 @@ public:
57};57};
5858
59template <class _StateT>59template <class _StateT>
60inline _LIBCPP_HIDE_FROM_ABI streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {60[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {
61 return streamoff(__x) - streamoff(__y);61 return streamoff(__x) - streamoff(__y);
62}62}
6363
lib/libcxx/include/__iterator/back_insert_iterator.h+1-7
...@@ -26,15 +26,9 @@ _LIBCPP_PUSH_MACROS...@@ -26,15 +26,9 @@ _LIBCPP_PUSH_MACROS
2626
27_LIBCPP_BEGIN_NAMESPACE_STD27_LIBCPP_BEGIN_NAMESPACE_STD
2828
29_LIBCPP_SUPPRESS_DEPRECATED_PUSH
30template <class _Container>29template <class _Container>
31class back_insert_iterator30class back_insert_iterator
32#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)31 : public __iterator_base<back_insert_iterator<_Container>, output_iterator_tag, void, void, void, void> {
33 : public iterator<output_iterator_tag, void, void, void, void>
34#endif
35{
36 _LIBCPP_SUPPRESS_DEPRECATED_POP
37
38protected:32protected:
39 _Container* container;33 _Container* container;
4034
lib/libcxx/include/__iterator/bounded_iter.h+7-8
...@@ -74,12 +74,12 @@ struct __bounded_iter {...@@ -74,12 +74,12 @@ struct __bounded_iter {
74 _LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter const&) = default;74 _LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter const&) = default;
75 _LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter&&) = default;75 _LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter&&) = default;
7676
77 template < class _OtherIterator,77 template <class _OtherIterator,
78 __enable_if_t<78 __enable_if_t<
79 _And< is_convertible<const _OtherIterator&, _Iterator>,79 _And<is_convertible<const _OtherIterator&, _Iterator>,
80 _Or<is_same<reference, __iter_reference<_OtherIterator> >,80 _Or<is_same<reference, __iterator_reference<_OtherIterator> >,
81 is_same<reference, __make_const_lvalue_ref<__iter_reference<_OtherIterator> > > > >::value,81 is_same<reference, __make_const_lvalue_ref<__iterator_reference<_OtherIterator> > > > >::value,
82 int> = 0>82 int> = 0>
83 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __bounded_iter(__bounded_iter<_OtherIterator> const& __other) _NOEXCEPT83 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __bounded_iter(__bounded_iter<_OtherIterator> const& __other) _NOEXCEPT
84 : __current_(__other.__current_),84 : __current_(__other.__current_),
85 __begin_(__other.__begin_),85 __begin_(__other.__begin_),
...@@ -116,8 +116,7 @@ public:...@@ -116,8 +116,7 @@ public:
116 // These operations check that the iterator is dereferenceable. Since the class invariant is116 // These operations check that the iterator is dereferenceable. Since the class invariant is
117 // that the iterator is always within `[begin, end]`, we only need to check it's not pointing to117 // 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()`118 // `end`. This is easier for the optimizer because it aligns with the `iter != container.end()`
119 // checks that typical callers already use (see119 // checks that typical callers already use (see https://llvm.org/PR78829).
120 // https://github.com/llvm/llvm-project/issues/78829).
121 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {120 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {
122 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(121 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
123 __current_ != __end_, "__bounded_iter::operator*: Attempt to dereference an iterator at the end");122 __current_ != __end_, "__bounded_iter::operator*: Attempt to dereference an iterator at the end");
lib/libcxx/include/__iterator/concepts.h+6-9
...@@ -117,15 +117,12 @@ template <class _Tp>...@@ -117,15 +117,12 @@ template <class _Tp>
117concept __signed_integer_like = signed_integral<_Tp>;117concept __signed_integer_like = signed_integral<_Tp>;
118118
119template <class _Ip>119template <class _Ip>
120concept weakly_incrementable =120concept weakly_incrementable = movable<_Ip> && requires(_Ip __i) {
121 // TODO: remove this once the clang bug is fixed (bugs.llvm.org/PR48173).121 typename iter_difference_t<_Ip>;
122 !same_as<_Ip, bool> && // Currently, clang does not handle bool correctly.122 requires __signed_integer_like<iter_difference_t<_Ip>>;
123 movable<_Ip> && requires(_Ip __i) {123 { ++__i } -> same_as<_Ip&>; // not required to be equality-preserving
124 typename iter_difference_t<_Ip>;124 __i++; // not required to be equality-preserving
125 requires __signed_integer_like<iter_difference_t<_Ip>>;125};
126 { ++__i } -> same_as<_Ip&>; // not required to be equality-preserving
127 __i++; // not required to be equality-preserving
128 };
129126
130// [iterator.concept.inc]127// [iterator.concept.inc]
131template <class _Ip>128template <class _Ip>
lib/libcxx/include/__iterator/cpp17_iterator_concepts.h+13-12
...@@ -68,7 +68,8 @@ concept __cpp17_default_constructible = is_default_constructible_v<_Tp>;...@@ -68,7 +68,8 @@ concept __cpp17_default_constructible = is_default_constructible_v<_Tp>;
68template <class _Iter>68template <class _Iter>
69concept __cpp17_iterator =69concept __cpp17_iterator =
70 __cpp17_copy_constructible<_Iter> && __cpp17_copy_assignable<_Iter> && __cpp17_destructible<_Iter> &&70 __cpp17_copy_constructible<_Iter> && __cpp17_copy_assignable<_Iter> && __cpp17_destructible<_Iter> &&
71 (is_signed_v<__iter_diff_t<_Iter>> || is_void_v<__iter_diff_t<_Iter>>) && requires(_Iter __iter) {71 (is_signed_v<__iterator_difference_type<_Iter>> || is_void_v<__iterator_difference_type<_Iter>>) &&
72 requires(_Iter __iter) {
72 { *__iter };73 { *__iter };
73 { ++__iter } -> same_as<_Iter&>;74 { ++__iter } -> same_as<_Iter&>;
74 };75 };
...@@ -81,8 +82,8 @@ concept __cpp17_input_iterator =...@@ -81,8 +82,8 @@ concept __cpp17_input_iterator =
81 { __lhs != std::as_const(__rhs) } -> __boolean_testable;82 { __lhs != std::as_const(__rhs) } -> __boolean_testable;
82 { std::as_const(__lhs) != std::as_const(__rhs) } -> __boolean_testable;83 { std::as_const(__lhs) != std::as_const(__rhs) } -> __boolean_testable;
8384
84 { *__lhs } -> same_as<__iter_reference<_Iter>>;85 { *__lhs } -> same_as<__iterator_reference<_Iter>>;
85 { *std::as_const(__lhs) } -> same_as<__iter_reference<_Iter>>;86 { *std::as_const(__lhs) } -> same_as<__iterator_reference<_Iter>>;
8687
87 { ++__lhs } -> same_as<_Iter&>;88 { ++__lhs } -> same_as<_Iter&>;
88 { (void)__lhs++ };89 { (void)__lhs++ };
...@@ -101,19 +102,19 @@ template <class _Iter>...@@ -101,19 +102,19 @@ template <class _Iter>
101concept __cpp17_forward_iterator =102concept __cpp17_forward_iterator =
102 __cpp17_input_iterator<_Iter> && __cpp17_default_constructible<_Iter> && requires(_Iter __iter) {103 __cpp17_input_iterator<_Iter> && __cpp17_default_constructible<_Iter> && requires(_Iter __iter) {
103 { __iter++ } -> convertible_to<const _Iter&>;104 { __iter++ } -> convertible_to<const _Iter&>;
104 { *__iter++ } -> same_as<__iter_reference<_Iter>>;105 { *__iter++ } -> same_as<__iterator_reference<_Iter>>;
105 };106 };
106107
107template <class _Iter>108template <class _Iter>
108concept __cpp17_bidirectional_iterator = __cpp17_forward_iterator<_Iter> && requires(_Iter __iter) {109concept __cpp17_bidirectional_iterator = __cpp17_forward_iterator<_Iter> && requires(_Iter __iter) {
109 { --__iter } -> same_as<_Iter&>;110 { --__iter } -> same_as<_Iter&>;
110 { __iter-- } -> convertible_to<const _Iter&>;111 { __iter-- } -> convertible_to<const _Iter&>;
111 { *__iter-- } -> same_as<__iter_reference<_Iter>>;112 { *__iter-- } -> same_as<__iterator_reference<_Iter>>;
112};113};
113114
114template <class _Iter>115template <class _Iter>
115concept __cpp17_random_access_iterator =116concept __cpp17_random_access_iterator =
116 __cpp17_bidirectional_iterator<_Iter> && requires(_Iter __iter, __iter_diff_t<_Iter> __n) {117 __cpp17_bidirectional_iterator<_Iter> && requires(_Iter __iter, __iterator_difference_type<_Iter> __n) {
117 { __iter += __n } -> same_as<_Iter&>;118 { __iter += __n } -> same_as<_Iter&>;
118119
119 { __iter + __n } -> same_as<_Iter>;120 { __iter + __n } -> same_as<_Iter>;
...@@ -125,13 +126,13 @@ concept __cpp17_random_access_iterator =...@@ -125,13 +126,13 @@ concept __cpp17_random_access_iterator =
125 { __iter - __n } -> same_as<_Iter>;126 { __iter - __n } -> same_as<_Iter>;
126 { std::as_const(__iter) - __n } -> same_as<_Iter>;127 { std::as_const(__iter) - __n } -> same_as<_Iter>;
127128
128 { __iter - __iter } -> same_as<__iter_diff_t<_Iter>>;129 { __iter - __iter } -> same_as<__iterator_difference_type<_Iter>>;
129 { std::as_const(__iter) - __iter } -> same_as<__iter_diff_t<_Iter>>;130 { std::as_const(__iter) - __iter } -> same_as<__iterator_difference_type<_Iter>>;
130 { __iter - std::as_const(__iter) } -> same_as<__iter_diff_t<_Iter>>;131 { __iter - std::as_const(__iter) } -> same_as<__iterator_difference_type<_Iter>>;
131 { std::as_const(__iter) - std::as_const(__iter) } -> same_as<__iter_diff_t<_Iter>>;132 { std::as_const(__iter) - std::as_const(__iter) } -> same_as<__iterator_difference_type<_Iter>>;
132133
133 { __iter[__n] } -> convertible_to<__iter_reference<_Iter>>;134 { __iter[__n] } -> convertible_to<__iterator_reference<_Iter>>;
134 { std::as_const(__iter)[__n] } -> convertible_to<__iter_reference<_Iter>>;135 { std::as_const(__iter)[__n] } -> convertible_to<__iterator_reference<_Iter>>;
135136
136 { __iter < __iter } -> __boolean_testable;137 { __iter < __iter } -> __boolean_testable;
137 { std::as_const(__iter) < __iter } -> __boolean_testable;138 { std::as_const(__iter) < __iter } -> __boolean_testable;
lib/libcxx/include/__iterator/distance.h+40-18
...@@ -10,41 +10,66 @@...@@ -10,41 +10,66 @@
10#ifndef _LIBCPP___ITERATOR_DISTANCE_H10#ifndef _LIBCPP___ITERATOR_DISTANCE_H
11#define _LIBCPP___ITERATOR_DISTANCE_H11#define _LIBCPP___ITERATOR_DISTANCE_H
1212
13#include <__algorithm/for_each_segment.h>
14#include <__concepts/same_as.h>
13#include <__config>15#include <__config>
14#include <__iterator/concepts.h>16#include <__iterator/concepts.h>
15#include <__iterator/incrementable_traits.h>17#include <__iterator/incrementable_traits.h>
16#include <__iterator/iterator_traits.h>18#include <__iterator/iterator_traits.h>
19#include <__iterator/segmented_iterator.h>
17#include <__ranges/access.h>20#include <__ranges/access.h>
18#include <__ranges/concepts.h>21#include <__ranges/concepts.h>
19#include <__ranges/size.h>22#include <__ranges/size.h>
20#include <__type_traits/decay.h>23#include <__type_traits/decay.h>
24#include <__type_traits/enable_if.h>
21#include <__type_traits/remove_cvref.h>25#include <__type_traits/remove_cvref.h>
26#include <__utility/move.h>
2227
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24# pragma GCC system_header29# pragma GCC system_header
25#endif30#endif
2631
32_LIBCPP_PUSH_MACROS
33#include <__undef_macros>
34
27_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
2836
29template <class _InputIter>37#if _LIBCPP_STD_VER >= 20
30inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 typename iterator_traits<_InputIter>::difference_type38template <class _Iter>
31__distance(_InputIter __first, _InputIter __last, input_iterator_tag) {39using __iter_distance_t _LIBCPP_NODEBUG = std::iter_difference_t<_Iter>;
32 typename iterator_traits<_InputIter>::difference_type __r(0);40#else
33 for (; __first != __last; ++__first)41template <class _Iter>
34 ++__r;42using __iter_distance_t _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::difference_type;
35 return __r;43#endif
36}
3744
38template <class _RandIter>45template <class _RandIter, __enable_if_t<__has_random_access_iterator_category<_RandIter>::value, int> = 0>
39inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 typename iterator_traits<_RandIter>::difference_type46inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 __iter_distance_t<_RandIter>
40__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag) {47__distance(_RandIter __first, _RandIter __last) {
41 return __last - __first;48 return __last - __first;
42}49}
4350
51template <class _InputIter, class _Sent>
52inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 __iter_distance_t<_InputIter>
53__distance(_InputIter __first, _Sent __last) {
54 __iter_distance_t<_InputIter> __r(0);
55#if _LIBCPP_STD_VER >= 20
56 if constexpr (same_as<_InputIter, _Sent> && __is_segmented_iterator_v<_InputIter>) {
57 std::__for_each_segment(__first, __last, [&__r](auto __lfirst, auto __llast) {
58 __r += std::__distance(__lfirst, __llast);
59 });
60 } else
61#endif
62 {
63 for (; __first != __last; ++__first)
64 ++__r;
65 }
66 return __r;
67}
68
44template <class _InputIter>69template <class _InputIter>
45inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 typename iterator_traits<_InputIter>::difference_type70inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 typename iterator_traits<_InputIter>::difference_type
46distance(_InputIter __first, _InputIter __last) {71distance(_InputIter __first, _InputIter __last) {
47 return std::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());72 return std::__distance(__first, __last);
48}73}
4974
50#if _LIBCPP_STD_VER >= 2075#if _LIBCPP_STD_VER >= 20
...@@ -56,12 +81,7 @@ struct __distance {...@@ -56,12 +81,7 @@ struct __distance {
56 template <class _Ip, sentinel_for<_Ip> _Sp>81 template <class _Ip, sentinel_for<_Ip> _Sp>
57 requires(!sized_sentinel_for<_Sp, _Ip>)82 requires(!sized_sentinel_for<_Sp, _Ip>)
58 _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const {83 _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const {
59 iter_difference_t<_Ip> __n = 0;84 return std::__distance(std::move(__first), std::move(__last));
60 while (__first != __last) {
61 ++__first;
62 ++__n;
63 }
64 return __n;
65 }85 }
6686
67 template <class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>87 template <class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
...@@ -92,4 +112,6 @@ inline constexpr auto distance = __distance{};...@@ -92,4 +112,6 @@ inline constexpr auto distance = __distance{};
92112
93_LIBCPP_END_NAMESPACE_STD113_LIBCPP_END_NAMESPACE_STD
94114
115_LIBCPP_POP_MACROS
116
95#endif // _LIBCPP___ITERATOR_DISTANCE_H117#endif // _LIBCPP___ITERATOR_DISTANCE_H
lib/libcxx/include/__iterator/front_insert_iterator.h+1-7
...@@ -26,15 +26,9 @@ _LIBCPP_PUSH_MACROS...@@ -26,15 +26,9 @@ _LIBCPP_PUSH_MACROS
2626
27_LIBCPP_BEGIN_NAMESPACE_STD27_LIBCPP_BEGIN_NAMESPACE_STD
2828
29_LIBCPP_SUPPRESS_DEPRECATED_PUSH
30template <class _Container>29template <class _Container>
31class front_insert_iterator30class front_insert_iterator
32#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)31 : public __iterator_base<front_insert_iterator<_Container>, output_iterator_tag, void, void, void, void> {
33 : public iterator<output_iterator_tag, void, void, void, void>
34#endif
35{
36 _LIBCPP_SUPPRESS_DEPRECATED_POP
37
38protected:32protected:
39 _Container* container;33 _Container* container;
4034
lib/libcxx/include/__iterator/insert_iterator.h+1-7
...@@ -35,15 +35,9 @@ template <class _Container>...@@ -35,15 +35,9 @@ template <class _Container>
35using __insert_iterator_iter_t _LIBCPP_NODEBUG = typename _Container::iterator;35using __insert_iterator_iter_t _LIBCPP_NODEBUG = typename _Container::iterator;
36#endif36#endif
3737
38_LIBCPP_SUPPRESS_DEPRECATED_PUSH
39template <class _Container>38template <class _Container>
40class insert_iterator39class insert_iterator
41#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)40 : public __iterator_base<insert_iterator<_Container>, output_iterator_tag, void, void, void, void> {
42 : public iterator<output_iterator_tag, void, void, void, void>
43#endif
44{
45 _LIBCPP_SUPPRESS_DEPRECATED_POP
46
47protected:41protected:
48 _Container* container;42 _Container* container;
49 __insert_iterator_iter_t<_Container> iter;43 __insert_iterator_iter_t<_Container> iter;
lib/libcxx/include/__iterator/istream_iterator.h+6-7
...@@ -25,15 +25,14 @@...@@ -25,15 +25,14 @@
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2727
28_LIBCPP_SUPPRESS_DEPRECATED_PUSH
29template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>28template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
30class istream_iterator29class istream_iterator
31#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)30 : public __iterator_base<istream_iterator<_Tp, _CharT, _Traits, _Distance>,
32 : public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>31 input_iterator_tag,
33#endif32 _Tp,
34{33 _Distance,
35 _LIBCPP_SUPPRESS_DEPRECATED_POP34 const _Tp*,
3635 const _Tp&> {
37public:36public:
38 typedef input_iterator_tag iterator_category;37 typedef input_iterator_tag iterator_category;
39 typedef _Tp value_type;38 typedef _Tp value_type;
lib/libcxx/include/__iterator/istreambuf_iterator.h+6-7
...@@ -25,15 +25,14 @@...@@ -25,15 +25,14 @@
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2727
28_LIBCPP_SUPPRESS_DEPRECATED_PUSH
29template <class _CharT, class _Traits>28template <class _CharT, class _Traits>
30class istreambuf_iterator29class istreambuf_iterator
31#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)30 : public __iterator_base<istreambuf_iterator<_CharT, _Traits>,
32 : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type, _CharT*, _CharT>31 input_iterator_tag,
33#endif32 _CharT,
34{33 typename _Traits::off_type,
35 _LIBCPP_SUPPRESS_DEPRECATED_POP34 _CharT*,
3635 _CharT> {
37public:36public:
38 typedef input_iterator_tag iterator_category;37 typedef input_iterator_tag iterator_category;
39 typedef _CharT value_type;38 typedef _CharT value_type;
lib/libcxx/include/__iterator/iter_move.h+1-1
...@@ -40,7 +40,7 @@ void iter_move() = delete;...@@ -40,7 +40,7 @@ void iter_move() = delete;
4040
41template <class _Tp>41template <class _Tp>
42concept __unqualified_iter_move = __class_or_enum<remove_cvref_t<_Tp>> && requires(_Tp&& __t) {42concept __unqualified_iter_move = __class_or_enum<remove_cvref_t<_Tp>> && requires(_Tp&& __t) {
43 // NOLINTNEXTLINE(libcpp-robust-against-adl) iter_swap ADL calls should only be made through ranges::iter_swap43 // NOLINTNEXTLINE(libcpp-robust-against-adl) iter_move ADL calls should only be made through ranges::iter_move
44 iter_move(std::forward<_Tp>(__t));44 iter_move(std::forward<_Tp>(__t));
45};45};
4646
lib/libcxx/include/__iterator/iterator.h+13
...@@ -28,6 +28,19 @@ struct _LIBCPP_DEPRECATED_IN_CXX17 iterator {...@@ -28,6 +28,19 @@ struct _LIBCPP_DEPRECATED_IN_CXX17 iterator {
28 typedef _Category iterator_category;28 typedef _Category iterator_category;
29};29};
3030
31_LIBCPP_SUPPRESS_DEPRECATED_PUSH
32#ifdef _LIBCPP_ABI_NO_ITERATOR_BASES
33template <class _Derived>
34struct __no_iterator_base {};
35
36template <class _Derived, class _Category, class _Tp, class _Distance, class _Pointer, class _Reference>
37using __iterator_base _LIBCPP_NODEBUG = __no_iterator_base<_Derived>;
38#else
39template <class _Derived, class _Category, class _Tp, class _Distance, class _Pointer, class _Reference>
40using __iterator_base _LIBCPP_NODEBUG = iterator<_Category, _Tp, _Distance, _Pointer, _Reference>;
41#endif
42_LIBCPP_SUPPRESS_DEPRECATED_POP
43
31_LIBCPP_END_NAMESPACE_STD44_LIBCPP_END_NAMESPACE_STD
3245
33#endif // _LIBCPP___ITERATOR_ITERATOR_H46#endif // _LIBCPP___ITERATOR_ITERATOR_H
lib/libcxx/include/__iterator/iterator_traits.h+13-14
...@@ -420,44 +420,43 @@ using __has_exactly_bidirectional_iterator_category _LIBCPP_NODEBUG =...@@ -420,44 +420,43 @@ using __has_exactly_bidirectional_iterator_category _LIBCPP_NODEBUG =
420 !__has_iterator_category_convertible_to<_Tp, random_access_iterator_tag>::value>;420 !__has_iterator_category_convertible_to<_Tp, random_access_iterator_tag>::value>;
421421
422template <class _InputIterator>422template <class _InputIterator>
423using __iter_value_type _LIBCPP_NODEBUG = typename iterator_traits<_InputIterator>::value_type;423using __iterator_value_type _LIBCPP_NODEBUG = typename iterator_traits<_InputIterator>::value_type;
424424
425#if _LIBCPP_STD_VER >= 23425#if _LIBCPP_STD_VER >= 23
426template <class _InputIterator>426template <class _InputIterator>
427using __iter_key_type _LIBCPP_NODEBUG = remove_const_t<tuple_element_t<0, __iter_value_type<_InputIterator>>>;427using __iter_key_type _LIBCPP_NODEBUG = remove_const_t<tuple_element_t<0, __iterator_value_type<_InputIterator>>>;
428428
429template <class _InputIterator>429template <class _InputIterator>
430using __iter_mapped_type _LIBCPP_NODEBUG = tuple_element_t<1, __iter_value_type<_InputIterator>>;430using __iter_mapped_type _LIBCPP_NODEBUG = tuple_element_t<1, __iterator_value_type<_InputIterator>>;
431431
432template <class _InputIterator>432template <class _InputIterator>
433using __iter_to_alloc_type _LIBCPP_NODEBUG =433using __iter_to_alloc_type _LIBCPP_NODEBUG =
434 pair<const tuple_element_t<0, __iter_value_type<_InputIterator>>,434 pair<const tuple_element_t<0, __iterator_value_type<_InputIterator>>,
435 tuple_element_t<1, __iter_value_type<_InputIterator>>>;435 tuple_element_t<1, __iterator_value_type<_InputIterator>>>;
436#else436#else
437template <class _InputIterator>437template <class _InputIterator>
438using __iter_key_type _LIBCPP_NODEBUG =438using __iter_key_type _LIBCPP_NODEBUG = __remove_const_t<typename __iterator_value_type<_InputIterator>::first_type>;
439 __remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
440439
441template <class _InputIterator>440template <class _InputIterator>
442using __iter_mapped_type _LIBCPP_NODEBUG = typename iterator_traits<_InputIterator>::value_type::second_type;441using __iter_mapped_type _LIBCPP_NODEBUG = typename __iterator_value_type<_InputIterator>::second_type;
443442
444template <class _InputIterator>443template <class _InputIterator>
445using __iter_to_alloc_type _LIBCPP_NODEBUG =444using __iter_to_alloc_type _LIBCPP_NODEBUG =
446 pair<const typename iterator_traits<_InputIterator>::value_type::first_type,445 pair<const typename __iterator_value_type<_InputIterator>::first_type,
447 typename iterator_traits<_InputIterator>::value_type::second_type>;446 typename __iterator_value_type<_InputIterator>::second_type>;
448#endif // _LIBCPP_STD_VER >= 23447#endif // _LIBCPP_STD_VER >= 23
449448
450template <class _Iter>449template <class _Iter>
451using __iterator_category_type _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::iterator_category;450using __iterator_iterator_category _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::iterator_category;
452451
453template <class _Iter>452template <class _Iter>
454using __iterator_pointer_type _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::pointer;453using __iterator_pointer _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::pointer;
455454
456template <class _Iter>455template <class _Iter>
457using __iter_diff_t _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::difference_type;456using __iterator_difference_type _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::difference_type;
458457
459template <class _Iter>458template <class _Iter>
460using __iter_reference _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::reference;459using __iterator_reference _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::reference;
461460
462#if _LIBCPP_STD_VER >= 20461#if _LIBCPP_STD_VER >= 20
463462
lib/libcxx/include/__iterator/ostream_iterator.h+1-7
...@@ -24,15 +24,9 @@...@@ -24,15 +24,9 @@
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2626
27_LIBCPP_SUPPRESS_DEPRECATED_PUSH
28template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >27template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
29class ostream_iterator28class ostream_iterator
30#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)29 : public __iterator_base<ostream_iterator<_Tp, _CharT, _Traits>, output_iterator_tag, void, void, void, void> {
31 : public iterator<output_iterator_tag, void, void, void, void>
32#endif
33{
34 _LIBCPP_SUPPRESS_DEPRECATED_POP
35
36public:30public:
37 typedef output_iterator_tag iterator_category;31 typedef output_iterator_tag iterator_category;
38 typedef void value_type;32 typedef void value_type;
lib/libcxx/include/__iterator/ostreambuf_iterator.h+1-7
...@@ -25,15 +25,9 @@...@@ -25,15 +25,9 @@
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2727
28_LIBCPP_SUPPRESS_DEPRECATED_PUSH
29template <class _CharT, class _Traits>28template <class _CharT, class _Traits>
30class ostreambuf_iterator29class ostreambuf_iterator
31#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)30 : public __iterator_base<ostreambuf_iterator<_CharT, _Traits>, output_iterator_tag, void, void, void, void> {
32 : public iterator<output_iterator_tag, void, void, void, void>
33#endif
34{
35 _LIBCPP_SUPPRESS_DEPRECATED_POP
36
37public:31public:
38 typedef output_iterator_tag iterator_category;32 typedef output_iterator_tag iterator_category;
39 typedef void value_type;33 typedef void value_type;
lib/libcxx/include/__iterator/reverse_iterator.h+8-13
...@@ -46,21 +46,16 @@...@@ -46,21 +46,16 @@
4646
47_LIBCPP_BEGIN_NAMESPACE_STD47_LIBCPP_BEGIN_NAMESPACE_STD
4848
49_LIBCPP_SUPPRESS_DEPRECATED_PUSH
50template <class _Iter>49template <class _Iter>
51class reverse_iterator50class reverse_iterator
52#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)51 : public __iterator_base<reverse_iterator<_Iter>,
53 : public iterator<typename iterator_traits<_Iter>::iterator_category,52 typename iterator_traits<_Iter>::iterator_category,
54 typename iterator_traits<_Iter>::value_type,53 typename iterator_traits<_Iter>::value_type,
55 typename iterator_traits<_Iter>::difference_type,54 typename iterator_traits<_Iter>::difference_type,
56 typename iterator_traits<_Iter>::pointer,55 typename iterator_traits<_Iter>::pointer,
57 typename iterator_traits<_Iter>::reference>56 typename iterator_traits<_Iter>::reference> {
58#endif
59{
60 _LIBCPP_SUPPRESS_DEPRECATED_POP
61
62private:57private:
63#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES58#ifndef _LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER
64 _Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break59 _Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break
65#endif60#endif
6661
...@@ -91,7 +86,7 @@ public:...@@ -91,7 +86,7 @@ public:
91 using reference = typename iterator_traits<_Iter>::reference;86 using reference = typename iterator_traits<_Iter>::reference;
92#endif87#endif
9388
94#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES89#ifndef _LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER
95 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator() : __t_(), current() {}90 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator() : __t_(), current() {}
9691
97 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit reverse_iterator(_Iter __x) : __t_(__x), current(__x) {}92 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit reverse_iterator(_Iter __x) : __t_(__x), current(__x) {}
lib/libcxx/include/__iterator/segmented_iterator.h+3-8
...@@ -67,18 +67,13 @@ struct __segmented_iterator_traits;...@@ -67,18 +67,13 @@ struct __segmented_iterator_traits;
67*/67*/
6868
69template <class _Tp, size_t = 0>69template <class _Tp, size_t = 0>
70struct __has_specialization : false_type {};70inline const bool __has_specialization_v = false;
7171
72template <class _Tp>72template <class _Tp>
73struct __has_specialization<_Tp, sizeof(_Tp) * 0> : true_type {};73inline const bool __has_specialization_v<_Tp, sizeof(_Tp) * 0> = true;
7474
75template <class _Iterator>75template <class _Iterator>
76using __is_segmented_iterator _LIBCPP_NODEBUG = __has_specialization<__segmented_iterator_traits<_Iterator> >;76inline const bool __is_segmented_iterator_v = __has_specialization_v<__segmented_iterator_traits<_Iterator> >;
77
78template <class _SegmentedIterator>
79struct __has_random_access_local_iterator
80 : __has_random_access_iterator_category<
81 typename __segmented_iterator_traits< _SegmentedIterator >::__local_iterator > {};
8277
83_LIBCPP_END_NAMESPACE_STD78_LIBCPP_END_NAMESPACE_STD
8479
lib/libcxx/include/__iterator/static_bounded_iter.h+3-3
...@@ -99,9 +99,9 @@ struct __static_bounded_iter {...@@ -99,9 +99,9 @@ struct __static_bounded_iter {
9999
100 template <class _OtherIterator,100 template <class _OtherIterator,
101 __enable_if_t<101 __enable_if_t<
102 _And< is_convertible<const _OtherIterator&, _Iterator>,102 _And<is_convertible<const _OtherIterator&, _Iterator>,
103 _Or<is_same<reference, __iter_reference<_OtherIterator> >,103 _Or<is_same<reference, __iterator_reference<_OtherIterator> >,
104 is_same<reference, __make_const_lvalue_ref<__iter_reference<_OtherIterator> > > > >::value,104 is_same<reference, __make_const_lvalue_ref<__iterator_reference<_OtherIterator> > > > >::value,
105 int> = 0>105 int> = 0>
106 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR106 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
107 __static_bounded_iter(__static_bounded_iter<_OtherIterator, _Size> const& __other) _NOEXCEPT107 __static_bounded_iter(__static_bounded_iter<_OtherIterator, _Size> const& __other) _NOEXCEPT
lib/libcxx/include/__iterator/wrap_iter.h+8-6
...@@ -49,12 +49,12 @@ private:...@@ -49,12 +49,12 @@ private:
4949
50public:50public:
51 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter() _NOEXCEPT : __i_() {}51 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter() _NOEXCEPT : __i_() {}
52 template <52 template <class _OtherIter,
53 class _OtherIter,53 __enable_if_t<
54 __enable_if_t< _And< is_convertible<const _OtherIter&, _Iter>,54 _And<is_convertible<const _OtherIter&, _Iter>,
55 _Or<is_same<reference, __iter_reference<_OtherIter> >,55 _Or<is_same<reference, __iterator_reference<_OtherIter> >,
56 is_same<reference, __make_const_lvalue_ref<__iter_reference<_OtherIter> > > > >::value,56 is_same<reference, __make_const_lvalue_ref<__iterator_reference<_OtherIter> > > > >::value,
57 int> = 0>57 int> = 0>
58 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter(const __wrap_iter<_OtherIter>& __u) _NOEXCEPT58 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter(const __wrap_iter<_OtherIter>& __u) _NOEXCEPT
59 : __i_(__u.__i_) {}59 : __i_(__u.__i_) {}
60 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT { return *__i_; }60 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT { return *__i_; }
...@@ -117,6 +117,8 @@ private:...@@ -117,6 +117,8 @@ private:
117 friend class span;117 friend class span;
118 template <class _Tp, size_t _Size>118 template <class _Tp, size_t _Size>
119 friend struct array;119 friend struct array;
120 template <class _Tp, class>
121 friend struct __optional_iterator;
120};122};
121123
122template <class _Iter1>124template <class _Iter1>
lib/libcxx/include/__locale+3-10
...@@ -57,9 +57,8 @@ _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale&);...@@ -57,9 +57,8 @@ _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale&);
57class _LIBCPP_EXPORTED_FROM_ABI locale {57class _LIBCPP_EXPORTED_FROM_ABI locale {
58public:58public:
59 // locale is essentially a shared_ptr that doesn't support weak_ptrs and never got a move constructor,59 // locale is essentially a shared_ptr that doesn't support weak_ptrs and never got a move constructor,
60 // so it is trivially relocatable. Like shared_ptr, it is also replaceable.60 // so it is trivially relocatable.
61 using __trivially_relocatable _LIBCPP_NODEBUG = locale;61 using __trivially_relocatable _LIBCPP_NODEBUG = locale;
62 using __replaceable _LIBCPP_NODEBUG = locale;
6362
64 // types:63 // types:
65 class _LIBCPP_EXPORTED_FROM_ABI facet;64 class _LIBCPP_EXPORTED_FROM_ABI facet;
...@@ -389,7 +388,7 @@ public:...@@ -389,7 +388,7 @@ public:
389 static const mask xdigit = _ISXDIGIT;388 static const mask xdigit = _ISXDIGIT;
390 static const mask blank = _ISBLANK;389 static const mask blank = _ISBLANK;
391 static const mask __regex_word = 0x8000;390 static const mask __regex_word = 0x8000;
392# elif defined(_NEWLIB_VERSION)391# elif _LIBCPP_LIBC_NEWLIB
393 // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.392 // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
394 typedef char mask;393 typedef char mask;
395 // In case char is signed, static_cast is needed to avoid warning on394 // In case char is signed, static_cast is needed to avoid warning on
...@@ -585,7 +584,7 @@ public:...@@ -585,7 +584,7 @@ public:
585# ifdef _CACHED_RUNES584# ifdef _CACHED_RUNES
586 static const size_t table_size = _CACHED_RUNES;585 static const size_t table_size = _CACHED_RUNES;
587# else586# else
588 static const size_t table_size = 256; // FIXME: Don't hardcode this.587 static const size_t table_size = 256;
589# endif588# endif
590 _LIBCPP_HIDE_FROM_ABI const mask* table() const _NOEXCEPT { return __tab_; }589 _LIBCPP_HIDE_FROM_ABI const mask* table() const _NOEXCEPT { return __tab_; }
591 static const mask* classic_table() _NOEXCEPT;590 static const mask* classic_table() _NOEXCEPT;
...@@ -1478,9 +1477,6 @@ public:...@@ -1478,9 +1477,6 @@ public:
14781477
1479protected:1478protected:
1480 ~numpunct_byname() override;1479 ~numpunct_byname() override;
1481
1482private:
1483 void __init(const char*);
1484};1480};
14851481
1486# if _LIBCPP_HAS_WIDE_CHARACTERS1482# if _LIBCPP_HAS_WIDE_CHARACTERS
...@@ -1495,9 +1491,6 @@ public:...@@ -1495,9 +1491,6 @@ public:
14951491
1496protected:1492protected:
1497 ~numpunct_byname() override;1493 ~numpunct_byname() override;
1498
1499private:
1500 void __init(const char*);
1501};1494};
1502# endif // _LIBCPP_HAS_WIDE_CHARACTERS1495# endif // _LIBCPP_HAS_WIDE_CHARACTERS
15031496
lib/libcxx/include/__locale_dir/locale_base_api.h+5-28
...@@ -57,15 +57,11 @@...@@ -57,15 +57,11 @@
57// float __strtof(const char*, char**, __locale_t);57// float __strtof(const char*, char**, __locale_t);
58// double __strtod(const char*, char**, __locale_t);58// double __strtod(const char*, char**, __locale_t);
59// long double __strtold(const char*, char**, __locale_t);59// long double __strtold(const char*, char**, __locale_t);
60// long long __strtoll(const char*, char**, __locale_t);
61// unsigned long long __strtoull(const char*, char**, __locale_t);
62// }60// }
63//61//
64// Character manipulation functions62// Character manipulation functions
65// --------------------------------63// --------------------------------
66// namespace __locale {64// namespace __locale {
67// int __isdigit(int, __locale_t); // required by the headers
68// int __isxdigit(int, __locale_t); // required by the headers
69// int __toupper(int, __locale_t);65// int __toupper(int, __locale_t);
70// int __tolower(int, __locale_t);66// int __tolower(int, __locale_t);
71// int __strcoll(const char*, const char*, __locale_t);67// int __strcoll(const char*, const char*, __locale_t);
...@@ -106,7 +102,6 @@...@@ -106,7 +102,6 @@
106//102//
107// 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
108// int __asprintf(char**, __locale_t, const char*, ...); // required by the headers104// int __asprintf(char**, __locale_t, const char*, ...); // required by the headers
109// int __sscanf(const char*, __locale_t, const char*, ...); // required by the headers
110// }105// }
111106
112#if _LIBCPP_HAS_LOCALIZATION107#if _LIBCPP_HAS_LOCALIZATION
...@@ -115,7 +110,6 @@...@@ -115,7 +110,6 @@
115# include <__locale_dir/support/apple.h>110# include <__locale_dir/support/apple.h>
116# elif defined(__FreeBSD__)111# elif defined(__FreeBSD__)
117# include <__locale_dir/support/freebsd.h>112# include <__locale_dir/support/freebsd.h>
118/* zig patch: https://github.com/llvm/llvm-project/pull/143055 */
119# elif defined(__NetBSD__)113# elif defined(__NetBSD__)
120# include <__locale_dir/support/netbsd.h>114# include <__locale_dir/support/netbsd.h>
121# elif defined(_LIBCPP_MSVCRT_LIKE)115# elif defined(_LIBCPP_MSVCRT_LIKE)
...@@ -124,20 +118,20 @@...@@ -124,20 +118,20 @@
124# include <__locale_dir/support/fuchsia.h>118# include <__locale_dir/support/fuchsia.h>
125# elif defined(__linux__)119# elif defined(__linux__)
126# include <__locale_dir/support/linux.h>120# include <__locale_dir/support/linux.h>
121# elif _LIBCPP_LIBC_NEWLIB
122# include <__locale_dir/support/newlib.h>
123# elif defined(_AIX)
124# include <__locale_dir/support/aix.h>
127# else125# else
128126
129// TODO: This is a temporary definition to bridge between the old way we defined the locale base API127// TODO: This is a temporary definition to bridge between the old way we defined the locale base API
130// (by providing global non-reserved names) and the new API. As we move individual platforms128// (by providing global non-reserved names) and the new API. As we move individual platforms
131// towards the new way of defining the locale base API, this should disappear since each platform129// towards the new way of defining the locale base API, this should disappear since each platform
132// will define those directly.130// will define those directly.
133# if defined(_AIX) || defined(__MVS__)131# if defined(__MVS__)
134# include <__locale_dir/locale_base_api/ibm.h>132# include <__locale_dir/locale_base_api/ibm.h>
135# elif defined(__ANDROID__)
136# include <__locale_dir/locale_base_api/android.h>
137# elif defined(__OpenBSD__)133# elif defined(__OpenBSD__)
138# include <__locale_dir/locale_base_api/openbsd.h>134# include <__locale_dir/locale_base_api/openbsd.h>
139# elif defined(__wasi__) || _LIBCPP_HAS_MUSL_LIBC
140# include <__locale_dir/locale_base_api/musl.h>
141# endif135# endif
142136
143# include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h>137# include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h>
...@@ -197,21 +191,9 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __...@@ -197,21 +191,9 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __
197 return strtold_l(__nptr, __endptr, __loc);191 return strtold_l(__nptr, __endptr, __loc);
198}192}
199193
200inline _LIBCPP_HIDE_FROM_ABI long long __strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
201 return strtoll_l(__nptr, __endptr, __base, __loc);
202}
203
204inline _LIBCPP_HIDE_FROM_ABI unsigned long long
205__strtoull(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
206 return strtoull_l(__nptr, __endptr, __base, __loc);
207}
208
209//194//
210// Character manipulation functions195// Character manipulation functions
211//196//
212inline _LIBCPP_HIDE_FROM_ABI int __isdigit(int __ch, __locale_t __loc) { return isdigit_l(__ch, __loc); }
213inline _LIBCPP_HIDE_FROM_ABI int __isxdigit(int __ch, __locale_t __loc) { return isxdigit_l(__ch, __loc); }
214
215# if defined(_LIBCPP_BUILDING_LIBRARY)197# if defined(_LIBCPP_BUILDING_LIBRARY)
216inline _LIBCPP_HIDE_FROM_ABI int __strcoll(const char* __s1, const char* __s2, __locale_t __loc) {198inline _LIBCPP_HIDE_FROM_ABI int __strcoll(const char* __s1, const char* __s2, __locale_t __loc) {
217 return strcoll_l(__s1, __s2, __loc);199 return strcoll_l(__s1, __s2, __loc);
...@@ -307,11 +289,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __...@@ -307,11 +289,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __
307 char** __s, __locale_t __loc, const char* __format, _Args&&... __args) {289 char** __s, __locale_t __loc, const char* __format, _Args&&... __args) {
308 return std::__libcpp_asprintf_l(__s, __loc, __format, std::forward<_Args>(__args)...);290 return std::__libcpp_asprintf_l(__s, __loc, __format, std::forward<_Args>(__args)...);
309}291}
310template <class... _Args>
311_LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __sscanf(
312 const char* __s, __locale_t __loc, const char* __format, _Args&&... __args) {
313 return std::__libcpp_sscanf_l(__s, __loc, __format, std::forward<_Args>(__args)...);
314}
315_LIBCPP_DIAGNOSTIC_POP292_LIBCPP_DIAGNOSTIC_POP
316# undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT293# undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
317294
lib/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h-10
...@@ -125,16 +125,6 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __libcpp_asprintf_l(...@@ -125,16 +125,6 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __libcpp_asprintf_l(
125 return __res;125 return __res;
126}126}
127127
128inline _LIBCPP_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __libcpp_sscanf_l(
129 const char* __s, locale_t __l, const char* __format, ...) {
130 va_list __va;
131 va_start(__va, __format);
132 __locale_guard __current(__l);
133 int __res = vsscanf(__s, __format, __va);
134 va_end(__va);
135 return __res;
136}
137
138_LIBCPP_END_NAMESPACE_STD128_LIBCPP_END_NAMESPACE_STD
139129
140#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H130#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H
lib/libcxx/include/__locale_dir/messages.h+1-1
...@@ -22,7 +22,7 @@...@@ -22,7 +22,7 @@
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__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)25# if !defined(__BIONIC__) && !_LIBCPP_LIBC_NEWLIB && !defined(__EMSCRIPTEN__)
26# define _LIBCPP_HAS_CATOPEN 126# define _LIBCPP_HAS_CATOPEN 1
27# include <nl_types.h>27# include <nl_types.h>
28# else28# else
lib/libcxx/include/__locale_dir/money.h+2-2
...@@ -433,7 +433,7 @@ bool money_get<_CharT, _InputIterator>::__do_get(...@@ -433,7 +433,7 @@ bool money_get<_CharT, _InputIterator>::__do_get(
433 __err |= ios_base::failbit;433 __err |= ios_base::failbit;
434 return false;434 return false;
435 }435 }
436 for (++__b; __fd > 0; --__fd, ++__b) {436 for (++__b; __fd > 0; --__fd, (void)++__b) {
437 if (__b == __e || !__ct.is(ctype_base::digit, *__b)) {437 if (__b == __e || !__ct.is(ctype_base::digit, *__b)) {
438 __err |= ios_base::failbit;438 __err |= ios_base::failbit;
439 return false;439 return false;
...@@ -451,7 +451,7 @@ bool money_get<_CharT, _InputIterator>::__do_get(...@@ -451,7 +451,7 @@ bool money_get<_CharT, _InputIterator>::__do_get(
451 }451 }
452 }452 }
453 if (__trailing_sign) {453 if (__trailing_sign) {
454 for (unsigned __i = 1; __i < __trailing_sign->size(); ++__i, ++__b) {454 for (unsigned __i = 1; __i < __trailing_sign->size(); ++__i, (void)++__b) {
455 if (__b == __e || *__b != (*__trailing_sign)[__i]) {455 if (__b == __e || *__b != (*__trailing_sign)[__i]) {
456 __err |= ios_base::failbit;456 __err |= ios_base::failbit;
457 return false;457 return false;
lib/libcxx/include/__locale_dir/num.h+190-243
...@@ -9,8 +9,10 @@...@@ -9,8 +9,10 @@
9#ifndef _LIBCPP___LOCALE_DIR_NUM_H9#ifndef _LIBCPP___LOCALE_DIR_NUM_H
10#define _LIBCPP___LOCALE_DIR_NUM_H10#define _LIBCPP___LOCALE_DIR_NUM_H
1111
12#include <__algorithm/copy.h>
12#include <__algorithm/find.h>13#include <__algorithm/find.h>
13#include <__algorithm/reverse.h>14#include <__algorithm/reverse.h>
15#include <__algorithm/simd_utils.h>
14#include <__charconv/to_chars_integral.h>16#include <__charconv/to_chars_integral.h>
15#include <__charconv/traits.h>17#include <__charconv/traits.h>
16#include <__config>18#include <__config>
...@@ -22,6 +24,7 @@...@@ -22,6 +24,7 @@
22#include <__locale_dir/scan_keyword.h>24#include <__locale_dir/scan_keyword.h>
23#include <__memory/unique_ptr.h>25#include <__memory/unique_ptr.h>
24#include <__system_error/errc.h>26#include <__system_error/errc.h>
27#include <__type_traits/is_signed.h>
25#include <cerrno>28#include <cerrno>
26#include <ios>29#include <ios>
27#include <streambuf>30#include <streambuf>
...@@ -46,9 +49,9 @@ struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base {...@@ -46,9 +49,9 @@ struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base {
46 static int __get_base(ios_base&);49 static int __get_base(ios_base&);
47 static const char __src[33]; // "0123456789abcdefABCDEFxX+-pPiInN"50 static const char __src[33]; // "0123456789abcdefABCDEFxX+-pPiInN"
48 // count of leading characters in __src used for parsing integers ("012..X+-")51 // count of leading characters in __src used for parsing integers ("012..X+-")
49 static const size_t __int_chr_cnt = 26;52 static inline const size_t __int_chr_cnt = 26;
50 // count of leading characters in __src used for parsing floating-point values ("012..-pP")53 // count of leading characters in __src used for parsing floating-point values ("012..-pP")
51 static const size_t __fp_chr_cnt = 28;54 static inline const size_t __fp_chr_cnt = 28;
52};55};
5356
54template <class _CharT>57template <class _CharT>
...@@ -71,7 +74,8 @@ struct __num_get : protected __num_get_base {...@@ -71,7 +74,8 @@ struct __num_get : protected __num_get_base {
7174
72 [[__deprecated__("This exists only for ABI compatibility")]] static string75 [[__deprecated__("This exists only for ABI compatibility")]] static string
73 __stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep);76 __stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep);
74 static int __stage2_int_loop(77
78 [[__deprecated__("This exists only for ABI compatibility")]] static int __stage2_int_loop(
75 _CharT __ct,79 _CharT __ct,
76 int __base,80 int __base,
77 char* __a,81 char* __a,
...@@ -83,11 +87,24 @@ struct __num_get : protected __num_get_base {...@@ -83,11 +87,24 @@ struct __num_get : protected __num_get_base {
83 unsigned*& __g_end,87 unsigned*& __g_end,
84 _CharT* __atoms);88 _CharT* __atoms);
8589
86 _LIBCPP_HIDE_FROM_ABI static string __stage2_int_prep(ios_base& __iob, _CharT& __thousands_sep) {90 _LIBCPP_HIDE_FROM_ABI static ptrdiff_t __atoms_offset(const _CharT* __atoms, _CharT __val) {
87 locale __loc = __iob.getloc();91 // TODO: Remove the manual vectorization once https://llvm.org/PR168551 is resolved
88 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);92# if _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS
89 __thousands_sep = __np.thousands_sep();93 if constexpr (is_same<_CharT, char>::value) {
90 return __np.grouping();94 // TODO(LLVM 24): This can be removed, since -Wpsabi doesn't warn on [[gnu::always_inline]] functions anymore.
95 _LIBCPP_DIAGNOSTIC_PUSH
96 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi")
97 using __vec = __simd_vector<char, 32>;
98 __vec __chars = std::__broadcast<__vec>(__val);
99 __vec __cmp = std::__partial_load<__vec, __int_chr_cnt>(__atoms);
100 auto __res = __chars == __cmp;
101 if (std::__none_of(__res))
102 return __int_chr_cnt;
103 return std::min(__int_chr_cnt, std::__find_first_set(__res));
104 _LIBCPP_DIAGNOSTIC_POP
105 }
106# endif
107 return std::find(__atoms, __atoms + __int_chr_cnt, __val) - __atoms;
91 }108 }
92109
93 _LIBCPP_HIDE_FROM_ABI const _CharT* __do_widen(ios_base& __iob, _CharT* __atoms) const {110 _LIBCPP_HIDE_FROM_ABI const _CharT* __do_widen(ios_base& __iob, _CharT* __atoms) const {
...@@ -120,54 +137,6 @@ string __num_get<_CharT>::__stage2_float_prep(...@@ -120,54 +137,6 @@ string __num_get<_CharT>::__stage2_float_prep(
120 return __np.grouping();137 return __np.grouping();
121}138}
122139
123template <class _CharT>
124int __num_get<_CharT>::__stage2_int_loop(
125 _CharT __ct,
126 int __base,
127 char* __a,
128 char*& __a_end,
129 unsigned& __dc,
130 _CharT __thousands_sep,
131 const string& __grouping,
132 unsigned* __g,
133 unsigned*& __g_end,
134 _CharT* __atoms) {
135 if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25])) {
136 *__a_end++ = __ct == __atoms[24] ? '+' : '-';
137 __dc = 0;
138 return 0;
139 }
140 if (__grouping.size() != 0 && __ct == __thousands_sep) {
141 if (__g_end - __g < __num_get_buf_sz) {
142 *__g_end++ = __dc;
143 __dc = 0;
144 }
145 return 0;
146 }
147 ptrdiff_t __f = std::find(__atoms, __atoms + __int_chr_cnt, __ct) - __atoms;
148 if (__f >= 24)
149 return -1;
150 switch (__base) {
151 case 8:
152 case 10:
153 if (__f >= __base)
154 return -1;
155 break;
156 case 16:
157 if (__f < 22)
158 break;
159 if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0') {
160 __dc = 0;
161 *__a_end++ = __src[__f];
162 return 0;
163 }
164 return -1;
165 }
166 *__a_end++ = __src[__f];
167 ++__dc;
168 return 0;
169}
170
171template <class _CharT>140template <class _CharT>
172int __num_get<_CharT>::__stage2_float_loop(141int __num_get<_CharT>::__stage2_float_loop(
173 _CharT __ct,142 _CharT __ct,
...@@ -272,65 +241,6 @@ _LIBCPP_HIDE_FROM_ABI _Tp __num_get_float(const char* __a, const char* __a_end,...@@ -272,65 +241,6 @@ _LIBCPP_HIDE_FROM_ABI _Tp __num_get_float(const char* __a, const char* __a_end,
272 return 0;241 return 0;
273}242}
274243
275template <class _Tp>
276_LIBCPP_HIDE_FROM_ABI _Tp
277__num_get_signed_integral(const char* __a, const char* __a_end, ios_base::iostate& __err, int __base) {
278 if (__a != __a_end) {
279 __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
280 errno = 0;
281 char* __p2;
282 long long __ll = __locale::__strtoll(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
283 __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
284 if (__current_errno == 0)
285 errno = __save_errno;
286 if (__p2 != __a_end) {
287 __err = ios_base::failbit;
288 return 0;
289 } else if (__current_errno == ERANGE || __ll < numeric_limits<_Tp>::min() || numeric_limits<_Tp>::max() < __ll) {
290 __err = ios_base::failbit;
291 if (__ll > 0)
292 return numeric_limits<_Tp>::max();
293 else
294 return numeric_limits<_Tp>::min();
295 }
296 return static_cast<_Tp>(__ll);
297 }
298 __err = ios_base::failbit;
299 return 0;
300}
301
302template <class _Tp>
303_LIBCPP_HIDE_FROM_ABI _Tp
304__num_get_unsigned_integral(const char* __a, const char* __a_end, ios_base::iostate& __err, int __base) {
305 if (__a != __a_end) {
306 const bool __negate = *__a == '-';
307 if (__negate && ++__a == __a_end) {
308 __err = ios_base::failbit;
309 return 0;
310 }
311 __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
312 errno = 0;
313 char* __p2;
314 unsigned long long __ll = __locale::__strtoull(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
315 __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
316 if (__current_errno == 0)
317 errno = __save_errno;
318 if (__p2 != __a_end) {
319 __err = ios_base::failbit;
320 return 0;
321 } else if (__current_errno == ERANGE || numeric_limits<_Tp>::max() < __ll) {
322 __err = ios_base::failbit;
323 return numeric_limits<_Tp>::max();
324 }
325 _Tp __res = static_cast<_Tp>(__ll);
326 if (__negate)
327 __res = -__res;
328 return __res;
329 }
330 __err = ios_base::failbit;
331 return 0;
332}
333
334template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >244template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
335class num_get : public locale::facet, private __num_get<_CharT> {245class num_get : public locale::facet, private __num_get<_CharT> {
336public:246public:
...@@ -468,137 +378,196 @@ protected:...@@ -468,137 +378,196 @@ protected:
468 return __b;378 return __b;
469 }379 }
470380
471 template <class _Signed>381 template <class _MaybeSigned>
472 _LIBCPP_HIDE_FROM_ABI iter_type382 iter_type __do_get_integral(
473 __do_get_signed(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Signed& __v) const {383 iter_type __first, iter_type __last, ios_base& __iob, ios_base::iostate& __err, _MaybeSigned& __v) const {
384 using _Unsigned = __make_unsigned_t<_MaybeSigned>;
385
474 // Stage 1386 // Stage 1
475 int __base = this->__get_base(__iob);387 int __base = this->__get_base(__iob);
476 // Stage 2388
477 char_type __thousands_sep;389 // Stages 2 & 3
478 const int __atoms_size = __num_get_base::__int_chr_cnt;390 // These are combined into a single step where we parse the characters and calculate the value in one go instead of
479 char_type __atoms1[__atoms_size];391 // storing the relevant characters first (in an allocated buffer) and parse the characters after we extracted them.
480 const char_type* __atoms = this->__do_widen(__iob, __atoms1);392 // This makes the whole process significantly faster, since we avoid potential allocations and copies.
481 string __grouping = this->__stage2_int_prep(__iob, __thousands_sep);393
482 string __buf;394 const auto& __numpunct = use_facet<numpunct<_CharT> >(__iob.getloc());
483 __buf.resize(__buf.capacity());395 char_type __thousands_sep = __numpunct.thousands_sep();
484 char* __a = &__buf[0];396 string __grouping = __numpunct.grouping();
485 char* __a_end = __a;397
398 char_type __atoms_buffer[__num_get_base::__int_chr_cnt];
399 const char_type* __atoms = this->__do_widen(__iob, __atoms_buffer);
486 unsigned __g[__num_get_base::__num_get_buf_sz];400 unsigned __g[__num_get_base::__num_get_buf_sz];
487 unsigned* __g_end = __g;401 unsigned* __g_end = __g;
488 unsigned __dc = 0;402 unsigned __dc = 0;
489 for (; __b != __e; ++__b) {403
490 if (__a_end == __a + __buf.size()) {404 if (__first == __last) {
491 size_t __tmp = __buf.size();405 __err |= ios_base::eofbit | ios_base::failbit;
492 __buf.resize(2 * __buf.size());406 __v = 0;
493 __buf.resize(__buf.capacity());407 return __first;
494 __a = &__buf[0];408 }
495 __a_end = __a + __tmp;409
410 while (!__grouping.empty() && *__first == __thousands_sep) {
411 ++__first;
412 if (__g_end - __g < this->__num_get_buf_sz)
413 *__g_end++ = 0;
414 }
415
416 bool __negate = false;
417 // __c == '+' || __c == '-'
418 if (auto __c = *__first; __c == __atoms[24] || __c == __atoms[25]) {
419 __negate = __c == __atoms[25];
420 ++__first;
421 }
422
423 if (__first == __last) {
424 __err |= ios_base::eofbit | ios_base::failbit;
425 __v = 0;
426 return __first;
427 }
428
429 bool __parsed_num = false;
430
431 // If we don't have a pre-set base, figure it out and swallow any prefix
432 if (__base == 0) {
433 auto __c = *__first;
434 // __c == '0'
435 if (__c == __atoms[0]) {
436 ++__first;
437 if (__first == __last) {
438 __err |= ios_base::eofbit;
439 __v = 0;
440 return __first;
441 }
442 // __c2 == 'x' || __c2 == 'X'
443 if (auto __c2 = *__first; __c2 == __atoms[22] || __c2 == __atoms[23]) {
444 __base = 16;
445 ++__first;
446 } else {
447 __base = 8;
448 __parsed_num = true; // We only swallowed '0', so we've started to parse a number
449 }
450 } else {
451 __base = 10;
452 }
453
454 // If the base has been specified explicitly, try to swallow the appropriate prefix. We only need to do something
455 // special for hex, since decimal has no prefix and octal's prefix is '0', which doesn't change the value that
456 // we'll parse if we don't swallow it.
457 } else if (__base == 16) {
458 // Try to swallow '0x'
459
460 // *__first == '0'
461 if (*__first == __atoms[0]) {
462 ++__first;
463 if (__first == __last) {
464 __err |= ios_base::eofbit;
465 __v = 0;
466 return __first;
467 }
468 // __c == 'x' || __c == 'X'
469 if (auto __c = *__first; __c == __atoms[22] || __c == __atoms[23])
470 ++__first;
471 else
472 __parsed_num = true; // We only swallowed '0', so we've started to parse a number
496 }473 }
497 if (this->__stage2_int_loop(
498 *__b,
499 __base,
500 __a,
501 __a_end,
502 __dc,
503 __thousands_sep,
504 __grouping,
505 __g,
506 __g_end,
507 const_cast<char_type*>(__atoms)))
508 break;
509 }474 }
510 if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz)
511 *__g_end++ = __dc;
512 // Stage 3
513 __v = std::__num_get_signed_integral<_Signed>(__a, __a_end, __err, __base);
514 // Digit grouping checked
515 __check_grouping(__grouping, __g, __g_end, __err);
516 // EOF checked
517 if (__b == __e)
518 __err |= ios_base::eofbit;
519 return __b;
520 }
521475
522 template <class _Unsigned>476 // Calculate the actual number
523 _LIBCPP_HIDE_FROM_ABI iter_type477 _Unsigned __val = 0;
524 __do_get_unsigned(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Unsigned& __v) const {478 bool __overflowed = false;
525 // Stage 1479 for (; __first != __last; ++__first) {
526 int __base = this->__get_base(__iob);480 auto __c = *__first;
527 // Stage 2481 if (!__grouping.empty() && __c == __thousands_sep) {
528 char_type __thousands_sep;482 if (__g_end - __g < this->__num_get_buf_sz) {
529 const int __atoms_size = __num_get_base::__int_chr_cnt;483 *__g_end++ = __dc;
530 char_type __atoms1[__atoms_size];484 __dc = 0;
531 const char_type* __atoms = this->__do_widen(__iob, __atoms1);485 }
532 string __grouping = this->__stage2_int_prep(__iob, __thousands_sep);486 continue;
533 string __buf;
534 __buf.resize(__buf.capacity());
535 char* __a = &__buf[0];
536 char* __a_end = __a;
537 unsigned __g[__num_get_base::__num_get_buf_sz];
538 unsigned* __g_end = __g;
539 unsigned __dc = 0;
540 for (; __b != __e; ++__b) {
541 if (__a_end == __a + __buf.size()) {
542 size_t __tmp = __buf.size();
543 __buf.resize(2 * __buf.size());
544 __buf.resize(__buf.capacity());
545 __a = &__buf[0];
546 __a_end = __a + __tmp;
547 }487 }
548 if (this->__stage2_int_loop(488 auto __offset = this->__atoms_offset(__atoms, __c);
549 *__b,489 if (__offset >= 22) // Not a valid integer character
550 __base,490 break;
551 __a,491
552 __a_end,492 if (__base == 16 && __offset >= 16)
553 __dc,493 __offset -= 6;
554 __thousands_sep,494 if (__offset >= __base)
555 __grouping,
556 __g,
557 __g_end,
558 const_cast<char_type*>(__atoms)))
559 break;495 break;
496 // __val = (__val * __base) + __offset
497 __overflowed |= __builtin_mul_overflow(__val, __base, std::addressof(__val)) ||
498 __builtin_add_overflow(__val, __offset, std::addressof(__val));
499 __parsed_num = true;
500 ++__dc;
501 }
502
503 if (!__parsed_num) {
504 __err |= ios_base::failbit;
505 __v = 0;
506 } else if (__overflowed) {
507 __err |= ios_base::failbit;
508 __v = is_signed<_MaybeSigned>::value && __negate
509 ? numeric_limits<_MaybeSigned>::min()
510 : numeric_limits<_MaybeSigned>::max();
511 } else if (!__negate) {
512 if (__val > static_cast<_Unsigned>(numeric_limits<_MaybeSigned>::max())) {
513 __err |= ios_base::failbit;
514 __v = numeric_limits<_MaybeSigned>::max();
515 } else {
516 __v = __val;
517 }
518 } else if (is_signed<_MaybeSigned>::value) {
519 if (__val > static_cast<_Unsigned>(numeric_limits<_MaybeSigned>::max()) + 1) {
520 __err |= ios_base::failbit;
521 __v = numeric_limits<_MaybeSigned>::min();
522 } else if (__val == static_cast<_Unsigned>(numeric_limits<_MaybeSigned>::max()) + 1) {
523 __v = numeric_limits<_MaybeSigned>::min();
524 } else {
525 __v = -__val;
526 }
527 } else {
528 __v = -__val;
560 }529 }
530
561 if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz)531 if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz)
562 *__g_end++ = __dc;532 *__g_end++ = __dc;
563 // Stage 3533
564 __v = std::__num_get_unsigned_integral<_Unsigned>(__a, __a_end, __err, __base);
565 // Digit grouping checked534 // Digit grouping checked
566 __check_grouping(__grouping, __g, __g_end, __err);535 __check_grouping(__grouping, __g, __g_end, __err);
567 // EOF checked536 // EOF checked
568 if (__b == __e)537 if (__first == __last)
569 __err |= ios_base::eofbit;538 __err |= ios_base::eofbit;
570 return __b;539 return __first;
571 }540 }
572541
573 virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, bool& __v) const;542 virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, bool& __v) const;
574543
575 virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long& __v) const {544 virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long& __v) const {
576 return this->__do_get_signed(__b, __e, __iob, __err, __v);545 return this->__do_get_integral(__b, __e, __iob, __err, __v);
577 }546 }
578547
579 virtual iter_type548 virtual iter_type
580 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long long& __v) const {549 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long long& __v) const {
581 return this->__do_get_signed(__b, __e, __iob, __err, __v);550 return this->__do_get_integral(__b, __e, __iob, __err, __v);
582 }551 }
583552
584 virtual iter_type553 virtual iter_type
585 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned short& __v) const {554 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned short& __v) const {
586 return this->__do_get_unsigned(__b, __e, __iob, __err, __v);555 return this->__do_get_integral(__b, __e, __iob, __err, __v);
587 }556 }
588557
589 virtual iter_type558 virtual iter_type
590 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const {559 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const {
591 return this->__do_get_unsigned(__b, __e, __iob, __err, __v);560 return this->__do_get_integral(__b, __e, __iob, __err, __v);
592 }561 }
593562
594 virtual iter_type563 virtual iter_type
595 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long& __v) const {564 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long& __v) const {
596 return this->__do_get_unsigned(__b, __e, __iob, __err, __v);565 return this->__do_get_integral(__b, __e, __iob, __err, __v);
597 }566 }
598567
599 virtual iter_type568 virtual iter_type
600 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long long& __v) const {569 do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long long& __v) const {
601 return this->__do_get_unsigned(__b, __e, __iob, __err, __v);570 return this->__do_get_integral(__b, __e, __iob, __err, __v);
602 }571 }
603572
604 virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, float& __v) const {573 virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, float& __v) const {
...@@ -652,40 +621,13 @@ _InputIterator num_get<_CharT, _InputIterator>::do_get(...@@ -652,40 +621,13 @@ _InputIterator num_get<_CharT, _InputIterator>::do_get(
652template <class _CharT, class _InputIterator>621template <class _CharT, class _InputIterator>
653_InputIterator num_get<_CharT, _InputIterator>::do_get(622_InputIterator num_get<_CharT, _InputIterator>::do_get(
654 iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, void*& __v) const {623 iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, void*& __v) const {
655 // Stage 1624 auto __flags = __iob.flags();
656 int __base = 16;625 __iob.flags((__flags & ~ios_base::basefield & ~ios_base::uppercase) | ios_base::hex);
657 // Stage 2626 uintptr_t __ptr;
658 char_type __atoms[__num_get_base::__int_chr_cnt];627 auto __res = __do_get_integral(__b, __e, __iob, __err, __ptr);
659 char_type __thousands_sep = char_type();628 __iob.flags(__flags);
660 string __grouping;629 __v = reinterpret_cast<void*>(__ptr);
661 std::use_facet<ctype<_CharT> >(__iob.getloc())630 return __res;
662 .widen(__num_get_base::__src, __num_get_base::__src + __num_get_base::__int_chr_cnt, __atoms);
663 string __buf;
664 __buf.resize(__buf.capacity());
665 char* __a = &__buf[0];
666 char* __a_end = __a;
667 unsigned __g[__num_get_base::__num_get_buf_sz];
668 unsigned* __g_end = __g;
669 unsigned __dc = 0;
670 for (; __b != __e; ++__b) {
671 if (__a_end == __a + __buf.size()) {
672 size_t __tmp = __buf.size();
673 __buf.resize(2 * __buf.size());
674 __buf.resize(__buf.capacity());
675 __a = &__buf[0];
676 __a_end = __a + __tmp;
677 }
678 if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms))
679 break;
680 }
681 // Stage 3
682 __buf.resize(__a_end - __a);
683 if (__locale::__sscanf(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1)
684 __err = ios_base::failbit;
685 // EOF checked
686 if (__b == __e)
687 __err |= ios_base::eofbit;
688 return __b;
689}631}
690632
691extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>;633extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>;
...@@ -748,6 +690,13 @@ void __num_put<_CharT>::__widen_and_group_int(...@@ -748,6 +690,13 @@ void __num_put<_CharT>::__widen_and_group_int(
748 __op = __ob + (__np - __nb);690 __op = __ob + (__np - __nb);
749}691}
750692
693_LIBCPP_HIDE_FROM_ABI inline bool __isdigit(char __c) { return __c >= '0' && __c <= '9'; }
694
695_LIBCPP_HIDE_FROM_ABI inline bool __isxdigit(char __c) {
696 auto __lower = __c | 0x20;
697 return std::__isdigit(__c) || (__lower >= 'a' && __lower <= 'f');
698}
699
751template <class _CharT>700template <class _CharT>
752void __num_put<_CharT>::__widen_and_group_float(701void __num_put<_CharT>::__widen_and_group_float(
753 char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc) {702 char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc) {
...@@ -763,11 +712,11 @@ void __num_put<_CharT>::__widen_and_group_float(...@@ -763,11 +712,11 @@ void __num_put<_CharT>::__widen_and_group_float(
763 *__oe++ = __ct.widen(*__nf++);712 *__oe++ = __ct.widen(*__nf++);
764 *__oe++ = __ct.widen(*__nf++);713 *__oe++ = __ct.widen(*__nf++);
765 for (__ns = __nf; __ns < __ne; ++__ns)714 for (__ns = __nf; __ns < __ne; ++__ns)
766 if (!__locale::__isxdigit(*__ns, _LIBCPP_GET_C_LOCALE))715 if (!std::__isxdigit(*__ns))
767 break;716 break;
768 } else {717 } else {
769 for (__ns = __nf; __ns < __ne; ++__ns)718 for (__ns = __nf; __ns < __ne; ++__ns)
770 if (!__locale::__isdigit(*__ns, _LIBCPP_GET_C_LOCALE))719 if (!std::__isdigit(*__ns))
771 break;720 break;
772 }721 }
773 if (__grouping.empty()) {722 if (__grouping.empty()) {
...@@ -885,9 +834,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_ty...@@ -885,9 +834,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_ty
885 const numpunct<char_type>& __np = std::use_facet<numpunct<char_type> >(__iob.getloc());834 const numpunct<char_type>& __np = std::use_facet<numpunct<char_type> >(__iob.getloc());
886 typedef typename numpunct<char_type>::string_type string_type;835 typedef typename numpunct<char_type>::string_type string_type;
887 string_type __nm = __v ? __np.truename() : __np.falsename();836 string_type __nm = __v ? __np.truename() : __np.falsename();
888 for (typename string_type::iterator __i = __nm.begin(); __i != __nm.end(); ++__i, ++__s)837 return std::copy(__nm.begin(), __nm.end(), __s);
889 *__s = *__i;
890 return __s;
891}838}
892839
893template <class _CharT, class _OutputIterator>840template <class _CharT, class _OutputIterator>
lib/libcxx/include/__locale_dir/pad_and_output.h+5-6
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
1313
14#if _LIBCPP_HAS_LOCALIZATION14#if _LIBCPP_HAS_LOCALIZATION
1515
16# include <__algorithm/copy.h>
17# include <__algorithm/fill_n.h>
16# include <ios>18# include <ios>
1719
18# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -30,12 +32,9 @@ _LIBCPP_HIDE_FROM_ABI _OutputIterator __pad_and_output(...@@ -30,12 +32,9 @@ _LIBCPP_HIDE_FROM_ABI _OutputIterator __pad_and_output(
30 __ns -= __sz;32 __ns -= __sz;
31 else33 else
32 __ns = 0;34 __ns = 0;
33 for (; __ob < __op; ++__ob, ++__s)35 __s = std::copy(__ob, __op, __s);
34 *__s = *__ob;36 __s = std::fill_n(__s, __ns, __fl);
35 for (; __ns; --__ns, ++__s)37 __s = std::copy(__op, __oe, __s);
36 *__s = __fl;
37 for (; __ob < __oe; ++__ob, ++__s)
38 *__s = *__ob;
39 __iob.width(0);38 __iob.width(0);
40 return __s;39 return __s;
41}40}
lib/libcxx/include/__locale_dir/support/bsd_like.h-20
...@@ -24,7 +24,6 @@...@@ -24,7 +24,6 @@
24# include <wctype.h>24# include <wctype.h>
25#endif25#endif
2626
27/* zig patch: https://github.com/llvm/llvm-project/pull/143055 */
28#if __has_include(<xlocale.h>)27#if __has_include(<xlocale.h>)
29# include <xlocale.h>28# include <xlocale.h>
30#endif29#endif
...@@ -80,22 +79,9 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __...@@ -80,22 +79,9 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __
80 return ::strtold_l(__nptr, __endptr, __loc);79 return ::strtold_l(__nptr, __endptr, __loc);
81}80}
8281
83inline _LIBCPP_HIDE_FROM_ABI long long __strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
84 return ::strtoll_l(__nptr, __endptr, __base, __loc);
85}
86
87inline _LIBCPP_HIDE_FROM_ABI unsigned long long
88__strtoull(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
89 return ::strtoull_l(__nptr, __endptr, __base, __loc);
90}
91
92//82//
93// Character manipulation functions83// Character manipulation functions
94//84//
95inline _LIBCPP_HIDE_FROM_ABI int __isdigit(int __c, __locale_t __loc) { return ::isdigit_l(__c, __loc); }
96
97inline _LIBCPP_HIDE_FROM_ABI int __isxdigit(int __c, __locale_t __loc) { return ::isxdigit_l(__c, __loc); }
98
99#if defined(_LIBCPP_BUILDING_LIBRARY)85#if defined(_LIBCPP_BUILDING_LIBRARY)
100inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return ::toupper_l(__c, __loc); }86inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return ::toupper_l(__c, __loc); }
10187
...@@ -216,12 +202,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __...@@ -216,12 +202,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __
216 char** __s, __locale_t __loc, const char* __format, _Args&&... __args) {202 char** __s, __locale_t __loc, const char* __format, _Args&&... __args) {
217 return ::asprintf_l(__s, __loc, __format, std::forward<_Args>(__args)...); // non-standard203 return ::asprintf_l(__s, __loc, __format, std::forward<_Args>(__args)...); // non-standard
218}204}
219
220template <class... _Args>
221_LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __sscanf(
222 const char* __s, __locale_t __loc, const char* __format, _Args&&... __args) {
223 return ::sscanf_l(__s, __loc, __format, std::forward<_Args>(__args)...);
224}
225_LIBCPP_DIAGNOSTIC_POP205_LIBCPP_DIAGNOSTIC_POP
226#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT206#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
227207
lib/libcxx/include/__locale_dir/support/fuchsia.h-7
...@@ -141,13 +141,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __...@@ -141,13 +141,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __
141 __locale_guard __current(__loc);141 __locale_guard __current(__loc);
142 return ::asprintf(__s, __format, std::forward<_Args>(__args)...); // non-standard142 return ::asprintf(__s, __format, std::forward<_Args>(__args)...); // non-standard
143}143}
144template <class... _Args>
145_LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __sscanf(
146 const char* __s, __locale_t __loc, const char* __format, _Args&&... __args) {
147 __locale_guard __current(__loc);
148 return std::sscanf(__s, __format, std::forward<_Args>(__args)...);
149}
150
151_LIBCPP_DIAGNOSTIC_POP144_LIBCPP_DIAGNOSTIC_POP
152#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT145#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
153146
lib/libcxx/include/__locale_dir/support/linux.h-37
...@@ -94,32 +94,9 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __...@@ -94,32 +94,9 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __
94 return ::strtold_l(__nptr, __endptr, __loc);94 return ::strtold_l(__nptr, __endptr, __loc);
95}95}
9696
97inline _LIBCPP_HIDE_FROM_ABI long long __strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
98#if !_LIBCPP_HAS_MUSL_LIBC
99 return ::strtoll_l(__nptr, __endptr, __base, __loc);
100#else
101 (void)__loc;
102 return ::strtoll(__nptr, __endptr, __base);
103#endif
104}
105
106inline _LIBCPP_HIDE_FROM_ABI unsigned long long
107__strtoull(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
108#if !_LIBCPP_HAS_MUSL_LIBC
109 return ::strtoull_l(__nptr, __endptr, __base, __loc);
110#else
111 (void)__loc;
112 return ::strtoull(__nptr, __endptr, __base);
113#endif
114}
115
116//97//
117// Character manipulation functions98// Character manipulation functions
118//99//
119inline _LIBCPP_HIDE_FROM_ABI int __isdigit(int __c, __locale_t __loc) { return isdigit_l(__c, __loc); }
120
121inline _LIBCPP_HIDE_FROM_ABI int __isxdigit(int __c, __locale_t __loc) { return isxdigit_l(__c, __loc); }
122
123#if defined(_LIBCPP_BUILDING_LIBRARY)100#if defined(_LIBCPP_BUILDING_LIBRARY)
124inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return toupper_l(__c, __loc); }101inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return toupper_l(__c, __loc); }
125102
...@@ -261,20 +238,6 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __asprintf(...@@ -261,20 +238,6 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __asprintf(
261 va_end(__va);238 va_end(__va);
262 return __res;239 return __res;
263}240}
264
265#ifndef _LIBCPP_COMPILER_GCC // GCC complains that this can't be always_inline due to C-style varargs
266_LIBCPP_HIDE_FROM_ABI
267#endif
268inline _LIBCPP_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __sscanf(
269 const char* __s, __locale_t __loc, const char* __format, ...) {
270 va_list __va;
271 va_start(__va, __format);
272 __locale_guard __current(__loc);
273 int __res = std::vsscanf(__s, __format, __va);
274 va_end(__va);
275 return __res;
276}
277
278} // namespace __locale241} // namespace __locale
279_LIBCPP_END_NAMESPACE_STD242_LIBCPP_END_NAMESPACE_STD
280243
lib/libcxx/include/__locale_dir/support/netbsd.h-2
...@@ -6,8 +6,6 @@...@@ -6,8 +6,6 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9/* zig patch: https://github.com/llvm/llvm-project/pull/143055 */
10
11#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H9#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H
12#define _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H10#define _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H
1311
lib/libcxx/include/__locale_dir/support/newlib.h created+243
...@@ -0,0 +1,243 @@
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_NEWLIB_H
10#define _LIBCPP___LOCALE_DIR_SUPPORT_NEWLIB_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__std_mbstate_t.h>
15#include <clocale> // std::lconv
16#include <cstdio>
17#include <cstdlib>
18#include <ctype.h>
19#include <stdarg.h>
20#include <string.h>
21#include <time.h>
22#if _LIBCPP_HAS_WIDE_CHARACTERS
23# include <cwchar>
24# include <wctype.h>
25#endif
26
27#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28# pragma GCC system_header
29#endif
30
31_LIBCPP_BEGIN_NAMESPACE_STD
32namespace __locale {
33
34struct __locale_guard {
35 _LIBCPP_HIDE_FROM_ABI __locale_guard(locale_t& __loc) : __old_loc_(::uselocale(__loc)) {}
36
37 _LIBCPP_HIDE_FROM_ABI ~__locale_guard() {
38 if (__old_loc_)
39 ::uselocale(__old_loc_);
40 }
41
42 locale_t __old_loc_;
43
44 __locale_guard(__locale_guard const&) = delete;
45 __locale_guard& operator=(__locale_guard const&) = delete;
46};
47
48//
49// Locale management
50//
51#define _LIBCPP_COLLATE_MASK LC_COLLATE_MASK
52#define _LIBCPP_CTYPE_MASK LC_CTYPE_MASK
53#define _LIBCPP_MONETARY_MASK LC_MONETARY_MASK
54#define _LIBCPP_NUMERIC_MASK LC_NUMERIC_MASK
55#define _LIBCPP_TIME_MASK LC_TIME_MASK
56#define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
57#define _LIBCPP_ALL_MASK LC_ALL_MASK
58#define _LIBCPP_LC_ALL LC_ALL
59
60using __locale_t _LIBCPP_NODEBUG = ::locale_t;
61
62#if defined(_LIBCPP_BUILDING_LIBRARY)
63using __lconv_t _LIBCPP_NODEBUG = std::lconv;
64
65inline _LIBCPP_HIDE_FROM_ABI __locale_t __newlocale(int __category_mask, const char* __locale, __locale_t __base) {
66 return ::newlocale(__category_mask, __locale, __base);
67}
68
69inline _LIBCPP_HIDE_FROM_ABI void __freelocale(__locale_t __loc) { ::freelocale(__loc); }
70
71inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, char const* __locale) {
72 return ::setlocale(__category, __locale);
73}
74
75inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
76 __locale_guard __current(__loc);
77 return std::localeconv();
78}
79#endif // _LIBCPP_BUILDING_LIBRARY
80
81//
82// Strtonum functions
83//
84inline _LIBCPP_HIDE_FROM_ABI float __strtof(const char* __nptr, char** __endptr, __locale_t __loc) {
85 return ::strtof_l(__nptr, __endptr, __loc);
86}
87
88inline _LIBCPP_HIDE_FROM_ABI double __strtod(const char* __nptr, char** __endptr, __locale_t __loc) {
89 return ::strtod_l(__nptr, __endptr, __loc);
90}
91
92inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __endptr, __locale_t __loc) {
93 return ::strtold_l(__nptr, __endptr, __loc);
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
151size_t __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_NEWLIB_H
lib/libcxx/include/__locale_dir/support/no_locale/characters.h-4
...@@ -29,10 +29,6 @@ namespace __locale {...@@ -29,10 +29,6 @@ namespace __locale {
29//29//
30// Character manipulation functions30// Character manipulation functions
31//31//
32inline _LIBCPP_HIDE_FROM_ABI int __isdigit(int __c, __locale_t) { return std::isdigit(__c); }
33
34inline _LIBCPP_HIDE_FROM_ABI int __isxdigit(int __c, __locale_t) { return std::isxdigit(__c); }
35
36#if defined(_LIBCPP_BUILDING_LIBRARY)32#if defined(_LIBCPP_BUILDING_LIBRARY)
37inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t) { return std::toupper(__c); }33inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t) { return std::toupper(__c); }
3834
lib/libcxx/include/__locale_dir/support/no_locale/strtonum.h-9
...@@ -34,15 +34,6 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __...@@ -34,15 +34,6 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __
34 return std::strtold(__nptr, __endptr);34 return std::strtold(__nptr, __endptr);
35}35}
3636
37inline _LIBCPP_HIDE_FROM_ABI long long __strtoll(const char* __nptr, char** __endptr, int __base, __locale_t) {
38 return std::strtoll(__nptr, __endptr, __base);
39}
40
41inline _LIBCPP_HIDE_FROM_ABI unsigned long long
42__strtoull(const char* __nptr, char** __endptr, int __base, __locale_t) {
43 return std::strtoull(__nptr, __endptr, __base);
44}
45
46} // namespace __locale37} // namespace __locale
47_LIBCPP_END_NAMESPACE_STD38_LIBCPP_END_NAMESPACE_STD
4839
lib/libcxx/include/__locale_dir/support/windows.h-29
...@@ -186,21 +186,9 @@ inline _LIBCPP_HIDE_FROM_ABI double __strtod(const char* __nptr, char** __endptr...@@ -186,21 +186,9 @@ inline _LIBCPP_HIDE_FROM_ABI double __strtod(const char* __nptr, char** __endptr
186 return ::_strtod_l(__nptr, __endptr, __loc);186 return ::_strtod_l(__nptr, __endptr, __loc);
187}187}
188188
189inline _LIBCPP_HIDE_FROM_ABI long long __strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
190 return ::_strtoi64_l(__nptr, __endptr, __base, __loc);
191}
192inline _LIBCPP_HIDE_FROM_ABI unsigned long long
193__strtoull(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
194 return ::_strtoui64_l(__nptr, __endptr, __base, __loc);
195}
196
197//189//
198// Character manipulation functions190// Character manipulation functions
199//191//
200inline _LIBCPP_HIDE_FROM_ABI int __isdigit(int __c, __locale_t __loc) { return _isdigit_l(__c, __loc); }
201
202inline _LIBCPP_HIDE_FROM_ABI int __isxdigit(int __c, __locale_t __loc) { return _isxdigit_l(__c, __loc); }
203
204#if defined(_LIBCPP_BUILDING_LIBRARY)192#if defined(_LIBCPP_BUILDING_LIBRARY)
205inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return ::_toupper_l(__c, __loc); }193inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return ::_toupper_l(__c, __loc); }
206194
...@@ -280,23 +268,6 @@ _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5) int __snpri...@@ -280,23 +268,6 @@ _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5) int __snpri
280_LIBCPP_EXPORTED_FROM_ABI268_LIBCPP_EXPORTED_FROM_ABI
281_LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __asprintf(char** __ret, __locale_t __loc, const char* __format, ...);269_LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __asprintf(char** __ret, __locale_t __loc, const char* __format, ...);
282270
283_LIBCPP_DIAGNOSTIC_PUSH
284_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
285_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") // GCC doesn't support [[gnu::format]] on variadic templates
286#ifdef _LIBCPP_COMPILER_CLANG_BASED
287# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) _LIBCPP_ATTRIBUTE_FORMAT(__VA_ARGS__)
288#else
289# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) /* nothing */
290#endif
291
292template <class... _Args>
293_LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __sscanf(
294 const char* __dest, __locale_t __loc, const char* __format, _Args&&... __args) {
295 return ::_sscanf_l(__dest, __format, __loc, std::forward<_Args>(__args)...);
296}
297_LIBCPP_DIAGNOSTIC_POP
298#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
299
300#if defined(_LIBCPP_BUILDING_LIBRARY)271#if defined(_LIBCPP_BUILDING_LIBRARY)
301struct __locale_guard {272struct __locale_guard {
302 _LIBCPP_HIDE_FROM_ABI __locale_guard(__locale_t __l) : __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {273 _LIBCPP_HIDE_FROM_ABI __locale_guard(__locale_t __l) : __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
lib/libcxx/include/__locale_dir/time.h+3-7
...@@ -601,17 +601,13 @@ private:...@@ -601,17 +601,13 @@ private:
601 template <> \601 template <> \
602 _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \602 _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \
603 template <> \603 template <> \
604 _LIBCPP_EXPORTED_FROM_ABI void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \604 void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
605 template <> \605 template <> \
606 _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze( \606 __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
607 char, const ctype<_CharT>&); \
608 extern template _LIBCPP_EXPORTED_FROM_ABI time_base::dateorder __time_get_storage<_CharT>::__do_date_order() \607 extern template _LIBCPP_EXPORTED_FROM_ABI time_base::dateorder __time_get_storage<_CharT>::__do_date_order() \
609 const; \608 const; \
610 extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const char*); \609 extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const char*); \
611 extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \610 extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&);
612 extern template _LIBCPP_EXPORTED_FROM_ABI void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
613 extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::string_type \
614 __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&);
615611
616_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char)612_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char)
617# if _LIBCPP_HAS_WIDE_CHARACTERS613# if _LIBCPP_HAS_WIDE_CHARACTERS
lib/libcxx/include/__math/hypot.h+1-1
...@@ -53,7 +53,7 @@ inline _LIBCPP_HIDE_FROM_ABI __promote_t<_A1, _A2> hypot(_A1 __x, _A2 __y) _NOEX...@@ -53,7 +53,7 @@ inline _LIBCPP_HIDE_FROM_ABI __promote_t<_A1, _A2> hypot(_A1 __x, _A2 __y) _NOEX
53// Computes the three-dimensional hypotenuse: `std::hypot(x,y,z)`.53// Computes the three-dimensional hypotenuse: `std::hypot(x,y,z)`.
54// The naive implementation might over-/underflow which is why this implementation is more involved:54// The naive implementation might over-/underflow which is why this implementation is more involved:
55// If the square of an argument might run into issues, we scale the arguments appropriately.55// If the square of an argument might run into issues, we scale the arguments appropriately.
56// See https://github.com/llvm/llvm-project/issues/92782 for a detailed discussion and summary.56// See https://llvm.org/PR92782 for a detailed discussion and summary.
57template <class _Real>57template <class _Real>
58_LIBCPP_HIDE_FROM_ABI _Real __hypot(_Real __x, _Real __y, _Real __z) {58_LIBCPP_HIDE_FROM_ABI _Real __hypot(_Real __x, _Real __y, _Real __z) {
59 // Factors needed to determine if over-/underflow might happen59 // Factors needed to determine if over-/underflow might happen
lib/libcxx/include/__math/logarithms.h+1-1
...@@ -58,7 +58,7 @@ inline _LIBCPP_HIDE_FROM_ABI double log10(_A1 __x) _NOEXCEPT {...@@ -58,7 +58,7 @@ inline _LIBCPP_HIDE_FROM_ABI double log10(_A1 __x) _NOEXCEPT {
58inline _LIBCPP_HIDE_FROM_ABI int ilogb(float __x) _NOEXCEPT { return __builtin_ilogbf(__x); }58inline _LIBCPP_HIDE_FROM_ABI int ilogb(float __x) _NOEXCEPT { return __builtin_ilogbf(__x); }
5959
60template <class = int>60template <class = int>
61_LIBCPP_HIDE_FROM_ABI double ilogb(double __x) _NOEXCEPT {61_LIBCPP_HIDE_FROM_ABI int ilogb(double __x) _NOEXCEPT {
62 return __builtin_ilogb(__x);62 return __builtin_ilogb(__x);
63}63}
6464
lib/libcxx/include/__math/traits.h+80-11
...@@ -25,33 +25,26 @@ namespace __math {...@@ -25,33 +25,26 @@ namespace __math {
2525
26// signbit26// signbit
2727
28// TODO(LLVM 22): Remove conditional once support for Clang 19 is dropped.
29#if defined(_LIBCPP_COMPILER_GCC) || __has_constexpr_builtin(__builtin_signbit)
30# define _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_CONSTEXPR_SINCE_CXX23
31#else
32# define _LIBCPP_SIGNBIT_CONSTEXPR
33#endif
34
35// The universal C runtime (UCRT) in the WinSDK provides floating point overloads28// The universal C runtime (UCRT) in the WinSDK provides floating point overloads
36// for std::signbit(). By defining our overloads as templates, we can work around29// for std::signbit(). By defining our overloads as templates, we can work around
37// this issue as templates are less preferred than non-template functions.30// this issue as templates are less preferred than non-template functions.
38template <class = void>31template <class = void>
39[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(float __x) _NOEXCEPT {32[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(float __x) _NOEXCEPT {
40 return __builtin_signbit(__x);33 return __builtin_signbit(__x);
41}34}
4235
43template <class = void>36template <class = void>
44[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(double __x) _NOEXCEPT {37[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(double __x) _NOEXCEPT {
45 return __builtin_signbit(__x);38 return __builtin_signbit(__x);
46}39}
4740
48template <class = void>41template <class = void>
49[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(long double __x) _NOEXCEPT {42[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(long double __x) _NOEXCEPT {
50 return __builtin_signbit(__x);43 return __builtin_signbit(__x);
51}44}
5245
53template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>46template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
54[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT {47[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT {
55 return __x < 0;48 return __x < 0;
56}49}
5750
...@@ -189,6 +182,82 @@ template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_ar...@@ -189,6 +182,82 @@ template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_ar
189 return __builtin_isunordered((type)__x, (type)__y);182 return __builtin_isunordered((type)__x, (type)__y);
190}183}
191184
185// MS UCRT incorrectly defines some functions in a way not working with integer types. Until C++20, this was worked
186// around by -fdelayed-template-parsing. Since C++20, we can use standard feature "requires" instead.
187
188// TODO: Remove the workaround once UCRT fixes these functions. Note that this doesn't seem planned as of 2025-07 per
189// https://developercommunity.visualstudio.com/t/10294165.
190
191#if defined(_LIBCPP_MSVCRT) && _LIBCPP_STD_VER >= 20
192namespace __ucrt {
193template <class _A1>
194 requires is_integral_v<_A1>
195[[nodiscard]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1) noexcept {
196 return true;
197}
198
199template <class _A1>
200 requires is_integral_v<_A1>
201[[nodiscard]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1) noexcept {
202 return false;
203}
204
205template <class _A1>
206 requires is_integral_v<_A1>
207[[nodiscard]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) noexcept {
208 return false;
209}
210
211template <class _A1>
212 requires is_integral_v<_A1>
213[[nodiscard]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) noexcept {
214 return __x != 0;
215}
216
217template <class _A1, class _A2>
218 requires is_arithmetic_v<_A1> && is_arithmetic_v<_A2>
219[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 __y) noexcept {
220 using type = __promote_t<_A1, _A2>;
221 return __builtin_isgreater((type)__x, (type)__y);
222}
223
224template <class _A1, class _A2>
225 requires is_arithmetic_v<_A1> && is_arithmetic_v<_A2>
226[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, _A2 __y) noexcept {
227 using type = __promote_t<_A1, _A2>;
228 return __builtin_isgreaterequal((type)__x, (type)__y);
229}
230
231template <class _A1, class _A2>
232 requires is_arithmetic_v<_A1> && is_arithmetic_v<_A2>
233[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) noexcept {
234 using type = __promote_t<_A1, _A2>;
235 return __builtin_isless((type)__x, (type)__y);
236}
237
238template <class _A1, class _A2>
239 requires is_arithmetic_v<_A1> && is_arithmetic_v<_A2>
240[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 __y) noexcept {
241 using type = __promote_t<_A1, _A2>;
242 return __builtin_islessequal((type)__x, (type)__y);
243}
244
245template <class _A1, class _A2>
246 requires is_arithmetic_v<_A1> && is_arithmetic_v<_A2>
247[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _A2 __y) noexcept {
248 using type = __promote_t<_A1, _A2>;
249 return __builtin_islessgreater((type)__x, (type)__y);
250}
251
252template <class _A1, class _A2>
253 requires is_arithmetic_v<_A1> && is_arithmetic_v<_A2>
254[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2 __y) noexcept {
255 using type = __promote_t<_A1, _A2>;
256 return __builtin_isunordered((type)__x, (type)__y);
257}
258} // namespace __ucrt
259#endif
260
192} // namespace __math261} // namespace __math
193262
194_LIBCPP_END_NAMESPACE_STD263_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__mdspan/extents.h+7-4
...@@ -25,6 +25,7 @@...@@ -25,6 +25,7 @@
25#include <__type_traits/integer_traits.h>25#include <__type_traits/integer_traits.h>
26#include <__type_traits/is_convertible.h>26#include <__type_traits/is_convertible.h>
27#include <__type_traits/is_nothrow_constructible.h>27#include <__type_traits/is_nothrow_constructible.h>
28#include <__type_traits/is_signed.h>
28#include <__type_traits/make_unsigned.h>29#include <__type_traits/make_unsigned.h>
29#include <__utility/integer_sequence.h>30#include <__utility/integer_sequence.h>
30#include <__utility/unreachable.h>31#include <__utility/unreachable.h>
...@@ -298,11 +299,13 @@ private:...@@ -298,11 +299,13 @@ private:
298299
299public:300public:
300 // [mdspan.extents.obs], observers of multidimensional index space301 // [mdspan.extents.obs], observers of multidimensional index space
301 _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return __rank_; }302 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return __rank_; }
302 _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank_dynamic() noexcept { return __rank_dynamic_; }303 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank_dynamic() noexcept { return __rank_dynamic_; }
303304
304 _LIBCPP_HIDE_FROM_ABI constexpr index_type extent(rank_type __r) const noexcept { return __vals_.__value(__r); }305 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr index_type extent(rank_type __r) const noexcept {
305 _LIBCPP_HIDE_FROM_ABI static constexpr size_t static_extent(rank_type __r) noexcept {306 return __vals_.__value(__r);
307 }
308 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr size_t static_extent(rank_type __r) noexcept {
306 return _Values::__static_value(__r);309 return _Values::__static_value(__r);
307 }310 }
308311
lib/libcxx/include/__mdspan/layout_stride.h+4-5
...@@ -272,11 +272,10 @@ public:...@@ -272,11 +272,10 @@ public:
272 return [&]<size_t... _Pos>(index_sequence<_Pos...>) {272 return [&]<size_t... _Pos>(index_sequence<_Pos...>) {
273 if ((__extents_.extent(_Pos) * ... * 1) == 0)273 if ((__extents_.extent(_Pos) * ... * 1) == 0)
274 return static_cast<index_type>(0);274 return static_cast<index_type>(0);
275 else275
276 return static_cast<index_type>(276 return static_cast<index_type>(
277 static_cast<index_type>(1) +277 static_cast<index_type>(1) + (((__extents_.extent(_Pos) - static_cast<index_type>(1)) * __strides_[_Pos]) +
278 (((__extents_.extent(_Pos) - static_cast<index_type>(1)) * __strides_[_Pos]) + ... +278 ... + static_cast<index_type>(0)));
279 static_cast<index_type>(0)));
280 }(make_index_sequence<__rank_>());279 }(make_index_sequence<__rank_>());
281 }280 }
282 }281 }
lib/libcxx/include/__mdspan/mdspan.h+29-23
...@@ -87,16 +87,17 @@ public:...@@ -87,16 +87,17 @@ public:
87 using data_handle_type = typename accessor_type::data_handle_type;87 using data_handle_type = typename accessor_type::data_handle_type;
88 using reference = typename accessor_type::reference;88 using reference = typename accessor_type::reference;
8989
90 _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return extents_type::rank(); }90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return extents_type::rank(); }
91 _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }91 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank_dynamic() noexcept {
92 _LIBCPP_HIDE_FROM_ABI static constexpr size_t static_extent(rank_type __r) noexcept {92 return extents_type::rank_dynamic();
93 }
94 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr size_t static_extent(rank_type __r) noexcept {
93 return extents_type::static_extent(__r);95 return extents_type::static_extent(__r);
94 }96 }
95 _LIBCPP_HIDE_FROM_ABI constexpr index_type extent(rank_type __r) const noexcept {97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr index_type extent(rank_type __r) const noexcept {
96 return __map_.extents().extent(__r);98 return __map_.extents().extent(__r);
97 };99 }
98100
99public:
100 //--------------------------------------------------------------------------------101 //--------------------------------------------------------------------------------
101 // [mdspan.mdspan.cons], mdspan constructors, assignment, and destructor102 // [mdspan.mdspan.cons], mdspan constructors, assignment, and destructor
102103
...@@ -185,7 +186,7 @@ public:...@@ -185,7 +186,7 @@ public:
185 requires((is_convertible_v<_OtherIndexTypes, index_type> && ...) &&186 requires((is_convertible_v<_OtherIndexTypes, index_type> && ...) &&
186 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&187 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&
187 (sizeof...(_OtherIndexTypes) == rank()))188 (sizeof...(_OtherIndexTypes) == rank()))
188 _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const {189 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const {
189 // Note the standard layouts would also check this, but user provided ones may not, so we190 // Note the standard layouts would also check this, but user provided ones may not, so we
190 // check the precondition here191 // check the precondition here
191 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__is_multidimensional_index_in(extents(), __indices...),192 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__is_multidimensional_index_in(extents(), __indices...),
...@@ -196,7 +197,8 @@ public:...@@ -196,7 +197,8 @@ public:
196 template <class _OtherIndexType>197 template <class _OtherIndexType>
197 requires(is_convertible_v<const _OtherIndexType&, index_type> &&198 requires(is_convertible_v<const _OtherIndexType&, index_type> &&
198 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)199 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)
199 _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](const array< _OtherIndexType, rank()>& __indices) const {200 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference
201 operator[](const array< _OtherIndexType, rank()>& __indices) const {
200 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {202 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {
201 return __map_(__indices[_Idxs]...);203 return __map_(__indices[_Idxs]...);
202 }(make_index_sequence<rank()>()));204 }(make_index_sequence<rank()>()));
...@@ -205,13 +207,13 @@ public:...@@ -205,13 +207,13 @@ public:
205 template <class _OtherIndexType>207 template <class _OtherIndexType>
206 requires(is_convertible_v<const _OtherIndexType&, index_type> &&208 requires(is_convertible_v<const _OtherIndexType&, index_type> &&
207 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)209 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)
208 _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](span<_OtherIndexType, rank()> __indices) const {210 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](span<_OtherIndexType, rank()> __indices) const {
209 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {211 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {
210 return __map_(__indices[_Idxs]...);212 return __map_(__indices[_Idxs]...);
211 }(make_index_sequence<rank()>()));213 }(make_index_sequence<rank()>()));
212 }214 }
213215
214 _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept {216 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept {
215 // Could leave this as only checked in debug mode: semantically size() is never217 // Could leave this as only checked in debug mode: semantically size() is never
216 // guaranteed to be related to any accessible range218 // guaranteed to be related to any accessible range
217 _LIBCPP_ASSERT_UNCATEGORIZED(219 _LIBCPP_ASSERT_UNCATEGORIZED(
...@@ -237,24 +239,28 @@ public:...@@ -237,24 +239,28 @@ public:
237 swap(__x.__acc_, __y.__acc_);239 swap(__x.__acc_, __y.__acc_);
238 }240 }
239241
240 _LIBCPP_HIDE_FROM_ABI constexpr const extents_type& extents() const noexcept { return __map_.extents(); };242 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const extents_type& extents() const noexcept {
241 _LIBCPP_HIDE_FROM_ABI constexpr const data_handle_type& data_handle() const noexcept { return __ptr_; };243 return __map_.extents();
242 _LIBCPP_HIDE_FROM_ABI constexpr const mapping_type& mapping() const noexcept { return __map_; };244 }
243 _LIBCPP_HIDE_FROM_ABI constexpr const accessor_type& accessor() const noexcept { return __acc_; };245 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const data_handle_type& data_handle() const noexcept { return __ptr_; }
246 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const mapping_type& mapping() const noexcept { return __map_; }
247 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const accessor_type& accessor() const noexcept { return __acc_; }
244248
245 // per LWG-4021 "mdspan::is_always_meow() should be noexcept"249 // per LWG-4021 "mdspan::is_always_meow() should be noexcept"
246 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_unique() noexcept { return mapping_type::is_always_unique(); };250 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_unique() noexcept {
247 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_exhaustive() noexcept {251 return mapping_type::is_always_unique();
252 }
253 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_exhaustive() noexcept {
248 return mapping_type::is_always_exhaustive();254 return mapping_type::is_always_exhaustive();
249 };255 }
250 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_strided() noexcept {256 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_strided() noexcept {
251 return mapping_type::is_always_strided();257 return mapping_type::is_always_strided();
252 };258 }
253259
254 _LIBCPP_HIDE_FROM_ABI constexpr bool is_unique() const { return __map_.is_unique(); };260 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool is_unique() const { return __map_.is_unique(); }
255 _LIBCPP_HIDE_FROM_ABI constexpr bool is_exhaustive() const { return __map_.is_exhaustive(); };261 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool is_exhaustive() const { return __map_.is_exhaustive(); }
256 _LIBCPP_HIDE_FROM_ABI constexpr bool is_strided() const { return __map_.is_strided(); };262 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool is_strided() const { return __map_.is_strided(); }
257 _LIBCPP_HIDE_FROM_ABI constexpr index_type stride(rank_type __r) const { return __map_.stride(__r); };263 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr index_type stride(rank_type __r) const { return __map_.stride(__r); }
258264
259private:265private:
260 _LIBCPP_NO_UNIQUE_ADDRESS data_handle_type __ptr_{};266 _LIBCPP_NO_UNIQUE_ADDRESS data_handle_type __ptr_{};
lib/libcxx/include/__memory/addressof.h+7-5
...@@ -19,7 +19,8 @@...@@ -19,7 +19,8 @@
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
2020
21template <class _Tp>21template <class _Tp>
22inline _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_NO_CFI _LIBCPP_HIDE_FROM_ABI _Tp* addressof(_Tp& __x) _NOEXCEPT {22[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_NO_CFI _LIBCPP_HIDE_FROM_ABI _Tp*
23addressof(_Tp& __x) _NOEXCEPT {
23 return __builtin_addressof(__x);24 return __builtin_addressof(__x);
24}25}
2526
...@@ -27,24 +28,25 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_NO_CFI _LIBCPP_HIDE_FROM_ABI _Tp* a...@@ -27,24 +28,25 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_NO_CFI _LIBCPP_HIDE_FROM_ABI _Tp* a
27// Objective-C++ Automatic Reference Counting uses qualified pointers28// Objective-C++ Automatic Reference Counting uses qualified pointers
28// that require special addressof() signatures.29// that require special addressof() signatures.
29template <class _Tp>30template <class _Tp>
30inline _LIBCPP_HIDE_FROM_ABI __strong _Tp* addressof(__strong _Tp& __x) _NOEXCEPT {31[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __strong _Tp* addressof(__strong _Tp& __x) _NOEXCEPT {
31 return &__x;32 return &__x;
32}33}
3334
34# if __has_feature(objc_arc_weak)35# if __has_feature(objc_arc_weak)
35template <class _Tp>36template <class _Tp>
36inline _LIBCPP_HIDE_FROM_ABI __weak _Tp* addressof(__weak _Tp& __x) _NOEXCEPT {37[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __weak _Tp* addressof(__weak _Tp& __x) _NOEXCEPT {
37 return &__x;38 return &__x;
38}39}
39# endif40# endif
4041
41template <class _Tp>42template <class _Tp>
42inline _LIBCPP_HIDE_FROM_ABI __autoreleasing _Tp* addressof(__autoreleasing _Tp& __x) _NOEXCEPT {43[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __autoreleasing _Tp* addressof(__autoreleasing _Tp& __x) _NOEXCEPT {
43 return &__x;44 return &__x;
44}45}
4546
46template <class _Tp>47template <class _Tp>
47inline _LIBCPP_HIDE_FROM_ABI __unsafe_unretained _Tp* addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT {48[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __unsafe_unretained _Tp*
49addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT {
48 return &__x;50 return &__x;
49}51}
50#endif52#endif
lib/libcxx/include/__memory/align.h+18-1
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <cstdint>
1415
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header17# pragma GCC system_header
...@@ -18,7 +19,23 @@...@@ -18,7 +19,23 @@
1819
19_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2021
21_LIBCPP_EXPORTED_FROM_ABI void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);22inline namespace __align_inline {
23_LIBCPP_HIDE_FROM_ABI inline void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space) {
24 void* __r = nullptr;
25 if (__sz <= __space) {
26 char* __p1 = static_cast<char*>(__ptr);
27 char* __p2 = reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(__p1 + (__align - 1)) & -__align);
28 size_t __d = static_cast<size_t>(__p2 - __p1);
29 if (__d <= __space - __sz) {
30 __r = __p2;
31 __ptr = __r;
32 __space -= __d;
33 }
34 }
35 return __r;
36}
37
38} // namespace __align_inline
2239
23_LIBCPP_END_NAMESPACE_STD40_LIBCPP_END_NAMESPACE_STD
2441
lib/libcxx/include/__memory/allocate_at_least.h+15-10
...@@ -19,26 +19,31 @@...@@ -19,26 +19,31 @@
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2121
22template <class _Pointer, class _SizeT = size_t>
23struct __allocation_result {
24 _Pointer ptr;
25 _SizeT count;
26
27 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __allocation_result(_Pointer __ptr, _SizeT __count)
28 : ptr(__ptr), count(__count) {}
29};
30_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__allocation_result);
31
22#if _LIBCPP_STD_VER >= 2332#if _LIBCPP_STD_VER >= 23
2333
24template <class _Alloc>34template <class _Alloc>
25[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto __allocate_at_least(_Alloc& __alloc, size_t __n) {35[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto __allocate_at_least(_Alloc& __alloc, size_t __n) {
26 return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);36 auto __res = std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);
37 return __allocation_result{__res.ptr, __res.count};
27}38}
2839
29#else40#else
3041
31template <class _Pointer>42template <class _Alloc, class _Traits = allocator_traits<_Alloc> >
32struct __allocation_result {
33 _Pointer ptr;
34 size_t count;
35};
36
37template <class _Alloc>
38[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI43[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
39_LIBCPP_CONSTEXPR __allocation_result<typename allocator_traits<_Alloc>::pointer>44_LIBCPP_CONSTEXPR __allocation_result<typename _Traits::pointer, typename _Traits::size_type>
40__allocate_at_least(_Alloc& __alloc, size_t __n) {45__allocate_at_least(_Alloc& __alloc, size_t __n) {
41 return {__alloc.allocate(__n), __n};46 return __allocation_result<typename _Traits::pointer, typename _Traits::size_type>(__alloc.allocate(__n), __n);
42}47}
4348
44#endif // _LIBCPP_STD_VER >= 2349#endif // _LIBCPP_STD_VER >= 23
lib/libcxx/include/__memory/allocator.h+14-26
...@@ -14,7 +14,6 @@...@@ -14,7 +14,6 @@
14#include <__cstddef/ptrdiff_t.h>14#include <__cstddef/ptrdiff_t.h>
15#include <__cstddef/size_t.h>15#include <__cstddef/size_t.h>
16#include <__memory/addressof.h>16#include <__memory/addressof.h>
17#include <__memory/allocate_at_least.h>
18#include <__memory/allocator_traits.h>17#include <__memory/allocator_traits.h>
19#include <__new/allocate.h>18#include <__new/allocate.h>
20#include <__new/exceptions.h>19#include <__new/exceptions.h>
...@@ -51,33 +50,21 @@ public:...@@ -51,33 +50,21 @@ public:
51};50};
52#endif // _LIBCPP_STD_VER <= 1751#endif // _LIBCPP_STD_VER <= 17
5352
54// This class provides a non-trivial default constructor to the class that derives from it53template <bool, class _Unique>
55// if the condition is satisfied.54struct __non_trivially_default_constructible_if {};
56//
57// The second template parameter exists to allow giving a unique type to __non_trivial_if,
58// which makes it possible to avoid breaking the ABI when making this a base class of an
59// existing class. Without that, imagine we have classes D1 and D2, both of which used to
60// have no base classes, but which now derive from __non_trivial_if. The layout of a class
61// that inherits from both D1 and D2 will change because the two __non_trivial_if base
62// classes are not allowed to share the same address.
63//
64// By making those __non_trivial_if base classes unique, we work around this problem and
65// it is safe to start deriving from __non_trivial_if in existing classes.
66template <bool _Cond, class _Unique>
67struct __non_trivial_if {};
6855
69template <class _Unique>56template <class _Unique>
70struct __non_trivial_if<true, _Unique> {57struct __non_trivially_default_constructible_if<true, _Unique> {
71 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __non_trivial_if() _NOEXCEPT {}58 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __non_trivially_default_constructible_if() {}
72};59};
7360
74// allocator
75//
76// Note: For ABI compatibility between C++20 and previous standards, we make
77// allocator<void> trivial in C++20.
78
79template <class _Tp>61template <class _Tp>
80class allocator : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> > {62class allocator
63// TODO(LLVM 24): Remove the opt-out
64#ifdef _LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR
65 : __non_trivially_default_constructible_if<!is_void<_Tp>::value, allocator<_Tp> >
66#endif
67{
81 static_assert(!is_const<_Tp>::value, "std::allocator does not support const types");68 static_assert(!is_const<_Tp>::value, "std::allocator does not support const types");
82 static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types");69 static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types");
8370
...@@ -133,10 +120,11 @@ public:...@@ -133,10 +120,11 @@ public:
133 typedef allocator<_Up> other;120 typedef allocator<_Up> other;
134 };121 };
135122
136 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI pointer address(reference __x) const _NOEXCEPT {123 [[__nodiscard__]] _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI pointer address(reference __x) const _NOEXCEPT {
137 return std::addressof(__x);124 return std::addressof(__x);
138 }125 }
139 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI const_pointer address(const_reference __x) const _NOEXCEPT {126 [[__nodiscard__]] _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI const_pointer
127 address(const_reference __x) const _NOEXCEPT {
140 return std::addressof(__x);128 return std::addressof(__x);
141 }129 }
142130
...@@ -144,7 +132,7 @@ public:...@@ -144,7 +132,7 @@ public:
144 return allocate(__n);132 return allocate(__n);
145 }133 }
146134
147 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {135 [[__nodiscard__]] _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
148 return size_type(~0) / sizeof(_Tp);136 return size_type(~0) / sizeof(_Tp);
149 }137 }
150138
lib/libcxx/include/__memory/allocator_traits.h+6-4
...@@ -314,23 +314,25 @@ struct allocator_traits {...@@ -314,23 +314,25 @@ struct allocator_traits {
314 }314 }
315315
316 template <class _Ap = _Alloc, __enable_if_t<__has_max_size_v<const _Ap>, int> = 0>316 template <class _Ap = _Alloc, __enable_if_t<__has_max_size_v<const _Ap>, int> = 0>
317 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type max_size(const allocator_type& __a) _NOEXCEPT {317 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type
318 max_size(const allocator_type& __a) _NOEXCEPT {
318 _LIBCPP_SUPPRESS_DEPRECATED_PUSH319 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
319 return __a.max_size();320 return __a.max_size();
320 _LIBCPP_SUPPRESS_DEPRECATED_POP321 _LIBCPP_SUPPRESS_DEPRECATED_POP
321 }322 }
322 template <class _Ap = _Alloc, __enable_if_t<!__has_max_size_v<const _Ap>, int> = 0>323 template <class _Ap = _Alloc, __enable_if_t<!__has_max_size_v<const _Ap>, int> = 0>
323 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type max_size(const allocator_type&) _NOEXCEPT {324 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type
325 max_size(const allocator_type&) _NOEXCEPT {
324 return numeric_limits<size_type>::max() / sizeof(value_type);326 return numeric_limits<size_type>::max() / sizeof(value_type);
325 }327 }
326328
327 template <class _Ap = _Alloc, __enable_if_t<__has_select_on_container_copy_construction_v<const _Ap>, int> = 0>329 template <class _Ap = _Alloc, __enable_if_t<__has_select_on_container_copy_construction_v<const _Ap>, int> = 0>
328 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static allocator_type330 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static allocator_type
329 select_on_container_copy_construction(const allocator_type& __a) {331 select_on_container_copy_construction(const allocator_type& __a) {
330 return __a.select_on_container_copy_construction();332 return __a.select_on_container_copy_construction();
331 }333 }
332 template <class _Ap = _Alloc, __enable_if_t<!__has_select_on_container_copy_construction_v<const _Ap>, int> = 0>334 template <class _Ap = _Alloc, __enable_if_t<!__has_select_on_container_copy_construction_v<const _Ap>, int> = 0>
333 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static allocator_type335 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static allocator_type
334 select_on_container_copy_construction(const allocator_type& __a) {336 select_on_container_copy_construction(const allocator_type& __a) {
335 return __a;337 return __a;
336 }338 }
lib/libcxx/include/__memory/compressed_pair.h+15-9
...@@ -28,8 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -28,8 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
28// understand how it works). //28// understand how it works). //
29// ================================================================================================================== //29// ================================================================================================================== //
3030
31// The first member is aligned to the alignment of the second member to force padding in front of the compressed pair31// On GCC, the first member is aligned to the alignment of the second member to force padding in front of the compressed
32// in case there are members before it.32// pair in case there are members before it.
33//33//
34// For example:34// For example:
35// (assuming x86-64 linux)35// (assuming x86-64 linux)
...@@ -52,7 +52,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -52,7 +52,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
52//52//
53// Furthermore, that alignment must be the same as what was used in the old __compressed_pair layout, so we must53// Furthermore, that alignment must be the same as what was used in the old __compressed_pair layout, so we must
54// handle reference types specially since alignof(T&) == alignof(T).54// handle reference types specially since alignof(T&) == alignof(T).
55// See https://github.com/llvm/llvm-project/issues/118559.55// See https://llvm.org/PR118559.
56//
57// On Clang, this is unnecessary, since we use anonymous structs instead, which automatically handle the alignment
58// correctly.
5659
57#ifndef _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING60#ifndef _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING
5861
...@@ -64,7 +67,7 @@ inline const size_t __compressed_pair_alignment<_Tp&> = _LIBCPP_ALIGNOF(void*);...@@ -64,7 +67,7 @@ inline const size_t __compressed_pair_alignment<_Tp&> = _LIBCPP_ALIGNOF(void*);
6467
65template <class _ToPad>68template <class _ToPad>
66inline const bool __is_reference_or_unpadded_object =69inline const bool __is_reference_or_unpadded_object =
67 (is_empty<_ToPad>::value && !__libcpp_is_final<_ToPad>::value) || sizeof(_ToPad) == __datasizeof_v<_ToPad>;70 (is_empty<_ToPad>::value && !__is_final_v<_ToPad>) || sizeof(_ToPad) == __datasizeof_v<_ToPad>;
6871
69template <class _Tp>72template <class _Tp>
70inline const bool __is_reference_or_unpadded_object<_Tp&> = true;73inline const bool __is_reference_or_unpadded_object<_Tp&> = true;
...@@ -80,6 +83,10 @@ class __compressed_pair_padding {...@@ -80,6 +83,10 @@ class __compressed_pair_padding {
80template <class _ToPad>83template <class _ToPad>
81class __compressed_pair_padding<_ToPad, true> {};84class __compressed_pair_padding<_ToPad, true> {};
8285
86# define _LIBCPP_COMPRESSED_ELEMENT(T1, Initializer1) \
87 _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1; \
88 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding_, __LINE__, _)
89
83// TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed90// TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed
84# ifdef _LIBCPP_COMPILER_GCC91# ifdef _LIBCPP_COMPILER_GCC
85# define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \92# define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \
...@@ -100,8 +107,7 @@ class __compressed_pair_padding<_ToPad, true> {};...@@ -100,8 +107,7 @@ class __compressed_pair_padding<_ToPad, true> {};
100# else107# else
101# define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \108# define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \
102 struct { \109 struct { \
103 _LIBCPP_NO_UNIQUE_ADDRESS \110 _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1; \
104 __attribute__((__aligned__(::std::__compressed_pair_alignment<T2>))) T1 Initializer1; \
105 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \111 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \
106 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \112 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
107 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \113 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \
...@@ -109,9 +115,7 @@ class __compressed_pair_padding<_ToPad, true> {};...@@ -109,9 +115,7 @@ class __compressed_pair_padding<_ToPad, true> {};
109115
110# define _LIBCPP_COMPRESSED_TRIPLE(T1, Initializer1, T2, Initializer2, T3, Initializer3) \116# define _LIBCPP_COMPRESSED_TRIPLE(T1, Initializer1, T2, Initializer2, T3, Initializer3) \
111 struct { \117 struct { \
112 _LIBCPP_NO_UNIQUE_ADDRESS \118 _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1; \
113 __attribute__((__aligned__(::std::__compressed_pair_alignment<T2>), \
114 __aligned__(::std::__compressed_pair_alignment<T3>))) T1 Initializer1; \
115 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \119 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \
116 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \120 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
117 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \121 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \
...@@ -121,6 +125,8 @@ class __compressed_pair_padding<_ToPad, true> {};...@@ -121,6 +125,8 @@ class __compressed_pair_padding<_ToPad, true> {};
121# endif125# endif
122126
123#else127#else
128# define _LIBCPP_COMPRESSED_ELEMENT(T1, Initializer1) _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1
129
124# define _LIBCPP_COMPRESSED_PAIR(T1, Name1, T2, Name2) \130# define _LIBCPP_COMPRESSED_PAIR(T1, Name1, T2, Name2) \
125 _LIBCPP_NO_UNIQUE_ADDRESS T1 Name1; \131 _LIBCPP_NO_UNIQUE_ADDRESS T1 Name1; \
126 _LIBCPP_NO_UNIQUE_ADDRESS T2 Name2132 _LIBCPP_NO_UNIQUE_ADDRESS T2 Name2
lib/libcxx/include/__memory/construct_at.h+12-23
...@@ -14,7 +14,6 @@...@@ -14,7 +14,6 @@
14#include <__config>14#include <__config>
15#include <__memory/addressof.h>15#include <__memory/addressof.h>
16#include <__new/placement_new_delete.h>16#include <__new/placement_new_delete.h>
17#include <__type_traits/enable_if.h>
18#include <__type_traits/is_array.h>17#include <__type_traits/is_array.h>
19#include <__utility/declval.h>18#include <__utility/declval.h>
20#include <__utility/forward.h>19#include <__utility/forward.h>
...@@ -33,7 +32,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -33,7 +32,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
33#if _LIBCPP_STD_VER >= 2032#if _LIBCPP_STD_VER >= 20
3433
35template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>34template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
36_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {35_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* _LIBCPP_DIAGNOSE_NULLPTR __location, _Args&&... __args) {
37 _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at");36 _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at");
38 return ::new (static_cast<void*>(__location)) _Tp(std::forward<_Args>(__args)...);37 return ::new (static_cast<void*>(__location)) _Tp(std::forward<_Args>(__args)...);
39}38}
...@@ -55,35 +54,25 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_at(_Tp* __l...@@ -55,35 +54,25 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_at(_Tp* __l
55// The internal functions are available regardless of the language version (with the exception of the `__destroy_at`54// The internal functions are available regardless of the language version (with the exception of the `__destroy_at`
56// taking an array).55// taking an array).
5756
58template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>57template <class _Tp>
59_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy_at(_Tp* __loc) {58_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy_at(_Tp* __loc) {
60 _LIBCPP_ASSERT_NON_NULL(__loc != nullptr, "null pointer given to destroy_at");59 _LIBCPP_ASSERT_NON_NULL(__loc != nullptr, "null pointer given to destroy_at");
61 __loc->~_Tp();
62}
63
64#if _LIBCPP_STD_VER >= 2060#if _LIBCPP_STD_VER >= 20
65template <class _Tp, __enable_if_t<is_array<_Tp>::value, int> = 0>61 if constexpr (is_array_v<_Tp>) {
66_LIBCPP_HIDE_FROM_ABI constexpr void __destroy_at(_Tp* __loc) {62 for (auto&& __val : *__loc)
67 _LIBCPP_ASSERT_NON_NULL(__loc != nullptr, "null pointer given to destroy_at");63 std::__destroy_at(std::addressof(__val));
68 for (auto&& __val : *__loc)64 } else
69 std::__destroy_at(std::addressof(__val));
70}
71#endif65#endif
7266 {
73#if _LIBCPP_STD_VER >= 1767 __loc->~_Tp();
7468 }
75template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>
76_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy_at(_Tp* __loc) {
77 std::__destroy_at(__loc);
78}69}
7970
80# if _LIBCPP_STD_VER >= 2071#if _LIBCPP_STD_VER >= 17
81template <class _Tp, enable_if_t<is_array_v<_Tp>, int> = 0>72template <class _Tp>
82_LIBCPP_HIDE_FROM_ABI constexpr void destroy_at(_Tp* __loc) {73_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy_at(_Tp* _LIBCPP_DIAGNOSE_NULLPTR __loc) {
83 std::__destroy_at(__loc);74 std::__destroy_at(__loc);
84}75}
85# endif
86
87#endif // _LIBCPP_STD_VER >= 1776#endif // _LIBCPP_STD_VER >= 17
8877
89_LIBCPP_END_NAMESPACE_STD78_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__memory/inout_ptr.h+1-1
...@@ -96,7 +96,7 @@ private:...@@ -96,7 +96,7 @@ private:
96};96};
9797
98template <class _Pointer = void, class _Smart, class... _Args>98template <class _Pointer = void, class _Smart, class... _Args>
99_LIBCPP_HIDE_FROM_ABI auto inout_ptr(_Smart& __s, _Args&&... __args) {99[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto inout_ptr(_Smart& __s, _Args&&... __args) {
100 using _Ptr = conditional_t<is_void_v<_Pointer>, __pointer_of_t<_Smart>, _Pointer>;100 using _Ptr = conditional_t<is_void_v<_Pointer>, __pointer_of_t<_Smart>, _Pointer>;
101 return std::inout_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);101 return std::inout_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);
102}102}
lib/libcxx/include/__memory/is_sufficiently_aligned.h+1-1
...@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
23#if _LIBCPP_STD_VER >= 2623#if _LIBCPP_STD_VER >= 26
2424
25template <size_t _Alignment, class _Tp>25template <size_t _Alignment, class _Tp>
26_LIBCPP_HIDE_FROM_ABI bool is_sufficiently_aligned(_Tp* __ptr) {26[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_sufficiently_aligned(_Tp* __ptr) {
27 return reinterpret_cast<uintptr_t>(__ptr) % _Alignment == 0;27 return reinterpret_cast<uintptr_t>(__ptr) % _Alignment == 0;
28}28}
2929
lib/libcxx/include/__memory/out_ptr.h+1-1
...@@ -88,7 +88,7 @@ private:...@@ -88,7 +88,7 @@ private:
88};88};
8989
90template <class _Pointer = void, class _Smart, class... _Args>90template <class _Pointer = void, class _Smart, class... _Args>
91_LIBCPP_HIDE_FROM_ABI auto out_ptr(_Smart& __s, _Args&&... __args) {91[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto out_ptr(_Smart& __s, _Args&&... __args) {
92 using _Ptr = conditional_t<is_void_v<_Pointer>, __pointer_of_t<_Smart>, _Pointer>;92 using _Ptr = conditional_t<is_void_v<_Pointer>, __pointer_of_t<_Smart>, _Pointer>;
93 return std::out_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);93 return std::out_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);
94}94}
lib/libcxx/include/__memory/pointer_traits.h+1-1
...@@ -255,7 +255,7 @@ concept __resettable_smart_pointer_with_args = requires(_Smart __s, _Pointer __p...@@ -255,7 +255,7 @@ concept __resettable_smart_pointer_with_args = requires(_Smart __s, _Pointer __p
255// This function ensures safe conversions between fancy pointers at compile-time, where we avoid casts from/to255// This function ensures safe conversions between fancy pointers at compile-time, where we avoid casts from/to
256// `__void_pointer` by obtaining the underlying raw pointer from the fancy pointer using `std::to_address`,256// `__void_pointer` by obtaining the underlying raw pointer from the fancy pointer using `std::to_address`,
257// then dereferencing it to retrieve the pointed-to object, and finally constructing the target fancy pointer257// then dereferencing it to retrieve the pointed-to object, and finally constructing the target fancy pointer
258// to that object using the `std::pointer_traits<>::pinter_to` function.258// to that object using the `std::pointer_traits<>::pointer_to` function.
259template <class _PtrTo, class _PtrFrom>259template <class _PtrTo, class _PtrFrom>
260_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _PtrTo __static_fancy_pointer_cast(const _PtrFrom& __p) {260_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _PtrTo __static_fancy_pointer_cast(const _PtrFrom& __p) {
261 using __ptr_traits = pointer_traits<_PtrTo>;261 using __ptr_traits = pointer_traits<_PtrTo>;
lib/libcxx/include/__memory/raw_storage_iterator.h+3-9
...@@ -28,15 +28,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -28,15 +28,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2828
29#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)29#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
3030
31_LIBCPP_SUPPRESS_DEPRECATED_PUSH
32template <class _OutputIterator, class _Tp>31template <class _OutputIterator, class _Tp>
33class _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator32class _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
34# if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)33 : public __iterator_base<raw_storage_iterator<_OutputIterator, _Tp>, output_iterator_tag, void, void, void, void> {
35 : public iterator<output_iterator_tag, void, void, void, void>
36# endif
37{
38 _LIBCPP_SUPPRESS_DEPRECATED_POP
39
40private:34private:
41 _OutputIterator __x_;35 _OutputIterator __x_;
4236
...@@ -52,7 +46,7 @@ public:...@@ -52,7 +46,7 @@ public:
52 typedef void reference;46 typedef void reference;
5347
54 _LIBCPP_HIDE_FROM_ABI explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}48 _LIBCPP_HIDE_FROM_ABI explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
55 _LIBCPP_HIDE_FROM_ABI raw_storage_iterator& operator*() { return *this; }49 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI raw_storage_iterator& operator*() { return *this; }
56 _LIBCPP_HIDE_FROM_ABI raw_storage_iterator& operator=(const _Tp& __element) {50 _LIBCPP_HIDE_FROM_ABI raw_storage_iterator& operator=(const _Tp& __element) {
57 ::new ((void*)std::addressof(*__x_)) _Tp(__element);51 ::new ((void*)std::addressof(*__x_)) _Tp(__element);
58 return *this;52 return *this;
...@@ -73,7 +67,7 @@ public:...@@ -73,7 +67,7 @@ public:
73 return __t;67 return __t;
74 }68 }
75# if _LIBCPP_STD_VER >= 1469# if _LIBCPP_STD_VER >= 14
76 _LIBCPP_HIDE_FROM_ABI _OutputIterator base() const { return __x_; }70 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _OutputIterator base() const { return __x_; }
77# endif71# endif
78};72};
7973
lib/libcxx/include/__memory/shared_count.h+9-30
...@@ -22,37 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,37 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
22// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)22// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)
23// should be sufficient for thread safety.23// should be sufficient for thread safety.
24// See https://llvm.org/PR2280324// See https://llvm.org/PR22803
25#if (defined(__clang__) && __has_builtin(__atomic_add_fetch) && defined(__ATOMIC_RELAXED) && \
26 defined(__ATOMIC_ACQ_REL)) || \
27 defined(_LIBCPP_COMPILER_GCC)
28# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT 1
29#else
30# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT 0
31#endif
32
33template <class _ValueType>
34inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_relaxed_load(_ValueType const* __value) {
35#if _LIBCPP_HAS_THREADS && defined(__ATOMIC_RELAXED) && \
36 (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
37 return __atomic_load_n(__value, __ATOMIC_RELAXED);
38#else
39 return *__value;
40#endif
41}
42
43template <class _ValueType>
44inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) {
45#if _LIBCPP_HAS_THREADS && defined(__ATOMIC_ACQUIRE) && \
46 (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
47 return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
48#else
49 return *__value;
50#endif
51}
5225
53template <class _Tp>26template <class _Tp>
54inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT {27inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT {
55#if _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT && _LIBCPP_HAS_THREADS28#if _LIBCPP_HAS_THREADS
56 return __atomic_add_fetch(std::addressof(__t), 1, __ATOMIC_RELAXED);29 return __atomic_add_fetch(std::addressof(__t), 1, __ATOMIC_RELAXED);
57#else30#else
58 return __t += 1;31 return __t += 1;
...@@ -61,7 +34,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _N...@@ -61,7 +34,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _N
6134
62template <class _Tp>35template <class _Tp>
63inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT {36inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT {
64#if _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT && _LIBCPP_HAS_THREADS37#if _LIBCPP_HAS_THREADS
65 return __atomic_add_fetch(std::addressof(__t), -1, __ATOMIC_ACQ_REL);38 return __atomic_add_fetch(std::addressof(__t), -1, __ATOMIC_ACQ_REL);
66#else39#else
67 return __t -= 1;40 return __t -= 1;
...@@ -95,7 +68,13 @@ public:...@@ -95,7 +68,13 @@ public:
95 return false;68 return false;
96 }69 }
97#endif70#endif
98 _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT { return __libcpp_relaxed_load(&__shared_owners_) + 1; }71 _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT {
72#if _LIBCPP_HAS_THREADS
73 return __atomic_load_n(&__shared_owners_, __ATOMIC_RELAXED) + 1;
74#else
75 return __shared_owners_ + 1;
76#endif
77 }
99};78};
10079
101class _LIBCPP_EXPORTED_FROM_ABI __shared_weak_count : private __shared_count {80class _LIBCPP_EXPORTED_FROM_ABI __shared_weak_count : private __shared_count {
lib/libcxx/include/__memory/shared_ptr.h+100-145
...@@ -41,19 +41,18 @@...@@ -41,19 +41,18 @@
41#include <__type_traits/enable_if.h>41#include <__type_traits/enable_if.h>
42#include <__type_traits/integral_constant.h>42#include <__type_traits/integral_constant.h>
43#include <__type_traits/is_array.h>43#include <__type_traits/is_array.h>
44#include <__type_traits/is_bounded_array.h>
45#include <__type_traits/is_constructible.h>44#include <__type_traits/is_constructible.h>
46#include <__type_traits/is_convertible.h>45#include <__type_traits/is_convertible.h>
47#include <__type_traits/is_function.h>46#include <__type_traits/is_function.h>
48#include <__type_traits/is_reference.h>47#include <__type_traits/is_reference.h>
49#include <__type_traits/is_same.h>48#include <__type_traits/is_same.h>
50#include <__type_traits/is_unbounded_array.h>
51#include <__type_traits/nat.h>49#include <__type_traits/nat.h>
52#include <__type_traits/negation.h>50#include <__type_traits/negation.h>
53#include <__type_traits/remove_cv.h>51#include <__type_traits/remove_cv.h>
54#include <__type_traits/remove_extent.h>52#include <__type_traits/remove_extent.h>
55#include <__type_traits/remove_reference.h>53#include <__type_traits/remove_reference.h>
56#include <__utility/declval.h>54#include <__utility/declval.h>
55#include <__utility/exception_guard.h>
57#include <__utility/forward.h>56#include <__utility/forward.h>
58#include <__utility/move.h>57#include <__utility/move.h>
59#include <__utility/swap.h>58#include <__utility/swap.h>
...@@ -78,7 +77,7 @@ public:...@@ -78,7 +77,7 @@ public:
78 _LIBCPP_HIDE_FROM_ABI bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;77 _LIBCPP_HIDE_FROM_ABI bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
79 _LIBCPP_HIDE_FROM_ABI bad_weak_ptr& operator=(const bad_weak_ptr&) _NOEXCEPT = default;78 _LIBCPP_HIDE_FROM_ABI bad_weak_ptr& operator=(const bad_weak_ptr&) _NOEXCEPT = default;
80 ~bad_weak_ptr() _NOEXCEPT override;79 ~bad_weak_ptr() _NOEXCEPT override;
81 const char* what() const _NOEXCEPT override;80 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
82};81};
8382
84[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_weak_ptr() {83[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_weak_ptr() {
...@@ -316,10 +315,8 @@ public:...@@ -316,10 +315,8 @@ public:
316#endif315#endif
317316
318 // A shared_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require317 // A shared_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require
319 // any bookkeeping, so it's always trivially relocatable. It is also replaceable because assignment just rebinds the318 // any bookkeeping, so it's always trivially relocatable.
320 // shared_ptr to manage a different object.
321 using __trivially_relocatable _LIBCPP_NODEBUG = shared_ptr;319 using __trivially_relocatable _LIBCPP_NODEBUG = shared_ptr;
322 using __replaceable _LIBCPP_NODEBUG = shared_ptr;
323320
324private:321private:
325 element_type* __ptr_;322 element_type* __ptr_;
...@@ -352,23 +349,16 @@ public:...@@ -352,23 +349,16 @@ public:
352349
353 template <class _Yp, class _Dp, __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>350 template <class _Yp, class _Dp, __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>
354 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d) : __ptr_(__p) {351 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d) : __ptr_(__p) {
355#if _LIBCPP_HAS_EXCEPTIONS352 auto __guard = std::__make_exception_guard([&] { __d(__p); });
356 try {353 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
357#endif // _LIBCPP_HAS_EXCEPTIONS354 typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
358 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
359 typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
360#ifndef _LIBCPP_CXX03_LANG355#ifndef _LIBCPP_CXX03_LANG
361 __cntrl_ = new _CntrlBlk(__p, std::move(__d), _AllocT());356 __cntrl_ = new _CntrlBlk(__p, std::move(__d), _AllocT());
362#else357#else
363 __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());358 __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
364#endif // not _LIBCPP_CXX03_LANG359#endif // not _LIBCPP_CXX03_LANG
365 __enable_weak_this(__p, __p);360 __enable_weak_this(__p, __p);
366#if _LIBCPP_HAS_EXCEPTIONS361 __guard.__complete();
367 } catch (...) {
368 __d(__p);
369 throw;
370 }
371#endif // _LIBCPP_HAS_EXCEPTIONS
372 }362 }
373363
374 template <class _Yp,364 template <class _Yp,
...@@ -376,28 +366,21 @@ public:...@@ -376,28 +366,21 @@ public:
376 class _Alloc,366 class _Alloc,
377 __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>367 __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>
378 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d, _Alloc __a) : __ptr_(__p) {368 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d, _Alloc __a) : __ptr_(__p) {
379#if _LIBCPP_HAS_EXCEPTIONS369 auto __guard = std::__make_exception_guard([&] { __d(__p); });
380 try {370 typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
381#endif // _LIBCPP_HAS_EXCEPTIONS371 typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
382 typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;372 typedef __allocator_destructor<_A2> _D2;
383 typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;373 _A2 __a2(__a);
384 typedef __allocator_destructor<_A2> _D2;374 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
385 _A2 __a2(__a);375 ::new ((void*)std::addressof(*__hold2.get()))
386 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
387 ::new ((void*)std::addressof(*__hold2.get()))
388#ifndef _LIBCPP_CXX03_LANG376#ifndef _LIBCPP_CXX03_LANG
389 _CntrlBlk(__p, std::move(__d), __a);377 _CntrlBlk(__p, std::move(__d), __a);
390#else378#else
391 _CntrlBlk(__p, __d, __a);379 _CntrlBlk(__p, __d, __a);
392#endif // not _LIBCPP_CXX03_LANG380#endif // not _LIBCPP_CXX03_LANG
393 __cntrl_ = std::addressof(*__hold2.release());381 __cntrl_ = std::addressof(*__hold2.release());
394 __enable_weak_this(__p, __p);382 __enable_weak_this(__p, __p);
395#if _LIBCPP_HAS_EXCEPTIONS383 __guard.__complete();
396 } catch (...) {
397 __d(__p);
398 throw;
399 }
400#endif // _LIBCPP_HAS_EXCEPTIONS
401 }384 }
402385
403 template <class _Dp>386 template <class _Dp>
...@@ -406,22 +389,15 @@ public:...@@ -406,22 +389,15 @@ public:
406 _Dp __d,389 _Dp __d,
407 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())390 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())
408 : __ptr_(nullptr) {391 : __ptr_(nullptr) {
409#if _LIBCPP_HAS_EXCEPTIONS392 auto __guard = std::__make_exception_guard([&] { __d(__p); });
410 try {393 typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
411#endif // _LIBCPP_HAS_EXCEPTIONS394 typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
412 typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
413 typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
414#ifndef _LIBCPP_CXX03_LANG395#ifndef _LIBCPP_CXX03_LANG
415 __cntrl_ = new _CntrlBlk(__p, std::move(__d), _AllocT());396 __cntrl_ = new _CntrlBlk(__p, std::move(__d), _AllocT());
416#else397#else
417 __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());398 __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
418#endif // not _LIBCPP_CXX03_LANG399#endif // not _LIBCPP_CXX03_LANG
419#if _LIBCPP_HAS_EXCEPTIONS400 __guard.__complete();
420 } catch (...) {
421 __d(__p);
422 throw;
423 }
424#endif // _LIBCPP_HAS_EXCEPTIONS
425 }401 }
426402
427 template <class _Dp, class _Alloc>403 template <class _Dp, class _Alloc>
...@@ -431,27 +407,20 @@ public:...@@ -431,27 +407,20 @@ public:
431 _Alloc __a,407 _Alloc __a,
432 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())408 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())
433 : __ptr_(nullptr) {409 : __ptr_(nullptr) {
434#if _LIBCPP_HAS_EXCEPTIONS410 auto __guard = std::__make_exception_guard([&] { __d(__p); });
435 try {411 typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
436#endif // _LIBCPP_HAS_EXCEPTIONS412 typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
437 typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;413 typedef __allocator_destructor<_A2> _D2;
438 typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;414 _A2 __a2(__a);
439 typedef __allocator_destructor<_A2> _D2;415 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
440 _A2 __a2(__a);416 ::new ((void*)std::addressof(*__hold2.get()))
441 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
442 ::new ((void*)std::addressof(*__hold2.get()))
443#ifndef _LIBCPP_CXX03_LANG417#ifndef _LIBCPP_CXX03_LANG
444 _CntrlBlk(__p, std::move(__d), __a);418 _CntrlBlk(__p, std::move(__d), __a);
445#else419#else
446 _CntrlBlk(__p, __d, __a);420 _CntrlBlk(__p, __d, __a);
447#endif // not _LIBCPP_CXX03_LANG421#endif // not _LIBCPP_CXX03_LANG
448 __cntrl_ = std::addressof(*__hold2.release());422 __cntrl_ = std::addressof(*__hold2.release());
449#if _LIBCPP_HAS_EXCEPTIONS423 __guard.__complete();
450 } catch (...) {
451 __d(__p);
452 throw;
453 }
454#endif // _LIBCPP_HAS_EXCEPTIONS
455 }424 }
456425
457 template <class _Yp>426 template <class _Yp>
...@@ -514,45 +483,16 @@ public:...@@ -514,45 +483,16 @@ public:
514483
515 template <class _Yp,484 template <class _Yp,
516 class _Dp,485 class _Dp,
517 __enable_if_t<!is_lvalue_reference<_Dp>::value && __compatible_with<_Yp, _Tp>::value &&486 __enable_if_t<__compatible_with<_Yp, _Tp>::value &&
518 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,487 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
519 int> = 0>488 int> = 0>
520 _LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {489 _LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {
521#if _LIBCPP_STD_VER >= 14490 using _AllocT = typename __shared_ptr_default_allocator<_Yp>::type;
522 if (__ptr_ == nullptr)491 using _Deleter = _If<is_lvalue_reference<_Dp>::value, reference_wrapper<__libcpp_remove_reference_t<_Dp> >, _Dp>;
523 __cntrl_ = nullptr;492 using _CntrlBlk = __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, _Deleter, _AllocT>;
524 else
525#endif
526 {
527 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
528 typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, _Dp, _AllocT> _CntrlBlk;
529 __cntrl_ = new _CntrlBlk(__r.get(), std::move(__r.get_deleter()), _AllocT());
530 __enable_weak_this(__r.get(), __r.get());
531 }
532 __r.release();
533 }
534493
535 template <class _Yp,494 __cntrl_ = __ptr_ ? new _CntrlBlk(__r.get(), std::forward<_Dp>(__r.get_deleter()), _AllocT()) : nullptr;
536 class _Dp,495 __enable_weak_this(__r.get(), __r.get());
537 class = void,
538 __enable_if_t<is_lvalue_reference<_Dp>::value && __compatible_with<_Yp, _Tp>::value &&
539 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
540 int> = 0>
541 _LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {
542#if _LIBCPP_STD_VER >= 14
543 if (__ptr_ == nullptr)
544 __cntrl_ = nullptr;
545 else
546#endif
547 {
548 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
549 typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer,
550 reference_wrapper<__libcpp_remove_reference_t<_Dp> >,
551 _AllocT>
552 _CntrlBlk;
553 __cntrl_ = new _CntrlBlk(__r.get(), std::ref(__r.get_deleter()), _AllocT());
554 __enable_weak_this(__r.get(), __r.get());
555 }
556 __r.release();496 __r.release();
557 }497 }
558498
...@@ -628,37 +568,43 @@ public:...@@ -628,37 +568,43 @@ public:
628 shared_ptr(__p, __d, __a).swap(*this);568 shared_ptr(__p, __d, __a).swap(*this);
629 }569 }
630570
631 _LIBCPP_HIDE_FROM_ABI element_type* get() const _NOEXCEPT { return __ptr_; }571 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI element_type* get() const _NOEXCEPT { return __ptr_; }
632572
633 _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<element_type> operator*() const _NOEXCEPT { return *__ptr_; }573 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<element_type> operator*() const _NOEXCEPT {
574 return *__ptr_;
575 }
634576
635 _LIBCPP_HIDE_FROM_ABI element_type* operator->() const _NOEXCEPT {577 _LIBCPP_HIDE_FROM_ABI element_type* operator->() const _NOEXCEPT {
636 static_assert(!is_array<_Tp>::value, "std::shared_ptr<T>::operator-> is only valid when T is not an array type.");578 static_assert(!is_array<_Tp>::value, "std::shared_ptr<T>::operator-> is only valid when T is not an array type.");
637 return __ptr_;579 return __ptr_;
638 }580 }
639581
640 _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT { return __cntrl_ ? __cntrl_->use_count() : 0; }582 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT {
583 return __cntrl_ ? __cntrl_->use_count() : 0;
584 }
641585
642#if _LIBCPP_STD_VER < 20 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_SHARED_PTR_UNIQUE)586#if _LIBCPP_STD_VER < 20 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_SHARED_PTR_UNIQUE)
643 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI bool unique() const _NOEXCEPT { return use_count() == 1; }587 [[__nodiscard__]] _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI bool unique() const _NOEXCEPT {
588 return use_count() == 1;
589 }
644#endif590#endif
645591
646 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return get() != nullptr; }592 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return get() != nullptr; }
647593
648 template <class _Up>594 template <class _Up>
649 _LIBCPP_HIDE_FROM_ABI bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT {595 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT {
650 return __cntrl_ < __p.__cntrl_;596 return __cntrl_ < __p.__cntrl_;
651 }597 }
652598
653 template <class _Up>599 template <class _Up>
654 _LIBCPP_HIDE_FROM_ABI bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT {600 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT {
655 return __cntrl_ < __p.__cntrl_;601 return __cntrl_ < __p.__cntrl_;
656 }602 }
657603
658 _LIBCPP_HIDE_FROM_ABI bool __owner_equivalent(const shared_ptr& __p) const { return __cntrl_ == __p.__cntrl_; }604 _LIBCPP_HIDE_FROM_ABI bool __owner_equivalent(const shared_ptr& __p) const { return __cntrl_ == __p.__cntrl_; }
659605
660#if _LIBCPP_STD_VER >= 17606#if _LIBCPP_STD_VER >= 17
661 _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<element_type> operator[](ptrdiff_t __i) const {607 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<element_type> operator[](ptrdiff_t __i) const {
662 static_assert(is_array<_Tp>::value, "std::shared_ptr<T>::operator[] is only valid when T is an array type.");608 static_assert(is_array<_Tp>::value, "std::shared_ptr<T>::operator[] is only valid when T is an array type.");
663 return __ptr_[__i];609 return __ptr_[__i];
664 }610 }
...@@ -729,7 +675,7 @@ shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;...@@ -729,7 +675,7 @@ shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;
729// std::allocate_shared and std::make_shared675// std::allocate_shared and std::make_shared
730//676//
731template <class _Tp, class _Alloc, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>677template <class _Tp, class _Alloc, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>
732_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&&... __args) {678[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&&... __args) {
733 using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;679 using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;
734 using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;680 using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
735 __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);681 __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);
...@@ -740,21 +686,21 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&&...@@ -740,21 +686,21 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&&
740}686}
741687
742template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>688template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>
743_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(_Args&&... __args) {689[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(_Args&&... __args) {
744 return std::allocate_shared<_Tp>(allocator<__remove_cv_t<_Tp> >(), std::forward<_Args>(__args)...);690 return std::allocate_shared<_Tp>(allocator<__remove_cv_t<_Tp> >(), std::forward<_Args>(__args)...);
745}691}
746692
747#if _LIBCPP_STD_VER >= 20693#if _LIBCPP_STD_VER >= 20
748694
749template <class _Tp, class _Alloc, __enable_if_t<!is_array<_Tp>::value, int> = 0>695template <class _Tp, class _Alloc, __enable_if_t<!is_array<_Tp>::value, int> = 0>
750_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {696[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {
751 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;697 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
752 _ForOverwriteAllocator __alloc(__a);698 _ForOverwriteAllocator __alloc(__a);
753 return std::allocate_shared<_Tp>(__alloc);699 return std::allocate_shared<_Tp>(__alloc);
754}700}
755701
756template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>702template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>
757_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() {703[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() {
758 return std::allocate_shared_for_overwrite<_Tp>(allocator<__remove_cv_t<_Tp>>());704 return std::allocate_shared_for_overwrite<_Tp>(allocator<__remove_cv_t<_Tp>>());
759}705}
760706
...@@ -946,67 +892,69 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Array> __allocate_shared_bounded_array(const _...@@ -946,67 +892,69 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Array> __allocate_shared_bounded_array(const _
946892
947// bounded array variants893// bounded array variants
948template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>894template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
949_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a) {895[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a) {
950 return std::__allocate_shared_bounded_array<_Tp>(__a);896 return std::__allocate_shared_bounded_array<_Tp>(__a);
951}897}
952898
953template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>899template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
954_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, const remove_extent_t<_Tp>& __u) {900[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
901allocate_shared(const _Alloc& __a, const remove_extent_t<_Tp>& __u) {
955 return std::__allocate_shared_bounded_array<_Tp>(__a, __u);902 return std::__allocate_shared_bounded_array<_Tp>(__a, __u);
956}903}
957904
958template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>905template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
959_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {906[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {
960 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;907 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
961 _ForOverwriteAllocator __alloc(__a);908 _ForOverwriteAllocator __alloc(__a);
962 return std::__allocate_shared_bounded_array<_Tp>(__alloc);909 return std::__allocate_shared_bounded_array<_Tp>(__alloc);
963}910}
964911
965template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>912template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
966_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared() {913[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared() {
967 return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>());914 return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>());
968}915}
969916
970template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>917template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
971_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(const remove_extent_t<_Tp>& __u) {918[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(const remove_extent_t<_Tp>& __u) {
972 return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>(), __u);919 return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>(), __u);
973}920}
974921
975template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>922template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
976_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() {923[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() {
977 return std::__allocate_shared_bounded_array<_Tp>(allocator<__for_overwrite_tag>());924 return std::__allocate_shared_bounded_array<_Tp>(allocator<__for_overwrite_tag>());
978}925}
979926
980// unbounded array variants927// unbounded array variants
981template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>928template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
982_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n) {929[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n) {
983 return std::__allocate_shared_unbounded_array<_Tp>(__a, __n);930 return std::__allocate_shared_unbounded_array<_Tp>(__a, __n);
984}931}
985932
986template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>933template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
987_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n, const remove_extent_t<_Tp>& __u) {934[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
935allocate_shared(const _Alloc& __a, size_t __n, const remove_extent_t<_Tp>& __u) {
988 return std::__allocate_shared_unbounded_array<_Tp>(__a, __n, __u);936 return std::__allocate_shared_unbounded_array<_Tp>(__a, __n, __u);
989}937}
990938
991template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>939template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
992_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a, size_t __n) {940[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a, size_t __n) {
993 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;941 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
994 _ForOverwriteAllocator __alloc(__a);942 _ForOverwriteAllocator __alloc(__a);
995 return std::__allocate_shared_unbounded_array<_Tp>(__alloc, __n);943 return std::__allocate_shared_unbounded_array<_Tp>(__alloc, __n);
996}944}
997945
998template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>946template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
999_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(size_t __n) {947[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(size_t __n) {
1000 return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n);948 return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n);
1001}949}
1002950
1003template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>951template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
1004_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(size_t __n, const remove_extent_t<_Tp>& __u) {952[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(size_t __n, const remove_extent_t<_Tp>& __u) {
1005 return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n, __u);953 return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n, __u);
1006}954}
1007955
1008template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>956template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
1009_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite(size_t __n) {957[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite(size_t __n) {
1010 return std::__allocate_shared_unbounded_array<_Tp>(allocator<__for_overwrite_tag>(), __n);958 return std::__allocate_shared_unbounded_array<_Tp>(allocator<__for_overwrite_tag>(), __n);
1011}959}
1012960
...@@ -1135,7 +1083,8 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __...@@ -1135,7 +1083,8 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __
1135}1083}
11361084
1137template <class _Tp, class _Up>1085template <class _Tp, class _Up>
1138inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {1086[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
1087static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
1139 return shared_ptr<_Tp>(__r, static_cast< typename shared_ptr<_Tp>::element_type*>(__r.get()));1088 return shared_ptr<_Tp>(__r, static_cast< typename shared_ptr<_Tp>::element_type*>(__r.get()));
1140}1089}
11411090
...@@ -1143,13 +1092,14 @@ inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(const shared_pt...@@ -1143,13 +1092,14 @@ inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(const shared_pt
1143// We don't backport because it is an evolutionary change.1092// We don't backport because it is an evolutionary change.
1144#if _LIBCPP_STD_VER >= 201093#if _LIBCPP_STD_VER >= 20
1145template <class _Tp, class _Up>1094template <class _Tp, class _Up>
1146_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(shared_ptr<_Up>&& __r) noexcept {1095[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
1147 return shared_ptr<_Tp>(std::move(__r), static_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));1096 return shared_ptr<_Tp>(std::move(__r), static_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
1148}1097}
1149#endif1098#endif
11501099
1151template <class _Tp, class _Up>1100template <class _Tp, class _Up>
1152inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {1101[[__nodiscard__]] inline
1102 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
1153 typedef typename shared_ptr<_Tp>::element_type _ET;1103 typedef typename shared_ptr<_Tp>::element_type _ET;
1154 _ET* __p = dynamic_cast<_ET*>(__r.get());1104 _ET* __p = dynamic_cast<_ET*>(__r.get());
1155 return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();1105 return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();
...@@ -1159,14 +1109,14 @@ inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(const shared_p...@@ -1159,14 +1109,14 @@ inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(const shared_p
1159// We don't backport because it is an evolutionary change.1109// We don't backport because it is an evolutionary change.
1160#if _LIBCPP_STD_VER >= 201110#if _LIBCPP_STD_VER >= 20
1161template <class _Tp, class _Up>1111template <class _Tp, class _Up>
1162_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(shared_ptr<_Up>&& __r) noexcept {1112[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
1163 auto* __p = dynamic_cast<typename shared_ptr<_Tp>::element_type*>(__r.get());1113 auto* __p = dynamic_cast<typename shared_ptr<_Tp>::element_type*>(__r.get());
1164 return __p ? shared_ptr<_Tp>(std::move(__r), __p) : shared_ptr<_Tp>();1114 return __p ? shared_ptr<_Tp>(std::move(__r), __p) : shared_ptr<_Tp>();
1165}1115}
1166#endif1116#endif
11671117
1168template <class _Tp, class _Up>1118template <class _Tp, class _Up>
1169_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {1119[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
1170 typedef typename shared_ptr<_Tp>::element_type _RTp;1120 typedef typename shared_ptr<_Tp>::element_type _RTp;
1171 return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));1121 return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
1172}1122}
...@@ -1175,13 +1125,13 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(const shared_ptr<_Up>&...@@ -1175,13 +1125,13 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(const shared_ptr<_Up>&
1175// We don't backport because it is an evolutionary change.1125// We don't backport because it is an evolutionary change.
1176#if _LIBCPP_STD_VER >= 201126#if _LIBCPP_STD_VER >= 20
1177template <class _Tp, class _Up>1127template <class _Tp, class _Up>
1178_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(shared_ptr<_Up>&& __r) noexcept {1128[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
1179 return shared_ptr<_Tp>(std::move(__r), const_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));1129 return shared_ptr<_Tp>(std::move(__r), const_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
1180}1130}
1181#endif1131#endif
11821132
1183template <class _Tp, class _Up>1133template <class _Tp, class _Up>
1184_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {1134[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
1185 return shared_ptr<_Tp>(__r, reinterpret_cast< typename shared_ptr<_Tp>::element_type*>(__r.get()));1135 return shared_ptr<_Tp>(__r, reinterpret_cast< typename shared_ptr<_Tp>::element_type*>(__r.get()));
1186}1136}
11871137
...@@ -1189,7 +1139,7 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<...@@ -1189,7 +1139,7 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<
1189// We don't backport because it is an evolutionary change.1139// We don't backport because it is an evolutionary change.
1190#if _LIBCPP_STD_VER >= 201140#if _LIBCPP_STD_VER >= 20
1191template <class _Tp, class _Up>1141template <class _Tp, class _Up>
1192_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(shared_ptr<_Up>&& __r) noexcept {1142[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
1193 return shared_ptr<_Tp>(std::move(__r), reinterpret_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));1143 return shared_ptr<_Tp>(std::move(__r), reinterpret_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
1194}1144}
1195#endif1145#endif
...@@ -1197,7 +1147,7 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(shared_ptr<_Up>&&...@@ -1197,7 +1147,7 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(shared_ptr<_Up>&&
1197#if _LIBCPP_HAS_RTTI1147#if _LIBCPP_HAS_RTTI
11981148
1199template <class _Dp, class _Tp>1149template <class _Dp, class _Tp>
1200inline _LIBCPP_HIDE_FROM_ABI _Dp* get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT {1150[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _Dp* get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT {
1201 return __p.template __get_deleter<_Dp>();1151 return __p.template __get_deleter<_Dp>();
1202}1152}
12031153
...@@ -1213,9 +1163,8 @@ public:...@@ -1213,9 +1163,8 @@ public:
1213#endif1163#endif
12141164
1215 // A weak_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require1165 // A weak_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require
1216 // any bookkeeping, so it's always trivially relocatable. It's also replaceable for the same reason.1166 // any bookkeeping, so it's always trivially relocatable.
1217 using __trivially_relocatable _LIBCPP_NODEBUG = weak_ptr;1167 using __trivially_relocatable _LIBCPP_NODEBUG = weak_ptr;
1218 using __replaceable _LIBCPP_NODEBUG = weak_ptr;
12191168
1220private:1169private:
1221 element_type* __ptr_;1170 element_type* __ptr_;
...@@ -1253,15 +1202,19 @@ public:...@@ -1253,15 +1202,19 @@ public:
1253 _LIBCPP_HIDE_FROM_ABI void swap(weak_ptr& __r) _NOEXCEPT;1202 _LIBCPP_HIDE_FROM_ABI void swap(weak_ptr& __r) _NOEXCEPT;
1254 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT;1203 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT;
12551204
1256 _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT { return __cntrl_ ? __cntrl_->use_count() : 0; }1205 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT {
1257 _LIBCPP_HIDE_FROM_ABI bool expired() const _NOEXCEPT { return __cntrl_ == nullptr || __cntrl_->use_count() == 0; }1206 return __cntrl_ ? __cntrl_->use_count() : 0;
1258 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> lock() const _NOEXCEPT;1207 }
1208 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool expired() const _NOEXCEPT {
1209 return __cntrl_ == nullptr || __cntrl_->use_count() == 0;
1210 }
1211 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> lock() const _NOEXCEPT;
1259 template <class _Up>1212 template <class _Up>
1260 _LIBCPP_HIDE_FROM_ABI bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT {1213 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT {
1261 return __cntrl_ < __r.__cntrl_;1214 return __cntrl_ < __r.__cntrl_;
1262 }1215 }
1263 template <class _Up>1216 template <class _Up>
1264 _LIBCPP_HIDE_FROM_ABI bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT {1217 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT {
1265 return __cntrl_ < __r.__cntrl_;1218 return __cntrl_ < __r.__cntrl_;
1266 }1219 }
12671220
...@@ -1445,13 +1398,15 @@ protected:...@@ -1445,13 +1398,15 @@ protected:
1445 _LIBCPP_HIDE_FROM_ABI ~enable_shared_from_this() {}1398 _LIBCPP_HIDE_FROM_ABI ~enable_shared_from_this() {}
14461399
1447public:1400public:
1448 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> shared_from_this() { return shared_ptr<_Tp>(__weak_this_); }1401 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> shared_from_this() { return shared_ptr<_Tp>(__weak_this_); }
1449 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp const> shared_from_this() const { return shared_ptr<const _Tp>(__weak_this_); }1402 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp const> shared_from_this() const {
1403 return shared_ptr<const _Tp>(__weak_this_);
1404 }
14501405
1451#if _LIBCPP_STD_VER >= 171406#if _LIBCPP_STD_VER >= 17
1452 _LIBCPP_HIDE_FROM_ABI weak_ptr<_Tp> weak_from_this() _NOEXCEPT { return __weak_this_; }1407 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI weak_ptr<_Tp> weak_from_this() _NOEXCEPT { return __weak_this_; }
14531408
1454 _LIBCPP_HIDE_FROM_ABI weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT { return __weak_this_; }1409 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT { return __weak_this_; }
1455#endif // _LIBCPP_STD_VER >= 171410#endif // _LIBCPP_STD_VER >= 17
14561411
1457 template <class _Up>1412 template <class _Up>
...@@ -1468,7 +1423,7 @@ struct hash<shared_ptr<_Tp> > {...@@ -1468,7 +1423,7 @@ struct hash<shared_ptr<_Tp> > {
1468 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;1423 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
1469#endif1424#endif
14701425
1471 _LIBCPP_HIDE_FROM_ABI size_t operator()(const shared_ptr<_Tp>& __ptr) const _NOEXCEPT {1426 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const shared_ptr<_Tp>& __ptr) const _NOEXCEPT {
1472 return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get());1427 return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get());
1473 }1428 }
1474};1429};
lib/libcxx/include/__memory/temp_value.h+1-2
...@@ -12,7 +12,6 @@...@@ -12,7 +12,6 @@
12#include <__config>12#include <__config>
13#include <__memory/addressof.h>13#include <__memory/addressof.h>
14#include <__memory/allocator_traits.h>14#include <__memory/allocator_traits.h>
15#include <__type_traits/aligned_storage.h>
16#include <__utility/forward.h>15#include <__utility/forward.h>
1716
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -26,7 +25,7 @@ struct __temp_value {...@@ -26,7 +25,7 @@ struct __temp_value {
26 typedef allocator_traits<_Alloc> _Traits;25 typedef allocator_traits<_Alloc> _Traits;
2726
28#ifdef _LIBCPP_CXX03_LANG27#ifdef _LIBCPP_CXX03_LANG
29 typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;28 _ALIGNAS_TYPE(_Tp) char __v[sizeof(_Tp)];
30#else29#else
31 union {30 union {
32 _Tp __v;31 _Tp __v;
lib/libcxx/include/__memory/uninitialized_algorithms.h+44-115
...@@ -32,7 +32,6 @@...@@ -32,7 +32,6 @@
32#include <__type_traits/is_trivially_assignable.h>32#include <__type_traits/is_trivially_assignable.h>
33#include <__type_traits/is_trivially_constructible.h>33#include <__type_traits/is_trivially_constructible.h>
34#include <__type_traits/is_trivially_relocatable.h>34#include <__type_traits/is_trivially_relocatable.h>
35#include <__type_traits/is_unbounded_array.h>
36#include <__type_traits/remove_const.h>35#include <__type_traits/remove_const.h>
37#include <__type_traits/remove_extent.h>36#include <__type_traits/remove_extent.h>
38#include <__utility/exception_guard.h>37#include <__utility/exception_guard.h>
...@@ -61,17 +60,10 @@ template <class _ValueType, class _InputIterator, class _Sentinel1, class _Forwa...@@ -61,17 +60,10 @@ template <class _ValueType, class _InputIterator, class _Sentinel1, class _Forwa
61inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_copy(60inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_copy(
62 _InputIterator __ifirst, _Sentinel1 __ilast, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {61 _InputIterator __ifirst, _Sentinel1 __ilast, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {
63 _ForwardIterator __idx = __ofirst;62 _ForwardIterator __idx = __ofirst;
64#if _LIBCPP_HAS_EXCEPTIONS63 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
65 try {64 for (; __ifirst != __ilast && !__stop_copying(__idx); ++__ifirst, (void)++__idx)
66#endif65 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
67 for (; __ifirst != __ilast && !__stop_copying(__idx); ++__ifirst, (void)++__idx)66 __guard.__complete();
68 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
69#if _LIBCPP_HAS_EXCEPTIONS
70 } catch (...) {
71 std::__destroy(__ofirst, __idx);
72 throw;
73 }
74#endif
7567
76 return pair<_InputIterator, _ForwardIterator>(std::move(__ifirst), std::move(__idx));68 return pair<_InputIterator, _ForwardIterator>(std::move(__ifirst), std::move(__idx));
77}69}
...@@ -91,17 +83,10 @@ template <class _ValueType, class _InputIterator, class _Size, class _ForwardIte...@@ -91,17 +83,10 @@ template <class _ValueType, class _InputIterator, class _Size, class _ForwardIte
91inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>83inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
92__uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {84__uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {
93 _ForwardIterator __idx = __ofirst;85 _ForwardIterator __idx = __ofirst;
94#if _LIBCPP_HAS_EXCEPTIONS86 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
95 try {87 for (; __n > 0 && !__stop_copying(__idx); ++__ifirst, (void)++__idx, (void)--__n)
96#endif88 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
97 for (; __n > 0 && !__stop_copying(__idx); ++__ifirst, (void)++__idx, (void)--__n)89 __guard.__complete();
98 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
99#if _LIBCPP_HAS_EXCEPTIONS
100 } catch (...) {
101 std::__destroy(__ofirst, __idx);
102 throw;
103 }
104#endif
10590
106 return pair<_InputIterator, _ForwardIterator>(std::move(__ifirst), std::move(__idx));91 return pair<_InputIterator, _ForwardIterator>(std::move(__ifirst), std::move(__idx));
107}92}
...@@ -121,17 +106,10 @@ template <class _ValueType, class _ForwardIterator, class _Sentinel, class _Tp>...@@ -121,17 +106,10 @@ template <class _ValueType, class _ForwardIterator, class _Sentinel, class _Tp>
121inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator106inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
122__uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) {107__uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) {
123 _ForwardIterator __idx = __first;108 _ForwardIterator __idx = __first;
124#if _LIBCPP_HAS_EXCEPTIONS109 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
125 try {110 for (; __idx != __last; ++__idx)
126#endif111 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__x);
127 for (; __idx != __last; ++__idx)112 __guard.__complete();
128 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__x);
129#if _LIBCPP_HAS_EXCEPTIONS
130 } catch (...) {
131 std::__destroy(__first, __idx);
132 throw;
133 }
134#endif
135113
136 return __idx;114 return __idx;
137}115}
...@@ -149,17 +127,10 @@ template <class _ValueType, class _ForwardIterator, class _Size, class _Tp>...@@ -149,17 +127,10 @@ template <class _ValueType, class _ForwardIterator, class _Size, class _Tp>
149inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator127inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
150__uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {128__uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
151 _ForwardIterator __idx = __first;129 _ForwardIterator __idx = __first;
152#if _LIBCPP_HAS_EXCEPTIONS130 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
153 try {131 for (; __n > 0; ++__idx, (void)--__n)
154#endif132 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__x);
155 for (; __n > 0; ++__idx, (void)--__n)133 __guard.__complete();
156 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__x);
157#if _LIBCPP_HAS_EXCEPTIONS
158 } catch (...) {
159 std::__destroy(__first, __idx);
160 throw;
161 }
162#endif
163134
164 return __idx;135 return __idx;
165}136}
...@@ -178,18 +149,11 @@ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {...@@ -178,18 +149,11 @@ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
178template <class _ValueType, class _ForwardIterator, class _Sentinel>149template <class _ValueType, class _ForwardIterator, class _Sentinel>
179inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator150inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
180__uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {151__uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
181 auto __idx = __first;152 auto __idx = __first;
182# if _LIBCPP_HAS_EXCEPTIONS153 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
183 try {154 for (; __idx != __last; ++__idx)
184# endif155 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType;
185 for (; __idx != __last; ++__idx)156 __guard.__complete();
186 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType;
187# if _LIBCPP_HAS_EXCEPTIONS
188 } catch (...) {
189 std::__destroy(__first, __idx);
190 throw;
191 }
192# endif
193157
194 return __idx;158 return __idx;
195}159}
...@@ -205,17 +169,10 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_default_construct(_ForwardIterat...@@ -205,17 +169,10 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_default_construct(_ForwardIterat
205template <class _ValueType, class _ForwardIterator, class _Size>169template <class _ValueType, class _ForwardIterator, class _Size>
206inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {170inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
207 auto __idx = __first;171 auto __idx = __first;
208# if _LIBCPP_HAS_EXCEPTIONS172 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
209 try {173 for (; __n > 0; ++__idx, (void)--__n)
210# endif174 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType;
211 for (; __n > 0; ++__idx, (void)--__n)175 __guard.__complete();
212 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType;
213# if _LIBCPP_HAS_EXCEPTIONS
214 } catch (...) {
215 std::__destroy(__first, __idx);
216 throw;
217 }
218# endif
219176
220 return __idx;177 return __idx;
221}178}
...@@ -231,18 +188,11 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_default_construct_n(...@@ -231,18 +188,11 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_default_construct_n(
231template <class _ValueType, class _ForwardIterator, class _Sentinel>188template <class _ValueType, class _ForwardIterator, class _Sentinel>
232inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator189inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
233__uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {190__uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
234 auto __idx = __first;191 auto __idx = __first;
235# if _LIBCPP_HAS_EXCEPTIONS192 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
236 try {193 for (; __idx != __last; ++__idx)
237# endif194 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType();
238 for (; __idx != __last; ++__idx)195 __guard.__complete();
239 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType();
240# if _LIBCPP_HAS_EXCEPTIONS
241 } catch (...) {
242 std::__destroy(__first, __idx);
243 throw;
244 }
245# endif
246196
247 return __idx;197 return __idx;
248}198}
...@@ -258,17 +208,10 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_value_construct(_ForwardIterator...@@ -258,17 +208,10 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_value_construct(_ForwardIterator
258template <class _ValueType, class _ForwardIterator, class _Size>208template <class _ValueType, class _ForwardIterator, class _Size>
259inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {209inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
260 auto __idx = __first;210 auto __idx = __first;
261# if _LIBCPP_HAS_EXCEPTIONS211 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
262 try {212 for (; __n > 0; ++__idx, (void)--__n)
263# endif213 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType();
264 for (; __n > 0; ++__idx, (void)--__n)214 __guard.__complete();
265 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType();
266# if _LIBCPP_HAS_EXCEPTIONS
267 } catch (...) {
268 std::__destroy(__first, __idx);
269 throw;
270 }
271# endif
272215
273 return __idx;216 return __idx;
274}217}
...@@ -293,19 +236,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali...@@ -293,19 +236,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
293 _ForwardIterator __ofirst,236 _ForwardIterator __ofirst,
294 _EndPredicate __stop_moving,237 _EndPredicate __stop_moving,
295 _IterMove __iter_move) {238 _IterMove __iter_move) {
296 auto __idx = __ofirst;239 auto __idx = __ofirst;
297# if _LIBCPP_HAS_EXCEPTIONS240 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
298 try {241 for (; __ifirst != __ilast && !__stop_moving(__idx); ++__idx, (void)++__ifirst) {
299# endif242 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__iter_move(__ifirst));
300 for (; __ifirst != __ilast && !__stop_moving(__idx); ++__idx, (void)++__ifirst) {
301 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__iter_move(__ifirst));
302 }
303# if _LIBCPP_HAS_EXCEPTIONS
304 } catch (...) {
305 std::__destroy(__ofirst, __idx);
306 throw;
307 }243 }
308# endif244 __guard.__complete();
309245
310 return {std::move(__ifirst), std::move(__idx)};246 return {std::move(__ifirst), std::move(__idx)};
311}247}
...@@ -331,18 +267,11 @@ template <class _ValueType,...@@ -331,18 +267,11 @@ template <class _ValueType,
331 class _IterMove>267 class _IterMove>
332inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_move_n(268inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_move_n(
333 _InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_moving, _IterMove __iter_move) {269 _InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_moving, _IterMove __iter_move) {
334 auto __idx = __ofirst;270 auto __idx = __ofirst;
335# if _LIBCPP_HAS_EXCEPTIONS271 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
336 try {272 for (; __n > 0 && !__stop_moving(__idx); ++__idx, (void)++__ifirst, --__n)
337# endif273 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__iter_move(__ifirst));
338 for (; __n > 0 && !__stop_moving(__idx); ++__idx, (void)++__ifirst, --__n)274 __guard.__complete();
339 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__iter_move(__ifirst));
340# if _LIBCPP_HAS_EXCEPTIONS
341 } catch (...) {
342 std::__destroy(__ofirst, __idx);
343 throw;
344 }
345# endif
346275
347 return {std::move(__ifirst), std::move(__idx)};276 return {std::move(__ifirst), std::move(__idx)};
348}277}
lib/libcxx/include/__memory/unique_ptr.h+14-16
...@@ -32,18 +32,15 @@...@@ -32,18 +32,15 @@
32#include <__type_traits/integral_constant.h>32#include <__type_traits/integral_constant.h>
33#include <__type_traits/is_array.h>33#include <__type_traits/is_array.h>
34#include <__type_traits/is_assignable.h>34#include <__type_traits/is_assignable.h>
35#include <__type_traits/is_bounded_array.h>
36#include <__type_traits/is_constant_evaluated.h>35#include <__type_traits/is_constant_evaluated.h>
37#include <__type_traits/is_constructible.h>36#include <__type_traits/is_constructible.h>
38#include <__type_traits/is_convertible.h>37#include <__type_traits/is_convertible.h>
39#include <__type_traits/is_function.h>38#include <__type_traits/is_function.h>
40#include <__type_traits/is_pointer.h>39#include <__type_traits/is_pointer.h>
41#include <__type_traits/is_reference.h>40#include <__type_traits/is_reference.h>
42#include <__type_traits/is_replaceable.h>
43#include <__type_traits/is_same.h>41#include <__type_traits/is_same.h>
44#include <__type_traits/is_swappable.h>42#include <__type_traits/is_swappable.h>
45#include <__type_traits/is_trivially_relocatable.h>43#include <__type_traits/is_trivially_relocatable.h>
46#include <__type_traits/is_unbounded_array.h>
47#include <__type_traits/is_void.h>44#include <__type_traits/is_void.h>
48#include <__type_traits/remove_extent.h>45#include <__type_traits/remove_extent.h>
49#include <__type_traits/type_identity.h>46#include <__type_traits/type_identity.h>
...@@ -145,8 +142,6 @@ public:...@@ -145,8 +142,6 @@ public:
145 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<deleter_type>::value,142 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<deleter_type>::value,
146 unique_ptr,143 unique_ptr,
147 void>;144 void>;
148 using __replaceable _LIBCPP_NODEBUG =
149 __conditional_t<__is_replaceable_v<pointer> && __is_replaceable_v<deleter_type>, unique_ptr, void>;
150145
151private:146private:
152 _LIBCPP_COMPRESSED_PAIR(pointer, __ptr_, deleter_type, __deleter_);147 _LIBCPP_COMPRESSED_PAIR(pointer, __ptr_, deleter_type, __deleter_);
...@@ -263,14 +258,17 @@ public:...@@ -263,14 +258,17 @@ public:
263 return *this;258 return *this;
264 }259 }
265260
266 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const
267 _NOEXCEPT_(_NOEXCEPT_(*std::declval<pointer>())) {262 _NOEXCEPT_(_NOEXCEPT_(*std::declval<pointer>())) {
268 return *__ptr_;263 return *__ptr_;
269 }264 }
270 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT { return __ptr_; }265 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT { return __ptr_; }
271 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT { return __ptr_; }266 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT { return __ptr_; }
272 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }267 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT {
273 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const deleter_type& get_deleter() const _NOEXCEPT {268 return __deleter_;
269 }
270 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const deleter_type&
271 get_deleter() const _NOEXCEPT {
274 return __deleter_;272 return __deleter_;
275 }273 }
276 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit operator bool() const _NOEXCEPT {274 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit operator bool() const _NOEXCEPT {
...@@ -413,8 +411,6 @@ public:...@@ -413,8 +411,6 @@ public:
413 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<deleter_type>::value,411 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<deleter_type>::value,
414 unique_ptr,412 unique_ptr,
415 void>;413 void>;
416 using __replaceable _LIBCPP_NODEBUG =
417 __conditional_t<__is_replaceable_v<pointer> && __is_replaceable_v<deleter_type>, unique_ptr, void>;
418414
419private:415private:
420 template <class _Up, class _OtherDeleter>416 template <class _Up, class _OtherDeleter>
...@@ -755,12 +751,13 @@ operator<=>(const unique_ptr<_T1, _D1>& __x, nullptr_t) {...@@ -755,12 +751,13 @@ operator<=>(const unique_ptr<_T1, _D1>& __x, nullptr_t) {
755#if _LIBCPP_STD_VER >= 14751#if _LIBCPP_STD_VER >= 14
756752
757template <class _Tp, class... _Args, enable_if_t<!is_array<_Tp>::value, int> = 0>753template <class _Tp, class... _Args, enable_if_t<!is_array<_Tp>::value, int> = 0>
758inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique(_Args&&... __args) {754[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
755_LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique(_Args&&... __args) {
759 return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));756 return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));
760}757}
761758
762template <class _Tp, enable_if_t<__is_unbounded_array_v<_Tp>, int> = 0>759template <class _Tp, enable_if_t<__is_unbounded_array_v<_Tp>, int> = 0>
763inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique(size_t __n) {760[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique(size_t __n) {
764 typedef __remove_extent_t<_Tp> _Up;761 typedef __remove_extent_t<_Tp> _Up;
765 return unique_ptr<_Tp>(__private_constructor_tag(), new _Up[__n](), __n);762 return unique_ptr<_Tp>(__private_constructor_tag(), new _Up[__n](), __n);
766}763}
...@@ -773,12 +770,13 @@ void make_unique(_Args&&...) = delete;...@@ -773,12 +770,13 @@ void make_unique(_Args&&...) = delete;
773#if _LIBCPP_STD_VER >= 20770#if _LIBCPP_STD_VER >= 20
774771
775template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>772template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>
776_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique_for_overwrite() {773[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique_for_overwrite() {
777 return unique_ptr<_Tp>(new _Tp);774 return unique_ptr<_Tp>(new _Tp);
778}775}
779776
780template <class _Tp, enable_if_t<is_unbounded_array_v<_Tp>, int> = 0>777template <class _Tp, enable_if_t<is_unbounded_array_v<_Tp>, int> = 0>
781_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp> make_unique_for_overwrite(size_t __n) {778[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr<_Tp>
779make_unique_for_overwrite(size_t __n) {
782 return unique_ptr<_Tp>(__private_constructor_tag(), new __remove_extent_t<_Tp>[__n], __n);780 return unique_ptr<_Tp>(__private_constructor_tag(), new __remove_extent_t<_Tp>[__n], __n);
783}781}
784782
...@@ -802,7 +800,7 @@ struct hash<__enable_hash_helper< unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp,...@@ -802,7 +800,7 @@ struct hash<__enable_hash_helper< unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp,
802 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;800 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
803#endif801#endif
804802
805 _LIBCPP_HIDE_FROM_ABI size_t operator()(const unique_ptr<_Tp, _Dp>& __ptr) const {803 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const unique_ptr<_Tp, _Dp>& __ptr) const {
806 typedef typename unique_ptr<_Tp, _Dp>::pointer pointer;804 typedef typename unique_ptr<_Tp, _Dp>::pointer pointer;
807 return hash<pointer>()(__ptr.get());805 return hash<pointer>()(__ptr.get());
808 }806 }
lib/libcxx/include/__memory/uses_allocator_construction.h+1
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include <__type_traits/remove_cv.h>17#include <__type_traits/remove_cv.h>
18#include <__utility/declval.h>18#include <__utility/declval.h>
19#include <__utility/pair.h>19#include <__utility/pair.h>
20#include <__utility/piecewise_construct.h>
20#include <tuple>21#include <tuple>
2122
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/__memory_resource/memory_resource.h+4-2
...@@ -42,7 +42,9 @@ public:...@@ -42,7 +42,9 @@ public:
42 do_deallocate(__p, __bytes, __align);42 do_deallocate(__p, __bytes, __align);
43 }43 }
4444
45 _LIBCPP_HIDE_FROM_ABI bool is_equal(const memory_resource& __other) const noexcept { return do_is_equal(__other); }45 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_equal(const memory_resource& __other) const noexcept {
46 return do_is_equal(__other);
47 }
4648
47private:49private:
48 virtual void* do_allocate(size_t, size_t) = 0;50 virtual void* do_allocate(size_t, size_t) = 0;
...@@ -68,7 +70,7 @@ operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept...@@ -68,7 +70,7 @@ operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept
6870
69// [mem.res.global]71// [mem.res.global]
7072
71[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*73[[nodiscard, __gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
72get_default_resource() noexcept;74get_default_resource() noexcept;
7375
74[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*76[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
lib/libcxx/include/__memory_resource/monotonic_buffer_resource.h+1-1
...@@ -93,7 +93,7 @@ public:...@@ -93,7 +93,7 @@ public:
93 }93 }
94 }94 }
9595
96 _LIBCPP_HIDE_FROM_ABI memory_resource* upstream_resource() const { return __res_; }96 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI memory_resource* upstream_resource() const { return __res_; }
9797
98protected:98protected:
99 void* do_allocate(size_t __bytes, size_t __alignment) override; // key function99 void* do_allocate(size_t __bytes, size_t __alignment) override; // key function
lib/libcxx/include/__memory_resource/polymorphic_allocator.h+13-8
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#include <__new/exceptions.h>18#include <__new/exceptions.h>
19#include <__new/placement_new_delete.h>19#include <__new/placement_new_delete.h>
20#include <__utility/exception_guard.h>20#include <__utility/exception_guard.h>
21#include <__utility/piecewise_construct.h>
21#include <limits>22#include <limits>
22#include <tuple>23#include <tuple>
2324
...@@ -50,7 +51,9 @@ public:...@@ -50,7 +51,9 @@ public:
5051
51 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator() noexcept : __res_(std::pmr::get_default_resource()) {}52 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator() noexcept : __res_(std::pmr::get_default_resource()) {}
5253
53 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(memory_resource* __r) noexcept : __res_(__r) {}54 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(memory_resource* _LIBCPP_DIAGNOSE_NULLPTR __r) noexcept : __res_(__r) {
55 _LIBCPP_ASSERT_NON_NULL(__r, "Attempted to pass a nullptr resource to polymorphic_alloator");
56 }
5457
55 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(const polymorphic_allocator&) = default;58 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(const polymorphic_allocator&) = default;
5659
...@@ -133,10 +136,10 @@ public:...@@ -133,10 +136,10 @@ public:
133 piecewise_construct,136 piecewise_construct,
134 __transform_tuple(typename __uses_alloc_ctor< _T1, polymorphic_allocator&, _Args1... >::type(),137 __transform_tuple(typename __uses_alloc_ctor< _T1, polymorphic_allocator&, _Args1... >::type(),
135 std::move(__x),138 std::move(__x),
136 typename __make_tuple_indices<sizeof...(_Args1)>::type{}),139 make_index_sequence<sizeof...(_Args1)>()),
137 __transform_tuple(typename __uses_alloc_ctor< _T2, polymorphic_allocator&, _Args2... >::type(),140 __transform_tuple(typename __uses_alloc_ctor< _T2, polymorphic_allocator&, _Args2... >::type(),
138 std::move(__y),141 std::move(__y),
139 typename __make_tuple_indices<sizeof...(_Args2)>::type{}));142 make_index_sequence<sizeof...(_Args2)>()));
140 }143 }
141144
142 template <class _T1, class _T2>145 template <class _T1, class _T2>
...@@ -170,11 +173,13 @@ public:...@@ -170,11 +173,13 @@ public:
170 __p->~_Tp();173 __p->~_Tp();
171 }174 }
172175
173 _LIBCPP_HIDE_FROM_ABI polymorphic_allocator select_on_container_copy_construction() const noexcept {176 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI polymorphic_allocator select_on_container_copy_construction() const noexcept {
174 return polymorphic_allocator();177 return polymorphic_allocator();
175 }178 }
176179
177 _LIBCPP_HIDE_FROM_ABI memory_resource* resource() const noexcept { return __res_; }180 [[nodiscard, __gnu__::__returns_nonnull__]] _LIBCPP_HIDE_FROM_ABI memory_resource* resource() const noexcept {
181 return __res_;
182 }
178183
179 _LIBCPP_HIDE_FROM_ABI friend bool184 _LIBCPP_HIDE_FROM_ABI friend bool
180 operator==(const polymorphic_allocator& __lhs, const polymorphic_allocator& __rhs) noexcept {185 operator==(const polymorphic_allocator& __lhs, const polymorphic_allocator& __rhs) noexcept {
...@@ -192,20 +197,20 @@ public:...@@ -192,20 +197,20 @@ public:
192private:197private:
193 template <class... _Args, size_t... _Is>198 template <class... _Args, size_t... _Is>
194 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&...>199 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&...>
195 __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t, __tuple_indices<_Is...>) {200 __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t, index_sequence<_Is...>) {
196 return std::forward_as_tuple(std::get<_Is>(std::move(__t))...);201 return std::forward_as_tuple(std::get<_Is>(std::move(__t))...);
197 }202 }
198203
199 template <class... _Args, size_t... _Is>204 template <class... _Args, size_t... _Is>
200 _LIBCPP_HIDE_FROM_ABI tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>205 _LIBCPP_HIDE_FROM_ABI tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>
201 __transform_tuple(integral_constant<int, 1>, tuple<_Args...>&& __t, __tuple_indices<_Is...>) {206 __transform_tuple(integral_constant<int, 1>, tuple<_Args...>&& __t, index_sequence<_Is...>) {
202 using _Tup = tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>;207 using _Tup = tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>;
203 return _Tup(allocator_arg, *this, std::get<_Is>(std::move(__t))...);208 return _Tup(allocator_arg, *this, std::get<_Is>(std::move(__t))...);
204 }209 }
205210
206 template <class... _Args, size_t... _Is>211 template <class... _Args, size_t... _Is>
207 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&..., polymorphic_allocator&>212 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&..., polymorphic_allocator&>
208 __transform_tuple(integral_constant<int, 2>, tuple<_Args...>&& __t, __tuple_indices<_Is...>) {213 __transform_tuple(integral_constant<int, 2>, tuple<_Args...>&& __t, index_sequence<_Is...>) {
209 using _Tup = tuple<_Args&&..., polymorphic_allocator&>;214 using _Tup = tuple<_Args&&..., polymorphic_allocator&>;
210 return _Tup(std::get<_Is>(std::move(__t))..., *this);215 return _Tup(std::get<_Is>(std::move(__t))..., *this);
211 }216 }
lib/libcxx/include/__memory_resource/pool_options.h+1-1
...@@ -24,7 +24,7 @@ namespace pmr {...@@ -24,7 +24,7 @@ namespace pmr {
2424
25// [mem.res.pool.options]25// [mem.res.pool.options]
2626
27struct _LIBCPP_EXPORTED_FROM_ABI pool_options {27struct pool_options {
28 size_t max_blocks_per_chunk = 0;28 size_t max_blocks_per_chunk = 0;
29 size_t largest_required_pool_block = 0;29 size_t largest_required_pool_block = 0;
30};30};
lib/libcxx/include/__memory_resource/synchronized_pool_resource.h+4-2
...@@ -56,9 +56,11 @@ public:...@@ -56,9 +56,11 @@ public:
56 __unsync_.release();56 __unsync_.release();
57 }57 }
5858
59 _LIBCPP_HIDE_FROM_ABI memory_resource* upstream_resource() const { return __unsync_.upstream_resource(); }59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI memory_resource* upstream_resource() const {
60 return __unsync_.upstream_resource();
61 }
6062
61 _LIBCPP_HIDE_FROM_ABI pool_options options() const { return __unsync_.options(); }63 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pool_options options() const { return __unsync_.options(); }
6264
63protected:65protected:
64 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void* do_allocate(size_t __bytes, size_t __align) override {66 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void* do_allocate(size_t __bytes, size_t __align) override {
lib/libcxx/include/__memory_resource/unsynchronized_pool_resource.h+1-1
...@@ -76,7 +76,7 @@ public:...@@ -76,7 +76,7 @@ public:
7676
77 void release();77 void release();
7878
79 _LIBCPP_HIDE_FROM_ABI memory_resource* upstream_resource() const { return __res_; }79 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI memory_resource* upstream_resource() const { return __res_; }
8080
81 [[__gnu__::__pure__]] pool_options options() const;81 [[__gnu__::__pure__]] pool_options options() const;
8282
lib/libcxx/include/__mutex/mutex.h+2-2
...@@ -37,11 +37,11 @@ public:...@@ -37,11 +37,11 @@ public:
37# endif37# endif
3838
39 _LIBCPP_ACQUIRE_CAPABILITY() void lock();39 _LIBCPP_ACQUIRE_CAPABILITY() void lock();
40 _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock() _NOEXCEPT;40 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock() _NOEXCEPT;
41 _LIBCPP_RELEASE_CAPABILITY void unlock() _NOEXCEPT;41 _LIBCPP_RELEASE_CAPABILITY void unlock() _NOEXCEPT;
4242
43 typedef __libcpp_mutex_t* native_handle_type;43 typedef __libcpp_mutex_t* native_handle_type;
44 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }44 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }
45};45};
4646
47static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");47static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");
lib/libcxx/include/__mutex/once_flag.h+14-11
...@@ -10,12 +10,11 @@...@@ -10,12 +10,11 @@
10#define _LIBCPP___MUTEX_ONCE_FLAG_H10#define _LIBCPP___MUTEX_ONCE_FLAG_H
1111
12#include <__config>12#include <__config>
13#include <__functional/invoke.h>
14#include <__memory/addressof.h>13#include <__memory/addressof.h>
15#include <__memory/shared_count.h> // __libcpp_acquire_load
16#include <__tuple/tuple_indices.h>
17#include <__tuple/tuple_size.h>14#include <__tuple/tuple_size.h>
15#include <__type_traits/invoke.h>
18#include <__utility/forward.h>16#include <__utility/forward.h>
17#include <__utility/integer_sequence.h>
19#include <__utility/move.h>18#include <__utility/move.h>
20#include <cstdint>19#include <cstdint>
21#ifndef _LIBCPP_CXX03_LANG20#ifndef _LIBCPP_CXX03_LANG
...@@ -88,14 +87,9 @@ public:...@@ -88,14 +87,9 @@ public:
88 _LIBCPP_HIDE_FROM_ABI explicit __call_once_param(_Fp& __f) : __f_(__f) {}87 _LIBCPP_HIDE_FROM_ABI explicit __call_once_param(_Fp& __f) : __f_(__f) {}
8988
90 _LIBCPP_HIDE_FROM_ABI void operator()() {89 _LIBCPP_HIDE_FROM_ABI void operator()() {
91 typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;90 [&]<size_t... _Indices>(__index_sequence<_Indices...>) -> void {
92 __execute(_Index());91 std::__invoke(std::get<_Indices>(std::move(__f_))...);
93 }92 }(__make_index_sequence<tuple_size<_Fp>::value>());
94
95private:
96 template <size_t... _Indices>
97 _LIBCPP_HIDE_FROM_ABI void __execute(__tuple_indices<_Indices...>) {
98 std::__invoke(std::get<0>(std::move(__f_)), std::get<_Indices>(std::move(__f_))...);
99 }93 }
100};94};
10195
...@@ -121,6 +115,15 @@ void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {...@@ -121,6 +115,15 @@ void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {
121115
122_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));116_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));
123117
118template <class _ValueType>
119inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) {
120#if _LIBCPP_HAS_THREADS
121 return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
122#else
123 return *__value;
124#endif
125}
126
124#ifndef _LIBCPP_CXX03_LANG127#ifndef _LIBCPP_CXX03_LANG
125128
126template <class _Callable, class... _Args>129template <class _Callable, class... _Args>
lib/libcxx/include/__mutex/tag_types.h+3-3
...@@ -17,15 +17,15 @@...@@ -17,15 +17,15 @@
1717
18_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
1919
20struct _LIBCPP_EXPORTED_FROM_ABI defer_lock_t {20struct defer_lock_t {
21 explicit defer_lock_t() = default;21 explicit defer_lock_t() = default;
22};22};
2323
24struct _LIBCPP_EXPORTED_FROM_ABI try_to_lock_t {24struct try_to_lock_t {
25 explicit try_to_lock_t() = default;25 explicit try_to_lock_t() = default;
26};26};
2727
28struct _LIBCPP_EXPORTED_FROM_ABI adopt_lock_t {28struct adopt_lock_t {
29 explicit adopt_lock_t() = default;29 explicit adopt_lock_t() = default;
30};30};
3131
lib/libcxx/include/__mutex/unique_lock.h+8-7
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#include <__memory/addressof.h>15#include <__memory/addressof.h>
16#include <__mutex/tag_types.h>16#include <__mutex/tag_types.h>
17#include <__system_error/throw_system_error.h>17#include <__system_error/throw_system_error.h>
18#include <__utility/move.h>
18#include <__utility/swap.h>19#include <__utility/swap.h>
19#include <cerrno>20#include <cerrno>
2021
...@@ -22,6 +23,9 @@...@@ -22,6 +23,9 @@
22# pragma GCC system_header23# pragma GCC system_header
23#endif24#endif
2425
26_LIBCPP_PUSH_MACROS
27#include <__undef_macros>
28
25_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
2630
27template <class _Mutex>31template <class _Mutex>
...@@ -74,13 +78,8 @@ public:...@@ -74,13 +78,8 @@ public:
74 }78 }
7579
76 _LIBCPP_HIDE_FROM_ABI unique_lock& operator=(unique_lock&& __u) _NOEXCEPT {80 _LIBCPP_HIDE_FROM_ABI unique_lock& operator=(unique_lock&& __u) _NOEXCEPT {
77 if (__owns_)81 if (this != std::addressof(__u))
78 __m_->unlock();82 unique_lock(std::move(__u)).swap(*this);
79
80 __m_ = __u.__m_;
81 __owns_ = __u.__owns_;
82 __u.__m_ = nullptr;
83 __u.__owns_ = false;
84 return *this;83 return *this;
85 }84 }
8685
...@@ -170,4 +169,6 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(unique_lock<_Mutex>& __x, unique_lock<_Mu...@@ -170,4 +169,6 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(unique_lock<_Mutex>& __x, unique_lock<_Mu
170169
171_LIBCPP_END_NAMESPACE_STD170_LIBCPP_END_NAMESPACE_STD
172171
172_LIBCPP_POP_MACROS
173
173#endif // _LIBCPP___MUTEX_UNIQUE_LOCK_H174#endif // _LIBCPP___MUTEX_UNIQUE_LOCK_H
lib/libcxx/include/__new/align_val_t.h+6
...@@ -16,6 +16,12 @@...@@ -16,6 +16,12 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19// <vcruntime_exception.h> defines its own std::align_val_t type,
20// which we use in order to be ABI-compatible with other STLs on Windows.
21#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION && defined(_LIBCPP_ABI_VCRUNTIME)
22# include <vcruntime_new.h>
23#endif
24
19_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD25_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
20#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION && !defined(_LIBCPP_ABI_VCRUNTIME)26#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION && !defined(_LIBCPP_ABI_VCRUNTIME)
21# ifndef _LIBCPP_CXX03_LANG27# ifndef _LIBCPP_CXX03_LANG
lib/libcxx/include/__new/allocate.h+1-2
...@@ -13,7 +13,6 @@...@@ -13,7 +13,6 @@
13#include <__cstddef/max_align_t.h>13#include <__cstddef/max_align_t.h>
14#include <__cstddef/size_t.h>14#include <__cstddef/size_t.h>
15#include <__new/align_val_t.h>15#include <__new/align_val_t.h>
16#include <__new/global_new_delete.h> // for _LIBCPP_HAS_SIZED_DEALLOCATION
17#include <__type_traits/type_identity.h>16#include <__type_traits/type_identity.h>
18#include <__utility/element_count.h>17#include <__utility/element_count.h>
1918
...@@ -43,7 +42,7 @@ __libcpp_allocate(__element_count __n, [[__maybe_unused__]] size_t __align = _LI...@@ -43,7 +42,7 @@ __libcpp_allocate(__element_count __n, [[__maybe_unused__]] size_t __align = _LI
43 return static_cast<_Tp*>(__builtin_operator_new(__size));42 return static_cast<_Tp*>(__builtin_operator_new(__size));
44}43}
4544
46#if _LIBCPP_HAS_SIZED_DEALLOCATION45#if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
47# define _LIBCPP_ONLY_IF_SIZED_DEALLOCATION(...) __VA_ARGS__46# define _LIBCPP_ONLY_IF_SIZED_DEALLOCATION(...) __VA_ARGS__
48#else47#else
49# define _LIBCPP_ONLY_IF_SIZED_DEALLOCATION(...) /* nothing */48# define _LIBCPP_ONLY_IF_SIZED_DEALLOCATION(...) /* nothing */
lib/libcxx/include/__new/exceptions.h+8-2
...@@ -17,6 +17,12 @@...@@ -17,6 +17,12 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20// <vcruntime_exception.h> defines its own std::bad_alloc type,
21// which we use in order to be ABI-compatible with other STLs on Windows.
22#if defined(_LIBCPP_ABI_VCRUNTIME)
23# include <vcruntime_exception.h>
24#endif
25
20_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD26_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
21#if !defined(_LIBCPP_ABI_VCRUNTIME)27#if !defined(_LIBCPP_ABI_VCRUNTIME)
2228
...@@ -26,7 +32,7 @@ public:...@@ -26,7 +32,7 @@ public:
26 _LIBCPP_HIDE_FROM_ABI bad_alloc(const bad_alloc&) _NOEXCEPT = default;32 _LIBCPP_HIDE_FROM_ABI bad_alloc(const bad_alloc&) _NOEXCEPT = default;
27 _LIBCPP_HIDE_FROM_ABI bad_alloc& operator=(const bad_alloc&) _NOEXCEPT = default;33 _LIBCPP_HIDE_FROM_ABI bad_alloc& operator=(const bad_alloc&) _NOEXCEPT = default;
28 ~bad_alloc() _NOEXCEPT override;34 ~bad_alloc() _NOEXCEPT override;
29 const char* what() const _NOEXCEPT override;35 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
30};36};
3137
32class _LIBCPP_EXPORTED_FROM_ABI bad_array_new_length : public bad_alloc {38class _LIBCPP_EXPORTED_FROM_ABI bad_array_new_length : public bad_alloc {
...@@ -35,7 +41,7 @@ public:...@@ -35,7 +41,7 @@ public:
35 _LIBCPP_HIDE_FROM_ABI bad_array_new_length(const bad_array_new_length&) _NOEXCEPT = default;41 _LIBCPP_HIDE_FROM_ABI bad_array_new_length(const bad_array_new_length&) _NOEXCEPT = default;
36 _LIBCPP_HIDE_FROM_ABI bad_array_new_length& operator=(const bad_array_new_length&) _NOEXCEPT = default;42 _LIBCPP_HIDE_FROM_ABI bad_array_new_length& operator=(const bad_array_new_length&) _NOEXCEPT = default;
37 ~bad_array_new_length() _NOEXCEPT override;43 ~bad_array_new_length() _NOEXCEPT override;
38 const char* what() const _NOEXCEPT override;44 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
39};45};
4046
41#elif defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 // !_LIBCPP_ABI_VCRUNTIME47#elif defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 // !_LIBCPP_ABI_VCRUNTIME
lib/libcxx/include/__new/global_new_delete.h+4-11
...@@ -12,7 +12,6 @@...@@ -12,7 +12,6 @@
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <__new/align_val_t.h>14#include <__new/align_val_t.h>
15#include <__new/exceptions.h>
16#include <__new/nothrow_t.h>15#include <__new/nothrow_t.h>
1716
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -25,12 +24,6 @@...@@ -25,12 +24,6 @@
25# define _THROW_BAD_ALLOC24# define _THROW_BAD_ALLOC
26#endif25#endif
2726
28#if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
29# define _LIBCPP_HAS_SIZED_DEALLOCATION 1
30#else
31# define _LIBCPP_HAS_SIZED_DEALLOCATION 0
32#endif
33
34#if defined(_LIBCPP_ABI_VCRUNTIME)27#if defined(_LIBCPP_ABI_VCRUNTIME)
35# include <new.h>28# include <new.h>
36#else29#else
...@@ -39,7 +32,7 @@...@@ -39,7 +32,7 @@
39 _LIBCPP_NOALIAS;32 _LIBCPP_NOALIAS;
40_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;33_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
41_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;34_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
42# if _LIBCPP_HAS_SIZED_DEALLOCATION35# if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
43_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;36_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
44# endif37# endif
4538
...@@ -48,7 +41,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _...@@ -48,7 +41,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _
48 _LIBCPP_NOALIAS;41 _LIBCPP_NOALIAS;
49_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;42_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
50_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;43_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
51# if _LIBCPP_HAS_SIZED_DEALLOCATION44# if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
52_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;45_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
53# endif46# endif
5447
...@@ -58,7 +51,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz)...@@ -58,7 +51,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz)
58operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;51operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
59_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;52_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
60_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;53_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
61# if _LIBCPP_HAS_SIZED_DEALLOCATION54# if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
62_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;55_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
63# endif56# endif
6457
...@@ -68,7 +61,7 @@ operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;...@@ -68,7 +61,7 @@ operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
68operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;61operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
69_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;62_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
70_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;63_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
71# if _LIBCPP_HAS_SIZED_DEALLOCATION64# if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
72_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;65_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
73# endif66# endif
74# endif67# endif
lib/libcxx/include/__new/interference_size.h-4
...@@ -20,13 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -20,13 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2020
21#if _LIBCPP_STD_VER >= 1721#if _LIBCPP_STD_VER >= 17
2222
23# if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
24
25inline constexpr size_t hardware_destructive_interference_size = __GCC_DESTRUCTIVE_SIZE;23inline constexpr size_t hardware_destructive_interference_size = __GCC_DESTRUCTIVE_SIZE;
26inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUCTIVE_SIZE;24inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUCTIVE_SIZE;
2725
28# endif // defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
29
30#endif // _LIBCPP_STD_VER >= 1726#endif // _LIBCPP_STD_VER >= 17
3127
32_LIBCPP_END_NAMESPACE_STD28_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__new/launder.h+3-5
...@@ -10,8 +10,6 @@...@@ -10,8 +10,6 @@
10#define _LIBCPP___NEW_LAUNDER_H10#define _LIBCPP___NEW_LAUNDER_H
1111
12#include <__config>12#include <__config>
13#include <__type_traits/is_function.h>
14#include <__type_traits/is_void.h>
1513
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header15# pragma GCC system_header
...@@ -20,15 +18,15 @@...@@ -20,15 +18,15 @@
20_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
21template <class _Tp>19template <class _Tp>
22[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT {20[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT {
23 static_assert(!(is_function<_Tp>::value), "can't launder functions");21 // The compiler diagnoses misuses of __builtin_launder, so we don't need to add any static_asserts
24 static_assert(!is_void<_Tp>::value, "can't launder cv-void");22 // to implement the Mandates.
25 return __builtin_launder(__p);23 return __builtin_launder(__p);
26}24}
2725
28#if _LIBCPP_STD_VER >= 1726#if _LIBCPP_STD_VER >= 17
29template <class _Tp>27template <class _Tp>
30[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp* launder(_Tp* __p) noexcept {28[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp* launder(_Tp* __p) noexcept {
31 return std::__launder(__p);29 return __builtin_launder(__p);
32}30}
33#endif31#endif
34_LIBCPP_END_NAMESPACE_STD32_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__new/nothrow_t.h+1-1
...@@ -19,7 +19,7 @@...@@ -19,7 +19,7 @@
19# include <new.h>19# include <new.h>
20#else20#else
21_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD21_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
22struct _LIBCPP_EXPORTED_FROM_ABI nothrow_t {22struct nothrow_t {
23 explicit nothrow_t() = default;23 explicit nothrow_t() = default;
24};24};
25extern _LIBCPP_EXPORTED_FROM_ABI const nothrow_t nothrow;25extern _LIBCPP_EXPORTED_FROM_ABI const nothrow_t nothrow;
lib/libcxx/include/__numeric/gcd_lcm.h+24-34
...@@ -33,28 +33,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -33,28 +33,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3333
34#if _LIBCPP_STD_VER >= 1734#if _LIBCPP_STD_VER >= 17
3535
36template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value>36template <class _Result, class _Source>
37struct __ct_abs;37constexpr _LIBCPP_HIDE_FROM_ABI _Result __abs_in_type(_Source __t) noexcept {
3838 if constexpr (is_signed_v<_Source>) {
39template <typename _Result, typename _Source>
40struct __ct_abs<_Result, _Source, true> {
41 constexpr _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept {
42 if (__t >= 0)39 if (__t >= 0)
43 return __t;40 return __t;
44 if (__t == numeric_limits<_Source>::min())41 if (__t == numeric_limits<_Source>::min())
45 return -static_cast<_Result>(__t);42 return -static_cast<_Result>(__t);
46 return -__t;43 return -__t;
44 } else {
45 return __t;
47 }46 }
48};47}
49
50template <typename _Result, typename _Source>
51struct __ct_abs<_Result, _Source, false> {
52 constexpr _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { return __t; }
53};
5448
55template <class _Tp>49template <class _Tp, class _Up>
56constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {50constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {
57 static_assert(!is_signed<_Tp>::value, "");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");
53 static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to gcd cannot be bool");
54 using _Rp = common_type_t<_Tp, _Up>;
55 using _Wp = make_unsigned_t<_Rp>;
5856
59 // Using Binary GCD algorithm https://en.wikipedia.org/wiki/Binary_GCD_algorithm, based on an implementation57 // Using Binary GCD algorithm https://en.wikipedia.org/wiki/Binary_GCD_algorithm, based on an implementation
60 // from https://lemire.me/blog/2024/04/13/greatest-common-divisor-the-extended-euclidean-algorithm-and-speed/58 // from https://lemire.me/blog/2024/04/13/greatest-common-divisor-the-extended-euclidean-algorithm-and-speed/
...@@ -67,22 +65,25 @@ constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {...@@ -67,22 +65,25 @@ constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {
67 //65 //
68 // And standard gcd algorithm where instead of modulo, minus is used.66 // And standard gcd algorithm where instead of modulo, minus is used.
6967
68 auto __a = static_cast<_Wp>(std::__abs_in_type<_Rp>(__m));
69 auto __b = static_cast<_Wp>(std::__abs_in_type<_Rp>(__n));
70
70 if (__a < __b) {71 if (__a < __b) {
71 _Tp __tmp = __b;72 _Wp __tmp = __b;
72 __b = __a;73 __b = __a;
73 __a = __tmp;74 __a = __tmp;
74 }75 }
75 if (__b == 0)76 if (__b == 0)
76 return __a;77 return static_cast<_Rp>(__a);
77 __a %= __b; // Make both argument of the same size, and early result in the easy case.78 __a %= __b; // Make both argument of the same size, and early result in the easy case.
78 if (__a == 0)79 if (__a == 0)
79 return __b;80 return static_cast<_Rp>(__b);
8081
81 _Tp __c = __a | __b;82 _Wp __c = __a | __b;
82 int __shift = std::__countr_zero(__c);83 int __shift = std::__countr_zero(__c);
83 __a >>= std::__countr_zero(__a);84 __a >>= std::__countr_zero(__a);
84 do {85 do {
85 _Tp __t = __b >> std::__countr_zero(__b);86 _Wp __t = __b >> std::__countr_zero(__b);
86 if (__a > __t) {87 if (__a > __t) {
87 __b = __a - __t;88 __b = __a - __t;
88 __a = __t;89 __a = __t;
...@@ -90,18 +91,7 @@ constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {...@@ -90,18 +91,7 @@ constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {
90 __b = __t - __a;91 __b = __t - __a;
91 }92 }
92 } while (__b != 0);93 } while (__b != 0);
93 return __a << __shift;94 return static_cast<_Rp>(__a << __shift);
94}
95
96template <class _Tp, class _Up>
97constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {
98 static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to gcd must be integer types");
99 static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to gcd cannot be bool");
100 static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to gcd cannot be bool");
101 using _Rp = common_type_t<_Tp, _Up>;
102 using _Wp = make_unsigned_t<_Rp>;
103 return static_cast<_Rp>(
104 std::__gcd(static_cast<_Wp>(__ct_abs<_Rp, _Tp>()(__m)), static_cast<_Wp>(__ct_abs<_Rp, _Up>()(__n))));
105}95}
10696
107template <class _Tp, class _Up>97template <class _Tp, class _Up>
...@@ -113,8 +103,8 @@ constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) {...@@ -113,8 +103,8 @@ constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) {
113 return 0;103 return 0;
114104
115 using _Rp = common_type_t<_Tp, _Up>;105 using _Rp = common_type_t<_Tp, _Up>;
116 _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / std::gcd(__m, __n);106 _Rp __val1 = std::__abs_in_type<_Rp>(__m) / std::gcd(__m, __n);
117 _Rp __val2 = __ct_abs<_Rp, _Up>()(__n);107 _Rp __val2 = std::__abs_in_type<_Rp>(__n);
118 _Rp __res;108 _Rp __res;
119 [[maybe_unused]] bool __overflow = __builtin_mul_overflow(__val1, __val2, std::addressof(__res));109 [[maybe_unused]] bool __overflow = __builtin_mul_overflow(__val1, __val2, std::addressof(__res));
120 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(!__overflow, "Overflow in lcm");110 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(!__overflow, "Overflow in lcm");
lib/libcxx/include/__numeric/midpoint.h+9-14
...@@ -12,16 +12,13 @@...@@ -12,16 +12,13 @@
1212
13#include <__config>13#include <__config>
14#include <__cstddef/ptrdiff_t.h>14#include <__cstddef/ptrdiff_t.h>
15#include <__type_traits/enable_if.h>
16#include <__type_traits/is_floating_point.h>15#include <__type_traits/is_floating_point.h>
17#include <__type_traits/is_integral.h>16#include <__type_traits/is_integral.h>
18#include <__type_traits/is_null_pointer.h>
19#include <__type_traits/is_object.h>17#include <__type_traits/is_object.h>
20#include <__type_traits/is_pointer.h>
21#include <__type_traits/is_same.h>18#include <__type_traits/is_same.h>
22#include <__type_traits/is_void.h>19#include <__type_traits/is_void.h>
23#include <__type_traits/make_unsigned.h>20#include <__type_traits/make_unsigned.h>
24#include <__type_traits/remove_pointer.h>21#include <__type_traits/remove_cv.h>
25#include <limits>22#include <limits>
2623
27#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -35,8 +32,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -35,8 +32,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3532
36#if _LIBCPP_STD_VER >= 2033#if _LIBCPP_STD_VER >= 20
37template <class _Tp>34template <class _Tp>
38_LIBCPP_HIDE_FROM_ABI constexpr enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp>35 requires(is_integral_v<_Tp> && !is_same_v<remove_cv_t<_Tp>, bool>)
39midpoint(_Tp __a, _Tp __b) noexcept _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK {36[[nodiscard]]
37_LIBCPP_HIDE_FROM_ABI constexpr _Tp midpoint(_Tp __a, _Tp __b) noexcept _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK {
40 using _Up = make_unsigned_t<_Tp>;38 using _Up = make_unsigned_t<_Tp>;
41 constexpr _Up __bitshift = numeric_limits<_Up>::digits - 1;39 constexpr _Up __bitshift = numeric_limits<_Up>::digits - 1;
4240
...@@ -48,23 +46,20 @@ midpoint(_Tp __a, _Tp __b) noexcept _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK...@@ -48,23 +46,20 @@ midpoint(_Tp __a, _Tp __b) noexcept _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
48 return __a + __half_diff;46 return __a + __half_diff;
49}47}
5048
51template <class _Tp, enable_if_t<is_object_v<_Tp> && !is_void_v<_Tp> && (sizeof(_Tp) > 0), int> = 0>49template <class _Tp>
52_LIBCPP_HIDE_FROM_ABI constexpr _Tp* midpoint(_Tp* __a, _Tp* __b) noexcept {50 requires(is_object_v<_Tp> && (sizeof(_Tp) > 0))
51[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* midpoint(_Tp* __a, _Tp* __b) noexcept {
53 return __a + std::midpoint(ptrdiff_t(0), __b - __a);52 return __a + std::midpoint(ptrdiff_t(0), __b - __a);
54}53}
5554
56template <typename _Tp>
57_LIBCPP_HIDE_FROM_ABI constexpr int __sign(_Tp __val) {
58 return (_Tp(0) < __val) - (__val < _Tp(0));
59}
60
61template <typename _Fp>55template <typename _Fp>
62_LIBCPP_HIDE_FROM_ABI constexpr _Fp __fp_abs(_Fp __f) {56_LIBCPP_HIDE_FROM_ABI constexpr _Fp __fp_abs(_Fp __f) {
63 return __f >= 0 ? __f : -__f;57 return __f >= 0 ? __f : -__f;
64}58}
6559
66template <class _Fp>60template <class _Fp>
67_LIBCPP_HIDE_FROM_ABI constexpr enable_if_t<is_floating_point_v<_Fp>, _Fp> midpoint(_Fp __a, _Fp __b) noexcept {61 requires(is_floating_point_v<_Fp>)
62[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Fp midpoint(_Fp __a, _Fp __b) noexcept {
68 constexpr _Fp __lo = numeric_limits<_Fp>::min() * 2;63 constexpr _Fp __lo = numeric_limits<_Fp>::min() * 2;
69 constexpr _Fp __hi = numeric_limits<_Fp>::max() / 2;64 constexpr _Fp __hi = numeric_limits<_Fp>::max() / 2;
7065
lib/libcxx/include/__numeric/pstl.h+2-2
...@@ -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 __iter_value_type<_ForwardIterator>73_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>;
...@@ -78,7 +78,7 @@ reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator _...@@ -78,7 +78,7 @@ reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator _
78 std::forward<_ExecutionPolicy>(__policy),78 std::forward<_ExecutionPolicy>(__policy),
79 std::move(__first),79 std::move(__first),
80 std::move(__last),80 std::move(__last),
81 __iter_value_type<_ForwardIterator>(),81 __iterator_value_type<_ForwardIterator>(),
82 plus{});82 plus{});
83}83}
8484
lib/libcxx/include/__numeric/saturation_arithmetic.h+13-5
...@@ -30,6 +30,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -30,6 +30,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
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 __add_sat(_Tp __x, _Tp __y) noexcept {
33# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2101
34 return __builtin_elementwise_add_sat(__x, __y);
35# else
33 if (_Tp __sum; !__builtin_add_overflow(__x, __y, std::addressof(__sum)))36 if (_Tp __sum; !__builtin_add_overflow(__x, __y, std::addressof(__sum)))
34 return __sum;37 return __sum;
35 // Handle overflow38 // Handle overflow
...@@ -44,10 +47,14 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {...@@ -44,10 +47,14 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {
44 // Overflows if (x < 0 && y < 0)47 // Overflows if (x < 0 && y < 0)
45 return std::numeric_limits<_Tp>::min();48 return std::numeric_limits<_Tp>::min();
46 }49 }
50# endif
47}51}
4852
49template <__signed_or_unsigned_integer _Tp>53template <__signed_or_unsigned_integer _Tp>
50_LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {54_LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {
55# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2101
56 return __builtin_elementwise_sub_sat(__x, __y);
57# else
51 if (_Tp __sub; !__builtin_sub_overflow(__x, __y, std::addressof(__sub)))58 if (_Tp __sub; !__builtin_sub_overflow(__x, __y, std::addressof(__sub)))
52 return __sub;59 return __sub;
53 // Handle overflow60 // Handle overflow
...@@ -63,6 +70,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {...@@ -63,6 +70,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {
63 // Overflows if (x < 0 && y > 0)70 // Overflows if (x < 0 && y > 0)
64 return std::numeric_limits<_Tp>::min();71 return std::numeric_limits<_Tp>::min();
65 }72 }
73# endif
66}74}
6775
68template <__signed_or_unsigned_integer _Tp>76template <__signed_or_unsigned_integer _Tp>
...@@ -113,27 +121,27 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {...@@ -113,27 +121,27 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {
113#if _LIBCPP_STD_VER >= 26121#if _LIBCPP_STD_VER >= 26
114122
115template <__signed_or_unsigned_integer _Tp>123template <__signed_or_unsigned_integer _Tp>
116_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {124[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
117 return std::__add_sat(__x, __y);125 return std::__add_sat(__x, __y);
118}126}
119127
120template <__signed_or_unsigned_integer _Tp>128template <__signed_or_unsigned_integer _Tp>
121_LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {129[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {
122 return std::__sub_sat(__x, __y);130 return std::__sub_sat(__x, __y);
123}131}
124132
125template <__signed_or_unsigned_integer _Tp>133template <__signed_or_unsigned_integer _Tp>
126_LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {134[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {
127 return std::__mul_sat(__x, __y);135 return std::__mul_sat(__x, __y);
128}136}
129137
130template <__signed_or_unsigned_integer _Tp>138template <__signed_or_unsigned_integer _Tp>
131_LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {139[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {
132 return std::__div_sat(__x, __y);140 return std::__div_sat(__x, __y);
133}141}
134142
135template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>143template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>
136_LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {144[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {
137 return std::__saturate_cast<_Rp>(__x);145 return std::__saturate_cast<_Rp>(__x);
138}146}
139147
lib/libcxx/include/__ostream/basic_ostream.h+8-8
...@@ -53,7 +53,7 @@ public:...@@ -53,7 +53,7 @@ public:
53 typedef typename traits_type::off_type off_type;53 typedef typename traits_type::off_type off_type;
5454
55 // 27.7.2.2 Constructor/destructor:55 // 27.7.2.2 Constructor/destructor:
56 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb) {56 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb) {
57 this->init(__sb);57 this->init(__sb);
58 }58 }
59 ~basic_ostream() override;59 ~basic_ostream() override;
...@@ -67,7 +67,7 @@ protected:...@@ -67,7 +67,7 @@ protected:
67 // 27.7.2.3 Assign/swap67 // 27.7.2.3 Assign/swap
68 inline _LIBCPP_HIDE_FROM_ABI basic_ostream& operator=(basic_ostream&& __rhs);68 inline _LIBCPP_HIDE_FROM_ABI basic_ostream& operator=(basic_ostream&& __rhs);
6969
70 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void swap(basic_ostream& __rhs) {70 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void swap(basic_ostream& __rhs) {
71 basic_ios<char_type, traits_type>::swap(__rhs);71 basic_ios<char_type, traits_type>::swap(__rhs);
72 }72 }
7373
...@@ -76,17 +76,17 @@ public:...@@ -76,17 +76,17 @@ public:
76 class sentry;76 class sentry;
7777
78 // 27.7.2.6 Formatted output:78 // 27.7.2.6 Formatted output:
79 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&)) {79 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&)) {
80 return __pf(*this);80 return __pf(*this);
81 }81 }
8282
83 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream&83 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_ostream&
84 operator<<(basic_ios<char_type, traits_type>& (*__pf)(basic_ios<char_type, traits_type>&)) {84 operator<<(basic_ios<char_type, traits_type>& (*__pf)(basic_ios<char_type, traits_type>&)) {
85 __pf(*this);85 __pf(*this);
86 return *this;86 return *this;
87 }87 }
8888
89 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& operator<<(ios_base& (*__pf)(ios_base&)) {89 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_ostream& operator<<(ios_base& (*__pf)(ios_base&)) {
90 __pf(*this);90 __pf(*this);
91 return *this;91 return *this;
92 }92 }
...@@ -174,9 +174,9 @@ public:...@@ -174,9 +174,9 @@ public:
174 basic_ostream& flush();174 basic_ostream& flush();
175175
176 // 27.7.2.5 seeks:176 // 27.7.2.5 seeks:
177 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 pos_type tellp();177 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 pos_type tellp();
178 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& seekp(pos_type __pos);178 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_ostream& seekp(pos_type __pos);
179 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);179 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);
180180
181protected:181protected:
182 _LIBCPP_HIDE_FROM_ABI basic_ostream() {} // extension, intentially does not initialize182 _LIBCPP_HIDE_FROM_ABI basic_ostream() {} // extension, intentially does not initialize
lib/libcxx/include/__pstl/backends/default.h+14-14
...@@ -102,7 +102,7 @@ struct __find<__default_backend_tag, _ExecutionPolicy> {...@@ -102,7 +102,7 @@ struct __find<__default_backend_tag, _ExecutionPolicy> {
102 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) const noexcept {102 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) const noexcept {
103 using _FindIf = __dispatch<__find_if, __current_configuration, _ExecutionPolicy>;103 using _FindIf = __dispatch<__find_if, __current_configuration, _ExecutionPolicy>;
104 return _FindIf()(104 return _FindIf()(
105 __policy, std::move(__first), std::move(__last), [&](__iter_reference<_ForwardIterator> __element) {105 __policy, std::move(__first), std::move(__last), [&](__iterator_reference<_ForwardIterator> __element) {
106 return __element == __value;106 return __element == __value;
107 });107 });
108 }108 }
...@@ -137,7 +137,7 @@ struct __all_of<__default_backend_tag, _ExecutionPolicy> {...@@ -137,7 +137,7 @@ struct __all_of<__default_backend_tag, _ExecutionPolicy> {
137 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool>137 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool>
138 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept {138 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept {
139 using _AnyOf = __dispatch<__any_of, __current_configuration, _ExecutionPolicy>;139 using _AnyOf = __dispatch<__any_of, __current_configuration, _ExecutionPolicy>;
140 auto __res = _AnyOf()(__policy, __first, __last, [&](__iter_reference<_ForwardIterator> __value) {140 auto __res = _AnyOf()(__policy, __first, __last, [&](__iterator_reference<_ForwardIterator> __value) {
141 return !__pred(__value);141 return !__pred(__value);
142 });142 });
143 if (!__res)143 if (!__res)
...@@ -204,7 +204,7 @@ struct __fill<__default_backend_tag, _ExecutionPolicy> {...@@ -204,7 +204,7 @@ struct __fill<__default_backend_tag, _ExecutionPolicy> {
204 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>204 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>
205 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept {205 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept {
206 using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>;206 using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>;
207 using _Ref = __iter_reference<_ForwardIterator>;207 using _Ref = __iterator_reference<_ForwardIterator>;
208 return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { __element = __value; });208 return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { __element = __value; });
209 }209 }
210};210};
...@@ -233,7 +233,7 @@ struct __replace<__default_backend_tag, _ExecutionPolicy> {...@@ -233,7 +233,7 @@ struct __replace<__default_backend_tag, _ExecutionPolicy> {
233 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __old, _Tp const& __new)233 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __old, _Tp const& __new)
234 const noexcept {234 const noexcept {
235 using _ReplaceIf = __dispatch<__replace_if, __current_configuration, _ExecutionPolicy>;235 using _ReplaceIf = __dispatch<__replace_if, __current_configuration, _ExecutionPolicy>;
236 using _Ref = __iter_reference<_ForwardIterator>;236 using _Ref = __iterator_reference<_ForwardIterator>;
237 return _ReplaceIf()(237 return _ReplaceIf()(
238 __policy, std::move(__first), std::move(__last), [&](_Ref __element) { return __element == __old; }, __new);238 __policy, std::move(__first), std::move(__last), [&](_Ref __element) { return __element == __old; }, __new);
239 }239 }
...@@ -246,7 +246,7 @@ struct __replace_if<__default_backend_tag, _ExecutionPolicy> {...@@ -246,7 +246,7 @@ struct __replace_if<__default_backend_tag, _ExecutionPolicy> {
246 _Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred, _Tp const& __new_value)246 _Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred, _Tp const& __new_value)
247 const noexcept {247 const noexcept {
248 using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>;248 using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>;
249 using _Ref = __iter_reference<_ForwardIterator>;249 using _Ref = __iterator_reference<_ForwardIterator>;
250 return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) {250 return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) {
251 if (__pred(__element))251 if (__pred(__element))
252 __element = __new_value;252 __element = __new_value;
...@@ -260,7 +260,7 @@ struct __generate<__default_backend_tag, _ExecutionPolicy> {...@@ -260,7 +260,7 @@ struct __generate<__default_backend_tag, _ExecutionPolicy> {
260 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>260 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>
261 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Generator&& __gen) const noexcept {261 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Generator&& __gen) const noexcept {
262 using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>;262 using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>;
263 using _Ref = __iter_reference<_ForwardIterator>;263 using _Ref = __iterator_reference<_ForwardIterator>;
264 return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { __element = __gen(); });264 return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { __element = __gen(); });
265 }265 }
266};266};
...@@ -271,7 +271,7 @@ struct __generate_n<__default_backend_tag, _ExecutionPolicy> {...@@ -271,7 +271,7 @@ struct __generate_n<__default_backend_tag, _ExecutionPolicy> {
271 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>271 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>
272 operator()(_Policy&& __policy, _ForwardIterator __first, _Size __n, _Generator&& __gen) const noexcept {272 operator()(_Policy&& __policy, _ForwardIterator __first, _Size __n, _Generator&& __gen) const noexcept {
273 using _ForEachN = __dispatch<__for_each_n, __current_configuration, _ExecutionPolicy>;273 using _ForEachN = __dispatch<__for_each_n, __current_configuration, _ExecutionPolicy>;
274 using _Ref = __iter_reference<_ForwardIterator>;274 using _Ref = __iterator_reference<_ForwardIterator>;
275 return _ForEachN()(__policy, std::move(__first), __n, [&](_Ref __element) { __element = __gen(); });275 return _ForEachN()(__policy, std::move(__first), __n, [&](_Ref __element) { __element = __gen(); });
276 }276 }
277};277};
...@@ -295,11 +295,11 @@ struct __sort<__default_backend_tag, _ExecutionPolicy> {...@@ -295,11 +295,11 @@ struct __sort<__default_backend_tag, _ExecutionPolicy> {
295template <class _ExecutionPolicy>295template <class _ExecutionPolicy>
296struct __count_if<__default_backend_tag, _ExecutionPolicy> {296struct __count_if<__default_backend_tag, _ExecutionPolicy> {
297 template <class _Policy, class _ForwardIterator, class _Predicate>297 template <class _Policy, class _ForwardIterator, class _Predicate>
298 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_diff_t<_ForwardIterator>> operator()(298 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iterator_difference_type<_ForwardIterator>> operator()(
299 _Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred) const noexcept {299 _Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred) const noexcept {
300 using _TransformReduce = __dispatch<__transform_reduce, __current_configuration, _ExecutionPolicy>;300 using _TransformReduce = __dispatch<__transform_reduce, __current_configuration, _ExecutionPolicy>;
301 using _DiffT = __iter_diff_t<_ForwardIterator>;301 using _DiffT = __iterator_difference_type<_ForwardIterator>;
302 using _Ref = __iter_reference<_ForwardIterator>;302 using _Ref = __iterator_reference<_ForwardIterator>;
303 return _TransformReduce()(303 return _TransformReduce()(
304 __policy, std::move(__first), std::move(__last), _DiffT{}, std::plus{}, [&](_Ref __element) -> _DiffT {304 __policy, std::move(__first), std::move(__last), _DiffT{}, std::plus{}, [&](_Ref __element) -> _DiffT {
305 return __pred(__element) ? _DiffT(1) : _DiffT(0);305 return __pred(__element) ? _DiffT(1) : _DiffT(0);
...@@ -310,10 +310,10 @@ struct __count_if<__default_backend_tag, _ExecutionPolicy> {...@@ -310,10 +310,10 @@ struct __count_if<__default_backend_tag, _ExecutionPolicy> {
310template <class _ExecutionPolicy>310template <class _ExecutionPolicy>
311struct __count<__default_backend_tag, _ExecutionPolicy> {311struct __count<__default_backend_tag, _ExecutionPolicy> {
312 template <class _Policy, class _ForwardIterator, class _Tp>312 template <class _Policy, class _ForwardIterator, class _Tp>
313 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_diff_t<_ForwardIterator>>313 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iterator_difference_type<_ForwardIterator>>
314 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept {314 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept {
315 using _CountIf = __dispatch<__count_if, __current_configuration, _ExecutionPolicy>;315 using _CountIf = __dispatch<__count_if, __current_configuration, _ExecutionPolicy>;
316 using _Ref = __iter_reference<_ForwardIterator>;316 using _Ref = __iterator_reference<_ForwardIterator>;
317 return _CountIf()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) -> bool {317 return _CountIf()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) -> bool {
318 return __element == __value;318 return __element == __value;
319 });319 });
...@@ -402,7 +402,7 @@ struct __replace_copy_if<__default_backend_tag, _ExecutionPolicy> {...@@ -402,7 +402,7 @@ struct __replace_copy_if<__default_backend_tag, _ExecutionPolicy> {
402 _Pred&& __pred,402 _Pred&& __pred,
403 _Tp const& __new_value) const noexcept {403 _Tp const& __new_value) const noexcept {
404 using _Transform = __dispatch<__transform, __current_configuration, _ExecutionPolicy>;404 using _Transform = __dispatch<__transform, __current_configuration, _ExecutionPolicy>;
405 using _Ref = __iter_reference<_ForwardIterator>;405 using _Ref = __iterator_reference<_ForwardIterator>;
406 auto __res =406 auto __res =
407 _Transform()(__policy, std::move(__first), std::move(__last), std::move(__out_it), [&](_Ref __element) {407 _Transform()(__policy, std::move(__first), std::move(__last), std::move(__out_it), [&](_Ref __element) {
408 return __pred(__element) ? __new_value : __element;408 return __pred(__element) ? __new_value : __element;
...@@ -424,7 +424,7 @@ struct __replace_copy<__default_backend_tag, _ExecutionPolicy> {...@@ -424,7 +424,7 @@ struct __replace_copy<__default_backend_tag, _ExecutionPolicy> {
424 _Tp const& __old_value,424 _Tp const& __old_value,
425 _Tp const& __new_value) const noexcept {425 _Tp const& __new_value) const noexcept {
426 using _ReplaceCopyIf = __dispatch<__replace_copy_if, __current_configuration, _ExecutionPolicy>;426 using _ReplaceCopyIf = __dispatch<__replace_copy_if, __current_configuration, _ExecutionPolicy>;
427 using _Ref = __iter_reference<_ForwardIterator>;427 using _Ref = __iterator_reference<_ForwardIterator>;
428 return _ReplaceCopyIf()(428 return _ReplaceCopyIf()(
429 __policy,429 __policy,
430 std::move(__first),430 std::move(__first),
lib/libcxx/include/__pstl/backends/libdispatch.h+2-2
...@@ -269,7 +269,7 @@ struct __cpu_traits<__libdispatch_backend_tag> {...@@ -269,7 +269,7 @@ struct __cpu_traits<__libdispatch_backend_tag> {
269 return __empty{};269 return __empty{};
270 }270 }
271271
272 using _Value = __iter_value_type<_RandomAccessIterator>;272 using _Value = __iterator_value_type<_RandomAccessIterator>;
273273
274 auto __destroy = [__size](_Value* __ptr) {274 auto __destroy = [__size](_Value* __ptr) {
275 std::destroy_n(__ptr, __size);275 std::destroy_n(__ptr, __size);
...@@ -282,7 +282,7 @@ struct __cpu_traits<__libdispatch_backend_tag> {...@@ -282,7 +282,7 @@ struct __cpu_traits<__libdispatch_backend_tag> {
282 // Initialize all elements to a moved-from state282 // Initialize all elements to a moved-from state
283 // TODO: Don't do this - this can be done in the first merge - see https://llvm.org/PR63928283 // TODO: Don't do this - this can be done in the first merge - see https://llvm.org/PR63928
284 std::__construct_at(__values.get(), std::move(*__first));284 std::__construct_at(__values.get(), std::move(*__first));
285 for (__iter_diff_t<_RandomAccessIterator> __i = 1; __i != __size; ++__i) {285 for (__iterator_difference_type<_RandomAccessIterator> __i = 1; __i != __size; ++__i) {
286 std::__construct_at(__values.get() + __i, std::move(__values.get()[__i - 1]));286 std::__construct_at(__values.get() + __i, std::move(__values.get()[__i - 1]));
287 }287 }
288 *__first = std::move(__values.get()[__size - 1]);288 *__first = std::move(__values.get()[__size - 1]);
lib/libcxx/include/__pstl/cpu_algos/find_if.h+1-1
...@@ -119,7 +119,7 @@ struct __cpu_parallel_find_if {...@@ -119,7 +119,7 @@ struct __cpu_parallel_find_if {
119 true);119 true);
120 } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> &&120 } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> &&
121 __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) {121 __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) {
122 using __diff_t = __iter_diff_t<_ForwardIterator>;122 using __diff_t = __iterator_difference_type<_ForwardIterator>;
123 return __pstl::__simd_first<_Backend>(123 return __pstl::__simd_first<_Backend>(
124 __first, __diff_t(0), __last - __first, [&__pred](_ForwardIterator __iter, __diff_t __i) {124 __first, __diff_t(0), __last - __first, [&__pred](_ForwardIterator __iter, __diff_t __i) {
125 return __pred(__iter[__i]);125 return __pred(__iter[__i]);
lib/libcxx/include/__pstl/cpu_algos/transform.h+5-6
...@@ -84,9 +84,8 @@ struct __cpu_parallel_transform {...@@ -84,9 +84,8 @@ struct __cpu_parallel_transform {
84 __first,84 __first,
85 __last - __first,85 __last - __first,
86 __result,86 __result,
87 [&](__iter_reference<_ForwardIterator> __in_value, __iter_reference<_ForwardOutIterator> __out_value) {87 [&](__iterator_reference<_ForwardIterator> __in_value,
88 __out_value = __op(__in_value);88 __iterator_reference<_ForwardOutIterator> __out_value) { __out_value = __op(__in_value); });
89 });
90 } else {89 } else {
91 return std::transform(__first, __last, __result, __op);90 return std::transform(__first, __last, __result, __op);
92 }91 }
...@@ -138,9 +137,9 @@ struct __cpu_parallel_transform_binary {...@@ -138,9 +137,9 @@ struct __cpu_parallel_transform_binary {
138 __last1 - __first1,137 __last1 - __first1,
139 __first2,138 __first2,
140 __result,139 __result,
141 [&](__iter_reference<_ForwardIterator1> __in1,140 [&](__iterator_reference<_ForwardIterator1> __in1,
142 __iter_reference<_ForwardIterator2> __in2,141 __iterator_reference<_ForwardIterator2> __in2,
143 __iter_reference<_ForwardOutIterator> __out_value) { __out_value = __op(__in1, __in2); });142 __iterator_reference<_ForwardOutIterator> __out_value) { __out_value = __op(__in1, __in2); });
144 } else {143 } else {
145 return std::transform(__first1, __last1, __first2, __result, __op);144 return std::transform(__first1, __last1, __first2, __result, __op);
146 }145 }
lib/libcxx/include/__pstl/cpu_algos/transform_reduce.h+5-4
...@@ -148,9 +148,10 @@ struct __cpu_parallel_transform_reduce_binary {...@@ -148,9 +148,10 @@ struct __cpu_parallel_transform_reduce_binary {
148 __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value &&148 __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value &&
149 __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value) {149 __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value) {
150 return __pstl::__simd_transform_reduce<_Backend>(150 return __pstl::__simd_transform_reduce<_Backend>(
151 __last1 - __first1, std::move(__init), std::move(__reduce), [&](__iter_diff_t<_ForwardIterator1> __i) {151 __last1 - __first1,
152 return __transform(__first1[__i], __first2[__i]);152 std::move(__init),
153 });153 std::move(__reduce),
154 [&](__iterator_difference_type<_ForwardIterator1> __i) { return __transform(__first1[__i], __first2[__i]); });
154 } else {155 } else {
155 return std::transform_reduce(156 return std::transform_reduce(
156 std::move(__first1),157 std::move(__first1),
...@@ -200,7 +201,7 @@ struct __cpu_parallel_transform_reduce {...@@ -200,7 +201,7 @@ struct __cpu_parallel_transform_reduce {
200 __last - __first,201 __last - __first,
201 std::move(__init),202 std::move(__init),
202 std::move(__reduce),203 std::move(__reduce),
203 [=, &__transform](__iter_diff_t<_ForwardIterator> __i) { return __transform(__first[__i]); });204 [=, &__transform](__iterator_difference_type<_ForwardIterator> __i) { return __transform(__first[__i]); });
204 } else {205 } else {
205 return std::transform_reduce(206 return std::transform_reduce(
206 std::move(__first), std::move(__last), std::move(__init), std::move(__reduce), std::move(__transform));207 std::move(__first), std::move(__last), std::move(__init), std::move(__reduce), std::move(__transform));
lib/libcxx/include/__random/binomial_distribution.h+10-4
...@@ -97,13 +97,19 @@ public:...@@ -97,13 +97,19 @@ public:
97 }97 }
98};98};
9999
100// The LLVM C library provides this with conflicting `noexcept` attributes.100// Some libc declares the math functions to be `noexcept`.
101#if !defined(_LIBCPP_MSVCRT_LIKE) && !defined(__LLVM_LIBC__)101#if _LIBCPP_GLIBC_PREREQ(2, 8) || defined(__LLVM_LIBC__)
102extern "C" double lgamma_r(double, int*);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;
103#endif109#endif
104110
105inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma(double __d) {111inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma(double __d) {
106#if defined(_LIBCPP_MSVCRT_LIKE) || defined(__LLVM_LIBC__)112#if defined(_LIBCPP_MSVCRT_LIKE)
107 return lgamma(__d);113 return lgamma(__d);
108#else114#else
109 int __sign;115 int __sign;
lib/libcxx/include/__random/mersenne_twister_engine.h+50-154
...@@ -62,24 +62,6 @@ _LIBCPP_HIDE_FROM_ABI bool...@@ -62,24 +62,6 @@ _LIBCPP_HIDE_FROM_ABI bool
62operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x,62operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
63 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __y);63 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
6464
65template <class _UInt,
66 size_t _Wp,
67 size_t _Np,
68 size_t _Mp,
69 size_t _Rp,
70 _UInt _Ap,
71 size_t _Up,
72 _UInt _Dp,
73 size_t _Sp,
74 _UInt _Bp,
75 size_t _Tp,
76 _UInt _Cp,
77 size_t _Lp,
78 _UInt _Fp>
79_LIBCPP_HIDE_FROM_ABI bool
80operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
81 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
82
83template <class _CharT,65template <class _CharT,
84 class _Traits,66 class _Traits,
85 class _UInt,67 class _UInt,
...@@ -194,14 +176,31 @@ public:...@@ -194,14 +176,31 @@ public:
194 _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(_Sseq& __q) {176 _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(_Sseq& __q) {
195 seed(__q);177 seed(__q);
196 }178 }
197 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed);179 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK {
180 __x_[0] = __sd & _Max;
181 for (size_t __i = 1; __i < __n; ++__i)
182 __x_[__i] = (__f * (__x_[__i - 1] ^ __rshift<__w - 2>(__x_[__i - 1])) + __i) & _Max;
183 __i_ = 0;
184 }
198 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>185 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
199 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {186 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
200 __seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());187 __seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());
201 }188 }
202189
203 // generating functions190 // generating functions
204 _LIBCPP_HIDE_FROM_ABI result_type operator()();191 _LIBCPP_HIDE_FROM_ABI result_type operator()() {
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);
194 const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
195 const size_t __k = (__i_ + __m) % __n;
196 __x_[__i_] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
197 result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d);
198 __i_ = __j;
199 __z ^= __lshift<__s>(__z) & __b;
200 __z ^= __lshift<__t>(__z) & __c;
201 return __z ^ __rshift<__l>(__z);
202 }
203
205 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {204 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
206 for (; __z; --__z)205 for (; __z; --__z)
207 operator()();206 operator()();
...@@ -225,24 +224,6 @@ public:...@@ -225,24 +224,6 @@ public:
225 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x,224 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
226 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __y);225 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
227226
228 template <class _UInt,
229 size_t _Wp,
230 size_t _Np,
231 size_t _Mp,
232 size_t _Rp,
233 _UInt _Ap,
234 size_t _Up,
235 _UInt _Dp,
236 size_t _Sp,
237 _UInt _Bp,
238 size_t _Tp,
239 _UInt _Cp,
240 size_t _Lp,
241 _UInt _Fp>
242 friend bool operator!=(
243 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
244 const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
245
246 template <class _CharT,227 template <class _CharT,
247 class _Traits,228 class _Traits,
248 class _UInt,229 class _UInt,
...@@ -285,9 +266,38 @@ public:...@@ -285,9 +266,38 @@ public:
285266
286private:267private:
287 template <class _Sseq>268 template <class _Sseq>
288 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>);269 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>) {
270 const unsigned __k = 1;
271 uint32_t __ar[__n * __k];
272 __q.generate(__ar, __ar + __n * __k);
273 for (size_t __i = 0; __i < __n; ++__i)
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 }
283 }
284
289 template <class _Sseq>285 template <class _Sseq>
290 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);286 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>) {
287 const unsigned __k = 2;
288 uint32_t __ar[__n * __k];
289 __q.generate(__ar, __ar + __n * __k);
290 for (size_t __i = 0; __i < __n; ++__i)
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 }
300 }
291301
292 template <size_t __count,302 template <size_t __count,
293 __enable_if_t<__count< __w, int> = 0> _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type __x) {303 __enable_if_t<__count< __w, int> = 0> _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type __x) {
...@@ -310,120 +320,6 @@ private:...@@ -310,120 +320,6 @@ private:
310 }320 }
311};321};
312322
313template <class _UIntType,
314 size_t __w,
315 size_t __n,
316 size_t __m,
317 size_t __r,
318 _UIntType __a,
319 size_t __u,
320 _UIntType __d,
321 size_t __s,
322 _UIntType __b,
323 size_t __t,
324 _UIntType __c,
325 size_t __l,
326 _UIntType __f>
327void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::seed(
328 result_type __sd) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { // __w >= 2
329 __x_[0] = __sd & _Max;
330 for (size_t __i = 1; __i < __n; ++__i)
331 __x_[__i] = (__f * (__x_[__i - 1] ^ __rshift<__w - 2>(__x_[__i - 1])) + __i) & _Max;
332 __i_ = 0;
333}
334
335template <class _UIntType,
336 size_t __w,
337 size_t __n,
338 size_t __m,
339 size_t __r,
340 _UIntType __a,
341 size_t __u,
342 _UIntType __d,
343 size_t __s,
344 _UIntType __b,
345 size_t __t,
346 _UIntType __c,
347 size_t __l,
348 _UIntType __f>
349template <class _Sseq>
350void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::__seed(
351 _Sseq& __q, integral_constant<unsigned, 1>) {
352 const unsigned __k = 1;
353 uint32_t __ar[__n * __k];
354 __q.generate(__ar, __ar + __n * __k);
355 for (size_t __i = 0; __i < __n; ++__i)
356 __x_[__i] = static_cast<result_type>(__ar[__i] & _Max);
357 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
358 __i_ = 0;
359 if ((__x_[0] & ~__mask) == 0) {
360 for (size_t __i = 1; __i < __n; ++__i)
361 if (__x_[__i] != 0)
362 return;
363 __x_[0] = result_type(1) << (__w - 1);
364 }
365}
366
367template <class _UIntType,
368 size_t __w,
369 size_t __n,
370 size_t __m,
371 size_t __r,
372 _UIntType __a,
373 size_t __u,
374 _UIntType __d,
375 size_t __s,
376 _UIntType __b,
377 size_t __t,
378 _UIntType __c,
379 size_t __l,
380 _UIntType __f>
381template <class _Sseq>
382void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::__seed(
383 _Sseq& __q, integral_constant<unsigned, 2>) {
384 const unsigned __k = 2;
385 uint32_t __ar[__n * __k];
386 __q.generate(__ar, __ar + __n * __k);
387 for (size_t __i = 0; __i < __n; ++__i)
388 __x_[__i] = static_cast<result_type>((__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max);
389 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
390 __i_ = 0;
391 if ((__x_[0] & ~__mask) == 0) {
392 for (size_t __i = 1; __i < __n; ++__i)
393 if (__x_[__i] != 0)
394 return;
395 __x_[0] = result_type(1) << (__w - 1);
396 }
397}
398
399template <class _UIntType,
400 size_t __w,
401 size_t __n,
402 size_t __m,
403 size_t __r,
404 _UIntType __a,
405 size_t __u,
406 _UIntType __d,
407 size_t __s,
408 _UIntType __b,
409 size_t __t,
410 _UIntType __c,
411 size_t __l,
412 _UIntType __f>
413_UIntType
414mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::operator()() {
415 const size_t __j = (__i_ + 1) % __n;
416 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
417 const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
418 const size_t __k = (__i_ + __m) % __n;
419 __x_[__i_] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
420 result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d);
421 __i_ = __j;
422 __z ^= __lshift<__s>(__z) & __b;
423 __z ^= __lshift<__t>(__z) & __c;
424 return __z ^ __rshift<__l>(__z);
425}
426
427template <class _UInt,323template <class _UInt,
428 size_t _Wp,324 size_t _Wp,
429 size_t _Np,325 size_t _Np,
lib/libcxx/include/__random/piecewise_constant_distribution.h+3-2
...@@ -9,9 +9,11 @@...@@ -9,9 +9,11 @@
9#ifndef _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H9#ifndef _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
10#define _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H10#define _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
1111
12#include <__algorithm/copy_n.h>
12#include <__algorithm/upper_bound.h>13#include <__algorithm/upper_bound.h>
13#include <__config>14#include <__config>
14#include <__cstddef/ptrdiff_t.h>15#include <__cstddef/ptrdiff_t.h>
16#include <__iterator/back_insert_iterator.h>
15#include <__random/is_valid.h>17#include <__random/is_valid.h>
16#include <__random/uniform_real_distribution.h>18#include <__random/uniform_real_distribution.h>
17#include <__vector/vector.h>19#include <__vector/vector.h>
...@@ -190,8 +192,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(...@@ -190,8 +192,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
190 __areas_.assign(1, 0.0);192 __areas_.assign(1, 0.0);
191 } else {193 } else {
192 __densities_.reserve(__b_.size() - 1);194 __densities_.reserve(__b_.size() - 1);
193 for (size_t __i = 0; __i < __b_.size() - 1; ++__i, ++__f_w)195 std::copy_n(__f_w, __b_.size() - 1, std::back_inserter(__densities_));
194 __densities_.push_back(*__f_w);
195 __init();196 __init();
196 }197 }
197}198}
lib/libcxx/include/__random/piecewise_linear_distribution.h+3-2
...@@ -9,9 +9,11 @@...@@ -9,9 +9,11 @@
9#ifndef _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H9#ifndef _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
10#define _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H10#define _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
1111
12#include <__algorithm/copy_n.h>
12#include <__algorithm/upper_bound.h>13#include <__algorithm/upper_bound.h>
13#include <__config>14#include <__config>
14#include <__cstddef/ptrdiff_t.h>15#include <__cstddef/ptrdiff_t.h>
16#include <__iterator/back_insert_iterator.h>
15#include <__random/is_valid.h>17#include <__random/is_valid.h>
16#include <__random/uniform_real_distribution.h>18#include <__random/uniform_real_distribution.h>
17#include <__vector/comparison.h>19#include <__vector/comparison.h>
...@@ -194,8 +196,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(...@@ -194,8 +196,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
194 __areas_.assign(1, 0.0);196 __areas_.assign(1, 0.0);
195 } else {197 } else {
196 __densities_.reserve(__b_.size());198 __densities_.reserve(__b_.size());
197 for (size_t __i = 0; __i < __b_.size(); ++__i, ++__f_w)199 std::copy_n(__f_w, __b_.size(), std::back_inserter(__densities_));
198 __densities_.push_back(*__f_w);
199 __init();200 __init();
200 }201 }
201}202}
lib/libcxx/include/__ranges/adjacent_transform_view.h created+406
...@@ -0,0 +1,406 @@
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_ADJACENT_TRANSFORM_VIEW_H
11#define _LIBCPP___RANGES_ADJACENT_TRANSFORM_VIEW_H
12
13#include <__config>
14
15#include <__algorithm/min.h>
16#include <__compare/three_way_comparable.h>
17#include <__concepts/constructible.h>
18#include <__concepts/convertible_to.h>
19#include <__concepts/derived_from.h>
20#include <__concepts/equality_comparable.h>
21#include <__concepts/invocable.h>
22#include <__cstddef/size_t.h>
23#include <__functional/bind_back.h>
24#include <__functional/invoke.h>
25#include <__functional/operations.h>
26#include <__iterator/concepts.h>
27#include <__iterator/incrementable_traits.h>
28#include <__iterator/iter_move.h>
29#include <__iterator/iter_swap.h>
30#include <__iterator/iterator_traits.h>
31#include <__iterator/next.h>
32#include <__iterator/prev.h>
33#include <__memory/addressof.h>
34#include <__ranges/access.h>
35#include <__ranges/adjacent_view.h>
36#include <__ranges/all.h>
37#include <__ranges/concepts.h>
38#include <__ranges/empty_view.h>
39#include <__ranges/movable_box.h>
40#include <__ranges/range_adaptor.h>
41#include <__ranges/size.h>
42#include <__ranges/view_interface.h>
43#include <__ranges/zip_transform_view.h>
44#include <__type_traits/common_type.h>
45#include <__type_traits/decay.h>
46#include <__type_traits/is_nothrow_constructible.h>
47#include <__type_traits/is_object.h>
48#include <__type_traits/is_referenceable.h>
49#include <__type_traits/make_unsigned.h>
50#include <__type_traits/maybe_const.h>
51#include <__utility/declval.h>
52#include <__utility/forward.h>
53#include <__utility/in_place.h>
54#include <__utility/integer_sequence.h>
55#include <__utility/move.h>
56
57#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
58# pragma GCC system_header
59#endif
60
61_LIBCPP_PUSH_MACROS
62#include <__undef_macros>
63
64_LIBCPP_BEGIN_NAMESPACE_STD
65
66#if _LIBCPP_STD_VER >= 23
67
68namespace ranges {
69
70template <class _Fn, size_t _Np>
71struct __apply_n {
72 template <class _Tp, size_t... _Is>
73 static auto __apply(index_sequence<_Is...>) -> invoke_result_t<_Fn, decltype((void)_Is, std::declval<_Tp>())...>;
74
75 template <class _Tp>
76 static auto operator()(_Tp&&) -> decltype(__apply<_Tp>(make_index_sequence<_Np>{}));
77};
78
79template <forward_range _View, move_constructible _Fn, size_t _Np>
80 requires view<_View> && (_Np > 0) && is_object_v<_Fn> &&
81 regular_invocable<__apply_n<_Fn&, _Np>, range_reference_t<_View>> &&
82 __referenceable<invoke_result_t<__apply_n<_Fn&, _Np>, range_reference_t<_View>>>
83class adjacent_transform_view : public view_interface<adjacent_transform_view<_View, _Fn, _Np>> {
84private:
85 _LIBCPP_NO_UNIQUE_ADDRESS adjacent_view<_View, _Np> __inner_;
86 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Fn> __fun_;
87
88 using _InnerView _LIBCPP_NODEBUG = adjacent_view<_View, _Np>;
89
90 template <bool _Const>
91 using __inner_iterator _LIBCPP_NODEBUG = iterator_t<__maybe_const<_Const, _InnerView>>;
92
93 template <bool _Const>
94 using __inner_sentinel _LIBCPP_NODEBUG = sentinel_t<__maybe_const<_Const, _InnerView>>;
95
96 template <bool>
97 class __iterator;
98
99 template <bool>
100 class __sentinel;
101
102public:
103 _LIBCPP_HIDE_FROM_ABI adjacent_transform_view() = default;
104
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)) {}
107
108 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
109 requires copy_constructible<_View>
110 {
111 return __inner_.base();
112 }
113 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__inner_).base(); }
114
115 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() { return __iterator<false>(*this, __inner_.begin()); }
116
117 _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>>
119 {
120 return __iterator<true>(*this, __inner_.begin());
121 }
122
123 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
124 if constexpr (common_range<_InnerView>) {
125 return __iterator<false>(*this, __inner_.end());
126 } else {
127 return __sentinel<false>(__inner_.end());
128 }
129 }
130
131 _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>>
133 {
134 if constexpr (common_range<const _InnerView>) {
135 return __iterator<true>(*this, __inner_.end());
136 } else {
137 return __sentinel<true>(__inner_.end());
138 }
139 }
140
141 _LIBCPP_HIDE_FROM_ABI constexpr auto size()
142 requires sized_range<_InnerView>
143 {
144 return __inner_.size();
145 }
146
147 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
148 requires sized_range<const _InnerView>
149 {
150 return __inner_.size();
151 }
152};
153
154template <forward_range _View, move_constructible _Fn, size_t _Np>
155 requires view<_View> && (_Np > 0) && is_object_v<_Fn> &&
156 regular_invocable<__apply_n<_Fn&, _Np>, range_reference_t<_View>> &&
157 __referenceable<invoke_result_t<__apply_n<_Fn&, _Np>, range_reference_t<_View>>>
158template <bool _Const>
159class adjacent_transform_view<_View, _Fn, _Np>::__iterator {
160 friend adjacent_transform_view;
161
162 using _Parent _LIBCPP_NODEBUG = __maybe_const<_Const, adjacent_transform_view>;
163 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
164
165 _Parent* __parent_ = nullptr;
166 __inner_iterator<_Const> __inner_;
167
168 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(_Parent& __parent, __inner_iterator<_Const> __inner)
169 : __parent_(std::addressof(__parent)), __inner_(std::move(__inner)) {}
170
171 static consteval auto __get_iterator_category() {
172 using _Cat = iterator_traits<iterator_t<_Base>>::iterator_category;
173 if constexpr (!is_reference_v<
174 invoke_result_t<__apply_n<__maybe_const<_Const, _Fn>&, _Np>, range_reference_t<_Base>>>)
175 return input_iterator_tag{};
176 else if constexpr (derived_from<_Cat, random_access_iterator_tag>)
177 return random_access_iterator_tag{};
178 else if constexpr (derived_from<_Cat, bidirectional_iterator_tag>)
179 return bidirectional_iterator_tag{};
180 else if constexpr (derived_from<_Cat, forward_iterator_tag>)
181 return forward_iterator_tag{};
182 else
183 return input_iterator_tag{};
184 }
185
186 template <size_t... _Is>
187 static consteval bool __noexcept_dereference(index_sequence<_Is...>) {
188 return noexcept(std::invoke(
189 std::declval<__maybe_const<_Const, _Fn>&>(), ((void)_Is, *std::declval<iterator_t<_Base> const&>())...));
190 }
191
192public:
193 using iterator_category = decltype(__get_iterator_category());
194 using iterator_concept = typename __inner_iterator<_Const>::iterator_concept;
195 using value_type =
196 remove_cvref_t<invoke_result_t<__apply_n<__maybe_const<_Const, _Fn>&, _Np>, range_reference_t<_Base>>>;
197 using difference_type = range_difference_t<_Base>;
198
199 _LIBCPP_HIDE_FROM_ABI __iterator() = default;
200
201 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
202 requires _Const && convertible_to<__inner_iterator<false>, __inner_iterator<true>>
203 : __parent_(__i.__parent_), __inner_(std::move(__i.__inner_)) {}
204
205 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
206 noexcept(__noexcept_dereference(make_index_sequence<_Np>{})) {
207 return std::apply(
208 [&](const auto&... __iters) -> decltype(auto) { return std::invoke(*__parent_->__fun_, *__iters...); },
209 __adjacent_view_iter_access::__get_current(__inner_));
210 }
211
212 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
213 ++__inner_;
214 return *this;
215 }
216
217 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int) {
218 auto __tmp = *this;
219 ++*this;
220 return __tmp;
221 }
222
223 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
224 requires bidirectional_range<_Base>
225 {
226 --__inner_;
227 return *this;
228 }
229
230 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
231 requires bidirectional_range<_Base>
232 {
233 auto __tmp = *this;
234 --*this;
235 return __tmp;
236 }
237
238 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __x)
239 requires random_access_range<_Base>
240 {
241 __inner_ += __x;
242 return *this;
243 }
244
245 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __x)
246 requires random_access_range<_Base>
247 {
248 __inner_ -= __x;
249 return *this;
250 }
251
252 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
253 requires random_access_range<_Base>
254 {
255 return std::apply(
256 [&](const auto&... __iters) -> decltype(auto) { return std::invoke(*__parent_->__fun_, __iters[__n]...); },
257 __adjacent_view_iter_access::__get_current(__inner_));
258 }
259
260 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {
261 return __x.__inner_ == __y.__inner_;
262 }
263
264 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
265 requires random_access_range<_Base>
266 {
267 return __x.__inner_ < __y.__inner_;
268 }
269
270 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
271 requires random_access_range<_Base>
272 {
273 return __x.__inner_ > __y.__inner_;
274 }
275
276 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
277 requires random_access_range<_Base>
278 {
279 return __x.__inner_ <= __y.__inner_;
280 }
281
282 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
283 requires random_access_range<_Base>
284 {
285 return __x.__inner_ >= __y.__inner_;
286 }
287
288 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
289 requires random_access_range<_Base> && three_way_comparable<__inner_iterator<_Const>>
290 {
291 return __x.__inner_ <=> __y.__inner_;
292 }
293
294 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
295 requires random_access_range<_Base>
296 {
297 return __iterator(*__i.__parent_, __i.__inner_ + __n);
298 }
299
300 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
301 requires random_access_range<_Base>
302 {
303 return __iterator(*__i.__parent_, __i.__inner_ + __n);
304 }
305
306 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
307 requires random_access_range<_Base>
308 {
309 return __iterator(*__i.__parent_, __i.__inner_ - __n);
310 }
311
312 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
313 requires sized_sentinel_for<__inner_iterator<_Const>, __inner_iterator<_Const>>
314 {
315 return __x.__inner_ - __y.__inner_;
316 }
317};
318
319template <forward_range _View, move_constructible _Fn, size_t _Np>
320 requires view<_View> && (_Np > 0) && is_object_v<_Fn> &&
321 regular_invocable<__apply_n<_Fn&, _Np>, range_reference_t<_View>> &&
322 __referenceable<invoke_result_t<__apply_n<_Fn&, _Np>, range_reference_t<_View>>>
323template <bool _Const>
324class adjacent_transform_view<_View, _Fn, _Np>::__sentinel {
325 friend adjacent_transform_view;
326
327 __inner_sentinel<_Const> __inner_;
328
329 _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(__inner_sentinel<_Const> __inner)
330 : __inner_(std::move(__inner)) {}
331
332public:
333 _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
334
335 _LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __i)
336 requires _Const && convertible_to<__inner_sentinel<false>, __inner_sentinel<_Const>>
337 : __inner_(std::move(__i.__inner_)) {}
338
339 template <bool _OtherConst>
340 requires sentinel_for<__inner_sentinel<_Const>, __inner_iterator<_OtherConst>>
341 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
342 return __x.__inner_ == __y.__inner_;
343 }
344
345 template <bool _OtherConst>
346 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 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
349 return __x.__inner_ - __y.__inner_;
350 }
351
352 template <bool _OtherConst>
353 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 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
356 return __x.__inner_ - __y.__inner_;
357 }
358};
359
360namespace views {
361namespace __adjacent_transform {
362
363template <size_t _Np>
364struct __fn : __range_adaptor_closure<__fn<_Np>> {
365 template <class _Range, class _Fn>
366 requires(_Np == 0 && forward_range<_Range &&>)
367 _LIBCPP_HIDE_FROM_ABI static constexpr auto
368 operator()(_Range&&, _Fn&& __fn) noexcept(noexcept(views::zip_transform(std::forward<_Fn>(__fn))))
369 -> decltype(views::zip_transform(std::forward<_Fn>(__fn))) {
370 return views::zip_transform(std::forward<_Fn>(__fn));
371 }
372
373 template <class _Range, class _Fn>
374 _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 std::forward<_Range>(__range), std::forward<_Fn>(__fn))))
377 -> decltype(adjacent_transform_view<views::all_t<_Range&&>, decay_t<_Fn>, _Np>(
378 std::forward<_Range>(__range), std::forward<_Fn>(__fn))) {
379 return adjacent_transform_view<views::all_t<_Range&&>, decay_t<_Fn>, _Np>(
380 std::forward<_Range>(__range), std::forward<_Fn>(__fn));
381 }
382
383 template <class _Fn>
384 requires constructible_from<decay_t<_Fn>, _Fn>
385 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&& __f) const
386 noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>) {
387 return __pipeable(std::__bind_back(*this, std::forward<_Fn>(__f)));
388 }
389};
390
391} // namespace __adjacent_transform
392inline namespace __cpo {
393template <size_t _Np>
394inline constexpr auto adjacent_transform = __adjacent_transform::__fn<_Np>{};
395inline constexpr auto pairwise_transform = adjacent_transform<2>;
396} // namespace __cpo
397} // namespace views
398} // namespace ranges
399
400#endif // _LIBCPP_STD_VER >= 23
401
402_LIBCPP_END_NAMESPACE_STD
403
404_LIBCPP_POP_MACROS
405
406#endif // _LIBCPP___RANGES_ADJACENT_TRANSFORM_VIEW_H
lib/libcxx/include/__ranges/adjacent_view.h created+419
...@@ -0,0 +1,419 @@
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_ADJACENT_VIEW_H
11#define _LIBCPP___RANGES_ADJACENT_VIEW_H
12
13#include <__config>
14
15#include <__algorithm/min.h>
16#include <__compare/three_way_comparable.h>
17#include <__concepts/constructible.h>
18#include <__concepts/convertible_to.h>
19#include <__concepts/equality_comparable.h>
20#include <__cstddef/size_t.h>
21#include <__functional/invoke.h>
22#include <__functional/operations.h>
23#include <__iterator/concepts.h>
24#include <__iterator/incrementable_traits.h>
25#include <__iterator/iter_move.h>
26#include <__iterator/iter_swap.h>
27#include <__iterator/iterator_traits.h>
28#include <__iterator/next.h>
29#include <__iterator/prev.h>
30#include <__ranges/access.h>
31#include <__ranges/all.h>
32#include <__ranges/concepts.h>
33#include <__ranges/empty_view.h>
34#include <__ranges/enable_borrowed_range.h>
35#include <__ranges/range_adaptor.h>
36#include <__ranges/size.h>
37#include <__ranges/view_interface.h>
38#include <__tuple/tuple_transform.h>
39#include <__type_traits/common_type.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/declval.h>
44#include <__utility/forward.h>
45#include <__utility/integer_sequence.h>
46#include <__utility/move.h>
47#include <array>
48#include <tuple>
49
50#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
51# pragma GCC system_header
52#endif
53
54_LIBCPP_PUSH_MACROS
55#include <__undef_macros>
56
57_LIBCPP_BEGIN_NAMESPACE_STD
58
59#if _LIBCPP_STD_VER >= 23
60
61namespace ranges {
62
63template <forward_range _View, size_t _Np>
64 requires view<_View> && (_Np > 0)
65class adjacent_view : public view_interface<adjacent_view<_View, _Np>> {
66private:
67 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
68
69 template <bool>
70 class __iterator;
71
72 template <bool>
73 class __sentinel;
74
75 struct __as_sentinel {};
76
77public:
78 _LIBCPP_HIDE_FROM_ABI adjacent_view()
79 requires default_initializable<_View>
80 = default;
81
82 _LIBCPP_HIDE_FROM_ABI constexpr explicit adjacent_view(_View __base) : __base_(std::move(__base)) {}
83
84 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
85 requires copy_constructible<_View>
86 {
87 return __base_;
88 }
89 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
90
91 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
92 requires(!__simple_view<_View>)
93 {
94 return __iterator<false>(ranges::begin(__base_), ranges::end(__base_));
95 }
96
97 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
98 requires range<const _View> // LWG4482 This is under-constrained.
99 {
100 return __iterator<true>(ranges::begin(__base_), ranges::end(__base_));
101 }
102
103 _LIBCPP_HIDE_FROM_ABI constexpr auto end()
104 requires(!__simple_view<_View>)
105 {
106 if constexpr (common_range<_View>) {
107 return __iterator<false>(__as_sentinel{}, ranges::begin(__base_), ranges::end(__base_));
108 } else {
109 return __sentinel<false>(ranges::end(__base_));
110 }
111 }
112
113 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
114 requires range<const _View> // LWG4482 This is under-constrained.
115 {
116 if constexpr (common_range<const _View>) {
117 return __iterator<true>(__as_sentinel{}, ranges::begin(__base_), ranges::end(__base_));
118 } else {
119 return __sentinel<true>(ranges::end(__base_));
120 }
121 }
122
123 _LIBCPP_HIDE_FROM_ABI constexpr auto size()
124 requires sized_range<_View>
125 {
126 using _ST = decltype(ranges::size(__base_));
127 using _CT = common_type_t<_ST, size_t>;
128 auto __sz = static_cast<_CT>(ranges::size(__base_));
129 __sz -= std::min<_CT>(__sz, _Np - 1);
130 return static_cast<_ST>(__sz);
131 }
132
133 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
134 requires sized_range<const _View>
135 {
136 using _ST = decltype(ranges::size(__base_));
137 using _CT = common_type_t<_ST, size_t>;
138 auto __sz = static_cast<_CT>(ranges::size(__base_));
139 __sz -= std::min<_CT>(__sz, _Np - 1);
140 return static_cast<_ST>(__sz);
141 }
142};
143
144struct __adjacent_view_iter_access {
145 template <class _Iter>
146 _LIBCPP_HIDE_FROM_ABI constexpr static auto& __get_current(_Iter& __it) noexcept {
147 return __it.__current_;
148 }
149};
150
151template <forward_range _View, size_t _Np>
152 requires view<_View> && (_Np > 0)
153template <bool _Const>
154class adjacent_view<_View, _Np>::__iterator {
155 friend __adjacent_view_iter_access;
156 friend adjacent_view;
157 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
158 array<iterator_t<_Base>, _Np> __current_ = array<iterator_t<_Base>, _Np>();
159
160 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(iterator_t<_Base> __first, sentinel_t<_Base> __last) {
161 __current_[0] = __first;
162 for (size_t __i = 1; __i < _Np; ++__i) {
163 __current_[__i] = ranges::next(__current_[__i - 1], 1, __last);
164 }
165 }
166
167 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__as_sentinel, iterator_t<_Base> __first, iterator_t<_Base> __last) {
168 if constexpr (!bidirectional_range<_Base>) {
169 __current_.fill(__last);
170 } else {
171 __current_[_Np - 1] = __last;
172 for (int __i = static_cast<int>(_Np) - 2; __i >= 0; --__i) {
173 __current_[__i] = ranges::prev(__current_[__i + 1], 1, __first);
174 }
175 }
176 }
177
178 template <class _Iter, size_t... _Is>
179 _LIBCPP_HIDE_FROM_ABI explicit constexpr __iterator(_Iter&& __i, index_sequence<_Is...>)
180 : __current_{std::move(__i.__current_[_Is])...} {}
181
182 static consteval auto __get_iterator_concept() {
183 if constexpr (random_access_range<_Base>)
184 return random_access_iterator_tag{};
185 else if constexpr (bidirectional_range<_Base>)
186 return bidirectional_iterator_tag{};
187 else
188 return forward_iterator_tag{};
189 }
190
191 template <class _Tp, size_t _Index>
192 using __always _LIBCPP_NODEBUG = _Tp;
193
194 template <class _Tp, size_t... _Is>
195 static auto __repeat_tuple_helper(index_sequence<_Is...>) -> tuple<__always<_Tp, _Is>...>;
196
197public:
198 using iterator_category = input_iterator_tag;
199 using iterator_concept = decltype(__get_iterator_concept());
200 using value_type = decltype(__repeat_tuple_helper<range_value_t<_Base>>(make_index_sequence<_Np>{}));
201 using difference_type = range_difference_t<_Base>;
202
203 _LIBCPP_HIDE_FROM_ABI __iterator() = default;
204 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
205 requires _Const && convertible_to<iterator_t<_View>, iterator_t<const _View>>
206 : __iterator(std::move(__i), make_index_sequence<_Np>{}) {}
207
208 _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {
209 return std::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);
210 }
211
212 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
213 for (auto& __i : __current_) {
214 ++__i;
215 }
216 return *this;
217 }
218
219 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int) {
220 auto __tmp = *this;
221 ++*this;
222 return __tmp;
223 }
224
225 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
226 requires bidirectional_range<_Base>
227 {
228 for (auto& __i : __current_) {
229 --__i;
230 }
231 return *this;
232 }
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 __x)
243 requires random_access_range<_Base>
244 {
245 for (auto& __i : __current_) {
246 __i += __x;
247 }
248 return *this;
249 }
250
251 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __x)
252 requires random_access_range<_Base>
253 {
254 for (auto& __i : __current_) {
255 __i -= __x;
256 }
257 return *this;
258 }
259
260 _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const
261 requires random_access_range<_Base>
262 {
263 return std::__tuple_transform([&](auto& __i) -> decltype(auto) { return __i[__n]; }, __current_);
264 }
265
266 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {
267 return __x.__current_.back() == __y.__current_.back();
268 }
269
270 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
271 requires random_access_range<_Base>
272 {
273 return __x.__current_.back() < __y.__current_.back();
274 }
275
276 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
277 requires random_access_range<_Base>
278 {
279 return __y < __x;
280 }
281
282 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
283 requires random_access_range<_Base>
284 {
285 return !(__y < __x);
286 }
287
288 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
289 requires random_access_range<_Base>
290 {
291 return !(__x < __y);
292 }
293
294 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
295 requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
296 {
297 return __x.__current_.back() <=> __y.__current_.back();
298 }
299
300 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
301 requires random_access_range<_Base>
302 {
303 auto __r = __i;
304 __r += __n;
305 return __r;
306 }
307
308 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
309 requires random_access_range<_Base>
310 {
311 return __i + __n;
312 }
313
314 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
315 requires random_access_range<_Base>
316 {
317 auto __r = __i;
318 __r -= __n;
319 return __r;
320 }
321
322 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
323 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
324 {
325 return __x.__current_.back() - __y.__current_.back();
326 }
327
328 _LIBCPP_HIDE_FROM_ABI friend constexpr auto iter_move(const __iterator& __i) noexcept(
329 noexcept(ranges::iter_move(std::declval<const iterator_t<_Base>&>())) &&
330 is_nothrow_move_constructible_v<range_rvalue_reference_t<_Base>>) {
331 return std::__tuple_transform(ranges::iter_move, __i.__current_);
332 }
333
334 _LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const __iterator& __l, const __iterator& __r) noexcept(
335 noexcept(ranges::iter_swap(std::declval<iterator_t<_Base>>(), std::declval<iterator_t<_Base>>())))
336 requires indirectly_swappable<iterator_t<_Base>>
337 {
338 for (size_t __i = 0; __i < _Np; ++__i) {
339 ranges::iter_swap(__l.__current_[__i], __r.__current_[__i]);
340 }
341 }
342};
343
344template <forward_range _View, size_t _Np>
345 requires view<_View> && (_Np > 0)
346template <bool _Const>
347class adjacent_view<_View, _Np>::__sentinel {
348 friend adjacent_view;
349 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
350 sentinel_t<_Base> __end_ = sentinel_t<_Base>();
351
352 _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) { __end_ = std::move(__end); }
353
354public:
355 _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
356
357 _LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __i)
358 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
359 : __end_(std::move(__i.__end_)) {}
360
361 template <bool _OtherConst>
362 requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
363 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
364 return __x.__current_.back() == __y.__end_;
365 }
366
367 template <bool _OtherConst>
368 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 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
371 return __x.__current_.back() - __y.__end_;
372 }
373
374 template <bool _OtherConst>
375 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 operator-(const __sentinel& __y, const __iterator<_OtherConst>& __x) {
378 return __y.__end_ - __x.__current_.back();
379 }
380};
381
382template <class _View, size_t _Np>
383constexpr bool enable_borrowed_range<adjacent_view<_View, _Np>> = enable_borrowed_range<_View>;
384
385namespace views {
386namespace __adjacent {
387
388template <size_t _Np>
389struct __fn : __range_adaptor_closure<__fn<_Np>> {
390 template <class _Range>
391 requires(_Np == 0 && forward_range<_Range &&>)
392 _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&&) noexcept {
393 return empty_view<tuple<>>{};
394 }
395
396 template <class _Ranges>
397 _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 -> 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 }
402};
403
404} // namespace __adjacent
405inline namespace __cpo {
406template <size_t _Np>
407inline constexpr auto adjacent = __adjacent::__fn<_Np>{};
408inline constexpr auto pairwise = adjacent<2>;
409} // namespace __cpo
410} // namespace views
411} // namespace ranges
412
413#endif // _LIBCPP_STD_VER >= 23
414
415_LIBCPP_END_NAMESPACE_STD
416
417_LIBCPP_POP_MACROS
418
419#endif // _LIBCPP___RANGES_ADJACENT_VIEW_H
lib/libcxx/include/__ranges/as_rvalue_view.h+9-9
...@@ -48,27 +48,27 @@ public:...@@ -48,27 +48,27 @@ public:
4848
49 _LIBCPP_HIDE_FROM_ABI constexpr explicit as_rvalue_view(_View __base) : __base_(std::move(__base)) {}49 _LIBCPP_HIDE_FROM_ABI constexpr explicit as_rvalue_view(_View __base) : __base_(std::move(__base)) {}
5050
51 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&51 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
52 requires copy_constructible<_View>52 requires copy_constructible<_View>
53 {53 {
54 return __base_;54 return __base_;
55 }55 }
5656
57 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }57 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
5858
59 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
60 requires(!__simple_view<_View>)60 requires(!__simple_view<_View>)
61 {61 {
62 return move_iterator(ranges::begin(__base_));62 return move_iterator(ranges::begin(__base_));
63 }63 }
6464
65 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const65 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
66 requires range<const _View>66 requires range<const _View>
67 {67 {
68 return move_iterator(ranges::begin(__base_));68 return move_iterator(ranges::begin(__base_));
69 }69 }
7070
71 _LIBCPP_HIDE_FROM_ABI constexpr auto end()71 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
72 requires(!__simple_view<_View>)72 requires(!__simple_view<_View>)
73 {73 {
74 if constexpr (common_range<_View>) {74 if constexpr (common_range<_View>) {
...@@ -78,7 +78,7 @@ public:...@@ -78,7 +78,7 @@ public:
78 }78 }
79 }79 }
8080
81 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const81 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
82 requires range<const _View>82 requires range<const _View>
83 {83 {
84 if constexpr (common_range<const _View>) {84 if constexpr (common_range<const _View>) {
...@@ -88,13 +88,13 @@ public:...@@ -88,13 +88,13 @@ public:
88 }88 }
89 }89 }
9090
91 _LIBCPP_HIDE_FROM_ABI constexpr auto size()91 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
92 requires sized_range<_View>92 requires sized_range<_View>
93 {93 {
94 return ranges::size(__base_);94 return ranges::size(__base_);
95 }95 }
9696
97 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
98 requires sized_range<const _View>98 requires sized_range<const _View>
99 {99 {
100 return ranges::size(__base_);100 return ranges::size(__base_);
...@@ -117,7 +117,7 @@ struct __fn : __range_adaptor_closure<__fn> {...@@ -117,7 +117,7 @@ struct __fn : __range_adaptor_closure<__fn> {
117 return /*---------------------------------*/ as_rvalue_view(std::forward<_Range>(__range));117 return /*---------------------------------*/ as_rvalue_view(std::forward<_Range>(__range));
118 }118 }
119119
120 template <class _Range>120 template <input_range _Range>
121 requires same_as<range_rvalue_reference_t<_Range>, range_reference_t<_Range>>121 requires same_as<range_rvalue_reference_t<_Range>, range_reference_t<_Range>>
122 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto122 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
123 operator()(_Range&& __range) noexcept(noexcept(views::all(std::forward<_Range>(__range))))123 operator()(_Range&& __range) noexcept(noexcept(views::all(std::forward<_Range>(__range))))
lib/libcxx/include/__ranges/chunk_by_view.h+6-6
...@@ -100,17 +100,17 @@ public:...@@ -100,17 +100,17 @@ public:
100 _LIBCPP_HIDE_FROM_ABI constexpr explicit chunk_by_view(_View __base, _Pred __pred)100 _LIBCPP_HIDE_FROM_ABI constexpr explicit chunk_by_view(_View __base, _Pred __pred)
101 : __base_(std::move(__base)), __pred_(in_place, std::move(__pred)) {}101 : __base_(std::move(__base)), __pred_(in_place, std::move(__pred)) {}
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 const _Pred& pred() const { return *__pred_; }111 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }
112112
113 _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {113 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
114 // Note: this duplicates a check in `optional` but provides a better error message.114 // Note: this duplicates a check in `optional` but provides a better error message.
115 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(115 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
116 __pred_.__has_value(), "Trying to call begin() on a chunk_by_view that does not have a valid predicate.");116 __pred_.__has_value(), "Trying to call begin() on a chunk_by_view that does not have a valid predicate.");
...@@ -122,7 +122,7 @@ public:...@@ -122,7 +122,7 @@ public:
122 return {*this, std::move(__first), *__cached_begin_};122 return {*this, std::move(__first), *__cached_begin_};
123 }123 }
124124
125 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {125 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
126 if constexpr (common_range<_View>) {126 if constexpr (common_range<_View>) {
127 return __iterator{*this, ranges::end(__base_), ranges::end(__base_)};127 return __iterator{*this, ranges::end(__base_), ranges::end(__base_)};
128 } else {128 } else {
...@@ -155,7 +155,7 @@ public:...@@ -155,7 +155,7 @@ public:
155155
156 _LIBCPP_HIDE_FROM_ABI __iterator() = default;156 _LIBCPP_HIDE_FROM_ABI __iterator() = default;
157157
158 _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const {158 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const {
159 // If the iterator is at end, this would return an empty range which can be checked by the calling code and doesn't159 // If the iterator is at end, this would return an empty range which can be checked by the calling code and doesn't
160 // necessarily lead to a bad access.160 // necessarily lead to a bad access.
161 _LIBCPP_ASSERT_PEDANTIC(__current_ != __next_, "Trying to dereference past-the-end chunk_by_view iterator.");161 _LIBCPP_ASSERT_PEDANTIC(__current_ != __next_, "Trying to dereference past-the-end chunk_by_view iterator.");
lib/libcxx/include/__ranges/common_view.h+7-7
...@@ -56,16 +56,16 @@ public:...@@ -56,16 +56,16 @@ public:
56 return __base_;56 return __base_;
57 }57 }
5858
59 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
6060
61 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {61 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
62 if constexpr (random_access_range<_View> && sized_range<_View>)62 if constexpr (random_access_range<_View> && sized_range<_View>)
63 return ranges::begin(__base_);63 return ranges::begin(__base_);
64 else64 else
65 return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_));65 return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_));
66 }66 }
6767
68 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
69 requires range<const _View>69 requires range<const _View>
70 {70 {
71 if constexpr (random_access_range<const _View> && sized_range<const _View>)71 if constexpr (random_access_range<const _View> && sized_range<const _View>)
...@@ -74,14 +74,14 @@ public:...@@ -74,14 +74,14 @@ public:
74 return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_));74 return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_));
75 }75 }
7676
77 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {77 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
78 if constexpr (random_access_range<_View> && sized_range<_View>)78 if constexpr (random_access_range<_View> && sized_range<_View>)
79 return ranges::begin(__base_) + ranges::size(__base_);79 return ranges::begin(__base_) + ranges::size(__base_);
80 else80 else
81 return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_));81 return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_));
82 }82 }
8383
84 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
85 requires range<const _View>85 requires range<const _View>
86 {86 {
87 if constexpr (random_access_range<const _View> && sized_range<const _View>)87 if constexpr (random_access_range<const _View> && sized_range<const _View>)
...@@ -90,13 +90,13 @@ public:...@@ -90,13 +90,13 @@ public:
90 return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_));90 return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_));
91 }91 }
9292
93 _LIBCPP_HIDE_FROM_ABI constexpr auto size()93 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
94 requires sized_range<_View>94 requires sized_range<_View>
95 {95 {
96 return ranges::size(__base_);96 return ranges::size(__base_);
97 }97 }
9898
99 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const99 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
100 requires sized_range<const _View>100 requires sized_range<const _View>
101 {101 {
102 return ranges::size(__base_);102 return ranges::size(__base_);
lib/libcxx/include/__ranges/drop_view.h+8-8
...@@ -80,14 +80,14 @@ public:...@@ -80,14 +80,14 @@ public:
80 _LIBCPP_ASSERT_UNCATEGORIZED(__count_ >= 0, "count must be greater than or equal to zero.");80 _LIBCPP_ASSERT_UNCATEGORIZED(__count_ >= 0, "count must be greater than or equal to zero.");
81 }81 }
8282
83 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&83 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
84 requires copy_constructible<_View>84 requires copy_constructible<_View>
85 {85 {
86 return __base_;86 return __base_;
87 }87 }
88 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }88 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
8989
90 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
91 requires(!(__simple_view<_View> && random_access_range<const _View> && sized_range<const _View>))91 requires(!(__simple_view<_View> && random_access_range<const _View> && sized_range<const _View>))
92 {92 {
93 if constexpr (random_access_range<_View> && sized_range<_View>) {93 if constexpr (random_access_range<_View> && sized_range<_View>) {
...@@ -104,20 +104,20 @@ public:...@@ -104,20 +104,20 @@ public:
104 return __tmp;104 return __tmp;
105 }105 }
106106
107 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const107 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
108 requires random_access_range<const _View> && sized_range<const _View>108 requires random_access_range<const _View> && sized_range<const _View>
109 {109 {
110 const auto __dist = std::min(ranges::distance(__base_), __count_);110 const auto __dist = std::min(ranges::distance(__base_), __count_);
111 return ranges::begin(__base_) + __dist;111 return ranges::begin(__base_) + __dist;
112 }112 }
113113
114 _LIBCPP_HIDE_FROM_ABI constexpr auto end()114 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
115 requires(!__simple_view<_View>)115 requires(!__simple_view<_View>)
116 {116 {
117 return ranges::end(__base_);117 return ranges::end(__base_);
118 }118 }
119119
120 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const120 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
121 requires range<const _View>121 requires range<const _View>
122 {122 {
123 return ranges::end(__base_);123 return ranges::end(__base_);
...@@ -129,13 +129,13 @@ public:...@@ -129,13 +129,13 @@ public:
129 return __s < __c ? 0 : __s - __c;129 return __s < __c ? 0 : __s - __c;
130 }130 }
131131
132 _LIBCPP_HIDE_FROM_ABI constexpr auto size()132 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
133 requires sized_range<_View>133 requires sized_range<_View>
134 {134 {
135 return __size(*this);135 return __size(*this);
136 }136 }
137137
138 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const138 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
139 requires sized_range<const _View>139 requires sized_range<const _View>
140 {140 {
141 return __size(*this);141 return __size(*this);
lib/libcxx/include/__ranges/drop_while_view.h+5-5
...@@ -57,17 +57,17 @@ public:...@@ -57,17 +57,17 @@ public:
57 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 drop_while_view(_View __base, _Pred __pred)57 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 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 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&60 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
61 requires copy_constructible<_View>61 requires copy_constructible<_View>
62 {62 {
63 return __base_;63 return __base_;
64 }64 }
6565
66 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }66 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
6767
68 _LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }
6969
70 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
71 // Note: this duplicates a check in `optional` but provides a better error message.71 // Note: this duplicates a check in `optional` but provides a better error message.
72 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(72 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
73 __pred_.__has_value(),73 __pred_.__has_value(),
...@@ -83,7 +83,7 @@ public:...@@ -83,7 +83,7 @@ public:
83 }83 }
84 }84 }
8585
86 _LIBCPP_HIDE_FROM_ABI constexpr auto end() { return ranges::end(__base_); }86 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() { return ranges::end(__base_); }
8787
88private:88private:
89 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();89 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
lib/libcxx/include/__ranges/elements_of.h created+49
...@@ -0,0 +1,49 @@
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_ELEMENTS_OF_H
11#define _LIBCPP___RANGES_ELEMENTS_OF_H
12
13#include <__config>
14#include <__cstddef/byte.h>
15#include <__memory/allocator.h>
16#include <__ranges/concepts.h>
17#include <__utility/forward.h>
18
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header
21#endif
22
23_LIBCPP_PUSH_MACROS
24#include <__undef_macros>
25
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28#if _LIBCPP_STD_VER >= 23
29
30namespace ranges {
31
32template <range _Range, class _Allocator = allocator<byte>>
33struct elements_of {
34 _LIBCPP_NO_UNIQUE_ADDRESS _Range range;
35 _LIBCPP_NO_UNIQUE_ADDRESS _Allocator allocator = _Allocator();
36};
37
38template <class _Range, class _Allocator = allocator<byte>>
39elements_of(_Range&&, _Allocator = _Allocator()) -> elements_of<_Range&&, _Allocator>;
40
41} // namespace ranges
42
43#endif // _LIBCPP_STD_VER >= 23
44
45_LIBCPP_END_NAMESPACE_STD
46
47_LIBCPP_POP_MACROS
48
49#endif // _LIBCPP___RANGES_ELEMENTS_OF_H
lib/libcxx/include/__ranges/empty_view.h+5-5
...@@ -29,11 +29,11 @@ template <class _Tp>...@@ -29,11 +29,11 @@ template <class _Tp>
29 requires is_object_v<_Tp>29 requires is_object_v<_Tp>
30class empty_view : public view_interface<empty_view<_Tp>> {30class empty_view : public view_interface<empty_view<_Tp>> {
31public:31public:
32 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }32 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
33 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }33 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
34 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }34 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
35 _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }35 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
36 _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }36 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }
37};37};
3838
39template <class _Tp>39template <class _Tp>
lib/libcxx/include/__ranges/filter_view.h+10-10
...@@ -76,16 +76,16 @@ public:...@@ -76,16 +76,16 @@ public:
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>
79 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&79 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
80 requires copy_constructible<_Vp>80 requires copy_constructible<_Vp>
81 {81 {
82 return __base_;82 return __base_;
83 }83 }
84 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
8585
86 _LIBCPP_HIDE_FROM_ABI constexpr _Pred const& pred() const { return *__pred_; }86 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Pred const& pred() const { return *__pred_; }
8787
88 _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {88 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
89 // Note: this duplicates a check in `optional` but provides a better error message.89 // Note: this duplicates a check in `optional` but provides a better error message.
90 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(90 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
91 __pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");91 __pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");
...@@ -99,7 +99,7 @@ public:...@@ -99,7 +99,7 @@ public:
99 }99 }
100 }100 }
101101
102 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {102 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
103 if constexpr (common_range<_View>)103 if constexpr (common_range<_View>)
104 return __iterator{*this, ranges::end(__base_)};104 return __iterator{*this, ranges::end(__base_)};
105 else105 else
...@@ -148,10 +148,10 @@ public:...@@ -148,10 +148,10 @@ public:
148 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(filter_view& __parent, iterator_t<_View> __current)148 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(filter_view& __parent, iterator_t<_View> __current)
149 : __current_(std::move(__current)), __parent_(std::addressof(__parent)) {}149 : __current_(std::move(__current)), __parent_(std::addressof(__parent)) {}
150150
151 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> const& base() const& noexcept { return __current_; }151 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> const& base() const& noexcept { return __current_; }
152 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> base() && { return std::move(__current_); }152 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> base() && { return std::move(__current_); }
153153
154 _LIBCPP_HIDE_FROM_ABI constexpr range_reference_t<_View> operator*() const { return *__current_; }154 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_reference_t<_View> operator*() const { return *__current_; }
155 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> operator->() const155 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> operator->() const
156 requires __has_arrow<iterator_t<_View>> && copyable<iterator_t<_View>>156 requires __has_arrow<iterator_t<_View>> && copyable<iterator_t<_View>>
157 {157 {
...@@ -194,7 +194,7 @@ public:...@@ -194,7 +194,7 @@ public:
194 return __x.__current_ == __y.__current_;194 return __x.__current_ == __y.__current_;
195 }195 }
196196
197 _LIBCPP_HIDE_FROM_ABI friend constexpr range_rvalue_reference_t<_View>197 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_rvalue_reference_t<_View>
198 iter_move(__iterator const& __it) noexcept(noexcept(ranges::iter_move(__it.__current_))) {198 iter_move(__iterator const& __it) noexcept(noexcept(ranges::iter_move(__it.__current_))) {
199 return ranges::iter_move(__it.__current_);199 return ranges::iter_move(__it.__current_);
200 }200 }
...@@ -218,7 +218,7 @@ public:...@@ -218,7 +218,7 @@ public:
218218
219 _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(filter_view& __parent) : __end_(ranges::end(__parent.__base_)) {}219 _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(filter_view& __parent) : __end_(ranges::end(__parent.__base_)) {}
220220
221 _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_View> base() const { return __end_; }221 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_View> base() const { return __end_; }
222222
223 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(__iterator const& __x, __sentinel const& __y) {223 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(__iterator const& __x, __sentinel const& __y) {
224 return __x.__current_ == __y.__end_;224 return __x.__current_ == __y.__end_;
lib/libcxx/include/__ranges/iota_view.h+41-22
...@@ -30,6 +30,7 @@...@@ -30,6 +30,7 @@
30#include <__ranges/movable_box.h>30#include <__ranges/movable_box.h>
31#include <__ranges/view_interface.h>31#include <__ranges/view_interface.h>
32#include <__type_traits/conditional.h>32#include <__type_traits/conditional.h>
33#include <__type_traits/decay.h>
33#include <__type_traits/is_nothrow_constructible.h>34#include <__type_traits/is_nothrow_constructible.h>
34#include <__type_traits/make_unsigned.h>35#include <__type_traits/make_unsigned.h>
35#include <__type_traits/type_identity.h>36#include <__type_traits/type_identity.h>
...@@ -57,11 +58,17 @@ struct __get_wider_signed {...@@ -57,11 +58,17 @@ struct __get_wider_signed {
57 return type_identity<int>{};58 return type_identity<int>{};
58 else if constexpr (sizeof(_Int) < sizeof(long))59 else if constexpr (sizeof(_Int) < sizeof(long))
59 return type_identity<long>{};60 return type_identity<long>{};
60 else61 else if constexpr (sizeof(_Int) < sizeof(long long))
61 return type_identity<long long>{};62 return type_identity<long long>{};
6263# if _LIBCPP_HAS_INT128
63 static_assert(64 else if constexpr (sizeof(_Int) <= sizeof(__int128))
64 sizeof(_Int) <= sizeof(long long), "Found integer-like type that is bigger than largest integer like type.");65 return type_identity<__int128>{};
66# else
67 else if constexpr (sizeof(_Int) <= sizeof(long long))
68 return type_identity<long long>{};
69# endif
70 else
71 static_assert(false, "Found integer-like type that is bigger than the largest integer like type.");
65 }72 }
6673
67 using type = typename decltype(__call())::type;74 using type = typename decltype(__call())::type;
...@@ -125,7 +132,8 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {...@@ -125,7 +132,8 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
125132
126 _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {}133 _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {}
127134
128 _LIBCPP_HIDE_FROM_ABI constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) {135 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Start operator*() const
136 noexcept(is_nothrow_copy_constructible_v<_Start>) {
129 return __value_;137 return __value_;
130 }138 }
131139
...@@ -189,7 +197,7 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {...@@ -189,7 +197,7 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
189 return *this;197 return *this;
190 }198 }
191199
192 _LIBCPP_HIDE_FROM_ABI constexpr _Start operator[](difference_type __n) const200 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Start operator[](difference_type __n) const
193 requires __advanceable<_Start>201 requires __advanceable<_Start>
194 {202 {
195 return _Start(__value_ + __n);203 return _Start(__value_ + __n);
...@@ -231,27 +239,28 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {...@@ -231,27 +239,28 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
231 return __x.__value_ <=> __y.__value_;239 return __x.__value_ <=> __y.__value_;
232 }240 }
233241
234 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n)242 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n)
235 requires __advanceable<_Start>243 requires __advanceable<_Start>
236 {244 {
237 __i += __n;245 __i += __n;
238 return __i;246 return __i;
239 }247 }
240248
241 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i)249 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i)
242 requires __advanceable<_Start>250 requires __advanceable<_Start>
243 {251 {
244 return __i + __n;252 return __i + __n;
245 }253 }
246254
247 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n)255 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n)
248 requires __advanceable<_Start>256 requires __advanceable<_Start>
249 {257 {
250 __i -= __n;258 __i -= __n;
251 return __i;259 return __i;
252 }260 }
253261
254 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)262 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
263 operator-(const __iterator& __x, const __iterator& __y)
255 requires __advanceable<_Start>264 requires __advanceable<_Start>
256 {265 {
257 if constexpr (__integer_like<_Start>) {266 if constexpr (__integer_like<_Start>) {
...@@ -282,14 +291,14 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {...@@ -282,14 +291,14 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
282 return __x.__value_ == __y.__bound_sentinel_;291 return __x.__value_ == __y.__bound_sentinel_;
283 }292 }
284293
285 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Start>294 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Start>
286 operator-(const __iterator& __x, const __sentinel& __y)295 operator-(const __iterator& __x, const __sentinel& __y)
287 requires sized_sentinel_for<_BoundSentinel, _Start>296 requires sized_sentinel_for<_BoundSentinel, _Start>
288 {297 {
289 return __x.__value_ - __y.__bound_sentinel_;298 return __x.__value_ - __y.__bound_sentinel_;
290 }299 }
291300
292 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Start>301 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Start>
293 operator-(const __sentinel& __x, const __iterator& __y)302 operator-(const __sentinel& __x, const __iterator& __y)
294 requires sized_sentinel_for<_BoundSentinel, _Start>303 requires sized_sentinel_for<_BoundSentinel, _Start>
295 {304 {
...@@ -329,24 +338,24 @@ public:...@@ -329,24 +338,24 @@ public:
329 requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)338 requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)
330 : iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}339 : iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}
331340
332 _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator{__value_}; }341 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator{__value_}; }
333342
334 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {343 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
335 if constexpr (same_as<_BoundSentinel, unreachable_sentinel_t>)344 if constexpr (same_as<_BoundSentinel, unreachable_sentinel_t>)
336 return unreachable_sentinel;345 return unreachable_sentinel;
337 else346 else
338 return __sentinel{__bound_sentinel_};347 return __sentinel{__bound_sentinel_};
339 }348 }
340349
341 _LIBCPP_HIDE_FROM_ABI constexpr __iterator end() const350 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator end() const
342 requires same_as<_Start, _BoundSentinel>351 requires same_as<_Start, _BoundSentinel>
343 {352 {
344 return __iterator{__bound_sentinel_};353 return __iterator{__bound_sentinel_};
345 }354 }
346355
347 _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { return __value_ == __bound_sentinel_; }356 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { return __value_ == __bound_sentinel_; }
348357
349 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const358 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
350 requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||359 requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||
351 (integral<_Start> && integral<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>360 (integral<_Start> && integral<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>
352 {361 {
...@@ -374,14 +383,15 @@ namespace views {...@@ -374,14 +383,15 @@ namespace views {
374namespace __iota {383namespace __iota {
375struct __fn {384struct __fn {
376 template <class _Start>385 template <class _Start>
377 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Start&& __start) const386 requires(requires(_Start __s) { ranges::iota_view<decay_t<_Start>>(std::forward<_Start>(__s)); })
378 noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start))))387 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Start&& __start) const
379 -> decltype(ranges::iota_view(std::forward<_Start>(__start))) {388 noexcept(noexcept(ranges::iota_view<decay_t<_Start>>(std::forward<_Start>(__start)))) {
380 return ranges::iota_view(std::forward<_Start>(__start));389 return ranges::iota_view<decay_t<_Start>>(std::forward<_Start>(__start));
381 }390 }
382391
383 template <class _Start, class _BoundSentinel>392 template <class _Start, class _BoundSentinel>
384 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Start&& __start, _BoundSentinel&& __bound_sentinel) const noexcept(393 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto
394 operator()(_Start&& __start, _BoundSentinel&& __bound_sentinel) const noexcept(
385 noexcept(ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel))))395 noexcept(ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel))))
386 -> decltype(ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel))) {396 -> decltype(ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel))) {
387 return ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel));397 return ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel));
...@@ -392,6 +402,15 @@ struct __fn {...@@ -392,6 +402,15 @@ struct __fn {
392inline namespace __cpo {402inline namespace __cpo {
393inline constexpr auto iota = __iota::__fn{};403inline constexpr auto iota = __iota::__fn{};
394} // namespace __cpo404} // namespace __cpo
405
406# if _LIBCPP_STD_VER >= 26
407
408inline constexpr auto indices = [] [[nodiscard]] (__integer_like auto __size) static {
409 return ranges::views::iota(decltype(__size){}, __size);
410};
411
412# endif
413
395} // namespace views414} // namespace views
396} // namespace ranges415} // namespace ranges
397416
lib/libcxx/include/__ranges/owning_view.h+15-15
...@@ -49,52 +49,52 @@ public:...@@ -49,52 +49,52 @@ public:
49 _LIBCPP_HIDE_FROM_ABI owning_view(owning_view&&) = default;49 _LIBCPP_HIDE_FROM_ABI owning_view(owning_view&&) = default;
50 _LIBCPP_HIDE_FROM_ABI owning_view& operator=(owning_view&&) = default;50 _LIBCPP_HIDE_FROM_ABI owning_view& operator=(owning_view&&) = default;
5151
52 _LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; }52 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; }
53 _LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; }53 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; }
54 _LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); }54 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); }
55 _LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); }55 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); }
5656
57 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); }57 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); }
58 _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); }58 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); }
59 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
60 requires range<const _Rp>60 requires range<const _Rp>
61 {61 {
62 return ranges::begin(__r_);62 return ranges::begin(__r_);
63 }63 }
64 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const64 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
65 requires range<const _Rp>65 requires range<const _Rp>
66 {66 {
67 return ranges::end(__r_);67 return ranges::end(__r_);
68 }68 }
6969
70 _LIBCPP_HIDE_FROM_ABI constexpr bool empty()70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty()
71 requires requires { ranges::empty(__r_); }71 requires requires { ranges::empty(__r_); }
72 {72 {
73 return ranges::empty(__r_);73 return ranges::empty(__r_);
74 }74 }
75 _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const75 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const
76 requires requires { ranges::empty(__r_); }76 requires requires { ranges::empty(__r_); }
77 {77 {
78 return ranges::empty(__r_);78 return ranges::empty(__r_);
79 }79 }
8080
81 _LIBCPP_HIDE_FROM_ABI constexpr auto size()81 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
82 requires sized_range<_Rp>82 requires sized_range<_Rp>
83 {83 {
84 return ranges::size(__r_);84 return ranges::size(__r_);
85 }85 }
86 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const86 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
87 requires sized_range<const _Rp>87 requires sized_range<const _Rp>
88 {88 {
89 return ranges::size(__r_);89 return ranges::size(__r_);
90 }90 }
9191
92 _LIBCPP_HIDE_FROM_ABI constexpr auto data()92 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto data()
93 requires contiguous_range<_Rp>93 requires contiguous_range<_Rp>
94 {94 {
95 return ranges::data(__r_);95 return ranges::data(__r_);
96 }96 }
97 _LIBCPP_HIDE_FROM_ABI constexpr auto data() const97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto data() const
98 requires contiguous_range<const _Rp>98 requires contiguous_range<const _Rp>
99 {99 {
100 return ranges::data(__r_);100 return ranges::data(__r_);
lib/libcxx/include/__ranges/ref_view.h+6-6
...@@ -51,24 +51,24 @@ public:...@@ -51,24 +51,24 @@ public:
51 _LIBCPP_HIDE_FROM_ABI constexpr ref_view(_Tp&& __t)51 _LIBCPP_HIDE_FROM_ABI constexpr ref_view(_Tp&& __t)
52 : __range_(std::addressof(static_cast<_Range&>(std::forward<_Tp>(__t)))) {}52 : __range_(std::addressof(static_cast<_Range&>(std::forward<_Tp>(__t)))) {}
5353
54 _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; }54 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; }
5555
56 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); }56 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); }
57 _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); }57 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); }
5858
59 _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const
60 requires requires { ranges::empty(*__range_); }60 requires requires { ranges::empty(*__range_); }
61 {61 {
62 return ranges::empty(*__range_);62 return ranges::empty(*__range_);
63 }63 }
6464
65 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const65 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
66 requires sized_range<_Range>66 requires sized_range<_Range>
67 {67 {
68 return ranges::size(*__range_);68 return ranges::size(*__range_);
69 }69 }
7070
71 _LIBCPP_HIDE_FROM_ABI constexpr auto data() const71 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto data() const
72 requires contiguous_range<_Range>72 requires contiguous_range<_Range>
73 {73 {
74 return ranges::data(*__range_);74 return ranges::data(*__range_);
lib/libcxx/include/__ranges/repeat_view.h+17-10
...@@ -108,17 +108,21 @@ public:...@@ -108,17 +108,21 @@ public:
108 __bound_ >= 0, "The behavior is undefined if Bound is not unreachable_sentinel_t and bound is negative");108 __bound_ >= 0, "The behavior is undefined if Bound is not unreachable_sentinel_t and bound is negative");
109 }109 }
110110
111 _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator(std::addressof(*__value_)); }111 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const {
112 return __iterator(std::addressof(*__value_));
113 }
112114
113 _LIBCPP_HIDE_FROM_ABI constexpr __iterator end() const115 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator end() const
114 requires(!same_as<_Bound, unreachable_sentinel_t>)116 requires(!same_as<_Bound, unreachable_sentinel_t>)
115 {117 {
116 return __iterator(std::addressof(*__value_), __bound_);118 return __iterator(std::addressof(*__value_), __bound_);
117 }119 }
118120
119 _LIBCPP_HIDE_FROM_ABI constexpr unreachable_sentinel_t end() const noexcept { return unreachable_sentinel; }121 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr unreachable_sentinel_t end() const noexcept {
122 return unreachable_sentinel;
123 }
120124
121 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const125 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
122 requires(!same_as<_Bound, unreachable_sentinel_t>)126 requires(!same_as<_Bound, unreachable_sentinel_t>)
123 {127 {
124 return std::__to_unsigned_like(__bound_);128 return std::__to_unsigned_like(__bound_);
...@@ -152,7 +156,7 @@ public:...@@ -152,7 +156,7 @@ public:
152156
153 _LIBCPP_HIDE_FROM_ABI __iterator() = default;157 _LIBCPP_HIDE_FROM_ABI __iterator() = default;
154158
155 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const noexcept { return *__value_; }159 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const noexcept { return *__value_; }
156160
157 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {161 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
158 ++__current_;162 ++__current_;
...@@ -192,7 +196,9 @@ public:...@@ -192,7 +196,9 @@ public:
192 return *this;196 return *this;
193 }197 }
194198
195 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](difference_type __n) const noexcept { return *(*this + __n); }199 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](difference_type __n) const noexcept {
200 return *(*this + __n);
201 }
196202
197 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {203 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {
198 return __x.__current_ == __y.__current_;204 return __x.__current_ == __y.__current_;
...@@ -202,22 +208,23 @@ public:...@@ -202,22 +208,23 @@ public:
202 return __x.__current_ <=> __y.__current_;208 return __x.__current_ <=> __y.__current_;
203 }209 }
204210
205 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n) {211 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n) {
206 __i += __n;212 __i += __n;
207 return __i;213 return __i;
208 }214 }
209215
210 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i) {216 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i) {
211 __i += __n;217 __i += __n;
212 return __i;218 return __i;
213 }219 }
214220
215 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n) {221 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n) {
216 __i -= __n;222 __i -= __n;
217 return __i;223 return __i;
218 }224 }
219225
220 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) {226 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
227 operator-(const __iterator& __x, const __iterator& __y) {
221 return static_cast<difference_type>(__x.__current_) - static_cast<difference_type>(__y.__current_);228 return static_cast<difference_type>(__x.__current_) - static_cast<difference_type>(__y.__current_);
222 }229 }
223230
lib/libcxx/include/__ranges/single_view.h+8-8
...@@ -63,21 +63,21 @@ public:...@@ -63,21 +63,21 @@ public:
63 _LIBCPP_HIDE_FROM_ABI constexpr explicit single_view(in_place_t, _Args&&... __args)63 _LIBCPP_HIDE_FROM_ABI constexpr explicit single_view(in_place_t, _Args&&... __args)
64 : __value_{in_place, std::forward<_Args>(__args)...} {}64 : __value_{in_place, std::forward<_Args>(__args)...} {}
6565
66 _LIBCPP_HIDE_FROM_ABI constexpr _Tp* begin() noexcept { return data(); }66 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* begin() noexcept { return data(); }
6767
68 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* begin() const noexcept { return data(); }68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* begin() const noexcept { return data(); }
6969
70 _LIBCPP_HIDE_FROM_ABI constexpr _Tp* end() noexcept { return data() + 1; }70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* end() noexcept { return data() + 1; }
7171
72 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* end() const noexcept { return data() + 1; }72 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* end() const noexcept { return data() + 1; }
7373
74 _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return false; }74 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return false; }
7575
76 _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 1; }76 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 1; }
7777
78 _LIBCPP_HIDE_FROM_ABI constexpr _Tp* data() noexcept { return __value_.operator->(); }78 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* data() noexcept { return __value_.operator->(); }
7979
80 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* data() const noexcept { return __value_.operator->(); }80 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* data() const noexcept { return __value_.operator->(); }
81};81};
8282
83template <class _Tp>83template <class _Tp>
lib/libcxx/include/__ranges/take_view.h+9-9
...@@ -75,15 +75,15 @@ public:...@@ -75,15 +75,15 @@ public:
75 _LIBCPP_ASSERT_UNCATEGORIZED(__count >= 0, "count has to be greater than or equal to zero");75 _LIBCPP_ASSERT_UNCATEGORIZED(__count >= 0, "count has to be greater than or equal to zero");
76 }76 }
7777
78 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&78 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
79 requires copy_constructible<_View>79 requires copy_constructible<_View>
80 {80 {
81 return __base_;81 return __base_;
82 }82 }
8383
84 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
8585
86 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()86 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
87 requires(!__simple_view<_View>)87 requires(!__simple_view<_View>)
88 {88 {
89 if constexpr (sized_range<_View>) {89 if constexpr (sized_range<_View>) {
...@@ -99,7 +99,7 @@ public:...@@ -99,7 +99,7 @@ public:
99 }99 }
100 }100 }
101101
102 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const102 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
103 requires range<const _View>103 requires range<const _View>
104 {104 {
105 if constexpr (sized_range<const _View>) {105 if constexpr (sized_range<const _View>) {
...@@ -115,7 +115,7 @@ public:...@@ -115,7 +115,7 @@ public:
115 }115 }
116 }116 }
117117
118 _LIBCPP_HIDE_FROM_ABI constexpr auto end()118 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
119 requires(!__simple_view<_View>)119 requires(!__simple_view<_View>)
120 {120 {
121 if constexpr (sized_range<_View>) {121 if constexpr (sized_range<_View>) {
...@@ -129,7 +129,7 @@ public:...@@ -129,7 +129,7 @@ public:
129 }129 }
130 }130 }
131131
132 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const132 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
133 requires range<const _View>133 requires range<const _View>
134 {134 {
135 if constexpr (sized_range<const _View>) {135 if constexpr (sized_range<const _View>) {
...@@ -143,14 +143,14 @@ public:...@@ -143,14 +143,14 @@ public:
143 }143 }
144 }144 }
145145
146 _LIBCPP_HIDE_FROM_ABI constexpr auto size()146 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
147 requires sized_range<_View>147 requires sized_range<_View>
148 {148 {
149 auto __n = ranges::size(__base_);149 auto __n = ranges::size(__base_);
150 return ranges::min(__n, static_cast<decltype(__n)>(__count_));150 return ranges::min(__n, static_cast<decltype(__n)>(__count_));
151 }151 }
152152
153 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const153 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
154 requires sized_range<const _View>154 requires sized_range<const _View>
155 {155 {
156 auto __n = ranges::size(__base_);156 auto __n = ranges::size(__base_);
...@@ -178,7 +178,7 @@ public:...@@ -178,7 +178,7 @@ public:
178 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>178 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
179 : __end_(std::move(__s.__end_)) {}179 : __end_(std::move(__s.__end_)) {}
180180
181 _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }181 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }
182182
183 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) {183 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) {
184 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;184 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
lib/libcxx/include/__ranges/transform_view.h+1-2
...@@ -13,7 +13,6 @@...@@ -13,7 +13,6 @@
13#include <__compare/three_way_comparable.h>13#include <__compare/three_way_comparable.h>
14#include <__concepts/constructible.h>14#include <__concepts/constructible.h>
15#include <__concepts/convertible_to.h>15#include <__concepts/convertible_to.h>
16#include <__concepts/copyable.h>
17#include <__concepts/derived_from.h>16#include <__concepts/derived_from.h>
18#include <__concepts/equality_comparable.h>17#include <__concepts/equality_comparable.h>
19#include <__concepts/invocable.h>18#include <__concepts/invocable.h>
...@@ -64,7 +63,7 @@ concept __regular_invocable_with_range_ref = regular_invocable<_Fn, range_refere...@@ -64,7 +63,7 @@ concept __regular_invocable_with_range_ref = regular_invocable<_Fn, range_refere
64template <class _View, class _Fn>63template <class _View, class _Fn>
65concept __transform_view_constraints =64concept __transform_view_constraints =
66 view<_View> && is_object_v<_Fn> && regular_invocable<_Fn&, range_reference_t<_View>> &&65 view<_View> && is_object_v<_Fn> && regular_invocable<_Fn&, range_reference_t<_View>> &&
67 __is_referenceable_v<invoke_result_t<_Fn&, range_reference_t<_View>>>;66 __referenceable<invoke_result_t<_Fn&, range_reference_t<_View>>>;
6867
69# if _LIBCPP_STD_VER >= 2368# if _LIBCPP_STD_VER >= 23
70template <input_range _View, move_constructible _Fn>69template <input_range _View, move_constructible _Fn>
lib/libcxx/include/__ranges/view_interface.h+10-10
...@@ -87,35 +87,35 @@ public:...@@ -87,35 +87,35 @@ public:
87 }87 }
8888
89 template <class _D2 = _Derived>89 template <class _D2 = _Derived>
90 _LIBCPP_HIDE_FROM_ABI constexpr auto data()90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto data()
91 requires contiguous_iterator<iterator_t<_D2>>91 requires contiguous_iterator<iterator_t<_D2>>
92 {92 {
93 return std::to_address(ranges::begin(__derived()));93 return std::to_address(ranges::begin(__derived()));
94 }94 }
9595
96 template <class _D2 = _Derived>96 template <class _D2 = _Derived>
97 _LIBCPP_HIDE_FROM_ABI constexpr auto data() const97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto data() const
98 requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>>98 requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>>
99 {99 {
100 return std::to_address(ranges::begin(__derived()));100 return std::to_address(ranges::begin(__derived()));
101 }101 }
102102
103 template <class _D2 = _Derived>103 template <class _D2 = _Derived>
104 _LIBCPP_HIDE_FROM_ABI constexpr auto size()104 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
105 requires forward_range<_D2> && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>>105 requires forward_range<_D2> && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>>
106 {106 {
107 return std::__to_unsigned_like(ranges::end(__derived()) - ranges::begin(__derived()));107 return std::__to_unsigned_like(ranges::end(__derived()) - ranges::begin(__derived()));
108 }108 }
109109
110 template <class _D2 = _Derived>110 template <class _D2 = _Derived>
111 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const111 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
112 requires forward_range<const _D2> && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>>112 requires forward_range<const _D2> && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>>
113 {113 {
114 return std::__to_unsigned_like(ranges::end(__derived()) - ranges::begin(__derived()));114 return std::__to_unsigned_like(ranges::end(__derived()) - ranges::begin(__derived()));
115 }115 }
116116
117 template <class _D2 = _Derived>117 template <class _D2 = _Derived>
118 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) front()118 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) front()
119 requires forward_range<_D2>119 requires forward_range<_D2>
120 {120 {
121 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(121 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
...@@ -124,7 +124,7 @@ public:...@@ -124,7 +124,7 @@ public:
124 }124 }
125125
126 template <class _D2 = _Derived>126 template <class _D2 = _Derived>
127 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) front() const127 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) front() const
128 requires forward_range<const _D2>128 requires forward_range<const _D2>
129 {129 {
130 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(130 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
...@@ -133,7 +133,7 @@ public:...@@ -133,7 +133,7 @@ public:
133 }133 }
134134
135 template <class _D2 = _Derived>135 template <class _D2 = _Derived>
136 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) back()136 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) back()
137 requires bidirectional_range<_D2> && common_range<_D2>137 requires bidirectional_range<_D2> && common_range<_D2>
138 {138 {
139 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(139 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
...@@ -142,7 +142,7 @@ public:...@@ -142,7 +142,7 @@ public:
142 }142 }
143143
144 template <class _D2 = _Derived>144 template <class _D2 = _Derived>
145 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) back() const145 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) back() const
146 requires bidirectional_range<const _D2> && common_range<const _D2>146 requires bidirectional_range<const _D2> && common_range<const _D2>
147 {147 {
148 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(148 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
...@@ -151,12 +151,12 @@ public:...@@ -151,12 +151,12 @@ public:
151 }151 }
152152
153 template <random_access_range _RARange = _Derived>153 template <random_access_range _RARange = _Derived>
154 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) {154 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) {
155 return ranges::begin(__derived())[__index];155 return ranges::begin(__derived())[__index];
156 }156 }
157157
158 template <random_access_range _RARange = const _Derived>158 template <random_access_range _RARange = const _Derived>
159 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const {159 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const {
160 return ranges::begin(__derived())[__index];160 return ranges::begin(__derived())[__index];
161 }161 }
162};162};
lib/libcxx/include/__ranges/zip_transform_view.h created+357
...@@ -0,0 +1,357 @@
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_ZIP_TRANSFORM_VIEW_H
11#define _LIBCPP___RANGES_ZIP_TRANSFORM_VIEW_H
12
13#include <__config>
14
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 <__concepts/invocable.h>
20#include <__functional/invoke.h>
21#include <__iterator/concepts.h>
22#include <__iterator/incrementable_traits.h>
23#include <__iterator/iterator_traits.h>
24#include <__memory/addressof.h>
25#include <__ranges/access.h>
26#include <__ranges/all.h>
27#include <__ranges/concepts.h>
28#include <__ranges/empty_view.h>
29#include <__ranges/movable_box.h>
30#include <__ranges/view_interface.h>
31#include <__ranges/zip_view.h>
32#include <__type_traits/decay.h>
33#include <__type_traits/invoke.h>
34#include <__type_traits/is_object.h>
35#include <__type_traits/is_reference.h>
36#include <__type_traits/is_referenceable.h>
37#include <__type_traits/maybe_const.h>
38#include <__type_traits/remove_cvref.h>
39#include <__utility/forward.h>
40#include <__utility/in_place.h>
41#include <__utility/move.h>
42#include <tuple> // for std::apply
43
44#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
45# pragma GCC system_header
46#endif
47
48_LIBCPP_PUSH_MACROS
49#include <__undef_macros>
50_LIBCPP_BEGIN_NAMESPACE_STD
51
52#if _LIBCPP_STD_VER >= 23
53
54namespace ranges {
55
56template <move_constructible _Fn, input_range... _Views>
57 requires(view<_Views> && ...) &&
58 (sizeof...(_Views) > 0) && is_object_v<_Fn> && regular_invocable<_Fn&, range_reference_t<_Views>...> &&
59 __referenceable<invoke_result_t<_Fn&, range_reference_t<_Views>...>>
60class zip_transform_view : public view_interface<zip_transform_view<_Fn, _Views...>> {
61 _LIBCPP_NO_UNIQUE_ADDRESS zip_view<_Views...> __zip_;
62 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Fn> __fun_;
63
64 using _InnerView _LIBCPP_NODEBUG = zip_view<_Views...>;
65 template <bool _Const>
66 using __ziperator _LIBCPP_NODEBUG = iterator_t<__maybe_const<_Const, _InnerView>>;
67 template <bool _Const>
68 using __zentinel _LIBCPP_NODEBUG = sentinel_t<__maybe_const<_Const, _InnerView>>;
69
70 template <bool>
71 class __iterator;
72
73 template <bool>
74 class __sentinel;
75
76public:
77 _LIBCPP_HIDE_FROM_ABI zip_transform_view() = default;
78
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)) {}
81
82 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() { return __iterator<false>(*this, __zip_.begin()); }
83
84 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
85 requires range<const _InnerView> && regular_invocable<const _Fn&, range_reference_t<const _Views>...>
86 {
87 return __iterator<true>(*this, __zip_.begin());
88 }
89
90 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
91 if constexpr (common_range<_InnerView>) {
92 return __iterator<false>(*this, __zip_.end());
93 } else {
94 return __sentinel<false>(__zip_.end());
95 }
96 }
97
98 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
99 requires range<const _InnerView> && regular_invocable<const _Fn&, range_reference_t<const _Views>...>
100 {
101 if constexpr (common_range<const _InnerView>) {
102 return __iterator<true>(*this, __zip_.end());
103 } else {
104 return __sentinel<true>(__zip_.end());
105 }
106 }
107
108 _LIBCPP_HIDE_FROM_ABI constexpr auto size()
109 requires sized_range<_InnerView>
110 {
111 return __zip_.size();
112 }
113
114 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
115 requires sized_range<const _InnerView>
116 {
117 return __zip_.size();
118 }
119};
120
121template <class _Fn, class... _Ranges>
122zip_transform_view(_Fn, _Ranges&&...) -> zip_transform_view<_Fn, views::all_t<_Ranges>...>;
123
124template <bool _Const, class _Fn, class... _Views>
125struct __zip_transform_iterator_category_base {};
126
127template <bool _Const, class _Fn, class... _Views>
128 requires forward_range<__maybe_const<_Const, zip_view<_Views...>>>
129struct __zip_transform_iterator_category_base<_Const, _Fn, _Views...> {
130private:
131 template <class _View>
132 using __tag _LIBCPP_NODEBUG = typename iterator_traits<iterator_t<__maybe_const<_Const, _View>>>::iterator_category;
133
134 static consteval auto __get_iterator_category() {
135 if constexpr (!is_reference_v<invoke_result_t<__maybe_const<_Const, _Fn>&,
136 range_reference_t<__maybe_const<_Const, _Views>>...>>) {
137 return input_iterator_tag();
138 } else if constexpr ((derived_from<__tag<_Views>, random_access_iterator_tag> && ...)) {
139 return random_access_iterator_tag();
140 } else if constexpr ((derived_from<__tag<_Views>, bidirectional_iterator_tag> && ...)) {
141 return bidirectional_iterator_tag();
142 } else if constexpr ((derived_from<__tag<_Views>, forward_iterator_tag> && ...)) {
143 return forward_iterator_tag();
144 } else {
145 return input_iterator_tag();
146 }
147 }
148
149public:
150 using iterator_category = decltype(__get_iterator_category());
151};
152
153template <move_constructible _Fn, input_range... _Views>
154 requires(view<_Views> && ...) &&
155 (sizeof...(_Views) > 0) && is_object_v<_Fn> && regular_invocable<_Fn&, range_reference_t<_Views>...> &&
156 __referenceable<invoke_result_t<_Fn&, range_reference_t<_Views>...>>
157template <bool _Const>
158class zip_transform_view<_Fn, _Views...>::__iterator
159 : public __zip_transform_iterator_category_base<_Const, _Fn, _Views...> {
160 using _Parent _LIBCPP_NODEBUG = __maybe_const<_Const, zip_transform_view>;
161 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _InnerView>;
162
163 friend zip_transform_view<_Fn, _Views...>;
164
165 _Parent* __parent_ = nullptr;
166 __ziperator<_Const> __inner_;
167
168 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(_Parent& __parent, __ziperator<_Const> __inner)
169 : __parent_(std::addressof(__parent)), __inner_(std::move(__inner)) {}
170
171 _LIBCPP_HIDE_FROM_ABI constexpr auto __get_deref_and_invoke() const noexcept {
172 return [&__fun = *__parent_->__fun_](const auto&... __iters) noexcept(noexcept(std::invoke(
173 *__parent_->__fun_, *__iters...))) -> decltype(auto) { return std::invoke(__fun, *__iters...); };
174 }
175
176public:
177 using iterator_concept = typename __ziperator<_Const>::iterator_concept;
178 using value_type =
179 remove_cvref_t<invoke_result_t<__maybe_const<_Const, _Fn>&, range_reference_t<__maybe_const<_Const, _Views>>...>>;
180 using difference_type = range_difference_t<_Base>;
181
182 _LIBCPP_HIDE_FROM_ABI __iterator() = default;
183 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
184 requires _Const && convertible_to<__ziperator<false>, __ziperator<_Const>>
185 : __parent_(__i.__parent_), __inner_(std::move(__i.__inner_)) {}
186
187 _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_)))) {
189 return std::apply(__get_deref_and_invoke(), __zip_view_iterator_access::__get_underlying(__inner_));
190 }
191
192 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
193 ++__inner_;
194 return *this;
195 }
196
197 _LIBCPP_HIDE_FROM_ABI constexpr void operator++(int) { ++*this; }
198
199 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int)
200 requires forward_range<_Base>
201 {
202 auto __tmp = *this;
203 ++*this;
204 return __tmp;
205 }
206
207 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
208 requires bidirectional_range<_Base>
209 {
210 --__inner_;
211 return *this;
212 }
213
214 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
215 requires bidirectional_range<_Base>
216 {
217 auto __tmp = *this;
218 --*this;
219 return __tmp;
220 }
221
222 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __x)
223 requires random_access_range<_Base>
224 {
225 __inner_ += __x;
226 return *this;
227 }
228
229 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __x)
230 requires random_access_range<_Base>
231 {
232 __inner_ -= __x;
233 return *this;
234 }
235
236 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
237 requires random_access_range<_Base>
238 {
239 return std::apply(
240 [&]<class... _Is>(const _Is&... __iters) -> decltype(auto) {
241 return std::invoke(*__parent_->__fun_, __iters[iter_difference_t<_Is>(__n)]...);
242 },
243 __zip_view_iterator_access::__get_underlying(__inner_));
244 }
245
246 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
247 requires equality_comparable<__ziperator<_Const>>
248 {
249 return __x.__inner_ == __y.__inner_;
250 }
251
252 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
253 requires random_access_range<_Base>
254 {
255 return __x.__inner_ <=> __y.__inner_;
256 }
257
258 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
259 requires random_access_range<_Base>
260 {
261 return __iterator(*__i.__parent_, __i.__inner_ + __n);
262 }
263
264 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
265 requires random_access_range<_Base>
266 {
267 return __iterator(*__i.__parent_, __i.__inner_ + __n);
268 }
269
270 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
271 requires random_access_range<_Base>
272 {
273 return __iterator(*__i.__parent_, __i.__inner_ - __n);
274 }
275
276 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
277 requires sized_sentinel_for<__ziperator<_Const>, __ziperator<_Const>>
278 {
279 return __x.__inner_ - __y.__inner_;
280 }
281};
282
283template <move_constructible _Fn, input_range... _Views>
284 requires(view<_Views> && ...) &&
285 (sizeof...(_Views) > 0) && is_object_v<_Fn> && regular_invocable<_Fn&, range_reference_t<_Views>...> &&
286 __referenceable<invoke_result_t<_Fn&, range_reference_t<_Views>...>>
287template <bool _Const>
288class zip_transform_view<_Fn, _Views...>::__sentinel {
289 __zentinel<_Const> __inner_;
290
291 friend zip_transform_view<_Fn, _Views...>;
292
293 _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(__zentinel<_Const> __inner) : __inner_(__inner) {}
294
295public:
296 _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
297
298 _LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __i)
299 requires _Const && convertible_to<__zentinel<false>, __zentinel<_Const>>
300 : __inner_(__i.__inner_) {}
301
302 template <bool _OtherConst>
303 requires sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>
304 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
305 return __x.__inner_ == __y.__inner_;
306 }
307
308 template <bool _OtherConst>
309 requires sized_sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>
310 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>
311 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
312 return __x.__inner_ - __y.__inner_;
313 }
314
315 template <bool _OtherConst>
316 requires sized_sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>
317 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>
318 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
319 return __x.__inner_ - __y.__inner_;
320 }
321};
322
323namespace views {
324namespace __zip_transform {
325
326struct __fn {
327 template <class _Fn>
328 requires(move_constructible<decay_t<_Fn>> && regular_invocable<decay_t<_Fn>&> &&
329 is_object_v<invoke_result_t<decay_t<_Fn>&>>)
330 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&&) const
331 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 }
334
335 template <class _Fn, class... _Ranges>
336 requires(sizeof...(_Ranges) > 0)
337 _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 -> 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 }
342};
343
344} // namespace __zip_transform
345inline namespace __cpo {
346inline constexpr auto zip_transform = __zip_transform::__fn{};
347} // namespace __cpo
348} // namespace views
349} // namespace ranges
350
351#endif // _LIBCPP_STD_VER >= 23
352
353_LIBCPP_END_NAMESPACE_STD
354
355_LIBCPP_POP_MACROS
356
357#endif // _LIBCPP___RANGES_ZIP_TRANSFORM_VIEW_H
lib/libcxx/include/__ranges/zip_view.h+20-20
...@@ -31,6 +31,7 @@...@@ -31,6 +31,7 @@
31#include <__ranges/enable_borrowed_range.h>31#include <__ranges/enable_borrowed_range.h>
32#include <__ranges/size.h>32#include <__ranges/size.h>
33#include <__ranges/view_interface.h>33#include <__ranges/view_interface.h>
34#include <__tuple/tuple_transform.h>
34#include <__type_traits/is_nothrow_constructible.h>35#include <__type_traits/is_nothrow_constructible.h>
35#include <__type_traits/make_unsigned.h>36#include <__type_traits/make_unsigned.h>
36#include <__utility/declval.h>37#include <__utility/declval.h>
...@@ -58,15 +59,6 @@ concept __zip_is_common =...@@ -58,15 +59,6 @@ concept __zip_is_common =
58 (!(bidirectional_range<_Ranges> && ...) && (common_range<_Ranges> && ...)) ||59 (!(bidirectional_range<_Ranges> && ...) && (common_range<_Ranges> && ...)) ||
59 ((random_access_range<_Ranges> && ...) && (sized_range<_Ranges> && ...));60 ((random_access_range<_Ranges> && ...) && (sized_range<_Ranges> && ...));
6061
61template <class _Fun, class _Tuple>
62_LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tuple) {
63 return std::apply(
64 [&]<class... _Types>(_Types&&... __elements) {
65 return tuple<invoke_result_t<_Fun&, _Types>...>(std::invoke(__f, std::forward<_Types>(__elements))...);
66 },
67 std::forward<_Tuple>(__tuple));
68}
69
70template <class _Fun, class _Tuple>62template <class _Fun, class _Tuple>
71_LIBCPP_HIDE_FROM_ABI constexpr void __tuple_for_each(_Fun&& __f, _Tuple&& __tuple) {63_LIBCPP_HIDE_FROM_ABI constexpr void __tuple_for_each(_Fun&& __f, _Tuple&& __tuple) {
72 std::apply(64 std::apply(
...@@ -145,24 +137,24 @@ public:...@@ -145,24 +137,24 @@ public:
145 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()137 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
146 requires(!(__simple_view<_Views> && ...))138 requires(!(__simple_view<_Views> && ...))
147 {139 {
148 return __iterator<false>(ranges::__tuple_transform(ranges::begin, __views_));140 return __iterator<false>(std::__tuple_transform(ranges::begin, __views_));
149 }141 }
150142
151 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const143 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
152 requires(range<const _Views> && ...)144 requires(range<const _Views> && ...)
153 {145 {
154 return __iterator<true>(ranges::__tuple_transform(ranges::begin, __views_));146 return __iterator<true>(std::__tuple_transform(ranges::begin, __views_));
155 }147 }
156148
157 _LIBCPP_HIDE_FROM_ABI constexpr auto end()149 _LIBCPP_HIDE_FROM_ABI constexpr auto end()
158 requires(!(__simple_view<_Views> && ...))150 requires(!(__simple_view<_Views> && ...))
159 {151 {
160 if constexpr (!__zip_is_common<_Views...>) {152 if constexpr (!__zip_is_common<_Views...>) {
161 return __sentinel<false>(ranges::__tuple_transform(ranges::end, __views_));153 return __sentinel<false>(std::__tuple_transform(ranges::end, __views_));
162 } else if constexpr ((random_access_range<_Views> && ...)) {154 } else if constexpr ((random_access_range<_Views> && ...)) {
163 return begin() + iter_difference_t<__iterator<false>>(size());155 return begin() + iter_difference_t<__iterator<false>>(size());
164 } else {156 } else {
165 return __iterator<false>(ranges::__tuple_transform(ranges::end, __views_));157 return __iterator<false>(std::__tuple_transform(ranges::end, __views_));
166 }158 }
167 }159 }
168160
...@@ -170,11 +162,11 @@ public:...@@ -170,11 +162,11 @@ public:
170 requires(range<const _Views> && ...)162 requires(range<const _Views> && ...)
171 {163 {
172 if constexpr (!__zip_is_common<const _Views...>) {164 if constexpr (!__zip_is_common<const _Views...>) {
173 return __sentinel<true>(ranges::__tuple_transform(ranges::end, __views_));165 return __sentinel<true>(std::__tuple_transform(ranges::end, __views_));
174 } else if constexpr ((random_access_range<const _Views> && ...)) {166 } else if constexpr ((random_access_range<const _Views> && ...)) {
175 return begin() + iter_difference_t<__iterator<true>>(size());167 return begin() + iter_difference_t<__iterator<true>>(size());
176 } else {168 } else {
177 return __iterator<true>(ranges::__tuple_transform(ranges::end, __views_));169 return __iterator<true>(std::__tuple_transform(ranges::end, __views_));
178 }170 }
179 }171 }
180172
...@@ -186,7 +178,7 @@ public:...@@ -186,7 +178,7 @@ public:
186 using _CT = make_unsigned_t<common_type_t<decltype(__sizes)...>>;178 using _CT = make_unsigned_t<common_type_t<decltype(__sizes)...>>;
187 return ranges::min({_CT(__sizes)...});179 return ranges::min({_CT(__sizes)...});
188 },180 },
189 ranges::__tuple_transform(ranges::size, __views_));181 std::__tuple_transform(ranges::size, __views_));
190 }182 }
191183
192 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const184 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
...@@ -197,7 +189,7 @@ public:...@@ -197,7 +189,7 @@ public:
197 using _CT = make_unsigned_t<common_type_t<decltype(__sizes)...>>;189 using _CT = make_unsigned_t<common_type_t<decltype(__sizes)...>>;
198 return ranges::min({_CT(__sizes)...});190 return ranges::min({_CT(__sizes)...});
199 },191 },
200 ranges::__tuple_transform(ranges::size, __views_));192 std::__tuple_transform(ranges::size, __views_));
201 }193 }
202};194};
203195
...@@ -235,6 +227,13 @@ struct __zip_view_iterator_category_base<_Const, _Views...> {...@@ -235,6 +227,13 @@ struct __zip_view_iterator_category_base<_Const, _Views...> {
235 using iterator_category = input_iterator_tag;227 using iterator_category = input_iterator_tag;
236};228};
237229
230struct __zip_view_iterator_access {
231 template <class _Iter>
232 _LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto) __get_underlying(_Iter& __iter) noexcept {
233 return (__iter.__current_);
234 }
235};
236
238template <input_range... _Views>237template <input_range... _Views>
239 requires(view<_Views> && ...) && (sizeof...(_Views) > 0)238 requires(view<_Views> && ...) && (sizeof...(_Views) > 0)
240template <bool _Const>239template <bool _Const>
...@@ -255,6 +254,7 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base...@@ -255,6 +254,7 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
255 static constexpr bool __is_zip_view_iterator = true;254 static constexpr bool __is_zip_view_iterator = true;
256255
257 friend struct __product_iterator_traits<__iterator>;256 friend struct __product_iterator_traits<__iterator>;
257 friend __zip_view_iterator_access;
258258
259public:259public:
260 using iterator_concept = decltype(ranges::__get_zip_view_iterator_tag<_Const, _Views...>());260 using iterator_concept = decltype(ranges::__get_zip_view_iterator_tag<_Const, _Views...>());
...@@ -268,7 +268,7 @@ public:...@@ -268,7 +268,7 @@ public:
268 : __current_(std::move(__i.__current_)) {}268 : __current_(std::move(__i.__current_)) {}
269269
270 _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {270 _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {
271 return ranges::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);271 return std::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);
272 }272 }
273273
274 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {274 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
...@@ -318,7 +318,7 @@ public:...@@ -318,7 +318,7 @@ public:
318 _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const318 _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 ranges::__tuple_transform(321 return std::__tuple_transform(
322 [&]<class _Iter>(_Iter& __i) -> decltype(auto) { return __i[iter_difference_t<_Iter>(__n)]; }, __current_);322 [&]<class _Iter>(_Iter& __i) -> decltype(auto) { return __i[iter_difference_t<_Iter>(__n)]; }, __current_);
323 }323 }
324324
...@@ -377,7 +377,7 @@ public:...@@ -377,7 +377,7 @@ public:
377 _LIBCPP_HIDE_FROM_ABI friend constexpr auto iter_move(const __iterator& __i) noexcept(377 _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>>&>())) && ...) &&378 (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>>> && ...)) {379 (is_nothrow_move_constructible_v<range_rvalue_reference_t<__maybe_const<_Const, _Views>>> && ...)) {
380 return ranges::__tuple_transform(ranges::iter_move, __i.__current_);380 return std::__tuple_transform(ranges::iter_move, __i.__current_);
381 }381 }
382382
383 _LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const __iterator& __l, const __iterator& __r) noexcept(383 _LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const __iterator& __l, const __iterator& __r) noexcept(
lib/libcxx/include/__split_buffer+612-240
...@@ -13,10 +13,12 @@...@@ -13,10 +13,12 @@
13#include <__algorithm/max.h>13#include <__algorithm/max.h>
14#include <__algorithm/move.h>14#include <__algorithm/move.h>
15#include <__algorithm/move_backward.h>15#include <__algorithm/move_backward.h>
16#include <__assert>
16#include <__config>17#include <__config>
17#include <__iterator/distance.h>18#include <__iterator/distance.h>
18#include <__iterator/iterator_traits.h>19#include <__iterator/iterator_traits.h>
19#include <__iterator/move_iterator.h>20#include <__iterator/move_iterator.h>
21#include <__memory/addressof.h>
20#include <__memory/allocate_at_least.h>22#include <__memory/allocate_at_least.h>
21#include <__memory/allocator.h>23#include <__memory/allocator.h>
22#include <__memory/allocator_traits.h>24#include <__memory/allocator_traits.h>
...@@ -28,11 +30,9 @@...@@ -28,11 +30,9 @@
28#include <__type_traits/integral_constant.h>30#include <__type_traits/integral_constant.h>
29#include <__type_traits/is_nothrow_assignable.h>31#include <__type_traits/is_nothrow_assignable.h>
30#include <__type_traits/is_nothrow_constructible.h>32#include <__type_traits/is_nothrow_constructible.h>
31#include <__type_traits/is_replaceable.h>
32#include <__type_traits/is_swappable.h>33#include <__type_traits/is_swappable.h>
33#include <__type_traits/is_trivially_destructible.h>34#include <__type_traits/is_trivially_destructible.h>
34#include <__type_traits/is_trivially_relocatable.h>35#include <__type_traits/is_trivially_relocatable.h>
35#include <__type_traits/remove_reference.h>
36#include <__utility/forward.h>36#include <__utility/forward.h>
37#include <__utility/move.h>37#include <__utility/move.h>
3838
...@@ -45,25 +45,430 @@ _LIBCPP_PUSH_MACROS...@@ -45,25 +45,430 @@ _LIBCPP_PUSH_MACROS
4545
46_LIBCPP_BEGIN_NAMESPACE_STD46_LIBCPP_BEGIN_NAMESPACE_STD
4747
48// __split_buffer allocates a contiguous chunk of memory and stores objects in the range [__begin_, __end_).48template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
49// It has uninitialized memory in the ranges [__first_, __begin_) and [__end_, __cap_). That allows49class __split_buffer;
50// it to grow both in the front and back without having to move the data.50
51template <class _SplitBuffer, class _Tp, class _Allocator>
52class __split_buffer_pointer_layout {
53protected:
54 using value_type = _Tp;
55 using allocator_type = _Allocator;
56 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
57 using reference = value_type&;
58 using const_reference = const value_type&;
59 using size_type = typename __alloc_traits::size_type;
60 using difference_type = typename __alloc_traits::difference_type;
61 using pointer = typename __alloc_traits::pointer;
62 using const_pointer = typename __alloc_traits::const_pointer;
63 using iterator = pointer;
64 using const_iterator = const_pointer;
65 using __sentinel_type _LIBCPP_NODEBUG = pointer;
5166
52template <class _Tp, class _Allocator = allocator<_Tp> >
53struct __split_buffer {
54public:67public:
55 using value_type = _Tp;68 // Can't be defaulted due to _LIBCPP_COMPRESSED_PAIR not being an aggregate in C++03 and C++11.
56 using allocator_type = _Allocator;69 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer_pointer_layout() : __back_cap_(nullptr) {}
57 using __alloc_rr _LIBCPP_NODEBUG = __libcpp_remove_reference_t<allocator_type>;70
58 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<__alloc_rr>;71 _LIBCPP_CONSTEXPR_SINCE_CXX20
59 using reference = value_type&;72 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer_pointer_layout(const allocator_type& __alloc)
60 using const_reference = const value_type&;73 : __back_cap_(nullptr), __alloc_(__alloc) {}
61 using size_type = typename __alloc_traits::size_type;74
62 using difference_type = typename __alloc_traits::difference_type;75 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __front_cap() _NOEXCEPT { return __front_cap_; }
63 using pointer = typename __alloc_traits::pointer;76
64 using const_pointer = typename __alloc_traits::const_pointer;77 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __front_cap() const _NOEXCEPT {
65 using iterator = pointer;78 return __front_cap_;
66 using const_iterator = const_pointer;79 }
80
81 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer begin() _NOEXCEPT { return __begin_; }
82
83 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer begin() const _NOEXCEPT { return __begin_; }
84
85 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() _NOEXCEPT { return __end_; }
86
87 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() const _NOEXCEPT { return __end_; }
88
89 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
90 return static_cast<size_type>(__end_ - __begin_);
91 }
92
93 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __begin_ == __end_; }
94
95 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
96 return static_cast<size_type>(__back_cap_ - __front_cap_);
97 }
98
99 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type& __get_allocator() _NOEXCEPT { return __alloc_; }
100
101 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type const& __get_allocator() const _NOEXCEPT {
102 return __alloc_;
103 }
104
105 // Returns the sentinel object directly. Should be used in conjunction with automatic type deduction,
106 // not explicit types.
107 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __sentinel_type __raw_sentinel() const _NOEXCEPT {
108 return __end_;
109 }
110 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __sentinel_type __raw_capacity() const _NOEXCEPT {
111 return __back_cap_;
112 }
113
114 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_data(pointer __new_first) _NOEXCEPT {
115 __front_cap_ = __new_first;
116 }
117
118 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
119 __set_valid_range(pointer __new_begin, pointer __new_end) _NOEXCEPT {
120 __begin_ = __new_begin;
121 __end_ = __new_end;
122 }
123
124 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
125 __set_valid_range(pointer __new_begin, size_type __new_size) _NOEXCEPT {
126 __begin_ = __new_begin;
127 __end_ = __begin_ + __new_size;
128 }
129
130 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(pointer __new_end) _NOEXCEPT {
131 _LIBCPP_ASSERT_INTERNAL(__front_cap_ <= __new_end, "__new_end cannot precede __front_cap_");
132 __end_ = __new_end;
133 }
134
135 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(size_type __new_size) _NOEXCEPT {
136 __end_ = __begin_ + __new_size;
137 }
138
139 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_capacity(size_type __new_capacity) _NOEXCEPT {
140 __back_cap_ = __front_cap_ + __new_capacity;
141 }
142
143 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_capacity(pointer __new_capacity) _NOEXCEPT {
144 __back_cap_ = __new_capacity;
145 }
146
147 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const _NOEXCEPT {
148 return static_cast<size_type>(__begin_ - __front_cap_);
149 }
150
151 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const _NOEXCEPT {
152 return static_cast<size_type>(__back_cap_ - __end_);
153 }
154
155 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT { return *(__end_ - 1); }
156
157 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT { return *(__end_ - 1); }
158
159 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(
160 __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type, __split_buffer_pointer_layout>,
161 value_type,
162 allocator_type>& __other) _NOEXCEPT {
163 std::swap(__front_cap_, __other.__front_cap_);
164 std::swap(__begin_, __other.__begin_);
165 std::swap(__back_cap_, __other.__back_cap_);
166 std::swap(__end_, __other.__end_);
167 }
168
169 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer_pointer_layout& __other) _NOEXCEPT {
170 std::swap(__front_cap_, __other.__front_cap_);
171 std::swap(__begin_, __other.__begin_);
172 std::swap(__back_cap_, __other.__back_cap_);
173 std::swap(__end_, __other.__end_);
174 std::__swap_allocator(__alloc_, __other.__alloc_);
175 }
176
177 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __reset() _NOEXCEPT {
178 __front_cap_ = nullptr;
179 __begin_ = nullptr;
180 __end_ = nullptr;
181 __back_cap_ = nullptr;
182 }
183
184 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
185 __copy_without_alloc(__split_buffer_pointer_layout const& __other)
186 _NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
187 __front_cap_ = __other.__front_cap_;
188 __begin_ = __other.__begin_;
189 __end_ = __other.__end_;
190 __back_cap_ = __other.__back_cap_;
191 }
192
193private:
194 pointer __front_cap_ = nullptr;
195 pointer __begin_ = nullptr;
196 pointer __end_ = nullptr;
197 _LIBCPP_COMPRESSED_PAIR(pointer, __back_cap_, allocator_type, __alloc_);
198
199 template <class, class, class>
200 friend class __split_buffer_pointer_layout;
201};
202
203template <class _SplitBuffer, class _Tp, class _Allocator>
204class __split_buffer_size_layout {
205protected:
206 using value_type = _Tp;
207 using allocator_type = _Allocator;
208 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
209 using reference = value_type&;
210 using const_reference = const value_type&;
211 using size_type = typename __alloc_traits::size_type;
212 using difference_type = typename __alloc_traits::difference_type;
213 using pointer = typename __alloc_traits::pointer;
214 using const_pointer = typename __alloc_traits::const_pointer;
215 using iterator = pointer;
216 using const_iterator = const_pointer;
217 using __sentinel_type _LIBCPP_NODEBUG = size_type;
218
219public:
220 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer_size_layout() = default;
221
222 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer_size_layout(const allocator_type& __alloc)
223 : __alloc_(__alloc) {}
224
225 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __front_cap() _NOEXCEPT { return __front_cap_; }
226
227 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __front_cap() const _NOEXCEPT {
228 return __front_cap_;
229 }
230
231 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer begin() _NOEXCEPT { return __begin_; }
232
233 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer begin() const _NOEXCEPT { return __begin_; }
234
235 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() _NOEXCEPT { return __begin_ + __size_; }
236
237 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() const _NOEXCEPT { return __begin_ + __size_; }
238
239 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }
240
241 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __size_ == 0; }
242
243 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT { return __cap_; }
244
245 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type& __get_allocator() _NOEXCEPT { return __alloc_; }
246
247 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type const& __get_allocator() const _NOEXCEPT {
248 return __alloc_;
249 }
250
251 // Returns the sentinel object directly. Should be used in conjunction with automatic type deduction,
252 // not explicit types.
253 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __sentinel_type __raw_sentinel() const _NOEXCEPT {
254 return __size_;
255 }
256 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __sentinel_type __raw_capacity() const _NOEXCEPT {
257 return __cap_;
258 }
259
260 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_data(pointer __new_first) _NOEXCEPT {
261 __front_cap_ = __new_first;
262 }
263
264 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
265 __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;
270 __set_sentinel(__new_end);
271 }
272
273 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
274 __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;
279 __set_sentinel(__new_size);
280 }
281
282 _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_");
284 __size_ += __new_end - end();
285 }
286
287 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(size_type __new_size) _NOEXCEPT {
288 __size_ = __new_size;
289 }
290
291 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_capacity(size_type __new_capacity) _NOEXCEPT {
292 __cap_ = __new_capacity;
293 }
294
295 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_capacity(pointer __new_capacity) _NOEXCEPT {
296 __cap_ = __new_capacity - __begin_;
297 }
298
299 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const _NOEXCEPT {
300 return static_cast<size_type>(__begin_ - __front_cap_);
301 }
302
303 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const _NOEXCEPT {
304 // `__cap_ - __end_` tells us the total number of spares when in size-mode. We need to remove
305 // the __front_spare from the count.
306 return __cap_ - __size_ - __front_spare();
307 }
308
309 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT { return __begin_[__size_ - 1]; }
310
311 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
312 return __begin_[__size_ - 1];
313 }
314
315 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(
316 __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type, __split_buffer_pointer_layout>,
317 value_type,
318 allocator_type>& __other) _NOEXCEPT {
319 std::swap(__front_cap_, __other.__front_cap_);
320 std::swap(__begin_, __other.__begin_);
321 std::swap(__cap_, __other.__cap_);
322 std::swap(__size_, __other.__size_);
323 }
324
325 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer_size_layout& __other) _NOEXCEPT {
326 std::swap(__front_cap_, __other.__front_cap_);
327 std::swap(__begin_, __other.__begin_);
328 std::swap(__cap_, __other.__cap_);
329 std::swap(__size_, __other.__size_);
330 std::__swap_allocator(__alloc_, __other.__alloc_);
331 }
332
333 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __reset() _NOEXCEPT {
334 __front_cap_ = nullptr;
335 __begin_ = nullptr;
336 __size_ = 0;
337 __cap_ = 0;
338 }
339
340 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
341 __copy_without_alloc(__split_buffer_size_layout const& __other)
342 _NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
343 __front_cap_ = __other.__front_cap_;
344 __begin_ = __other.__begin_;
345 __cap_ = __other.__cap_;
346 __size_ = __other.__size_;
347 }
348
349private:
350 pointer __front_cap_ = nullptr;
351 pointer __begin_ = nullptr;
352 size_type __size_ = 0;
353 size_type __cap_ = 0;
354 _LIBCPP_NO_UNIQUE_ADDRESS allocator_type __alloc_;
355
356 template <class, class, class>
357 friend class __split_buffer_size_layout;
358};
359
360// `__split_buffer` is a contiguous array data structure. It may hold spare capacity at both ends of
361// the sequence. This allows for a `__split_buffer` to grow from both the front and the back without
362// relocating its contents until it runs out of room. This characteristic sets it apart from
363// `std::vector`, which only holds spare capacity at its end. As such, `__split_buffer` is useful
364// for implementing both `std::vector` and `std::deque`.
365//
366// The sequence is stored as a contiguous chunk of memory delimited by the following "pointers" (`o` denotes
367// uninitialized memory and `x` denotes a valid object):
368//
369// |oooooooooooooooooooxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoooooooooooooooooooooooo|
370// ^ ^ ^ ^
371// __front_cap_ __begin_ __end_ __back_cap_
372//
373// The range [__front_cap_, __begin_) contains uninitialized memory. It is referred to as the "front spare capacity".
374// The range [__begin_, __end_) contains valid objects. It is referred to as the "valid range".
375// The range [__end_, __back_cap_) contains uninitialized memory. It is referred to as the "back spare capacity".
376//
377// The layout of `__split_buffer` is determined by the `_Layout` template template parameter. This
378// `_Layout` allows the above pointers to be stored as different representations, such as integer
379// offsets. A layout class template must provide the following interface:
380//
381// template<class _Tp, class _Allocator, class _Layout>
382// class __layout {
383// protected:
384// using value_type = _Tp;
385// using allocator_type = _Allocator;
386// using __alloc_traits = allocator_traits<allocator_type>;
387// using reference = value_type&;
388// using const_reference = const value_type&;
389// using size_type = typename __alloc_traits::size_type;
390// using difference_type = typename __alloc_traits::difference_type;
391// using pointer = typename __alloc_traits::pointer;
392// using const_pointer = typename __alloc_traits::const_pointer;
393// using iterator = pointer;
394// using const_iterator = const_pointer;
395// using __sentinel_type = /* type that represents the layout's sentinel */;
396//
397// public:
398// __layout() = default;
399// explicit __layout(const allocator_type&);
400//
401// pointer __front_cap();
402// const_pointer __front_cap() const;
403//
404// pointer begin();
405// const_pointer begin() const;
406//
407// pointer end();
408// pointer end() const;
409//
410// size_type size() const;
411// bool empty() const;
412// size_type capacity() const;
413//
414// allocator_type& __get_allocator();
415// allocator_type const& __get_allocator() const;
416//
417// __sentinel_type __raw_sentinel() const;
418// __sentinel_type __raw_capacity() const;
419//
420// void __set_data(pointer);
421// void __set_valid_range(pointer __begin, pointer __end);
422// void __set_valid_range(pointer __begin, size_type __size);
423// void __set_sentinel(pointer __end);
424// void __set_sentinel(size_type __size);
425//
426// void __set_capacity(size_type __capacity);
427// void __set_capacity(pointer __capacity);
428//
429// size_type __front_spare() const;
430// size_type __back_spare() const;
431//
432// reference back();
433// const_reference back() const;
434//
435// template<class _OtherLayout>
436// void __swap_without_allocator(_OtherLayout&);
437// void swap(__layout&);
438//
439// void __reset();
440// void __copy_without_alloc(__layout const&);
441// };
442//
443template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
444class __split_buffer : _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _Allocator> {
445 using __base_type _LIBCPP_NODEBUG = _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _Allocator>;
446
447public:
448 using __base_type::__back_spare;
449 using __base_type::__copy_without_alloc;
450 using __base_type::__front_cap;
451 using __base_type::__front_spare;
452 using __base_type::__get_allocator;
453 using __base_type::__raw_capacity;
454 using __base_type::__raw_sentinel;
455 using __base_type::__reset;
456 using __base_type::__set_capacity;
457 using __base_type::__set_data;
458 using __base_type::__set_sentinel;
459 using __base_type::__set_valid_range;
460
461 using typename __base_type::__alloc_traits;
462 using typename __base_type::allocator_type;
463 using typename __base_type::const_iterator;
464 using typename __base_type::const_pointer;
465 using typename __base_type::const_reference;
466 using typename __base_type::difference_type;
467 using typename __base_type::iterator;
468 using typename __base_type::pointer;
469 using typename __base_type::reference;
470 using typename __base_type::size_type;
471 using typename __base_type::value_type;
67472
68 // A __split_buffer contains the following members which may be trivially relocatable:473 // A __split_buffer contains the following members which may be trivially relocatable:
69 // - pointer: may be trivially relocatable, so it's checked474 // - pointer: may be trivially relocatable, so it's checked
...@@ -73,36 +478,24 @@ public:...@@ -73,36 +478,24 @@ public:
73 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<allocator_type>::value,478 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<allocator_type>::value,
74 __split_buffer,479 __split_buffer,
75 void>;480 void>;
76 using __replaceable _LIBCPP_NODEBUG =
77 __conditional_t<__is_replaceable_v<pointer> && __container_allocator_is_replaceable<__alloc_traits>::value,
78 __split_buffer,
79 void>;
80
81 pointer __first_;
82 pointer __begin_;
83 pointer __end_;
84 _LIBCPP_COMPRESSED_PAIR(pointer, __cap_, allocator_type, __alloc_);
85481
86 __split_buffer(const __split_buffer&) = delete;482 __split_buffer(const __split_buffer&) = delete;
87 __split_buffer& operator=(const __split_buffer&) = delete;483 __split_buffer& operator=(const __split_buffer&) = delete;
88484
89 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer()485 _LIBCPP_HIDE_FROM_ABI __split_buffer() = default;
90 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
91 : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __cap_(nullptr) {}
92486
93 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(__alloc_rr& __a)487 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(allocator_type& __a) : __base_type(__a) {}
94 : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __cap_(nullptr), __alloc_(__a) {}
95488
96 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(const __alloc_rr& __a)489 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(const allocator_type& __a)
97 : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __cap_(nullptr), __alloc_(__a) {}490 : __base_type(__a) {}
98491
99 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI492 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
100 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);493 __split_buffer(size_type __cap, size_type __start, allocator_type& __a);
101494
102 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)495 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
103 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);496 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
104497
105 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);498 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const allocator_type& __a);
106499
107 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)500 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
108 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&501 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
...@@ -111,36 +504,16 @@ public:...@@ -111,36 +504,16 @@ public:
111504
112 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();505 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
113506
114 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __begin_; }507 using __base_type::back;
115 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __begin_; }508 using __base_type::begin;
116509 using __base_type::capacity;
117 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __end_; }510 using __base_type::empty;
118 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __end_; }511 using __base_type::end;
119512 using __base_type::size;
120 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
121513
122 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const {514 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(begin()); }
123 return static_cast<size_type>(__end_ - __begin_);515 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() { return *begin(); }
124 }516 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return *begin(); }
125
126 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const { return __end_ == __begin_; }
127
128 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const {
129 return static_cast<size_type>(__cap_ - __first_);
130 }
131
132 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const {
133 return static_cast<size_type>(__begin_ - __first_);
134 }
135
136 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const {
137 return static_cast<size_type>(__cap_ - __end_);
138 }
139
140 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() { return *__begin_; }
141 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return *__begin_; }
142 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() { return *(__end_ - 1); }
143 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const { return *(__end_ - 1); }
144517
145 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;518 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
146519
...@@ -149,8 +522,8 @@ public:...@@ -149,8 +522,8 @@ public:
149 template <class... _Args>522 template <class... _Args>
150 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);523 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
151524
152 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() { __destruct_at_begin(__begin_ + 1); }525 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() { __destruct_at_begin(begin() + 1); }
153 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() { __destruct_at_end(__end_ - 1); }526 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() { __destruct_at_end(end() - 1); }
154527
155 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);528 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);
156 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);529 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);
...@@ -182,244 +555,242 @@ public:...@@ -182,244 +555,242 @@ public:
182 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;555 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
183556
184 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)557 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
185 _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>);558 _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
559
560 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
561 if (__front_cap() == nullptr) {
562 if (begin() != nullptr)
563 return false;
564
565 if (!empty())
566 return false;
567
568 if (capacity() != 0)
569 return false;
570
571 return true;
572 } else {
573 if (begin() < __front_cap())
574 return false;
186575
187 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;576 if (capacity() < size())
577 return false;
578
579 if (end() < begin())
580 return false;
581
582 return true;
583 }
584 }
585
586 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
587 __swap_without_allocator(__split_buffer<value_type, allocator_type, _Layout>& __other) _NOEXCEPT {
588 __base_type::__swap_without_allocator(__other);
589 }
188590
189private:591private:
190 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)592 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
191 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {593 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
192 __alloc_ = std::move(__c.__alloc_);594 __get_allocator() = std::move(__c.__get_allocator());
193 }595 }
194596
195 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {}597 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {}
196598
197 struct _ConstructTransaction {599 struct _ConstructTransaction {
198 _LIBCPP_CONSTEXPR_SINCE_CXX20600 _LIBCPP_CONSTEXPR_SINCE_CXX20
199 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT601 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(__split_buffer* __parent, pointer __p, size_type __n) _NOEXCEPT
200 : __pos_(*__p),602 : __pos_(__p),
201 __end_(*__p + __n),603 __end_(__p + __n),
202 __dest_(__p) {}604 __parent_(__parent) {}
203605
204 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { *__dest_ = __pos_; }606 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { __parent_->__set_sentinel(__pos_); }
205607
206 pointer __pos_;608 pointer __pos_;
207 const pointer __end_;609 const pointer __end_;
208610
209 private:611 private:
210 pointer* __dest_;612 __split_buffer* __parent_;
211 };613 };
212};
213614
214template <class _Tp, class _Allocator>615 template <class _T2, class _A2, template <class, class, class> class _L2>
215_LIBCPP_CONSTEXPR_SINCE_CXX20 bool __split_buffer<_Tp, _Allocator>::__invariants() const {616 friend class __split_buffer;
216 if (__first_ == nullptr) {617};
217 if (__begin_ != nullptr)
218 return false;
219 if (__end_ != nullptr)
220 return false;
221 if (__cap_ != nullptr)
222 return false;
223 } else {
224 if (__begin_ < __first_)
225 return false;
226 if (__end_ < __begin_)
227 return false;
228 if (__cap_ < __end_)
229 return false;
230 }
231 return true;
232}
233618
234// Default constructs __n objects starting at __end_619// Default constructs __n objects starting at `end()`
235// throws if construction throws620// throws if construction throws
236// Precondition: __n > 0621// Precondition: __n > 0
237// Precondition: size() + __n <= capacity()622// Precondition: size() + __n <= capacity()
238// Postcondition: size() == size() + __n623// Postcondition: size() == size() + __n
239template <class _Tp, class _Allocator>624template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
240_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n) {625_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::__construct_at_end(size_type __n) {
241 _ConstructTransaction __tx(std::addressof(this->__end_), __n);626 _ConstructTransaction __tx(this, end(), __n);
242 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {627 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
243 __alloc_traits::construct(__alloc_, std::__to_address(__tx.__pos_));628 __alloc_traits::construct(__get_allocator(), std::__to_address(__tx.__pos_));
244 }629 }
245}630}
246631
247// Copy constructs __n objects starting at __end_ from __x632// Copy constructs __n objects starting at `end()` from __x
248// throws if construction throws633// throws if construction throws
249// Precondition: __n > 0634// Precondition: __n > 0
250// Precondition: size() + __n <= capacity()635// Precondition: size() + __n <= capacity()
251// Postcondition: size() == old size() + __n636// Postcondition: size() == old size() + __n
252// Postcondition: [i] == __x for all i in [size() - __n, __n)637// Postcondition: [i] == __x for all i in [size() - __n, __n)
253template <class _Tp, class _Allocator>638template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
254_LIBCPP_CONSTEXPR_SINCE_CXX20 void639_LIBCPP_CONSTEXPR_SINCE_CXX20 void
255__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x) {640__split_buffer<_Tp, _Allocator, _Layout>::__construct_at_end(size_type __n, const_reference __x) {
256 _ConstructTransaction __tx(std::addressof(this->__end_), __n);641 _ConstructTransaction __tx(this, end(), __n);
257 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {642 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
258 __alloc_traits::construct(__alloc_, std::__to_address(__tx.__pos_), __x);643 __alloc_traits::construct(__get_allocator(), std::__to_address(__tx.__pos_), __x);
259 }644 }
260}645}
261646
262template <class _Tp, class _Allocator>647template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
263template <class _Iterator, class _Sentinel>648template <class _Iterator, class _Sentinel>
264_LIBCPP_CONSTEXPR_SINCE_CXX20 void649_LIBCPP_CONSTEXPR_SINCE_CXX20 void
265__split_buffer<_Tp, _Allocator>::__construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last) {650__split_buffer<_Tp, _Allocator, _Layout>::__construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last) {
266 __alloc_rr& __a = __alloc_;651 allocator_type& __a = __get_allocator();
267 for (; __first != __last; ++__first) {652 for (; __first != __last; ++__first) {
268 if (__end_ == __cap_) {653 if (__back_spare() == 0) {
269 size_type __old_cap = __cap_ - __first_;654 size_type __old_cap = capacity();
270 size_type __new_cap = std::max<size_type>(2 * __old_cap, 8);655 size_type __new_cap = std::max<size_type>(2 * __old_cap, 8);
271 __split_buffer __buf(__new_cap, 0, __a);656 __split_buffer __buf(__new_cap, 0, __a);
272 for (pointer __p = __begin_; __p != __end_; ++__p, (void)++__buf.__end_)657 pointer __buf_end = __buf.end();
273 __alloc_traits::construct(__buf.__alloc_, std::__to_address(__buf.__end_), std::move(*__p));658 pointer __end = end();
659 for (pointer __p = begin(); __p != __end; ++__p) {
660 __alloc_traits::construct(__buf.__get_allocator(), std::__to_address(__buf_end), std::move(*__p));
661 __buf.__set_sentinel(++__buf_end);
662 }
274 swap(__buf);663 swap(__buf);
275 }664 }
276 __alloc_traits::construct(__a, std::__to_address(this->__end_), *__first);665
277 ++this->__end_;666 __alloc_traits::construct(__a, std::__to_address(end()), *__first);
667 __set_sentinel(size() + 1);
278 }668 }
279}669}
280template <class _Tp, class _Allocator>670
671template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
281template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >672template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
282_LIBCPP_CONSTEXPR_SINCE_CXX20 void673_LIBCPP_CONSTEXPR_SINCE_CXX20 void
283__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last) {674__split_buffer<_Tp, _Allocator, _Layout>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last) {
284 __construct_at_end_with_size(__first, std::distance(__first, __last));675 __construct_at_end_with_size(__first, std::distance(__first, __last));
285}676}
286677
287template <class _Tp, class _Allocator>678template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
288template <class _ForwardIterator>679template <class _ForwardIterator>
289_LIBCPP_CONSTEXPR_SINCE_CXX20 void680_LIBCPP_CONSTEXPR_SINCE_CXX20 void
290__split_buffer<_Tp, _Allocator>::__construct_at_end_with_size(_ForwardIterator __first, size_type __n) {681__split_buffer<_Tp, _Allocator, _Layout>::__construct_at_end_with_size(_ForwardIterator __first, size_type __n) {
291 _ConstructTransaction __tx(std::addressof(this->__end_), __n);682 _ConstructTransaction __tx(this, end(), __n);
292 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__first) {683 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__first) {
293 __alloc_traits::construct(__alloc_, std::__to_address(__tx.__pos_), *__first);684 __alloc_traits::construct(__get_allocator(), std::__to_address(__tx.__pos_), *__first);
294 }685 }
295}686}
296687
297template <class _Tp, class _Allocator>688template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
298_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void689_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void
299__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type) {690__split_buffer<_Tp, _Allocator, _Layout>::__destruct_at_begin(pointer __new_begin, false_type) {
300 while (__begin_ != __new_begin)691 pointer __begin = begin();
301 __alloc_traits::destroy(__alloc_, std::__to_address(__begin_++));692 // Updating begin at every iteration is unnecessary because destruction can't throw.
693 while (__begin != __new_begin)
694 __alloc_traits::destroy(__get_allocator(), std::__to_address(__begin++));
695 __set_valid_range(__begin, end());
302}696}
303697
304template <class _Tp, class _Allocator>698template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
305_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void699_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void
306__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_type) {700__split_buffer<_Tp, _Allocator, _Layout>::__destruct_at_begin(pointer __new_begin, true_type) {
307 __begin_ = __new_begin;701 __set_valid_range(__new_begin, end());
308}
309
310template <class _Tp, class _Allocator>
311_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
312__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT {
313 while (__new_last != __end_)
314 __alloc_traits::destroy(__alloc_, std::__to_address(--__end_));
315}702}
316703
317template <class _Tp, class _Allocator>704template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
318_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void705_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
319__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type) _NOEXCEPT {706__split_buffer<_Tp, _Allocator, _Layout>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT {
320 __end_ = __new_last;707 pointer __end = end();
708 // Updating begin at every iteration is unnecessary because destruction can't throw.
709 while (__new_last != __end)
710 __alloc_traits::destroy(__get_allocator(), std::__to_address(--__end));
711 __set_sentinel(__end);
321}712}
322713
323template <class _Tp, class _Allocator>714template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
324_LIBCPP_CONSTEXPR_SINCE_CXX20715_LIBCPP_CONSTEXPR_SINCE_CXX20
325__split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)716__split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(size_type __cap, size_type __start, allocator_type& __a)
326 : __cap_(nullptr), __alloc_(__a) {717 : __base_type(__a) {
327 if (__cap == 0) {718 _LIBCPP_ASSERT_INTERNAL(__cap >= __start, "can't have a start point outside the capacity");
328 __first_ = nullptr;719 if (__cap > 0) {
329 } else {720 auto __allocation = std::__allocate_at_least(__get_allocator(), __cap);
330 auto __allocation = std::__allocate_at_least(__alloc_, __cap);721 __set_data(__allocation.ptr);
331 __first_ = __allocation.ptr;722 __cap = __allocation.count;
332 __cap = __allocation.count;
333 }723 }
334 __begin_ = __end_ = __first_ + __start;724
335 __cap_ = __first_ + __cap;725 pointer __begin = __front_cap() + __start;
726 __set_valid_range(__begin, __begin);
727 __set_capacity(__cap);
336}728}
337729
338template <class _Tp, class _Allocator>730template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
339_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator>::~__split_buffer() {731_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::~__split_buffer() {
340 clear();732 clear();
341 if (__first_)733 if (__front_cap())
342 __alloc_traits::deallocate(__alloc_, __first_, capacity());734 __alloc_traits::deallocate(__get_allocator(), __front_cap(), capacity());
343}735}
344736
345template <class _Tp, class _Allocator>737template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
346_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)738_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c)
347 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)739 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
348 : __first_(std::move(__c.__first_)),740 : __base_type(std::move(__c)) {
349 __begin_(std::move(__c.__begin_)),741 __c.__reset();
350 __end_(std::move(__c.__end_)),
351 __cap_(std::move(__c.__cap_)),
352 __alloc_(std::move(__c.__alloc_)) {
353 __c.__first_ = nullptr;
354 __c.__begin_ = nullptr;
355 __c.__end_ = nullptr;
356 __c.__cap_ = nullptr;
357}742}
358743
359template <class _Tp, class _Allocator>744template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
360_LIBCPP_CONSTEXPR_SINCE_CXX20745_LIBCPP_CONSTEXPR_SINCE_CXX20
361__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)746__split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c, const allocator_type& __a)
362 : __cap_(nullptr), __alloc_(__a) {747 : __base_type(__a) {
363 if (__a == __c.__alloc_) {748 if (__a == __c.__get_allocator()) {
364 __first_ = __c.__first_;749 __set_data(__c.__front_cap());
365 __begin_ = __c.__begin_;750 __set_valid_range(__c.begin(), __c.end());
366 __end_ = __c.__end_;751 __set_capacity(__c.capacity());
367 __cap_ = __c.__cap_;752 __c.__reset();
368 __c.__first_ = nullptr;
369 __c.__begin_ = nullptr;
370 __c.__end_ = nullptr;
371 __c.__cap_ = nullptr;
372 } else {753 } else {
373 auto __allocation = std::__allocate_at_least(__alloc_, __c.size());754 auto __allocation = std::__allocate_at_least(__get_allocator(), __c.size());
374 __first_ = __allocation.ptr;755 __set_data(__allocation.ptr);
375 __begin_ = __end_ = __first_;756 __set_valid_range(__front_cap(), __front_cap());
376 __cap_ = __first_ + __allocation.count;757 __set_capacity(__allocation.count);
377 typedef move_iterator<iterator> _Ip;758 typedef move_iterator<iterator> _Ip;
378 __construct_at_end(_Ip(__c.begin()), _Ip(__c.end()));759 __construct_at_end(_Ip(__c.begin()), _Ip(__c.end()));
379 }760 }
380}761}
381762
382template <class _Tp, class _Allocator>763template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
383_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator>&764_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>&
384__split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)765__split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c)
385 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&766 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
386 is_nothrow_move_assignable<allocator_type>::value) ||767 is_nothrow_move_assignable<allocator_type>::value) ||
387 !__alloc_traits::propagate_on_container_move_assignment::value) {768 !__alloc_traits::propagate_on_container_move_assignment::value) {
388 clear();769 clear();
389 shrink_to_fit();770 shrink_to_fit();
390 __first_ = __c.__first_;771 __copy_without_alloc(__c);
391 __begin_ = __c.__begin_;
392 __end_ = __c.__end_;
393 __cap_ = __c.__cap_;
394 __move_assign_alloc(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());772 __move_assign_alloc(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
395 __c.__first_ = __c.__begin_ = __c.__end_ = __c.__cap_ = nullptr;773 __c.__reset();
396 return *this;774 return *this;
397}775}
398776
399template <class _Tp, class _Allocator>777template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
400_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)778_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::swap(__split_buffer& __x)
401 _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>) {779 _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>) {
402 std::swap(__first_, __x.__first_);780 __base_type::swap(__x);
403 std::swap(__begin_, __x.__begin_);
404 std::swap(__end_, __x.__end_);
405 std::swap(__cap_, __x.__cap_);
406 std::__swap_allocator(__alloc_, __x.__alloc_);
407}781}
408782
409template <class _Tp, class _Allocator>783template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
410_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT {784_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::shrink_to_fit() _NOEXCEPT {
411 if (capacity() > size()) {785 if (capacity() > size()) {
412#if _LIBCPP_HAS_EXCEPTIONS786#if _LIBCPP_HAS_EXCEPTIONS
413 try {787 try {
414#endif // _LIBCPP_HAS_EXCEPTIONS788#endif // _LIBCPP_HAS_EXCEPTIONS
415 __split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc_);789 __split_buffer<value_type, allocator_type, _Layout> __t(size(), 0, __get_allocator());
416 if (__t.capacity() < capacity()) {790 if (__t.capacity() < capacity()) {
417 __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_));791 __t.__construct_at_end(move_iterator<pointer>(begin()), move_iterator<pointer>(end()));
418 __t.__end_ = __t.__begin_ + (__end_ - __begin_);792 __t.__set_sentinel(size());
419 std::swap(__first_, __t.__first_);793 __swap_without_allocator(__t);
420 std::swap(__begin_, __t.__begin_);
421 std::swap(__end_, __t.__end_);
422 std::swap(__cap_, __t.__cap_);
423 }794 }
424#if _LIBCPP_HAS_EXCEPTIONS795#if _LIBCPP_HAS_EXCEPTIONS
425 } catch (...) {796 } catch (...) {
...@@ -428,55 +799,56 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::shrink_to_fi...@@ -428,55 +799,56 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::shrink_to_fi
428 }799 }
429}800}
430801
431template <class _Tp, class _Allocator>802template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
432template <class... _Args>803template <class... _Args>
433_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::emplace_front(_Args&&... __args) {804_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emplace_front(_Args&&... __args) {
434 if (__begin_ == __first_) {805 if (__front_spare() == 0) {
435 if (__end_ < __cap_) {806 pointer __end = end();
436 difference_type __d = __cap_ - __end_;807 if (__back_spare() > 0) {
808 // The elements are pressed up against the front of the buffer: we need to move them back a
809 // little bit to make `emplace_front` have amortised O(1) complexity.
810 difference_type __d = __back_spare();
437 __d = (__d + 1) / 2;811 __d = (__d + 1) / 2;
438 __begin_ = std::move_backward(__begin_, __end_, __end_ + __d);812 auto __new_end = __end + __d;
439 __end_ += __d;813 __set_valid_range(std::move_backward(begin(), __end, __new_end), __new_end);
440 } else {814 } else {
441 size_type __c = std::max<size_type>(2 * static_cast<size_type>(__cap_ - __first_), 1);815 size_type __c = std::max<size_type>(2 * capacity(), 1);
442 __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc_);816 __split_buffer<value_type, allocator_type, _Layout> __t(__c, (__c + 3) / 4, __get_allocator());
443 __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_));817 __t.__construct_at_end(move_iterator<pointer>(begin()), move_iterator<pointer>(__end));
444 std::swap(__first_, __t.__first_);818 __base_type::__swap_without_allocator(__t);
445 std::swap(__begin_, __t.__begin_);
446 std::swap(__end_, __t.__end_);
447 std::swap(__cap_, __t.__cap_);
448 }819 }
449 }820 }
450 __alloc_traits::construct(__alloc_, std::__to_address(__begin_ - 1), std::forward<_Args>(__args)...);821
451 --__begin_;822 __alloc_traits::construct(__get_allocator(), std::__to_address(begin() - 1), std::forward<_Args>(__args)...);
823 __set_valid_range(begin() - 1, size() + 1);
452}824}
453825
454template <class _Tp, class _Allocator>826template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
455template <class... _Args>827template <class... _Args>
456_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args) {828_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emplace_back(_Args&&... __args) {
457 if (__end_ == __cap_) {829 pointer __end = end();
458 if (__begin_ > __first_) {830 if (__back_spare() == 0) {
459 difference_type __d = __begin_ - __first_;831 if (__front_spare() > 0) {
832 difference_type __d = __front_spare();
460 __d = (__d + 1) / 2;833 __d = (__d + 1) / 2;
461 __end_ = std::move(__begin_, __end_, __begin_ - __d);834 __end = std::move(begin(), __end, begin() - __d);
462 __begin_ -= __d;835 __set_valid_range(begin() - __d, __end);
463 } else {836 } else {
464 size_type __c = std::max<size_type>(2 * static_cast<size_type>(__cap_ - __first_), 1);837 size_type __c = std::max<size_type>(2 * capacity(), 1);
465 __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc_);838 __split_buffer<value_type, allocator_type, _Layout> __t(__c, __c / 4, __get_allocator());
466 __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_));839 __t.__construct_at_end(move_iterator<pointer>(begin()), move_iterator<pointer>(__end));
467 std::swap(__first_, __t.__first_);840 __base_type::__swap_without_allocator(__t);
468 std::swap(__begin_, __t.__begin_);
469 std::swap(__end_, __t.__end_);
470 std::swap(__cap_, __t.__cap_);
471 }841 }
472 }842 }
473 __alloc_traits::construct(__alloc_, std::__to_address(__end_), std::forward<_Args>(__args)...);843
474 ++__end_;844 __alloc_traits::construct(__get_allocator(), std::__to_address(__end), std::forward<_Args>(__args)...);
845 __set_sentinel(++__end);
475}846}
476847
477template <class _Tp, class _Allocator>848template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
478_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void849_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
479swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {850swap(__split_buffer<_Tp, _Allocator, _Layout>& __x, __split_buffer<_Tp, _Allocator, _Layout>& __y)
851 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
480 __x.swap(__y);852 __x.swap(__y);
481}853}
482854
lib/libcxx/include/__stop_token/atomic_unique_lock.h+1-1
...@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
27// where State contains a lock bit and might contain other data,27// 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 << 228// and LockedBit is the value of State when the lock bit is set, e.g 1 << 2
29template <class _State, _State _LockedBit>29template <class _State, _State _LockedBit>
30class _LIBCPP_AVAILABILITY_SYNC __atomic_unique_lock {30class __atomic_unique_lock {
31 static_assert(std::__popcount(static_cast<unsigned long long>(_LockedBit)) == 1,31 static_assert(std::__popcount(static_cast<unsigned long long>(_LockedBit)) == 1,
32 "LockedBit must be an integer where only one bit is set");32 "LockedBit must be an integer where only one bit is set");
3333
lib/libcxx/include/__stop_token/stop_callback.h+2-2
...@@ -34,7 +34,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -34,7 +34,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
34#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS34#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
3535
36template <class _Callback>36template <class _Callback>
37class _LIBCPP_AVAILABILITY_SYNC stop_callback : private __stop_callback_base {37class stop_callback : private __stop_callback_base {
38 static_assert(invocable<_Callback>,38 static_assert(invocable<_Callback>,
39 "Mandates: stop_callback is instantiated with an argument for the template parameter Callback that "39 "Mandates: stop_callback is instantiated with an argument for the template parameter Callback that "
40 "satisfies invocable.");40 "satisfies invocable.");
...@@ -91,7 +91,7 @@ private:...@@ -91,7 +91,7 @@ private:
91};91};
9292
93template <class _Callback>93template <class _Callback>
94_LIBCPP_AVAILABILITY_SYNC stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;94stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
9595
96#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS96#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
9797
lib/libcxx/include/__stop_token/stop_source.h+1-1
...@@ -30,7 +30,7 @@ struct nostopstate_t {...@@ -30,7 +30,7 @@ struct nostopstate_t {
3030
31inline constexpr nostopstate_t nostopstate{};31inline constexpr nostopstate_t nostopstate{};
3232
33class _LIBCPP_AVAILABILITY_SYNC stop_source {33class stop_source {
34public:34public:
35 _LIBCPP_HIDE_FROM_ABI stop_source() : __state_(new __stop_state()) { __state_->__increment_stop_source_counter(); }35 _LIBCPP_HIDE_FROM_ABI stop_source() : __state_(new __stop_state()) { __state_->__increment_stop_source_counter(); }
3636
lib/libcxx/include/__stop_token/stop_state.h+4-4
...@@ -100,7 +100,7 @@ public:...@@ -100,7 +100,7 @@ public:
100 return ((__curent_state & __stop_requested_bit) != 0) || ((__curent_state >> __stop_source_counter_shift) != 0);100 return ((__curent_state & __stop_requested_bit) != 0) || ((__curent_state >> __stop_source_counter_shift) != 0);
101 }101 }
102102
103 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool __request_stop() noexcept {103 _LIBCPP_HIDE_FROM_ABI bool __request_stop() noexcept {
104 auto __cb_list_lock = __try_lock_for_request_stop();104 auto __cb_list_lock = __try_lock_for_request_stop();
105 if (!__cb_list_lock.__owns_lock()) {105 if (!__cb_list_lock.__owns_lock()) {
106 return false;106 return false;
...@@ -137,7 +137,7 @@ public:...@@ -137,7 +137,7 @@ public:
137 return true;137 return true;
138 }138 }
139139
140 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool __add_callback(__stop_callback_base* __cb) noexcept {140 _LIBCPP_HIDE_FROM_ABI bool __add_callback(__stop_callback_base* __cb) noexcept {
141 // If it is already stop_requested. Do not try to request it again.141 // If it is already stop_requested. Do not try to request it again.
142 const auto __give_up_trying_to_lock_condition = [__cb](__state_t __state) {142 const auto __give_up_trying_to_lock_condition = [__cb](__state_t __state) {
143 if ((__state & __stop_requested_bit) != 0) {143 if ((__state & __stop_requested_bit) != 0) {
...@@ -164,7 +164,7 @@ public:...@@ -164,7 +164,7 @@ public:
164 }164 }
165165
166 // called by the destructor of stop_callback166 // called by the destructor of stop_callback
167 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void __remove_callback(__stop_callback_base* __cb) noexcept {167 _LIBCPP_HIDE_FROM_ABI void __remove_callback(__stop_callback_base* __cb) noexcept {
168 __callback_list_lock __cb_list_lock(__state_);168 __callback_list_lock __cb_list_lock(__state_);
169169
170 // under below condition, the request_stop call just popped __cb from the list and could execute it now170 // under below condition, the request_stop call just popped __cb from the list and could execute it now
...@@ -192,7 +192,7 @@ public:...@@ -192,7 +192,7 @@ public:
192 }192 }
193193
194private:194private:
195 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI __callback_list_lock __try_lock_for_request_stop() noexcept {195 _LIBCPP_HIDE_FROM_ABI __callback_list_lock __try_lock_for_request_stop() noexcept {
196 // If it is already stop_requested, do not try to request stop or lock the list again.196 // If it is already stop_requested, do not try to request stop or lock the list again.
197 const auto __lock_fail_condition = [](__state_t __state) { return (__state & __stop_requested_bit) != 0; };197 const auto __lock_fail_condition = [](__state_t __state) { return (__state & __stop_requested_bit) != 0; };
198198
lib/libcxx/include/__stop_token/stop_token.h+1-1
...@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
23#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS23#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
2424
25class _LIBCPP_AVAILABILITY_SYNC 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;
2828
lib/libcxx/include/__string/char_traits.h+51-31
...@@ -94,16 +94,17 @@ struct char_traits<char> {...@@ -94,16 +94,17 @@ struct char_traits<char> {
94 }94 }
9595
96 // TODO: Make this _LIBCPP_HIDE_FROM_ABI96 // TODO: Make this _LIBCPP_HIDE_FROM_ABI
97 static inline _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {97 [[__nodiscard__]] static inline _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {
98 return __c1 == __c2;98 return __c1 == __c2;
99 }99 }
100 static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {100 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
101 lt(char_type __c1, char_type __c2) _NOEXCEPT {
101 return (unsigned char)__c1 < (unsigned char)__c2;102 return (unsigned char)__c1 < (unsigned char)__c2;
102 }103 }
103104
104 // __constexpr_memcmp requires a trivially lexicographically comparable type, but char is not when char is a signed105 // __constexpr_memcmp requires a trivially lexicographically comparable type, but char is not when char is a signed
105 // type106 // type
106 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int107 [[__nodiscard__]] static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int
107 compare(const char_type* __lhs, const char_type* __rhs, size_t __count) _NOEXCEPT {108 compare(const char_type* __lhs, const char_type* __rhs, size_t __count) _NOEXCEPT {
108 if (__libcpp_is_constant_evaluated()) {109 if (__libcpp_is_constant_evaluated()) {
109#ifdef _LIBCPP_COMPILER_CLANG_BASED110#ifdef _LIBCPP_COMPILER_CLANG_BASED
...@@ -126,11 +127,12 @@ struct char_traits<char> {...@@ -126,11 +127,12 @@ struct char_traits<char> {
126 }127 }
127 }128 }
128129
129 static inline _LIBCPP_HIDE_FROM_ABI size_t _LIBCPP_CONSTEXPR_SINCE_CXX17 length(const char_type* __s) _NOEXCEPT {130 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI size_t _LIBCPP_CONSTEXPR_SINCE_CXX17
131 length(const char_type* __s) _NOEXCEPT {
130 return std::__constexpr_strlen(__s);132 return std::__constexpr_strlen(__s);
131 }133 }
132134
133 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*135 [[__nodiscard__]] static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
134 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {136 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
135 return std::__constexpr_memchr(__s, __a, __n);137 return std::__constexpr_memchr(__s, __a, __n);
136 }138 }
...@@ -154,19 +156,24 @@ struct char_traits<char> {...@@ -154,19 +156,24 @@ struct char_traits<char> {
154 return __s;156 return __s;
155 }157 }
156158
157 static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {159 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {
158 return eq_int_type(__c, eof()) ? ~eof() : __c;160 return eq_int_type(__c, eof()) ? ~eof() : __c;
159 }161 }
160 static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {162 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type
163 to_char_type(int_type __c) _NOEXCEPT {
161 return char_type(__c);164 return char_type(__c);
162 }165 }
163 static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {166 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type
167 to_int_type(char_type __c) _NOEXCEPT {
164 return int_type((unsigned char)__c);168 return int_type((unsigned char)__c);
165 }169 }
166 static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {170 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
171 eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {
167 return __c1 == __c2;172 return __c1 == __c2;
168 }173 }
169 static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return int_type(EOF); }174 [[__nodiscard__]] static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT {
175 return int_type(EOF);
176 }
170};177};
171178
172template <class _CharT, class _IntT, _IntT _EOFVal>179template <class _CharT, class _IntT, _IntT _EOFVal>
...@@ -187,11 +194,11 @@ struct __char_traits_base {...@@ -187,11 +194,11 @@ struct __char_traits_base {
187 __lhs = __rhs;194 __lhs = __rhs;
188 }195 }
189196
190 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool eq(char_type __lhs, char_type __rhs) _NOEXCEPT {197 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool eq(char_type __lhs, char_type __rhs) _NOEXCEPT {
191 return __lhs == __rhs;198 return __lhs == __rhs;
192 }199 }
193200
194 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool lt(char_type __lhs, char_type __rhs) _NOEXCEPT {201 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool lt(char_type __lhs, char_type __rhs) _NOEXCEPT {
195 return __lhs < __rhs;202 return __lhs < __rhs;
196 }203 }
197204
...@@ -213,19 +220,22 @@ struct __char_traits_base {...@@ -213,19 +220,22 @@ struct __char_traits_base {
213 return __str;220 return __str;
214 }221 }
215222
216 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {223 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {
217 return char_type(__c);224 return char_type(__c);
218 }225 }
219226
220 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT { return int_type(__c); }227 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {
228 return int_type(__c);
229 }
221230
222 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __lhs, int_type __rhs) _NOEXCEPT {231 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool
232 eq_int_type(int_type __lhs, int_type __rhs) _NOEXCEPT {
223 return __lhs == __rhs;233 return __lhs == __rhs;
224 }234 }
225235
226 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return _EOFVal; }236 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return _EOFVal; }
227237
228 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {238 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {
229 return eq_int_type(__c, eof()) ? static_cast<int_type>(~eof()) : __c;239 return eq_int_type(__c, eof()) ? static_cast<int_type>(~eof()) : __c;
230 }240 }
231};241};
...@@ -235,18 +245,19 @@ struct __char_traits_base {...@@ -235,18 +245,19 @@ struct __char_traits_base {
235#if _LIBCPP_HAS_WIDE_CHARACTERS245#if _LIBCPP_HAS_WIDE_CHARACTERS
236template <>246template <>
237struct char_traits<wchar_t> : __char_traits_base<wchar_t, wint_t, static_cast<wint_t>(WEOF)> {247struct char_traits<wchar_t> : __char_traits_base<wchar_t, wint_t, static_cast<wint_t>(WEOF)> {
238 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int248 [[__nodiscard__]] static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int
239 compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {249 compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
240 if (__n == 0)250 if (__n == 0)
241 return 0;251 return 0;
242 return std::__constexpr_wmemcmp(__s1, __s2, __n);252 return std::__constexpr_wmemcmp(__s1, __s2, __n);
243 }253 }
244254
245 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT {255 [[__nodiscard__]] static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t
256 length(const char_type* __s) _NOEXCEPT {
246 return std::__constexpr_wcslen(__s);257 return std::__constexpr_wcslen(__s);
247 }258 }
248259
249 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*260 [[__nodiscard__]] static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
250 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {261 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
251 return std::__constexpr_wmemchr(__s, __a, __n);262 return std::__constexpr_wmemchr(__s, __a, __n);
252 }263 }
...@@ -257,16 +268,16 @@ struct char_traits<wchar_t> : __char_traits_base<wchar_t, wint_t, static_cast<wi...@@ -257,16 +268,16 @@ struct char_traits<wchar_t> : __char_traits_base<wchar_t, wint_t, static_cast<wi
257268
258template <>269template <>
259struct char_traits<char8_t> : __char_traits_base<char8_t, unsigned int, static_cast<unsigned int>(EOF)> {270struct char_traits<char8_t> : __char_traits_base<char8_t, unsigned int, static_cast<unsigned int>(EOF)> {
260 static _LIBCPP_HIDE_FROM_ABI constexpr int271 [[nodiscard]] static _LIBCPP_HIDE_FROM_ABI constexpr int
261 compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept {272 compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept {
262 return std::__constexpr_memcmp(__s1, __s2, __element_count(__n));273 return std::__constexpr_memcmp(__s1, __s2, __element_count(__n));
263 }274 }
264275
265 static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __str) noexcept {276 [[nodiscard]] static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __str) noexcept {
266 return std::__constexpr_strlen(__str);277 return std::__constexpr_strlen(__str);
267 }278 }
268279
269 _LIBCPP_HIDE_FROM_ABI static constexpr const char_type*280 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr const char_type*
270 find(const char_type* __s, size_t __n, const char_type& __a) noexcept {281 find(const char_type* __s, size_t __n, const char_type& __a) noexcept {
271 return std::__constexpr_memchr(__s, __a, __n);282 return std::__constexpr_memchr(__s, __a, __n);
272 }283 }
...@@ -276,11 +287,11 @@ struct char_traits<char8_t> : __char_traits_base<char8_t, unsigned int, static_c...@@ -276,11 +287,11 @@ struct char_traits<char8_t> : __char_traits_base<char8_t, unsigned int, static_c
276287
277template <>288template <>
278struct char_traits<char16_t> : __char_traits_base<char16_t, uint_least16_t, static_cast<uint_least16_t>(0xFFFF)> {289struct char_traits<char16_t> : __char_traits_base<char16_t, uint_least16_t, static_cast<uint_least16_t>(0xFFFF)> {
279 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 int290 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 int
280 compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;291 compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
281 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT;292 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT;
282293
283 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*294 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
284 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {295 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
285 __identity __proj;296 __identity __proj;
286 const char_type* __match = std::__find(__s, __s + __n, __a, __proj);297 const char_type* __match = std::__find(__s, __s + __n, __a, __proj);
...@@ -290,7 +301,7 @@ struct char_traits<char16_t> : __char_traits_base<char16_t, uint_least16_t, stat...@@ -290,7 +301,7 @@ struct char_traits<char16_t> : __char_traits_base<char16_t, uint_least16_t, stat
290 }301 }
291};302};
292303
293inline _LIBCPP_CONSTEXPR_SINCE_CXX17 int304[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX17 int
294char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {305char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
295 for (; __n; --__n, ++__s1, ++__s2) {306 for (; __n; --__n, ++__s1, ++__s2) {
296 if (lt(*__s1, *__s2))307 if (lt(*__s1, *__s2))
...@@ -301,7 +312,8 @@ char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, siz...@@ -301,7 +312,8 @@ char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, siz
301 return 0;312 return 0;
302}313}
303314
304inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t char_traits<char16_t>::length(const char_type* __s) _NOEXCEPT {315[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t
316char_traits<char16_t>::length(const char_type* __s) _NOEXCEPT {
305 size_t __len = 0;317 size_t __len = 0;
306 for (; !eq(*__s, char_type(0)); ++__s)318 for (; !eq(*__s, char_type(0)); ++__s)
307 ++__len;319 ++__len;
...@@ -310,11 +322,11 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t char_traits<char16_t>::length(const...@@ -310,11 +322,11 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t char_traits<char16_t>::length(const
310322
311template <>323template <>
312struct char_traits<char32_t> : __char_traits_base<char32_t, uint_least32_t, static_cast<uint_least32_t>(0xFFFFFFFF)> {324struct char_traits<char32_t> : __char_traits_base<char32_t, uint_least32_t, static_cast<uint_least32_t>(0xFFFFFFFF)> {
313 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 int325 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 int
314 compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;326 compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
315 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT;327 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT;
316328
317 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*329 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
318 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {330 find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
319 __identity __proj;331 __identity __proj;
320 const char_type* __match = std::__find(__s, __s + __n, __a, __proj);332 const char_type* __match = std::__find(__s, __s + __n, __a, __proj);
...@@ -324,7 +336,7 @@ struct char_traits<char32_t> : __char_traits_base<char32_t, uint_least32_t, stat...@@ -324,7 +336,7 @@ struct char_traits<char32_t> : __char_traits_base<char32_t, uint_least32_t, stat
324 }336 }
325};337};
326338
327inline _LIBCPP_CONSTEXPR_SINCE_CXX17 int339[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX17 int
328char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {340char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
329 for (; __n; --__n, ++__s1, ++__s2) {341 for (; __n; --__n, ++__s1, ++__s2) {
330 if (lt(*__s1, *__s2))342 if (lt(*__s1, *__s2))
...@@ -335,7 +347,8 @@ char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, siz...@@ -335,7 +347,8 @@ char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, siz
335 return 0;347 return 0;
336}348}
337349
338inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t char_traits<char32_t>::length(const char_type* __s) _NOEXCEPT {350[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t
351char_traits<char32_t>::length(const char_type* __s) _NOEXCEPT {
339 size_t __len = 0;352 size_t __len = 0;
340 for (; !eq(*__s, char_type(0)); ++__s)353 for (; !eq(*__s, char_type(0)); ++__s)
341 ++__len;354 ++__len;
...@@ -369,6 +382,13 @@ _LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR_SINCE_CXX14 const _CharT* __searc...@@ -369,6 +382,13 @@ _LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR_SINCE_CXX14 const _CharT* __searc
369 if (__len1 < __len2)382 if (__len1 < __len2)
370 return __last1;383 return __last1;
371384
385 if (__builtin_constant_p(__len2 == 1) && __len2 == 1) {
386 auto __res = _Traits::find(__first1, __len1, *__first2);
387 if (__res == nullptr)
388 return __last1;
389 return __res;
390 }
391
372 // First element of __first2 is loop invariant.392 // First element of __first2 is loop invariant.
373 _CharT __f2 = *__first2;393 _CharT __f2 = *__first2;
374 while (true) {394 while (true) {
lib/libcxx/include/__string/constexpr_c_functions.h+5-5
...@@ -22,7 +22,6 @@...@@ -22,7 +22,6 @@
22#include <__type_traits/is_equality_comparable.h>22#include <__type_traits/is_equality_comparable.h>
23#include <__type_traits/is_integral.h>23#include <__type_traits/is_integral.h>
24#include <__type_traits/is_same.h>24#include <__type_traits/is_same.h>
25#include <__type_traits/is_trivially_copyable.h>
26#include <__type_traits/is_trivially_lexicographically_comparable.h>25#include <__type_traits/is_trivially_lexicographically_comparable.h>
27#include <__type_traits/remove_cv.h>26#include <__type_traits/remove_cv.h>
28#include <__utility/element_count.h>27#include <__utility/element_count.h>
...@@ -96,14 +95,13 @@ __constexpr_memcmp(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {...@@ -96,14 +95,13 @@ __constexpr_memcmp(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {
96 }95 }
97}96}
9897
99// Because of __libcpp_is_trivially_equality_comparable we know that comparing the object representations is equivalent98// Because of __is_trivially_equality_comparable_v we know that comparing the object representations is equivalent
100// to a std::memcmp(...) == 0. Since we have multiple objects contiguously in memory, we can call memcmp once instead99// to a std::memcmp(...) == 0. Since we have multiple objects contiguously in memory, we can call memcmp once instead
101// of invoking it on every object individually.100// of invoking it on every object individually.
102template <class _Tp, class _Up>101template <class _Tp, class _Up>
103_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool102_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
104__constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {103__constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {
105 static_assert(__libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,104 static_assert(__is_trivially_equality_comparable_v<_Tp, _Up>, "_Tp and _Up have to be trivially equality comparable");
106 "_Tp and _Up have to be trivially equality comparable");
107105
108 auto __count = static_cast<size_t>(__n);106 auto __count = static_cast<size_t>(__n);
109107
...@@ -128,7 +126,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n...@@ -128,7 +126,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n
128126
129template <class _Tp, class _Up>127template <class _Tp, class _Up>
130_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_memchr(_Tp* __str, _Up __value, size_t __count) {128_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_memchr(_Tp* __str, _Up __value, size_t __count) {
131 static_assert(sizeof(_Tp) == 1 && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,129 static_assert(sizeof(_Tp) == 1 && __is_trivially_equality_comparable_v<_Tp, _Up>,
132 "Calling memchr on non-trivially equality comparable types is unsafe.");130 "Calling memchr on non-trivially equality comparable types is unsafe.");
133131
134 if (__libcpp_is_constant_evaluated()) {132 if (__libcpp_is_constant_evaluated()) {
...@@ -225,6 +223,8 @@ __constexpr_memmove(_Tp* __dest, _Up* __src, __element_count __n) {...@@ -225,6 +223,8 @@ __constexpr_memmove(_Tp* __dest, _Up* __src, __element_count __n) {
225 std::__assign_trivially_copyable(__dest[__i], __src[__i]);223 std::__assign_trivially_copyable(__dest[__i], __src[__i]);
226 }224 }
227 }225 }
226 } else if _LIBCPP_CONSTEXPR (sizeof(_Tp) == __datasizeof_v<_Tp>) {
227 ::__builtin_memmove(__dest, __src, __count * sizeof(_Tp));
228 } else if (__count > 0) {228 } else if (__count > 0) {
229 ::__builtin_memmove(__dest, __src, (__count - 1) * sizeof(_Tp) + __datasizeof_v<_Tp>);229 ::__builtin_memmove(__dest, __src, (__count - 1) * sizeof(_Tp) + __datasizeof_v<_Tp>);
230 }230 }
lib/libcxx/include/__support/xlocale/__strtonum_fallback.h-8
...@@ -34,12 +34,4 @@ inline _LIBCPP_HIDE_FROM_ABI long double strtold_l(const char* __nptr, char** __...@@ -34,12 +34,4 @@ inline _LIBCPP_HIDE_FROM_ABI long double strtold_l(const char* __nptr, char** __
34 return ::strtold(__nptr, __endptr);34 return ::strtold(__nptr, __endptr);
35}35}
3636
37inline _LIBCPP_HIDE_FROM_ABI long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) {
38 return ::strtoll(__nptr, __endptr, __base);
39}
40
41inline _LIBCPP_HIDE_FROM_ABI unsigned long long strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) {
42 return ::strtoull(__nptr, __endptr, __base);
43}
44
45#endif // _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H37#endif // _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
lib/libcxx/include/__system_error/error_category.h+8-8
...@@ -20,7 +20,7 @@...@@ -20,7 +20,7 @@
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2222
23class _LIBCPP_EXPORTED_FROM_ABI error_condition;23class error_condition;
24class _LIBCPP_EXPORTED_FROM_ABI error_code;24class _LIBCPP_EXPORTED_FROM_ABI error_code;
2525
26class _LIBCPP_HIDDEN __do_message;26class _LIBCPP_HIDDEN __do_message;
...@@ -37,11 +37,11 @@ public:...@@ -37,11 +37,11 @@ public:
37 error_category(const error_category&) = delete;37 error_category(const error_category&) = delete;
38 error_category& operator=(const error_category&) = delete;38 error_category& operator=(const error_category&) = delete;
3939
40 virtual const char* name() const _NOEXCEPT = 0;40 [[__nodiscard__]] virtual const char* name() const _NOEXCEPT = 0;
41 virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;41 [[__nodiscard__]] virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
42 virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;42 [[__nodiscard__]] virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
43 virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;43 [[__nodiscard__]] virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
44 virtual string message(int __ev) const = 0;44 [[__nodiscard__]] virtual string message(int __ev) const = 0;
4545
46 _LIBCPP_HIDE_FROM_ABI bool operator==(const error_category& __rhs) const _NOEXCEPT { return this == &__rhs; }46 _LIBCPP_HIDE_FROM_ABI bool operator==(const error_category& __rhs) const _NOEXCEPT { return this == &__rhs; }
4747
...@@ -67,8 +67,8 @@ public:...@@ -67,8 +67,8 @@ public:
67 string message(int __ev) const override;67 string message(int __ev) const override;
68};68};
6969
70[[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;70[[__gnu__::__const__]] [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
71[[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;71[[__gnu__::__const__]] [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
7272
73_LIBCPP_END_NAMESPACE_STD73_LIBCPP_END_NAMESPACE_STD
7474
lib/libcxx/include/__system_error/error_code.h+5-5
...@@ -71,20 +71,20 @@ public:...@@ -71,20 +71,20 @@ public:
71 __cat_ = &system_category();71 __cat_ = &system_category();
72 }72 }
7373
74 _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }74 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }
7575
76 _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }
7777
78 _LIBCPP_HIDE_FROM_ABI error_condition default_error_condition() const _NOEXCEPT {78 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI error_condition default_error_condition() const _NOEXCEPT {
79 return __cat_->default_error_condition(__val_);79 return __cat_->default_error_condition(__val_);
80 }80 }
8181
82 string message() const;82 [[__nodiscard__]] string message() const;
8383
84 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }84 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
85};85};
8686
87inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(errc __e) _NOEXCEPT {87[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(errc __e) _NOEXCEPT {
88 return error_code(static_cast<int>(__e), generic_category());88 return error_code(static_cast<int>(__e), generic_category());
89}89}
9090
lib/libcxx/include/__system_error/error_condition.h+4-4
...@@ -80,15 +80,15 @@ public:...@@ -80,15 +80,15 @@ public:
80 __cat_ = &generic_category();80 __cat_ = &generic_category();
81 }81 }
8282
83 _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }
8484
85 _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }
86 string message() const;86 [[__nodiscard__]] string message() const;
8787
88 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }88 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
89};89};
9090
91inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(errc __e) _NOEXCEPT {91[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(errc __e) _NOEXCEPT {
92 return error_condition(static_cast<int>(__e), generic_category());92 return error_condition(static_cast<int>(__e), generic_category());
93}93}
9494
lib/libcxx/include/__system_error/system_error.h+1-1
...@@ -36,7 +36,7 @@ public:...@@ -36,7 +36,7 @@ public:
36 _LIBCPP_HIDE_FROM_ABI system_error(const system_error&) _NOEXCEPT = default;36 _LIBCPP_HIDE_FROM_ABI system_error(const system_error&) _NOEXCEPT = default;
37 ~system_error() _NOEXCEPT override;37 ~system_error() _NOEXCEPT override;
3838
39 _LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }39 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
40};40};
4141
42// __ev is expected to be an error in the generic_category domain (e.g. from42// __ev is expected to be an error in the generic_category domain (e.g. from
lib/libcxx/include/__thread/id.h+1-1
...@@ -23,7 +23,7 @@...@@ -23,7 +23,7 @@
23_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
2424
25#if _LIBCPP_HAS_THREADS25#if _LIBCPP_HAS_THREADS
26class _LIBCPP_EXPORTED_FROM_ABI __thread_id;26class __thread_id;
2727
28namespace this_thread {28namespace this_thread {
2929
lib/libcxx/include/__thread/jthread.h+1-1
...@@ -36,7 +36,7 @@ _LIBCPP_PUSH_MACROS...@@ -36,7 +36,7 @@ _LIBCPP_PUSH_MACROS
3636
37_LIBCPP_BEGIN_NAMESPACE_STD37_LIBCPP_BEGIN_NAMESPACE_STD
3838
39class _LIBCPP_AVAILABILITY_SYNC jthread {39class jthread {
40public:40public:
41 // types41 // types
42 using id = thread::id;42 using id = thread::id;
lib/libcxx/include/__thread/poll_with_backoff.h+27-8
...@@ -22,33 +22,50 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,33 +22,50 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
23static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;23static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;
2424
25enum class __backoff_results : unsigned char {
26 __continue_poll = 1,
27 __poll_success = 2,
28 __timeout = 3,
29 __backoff_failure = 4,
30};
31
32enum class __poll_with_backoff_results : unsigned char {
33 __poll_success = static_cast<unsigned char>(__backoff_results::__poll_success),
34 __timeout = static_cast<unsigned char>(__backoff_results::__timeout),
35 __backoff_failure = static_cast<unsigned char>(__backoff_results::__backoff_failure),
36};
37
25// Polls a thread for a condition given by a predicate, and backs off based on a backoff policy38// Polls a thread for a condition given by a predicate, and backs off based on a backoff policy
26// before polling again.39// before polling again.
27//40//
28// - __poll is the "test function" that should return true if polling succeeded, and false if it failed.41// - __poll is the "test function" that should return true if polling succeeded, and false if it failed.
29//42//
30// - __backoff is the "backoff policy", which is called with the duration since we started polling. It should43// - __backoff is the "backoff policy", which is called with the duration since we started polling. It should
31// return false in order to resume polling, and true if polling should stop entirely for some reason.44// return __backoff_results::__continue_poll in order to resume polling, and other appropriate __backoff_results
45// if polling should stop entirely for some reason.
32// In general, backoff policies sleep for some time before returning control to the polling loop.46// In general, backoff policies sleep for some time before returning control to the polling loop.
33//47//
34// - __max_elapsed is the maximum duration to try polling for. If the maximum duration is exceeded,48// - __max_elapsed is the maximum duration to try polling for. If the maximum duration is exceeded,
35// the polling loop will return false to report a timeout.49// the polling loop will return __poll_with_backoff_results::__timeout to report a timeout.
50
36template <class _Poll, class _Backoff>51template <class _Poll, class _Backoff>
37_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool __libcpp_thread_poll_with_backoff(52_LIBCPP_HIDE_FROM_ABI __poll_with_backoff_results __libcpp_thread_poll_with_backoff(
38 _Poll&& __poll, _Backoff&& __backoff, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) {53 _Poll&& __poll, _Backoff&& __backoff, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) {
39 auto const __start = chrono::high_resolution_clock::now();54 auto const __start = chrono::high_resolution_clock::now();
40 for (int __count = 0;;) {55 for (int __count = 0;;) {
41 if (__poll())56 if (__poll())
42 return true; // __poll completion means success57 return __poll_with_backoff_results::__poll_success;
43 if (__count < __libcpp_polling_count) {58 if (__count < __libcpp_polling_count) {
44 __count += 1;59 __count += 1;
45 continue;60 continue;
46 }61 }
47 chrono::nanoseconds const __elapsed = chrono::high_resolution_clock::now() - __start;62 chrono::nanoseconds const __elapsed = chrono::high_resolution_clock::now() - __start;
48 if (__max_elapsed != chrono::nanoseconds::zero() && __max_elapsed < __elapsed)63 if (__max_elapsed != chrono::nanoseconds::zero() && __max_elapsed < __elapsed)
49 return false; // timeout failure64 return __poll_with_backoff_results::__timeout;
50 if (__backoff(__elapsed))65 if (auto __backoff_res = __backoff(__elapsed); __backoff_res == __backoff_results::__continue_poll)
51 return false; // __backoff completion means failure66 continue;
67 else
68 return static_cast<__poll_with_backoff_results>(__backoff_res);
52 }69 }
53}70}
5471
...@@ -59,7 +76,9 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool __libcpp_thread_poll_with_b...@@ -59,7 +76,9 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool __libcpp_thread_poll_with_b
59// so this should most likely only be used on single-threaded systems where there76// so this should most likely only be used on single-threaded systems where there
60// are no other threads to compete with.77// are no other threads to compete with.
61struct __spinning_backoff_policy {78struct __spinning_backoff_policy {
62 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator()(chrono::nanoseconds const&) const { return false; }79 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __backoff_results operator()(chrono::nanoseconds const&) const {
80 return __backoff_results::__continue_poll;
81 }
63};82};
6483
65_LIBCPP_END_NAMESPACE_STD84_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__thread/support/c11.h+8-8
...@@ -39,17 +39,17 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursiv...@@ -39,17 +39,17 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursiv
39 return mtx_init(__m, mtx_plain | mtx_recursive) == thrd_success ? 0 : EINVAL;39 return mtx_init(__m, mtx_plain | mtx_recursive) == thrd_success ? 0 : EINVAL;
40}40}
4141
42inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int42_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
43__libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t* __m) {43__libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t* __m) {
44 return mtx_lock(__m) == thrd_success ? 0 : EINVAL;44 return mtx_lock(__m) == thrd_success ? 0 : EINVAL;
45}45}
4646
47inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool47_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI bool
48__libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m) {48__libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m) {
49 return mtx_trylock(__m) == thrd_success;49 return mtx_trylock(__m) == thrd_success;
50}50}
5151
52inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int52_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
53__libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t* __m) {53__libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t* __m) {
54 return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;54 return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;
55}55}
...@@ -59,15 +59,15 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_destroy(__libcpp_recur...@@ -59,15 +59,15 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_destroy(__libcpp_recur
59 return 0;59 return 0;
60}60}
6161
62inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_lock(__libcpp_mutex_t* __m) {62_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int __libcpp_mutex_lock(__libcpp_mutex_t* __m) {
63 return mtx_lock(__m) == thrd_success ? 0 : EINVAL;63 return mtx_lock(__m) == thrd_success ? 0 : EINVAL;
64}64}
6565
66inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool __libcpp_mutex_trylock(__libcpp_mutex_t* __m) {66_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI bool __libcpp_mutex_trylock(__libcpp_mutex_t* __m) {
67 return mtx_trylock(__m) == thrd_success;67 return mtx_trylock(__m) == thrd_success;
68}68}
6969
70inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_unlock(__libcpp_mutex_t* __m) {70_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int __libcpp_mutex_unlock(__libcpp_mutex_t* __m) {
71 return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;71 return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;
72}72}
7373
...@@ -92,12 +92,12 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_condvar_broadcast(__libcpp_condvar_t*...@@ -92,12 +92,12 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_condvar_broadcast(__libcpp_condvar_t*
92 return cnd_broadcast(__cv) == thrd_success ? 0 : EINVAL;92 return cnd_broadcast(__cv) == thrd_success ? 0 : EINVAL;
93}93}
9494
95inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int95_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
96__libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m) {96__libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m) {
97 return cnd_wait(__cv, __m) == thrd_success ? 0 : EINVAL;97 return cnd_wait(__cv, __m) == thrd_success ? 0 : EINVAL;
98}98}
9999
100inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int100_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
101__libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, timespec* __ts) {101__libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, timespec* __ts) {
102 int __ec = cnd_timedwait(__cv, __m, __ts);102 int __ec = cnd_timedwait(__cv, __m, __ts);
103 return __ec == thrd_timedout ? ETIMEDOUT : __ec;103 return __ec == thrd_timedout ? ETIMEDOUT : __ec;
lib/libcxx/include/__thread/support/pthread.h+8-8
...@@ -72,17 +72,17 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursiv...@@ -72,17 +72,17 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursiv
72 return 0;72 return 0;
73}73}
7474
75inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int75_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
76__libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t* __m) {76__libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t* __m) {
77 return pthread_mutex_lock(__m);77 return pthread_mutex_lock(__m);
78}78}
7979
80inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool80_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI bool
81__libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m) {81__libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m) {
82 return pthread_mutex_trylock(__m) == 0;82 return pthread_mutex_trylock(__m) == 0;
83}83}
8484
85inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int85_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
86__libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t* __m) {86__libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t* __m) {
87 return pthread_mutex_unlock(__m);87 return pthread_mutex_unlock(__m);
88}88}
...@@ -91,15 +91,15 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_destroy(__libcpp_recur...@@ -91,15 +91,15 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_recursive_mutex_destroy(__libcpp_recur
91 return pthread_mutex_destroy(__m);91 return pthread_mutex_destroy(__m);
92}92}
9393
94inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_lock(__libcpp_mutex_t* __m) {94_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int __libcpp_mutex_lock(__libcpp_mutex_t* __m) {
95 return pthread_mutex_lock(__m);95 return pthread_mutex_lock(__m);
96}96}
9797
98inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool __libcpp_mutex_trylock(__libcpp_mutex_t* __m) {98_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI bool __libcpp_mutex_trylock(__libcpp_mutex_t* __m) {
99 return pthread_mutex_trylock(__m) == 0;99 return pthread_mutex_trylock(__m) == 0;
100}100}
101101
102inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_unlock(__libcpp_mutex_t* __m) {102_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int __libcpp_mutex_unlock(__libcpp_mutex_t* __m) {
103 return pthread_mutex_unlock(__m);103 return pthread_mutex_unlock(__m);
104}104}
105105
...@@ -117,12 +117,12 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_condvar_broadcast(__libcpp_condvar_t*...@@ -117,12 +117,12 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_condvar_broadcast(__libcpp_condvar_t*
117 return pthread_cond_broadcast(__cv);117 return pthread_cond_broadcast(__cv);
118}118}
119119
120inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int120_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
121__libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m) {121__libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m) {
122 return pthread_cond_wait(__cv, __m);122 return pthread_cond_wait(__cv, __m);
123}123}
124124
125inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int125_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI int
126__libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, __libcpp_timespec_t* __ts) {126__libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, __libcpp_timespec_t* __ts) {
127 return pthread_cond_timedwait(__cv, __m, __ts);127 return pthread_cond_timedwait(__cv, __m, __ts);
128}128}
lib/libcxx/include/__thread/support/windows.h+8-8
...@@ -36,22 +36,22 @@ typedef void* __libcpp_recursive_mutex_t[6];...@@ -36,22 +36,22 @@ typedef void* __libcpp_recursive_mutex_t[6];
3636
37_LIBCPP_EXPORTED_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t* __m);37_LIBCPP_EXPORTED_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t* __m);
3838
39_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int39_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI int
40__libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t* __m);40__libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t* __m);
4141
42_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool42_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI bool
43__libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m);43__libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m);
4444
45_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int45_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI int
46__libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t* __m);46__libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t* __m);
4747
48_LIBCPP_EXPORTED_FROM_ABI int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t* __m);48_LIBCPP_EXPORTED_FROM_ABI int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t* __m);
4949
50_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_lock(__libcpp_mutex_t* __m);50_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI int __libcpp_mutex_lock(__libcpp_mutex_t* __m);
5151
52_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool __libcpp_mutex_trylock(__libcpp_mutex_t* __m);52_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI bool __libcpp_mutex_trylock(__libcpp_mutex_t* __m);
5353
54_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_unlock(__libcpp_mutex_t* __m);54_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI int __libcpp_mutex_unlock(__libcpp_mutex_t* __m);
5555
56_LIBCPP_EXPORTED_FROM_ABI int __libcpp_mutex_destroy(__libcpp_mutex_t* __m);56_LIBCPP_EXPORTED_FROM_ABI int __libcpp_mutex_destroy(__libcpp_mutex_t* __m);
5757
...@@ -65,10 +65,10 @@ _LIBCPP_EXPORTED_FROM_ABI int __libcpp_condvar_signal(__libcpp_condvar_t* __cv);...@@ -65,10 +65,10 @@ _LIBCPP_EXPORTED_FROM_ABI int __libcpp_condvar_signal(__libcpp_condvar_t* __cv);
6565
66_LIBCPP_EXPORTED_FROM_ABI int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv);66_LIBCPP_EXPORTED_FROM_ABI int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv);
6767
68_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int68_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI int
69__libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m);69__libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m);
7070
71_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_NO_THREAD_SAFETY_ANALYSIS int71_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_EXPORTED_FROM_ABI int
72__libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, __libcpp_timespec_t* __ts);72__libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, __libcpp_timespec_t* __ts);
7373
74_LIBCPP_EXPORTED_FROM_ABI int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);74_LIBCPP_EXPORTED_FROM_ABI int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);
lib/libcxx/include/__thread/thread.h+13-8
...@@ -25,6 +25,8 @@...@@ -25,6 +25,8 @@
25#include <__thread/support.h>25#include <__thread/support.h>
26#include <__type_traits/decay.h>26#include <__type_traits/decay.h>
27#include <__type_traits/enable_if.h>27#include <__type_traits/enable_if.h>
28#include <__type_traits/invoke.h>
29#include <__type_traits/is_constructible.h>
28#include <__type_traits/is_same.h>30#include <__type_traits/is_same.h>
29#include <__type_traits/remove_cvref.h>31#include <__type_traits/remove_cvref.h>
30#include <__utility/forward.h>32#include <__utility/forward.h>
...@@ -155,8 +157,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {...@@ -155,8 +157,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {
155# ifndef _LIBCPP_CXX03_LANG157# ifndef _LIBCPP_CXX03_LANG
156158
157template <class _TSp, class _Fp, class... _Args, size_t... _Indices>159template <class _TSp, class _Fp, class... _Args, size_t... _Indices>
158inline _LIBCPP_HIDE_FROM_ABI void __thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>) {160inline _LIBCPP_HIDE_FROM_ABI void __thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __index_sequence<_Indices...>) {
159 std::__invoke(std::move(std::get<1>(__t)), std::move(std::get<_Indices>(__t))...);161 std::__invoke(std::move(std::get<_Indices + 1>(__t))...);
160}162}
161163
162template <class _Fp>164template <class _Fp>
...@@ -164,8 +166,7 @@ _LIBCPP_HIDE_FROM_ABI void* __thread_proxy(void* __vp) {...@@ -164,8 +166,7 @@ _LIBCPP_HIDE_FROM_ABI void* __thread_proxy(void* __vp) {
164 // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>166 // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
165 unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));167 unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
166 __thread_local_data().set_pointer(std::get<0>(*__p.get()).release());168 __thread_local_data().set_pointer(std::get<0>(*__p.get()).release());
167 typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;169 std::__thread_execute(*__p.get(), __make_index_sequence<tuple_size<_Fp>::value - 1>());
168 std::__thread_execute(*__p.get(), _Index());
169 return nullptr;170 return nullptr;
170}171}
171172
...@@ -206,6 +207,10 @@ public:...@@ -206,6 +207,10 @@ public:
206# ifndef _LIBCPP_CXX03_LANG207# ifndef _LIBCPP_CXX03_LANG
207 template <class _Fp, class... _Args, __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value, int> = 0>208 template <class _Fp, class... _Args, __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value, int> = 0>
208 _LIBCPP_HIDE_FROM_ABI explicit thread(_Fp&& __f, _Args&&... __args) {209 _LIBCPP_HIDE_FROM_ABI explicit thread(_Fp&& __f, _Args&&... __args) {
210 static_assert(is_constructible<__decay_t<_Fp>, _Fp>::value, "");
211 static_assert(_And<is_constructible<__decay_t<_Args>, _Args>...>::value, "");
212 static_assert(__is_invocable_v<__decay_t<_Fp>, __decay_t<_Args>...>, "");
213
209 typedef unique_ptr<__thread_struct> _TSPtr;214 typedef unique_ptr<__thread_struct> _TSPtr;
210 _TSPtr __tsp(new __thread_struct);215 _TSPtr __tsp(new __thread_struct);
211 typedef tuple<_TSPtr, __decay_t<_Fp>, __decay_t<_Args>...> _Gp;216 typedef tuple<_TSPtr, __decay_t<_Fp>, __decay_t<_Args>...> _Gp;
...@@ -243,13 +248,13 @@ public:...@@ -243,13 +248,13 @@ public:
243248
244 _LIBCPP_HIDE_FROM_ABI void swap(thread& __t) _NOEXCEPT { std::swap(__t_, __t.__t_); }249 _LIBCPP_HIDE_FROM_ABI void swap(thread& __t) _NOEXCEPT { std::swap(__t_, __t.__t_); }
245250
246 _LIBCPP_HIDE_FROM_ABI bool joinable() const _NOEXCEPT { return !__libcpp_thread_isnull(&__t_); }251 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool joinable() const _NOEXCEPT { return !__libcpp_thread_isnull(&__t_); }
247 void join();252 void join();
248 void detach();253 void detach();
249 _LIBCPP_HIDE_FROM_ABI id get_id() const _NOEXCEPT { return __libcpp_thread_get_id(&__t_); }254 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI id get_id() const _NOEXCEPT { return __libcpp_thread_get_id(&__t_); }
250 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() _NOEXCEPT { return __t_; }255 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() _NOEXCEPT { return __t_; }
251256
252 static unsigned hardware_concurrency() _NOEXCEPT;257 [[__nodiscard__]] static unsigned hardware_concurrency() _NOEXCEPT;
253};258};
254259
255inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x.swap(__y); }260inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x.swap(__y); }
lib/libcxx/include/__thread/timed_backoff_policy.h+3-2
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11#define _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H11#define _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H
1212
13#include <__config>13#include <__config>
14#include <__thread/poll_with_backoff.h>
1415
15#if _LIBCPP_HAS_THREADS16#if _LIBCPP_HAS_THREADS
1617
...@@ -24,7 +25,7 @@...@@ -24,7 +25,7 @@
24_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2526
26struct __libcpp_timed_backoff_policy {27struct __libcpp_timed_backoff_policy {
27 _LIBCPP_HIDE_FROM_ABI bool operator()(chrono::nanoseconds __elapsed) const {28 _LIBCPP_HIDE_FROM_ABI __backoff_results operator()(chrono::nanoseconds __elapsed) const {
28 if (__elapsed > chrono::milliseconds(128))29 if (__elapsed > chrono::milliseconds(128))
29 __libcpp_thread_sleep_for(chrono::milliseconds(8));30 __libcpp_thread_sleep_for(chrono::milliseconds(8));
30 else if (__elapsed > chrono::microseconds(64))31 else if (__elapsed > chrono::microseconds(64))
...@@ -33,7 +34,7 @@ struct __libcpp_timed_backoff_policy {...@@ -33,7 +34,7 @@ struct __libcpp_timed_backoff_policy {
33 __libcpp_thread_yield();34 __libcpp_thread_yield();
34 else {35 else {
35 } // poll36 } // poll
36 return false;37 return __backoff_results::__continue_poll;
37 }38 }
38};39};
3940
lib/libcxx/include/__tree+849-701
...@@ -11,37 +11,39 @@...@@ -11,37 +11,39 @@
11#define _LIBCPP___TREE11#define _LIBCPP___TREE
1212
13#include <__algorithm/min.h>13#include <__algorithm/min.h>
14#include <__algorithm/specialized_algorithms.h>
14#include <__assert>15#include <__assert>
15#include <__config>16#include <__config>
16#include <__fwd/map.h>
17#include <__fwd/pair.h>17#include <__fwd/pair.h>
18#include <__fwd/set.h>
19#include <__iterator/distance.h>18#include <__iterator/distance.h>
20#include <__iterator/iterator_traits.h>19#include <__iterator/iterator_traits.h>
21#include <__iterator/next.h>20#include <__iterator/next.h>
22#include <__memory/addressof.h>21#include <__memory/addressof.h>
23#include <__memory/allocator_traits.h>22#include <__memory/allocator_traits.h>
24#include <__memory/compressed_pair.h>23#include <__memory/compressed_pair.h>
24#include <__memory/construct_at.h>
25#include <__memory/pointer_traits.h>25#include <__memory/pointer_traits.h>
26#include <__memory/swap_allocator.h>26#include <__memory/swap_allocator.h>
27#include <__memory/unique_ptr.h>27#include <__memory/unique_ptr.h>
28#include <__type_traits/can_extract_key.h>28#include <__new/launder.h>
29#include <__type_traits/copy_cvref.h>29#include <__type_traits/copy_cvref.h>
30#include <__type_traits/enable_if.h>30#include <__type_traits/enable_if.h>
31#include <__type_traits/invoke.h>31#include <__type_traits/invoke.h>
32#include <__type_traits/is_const.h>
33#include <__type_traits/is_constructible.h>32#include <__type_traits/is_constructible.h>
34#include <__type_traits/is_nothrow_assignable.h>33#include <__type_traits/is_nothrow_assignable.h>
35#include <__type_traits/is_nothrow_constructible.h>34#include <__type_traits/is_nothrow_constructible.h>
36#include <__type_traits/is_same.h>35#include <__type_traits/is_same.h>
36#include <__type_traits/is_specialization.h>
37#include <__type_traits/is_swappable.h>37#include <__type_traits/is_swappable.h>
38#include <__type_traits/make_transparent.h>
38#include <__type_traits/remove_const.h>39#include <__type_traits/remove_const.h>
39#include <__type_traits/remove_const_ref.h>
40#include <__type_traits/remove_cvref.h>40#include <__type_traits/remove_cvref.h>
41#include <__utility/forward.h>41#include <__utility/forward.h>
42#include <__utility/lazy_synth_three_way_comparator.h>
42#include <__utility/move.h>43#include <__utility/move.h>
43#include <__utility/pair.h>44#include <__utility/pair.h>
44#include <__utility/swap.h>45#include <__utility/swap.h>
46#include <__utility/try_key_extraction.h>
45#include <limits>47#include <limits>
4648
47#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)49#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -51,14 +53,31 @@...@@ -51,14 +53,31 @@
51_LIBCPP_PUSH_MACROS53_LIBCPP_PUSH_MACROS
52#include <__undef_macros>54#include <__undef_macros>
5355
54_LIBCPP_BEGIN_NAMESPACE_STD56_LIBCPP_DIAGNOSTIC_PUSH
57// GCC complains about the backslashes at the end, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121528
58_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wcomment")
59// __tree is a red-black-tree implementation used for the associative containers (i.e. (multi)map/set). It stores
60// - (1) a pointer to the node with the smallest (i.e. leftmost) element, namely __begin_node_
61// - (2) the number of nodes in the tree, namely __size_
62// - (3) a pointer to the root of the tree, namely __end_node_
63//
64// Storing (1) and (2) is required to allow for constant time lookups. A tree looks like this in memory:
65//
66// __end_node_
67// |
68// root
69// / \
70// l1 r1
71// / \ / \
72// ... ... ... ...
73//
74// All nodes except __end_node_ have a __left_ and __right_ pointer as well as a __parent_ pointer.
75// __end_node_ only contains a __left_ pointer, which points to the root of the tree.
76// This layout allows for iteration through the tree without a need for special handling of the end node. See
77// __tree_next_iter and __tree_prev_iter for more details.
78_LIBCPP_DIAGNOSTIC_POP
5579
56template <class _Tp, class _Compare, class _Allocator>80_LIBCPP_BEGIN_NAMESPACE_STD
57class __tree;
58template <class _Tp, class _NodePtr, class _DiffType>
59class __tree_iterator;
60template <class _Tp, class _ConstNodePtr, class _DiffType>
61class __tree_const_iterator;
6281
63template <class _Pointer>82template <class _Pointer>
64class __tree_end_node;83class __tree_end_node;
...@@ -70,13 +89,6 @@ class __tree_node;...@@ -70,13 +89,6 @@ class __tree_node;
70template <class _Key, class _Value>89template <class _Key, class _Value>
71struct __value_type;90struct __value_type;
7291
73template <class _Allocator>
74class __map_node_destructor;
75template <class _TreeIterator>
76class __map_iterator;
77template <class _TreeIterator>
78class __map_const_iterator;
79
80/*92/*
8193
82_NodePtr algorithms94_NodePtr algorithms
...@@ -185,6 +197,11 @@ _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT {...@@ -185,6 +197,11 @@ _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT {
185 return __x->__parent_unsafe();197 return __x->__parent_unsafe();
186}198}
187199
200// __tree_next_iter and __tree_prev_iter implement iteration through the tree. The order is as follows:
201// left sub-tree -> node -> right sub-tree. When the right-most node of a sub-tree is reached, we walk up the tree until
202// we find a node where we were in the left sub-tree. We are _always_ in a left sub-tree, since the __end_node_ points
203// 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.
188template <class _EndNodePtr, class _NodePtr>205template <class _EndNodePtr, class _NodePtr>
189inline _LIBCPP_HIDE_FROM_ABI _EndNodePtr __tree_next_iter(_NodePtr __x) _NOEXCEPT {206inline _LIBCPP_HIDE_FROM_ABI _EndNodePtr __tree_next_iter(_NodePtr __x) _NOEXCEPT {
190 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");207 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
...@@ -494,16 +511,7 @@ _LIBCPP_HIDE_FROM_ABI void __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEP...@@ -494,16 +511,7 @@ _LIBCPP_HIDE_FROM_ABI void __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEP
494// node traits511// node traits
495512
496template <class _Tp>513template <class _Tp>
497struct __is_tree_value_type_imp : false_type {};514inline const bool __is_tree_value_type_v = __is_specialization_v<_Tp, __value_type>;
498
499template <class _Key, class _Value>
500struct __is_tree_value_type_imp<__value_type<_Key, _Value> > : true_type {};
501
502template <class... _Args>
503struct __is_tree_value_type : false_type {};
504
505template <class _One>
506struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__remove_cvref_t<_One> > {};
507515
508template <class _Tp>516template <class _Tp>
509struct __get_tree_key_type {517struct __get_tree_key_type {
...@@ -549,15 +557,14 @@ private:...@@ -549,15 +557,14 @@ private:
549template <class _Pointer>557template <class _Pointer>
550class __tree_end_node {558class __tree_end_node {
551public:559public:
552 typedef _Pointer pointer;560 using pointer = _Pointer;
553 pointer __left_;561 pointer __left_;
554562
555 _LIBCPP_HIDE_FROM_ABI __tree_end_node() _NOEXCEPT : __left_() {}563 _LIBCPP_HIDE_FROM_ABI __tree_end_node() _NOEXCEPT : __left_() {}
556};564};
557565
558template <class _VoidPtr>566template <class _VoidPtr>
559class _LIBCPP_STANDALONE_DEBUG567class __tree_node_base : public __tree_end_node<__rebind_pointer_t<_VoidPtr, __tree_node_base<_VoidPtr> > > {
560__tree_node_base : public __tree_end_node<__rebind_pointer_t<_VoidPtr, __tree_node_base<_VoidPtr> > > {
561public:568public:
562 using pointer = __rebind_pointer_t<_VoidPtr, __tree_node_base>;569 using pointer = __rebind_pointer_t<_VoidPtr, __tree_node_base>;
563 using __end_node_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<_VoidPtr, __tree_end_node<pointer> >;570 using __end_node_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<_VoidPtr, __tree_end_node<pointer> >;
...@@ -570,20 +577,41 @@ public:...@@ -570,20 +577,41 @@ public:
570577
571 _LIBCPP_HIDE_FROM_ABI void __set_parent(pointer __p) { __parent_ = static_cast<__end_node_pointer>(__p); }578 _LIBCPP_HIDE_FROM_ABI void __set_parent(pointer __p) { __parent_ = static_cast<__end_node_pointer>(__p); }
572579
573 ~__tree_node_base() = delete;580 _LIBCPP_HIDE_FROM_ABI __tree_node_base() = default;
574 __tree_node_base(__tree_node_base const&) = delete;581 __tree_node_base(__tree_node_base const&) = delete;
575 __tree_node_base& operator=(__tree_node_base const&) = delete;582 __tree_node_base& operator=(__tree_node_base const&) = delete;
576};583};
577584
578template <class _Tp, class _VoidPtr>585template <class _Tp, class _VoidPtr>
579class _LIBCPP_STANDALONE_DEBUG __tree_node : public __tree_node_base<_VoidPtr> {586class __tree_node : public __tree_node_base<_VoidPtr> {
580public:587public:
581 using __node_value_type _LIBCPP_NODEBUG = __get_node_value_type_t<_Tp>;588 using __node_value_type _LIBCPP_NODEBUG = __get_node_value_type_t<_Tp>;
582589
583 __node_value_type __value_;590// We use a union to avoid initialization during member initialization, which allows us
591// to use the allocator from the container to construct the `__node_value_type` in the
592// memory provided by the union member
593#ifndef _LIBCPP_CXX03_LANG
594
595private:
596 union {
597 __node_value_type __value_;
598 };
584599
600public:
585 _LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value() { return __value_; }601 _LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value() { return __value_; }
602#else
603
604private:
605 _ALIGNAS_TYPE(__node_value_type) unsigned char __buffer_[sizeof(__node_value_type)];
606
607public:
608 _LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value() { return *reinterpret_cast<__node_value_type*>(__buffer_); }
609#endif
586610
611 template <class _Alloc, class... _Args>
612 _LIBCPP_HIDE_FROM_ABI explicit __tree_node(_Alloc& __na, _Args&&... __args) {
613 allocator_traits<_Alloc>::construct(__na, std::addressof(__get_value()), std::forward<_Args>(__args)...);
614 }
587 ~__tree_node() = delete;615 ~__tree_node() = delete;
588 __tree_node(__tree_node const&) = delete;616 __tree_node(__tree_node const&) = delete;
589 __tree_node& operator=(__tree_node const&) = delete;617 __tree_node& operator=(__tree_node const&) = delete;
...@@ -591,11 +619,11 @@ public:...@@ -591,11 +619,11 @@ public:
591619
592template <class _Allocator>620template <class _Allocator>
593class __tree_node_destructor {621class __tree_node_destructor {
594 typedef _Allocator allocator_type;622 using allocator_type = _Allocator;
595 typedef allocator_traits<allocator_type> __alloc_traits;623 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
596624
597public:625public:
598 typedef typename __alloc_traits::pointer pointer;626 using pointer = typename __alloc_traits::pointer;
599627
600private:628private:
601 allocator_type& __na_;629 allocator_type& __na_;
...@@ -612,7 +640,7 @@ public:...@@ -612,7 +640,7 @@ public:
612640
613 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {641 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {
614 if (__value_constructed)642 if (__value_constructed)
615 __alloc_traits::destroy(__na_, std::addressof(__p->__value_));643 __alloc_traits::destroy(__na_, std::addressof(__p->__get_value()));
616 if (__p)644 if (__p)
617 __alloc_traits::deallocate(__na_, __p, 1);645 __alloc_traits::deallocate(__na_, __p, 1);
618 }646 }
...@@ -630,12 +658,60 @@ struct __generic_container_node_destructor<__tree_node<_Tp, _VoidPtr>, _Alloc> :...@@ -630,12 +658,60 @@ struct __generic_container_node_destructor<__tree_node<_Tp, _VoidPtr>, _Alloc> :
630};658};
631#endif659#endif
632660
661// Do an in-order traversal of the tree until `__break` returns true. Takes the root node of the tree.
662template <class _Reference, class _Break, class _NodePtr, class _Func, class _Proj>
663#ifndef _LIBCPP_COMPILER_GCC // This function is recursive, so GCC complains about always_inline.
664_LIBCPP_HIDE_FROM_ABI
665#endif
666bool __tree_iterate_from_root(_Break __break, _NodePtr __root, _Func& __func, _Proj& __proj) {
667 if (__root->__left_) {
668 if (std::__tree_iterate_from_root<_Reference>(__break, static_cast<_NodePtr>(__root->__left_), __func, __proj))
669 return true;
670 }
671 if (__break(__root))
672 return true;
673 std::__invoke(__func, std::__invoke(__proj, static_cast<_Reference>(__root->__get_value())));
674 if (__root->__right_)
675 return std::__tree_iterate_from_root<_Reference>(__break, static_cast<_NodePtr>(__root->__right_), __func, __proj);
676 return false;
677}
678
679// Do an in-order traversal of the tree from __first to __last.
680template <class _NodeIter, class _Func, class _Proj>
681_LIBCPP_HIDE_FROM_ABI void
682__tree_iterate_subrange(_NodeIter __first_it, _NodeIter __last_it, _Func& __func, _Proj& __proj) {
683 using _NodePtr = typename _NodeIter::__node_pointer;
684 using _Reference = typename _NodeIter::reference;
685
686 auto __first = __first_it.__ptr_;
687 auto __last = __last_it.__ptr_;
688
689 while (true) {
690 if (__first == __last)
691 return;
692 const auto __nfirst = static_cast<_NodePtr>(__first);
693 std::__invoke(__func, std::__invoke(__proj, static_cast<_Reference>(__nfirst->__get_value())));
694 if (__nfirst->__right_) {
695 if (std::__tree_iterate_from_root<_Reference>(
696 [&](_NodePtr __node) -> bool { return __node == __last; },
697 static_cast<_NodePtr>(__nfirst->__right_),
698 __func,
699 __proj))
700 return;
701 }
702 while (!std::__tree_is_left_child(static_cast<_NodePtr>(__first)))
703 __first = static_cast<_NodePtr>(__first)->__parent_;
704 __first = static_cast<_NodePtr>(__first)->__parent_;
705 }
706}
707
633template <class _Tp, class _NodePtr, class _DiffType>708template <class _Tp, class _NodePtr, class _DiffType>
634class __tree_iterator {709class __tree_iterator {
635 typedef __tree_node_types<_NodePtr> _NodeTypes;710 using _NodeTypes _LIBCPP_NODEBUG = __tree_node_types<_NodePtr>;
636 typedef _NodePtr __node_pointer;711 // NOLINTNEXTLINE(libcpp-nodebug-on-aliases) lldb relies on this alias for pretty printing
637 typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;712 using __node_pointer = _NodePtr;
638 typedef typename _NodeTypes::__end_node_pointer __end_node_pointer;713 using __node_base_pointer _LIBCPP_NODEBUG = typename _NodeTypes::__node_base_pointer;
714 using __end_node_pointer _LIBCPP_NODEBUG = typename _NodeTypes::__end_node_pointer;
639715
640 __end_node_pointer __ptr_;716 __end_node_pointer __ptr_;
641717
...@@ -646,15 +722,12 @@ public:...@@ -646,15 +722,12 @@ public:
646 using reference = value_type&;722 using reference = value_type&;
647 using pointer = __rebind_pointer_t<_NodePtr, value_type>;723 using pointer = __rebind_pointer_t<_NodePtr, value_type>;
648724
649 _LIBCPP_HIDE_FROM_ABI __tree_iterator() _NOEXCEPT725 _LIBCPP_HIDE_FROM_ABI __tree_iterator() _NOEXCEPT : __ptr_(nullptr) {}
650#if _LIBCPP_STD_VER >= 14
651 : __ptr_(nullptr)
652#endif
653 {
654 }
655726
656 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__value_; }727 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__get_value(); }
657 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return pointer_traits<pointer>::pointer_to(__get_np()->__value_); }728 _LIBCPP_HIDE_FROM_ABI pointer operator->() const {
729 return pointer_traits<pointer>::pointer_to(__get_np()->__get_value());
730 }
658731
659 _LIBCPP_HIDE_FROM_ABI __tree_iterator& operator++() {732 _LIBCPP_HIDE_FROM_ABI __tree_iterator& operator++() {
660 __ptr_ = std::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_));733 __ptr_ = std::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_));
...@@ -691,50 +764,54 @@ private:...@@ -691,50 +764,54 @@ private:
691 friend class __tree;764 friend class __tree;
692 template <class, class, class>765 template <class, class, class>
693 friend class __tree_const_iterator;766 friend class __tree_const_iterator;
694 template <class>767
695 friend class __map_iterator;768 template <class _NodeIter, class _Func, class _Proj>
696 template <class, class, class, class>769 friend void __tree_iterate_subrange(_NodeIter, _NodeIter, _Func&, _Proj&);
697 friend class map;770};
698 template <class, class, class, class>771
699 friend class multimap;772#ifndef _LIBCPP_CXX03_LANG
700 template <class, class, class>773// This also handles {multi,}set::iterator, since they're just aliases to __tree::iterator
701 friend class set;774template <class _Tp, class _NodePtr, class _DiffType>
702 template <class, class, class>775struct __specialized_algorithm<
703 friend class multiset;776 _Algorithm::__for_each,
777 __iterator_pair<__tree_iterator<_Tp, _NodePtr, _DiffType>, __tree_iterator<_Tp, _NodePtr, _DiffType>>> {
778 static const bool __has_algorithm = true;
779
780 using __iterator _LIBCPP_NODEBUG = __tree_iterator<_Tp, _NodePtr, _DiffType>;
781
782 template <class _Func, class _Proj>
783 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Func& __func, _Proj& __proj) {
784 std::__tree_iterate_subrange(__first, __last, __func, __proj);
785 }
704};786};
787#endif
705788
706template <class _Tp, class _NodePtr, class _DiffType>789template <class _Tp, class _NodePtr, class _DiffType>
707class __tree_const_iterator {790class __tree_const_iterator {
708 typedef __tree_node_types<_NodePtr> _NodeTypes;791 using _NodeTypes _LIBCPP_NODEBUG = __tree_node_types<_NodePtr>;
709 // NOLINTNEXTLINE(libcpp-nodebug-on-aliases) lldb relies on this alias for pretty printing792 // NOLINTNEXTLINE(libcpp-nodebug-on-aliases) lldb relies on this alias for pretty printing
710 using __node_pointer = _NodePtr;793 using __node_pointer = _NodePtr;
711 typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;794 using __node_base_pointer _LIBCPP_NODEBUG = typename _NodeTypes::__node_base_pointer;
712 typedef typename _NodeTypes::__end_node_pointer __end_node_pointer;795 using __end_node_pointer _LIBCPP_NODEBUG = typename _NodeTypes::__end_node_pointer;
713796
714 __end_node_pointer __ptr_;797 __end_node_pointer __ptr_;
715798
716public:799public:
717 using iterator_category = bidirectional_iterator_tag;800 using iterator_category = bidirectional_iterator_tag;
718 using value_type = __get_node_value_type_t<_Tp>;801 using value_type = __get_node_value_type_t<_Tp>;
719 using difference_type = _DiffType;802 using difference_type = _DiffType;
720 using reference = const value_type&;803 using reference = const value_type&;
721 using pointer = __rebind_pointer_t<_NodePtr, const value_type>;804 using pointer = __rebind_pointer_t<_NodePtr, const value_type>;
805 using __non_const_iterator _LIBCPP_NODEBUG = __tree_iterator<_Tp, __node_pointer, difference_type>;
722806
723 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator() _NOEXCEPT807 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator() _NOEXCEPT : __ptr_(nullptr) {}
724#if _LIBCPP_STD_VER >= 14
725 : __ptr_(nullptr)
726#endif
727 {
728 }
729
730private:
731 typedef __tree_iterator<_Tp, __node_pointer, difference_type> __non_const_iterator;
732808
733public:
734 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}809 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}
735810
736 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__value_; }811 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__get_value(); }
737 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return pointer_traits<pointer>::pointer_to(__get_np()->__value_); }812 _LIBCPP_HIDE_FROM_ABI pointer operator->() const {
813 return pointer_traits<pointer>::pointer_to(__get_np()->__get_value());
814 }
738815
739 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator& operator++() {816 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator& operator++() {
740 __ptr_ = std::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_));817 __ptr_ = std::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_));
...@@ -772,18 +849,28 @@ private:...@@ -772,18 +849,28 @@ private:
772849
773 template <class, class, class>850 template <class, class, class>
774 friend class __tree;851 friend class __tree;
775 template <class, class, class, class>852
776 friend class map;853 template <class _NodeIter, class _Func, class _Proj>
777 template <class, class, class, class>854 friend void __tree_iterate_subrange(_NodeIter, _NodeIter, _Func&, _Proj&);
778 friend class multimap;
779 template <class, class, class>
780 friend class set;
781 template <class, class, class>
782 friend class multiset;
783 template <class>
784 friend class __map_const_iterator;
785};855};
786856
857#ifndef _LIBCPP_CXX03_LANG
858// This also handles {multi,}set::const_iterator, since they're just aliases to __tree::iterator
859template <class _Tp, class _NodePtr, class _DiffType>
860struct __specialized_algorithm<
861 _Algorithm::__for_each,
862 __iterator_pair<__tree_const_iterator<_Tp, _NodePtr, _DiffType>, __tree_const_iterator<_Tp, _NodePtr, _DiffType>>> {
863 static const bool __has_algorithm = true;
864
865 using __iterator _LIBCPP_NODEBUG = __tree_const_iterator<_Tp, _NodePtr, _DiffType>;
866
867 template <class _Func, class _Proj>
868 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Func& __func, _Proj& __proj) {
869 std::__tree_iterate_subrange(__first, __last, __func, __proj);
870 }
871};
872#endif
873
787template <class _Tp, class _Compare>874template <class _Tp, class _Compare>
788#ifndef _LIBCPP_CXX03_LANG875#ifndef _LIBCPP_CXX03_LANG
789_LIBCPP_DIAGNOSE_WARNING(!__is_invocable_v<_Compare const&, _Tp const&, _Tp const&>,876_LIBCPP_DIAGNOSE_WARNING(!__is_invocable_v<_Compare const&, _Tp const&, _Tp const&>,
...@@ -794,21 +881,20 @@ int __diagnose_non_const_comparator();...@@ -794,21 +881,20 @@ int __diagnose_non_const_comparator();
794template <class _Tp, class _Compare, class _Allocator>881template <class _Tp, class _Compare, class _Allocator>
795class __tree {882class __tree {
796public:883public:
797 using value_type = __get_node_value_type_t<_Tp>;884 using value_type = __get_node_value_type_t<_Tp>;
798 typedef _Compare value_compare;885 using value_compare = _Compare;
799 typedef _Allocator allocator_type;886 using allocator_type = _Allocator;
800887
801private:888private:
802 typedef allocator_traits<allocator_type> __alloc_traits;889 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
803 using key_type = __get_tree_key_type_t<_Tp>;890 using key_type = __get_tree_key_type_t<_Tp>;
804891
805public:892public:
806 typedef typename __alloc_traits::pointer pointer;893 using pointer = typename __alloc_traits::pointer;
807 typedef typename __alloc_traits::const_pointer const_pointer;894 using const_pointer = typename __alloc_traits::const_pointer;
808 typedef typename __alloc_traits::size_type size_type;895 using size_type = typename __alloc_traits::size_type;
809 typedef typename __alloc_traits::difference_type difference_type;896 using difference_type = typename __alloc_traits::difference_type;
810897
811public:
812 using __void_pointer _LIBCPP_NODEBUG = typename __alloc_traits::void_pointer;898 using __void_pointer _LIBCPP_NODEBUG = typename __alloc_traits::void_pointer;
813899
814 using __node _LIBCPP_NODEBUG = __tree_node<_Tp, __void_pointer>;900 using __node _LIBCPP_NODEBUG = __tree_node<_Tp, __void_pointer>;
...@@ -821,22 +907,8 @@ public:...@@ -821,22 +907,8 @@ public:
821 using __end_node_t _LIBCPP_NODEBUG = __tree_end_node<__node_base_pointer>;907 using __end_node_t _LIBCPP_NODEBUG = __tree_end_node<__node_base_pointer>;
822 using __end_node_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<__void_pointer, __end_node_t>;908 using __end_node_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<__void_pointer, __end_node_t>;
823909
824 using __parent_pointer _LIBCPP_NODEBUG = __end_node_pointer; // TODO: Remove this once the uses in <map> are removed910 using __node_allocator _LIBCPP_NODEBUG = __rebind_alloc<__alloc_traits, __node>;
825911 using __node_traits _LIBCPP_NODEBUG = allocator_traits<__node_allocator>;
826 typedef __rebind_alloc<__alloc_traits, __node> __node_allocator;
827 typedef allocator_traits<__node_allocator> __node_traits;
828
829// TODO(LLVM 22): Remove this check
830#ifndef _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
831 static_assert(sizeof(__node_base_pointer) == sizeof(__end_node_pointer) && _LIBCPP_ALIGNOF(__node_base_pointer) ==
832 _LIBCPP_ALIGNOF(__end_node_pointer),
833 "It looks like you are using std::__tree (an implementation detail for (multi)map/set) with a fancy "
834 "pointer type that thas a different representation depending on whether it points to a __tree base "
835 "pointer or a __tree node pointer (both of which are implementation details of the standard library). "
836 "This means that your ABI is being broken between LLVM 19 and LLVM 20. If you don't care about your "
837 "ABI being broken, define the _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB macro to silence this "
838 "diagnostic.");
839#endif
840912
841private:913private:
842 // check for sane allocator pointer rebinding semantics. Rebinding the914 // check for sane allocator pointer rebinding semantics. Rebinding the
...@@ -844,8 +916,8 @@ private:...@@ -844,8 +916,8 @@ private:
844 // the pointer using 'pointer_traits'.916 // the pointer using 'pointer_traits'.
845 static_assert(is_same<__node_pointer, typename __node_traits::pointer>::value,917 static_assert(is_same<__node_pointer, typename __node_traits::pointer>::value,
846 "Allocator does not rebind pointers in a sane manner.");918 "Allocator does not rebind pointers in a sane manner.");
847 typedef __rebind_alloc<__node_traits, __node_base> __node_base_allocator;919 using __node_base_allocator _LIBCPP_NODEBUG = __rebind_alloc<__node_traits, __node_base>;
848 typedef allocator_traits<__node_base_allocator> __node_base_traits;920 using __node_base_traits _LIBCPP_NODEBUG = allocator_traits<__node_base_allocator>;
849 static_assert(is_same<__node_base_pointer, typename __node_base_traits::pointer>::value,921 static_assert(is_same<__node_base_pointer, typename __node_base_traits::pointer>::value,
850 "Allocator does not rebind pointers in a sane manner.");922 "Allocator does not rebind pointers in a sane manner.");
851923
...@@ -865,17 +937,11 @@ public:...@@ -865,17 +937,11 @@ public:
865937
866private:938private:
867 _LIBCPP_HIDE_FROM_ABI const __node_allocator& __node_alloc() const _NOEXCEPT { return __node_alloc_; }939 _LIBCPP_HIDE_FROM_ABI const __node_allocator& __node_alloc() const _NOEXCEPT { return __node_alloc_; }
868 _LIBCPP_HIDE_FROM_ABI __end_node_pointer& __begin_node() _NOEXCEPT { return __begin_node_; }
869 _LIBCPP_HIDE_FROM_ABI const __end_node_pointer& __begin_node() const _NOEXCEPT { return __begin_node_; }
870940
871public:941public:
872 _LIBCPP_HIDE_FROM_ABI allocator_type __alloc() const _NOEXCEPT { return allocator_type(__node_alloc()); }942 _LIBCPP_HIDE_FROM_ABI allocator_type __alloc() const _NOEXCEPT { return allocator_type(__node_alloc()); }
873943
874private:944 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }
875 _LIBCPP_HIDE_FROM_ABI size_type& size() _NOEXCEPT { return __size_; }
876
877public:
878 _LIBCPP_HIDE_FROM_ABI const size_type& size() const _NOEXCEPT { return __size_; }
879 _LIBCPP_HIDE_FROM_ABI value_compare& value_comp() _NOEXCEPT { return __value_comp_; }945 _LIBCPP_HIDE_FROM_ABI value_compare& value_comp() _NOEXCEPT { return __value_comp_; }
880 _LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT { return __value_comp_; }946 _LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT { return __value_comp_; }
881947
...@@ -888,32 +954,61 @@ public:...@@ -888,32 +954,61 @@ public:
888 return std::addressof(__end_node()->__left_);954 return std::addressof(__end_node()->__left_);
889 }955 }
890956
891 typedef __tree_iterator<_Tp, __node_pointer, difference_type> iterator;957 using iterator = __tree_iterator<_Tp, __node_pointer, difference_type>;
892 typedef __tree_const_iterator<_Tp, __node_pointer, difference_type> const_iterator;958 using const_iterator = __tree_const_iterator<_Tp, __node_pointer, difference_type>;
893959
894 _LIBCPP_HIDE_FROM_ABI explicit __tree(const value_compare& __comp) _NOEXCEPT_(960 _LIBCPP_HIDE_FROM_ABI explicit __tree(const value_compare& __comp) _NOEXCEPT_(
895 is_nothrow_default_constructible<__node_allocator>::value&& is_nothrow_copy_constructible<value_compare>::value);961 is_nothrow_default_constructible<__node_allocator>::value&& is_nothrow_copy_constructible<value_compare>::value)
896 _LIBCPP_HIDE_FROM_ABI explicit __tree(const allocator_type& __a);962 : __size_(0), __value_comp_(__comp) {
897 _LIBCPP_HIDE_FROM_ABI __tree(const value_compare& __comp, const allocator_type& __a);963 __begin_node_ = __end_node();
964 }
965
966 _LIBCPP_HIDE_FROM_ABI explicit __tree(const allocator_type& __a)
967 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {
968 __begin_node_ = __end_node();
969 }
970
971 _LIBCPP_HIDE_FROM_ABI __tree(const value_compare& __comp, const allocator_type& __a)
972 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(__comp) {
973 __begin_node_ = __end_node();
974 }
975
898 _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __t);976 _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __t);
977
978 _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __other, const allocator_type& __alloc)
979 : __begin_node_(__end_node()), __node_alloc_(__alloc), __size_(0), __value_comp_(__other.value_comp()) {
980 if (__other.size() == 0)
981 return;
982
983 *__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__other.__root()));
984 __root()->__parent_ = __end_node();
985 __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
986 __size_ = __other.size();
987 }
988
899 _LIBCPP_HIDE_FROM_ABI __tree& operator=(const __tree& __t);989 _LIBCPP_HIDE_FROM_ABI __tree& operator=(const __tree& __t);
900 template <class _ForwardIterator>990 template <class _ForwardIterator>
901 _LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);991 _LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
902 template <class _InputIterator>
903 _LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last);
904 _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(992 _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(
905 is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value);993 is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value);
906 _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a);994 _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a);
995
907 _LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t)996 _LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t)
908 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&997 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
909 ((__node_traits::propagate_on_container_move_assignment::value &&998 ((__node_traits::propagate_on_container_move_assignment::value &&
910 is_nothrow_move_assignable<__node_allocator>::value) ||999 is_nothrow_move_assignable<__node_allocator>::value) ||
911 allocator_traits<__node_allocator>::is_always_equal::value));1000 allocator_traits<__node_allocator>::is_always_equal::value)) {
1001 __move_assign(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
1002 return *this;
1003 }
9121004
913 _LIBCPP_HIDE_FROM_ABI ~__tree();1005 _LIBCPP_HIDE_FROM_ABI ~__tree() {
1006 static_assert(is_copy_constructible<value_compare>::value, "Comparator must be copy-constructible.");
1007 destroy(__root());
1008 }
9141009
915 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return iterator(__begin_node()); }1010 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return iterator(__begin_node_); }
916 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return const_iterator(__begin_node()); }1011 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return const_iterator(__begin_node_); }
917 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(__end_node()); }1012 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(__end_node()); }
918 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(__end_node()); }1013 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(__end_node()); }
9191014
...@@ -931,116 +1026,151 @@ public:...@@ -931,116 +1026,151 @@ public:
931 _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);1026 _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);
932#endif1027#endif
9331028
934 template <class _Key, class... _Args>
935 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args&&... __args);
936 template <class _Key, class... _Args>
937 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);
938
939 template <class... _Args>
940 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
941
942 template <class... _Args>
943 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args);
944
945 template <class... _Args>1029 template <class... _Args>
946 _LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args);1030 _LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args);
9471031
948 template <class... _Args>1032 template <class... _Args>
949 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);1033 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
9501034
951 template <class _Pp>
952 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Pp&& __x) {
953 return __emplace_unique_extract_key(std::forward<_Pp>(__x), __can_extract_key<_Pp, key_type>());
954 }
955
956 template <class _First,
957 class _Second,
958 __enable_if_t<__can_extract_map_key<_First, key_type, value_type>::value, int> = 0>
959 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_First&& __f, _Second&& __s) {
960 return __emplace_unique_key_args(__f, std::forward<_First>(__f), std::forward<_Second>(__s));
961 }
962
963 template <class... _Args>1035 template <class... _Args>
964 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {1036 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {
965 return __emplace_unique_impl(std::forward<_Args>(__args)...);1037 return std::__try_key_extraction<key_type>(
966 }1038 [this](const key_type& __key, _Args&&... __args2) {
9671039 auto [__parent, __child] = __find_equal(__key);
968 template <class _Pp>1040 __node_pointer __r = static_cast<__node_pointer>(__child);
969 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {1041 bool __inserted = false;
970 return __emplace_unique_impl(std::forward<_Pp>(__x));1042 if (__child == nullptr) {
971 }1043 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
9721044 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
973 template <class _Pp>1045 __r = __h.release();
974 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {1046 __inserted = true;
975 return __emplace_unique_key_args(__x, std::forward<_Pp>(__x));1047 }
976 }1048 return pair<iterator, bool>(iterator(__r), __inserted);
9771049 },
978 template <class _Pp>1050 [this](_Args&&... __args2) {
979 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {1051 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
980 return __emplace_unique_key_args(__x.first, std::forward<_Pp>(__x));1052 auto [__parent, __child] = __find_equal(__h->__get_value());
981 }1053 __node_pointer __r = static_cast<__node_pointer>(__child);
9821054 bool __inserted = false;
983 template <class _Pp>1055 if (__child == nullptr) {
984 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_unique(const_iterator __p, _Pp&& __x) {1056 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
985 return __emplace_hint_unique_extract_key(__p, std::forward<_Pp>(__x), __can_extract_key<_Pp, key_type>());1057 __r = __h.release();
986 }1058 __inserted = true;
9871059 }
988 template <class _First,1060 return pair<iterator, bool>(iterator(__r), __inserted);
989 class _Second,1061 },
990 __enable_if_t<__can_extract_map_key<_First, key_type, value_type>::value, int> = 0>1062 std::forward<_Args>(__args)...);
991 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {
992 return __emplace_hint_unique_key_args(__p, __f, std::forward<_First>(__f), std::forward<_Second>(__s)).first;
993 }1063 }
9941064
995 template <class... _Args>1065 template <class... _Args>
996 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_unique(const_iterator __p, _Args&&... __args) {1066 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_hint_unique(const_iterator __p, _Args&&... __args) {
997 return __emplace_hint_unique_impl(__p, std::forward<_Args>(__args)...);1067 return std::__try_key_extraction<key_type>(
1068 [this, __p](const key_type& __key, _Args&&... __args2) {
1069 __node_base_pointer __dummy;
1070 auto [__parent, __child] = __find_equal(__p, __dummy, __key);
1071 __node_pointer __r = static_cast<__node_pointer>(__child);
1072 bool __inserted = false;
1073 if (__child == nullptr) {
1074 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
1075 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1076 __r = __h.release();
1077 __inserted = true;
1078 }
1079 return pair<iterator, bool>(iterator(__r), __inserted);
1080 },
1081 [this, __p](_Args&&... __args2) {
1082 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
1083 __node_base_pointer __dummy;
1084 auto [__parent, __child] = __find_equal(__p, __dummy, __h->__get_value());
1085 __node_pointer __r = static_cast<__node_pointer>(__child);
1086 if (__child == nullptr) {
1087 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1088 __r = __h.release();
1089 }
1090 return pair<iterator, bool>(iterator(__r), __child == nullptr);
1091 },
1092 std::forward<_Args>(__args)...);
998 }1093 }
9991094
1000 template <class _Pp>1095 template <class _InIter, class _Sent>
1001 _LIBCPP_HIDE_FROM_ABI iterator1096 _LIBCPP_HIDE_FROM_ABI void __insert_range_multi(_InIter __first, _Sent __last) {
1002 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_fail_tag) {1097 if (__first == __last)
1003 return __emplace_hint_unique_impl(__p, std::forward<_Pp>(__x));1098 return;
1004 }
10051099
1006 template <class _Pp>1100 if (__root() == nullptr) { // Make sure we always have a root node
1007 _LIBCPP_HIDE_FROM_ABI iterator1101 __insert_node_at(
1008 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) {1102 __end_node(), __end_node()->__left_, static_cast<__node_base_pointer>(__construct_node(*__first).release()));
1009 return __emplace_hint_unique_key_args(__p, __x, std::forward<_Pp>(__x)).first;1103 ++__first;
1010 }1104 }
10111105
1012 template <class _Pp>1106 auto __max_node = static_cast<__node_pointer>(std::__tree_max(static_cast<__node_base_pointer>(__root())));
1013 _LIBCPP_HIDE_FROM_ABI iterator
1014 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) {
1015 return __emplace_hint_unique_key_args(__p, __x.first, std::forward<_Pp>(__x)).first;
1016 }
10171107
1018 template <class _ValueT = _Tp, __enable_if_t<__is_tree_value_type<_ValueT>::value, int> = 0>1108 for (; __first != __last; ++__first) {
1019 _LIBCPP_HIDE_FROM_ABI void1109 __node_holder __nd = __construct_node(*__first);
1020 __insert_unique_from_orphaned_node(const_iterator __p, __get_node_value_type_t<_Tp>&& __value) {1110 // Always check the max node first. This optimizes for sorted ranges inserted at the end.
1021 __emplace_hint_unique(__p, const_cast<key_type&&>(__value.first), std::move(__value.second));1111 if (!value_comp()(__nd->__get_value(), __max_node->__get_value())) { // __node >= __max_val
1112 __insert_node_at(static_cast<__end_node_pointer>(__max_node),
1113 __max_node->__right_,
1114 static_cast<__node_base_pointer>(__nd.get()));
1115 __max_node = __nd.release();
1116 } else {
1117 __end_node_pointer __parent;
1118 __node_base_pointer& __child = __find_leaf_high(__parent, __nd->__get_value());
1119 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));
1120 }
1121 }
1022 }1122 }
10231123
1024 template <class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type<_ValueT>::value, int> = 0>1124 template <class _InIter, class _Sent>
1025 _LIBCPP_HIDE_FROM_ABI void __insert_unique_from_orphaned_node(const_iterator __p, _Tp&& __value) {1125 _LIBCPP_HIDE_FROM_ABI void __insert_range_unique(_InIter __first, _Sent __last) {
1026 __emplace_hint_unique(__p, std::move(__value));1126 if (__first == __last)
1027 }1127 return;
10281128
1029 template <class _ValueT = _Tp, __enable_if_t<__is_tree_value_type<_ValueT>::value, int> = 0>1129 if (__root() == nullptr) {
1030 _LIBCPP_HIDE_FROM_ABI void __insert_multi_from_orphaned_node(const_iterator __p, value_type&& __value) {1130 __insert_node_at(
1031 __emplace_hint_multi(__p, const_cast<key_type&&>(__value.first), std::move(__value.second));1131 __end_node(), __end_node()->__left_, static_cast<__node_base_pointer>(__construct_node(*__first).release()));
1032 }1132 ++__first;
1133 }
10331134
1034 template <class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type<_ValueT>::value, int> = 0>1135 auto __max_node = static_cast<__node_pointer>(std::__tree_max(static_cast<__node_base_pointer>(__root())));
1035 _LIBCPP_HIDE_FROM_ABI void __insert_multi_from_orphaned_node(const_iterator __p, _Tp&& __value) {1136
1036 __emplace_hint_multi(__p, std::move(__value));1137 using __reference = decltype(*__first);
1138
1139 for (; __first != __last; ++__first) {
1140 std::__try_key_extraction<key_type>(
1141 [this, &__max_node](const key_type& __key, __reference&& __val) {
1142 if (value_comp()(__max_node->__get_value(), __key)) { // __key > __max_node
1143 __node_holder __nd = __construct_node(std::forward<__reference>(__val));
1144 __insert_node_at(static_cast<__end_node_pointer>(__max_node),
1145 __max_node->__right_,
1146 static_cast<__node_base_pointer>(__nd.get()));
1147 __max_node = __nd.release();
1148 } else {
1149 auto [__parent, __child] = __find_equal(__key);
1150 if (__child == nullptr) {
1151 __node_holder __nd = __construct_node(std::forward<__reference>(__val));
1152 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));
1153 }
1154 }
1155 },
1156 [this, &__max_node](__reference&& __val) {
1157 __node_holder __nd = __construct_node(std::forward<__reference>(__val));
1158 if (value_comp()(__max_node->__get_value(), __nd->__get_value())) { // __node > __max_node
1159 __insert_node_at(static_cast<__end_node_pointer>(__max_node),
1160 __max_node->__right_,
1161 static_cast<__node_base_pointer>(__nd.get()));
1162 __max_node = __nd.release();
1163 } else {
1164 auto [__parent, __child] = __find_equal(__nd->__get_value());
1165 if (__child == nullptr) {
1166 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));
1167 }
1168 }
1169 },
1170 *__first);
1171 }
1037 }1172 }
10381173
1039 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __node_assign_unique(const value_type& __v, __node_pointer __dest);
1040
1041 _LIBCPP_HIDE_FROM_ABI iterator __node_insert_multi(__node_pointer __nd);
1042 _LIBCPP_HIDE_FROM_ABI iterator __node_insert_multi(const_iterator __p, __node_pointer __nd);
1043
1044 _LIBCPP_HIDE_FROM_ABI iterator __remove_node_pointer(__node_pointer) _NOEXCEPT;1174 _LIBCPP_HIDE_FROM_ABI iterator __remove_node_pointer(__node_pointer) _NOEXCEPT;
10451175
1046#if _LIBCPP_STD_VER >= 171176#if _LIBCPP_STD_VER >= 17
...@@ -1048,15 +1178,15 @@ public:...@@ -1048,15 +1178,15 @@ public:
1048 _LIBCPP_HIDE_FROM_ABI _InsertReturnType __node_handle_insert_unique(_NodeHandle&&);1178 _LIBCPP_HIDE_FROM_ABI _InsertReturnType __node_handle_insert_unique(_NodeHandle&&);
1049 template <class _NodeHandle>1179 template <class _NodeHandle>
1050 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_unique(const_iterator, _NodeHandle&&);1180 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_unique(const_iterator, _NodeHandle&&);
1051 template <class _Tree>1181 template <class _Comp2>
1052 _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_unique(_Tree& __source);1182 _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_unique(__tree<_Tp, _Comp2, _Allocator>& __source);
10531183
1054 template <class _NodeHandle>1184 template <class _NodeHandle>
1055 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(_NodeHandle&&);1185 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(_NodeHandle&&);
1056 template <class _NodeHandle>1186 template <class _NodeHandle>
1057 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(const_iterator, _NodeHandle&&);1187 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(const_iterator, _NodeHandle&&);
1058 template <class _Tree>1188 template <class _Comp2>
1059 _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_multi(_Tree& __source);1189 _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_multi(__tree<_Tp, _Comp2, _Allocator>& __source);
10601190
1061 template <class _NodeHandle>1191 template <class _NodeHandle>
1062 _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(key_type const&);1192 _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(key_type const&);
...@@ -1075,41 +1205,157 @@ public:...@@ -1075,41 +1205,157 @@ public:
1075 __insert_node_at(__end_node_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT;1205 __insert_node_at(__end_node_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT;
10761206
1077 template <class _Key>1207 template <class _Key>
1078 _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __v);1208 _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __key) {
1209 auto [__, __match] = __find_equal(__key);
1210 if (__match == nullptr)
1211 return end();
1212 return iterator(static_cast<__node_pointer>(__match));
1213 }
1214
1079 template <class _Key>1215 template <class _Key>
1080 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __v) const;1216 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __key) const {
1217 auto [__, __match] = __find_equal(__key);
1218 if (__match == nullptr)
1219 return end();
1220 return const_iterator(static_cast<__node_pointer>(__match));
1221 }
10811222
1082 template <class _Key>1223 template <class _Key>
1083 _LIBCPP_HIDE_FROM_ABI size_type __count_unique(const _Key& __k) const;1224 _LIBCPP_HIDE_FROM_ABI size_type __count_unique(const _Key& __k) const;
1084 template <class _Key>1225 template <class _Key>
1085 _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const;1226 _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const;
10861227
1228 template <bool _LowerBound, class _Key>
1229 _LIBCPP_HIDE_FROM_ABI __end_node_pointer __lower_upper_bound_unique_impl(const _Key& __v) const {
1230 auto __rt = __root();
1231 auto __result = __end_node();
1232 auto __comp = __lazy_synth_three_way_comparator<_Compare, _Key, value_type>(value_comp());
1233 while (__rt != nullptr) {
1234 auto __comp_res = __comp(__v, __rt->__get_value());
1235
1236 if (__comp_res.__less()) {
1237 __result = static_cast<__end_node_pointer>(__rt);
1238 __rt = static_cast<__node_pointer>(__rt->__left_);
1239 } else if (__comp_res.__greater()) {
1240 __rt = static_cast<__node_pointer>(__rt->__right_);
1241 } else if _LIBCPP_CONSTEXPR (_LowerBound) {
1242 return static_cast<__end_node_pointer>(__rt);
1243 } else {
1244 return __rt->__right_ ? static_cast<__end_node_pointer>(std::__tree_min(__rt->__right_)) : __result;
1245 }
1246 }
1247 return __result;
1248 }
1249
1250 // Compatibility escape hatch for comparators that are not strict weak orderings. This
1251 // can be removed for the LLVM 23 release.
1252#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1087 template <class _Key>1253 template <class _Key>
1088 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _Key& __v) {1254 _LIBCPP_HIDE_FROM_ABI __end_node_pointer __lower_bound_unique_compat_impl(const _Key& __v) const {
1089 return __lower_bound(__v, __root(), __end_node());1255 auto __rt = __root();
1256 auto __result = __end_node();
1257 while (__rt != nullptr) {
1258 if (!value_comp()(__rt->__get_value(), __v)) {
1259 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
1260 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
1261 } else {
1262 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
1263 }
1264 }
1265 return __result;
1090 }1266 }
1267
1091 template <class _Key>1268 template <class _Key>
1092 _LIBCPP_HIDE_FROM_ABI iterator __lower_bound(const _Key& __v, __node_pointer __root, __end_node_pointer __result);1269 _LIBCPP_HIDE_FROM_ABI __end_node_pointer __upper_bound_unique_compat_impl(const _Key& __v) const {
1270 auto __rt = __root();
1271 auto __result = __end_node();
1272 while (__rt != nullptr) {
1273 if (value_comp()(__v, __rt->__get_value())) {
1274 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
1275 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
1276 } else {
1277 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
1278 }
1279 }
1280 return __result;
1281 }
1282#endif // _LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND
1283
1093 template <class _Key>1284 template <class _Key>
1094 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _Key& __v) const {1285 _LIBCPP_HIDE_FROM_ABI iterator __lower_bound_unique(const _Key& __v) {
1095 return __lower_bound(__v, __root(), __end_node());1286#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1287 return iterator(__lower_bound_unique_compat_impl(__v));
1288#else
1289 return iterator(__lower_upper_bound_unique_impl<true>(__v));
1290#endif
1096 }1291 }
1292
1293 template <class _Key>
1294 _LIBCPP_HIDE_FROM_ABI const_iterator __lower_bound_unique(const _Key& __v) const {
1295#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1296 return const_iterator(__lower_bound_unique_compat_impl(__v));
1297#else
1298 return const_iterator(__lower_upper_bound_unique_impl<true>(__v));
1299#endif
1300 }
1301
1302 template <class _Key>
1303 _LIBCPP_HIDE_FROM_ABI iterator __upper_bound_unique(const _Key& __v) {
1304#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1305 return iterator(__upper_bound_unique_compat_impl(__v));
1306#else
1307 return iterator(__lower_upper_bound_unique_impl<false>(__v));
1308#endif
1309 }
1310
1311 template <class _Key>
1312 _LIBCPP_HIDE_FROM_ABI const_iterator __upper_bound_unique(const _Key& __v) const {
1313#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1314 return iterator(__upper_bound_unique_compat_impl(__v));
1315#else
1316 return iterator(__lower_upper_bound_unique_impl<false>(__v));
1317#endif
1318 }
1319
1320private:
1321 template <class _Key>
1322 _LIBCPP_HIDE_FROM_ABI iterator
1323 __lower_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result);
1324
1097 template <class _Key>1325 template <class _Key>
1098 _LIBCPP_HIDE_FROM_ABI const_iterator1326 _LIBCPP_HIDE_FROM_ABI const_iterator
1099 __lower_bound(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;1327 __lower_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;
1328
1329public:
1100 template <class _Key>1330 template <class _Key>
1101 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _Key& __v) {1331 _LIBCPP_HIDE_FROM_ABI iterator __lower_bound_multi(const _Key& __v) {
1102 return __upper_bound(__v, __root(), __end_node());1332 return __lower_bound_multi(__v, __root(), __end_node());
1103 }1333 }
1104 template <class _Key>1334 template <class _Key>
1105 _LIBCPP_HIDE_FROM_ABI iterator __upper_bound(const _Key& __v, __node_pointer __root, __end_node_pointer __result);1335 _LIBCPP_HIDE_FROM_ABI const_iterator __lower_bound_multi(const _Key& __v) const {
1336 return __lower_bound_multi(__v, __root(), __end_node());
1337 }
1338
1339 template <class _Key>
1340 _LIBCPP_HIDE_FROM_ABI iterator __upper_bound_multi(const _Key& __v) {
1341 return __upper_bound_multi(__v, __root(), __end_node());
1342 }
1343
1106 template <class _Key>1344 template <class _Key>
1107 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _Key& __v) const {1345 _LIBCPP_HIDE_FROM_ABI const_iterator __upper_bound_multi(const _Key& __v) const {
1108 return __upper_bound(__v, __root(), __end_node());1346 return __upper_bound_multi(__v, __root(), __end_node());
1109 }1347 }
1348
1349private:
1350 template <class _Key>
1351 _LIBCPP_HIDE_FROM_ABI iterator
1352 __upper_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result);
1353
1110 template <class _Key>1354 template <class _Key>
1111 _LIBCPP_HIDE_FROM_ABI const_iterator1355 _LIBCPP_HIDE_FROM_ABI const_iterator
1112 __upper_bound(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;1356 __upper_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;
1357
1358public:
1113 template <class _Key>1359 template <class _Key>
1114 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> __equal_range_unique(const _Key& __k);1360 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> __equal_range_unique(const _Key& __k);
1115 template <class _Key>1361 template <class _Key>
...@@ -1120,22 +1366,24 @@ public:...@@ -1120,22 +1366,24 @@ public:
1120 template <class _Key>1366 template <class _Key>
1121 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> __equal_range_multi(const _Key& __k) const;1367 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> __equal_range_multi(const _Key& __k) const;
11221368
1123 typedef __tree_node_destructor<__node_allocator> _Dp;1369 using _Dp _LIBCPP_NODEBUG = __tree_node_destructor<__node_allocator>;
1124 typedef unique_ptr<__node, _Dp> __node_holder;1370 using __node_holder _LIBCPP_NODEBUG = unique_ptr<__node, _Dp>;
11251371
1126 _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT;1372 _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT;
11271373
1128 // FIXME: Make this function const qualified. Unfortunately doing so1374 // FIXME: Make this function const qualified. Unfortunately doing so
1129 // breaks existing code which uses non-const callable comparators.1375 // breaks existing code which uses non-const callable comparators.
1130 template <class _Key>1376 template <class _Key>
1131 _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_equal(__end_node_pointer& __parent, const _Key& __v);1377 _LIBCPP_HIDE_FROM_ABI pair<__end_node_pointer, __node_base_pointer&> __find_equal(const _Key& __v);
1378
1132 template <class _Key>1379 template <class _Key>
1133 _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_equal(__end_node_pointer& __parent, const _Key& __v) const {1380 _LIBCPP_HIDE_FROM_ABI pair<__end_node_pointer, __node_base_pointer&> __find_equal(const _Key& __v) const {
1134 return const_cast<__tree*>(this)->__find_equal(__parent, __v);1381 return const_cast<__tree*>(this)->__find_equal(__v);
1135 }1382 }
1383
1136 template <class _Key>1384 template <class _Key>
1137 _LIBCPP_HIDE_FROM_ABI __node_base_pointer&1385 _LIBCPP_HIDE_FROM_ABI pair<__end_node_pointer, __node_base_pointer&>
1138 __find_equal(const_iterator __hint, __end_node_pointer& __parent, __node_base_pointer& __dummy, const _Key& __v);1386 __find_equal(const_iterator __hint, __node_base_pointer& __dummy, const _Key& __v);
11391387
1140 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __tree& __t) {1388 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __tree& __t) {
1141 __copy_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_copy_assignment::value>());1389 __copy_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_copy_assignment::value>());
...@@ -1160,7 +1408,7 @@ private:...@@ -1160,7 +1408,7 @@ private:
1160 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&&... __args);1408 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&&... __args);
11611409
1162 // TODO: Make this _LIBCPP_HIDE_FROM_ABI1410 // TODO: Make this _LIBCPP_HIDE_FROM_ABI
1163 _LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT;1411 _LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT { (__tree_deleter(__node_alloc_))(__nd); }
11641412
1165 _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);1413 _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);
1166 _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(1414 _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(
...@@ -1178,7 +1426,7 @@ private:...@@ -1178,7 +1426,7 @@ private:
1178 }1426 }
1179 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}1427 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
11801428
1181 template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type<_ValueT>::value, int> = 0>1429 template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>
1182 _LIBCPP_HIDE_FROM_ABI static void __assign_value(__get_node_value_type_t<value_type>& __lhs, _From&& __rhs) {1430 _LIBCPP_HIDE_FROM_ABI static void __assign_value(__get_node_value_type_t<value_type>& __lhs, _From&& __rhs) {
1183 using __key_type = __remove_const_t<typename value_type::first_type>;1431 using __key_type = __remove_const_t<typename value_type::first_type>;
11841432
...@@ -1188,166 +1436,203 @@ private:...@@ -1188,166 +1436,203 @@ private:
1188 __lhs.second = std::forward<_From>(__rhs).second;1436 __lhs.second = std::forward<_From>(__rhs).second;
1189 }1437 }
11901438
1191 template <class _To, class _From, class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type<_ValueT>::value, int> = 0>1439 template <class _To, class _From, class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type_v<_ValueT>, int> = 0>
1192 _LIBCPP_HIDE_FROM_ABI static void __assign_value(_To& __lhs, _From&& __rhs) {1440 _LIBCPP_HIDE_FROM_ABI static void __assign_value(_To& __lhs, _From&& __rhs) {
1193 __lhs = std::forward<_From>(__rhs);1441 __lhs = std::forward<_From>(__rhs);
1194 }1442 }
11951443
1196 struct _DetachedTreeCache {1444 class __tree_deleter {
1197 _LIBCPP_HIDE_FROM_ABI explicit _DetachedTreeCache(__tree* __t) _NOEXCEPT1445 __node_allocator& __alloc_;
1198 : __t_(__t),1446
1199 __cache_root_(__detach_from_tree(__t)) {1447 public:
1200 __advance();1448 using pointer = __node_pointer;
1449
1450 _LIBCPP_HIDE_FROM_ABI __tree_deleter(__node_allocator& __alloc) : __alloc_(__alloc) {}
1451
1452#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1453 _LIBCPP_HIDE_FROM_ABI
1454#endif
1455 void
1456 operator()(__node_pointer __ptr) {
1457 if (!__ptr)
1458 return;
1459
1460 (*this)(static_cast<__node_pointer>(__ptr->__left_));
1461
1462 auto __right = __ptr->__right_;
1463
1464 __node_traits::destroy(__alloc_, std::addressof(__ptr->__get_value()));
1465 __node_traits::deallocate(__alloc_, __ptr, 1);
1466
1467 (*this)(static_cast<__node_pointer>(__right));
1201 }1468 }
1469 };
1470
1471 // This copy construction will always produce a correct red-black-tree assuming the incoming tree is correct, since we
1472 // copy the exact structure 1:1. Since this is for copy construction _only_ we know that we get a correct tree. If we
1473 // didn't get a correct tree, the invariants of __tree are broken and we have a much bigger problem than an improperly
1474 // balanced tree.
1475 template <class _NodeConstructor>
1476#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1477 _LIBCPP_HIDE_FROM_ABI
1478#endif
1479 __node_pointer __construct_from_tree(__node_pointer __src, _NodeConstructor __construct) {
1480 if (!__src)
1481 return nullptr;
12021482
1203 _LIBCPP_HIDE_FROM_ABI __node_pointer __get() const _NOEXCEPT { return __cache_elem_; }1483 __node_holder __new_node = __construct(__src->__get_value());
12041484
1205 _LIBCPP_HIDE_FROM_ABI void __advance() _NOEXCEPT {1485 unique_ptr<__node, __tree_deleter> __left(
1206 __cache_elem_ = __cache_root_;1486 __construct_from_tree(static_cast<__node_pointer>(__src->__left_), __construct), __node_alloc_);
1207 if (__cache_root_) {1487 __node_pointer __right = __construct_from_tree(static_cast<__node_pointer>(__src->__right_), __construct);
1208 __cache_root_ = __detach_next(__cache_root_);1488
1209 }1489 __node_pointer __new_node_ptr = __new_node.release();
1490
1491 __new_node_ptr->__is_black_ = __src->__is_black_;
1492 __new_node_ptr->__left_ = static_cast<__node_base_pointer>(__left.release());
1493 __new_node_ptr->__right_ = static_cast<__node_base_pointer>(__right);
1494 if (__new_node_ptr->__left_)
1495 __new_node_ptr->__left_->__parent_ = static_cast<__end_node_pointer>(__new_node_ptr);
1496 if (__new_node_ptr->__right_)
1497 __new_node_ptr->__right_->__parent_ = static_cast<__end_node_pointer>(__new_node_ptr);
1498 return __new_node_ptr;
1499 }
1500
1501 _LIBCPP_HIDE_FROM_ABI __node_pointer __copy_construct_tree(__node_pointer __src) {
1502 return __construct_from_tree(__src, [this](const value_type& __val) { return __construct_node(__val); });
1503 }
1504
1505 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) {
1507 return __construct_from_tree(__src, [this](value_type& __val) {
1508 return __construct_node(const_cast<key_type&&>(__val.first), std::move(__val.second));
1509 });
1510 }
1511
1512 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) {
1514 return __construct_from_tree(__src, [this](value_type& __val) { return __construct_node(std::move(__val)); });
1515 }
1516
1517 template <class _Assignment, class _ConstructionAlg>
1518 // This copy assignment will always produce a correct red-black-tree assuming the incoming tree is correct, since our
1519 // own tree is a red-black-tree and the incoming tree is a red-black-tree. The invariants of a red-black-tree are
1520 // temporarily not met until all of the incoming red-black tree is copied.
1521#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1522 _LIBCPP_HIDE_FROM_ABI
1523#endif
1524 __node_pointer __assign_from_tree(
1525 __node_pointer __dest, __node_pointer __src, _Assignment __assign, _ConstructionAlg __construct_subtree) {
1526 if (!__src) {
1527 destroy(__dest);
1528 return nullptr;
1210 }1529 }
12111530
1212 _LIBCPP_HIDE_FROM_ABI ~_DetachedTreeCache() {1531 __assign(__dest->__get_value(), __src->__get_value());
1213 __t_->destroy(__cache_elem_);1532 __dest->__is_black_ = __src->__is_black_;
1214 if (__cache_root_) {1533
1215 while (__cache_root_->__parent_ != nullptr)1534 // If we already have a left node in the destination tree, reuse it and copy-assign recursively
1216 __cache_root_ = static_cast<__node_pointer>(__cache_root_->__parent_);1535 if (__dest->__left_) {
1217 __t_->destroy(__cache_root_);1536 __dest->__left_ = static_cast<__node_base_pointer>(__assign_from_tree(
1218 }1537 static_cast<__node_pointer>(__dest->__left_),
1538 static_cast<__node_pointer>(__src->__left_),
1539 __assign,
1540 __construct_subtree));
1541
1542 // Otherwise, we must create new nodes; copy-construct from here on
1543 } else if (__src->__left_) {
1544 auto __new_left = __construct_subtree(static_cast<__node_pointer>(__src->__left_));
1545 __dest->__left_ = static_cast<__node_base_pointer>(__new_left);
1546 __new_left->__parent_ = static_cast<__end_node_pointer>(__dest);
1219 }1547 }
12201548
1221 _DetachedTreeCache(_DetachedTreeCache const&) = delete;1549 // Identical to the left case above, just for the right nodes
1222 _DetachedTreeCache& operator=(_DetachedTreeCache const&) = delete;1550 if (__dest->__right_) {
1551 __dest->__right_ = static_cast<__node_base_pointer>(__assign_from_tree(
1552 static_cast<__node_pointer>(__dest->__right_),
1553 static_cast<__node_pointer>(__src->__right_),
1554 __assign,
1555 __construct_subtree));
1556 } else if (__src->__right_) {
1557 auto __new_right = __construct_subtree(static_cast<__node_pointer>(__src->__right_));
1558 __dest->__right_ = static_cast<__node_base_pointer>(__new_right);
1559 __new_right->__parent_ = static_cast<__end_node_pointer>(__dest);
1560 }
12231561
1224 private:1562 return __dest;
1225 _LIBCPP_HIDE_FROM_ABI static __node_pointer __detach_from_tree(__tree* __t) _NOEXCEPT;1563 }
1226 _LIBCPP_HIDE_FROM_ABI static __node_pointer __detach_next(__node_pointer) _NOEXCEPT;
12271564
1228 __tree* __t_;1565 _LIBCPP_HIDE_FROM_ABI __node_pointer __copy_assign_tree(__node_pointer __dest, __node_pointer __src) {
1229 __node_pointer __cache_root_;1566 return __assign_from_tree(
1230 __node_pointer __cache_elem_;1567 __dest,
1231 };1568 __src,
1232};1569 [](value_type& __lhs, const value_type& __rhs) { __assign_value(__lhs, __rhs); },
1570 [this](__node_pointer __nd) { return __copy_construct_tree(__nd); });
1571 }
12331572
1234template <class _Tp, class _Compare, class _Allocator>1573 _LIBCPP_HIDE_FROM_ABI __node_pointer __move_assign_tree(__node_pointer __dest, __node_pointer __src) {
1235__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp) _NOEXCEPT_(1574 return __assign_from_tree(
1236 is_nothrow_default_constructible<__node_allocator>::value&& is_nothrow_copy_constructible<value_compare>::value)1575 __dest,
1237 : __size_(0), __value_comp_(__comp) {1576 __src,
1238 __begin_node() = __end_node();1577 [](value_type& __lhs, value_type& __rhs) { __assign_value(__lhs, std::move(__rhs)); },
1239}1578 [this](__node_pointer __nd) { return __move_construct_tree(__nd); });
1579 }
12401580
1241template <class _Tp, class _Compare, class _Allocator>1581 friend struct __specialized_algorithm<_Algorithm::__for_each, __single_range<__tree> >;
1242__tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)1582};
1243 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {
1244 __begin_node() = __end_node();
1245}
12461583
1584#if _LIBCPP_STD_VER >= 14
1247template <class _Tp, class _Compare, class _Allocator>1585template <class _Tp, class _Compare, class _Allocator>
1248__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp, const allocator_type& __a)1586struct __specialized_algorithm<_Algorithm::__for_each, __single_range<__tree<_Tp, _Compare, _Allocator> > > {
1249 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(__comp) {1587 static const bool __has_algorithm = true;
1250 __begin_node() = __end_node();
1251}
12521588
1253// Precondition: size() != 01589 using __node_pointer _LIBCPP_NODEBUG = typename __tree<_Tp, _Compare, _Allocator>::__node_pointer;
1254template <class _Tp, class _Compare, class _Allocator>
1255typename __tree<_Tp, _Compare, _Allocator>::__node_pointer
1256__tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_from_tree(__tree* __t) _NOEXCEPT {
1257 __node_pointer __cache = static_cast<__node_pointer>(__t->__begin_node());
1258 __t->__begin_node() = __t->__end_node();
1259 __t->__end_node()->__left_->__parent_ = nullptr;
1260 __t->__end_node()->__left_ = nullptr;
1261 __t->size() = 0;
1262 // __cache->__left_ == nullptr
1263 if (__cache->__right_ != nullptr)
1264 __cache = static_cast<__node_pointer>(__cache->__right_);
1265 // __cache->__left_ == nullptr
1266 // __cache->__right_ == nullptr
1267 return __cache;
1268}
12691590
1270// Precondition: __cache != nullptr1591 template <class _Tree, class _Func, class _Proj>
1271// __cache->left_ == nullptr1592 _LIBCPP_HIDE_FROM_ABI static auto operator()(_Tree&& __range, _Func __func, _Proj __proj) {
1272// __cache->right_ == nullptr1593 if (__range.size() != 0)
1273// This is no longer a red-black tree1594 std::__tree_iterate_from_root<__copy_cvref_t<_Tree, typename __remove_cvref_t<_Tree>::value_type>>(
1274template <class _Tp, class _Compare, class _Allocator>1595 [](__node_pointer) { return false; }, __range.__root(), __func, __proj);
1275typename __tree<_Tp, _Compare, _Allocator>::__node_pointer1596 return std::make_pair(__range.end(), std::move(__func));
1276__tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_next(__node_pointer __cache) _NOEXCEPT {1597 }
1277 if (__cache->__parent_ == nullptr)1598};
1278 return nullptr;1599#endif
1279 if (std::__tree_is_left_child(static_cast<__node_base_pointer>(__cache))) {
1280 __cache->__parent_->__left_ = nullptr;
1281 __cache = static_cast<__node_pointer>(__cache->__parent_);
1282 if (__cache->__right_ == nullptr)
1283 return __cache;
1284 return static_cast<__node_pointer>(std::__tree_leaf(__cache->__right_));
1285 }
1286 // __cache is right child
1287 __cache->__parent_unsafe()->__right_ = nullptr;
1288 __cache = static_cast<__node_pointer>(__cache->__parent_);
1289 if (__cache->__left_ == nullptr)
1290 return __cache;
1291 return static_cast<__node_pointer>(std::__tree_leaf(__cache->__left_));
1292}
12931600
1294template <class _Tp, class _Compare, class _Allocator>1601template <class _Tp, class _Compare, class _Allocator>
1295__tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t) {1602__tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t) {
1296 if (this != std::addressof(__t)) {1603 if (this == std::addressof(__t))
1297 value_comp() = __t.value_comp();1604 return *this;
1298 __copy_assign_alloc(__t);
1299 __assign_multi(__t.begin(), __t.end());
1300 }
1301 return *this;
1302}
13031605
1304template <class _Tp, class _Compare, class _Allocator>1606 value_comp() = __t.value_comp();
1305template <class _ForwardIterator>1607 __copy_assign_alloc(__t);
1306void __tree<_Tp, _Compare, _Allocator>::__assign_unique(_ForwardIterator __first, _ForwardIterator __last) {
1307 typedef iterator_traits<_ForwardIterator> _ITraits;
1308 typedef typename _ITraits::value_type _ItValueType;
1309 static_assert(
1310 is_same<_ItValueType, value_type>::value, "__assign_unique may only be called with the containers value type");
1311 static_assert(
1312 __has_forward_iterator_category<_ForwardIterator>::value, "__assign_unique requires a forward iterator");
1313 if (size() != 0) {
1314 _DetachedTreeCache __cache(this);
1315 for (; __cache.__get() != nullptr && __first != __last; ++__first) {
1316 if (__node_assign_unique(*__first, __cache.__get()).second)
1317 __cache.__advance();
1318 }
1319 }
1320 for (; __first != __last; ++__first)
1321 __emplace_unique(*__first);
1322}
13231608
1324template <class _Tp, class _Compare, class _Allocator>1609 if (__size_ != 0) {
1325template <class _InputIterator>1610 *__root_ptr() = static_cast<__node_base_pointer>(__copy_assign_tree(__root(), __t.__root()));
1326void __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _InputIterator __last) {1611 } else {
1327 typedef iterator_traits<_InputIterator> _ITraits;1612 *__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
1328 typedef typename _ITraits::value_type _ItValueType;1613 if (__root())
1329 static_assert(1614 __root()->__parent_ = __end_node();
1330 is_same<_ItValueType, value_type>::value, "__assign_multi may only be called with the containers value_type");
1331 if (size() != 0) {
1332 _DetachedTreeCache __cache(this);
1333 for (; __cache.__get() && __first != __last; ++__first) {
1334 __assign_value(__cache.__get()->__value_, *__first);
1335 __node_insert_multi(__cache.__get());
1336 __cache.__advance();
1337 }
1338 }1615 }
1339 const_iterator __e = end();1616 __begin_node_ =
1340 for (; __first != __last; ++__first)1617 __end_node()->__left_ ? static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_)) : __end_node();
1341 __emplace_hint_multi(__e, *__first);1618 __size_ = __t.size();
1619
1620 return *this;
1342}1621}
13431622
1344template <class _Tp, class _Compare, class _Allocator>1623template <class _Tp, class _Compare, class _Allocator>
1345__tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)1624__tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
1346 : __begin_node_(),1625 : __begin_node_(__end_node()),
1347 __node_alloc_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),1626 __node_alloc_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),
1348 __size_(0),1627 __size_(0),
1349 __value_comp_(__t.value_comp()) {1628 __value_comp_(__t.value_comp()) {
1350 __begin_node() = __end_node();1629 if (__t.size() == 0)
1630 return;
1631
1632 *__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
1633 __root()->__parent_ = __end_node();
1634 __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1635 __size_ = __t.size();
1351}1636}
13521637
1353template <class _Tp, class _Compare, class _Allocator>1638template <class _Tp, class _Compare, class _Allocator>
...@@ -1358,33 +1643,38 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(...@@ -1358,33 +1643,38 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(
1358 __node_alloc_(std::move(__t.__node_alloc_)),1643 __node_alloc_(std::move(__t.__node_alloc_)),
1359 __size_(__t.__size_),1644 __size_(__t.__size_),
1360 __value_comp_(std::move(__t.__value_comp_)) {1645 __value_comp_(std::move(__t.__value_comp_)) {
1361 if (size() == 0)1646 if (__size_ == 0)
1362 __begin_node() = __end_node();1647 __begin_node_ = __end_node();
1363 else {1648 else {
1364 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());1649 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());
1365 __t.__begin_node() = __t.__end_node();1650 __t.__begin_node_ = __t.__end_node();
1366 __t.__end_node()->__left_ = nullptr;1651 __t.__end_node()->__left_ = nullptr;
1367 __t.size() = 0;1652 __t.__size_ = 0;
1368 }1653 }
1369}1654}
13701655
1371template <class _Tp, class _Compare, class _Allocator>1656template <class _Tp, class _Compare, class _Allocator>
1372__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)1657__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
1373 : __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(std::move(__t.value_comp())) {1658 : __begin_node_(__end_node()),
1659 __node_alloc_(__node_allocator(__a)),
1660 __size_(0),
1661 __value_comp_(std::move(__t.value_comp())) {
1662 if (__t.size() == 0)
1663 return;
1374 if (__a == __t.__alloc()) {1664 if (__a == __t.__alloc()) {
1375 if (__t.size() == 0)1665 __begin_node_ = __t.__begin_node_;
1376 __begin_node() = __end_node();1666 __end_node()->__left_ = __t.__end_node()->__left_;
1377 else {1667 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());
1378 __begin_node() = __t.__begin_node();1668 __size_ = __t.__size_;
1379 __end_node()->__left_ = __t.__end_node()->__left_;1669 __t.__begin_node_ = __t.__end_node();
1380 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());1670 __t.__end_node()->__left_ = nullptr;
1381 size() = __t.size();1671 __t.__size_ = 0;
1382 __t.__begin_node() = __t.__end_node();
1383 __t.__end_node()->__left_ = nullptr;
1384 __t.size() = 0;
1385 }
1386 } else {1672 } else {
1387 __begin_node() = __end_node();1673 *__root_ptr() = static_cast<__node_base_pointer>(__move_construct_tree(__t.__root()));
1674 __root()->__parent_ = __end_node();
1675 __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1676 __size_ = __t.size();
1677 __t.clear(); // Ensure that __t is in a valid state after moving out the keys
1388 }1678 }
1389}1679}
13901680
...@@ -1397,61 +1687,33 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)...@@ -1397,61 +1687,33 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
1397 __move_assign_alloc(__t);1687 __move_assign_alloc(__t);
1398 __size_ = __t.__size_;1688 __size_ = __t.__size_;
1399 __value_comp_ = std::move(__t.__value_comp_);1689 __value_comp_ = std::move(__t.__value_comp_);
1400 if (size() == 0)1690 if (__size_ == 0)
1401 __begin_node() = __end_node();1691 __begin_node_ = __end_node();
1402 else {1692 else {
1403 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());1693 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());
1404 __t.__begin_node() = __t.__end_node();1694 __t.__begin_node_ = __t.__end_node();
1405 __t.__end_node()->__left_ = nullptr;1695 __t.__end_node()->__left_ = nullptr;
1406 __t.size() = 0;1696 __t.__size_ = 0;
1407 }1697 }
1408}1698}
14091699
1410template <class _Tp, class _Compare, class _Allocator>1700template <class _Tp, class _Compare, class _Allocator>
1411void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) {1701void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) {
1412 if (__node_alloc() == __t.__node_alloc())1702 if (__node_alloc() == __t.__node_alloc()) {
1413 __move_assign(__t, true_type());1703 __move_assign(__t, true_type());
1414 else {1704 } else {
1415 value_comp() = std::move(__t.value_comp());1705 value_comp() = std::move(__t.value_comp());
1416 const_iterator __e = end();1706 if (__size_ != 0) {
1417 if (size() != 0) {1707 *__root_ptr() = static_cast<__node_base_pointer>(__move_assign_tree(__root(), __t.__root()));
1418 _DetachedTreeCache __cache(this);1708 } else {
1419 while (__cache.__get() != nullptr && __t.size() != 0) {1709 *__root_ptr() = static_cast<__node_base_pointer>(__move_construct_tree(__t.__root()));
1420 __assign_value(__cache.__get()->__value_, std::move(__t.remove(__t.begin())->__value_));1710 if (__root())
1421 __node_insert_multi(__cache.__get());1711 __root()->__parent_ = __end_node();
1422 __cache.__advance();
1423 }
1424 }
1425 while (__t.size() != 0) {
1426 __insert_multi_from_orphaned_node(__e, std::move(__t.remove(__t.begin())->__value_));
1427 }1712 }
1428 }1713 __begin_node_ =
1429}1714 __end_node()->__left_ ? static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_)) : __end_node();
14301715 __size_ = __t.size();
1431template <class _Tp, class _Compare, class _Allocator>1716 __t.clear(); // Ensure that __t is in a valid state after moving out the keys
1432__tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
1433 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
1434 ((__node_traits::propagate_on_container_move_assignment::value &&
1435 is_nothrow_move_assignable<__node_allocator>::value) ||
1436 allocator_traits<__node_allocator>::is_always_equal::value)) {
1437 __move_assign(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
1438 return *this;
1439}
1440
1441template <class _Tp, class _Compare, class _Allocator>
1442__tree<_Tp, _Compare, _Allocator>::~__tree() {
1443 static_assert(is_copy_constructible<value_compare>::value, "Comparator must be copy-constructible.");
1444 destroy(__root());
1445}
1446
1447template <class _Tp, class _Compare, class _Allocator>
1448void __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT {
1449 if (__nd != nullptr) {
1450 destroy(static_cast<__node_pointer>(__nd->__left_));
1451 destroy(static_cast<__node_pointer>(__nd->__right_));
1452 __node_allocator& __na = __node_alloc();
1453 __node_traits::destroy(__na, std::addressof(__nd->__value_));
1454 __node_traits::deallocate(__na, __nd, 1);
1455 }1717 }
1456}1718}
14571719
...@@ -1470,12 +1732,12 @@ void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)...@@ -1470,12 +1732,12 @@ void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1470 std::__swap_allocator(__node_alloc(), __t.__node_alloc());1732 std::__swap_allocator(__node_alloc(), __t.__node_alloc());
1471 swap(__size_, __t.__size_);1733 swap(__size_, __t.__size_);
1472 swap(__value_comp_, __t.__value_comp_);1734 swap(__value_comp_, __t.__value_comp_);
1473 if (size() == 0)1735 if (__size_ == 0)
1474 __begin_node() = __end_node();1736 __begin_node_ = __end_node();
1475 else1737 else
1476 __end_node()->__left_->__parent_ = __end_node();1738 __end_node()->__left_->__parent_ = __end_node();
1477 if (__t.size() == 0)1739 if (__t.__size_ == 0)
1478 __t.__begin_node() = __t.__end_node();1740 __t.__begin_node_ = __t.__end_node();
1479 else1741 else
1480 __t.__end_node()->__left_->__parent_ = __t.__end_node();1742 __t.__end_node()->__left_->__parent_ = __t.__end_node();
1481}1743}
...@@ -1483,8 +1745,8 @@ void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)...@@ -1483,8 +1745,8 @@ void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1483template <class _Tp, class _Compare, class _Allocator>1745template <class _Tp, class _Compare, class _Allocator>
1484void __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT {1746void __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT {
1485 destroy(__root());1747 destroy(__root());
1486 size() = 0;1748 __size_ = 0;
1487 __begin_node() = __end_node();1749 __begin_node_ = __end_node();
1488 __end_node()->__left_ = nullptr;1750 __end_node()->__left_ = nullptr;
1489}1751}
14901752
...@@ -1497,7 +1759,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__end_node_pointer& __parent,...@@ -1497,7 +1759,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__end_node_pointer& __parent,
1497 __node_pointer __nd = __root();1759 __node_pointer __nd = __root();
1498 if (__nd != nullptr) {1760 if (__nd != nullptr) {
1499 while (true) {1761 while (true) {
1500 if (value_comp()(__nd->__value_, __v)) {1762 if (value_comp()(__nd->__get_value(), __v)) {
1501 if (__nd->__right_ != nullptr)1763 if (__nd->__right_ != nullptr)
1502 __nd = static_cast<__node_pointer>(__nd->__right_);1764 __nd = static_cast<__node_pointer>(__nd->__right_);
1503 else {1765 else {
...@@ -1527,7 +1789,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__end_node_pointer& __parent...@@ -1527,7 +1789,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__end_node_pointer& __parent
1527 __node_pointer __nd = __root();1789 __node_pointer __nd = __root();
1528 if (__nd != nullptr) {1790 if (__nd != nullptr) {
1529 while (true) {1791 while (true) {
1530 if (value_comp()(__v, __nd->__value_)) {1792 if (value_comp()(__v, __nd->__get_value())) {
1531 if (__nd->__left_ != nullptr)1793 if (__nd->__left_ != nullptr)
1532 __nd = static_cast<__node_pointer>(__nd->__left_);1794 __nd = static_cast<__node_pointer>(__nd->__left_);
1533 else {1795 else {
...@@ -1578,92 +1840,91 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Co...@@ -1578,92 +1840,91 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Co
1578 return __find_leaf_low(__parent, __v);1840 return __find_leaf_low(__parent, __v);
1579}1841}
15801842
1581// Find place to insert if __v doesn't exist1843// Find __v
1582// Set __parent to parent of null leaf1844// If __v exists, return the parent of the node of __v and a reference to the pointer to the node of __v.
1583// Return reference to null leaf1845// If __v doesn't exist, return the parent of the null leaf and a reference to the pointer to the null leaf.
1584// If __v exists, set parent to node of __v and return reference to node of __v
1585template <class _Tp, class _Compare, class _Allocator>1846template <class _Tp, class _Compare, class _Allocator>
1586template <class _Key>1847template <class _Key>
1587typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&1848_LIBCPP_HIDE_FROM_ABI pair<typename __tree<_Tp, _Compare, _Allocator>::__end_node_pointer,
1588__tree<_Tp, _Compare, _Allocator>::__find_equal(__end_node_pointer& __parent, const _Key& __v) {1849 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&>
1589 __node_pointer __nd = __root();1850__tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {
1590 __node_base_pointer* __nd_ptr = __root_ptr();1851 using _Pair = pair<__end_node_pointer, __node_base_pointer&>;
1591 if (__nd != nullptr) {1852
1592 while (true) {1853 __node_pointer __nd = __root();
1593 if (value_comp()(__v, __nd->__value_)) {1854
1594 if (__nd->__left_ != nullptr) {1855 if (__nd == nullptr) {
1595 __nd_ptr = std::addressof(__nd->__left_);1856 auto __end = __end_node();
1596 __nd = static_cast<__node_pointer>(__nd->__left_);1857 return _Pair(__end, __end->__left_);
1597 } else {1858 }
1598 __parent = static_cast<__end_node_pointer>(__nd);1859
1599 return __parent->__left_;1860 __node_base_pointer* __node_ptr = __root_ptr();
1600 }1861 auto&& __transparent = std::__as_transparent<_Key>(value_comp());
1601 } else if (value_comp()(__nd->__value_, __v)) {1862 auto __comp =
1602 if (__nd->__right_ != nullptr) {1863 __lazy_synth_three_way_comparator<__make_transparent_t<_Key, _Compare>, _Key, value_type>(__transparent);
1603 __nd_ptr = std::addressof(__nd->__right_);1864
1604 __nd = static_cast<__node_pointer>(__nd->__right_);1865 while (true) {
1605 } else {1866 auto __comp_res = __comp(__v, __nd->__get_value());
1606 __parent = static_cast<__end_node_pointer>(__nd);1867
1607 return __nd->__right_;1868 if (__comp_res.__less()) {
1608 }1869 if (__nd->__left_ == nullptr)
1609 } else {1870 return _Pair(static_cast<__end_node_pointer>(__nd), __nd->__left_);
1610 __parent = static_cast<__end_node_pointer>(__nd);1871
1611 return *__nd_ptr;1872 __node_ptr = std::addressof(__nd->__left_);
1612 }1873 __nd = static_cast<__node_pointer>(__nd->__left_);
1874 } else if (__comp_res.__greater()) {
1875 if (__nd->__right_ == nullptr)
1876 return _Pair(static_cast<__end_node_pointer>(__nd), __nd->__right_);
1877
1878 __node_ptr = std::addressof(__nd->__right_);
1879 __nd = static_cast<__node_pointer>(__nd->__right_);
1880 } else {
1881 return _Pair(static_cast<__end_node_pointer>(__nd), *__node_ptr);
1613 }1882 }
1614 }1883 }
1615 __parent = __end_node();
1616 return __parent->__left_;
1617}1884}
16181885
1619// Find place to insert if __v doesn't exist1886// Find __v
1620// First check prior to __hint.1887// First check prior to __hint.
1621// Next check after __hint.1888// Next check after __hint.
1622// Next do O(log N) search.1889// Next do O(log N) search.
1623// Set __parent to parent of null leaf1890// If __v exists, return the parent of the node of __v and a reference to the pointer to the node of __v.
1624// Return reference to null leaf1891// If __v doesn't exist, return the parent of the null leaf and a reference to the pointer to the null leaf.
1625// If __v exists, set parent to node of __v and return reference to node of __v
1626template <class _Tp, class _Compare, class _Allocator>1892template <class _Tp, class _Compare, class _Allocator>
1627template <class _Key>1893template <class _Key>
1628typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Compare, _Allocator>::__find_equal(1894_LIBCPP_HIDE_FROM_ABI pair<typename __tree<_Tp, _Compare, _Allocator>::__end_node_pointer,
1629 const_iterator __hint, __end_node_pointer& __parent, __node_base_pointer& __dummy, const _Key& __v) {1895 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&>
1630 if (__hint == end() || value_comp()(__v, *__hint)) // check before1896__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_base_pointer& __dummy, const _Key& __v) {
1631 {1897 using _Pair = pair<__end_node_pointer, __node_base_pointer&>;
1898
1899 if (__hint == end() || value_comp()(__v, *__hint)) { // check before
1632 // __v < *__hint1900 // __v < *__hint
1633 const_iterator __prior = __hint;1901 const_iterator __prior = __hint;
1634 if (__prior == begin() || value_comp()(*--__prior, __v)) {1902 if (__prior == begin() || value_comp()(*--__prior, __v)) {
1635 // *prev(__hint) < __v < *__hint1903 // *prev(__hint) < __v < *__hint
1636 if (__hint.__ptr_->__left_ == nullptr) {1904 if (__hint.__ptr_->__left_ == nullptr)
1637 __parent = __hint.__ptr_;1905 return _Pair(__hint.__ptr_, __hint.__ptr_->__left_);
1638 return __parent->__left_;1906 return _Pair(__prior.__ptr_, static_cast<__node_pointer>(__prior.__ptr_)->__right_);
1639 } else {
1640 __parent = __prior.__ptr_;
1641 return static_cast<__node_base_pointer>(__prior.__ptr_)->__right_;
1642 }
1643 }1907 }
1644 // __v <= *prev(__hint)1908 // __v <= *prev(__hint)
1645 return __find_equal(__parent, __v);1909 return __find_equal(__v);
1646 } else if (value_comp()(*__hint, __v)) // check after1910 }
1647 {1911
1912 if (value_comp()(*__hint, __v)) { // check after
1648 // *__hint < __v1913 // *__hint < __v
1649 const_iterator __next = std::next(__hint);1914 const_iterator __next = std::next(__hint);
1650 if (__next == end() || value_comp()(__v, *__next)) {1915 if (__next == end() || value_comp()(__v, *__next)) {
1651 // *__hint < __v < *std::next(__hint)1916 // *__hint < __v < *std::next(__hint)
1652 if (__hint.__get_np()->__right_ == nullptr) {1917 if (__hint.__get_np()->__right_ == nullptr)
1653 __parent = __hint.__ptr_;1918 return _Pair(__hint.__ptr_, static_cast<__node_pointer>(__hint.__ptr_)->__right_);
1654 return static_cast<__node_base_pointer>(__hint.__ptr_)->__right_;1919 return _Pair(__next.__ptr_, __next.__ptr_->__left_);
1655 } else {
1656 __parent = __next.__ptr_;
1657 return __parent->__left_;
1658 }
1659 }1920 }
1660 // *next(__hint) <= __v1921 // *next(__hint) <= __v
1661 return __find_equal(__parent, __v);1922 return __find_equal(__v);
1662 }1923 }
1924
1663 // else __v == *__hint1925 // else __v == *__hint
1664 __parent = __hint.__ptr_;1926 __dummy = static_cast<__node_base_pointer>(__hint.__ptr_);
1665 __dummy = static_cast<__node_base_pointer>(__hint.__ptr_);1927 return _Pair(__hint.__ptr_, __dummy);
1666 return __dummy;
1667}1928}
16681929
1669template <class _Tp, class _Compare, class _Allocator>1930template <class _Tp, class _Compare, class _Allocator>
...@@ -1674,46 +1935,10 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(...@@ -1674,46 +1935,10 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(
1674 __new_node->__parent_ = __parent;1935 __new_node->__parent_ = __parent;
1675 // __new_node->__is_black_ is initialized in __tree_balance_after_insert1936 // __new_node->__is_black_ is initialized in __tree_balance_after_insert
1676 __child = __new_node;1937 __child = __new_node;
1677 if (__begin_node()->__left_ != nullptr)1938 if (__begin_node_->__left_ != nullptr)
1678 __begin_node() = static_cast<__end_node_pointer>(__begin_node()->__left_);1939 __begin_node_ = static_cast<__end_node_pointer>(__begin_node_->__left_);
1679 std::__tree_balance_after_insert(__end_node()->__left_, __child);1940 std::__tree_balance_after_insert(__end_node()->__left_, __child);
1680 ++size();1941 ++__size_;
1681}
1682
1683template <class _Tp, class _Compare, class _Allocator>
1684template <class _Key, class... _Args>
1685pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
1686__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args) {
1687 __end_node_pointer __parent;
1688 __node_base_pointer& __child = __find_equal(__parent, __k);
1689 __node_pointer __r = static_cast<__node_pointer>(__child);
1690 bool __inserted = false;
1691 if (__child == nullptr) {
1692 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1693 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1694 __r = __h.release();
1695 __inserted = true;
1696 }
1697 return pair<iterator, bool>(iterator(__r), __inserted);
1698}
1699
1700template <class _Tp, class _Compare, class _Allocator>
1701template <class _Key, class... _Args>
1702pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
1703__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
1704 const_iterator __p, _Key const& __k, _Args&&... __args) {
1705 __end_node_pointer __parent;
1706 __node_base_pointer __dummy;
1707 __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);
1708 __node_pointer __r = static_cast<__node_pointer>(__child);
1709 bool __inserted = false;
1710 if (__child == nullptr) {
1711 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1712 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1713 __r = __h.release();
1714 __inserted = true;
1715 }
1716 return pair<iterator, bool>(iterator(__r), __inserted);
1717}1942}
17181943
1719template <class _Tp, class _Compare, class _Allocator>1944template <class _Tp, class _Compare, class _Allocator>
...@@ -1722,51 +1947,18 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_holder...@@ -1722,51 +1947,18 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_holder
1722__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {1947__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
1723 __node_allocator& __na = __node_alloc();1948 __node_allocator& __na = __node_alloc();
1724 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));1949 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1725 __node_traits::construct(__na, std::addressof(__h->__value_), std::forward<_Args>(__args)...);1950 std::__construct_at(std::addressof(*__h), __na, std::forward<_Args>(__args)...);
1726 __h.get_deleter().__value_constructed = true;1951 __h.get_deleter().__value_constructed = true;
1727 return __h;1952 return __h;
1728}1953}
17291954
1730template <class _Tp, class _Compare, class _Allocator>
1731template <class... _Args>
1732pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
1733__tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl(_Args&&... __args) {
1734 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1735 __end_node_pointer __parent;
1736 __node_base_pointer& __child = __find_equal(__parent, __h->__value_);
1737 __node_pointer __r = static_cast<__node_pointer>(__child);
1738 bool __inserted = false;
1739 if (__child == nullptr) {
1740 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1741 __r = __h.release();
1742 __inserted = true;
1743 }
1744 return pair<iterator, bool>(iterator(__r), __inserted);
1745}
1746
1747template <class _Tp, class _Compare, class _Allocator>
1748template <class... _Args>
1749typename __tree<_Tp, _Compare, _Allocator>::iterator
1750__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_impl(const_iterator __p, _Args&&... __args) {
1751 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1752 __end_node_pointer __parent;
1753 __node_base_pointer __dummy;
1754 __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __h->__value_);
1755 __node_pointer __r = static_cast<__node_pointer>(__child);
1756 if (__child == nullptr) {
1757 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1758 __r = __h.release();
1759 }
1760 return iterator(__r);
1761}
1762
1763template <class _Tp, class _Compare, class _Allocator>1955template <class _Tp, class _Compare, class _Allocator>
1764template <class... _Args>1956template <class... _Args>
1765typename __tree<_Tp, _Compare, _Allocator>::iterator1957typename __tree<_Tp, _Compare, _Allocator>::iterator
1766__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args) {1958__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args) {
1767 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);1959 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1768 __end_node_pointer __parent;1960 __end_node_pointer __parent;
1769 __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);1961 __node_base_pointer& __child = __find_leaf_high(__parent, __h->__get_value());
1770 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1962 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1771 return iterator(static_cast<__node_pointer>(__h.release()));1963 return iterator(static_cast<__node_pointer>(__h.release()));
1772}1964}
...@@ -1777,53 +1969,19 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator...@@ -1777,53 +1969,19 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator
1777__tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p, _Args&&... __args) {1969__tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p, _Args&&... __args) {
1778 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);1970 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1779 __end_node_pointer __parent;1971 __end_node_pointer __parent;
1780 __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);1972 __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__get_value());
1781 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1973 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1782 return iterator(static_cast<__node_pointer>(__h.release()));1974 return iterator(static_cast<__node_pointer>(__h.release()));
1783}1975}
17841976
1785template <class _Tp, class _Compare, class _Allocator>
1786pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
1787__tree<_Tp, _Compare, _Allocator>::__node_assign_unique(const value_type& __v, __node_pointer __nd) {
1788 __end_node_pointer __parent;
1789 __node_base_pointer& __child = __find_equal(__parent, __v);
1790 __node_pointer __r = static_cast<__node_pointer>(__child);
1791 bool __inserted = false;
1792 if (__child == nullptr) {
1793 __assign_value(__nd->__value_, __v);
1794 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd));
1795 __r = __nd;
1796 __inserted = true;
1797 }
1798 return pair<iterator, bool>(iterator(__r), __inserted);
1799}
1800
1801template <class _Tp, class _Compare, class _Allocator>
1802typename __tree<_Tp, _Compare, _Allocator>::iterator
1803__tree<_Tp, _Compare, _Allocator>::__node_insert_multi(__node_pointer __nd) {
1804 __end_node_pointer __parent;
1805 __node_base_pointer& __child = __find_leaf_high(__parent, __nd->__value_);
1806 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd));
1807 return iterator(__nd);
1808}
1809
1810template <class _Tp, class _Compare, class _Allocator>
1811typename __tree<_Tp, _Compare, _Allocator>::iterator
1812__tree<_Tp, _Compare, _Allocator>::__node_insert_multi(const_iterator __p, __node_pointer __nd) {
1813 __end_node_pointer __parent;
1814 __node_base_pointer& __child = __find_leaf(__p, __parent, __nd->__value_);
1815 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd));
1816 return iterator(__nd);
1817}
1818
1819template <class _Tp, class _Compare, class _Allocator>1977template <class _Tp, class _Compare, class _Allocator>
1820typename __tree<_Tp, _Compare, _Allocator>::iterator1978typename __tree<_Tp, _Compare, _Allocator>::iterator
1821__tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _NOEXCEPT {1979__tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _NOEXCEPT {
1822 iterator __r(__ptr);1980 iterator __r(__ptr);
1823 ++__r;1981 ++__r;
1824 if (__begin_node() == __ptr)1982 if (__begin_node_ == __ptr)
1825 __begin_node() = __r.__ptr_;1983 __begin_node_ = __r.__ptr_;
1826 --size();1984 --__size_;
1827 std::__tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__ptr));1985 std::__tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__ptr));
1828 return __r;1986 return __r;
1829}1987}
...@@ -1837,8 +1995,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __n...@@ -1837,8 +1995,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __n
1837 return _InsertReturnType{end(), false, _NodeHandle()};1995 return _InsertReturnType{end(), false, _NodeHandle()};
18381996
1839 __node_pointer __ptr = __nh.__ptr_;1997 __node_pointer __ptr = __nh.__ptr_;
1840 __end_node_pointer __parent;1998 auto [__parent, __child] = __find_equal(__ptr->__get_value());
1841 __node_base_pointer& __child = __find_equal(__parent, __ptr->__value_);
1842 if (__child != nullptr)1999 if (__child != nullptr)
1843 return _InsertReturnType{iterator(static_cast<__node_pointer>(__child)), false, std::move(__nh)};2000 return _InsertReturnType{iterator(static_cast<__node_pointer>(__child)), false, std::move(__nh)};
18442001
...@@ -1855,10 +2012,9 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __...@@ -1855,10 +2012,9 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __
1855 return end();2012 return end();
18562013
1857 __node_pointer __ptr = __nh.__ptr_;2014 __node_pointer __ptr = __nh.__ptr_;
1858 __end_node_pointer __parent;
1859 __node_base_pointer __dummy;2015 __node_base_pointer __dummy;
1860 __node_base_pointer& __child = __find_equal(__hint, __parent, __dummy, __ptr->__value_);2016 auto [__parent, __child] = __find_equal(__hint, __dummy, __ptr->__get_value());
1861 __node_pointer __r = static_cast<__node_pointer>(__child);2017 __node_pointer __r = static_cast<__node_pointer>(__child);
1862 if (__child == nullptr) {2018 if (__child == nullptr) {
1863 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2019 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
1864 __r = __ptr;2020 __r = __ptr;
...@@ -1885,14 +2041,12 @@ _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_hand...@@ -1885,14 +2041,12 @@ _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_hand
1885}2041}
18862042
1887template <class _Tp, class _Compare, class _Allocator>2043template <class _Tp, class _Compare, class _Allocator>
1888template <class _Tree>2044template <class _Comp2>
1889_LIBCPP_HIDE_FROM_ABI void __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(_Tree& __source) {2045_LIBCPP_HIDE_FROM_ABI void
1890 static_assert(is_same<typename _Tree::__node_pointer, __node_pointer>::value, "");2046__tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(__tree<_Tp, _Comp2, _Allocator>& __source) {
18912047 for (iterator __i = __source.begin(); __i != __source.end();) {
1892 for (typename _Tree::iterator __i = __source.begin(); __i != __source.end();) {
1893 __node_pointer __src_ptr = __i.__get_np();2048 __node_pointer __src_ptr = __i.__get_np();
1894 __end_node_pointer __parent;2049 auto [__parent, __child] = __find_equal(__src_ptr->__get_value());
1895 __node_base_pointer& __child = __find_equal(__parent, __src_ptr->__value_);
1896 ++__i;2050 ++__i;
1897 if (__child != nullptr)2051 if (__child != nullptr)
1898 continue;2052 continue;
...@@ -1909,7 +2063,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh...@@ -1909,7 +2063,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh
1909 return end();2063 return end();
1910 __node_pointer __ptr = __nh.__ptr_;2064 __node_pointer __ptr = __nh.__ptr_;
1911 __end_node_pointer __parent;2065 __end_node_pointer __parent;
1912 __node_base_pointer& __child = __find_leaf_high(__parent, __ptr->__value_);2066 __node_base_pointer& __child = __find_leaf_high(__parent, __ptr->__get_value());
1913 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2067 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
1914 __nh.__release_ptr();2068 __nh.__release_ptr();
1915 return iterator(__ptr);2069 return iterator(__ptr);
...@@ -1924,21 +2078,20 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __h...@@ -1924,21 +2078,20 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __h
19242078
1925 __node_pointer __ptr = __nh.__ptr_;2079 __node_pointer __ptr = __nh.__ptr_;
1926 __end_node_pointer __parent;2080 __end_node_pointer __parent;
1927 __node_base_pointer& __child = __find_leaf(__hint, __parent, __ptr->__value_);2081 __node_base_pointer& __child = __find_leaf(__hint, __parent, __ptr->__get_value());
1928 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2082 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
1929 __nh.__release_ptr();2083 __nh.__release_ptr();
1930 return iterator(__ptr);2084 return iterator(__ptr);
1931}2085}
19322086
1933template <class _Tp, class _Compare, class _Allocator>2087template <class _Tp, class _Compare, class _Allocator>
1934template <class _Tree>2088template <class _Comp2>
1935_LIBCPP_HIDE_FROM_ABI void __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(_Tree& __source) {2089_LIBCPP_HIDE_FROM_ABI void
1936 static_assert(is_same<typename _Tree::__node_pointer, __node_pointer>::value, "");2090__tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(__tree<_Tp, _Comp2, _Allocator>& __source) {
19372091 for (iterator __i = __source.begin(); __i != __source.end();) {
1938 for (typename _Tree::iterator __i = __source.begin(); __i != __source.end();) {
1939 __node_pointer __src_ptr = __i.__get_np();2092 __node_pointer __src_ptr = __i.__get_np();
1940 __end_node_pointer __parent;2093 __end_node_pointer __parent;
1941 __node_base_pointer& __child = __find_leaf_high(__parent, __src_ptr->__value_);2094 __node_base_pointer& __child = __find_leaf_high(__parent, __src_ptr->__get_value());
1942 ++__i;2095 ++__i;
1943 __source.__remove_node_pointer(__src_ptr);2096 __source.__remove_node_pointer(__src_ptr);
1944 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__src_ptr));2097 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__src_ptr));
...@@ -1987,34 +2140,17 @@ __tree<_Tp, _Compare, _Allocator>::__erase_multi(const _Key& __k) {...@@ -1987,34 +2140,17 @@ __tree<_Tp, _Compare, _Allocator>::__erase_multi(const _Key& __k) {
1987 return __r;2140 return __r;
1988}2141}
19892142
1990template <class _Tp, class _Compare, class _Allocator>
1991template <class _Key>
1992typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::find(const _Key& __v) {
1993 iterator __p = __lower_bound(__v, __root(), __end_node());
1994 if (__p != end() && !value_comp()(__v, *__p))
1995 return __p;
1996 return end();
1997}
1998
1999template <class _Tp, class _Compare, class _Allocator>
2000template <class _Key>
2001typename __tree<_Tp, _Compare, _Allocator>::const_iterator
2002__tree<_Tp, _Compare, _Allocator>::find(const _Key& __v) const {
2003 const_iterator __p = __lower_bound(__v, __root(), __end_node());
2004 if (__p != end() && !value_comp()(__v, *__p))
2005 return __p;
2006 return end();
2007}
2008
2009template <class _Tp, class _Compare, class _Allocator>2143template <class _Tp, class _Compare, class _Allocator>
2010template <class _Key>2144template <class _Key>
2011typename __tree<_Tp, _Compare, _Allocator>::size_type2145typename __tree<_Tp, _Compare, _Allocator>::size_type
2012__tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {2146__tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {
2013 __node_pointer __rt = __root();2147 __node_pointer __rt = __root();
2148 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2014 while (__rt != nullptr) {2149 while (__rt != nullptr) {
2015 if (value_comp()(__k, __rt->__value_)) {2150 auto __comp_res = __comp(__k, __rt->__get_value());
2151 if (__comp_res.__less()) {
2016 __rt = static_cast<__node_pointer>(__rt->__left_);2152 __rt = static_cast<__node_pointer>(__rt->__left_);
2017 } else if (value_comp()(__rt->__value_, __k))2153 } else if (__comp_res.__greater())
2018 __rt = static_cast<__node_pointer>(__rt->__right_);2154 __rt = static_cast<__node_pointer>(__rt->__right_);
2019 else2155 else
2020 return 1;2156 return 1;
...@@ -2028,26 +2164,28 @@ typename __tree<_Tp, _Compare, _Allocator>::size_type...@@ -2028,26 +2164,28 @@ typename __tree<_Tp, _Compare, _Allocator>::size_type
2028__tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const {2164__tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const {
2029 __end_node_pointer __result = __end_node();2165 __end_node_pointer __result = __end_node();
2030 __node_pointer __rt = __root();2166 __node_pointer __rt = __root();
2167 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2031 while (__rt != nullptr) {2168 while (__rt != nullptr) {
2032 if (value_comp()(__k, __rt->__value_)) {2169 auto __comp_res = __comp(__k, __rt->__get_value());
2170 if (__comp_res.__less()) {
2033 __result = static_cast<__end_node_pointer>(__rt);2171 __result = static_cast<__end_node_pointer>(__rt);
2034 __rt = static_cast<__node_pointer>(__rt->__left_);2172 __rt = static_cast<__node_pointer>(__rt->__left_);
2035 } else if (value_comp()(__rt->__value_, __k))2173 } else if (__comp_res.__greater())
2036 __rt = static_cast<__node_pointer>(__rt->__right_);2174 __rt = static_cast<__node_pointer>(__rt->__right_);
2037 else2175 else
2038 return std::distance(2176 return std::distance(
2039 __lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),2177 __lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),
2040 __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result));2178 __upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));
2041 }2179 }
2042 return 0;2180 return 0;
2043}2181}
20442182
2045template <class _Tp, class _Compare, class _Allocator>2183template <class _Tp, class _Compare, class _Allocator>
2046template <class _Key>2184template <class _Key>
2047typename __tree<_Tp, _Compare, _Allocator>::iterator2185typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound_multi(
2048__tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v, __node_pointer __root, __end_node_pointer __result) {2186 const _Key& __v, __node_pointer __root, __end_node_pointer __result) {
2049 while (__root != nullptr) {2187 while (__root != nullptr) {
2050 if (!value_comp()(__root->__value_, __v)) {2188 if (!value_comp()(__root->__get_value(), __v)) {
2051 __result = static_cast<__end_node_pointer>(__root);2189 __result = static_cast<__end_node_pointer>(__root);
2052 __root = static_cast<__node_pointer>(__root->__left_);2190 __root = static_cast<__node_pointer>(__root->__left_);
2053 } else2191 } else
...@@ -2058,10 +2196,10 @@ __tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v, __node_pointer...@@ -2058,10 +2196,10 @@ __tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v, __node_pointer
20582196
2059template <class _Tp, class _Compare, class _Allocator>2197template <class _Tp, class _Compare, class _Allocator>
2060template <class _Key>2198template <class _Key>
2061typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound(2199typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound_multi(
2062 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {2200 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {
2063 while (__root != nullptr) {2201 while (__root != nullptr) {
2064 if (!value_comp()(__root->__value_, __v)) {2202 if (!value_comp()(__root->__get_value(), __v)) {
2065 __result = static_cast<__end_node_pointer>(__root);2203 __result = static_cast<__end_node_pointer>(__root);
2066 __root = static_cast<__node_pointer>(__root->__left_);2204 __root = static_cast<__node_pointer>(__root->__left_);
2067 } else2205 } else
...@@ -2072,10 +2210,10 @@ typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare,...@@ -2072,10 +2210,10 @@ typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare,
20722210
2073template <class _Tp, class _Compare, class _Allocator>2211template <class _Tp, class _Compare, class _Allocator>
2074template <class _Key>2212template <class _Key>
2075typename __tree<_Tp, _Compare, _Allocator>::iterator2213typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound_multi(
2076__tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v, __node_pointer __root, __end_node_pointer __result) {2214 const _Key& __v, __node_pointer __root, __end_node_pointer __result) {
2077 while (__root != nullptr) {2215 while (__root != nullptr) {
2078 if (value_comp()(__v, __root->__value_)) {2216 if (value_comp()(__v, __root->__get_value())) {
2079 __result = static_cast<__end_node_pointer>(__root);2217 __result = static_cast<__end_node_pointer>(__root);
2080 __root = static_cast<__node_pointer>(__root->__left_);2218 __root = static_cast<__node_pointer>(__root->__left_);
2081 } else2219 } else
...@@ -2086,10 +2224,10 @@ __tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v, __node_pointer...@@ -2086,10 +2224,10 @@ __tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v, __node_pointer
20862224
2087template <class _Tp, class _Compare, class _Allocator>2225template <class _Tp, class _Compare, class _Allocator>
2088template <class _Key>2226template <class _Key>
2089typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound(2227typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound_multi(
2090 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {2228 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {
2091 while (__root != nullptr) {2229 while (__root != nullptr) {
2092 if (value_comp()(__v, __root->__value_)) {2230 if (value_comp()(__v, __root->__get_value())) {
2093 __result = static_cast<__end_node_pointer>(__root);2231 __result = static_cast<__end_node_pointer>(__root);
2094 __root = static_cast<__node_pointer>(__root->__left_);2232 __root = static_cast<__node_pointer>(__root->__left_);
2095 } else2233 } else
...@@ -2102,14 +2240,16 @@ template <class _Tp, class _Compare, class _Allocator>...@@ -2102,14 +2240,16 @@ template <class _Tp, class _Compare, class _Allocator>
2102template <class _Key>2240template <class _Key>
2103pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>2241pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>
2104__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) {2242__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) {
2105 typedef pair<iterator, iterator> _Pp;2243 using _Pp = pair<iterator, iterator>;
2106 __end_node_pointer __result = __end_node();2244 __end_node_pointer __result = __end_node();
2107 __node_pointer __rt = __root();2245 __node_pointer __rt = __root();
2246 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2108 while (__rt != nullptr) {2247 while (__rt != nullptr) {
2109 if (value_comp()(__k, __rt->__value_)) {2248 auto __comp_res = __comp(__k, __rt->__get_value());
2249 if (__comp_res.__less()) {
2110 __result = static_cast<__end_node_pointer>(__rt);2250 __result = static_cast<__end_node_pointer>(__rt);
2111 __rt = static_cast<__node_pointer>(__rt->__left_);2251 __rt = static_cast<__node_pointer>(__rt->__left_);
2112 } else if (value_comp()(__rt->__value_, __k))2252 } else if (__comp_res.__greater())
2113 __rt = static_cast<__node_pointer>(__rt->__right_);2253 __rt = static_cast<__node_pointer>(__rt->__right_);
2114 else2254 else
2115 return _Pp(iterator(__rt),2255 return _Pp(iterator(__rt),
...@@ -2124,14 +2264,16 @@ template <class _Key>...@@ -2124,14 +2264,16 @@ template <class _Key>
2124pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,2264pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,
2125 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>2265 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>
2126__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {2266__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {
2127 typedef pair<const_iterator, const_iterator> _Pp;2267 using _Pp = pair<const_iterator, const_iterator>;
2128 __end_node_pointer __result = __end_node();2268 __end_node_pointer __result = __end_node();
2129 __node_pointer __rt = __root();2269 __node_pointer __rt = __root();
2270 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2130 while (__rt != nullptr) {2271 while (__rt != nullptr) {
2131 if (value_comp()(__k, __rt->__value_)) {2272 auto __comp_res = __comp(__k, __rt->__get_value());
2273 if (__comp_res.__less()) {
2132 __result = static_cast<__end_node_pointer>(__rt);2274 __result = static_cast<__end_node_pointer>(__rt);
2133 __rt = static_cast<__node_pointer>(__rt->__left_);2275 __rt = static_cast<__node_pointer>(__rt->__left_);
2134 } else if (value_comp()(__rt->__value_, __k))2276 } else if (__comp_res.__greater())
2135 __rt = static_cast<__node_pointer>(__rt->__right_);2277 __rt = static_cast<__node_pointer>(__rt->__right_);
2136 else2278 else
2137 return _Pp(2279 return _Pp(
...@@ -2146,18 +2288,21 @@ template <class _Tp, class _Compare, class _Allocator>...@@ -2146,18 +2288,21 @@ template <class _Tp, class _Compare, class _Allocator>
2146template <class _Key>2288template <class _Key>
2147pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>2289pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>
2148__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) {2290__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) {
2149 typedef pair<iterator, iterator> _Pp;2291 using _Pp = pair<iterator, iterator>;
2150 __end_node_pointer __result = __end_node();2292 __end_node_pointer __result = __end_node();
2151 __node_pointer __rt = __root();2293 __node_pointer __rt = __root();
2294 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2152 while (__rt != nullptr) {2295 while (__rt != nullptr) {
2153 if (value_comp()(__k, __rt->__value_)) {2296 auto __comp_res = __comp(__k, __rt->__get_value());
2297 if (__comp_res.__less()) {
2154 __result = static_cast<__end_node_pointer>(__rt);2298 __result = static_cast<__end_node_pointer>(__rt);
2155 __rt = static_cast<__node_pointer>(__rt->__left_);2299 __rt = static_cast<__node_pointer>(__rt->__left_);
2156 } else if (value_comp()(__rt->__value_, __k))2300 } else if (__comp_res.__greater())
2157 __rt = static_cast<__node_pointer>(__rt->__right_);2301 __rt = static_cast<__node_pointer>(__rt->__right_);
2158 else2302 else
2159 return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),2303 return _Pp(
2160 __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result));2304 __lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),
2305 __upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));
2161 }2306 }
2162 return _Pp(iterator(__result), iterator(__result));2307 return _Pp(iterator(__result), iterator(__result));
2163}2308}
...@@ -2167,18 +2312,21 @@ template <class _Key>...@@ -2167,18 +2312,21 @@ template <class _Key>
2167pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,2312pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,
2168 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>2313 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>
2169__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {2314__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {
2170 typedef pair<const_iterator, const_iterator> _Pp;2315 using _Pp = pair<const_iterator, const_iterator>;
2171 __end_node_pointer __result = __end_node();2316 __end_node_pointer __result = __end_node();
2172 __node_pointer __rt = __root();2317 __node_pointer __rt = __root();
2318 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2173 while (__rt != nullptr) {2319 while (__rt != nullptr) {
2174 if (value_comp()(__k, __rt->__value_)) {2320 auto __comp_res = __comp(__k, __rt->__get_value());
2321 if (__comp_res.__less()) {
2175 __result = static_cast<__end_node_pointer>(__rt);2322 __result = static_cast<__end_node_pointer>(__rt);
2176 __rt = static_cast<__node_pointer>(__rt->__left_);2323 __rt = static_cast<__node_pointer>(__rt->__left_);
2177 } else if (value_comp()(__rt->__value_, __k))2324 } else if (__comp_res.__greater())
2178 __rt = static_cast<__node_pointer>(__rt->__right_);2325 __rt = static_cast<__node_pointer>(__rt->__right_);
2179 else2326 else
2180 return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),2327 return _Pp(
2181 __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result));2328 __lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),
2329 __upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));
2182 }2330 }
2183 return _Pp(const_iterator(__result), const_iterator(__result));2331 return _Pp(const_iterator(__result), const_iterator(__result));
2184}2332}
...@@ -2187,13 +2335,13 @@ template <class _Tp, class _Compare, class _Allocator>...@@ -2187,13 +2335,13 @@ template <class _Tp, class _Compare, class _Allocator>
2187typename __tree<_Tp, _Compare, _Allocator>::__node_holder2335typename __tree<_Tp, _Compare, _Allocator>::__node_holder
2188__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT {2336__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT {
2189 __node_pointer __np = __p.__get_np();2337 __node_pointer __np = __p.__get_np();
2190 if (__begin_node() == __p.__ptr_) {2338 if (__begin_node_ == __p.__ptr_) {
2191 if (__np->__right_ != nullptr)2339 if (__np->__right_ != nullptr)
2192 __begin_node() = static_cast<__end_node_pointer>(__np->__right_);2340 __begin_node_ = static_cast<__end_node_pointer>(__np->__right_);
2193 else2341 else
2194 __begin_node() = static_cast<__end_node_pointer>(__np->__parent_);2342 __begin_node_ = static_cast<__end_node_pointer>(__np->__parent_);
2195 }2343 }
2196 --size();2344 --__size_;
2197 std::__tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__np));2345 std::__tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__np));
2198 return __node_holder(__np, _Dp(__node_alloc(), true));2346 return __node_holder(__np, _Dp(__node_alloc(), true));
2199}2347}
lib/libcxx/include/__tuple/sfinae_helpers.h+1-44
...@@ -10,20 +10,6 @@...@@ -10,20 +10,6 @@
10#define _LIBCPP___TUPLE_SFINAE_HELPERS_H10#define _LIBCPP___TUPLE_SFINAE_HELPERS_H
1111
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__fwd/tuple.h>
15#include <__tuple/make_tuple_types.h>
16#include <__tuple/tuple_element.h>
17#include <__tuple/tuple_like_ext.h>
18#include <__tuple/tuple_size.h>
19#include <__tuple/tuple_types.h>
20#include <__type_traits/conjunction.h>
21#include <__type_traits/enable_if.h>
22#include <__type_traits/integral_constant.h>
23#include <__type_traits/is_constructible.h>
24#include <__type_traits/is_same.h>
25#include <__type_traits/remove_cvref.h>
26#include <__type_traits/remove_reference.h>
2713
28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29# pragma GCC system_header15# pragma GCC system_header
...@@ -33,36 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -33,36 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3319
34#ifndef _LIBCPP_CXX03_LANG20#ifndef _LIBCPP_CXX03_LANG
3521
36struct __tuple_sfinae_base {22struct __check_tuple_constructor_fail {
37 template <template <class, class...> class _Trait, class... _LArgs, class... _RArgs>
38 static auto __do_test(__tuple_types<_LArgs...>,
39 __tuple_types<_RArgs...>) -> __all<__enable_if_t<_Trait<_LArgs, _RArgs>::value, bool>{true}...>;
40 template <template <class...> class>
41 static auto __do_test(...) -> false_type;
42
43 template <class _FromArgs, class _ToArgs>
44 using __constructible _LIBCPP_NODEBUG = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{}));
45};
46
47// __tuple_constructible
48
49template <class _Tp,
50 class _Up,
51 bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
52 bool = __tuple_like_ext<_Up>::value>
53struct __tuple_constructible : public false_type {};
54
55template <class _Tp, class _Up>
56struct __tuple_constructible<_Tp, _Up, true, true>
57 : public __tuple_sfinae_base::__constructible< typename __make_tuple_types<_Tp>::type,
58 typename __make_tuple_types<_Up>::type > {};
59
60template <size_t _Ip, class... _Tp>
61struct tuple_element<_Ip, tuple<_Tp...> > {
62 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, __tuple_types<_Tp...> >::type;
63};
64
65struct _LIBCPP_EXPORTED_FROM_ABI __check_tuple_constructor_fail {
66 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; }
67 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; }
68 template <class...>25 template <class...>
lib/libcxx/include/__tuple/tuple_element.h-12
...@@ -11,8 +11,6 @@...@@ -11,8 +11,6 @@
1111
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <__tuple/tuple_indices.h>
15#include <__tuple/tuple_types.h>
1614
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header16# pragma GCC system_header
...@@ -38,21 +36,11 @@ struct tuple_element<_Ip, const volatile _Tp> {...@@ -38,21 +36,11 @@ struct tuple_element<_Ip, const volatile _Tp> {
38 using type _LIBCPP_NODEBUG = const volatile typename tuple_element<_Ip, _Tp>::type;36 using type _LIBCPP_NODEBUG = const volatile typename tuple_element<_Ip, _Tp>::type;
39};37};
4038
41#ifndef _LIBCPP_CXX03_LANG
42
43template <size_t _Ip, class... _Types>
44struct tuple_element<_Ip, __tuple_types<_Types...> > {
45 static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
46 using type _LIBCPP_NODEBUG = __type_pack_element<_Ip, _Types...>;
47};
48
49# if _LIBCPP_STD_VER >= 1439# if _LIBCPP_STD_VER >= 14
50template <size_t _Ip, class... _Tp>40template <size_t _Ip, class... _Tp>
51using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element<_Ip, _Tp...>::type;41using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element<_Ip, _Tp...>::type;
52# endif42# endif
5343
54#endif // _LIBCPP_CXX03_LANG
55
56_LIBCPP_END_NAMESPACE_STD44_LIBCPP_END_NAMESPACE_STD
5745
58#endif // _LIBCPP___TUPLE_TUPLE_ELEMENT_H46#endif // _LIBCPP___TUPLE_TUPLE_ELEMENT_H
lib/libcxx/include/__tuple/tuple_size.h-4
...@@ -12,7 +12,6 @@...@@ -12,7 +12,6 @@
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <__fwd/tuple.h>14#include <__fwd/tuple.h>
15#include <__tuple/tuple_types.h>
16#include <__type_traits/enable_if.h>15#include <__type_traits/enable_if.h>
17#include <__type_traits/integral_constant.h>16#include <__type_traits/integral_constant.h>
18#include <__type_traits/is_const.h>17#include <__type_traits/is_const.h>
...@@ -59,9 +58,6 @@ struct tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};...@@ -59,9 +58,6 @@ struct tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
59template <class... _Tp>58template <class... _Tp>
60struct tuple_size<tuple<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};59struct tuple_size<tuple<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};
6160
62template <class... _Tp>
63struct tuple_size<__tuple_types<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};
64
65# if _LIBCPP_STD_VER >= 1761# if _LIBCPP_STD_VER >= 17
66template <class _Tp>62template <class _Tp>
67inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;63inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
lib/libcxx/include/__tuple/tuple_transform.h created+45
...@@ -0,0 +1,45 @@
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___TUPLE_TUPLE_TRANSFORM_H
11#define _LIBCPP___TUPLE_TUPLE_TRANSFORM_H
12
13#include <__config>
14
15#include <__functional/invoke.h>
16#include <__utility/forward.h>
17#include <tuple>
18
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header
21#endif
22
23_LIBCPP_PUSH_MACROS
24#include <__undef_macros>
25
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28#if _LIBCPP_STD_VER >= 23
29
30template <class _Fun, class _Tuple>
31_LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tuple) {
32 return std::apply(
33 [&]<class... _Types>(_Types&&... __elements) {
34 return tuple<invoke_result_t<_Fun&, _Types>...>(std::invoke(__f, std::forward<_Types>(__elements))...);
35 },
36 std::forward<_Tuple>(__tuple));
37}
38
39#endif // _LIBCPP_STD_VER >= 23
40
41_LIBCPP_END_NAMESPACE_STD
42
43_LIBCPP_POP_MACROS
44
45#endif // _LIBCPP___TUPLE_TUPLE_TRANSFORM_H
lib/libcxx/include/__type_traits/aligned_storage.h+13-40
...@@ -11,8 +11,6 @@...@@ -11,8 +11,6 @@
1111
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <__type_traits/integral_constant.h>
15#include <__type_traits/type_list.h>
1614
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header16# pragma GCC system_header
...@@ -21,10 +19,10 @@...@@ -21,10 +19,10 @@
21_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
2220
23template <class _Tp>21template <class _Tp>
24struct __align_type {22struct _ALIGNAS(_LIBCPP_PREFERRED_ALIGNOF(_Tp)) _AlignedAsT {};
25 static const size_t value = _LIBCPP_PREFERRED_ALIGNOF(_Tp);23
26 typedef _Tp type;24template <class... _Args>
27};25struct __max_align_impl : _AlignedAsT<_Args>... {};
2826
29struct __struct_double {27struct __struct_double {
30 long double __lx;28 long double __lx;
...@@ -33,41 +31,16 @@ struct __struct_double4 {...@@ -33,41 +31,16 @@ struct __struct_double4 {
33 double __lx[4];31 double __lx[4];
34};32};
3533
36using __all_types _LIBCPP_NODEBUG =34inline const size_t __aligned_storage_max_align =
37 __type_list<__align_type<unsigned char>,35 _LIBCPP_ALIGNOF(__max_align_impl<unsigned long long, double, long double, __struct_double, __struct_double4, int*>);
38 __align_type<unsigned short>,
39 __align_type<unsigned int>,
40 __align_type<unsigned long>,
41 __align_type<unsigned long long>,
42 __align_type<double>,
43 __align_type<long double>,
44 __align_type<__struct_double>,
45 __align_type<__struct_double4>,
46 __align_type<int*> >;
47
48template <class _TL, size_t _Len>
49struct __find_max_align;
50
51template <class _Head, size_t _Len>
52struct __find_max_align<__type_list<_Head>, _Len> : public integral_constant<size_t, _Head::value> {};
53
54template <size_t _Len, size_t _A1, size_t _A2>
55struct __select_align {
56private:
57 static const size_t __min = _A2 < _A1 ? _A2 : _A1;
58 static const size_t __max = _A1 < _A2 ? _A2 : _A1;
59
60public:
61 static const size_t value = _Len < __max ? __min : __max;
62};
6336
64template <class _Head, class... _Tail, size_t _Len>37template <size_t _Len>
65struct __find_max_align<__type_list<_Head, _Tail...>, _Len>38inline const size_t __aligned_storage_alignment =
66 : public integral_constant<39 _Len > __aligned_storage_max_align
67 size_t,40 ? __aligned_storage_max_align
68 __select_align<_Len, _Head::value, __find_max_align<__type_list<_Tail...>, _Len>::value>::value> {};41 : size_t(1) << ((sizeof(size_t) * __CHAR_BIT__) - __builtin_clzg(_Len) - 1);
6942
70template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>43template <size_t _Len, size_t _Align = __aligned_storage_alignment<_Len> >
71struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_storage {44struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_storage {
72 union _ALIGNAS(_Align) type {45 union _ALIGNAS(_Align) type {
73 unsigned char __data[(_Len + _Align - 1) / _Align * _Align];46 unsigned char __data[(_Len + _Align - 1) / _Align * _Align];
...@@ -77,7 +50,7 @@ struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_storage {...@@ -77,7 +50,7 @@ struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_storage {
77#if _LIBCPP_STD_VER >= 1450#if _LIBCPP_STD_VER >= 14
7851
79_LIBCPP_SUPPRESS_DEPRECATED_PUSH52_LIBCPP_SUPPRESS_DEPRECATED_PUSH
80template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>53template <size_t _Len, size_t _Align = __aligned_storage_alignment<_Len> >
81using aligned_storage_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_storage<_Len, _Align>::type;54using aligned_storage_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_storage<_Len, _Align>::type;
82_LIBCPP_SUPPRESS_DEPRECATED_POP55_LIBCPP_SUPPRESS_DEPRECATED_POP
8356
lib/libcxx/include/__type_traits/desugars_to.h+4
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#define _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H10#define _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H
1111
12#include <__config>12#include <__config>
13#include <__type_traits/integral_constant.h>
1314
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header16# pragma GCC system_header
...@@ -64,6 +65,9 @@ template <class _CanonicalTag, class _Operation, class... _Args>...@@ -64,6 +65,9 @@ template <class _CanonicalTag, class _Operation, class... _Args>
64inline const bool __desugars_to_v<_CanonicalTag, _Operation&&, _Args...> =65inline const bool __desugars_to_v<_CanonicalTag, _Operation&&, _Args...> =
65 __desugars_to_v<_CanonicalTag, _Operation, _Args...>;66 __desugars_to_v<_CanonicalTag, _Operation, _Args...>;
6667
68template <class _CanonicalTag, class _Operation, class... _Args>
69struct __desugars_to : integral_constant<bool, __desugars_to_v<_CanonicalTag, _Operation, _Args...> > {};
70
67_LIBCPP_END_NAMESPACE_STD71_LIBCPP_END_NAMESPACE_STD
6872
69#endif // _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H73#endif // _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H
lib/libcxx/include/__type_traits/invoke.h+8
...@@ -62,6 +62,9 @@...@@ -62,6 +62,9 @@
62//62//
63// template <class Func, class... Args>63// template <class Func, class... Args>
64// using __invoke_result_t = invoke_result_t<Func, Args...>;64// using __invoke_result_t = invoke_result_t<Func, Args...>;
65//
66// template <class Ret, class Func, class... Args>
67// struct __is_invocable_r : is_invocable_r<Ret, Func, Args...> {};
6568
66_LIBCPP_BEGIN_NAMESPACE_STD69_LIBCPP_BEGIN_NAMESPACE_STD
6770
...@@ -112,8 +115,10 @@ inline const bool __is_invocable_r_v = __is_invocable_r_impl<_Ret, __is_invocabl...@@ -112,8 +115,10 @@ inline const bool __is_invocable_r_v = __is_invocable_r_impl<_Ret, __is_invocabl
112template <bool __is_invocable, class... _Args>115template <bool __is_invocable, class... _Args>
113inline const bool __is_nothrow_invocable_impl = false;116inline const bool __is_nothrow_invocable_impl = false;
114117
118# ifndef _LIBCPP_CXX03_LANG
115template <class... _Args>119template <class... _Args>
116inline const bool __is_nothrow_invocable_impl<true, _Args...> = noexcept(__builtin_invoke(std::declval<_Args>()...));120inline const bool __is_nothrow_invocable_impl<true, _Args...> = noexcept(__builtin_invoke(std::declval<_Args>()...));
121# endif
117122
118template <class... _Args>123template <class... _Args>
119inline const bool __is_nothrow_invocable_v = __is_nothrow_invocable_impl<__is_invocable_v<_Args...>, _Args...>;124inline const bool __is_nothrow_invocable_v = __is_nothrow_invocable_impl<__is_invocable_v<_Args...>, _Args...>;
...@@ -327,6 +332,9 @@ using __invoke_result_t _LIBCPP_NODEBUG = typename __invoke_result<_Func, _Args....@@ -327,6 +332,9 @@ using __invoke_result_t _LIBCPP_NODEBUG = typename __invoke_result<_Func, _Args.
327332
328#endif // __has_builtin(__builtin_invoke_r)333#endif // __has_builtin(__builtin_invoke_r)
329334
335template <class _Ret, class _Func, class... _Args>
336struct __is_invocable_r : integral_constant<bool, __is_invocable_r_v<_Ret, _Func, _Args...> > {};
337
330template <class _Ret, bool = is_void<_Ret>::value>338template <class _Ret, bool = is_void<_Ret>::value>
331struct __invoke_void_return_wrapper {339struct __invoke_void_return_wrapper {
332 template <class... _Args>340 template <class... _Args>
lib/libcxx/include/__type_traits/is_allocator.h+6-7
...@@ -11,7 +11,6 @@...@@ -11,7 +11,6 @@
1111
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <__type_traits/integral_constant.h>
15#include <__type_traits/void_t.h>14#include <__type_traits/void_t.h>
16#include <__utility/declval.h>15#include <__utility/declval.h>
1716
...@@ -21,13 +20,13 @@...@@ -21,13 +20,13 @@
2120
22_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2322
24template <typename _Alloc, typename = void, typename = void>23template <class _Alloc, class = void, class = void>
25struct __is_allocator : false_type {};24inline const bool __is_allocator_v = false;
2625
27template <typename _Alloc>26template <class _Alloc>
28struct __is_allocator<_Alloc,27inline const bool __is_allocator_v<_Alloc,
29 __void_t<typename _Alloc::value_type>,28 __void_t<typename _Alloc::value_type>,
30 __void_t<decltype(std::declval<_Alloc&>().allocate(size_t(0)))> > : true_type {};29 __void_t<decltype(std::declval<_Alloc&>().allocate(size_t()))> > = true;
3130
32_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
3332
lib/libcxx/include/__type_traits/is_array.h+26
...@@ -26,6 +26,32 @@ template <class _Tp>...@@ -26,6 +26,32 @@ template <class _Tp>
26_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_array_v = __is_array(_Tp);26_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_array_v = __is_array(_Tp);
27#endif27#endif
2828
29template <class _Tp>
30inline const bool __is_bounded_array_v = __is_bounded_array(_Tp);
31
32#if _LIBCPP_STD_VER >= 20
33
34template <class _Tp>
35struct _LIBCPP_NO_SPECIALIZATIONS is_bounded_array : bool_constant<__is_bounded_array(_Tp)> {};
36
37template <class _Tp>
38_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
39
40#endif
41
42template <class _Tp>
43inline const bool __is_unbounded_array_v = __is_unbounded_array(_Tp);
44
45#if _LIBCPP_STD_VER >= 20
46
47template <class _Tp>
48struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : bool_constant<__is_unbounded_array(_Tp)> {};
49
50template <class _Tp>
51_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
52
53#endif
54
29_LIBCPP_END_NAMESPACE_STD55_LIBCPP_END_NAMESPACE_STD
3056
31#endif // _LIBCPP___TYPE_TRAITS_IS_ARRAY_H57#endif // _LIBCPP___TYPE_TRAITS_IS_ARRAY_H
lib/libcxx/include/__type_traits/is_equality_comparable.h+16-21
...@@ -27,11 +27,11 @@...@@ -27,11 +27,11 @@
27_LIBCPP_BEGIN_NAMESPACE_STD27_LIBCPP_BEGIN_NAMESPACE_STD
2828
29template <class _Tp, class _Up, class = void>29template <class _Tp, class _Up, class = void>
30struct __is_equality_comparable : false_type {};30inline const bool __is_equality_comparable_v = false;
3131
32template <class _Tp, class _Up>32template <class _Tp, class _Up>
33struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() == std::declval<_Up>())> > : true_type {33inline const bool
34};34 __is_equality_comparable_v<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() == std::declval<_Up>())> > = true;
3535
36// A type is_trivially_equality_comparable if the expression `a == b` is equivalent to `std::memcmp(&a, &b, sizeof(T))`36// A type is_trivially_equality_comparable if the expression `a == b` is equivalent to `std::memcmp(&a, &b, sizeof(T))`
37// (with `a` and `b` being of type `T`). For the case where we compare two object of the same type, we can use37// (with `a` and `b` being of type `T`). For the case where we compare two object of the same type, we can use
...@@ -48,40 +48,35 @@ struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>()...@@ -48,40 +48,35 @@ struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>()
48// representation may not be equivalent.48// representation may not be equivalent.
4949
50template <class _Tp, class _Up, class = void>50template <class _Tp, class _Up, class = void>
51struct __libcpp_is_trivially_equality_comparable_impl : false_type {};51inline const bool __is_trivially_equality_comparable_impl = false;
5252
53template <class _Tp>53template <class _Tp>
54struct __libcpp_is_trivially_equality_comparable_impl<_Tp, _Tp>54inline const bool __is_trivially_equality_comparable_impl<_Tp, _Tp>
55#if __has_builtin(__is_trivially_equality_comparable)55#if __has_builtin(__is_trivially_equality_comparable)
56 : integral_constant<bool, __is_trivially_equality_comparable(_Tp) && __is_equality_comparable<_Tp, _Tp>::value> {56 = __is_trivially_equality_comparable(_Tp) && __is_equality_comparable_v<_Tp, _Tp>;
57};
58#else57#else
59 : is_integral<_Tp> {58 = is_integral<_Tp>::value;
60};
61#endif // __has_builtin(__is_trivially_equality_comparable)59#endif // __has_builtin(__is_trivially_equality_comparable)
6260
63template <class _Tp, class _Up>61template <class _Tp, class _Up>
64struct __libcpp_is_trivially_equality_comparable_impl<62inline const bool __is_trivially_equality_comparable_impl<
65 _Tp,63 _Tp,
66 _Up,64 _Up,
67 __enable_if_t<is_integral<_Tp>::value && is_integral<_Up>::value && !is_same<_Tp, _Up>::value &&65 __enable_if_t<is_integral<_Tp>::value && is_integral<_Up>::value && !is_same<_Tp, _Up>::value> > =
68 is_signed<_Tp>::value == is_signed<_Up>::value && sizeof(_Tp) == sizeof(_Up)> > : true_type {};66 is_signed<_Tp>::value == is_signed<_Up>::value && sizeof(_Tp) == sizeof(_Up);
6967
70template <class _Tp>68template <class _Tp>
71struct __libcpp_is_trivially_equality_comparable_impl<_Tp*, _Tp*> : true_type {};69inline const bool __is_trivially_equality_comparable_impl<_Tp*, _Tp*> = true;
7270
73// TODO: Use is_pointer_inverconvertible_base_of71// TODO: Use is_pointer_inverconvertible_base_of
74template <class _Tp, class _Up>72template <class _Tp, class _Up>
75struct __libcpp_is_trivially_equality_comparable_impl<_Tp*, _Up*>73inline const bool __is_trivially_equality_comparable_impl<_Tp*, _Up*> =
76 : integral_constant<74 __is_equality_comparable_v<_Tp*, _Up*> &&
77 bool,75 (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value || is_void<_Tp>::value || is_void<_Up>::value);
78 __is_equality_comparable<_Tp*, _Up*>::value &&
79 (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value || is_void<_Tp>::value || is_void<_Up>::value)> {
80};
8176
82template <class _Tp, class _Up>77template <class _Tp, class _Up>
83using __libcpp_is_trivially_equality_comparable _LIBCPP_NODEBUG =78inline const bool __is_trivially_equality_comparable_v =
84 __libcpp_is_trivially_equality_comparable_impl<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >;79 __is_trivially_equality_comparable_impl<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >;
8580
86_LIBCPP_END_NAMESPACE_STD81_LIBCPP_END_NAMESPACE_STD
8782
lib/libcxx/include/__type_traits/is_final.h+1-1
...@@ -19,7 +19,7 @@...@@ -19,7 +19,7 @@
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
2020
21template <class _Tp>21template <class _Tp>
22struct __libcpp_is_final : integral_constant<bool, __is_final(_Tp)> {};22inline const bool __is_final_v = __is_final(_Tp);
2323
24#if _LIBCPP_STD_VER >= 1424#if _LIBCPP_STD_VER >= 14
25template <class _Tp>25template <class _Tp>
lib/libcxx/include/__type_traits/is_floating_point.h+7-6
...@@ -20,18 +20,19 @@...@@ -20,18 +20,19 @@
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2121
22// clang-format off22// clang-format off
23template <class _Tp> struct __libcpp_is_floating_point : false_type {};23template <class _Tp> inline const bool __is_floating_point_impl = false;
24template <> struct __libcpp_is_floating_point<float> : true_type {};24template <> inline const bool __is_floating_point_impl<float> = true;
25template <> struct __libcpp_is_floating_point<double> : true_type {};25template <> inline const bool __is_floating_point_impl<double> = true;
26template <> struct __libcpp_is_floating_point<long double> : true_type {};26template <> inline const bool __is_floating_point_impl<long double> = true;
27// clang-format on27// clang-format on
2828
29template <class _Tp>29template <class _Tp>
30struct _LIBCPP_NO_SPECIALIZATIONS is_floating_point : __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};30struct _LIBCPP_NO_SPECIALIZATIONS is_floating_point
31 : integral_constant<bool, __is_floating_point_impl<__remove_cv_t<_Tp> > > {};
3132
32#if _LIBCPP_STD_VER >= 1733#if _LIBCPP_STD_VER >= 17
33template <class _Tp>34template <class _Tp>
34_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;35_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_floating_point_v = __is_floating_point_impl<__remove_cv_t<_Tp>>;
35#endif36#endif
3637
37_LIBCPP_END_NAMESPACE_STD38_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__type_traits/is_generic_transparent_comparator.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_GENERIC_TRANSPARENT_COMPARATOR_H
10#define _LIBCPP___TYPE_TRAITS_IS_GENERIC_TRANSPARENT_COMPARATOR_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
20// This trait returns true if the given _Comparator is known to accept any two types for comparison. This is separate
21// from `__is_transparent_v`, since that only enables overloads of specific functions, but doesn't give any semantic
22// guarantees. This trait guarantess that the comparator simply calls the appropriate comparison functions for any two
23// types.
24
25template <class _Comparator>
26inline const bool __is_generic_transparent_comparator_v = false;
27
28_LIBCPP_END_NAMESPACE_STD
29
30#endif // _LIBCPP___TYPE_TRAITS_IS_GENERIC_TRANSPARENT_COMPARATOR_H
lib/libcxx/include/__type_traits/is_specialization.h+2-6
...@@ -30,15 +30,11 @@...@@ -30,15 +30,11 @@
3030
31_LIBCPP_BEGIN_NAMESPACE_STD31_LIBCPP_BEGIN_NAMESPACE_STD
3232
33#if _LIBCPP_STD_VER >= 17
34
35template <class _Tp, template <class...> class _Template>33template <class _Tp, template <class...> class _Template>
36inline constexpr bool __is_specialization_v = false; // true if and only if _Tp is a specialization of _Template34inline const bool __is_specialization_v = false; // true if and only if _Tp is a specialization of _Template
3735
38template <template <class...> class _Template, class... _Args>36template <template <class...> class _Template, class... _Args>
39inline constexpr bool __is_specialization_v<_Template<_Args...>, _Template> = true;37inline const bool __is_specialization_v<_Template<_Args...>, _Template> = true;
40
41#endif // _LIBCPP_STD_VER >= 17
4238
43_LIBCPP_END_NAMESPACE_STD39_LIBCPP_END_NAMESPACE_STD
4440
lib/libcxx/include/__type_traits/is_within_lifetime.h created+29
...@@ -0,0 +1,29 @@
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_WITHIN_LIFETIME_H
10#define _LIBCPP___TYPE_TRAITS_IS_WITHIN_LIFETIME_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
20#if _LIBCPP_STD_VER >= 26 && __has_builtin(__builtin_is_within_lifetime)
21template <class _Tp>
22_LIBCPP_HIDE_FROM_ABI consteval bool is_within_lifetime(const _Tp* __p) noexcept {
23 return __builtin_is_within_lifetime(__p);
24}
25#endif
26
27_LIBCPP_END_NAMESPACE_STD
28
29#endif // _LIBCPP___TYPE_TRAITS_IS_WITHIN_LIFETIME_H
lib/libcxx/include/__type_traits/make_transparent.h created+52
...@@ -0,0 +1,52 @@
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_MAKE_TRANSPARENT_H
10#define _LIBCPP___TYPE_TRAITS_MAKE_TRANSPARENT_H
11
12#include <__config>
13#include <__type_traits/enable_if.h>
14#include <__type_traits/is_empty.h>
15#include <__type_traits/is_same.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
23// __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 a
25// std::string).
26
27template <class _Tp, class _Comparator>
28struct __make_transparent {
29 using type _LIBCPP_NODEBUG = _Comparator;
30};
31
32template <class _Tp, class _Comparator>
33using __make_transparent_t _LIBCPP_NODEBUG = typename __make_transparent<_Tp, _Comparator>::type;
34
35template <class _Tp,
36 class _Comparator,
37 __enable_if_t<is_same<_Comparator, __make_transparent_t<_Tp, _Comparator> >::value, int> = 0>
38_LIBCPP_HIDE_FROM_ABI _Comparator& __as_transparent(_Comparator& __comp) {
39 return __comp;
40}
41
42template <class _Tp,
43 class _Comparator,
44 __enable_if_t<!is_same<_Comparator, __make_transparent_t<_Tp, _Comparator> >::value, int> = 0>
45_LIBCPP_HIDE_FROM_ABI __make_transparent_t<_Tp, _Comparator> __as_transparent(_Comparator&) {
46 static_assert(is_empty<_Comparator>::value);
47 return __make_transparent_t<_Tp, _Comparator>();
48}
49
50_LIBCPP_END_NAMESPACE_STD
51
52#endif // _LIBCPP___TYPE_TRAITS_MAKE_TRANSPARENT_H
lib/libcxx/include/__type_traits/reference_constructs_from_temporary.h+1-7
...@@ -18,7 +18,7 @@...@@ -18,7 +18,7 @@
1818
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
2020
21#if _LIBCPP_STD_VER >= 23 && __has_builtin(__reference_constructs_from_temporary)21#if _LIBCPP_STD_VER >= 23
2222
23template <class _Tp, class _Up>23template <class _Tp, class _Up>
24struct _LIBCPP_NO_SPECIALIZATIONS reference_constructs_from_temporary24struct _LIBCPP_NO_SPECIALIZATIONS reference_constructs_from_temporary
...@@ -30,14 +30,8 @@ _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool reference_constructs_from_tempo...@@ -30,14 +30,8 @@ _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool reference_constructs_from_tempo
3030
31#endif31#endif
3232
33#if __has_builtin(__reference_constructs_from_temporary)
34template <class _Tp, class _Up>33template <class _Tp, class _Up>
35inline const bool __reference_constructs_from_temporary_v = __reference_constructs_from_temporary(_Tp, _Up);34inline const bool __reference_constructs_from_temporary_v = __reference_constructs_from_temporary(_Tp, _Up);
36#else
37// TODO(LLVM 22): Remove this as all supported compilers should have __reference_constructs_from_temporary implemented.
38template <class _Tp, class _Up>
39inline const bool __reference_constructs_from_temporary_v = __reference_binds_to_temporary(_Tp, _Up);
40#endif
4135
42_LIBCPP_END_NAMESPACE_STD36_LIBCPP_END_NAMESPACE_STD
4337
lib/libcxx/include/__type_traits/reference_converts_from_temporary.h+1-1
...@@ -18,7 +18,7 @@...@@ -18,7 +18,7 @@
1818
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
2020
21#if _LIBCPP_STD_VER >= 23 && __has_builtin(__reference_converts_from_temporary)21#if _LIBCPP_STD_VER >= 23
2222
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
lib/libcxx/include/__utility/cmp.h+19-7
...@@ -26,10 +26,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -26,10 +26,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2626
27#if _LIBCPP_STD_VER >= 2027#if _LIBCPP_STD_VER >= 20
2828
29template <typename _Tp, typename _Ip>
30concept __comparison_can_promote_to =
31 sizeof(_Tp) < sizeof(_Ip) || (sizeof(_Tp) == sizeof(_Ip) && __signed_integer<_Tp>);
32
29template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>33template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
30_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept {34[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept {
31 if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)35 if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
32 return __t == __u;36 return __t == __u;
37 else if constexpr (__comparison_can_promote_to<_Tp, int> && __comparison_can_promote_to<_Up, int>)
38 return static_cast<int>(__t) == static_cast<int>(__u);
39 else if constexpr (__comparison_can_promote_to<_Tp, long long> && __comparison_can_promote_to<_Up, long long>)
40 return static_cast<long long>(__t) == static_cast<long long>(__u);
33 else if constexpr (is_signed_v<_Tp>)41 else if constexpr (is_signed_v<_Tp>)
34 return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u;42 return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u;
35 else43 else
...@@ -37,14 +45,18 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept {...@@ -37,14 +45,18 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept {
37}45}
3846
39template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>47template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
40_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept {48[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept {
41 return !std::cmp_equal(__t, __u);49 return !std::cmp_equal(__t, __u);
42}50}
4351
44template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>52template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
45_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept {53[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept {
46 if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)54 if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
47 return __t < __u;55 return __t < __u;
56 else if constexpr (__comparison_can_promote_to<_Tp, int> && __comparison_can_promote_to<_Up, int>)
57 return static_cast<int>(__t) < static_cast<int>(__u);
58 else if constexpr (__comparison_can_promote_to<_Tp, long long> && __comparison_can_promote_to<_Up, long long>)
59 return static_cast<long long>(__t) < static_cast<long long>(__u);
48 else if constexpr (is_signed_v<_Tp>)60 else if constexpr (is_signed_v<_Tp>)
49 return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u;61 return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u;
50 else62 else
...@@ -52,22 +64,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept {...@@ -52,22 +64,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept {
52}64}
5365
54template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>66template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
55_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept {67[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept {
56 return std::cmp_less(__u, __t);68 return std::cmp_less(__u, __t);
57}69}
5870
59template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>71template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
60_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept {72[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept {
61 return !std::cmp_greater(__t, __u);73 return !std::cmp_greater(__t, __u);
62}74}
6375
64template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>76template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
65_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept {77[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept {
66 return !std::cmp_less(__t, __u);78 return !std::cmp_less(__t, __u);
67}79}
6880
69template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>81template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
70_LIBCPP_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept {82[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept {
71 return std::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&83 return std::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
72 std::cmp_greater_equal(__u, numeric_limits<_Tp>::min());84 std::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
73}85}
lib/libcxx/include/__utility/default_three_way_comparator.h created+70
...@@ -0,0 +1,70 @@
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_DEFAULT_THREE_WAY_COMPARATOR_H
10#define _LIBCPP___UTILITY_DEFAULT_THREE_WAY_COMPARATOR_H
11
12#include <__config>
13#include <__type_traits/enable_if.h>
14#include <__type_traits/is_arithmetic.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
22// This struct can be specialized to provide a three way comparator between _LHS and _RHS.
23// The return value should be
24// - less than zero if (lhs_val < rhs_val)
25// - greater than zero if (rhs_val < lhs_val)
26// - zero otherwise
27template <class _LHS, class _RHS, class = void>
28struct __default_three_way_comparator;
29
30template <class _LHS, class _RHS>
31struct __default_three_way_comparator<_LHS,
32 _RHS,
33 __enable_if_t<is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value> > {
34 _LIBCPP_HIDE_FROM_ABI static int operator()(_LHS __lhs, _RHS __rhs) {
35 if (__lhs < __rhs)
36 return -1;
37 if (__lhs > __rhs)
38 return 1;
39 return 0;
40 }
41};
42
43#if _LIBCPP_STD_VER >= 20 && __has_builtin(__builtin_lt_synthesizes_from_spaceship)
44template <class _LHS, class _RHS>
45struct __default_three_way_comparator<
46 _LHS,
47 _RHS,
48 __enable_if_t<!(is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value) &&
49 __builtin_lt_synthesizes_from_spaceship(const _LHS&, const _RHS&)>> {
50 _LIBCPP_HIDE_FROM_ABI static int operator()(const _LHS& __lhs, const _RHS& __rhs) {
51 auto __res = __lhs <=> __rhs;
52 if (__res < 0)
53 return -1;
54 if (__res > 0)
55 return 1;
56 return 0;
57 }
58};
59#endif
60
61template <class _LHS, class _RHS, bool = true>
62struct __has_default_three_way_comparator : false_type {};
63
64template <class _LHS, class _RHS>
65struct __has_default_three_way_comparator<_LHS, _RHS, sizeof(__default_three_way_comparator<_LHS, _RHS>) >= 0>
66 : true_type {};
67
68_LIBCPP_END_NAMESPACE_STD
69
70#endif // _LIBCPP___UTILITY_DEFAULT_THREE_WAY_COMPARATOR_H
lib/libcxx/include/__utility/in_place.h+1-1
...@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
23#if _LIBCPP_STD_VER >= 1723#if _LIBCPP_STD_VER >= 17
2424
25struct _LIBCPP_EXPORTED_FROM_ABI in_place_t {25struct in_place_t {
26 explicit in_place_t() = default;26 explicit in_place_t() = default;
27};27};
28inline constexpr in_place_t in_place{};28inline constexpr in_place_t in_place{};
lib/libcxx/include/__utility/integer_sequence.h+56-41
...@@ -11,63 +11,52 @@...@@ -11,63 +11,52 @@
1111
12#include <__config>12#include <__config>
13#include <__cstddef/size_t.h>13#include <__cstddef/size_t.h>
14#include <__tuple/tuple_element.h>
15#include <__tuple/tuple_size.h>
14#include <__type_traits/is_integral.h>16#include <__type_traits/is_integral.h>
1517
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header19# pragma GCC system_header
18#endif20#endif
1921
22#ifndef _LIBCPP_CXX03_LANG
23
20_LIBCPP_BEGIN_NAMESPACE_STD24_LIBCPP_BEGIN_NAMESPACE_STD
2125
22template <size_t...>26# if __has_builtin(__make_integer_seq)
23struct __tuple_indices;27template <template <class _Tp, _Tp...> class _BaseType, class _Tp, _Tp _SequenceSize>
28using __make_integer_sequence_impl _LIBCPP_NODEBUG = __make_integer_seq<_BaseType, _Tp, _SequenceSize>;
29# else
30template <template <class _Tp, _Tp...> class _BaseType, class _Tp, _Tp _SequenceSize>
31using __make_integer_sequence_impl _LIBCPP_NODEBUG = _BaseType<_Tp, __integer_pack(_SequenceSize)...>;
32# endif
2433
25template <class _IdxType, _IdxType... _Values>34template <class _Tp, _Tp... _Indices>
26struct __integer_sequence {35struct __integer_sequence {
27 template <template <class _OIdxType, _OIdxType...> class _ToIndexSeq, class _ToIndexType>36 using value_type = _Tp;
28 using __convert _LIBCPP_NODEBUG = _ToIndexSeq<_ToIndexType, _Values...>;37 static_assert(is_integral<_Tp>::value, "std::integer_sequence can only be instantiated with an integral type");
2938 [[__nodiscard__]] static _LIBCPP_HIDE_FROM_ABI constexpr size_t size() noexcept { return sizeof...(_Indices); }
30 template <size_t _Sp>
31 using __to_tuple_indices _LIBCPP_NODEBUG = __tuple_indices<(_Values + _Sp)...>;
32};39};
3340
34#if __has_builtin(__make_integer_seq)41template <size_t... _Indices>
35template <size_t _Ep, size_t _Sp>42using __index_sequence _LIBCPP_NODEBUG = __integer_sequence<size_t, _Indices...>;
36using __make_indices_imp _LIBCPP_NODEBUG =
37 typename __make_integer_seq<__integer_sequence, size_t, _Ep - _Sp>::template __to_tuple_indices<_Sp>;
38#elif __has_builtin(__integer_pack)
39template <size_t _Ep, size_t _Sp>
40using __make_indices_imp _LIBCPP_NODEBUG =
41 typename __integer_sequence<size_t, __integer_pack(_Ep - _Sp)...>::template __to_tuple_indices<_Sp>;
42#else
43# error "No known way to get an integer pack from the compiler"
44#endif
4543
46#if _LIBCPP_STD_VER >= 1444template <size_t _SequenceSize>
45using __make_index_sequence _LIBCPP_NODEBUG = __make_integer_sequence_impl<__integer_sequence, size_t, _SequenceSize>;
4746
48template <class _Tp, _Tp... _Ip>47template <class... _Args>
49struct integer_sequence {48using __index_sequence_for _LIBCPP_NODEBUG = __make_index_sequence<sizeof...(_Args)>;
50 typedef _Tp value_type;49
51 static_assert(is_integral<_Tp>::value, "std::integer_sequence can only be instantiated with an integral type");50# if _LIBCPP_STD_VER >= 14
52 static _LIBCPP_HIDE_FROM_ABI constexpr size_t size() noexcept { return sizeof...(_Ip); }51
53};52template <class _Tp, _Tp... _Indices>
53struct integer_sequence : __integer_sequence<_Tp, _Indices...> {};
5454
55template <size_t... _Ip>55template <size_t... _Ip>
56using index_sequence = integer_sequence<size_t, _Ip...>;56using index_sequence = integer_sequence<size_t, _Ip...>;
5757
58# if __has_builtin(__make_integer_seq)
59
60template <class _Tp, _Tp _Ep>58template <class _Tp, _Tp _Ep>
61using make_integer_sequence _LIBCPP_NODEBUG = __make_integer_seq<integer_sequence, _Tp, _Ep>;59using make_integer_sequence _LIBCPP_NODEBUG = __make_integer_sequence_impl<integer_sequence, _Tp, _Ep>;
62
63# elif __has_builtin(__integer_pack)
64
65template <class _Tp, _Tp _SequenceSize>
66using make_integer_sequence _LIBCPP_NODEBUG = integer_sequence<_Tp, __integer_pack(_SequenceSize)...>;
67
68# else
69# error "No known way to get an integer pack from the compiler"
70# endif
7160
72template <size_t _Np>61template <size_t _Np>
73using make_index_sequence = make_integer_sequence<size_t, _Np>;62using make_index_sequence = make_integer_sequence<size_t, _Np>;
...@@ -75,16 +64,42 @@ using make_index_sequence = make_integer_sequence<size_t, _Np>;...@@ -75,16 +64,42 @@ using make_index_sequence = make_integer_sequence<size_t, _Np>;
75template <class... _Tp>64template <class... _Tp>
76using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;65using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
7766
78# if _LIBCPP_STD_VER >= 2067# if _LIBCPP_STD_VER >= 20
79// Executes __func for every element in an index_sequence.68// Executes __func for every element in an index_sequence.
80template <size_t... _Index, class _Function>69template <size_t... _Index, class _Function>
81_LIBCPP_HIDE_FROM_ABI constexpr void __for_each_index_sequence(index_sequence<_Index...>, _Function __func) {70_LIBCPP_HIDE_FROM_ABI constexpr void __for_each_index_sequence(index_sequence<_Index...>, _Function __func) {
82 (__func.template operator()<_Index>(), ...);71 (__func.template operator()<_Index>(), ...);
83}72}
84# endif // _LIBCPP_STD_VER >= 2073# endif // _LIBCPP_STD_VER >= 20
74
75# if _LIBCPP_STD_VER >= 26
76// [intseq.binding], structured binding support
77template <class _Tp, _Tp... _Indices>
78struct tuple_size<integer_sequence<_Tp, _Indices...>> : integral_constant<size_t, sizeof...(_Indices)> {};
8579
86#endif // _LIBCPP_STD_VER >= 1480template <size_t _Ip, class _Tp, _Tp... _Indices>
81struct tuple_element<_Ip, integer_sequence<_Tp, _Indices...>> {
82 static_assert(_Ip < sizeof...(_Indices), "Index out of bounds in std::tuple_element<> (std::integer_sequence)");
83 using type _LIBCPP_NODEBUG = _Tp;
84};
85
86template <size_t _Ip, class _Tp, _Tp... _Indices>
87struct tuple_element<_Ip, const integer_sequence<_Tp, _Indices...>> {
88 static_assert(_Ip < sizeof...(_Indices), "Index out of bounds in std::tuple_element<> (const std::integer_sequence)");
89 using type _LIBCPP_NODEBUG = _Tp;
90};
91
92template <size_t _Ip, class _Tp, _Tp... _Indices>
93[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp get(integer_sequence<_Tp, _Indices...>) noexcept {
94 static_assert(_Ip < sizeof...(_Indices), "Index out of bounds in std::get<> (std::integer_sequence)");
95 return _Indices...[_Ip];
96}
97# endif // _LIBCPP_STD_VER >= 26
98
99# endif // _LIBCPP_STD_VER >= 14
87100
88_LIBCPP_END_NAMESPACE_STD101_LIBCPP_END_NAMESPACE_STD
89102
103#endif // _LIBCPP_CXX03_LANG
104
90#endif // _LIBCPP___UTILITY_INTEGER_SEQUENCE_H105#endif // _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
lib/libcxx/include/__utility/lazy_synth_three_way_comparator.h created+120
...@@ -0,0 +1,120 @@
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_LAZY_SYNTH_THREE_WAY_COMPARATOR_H
10#define _LIBCPP___UTILITY_LAZY_SYNTH_THREE_WAY_COMPARATOR_H
11
12#include <__assert>
13#include <__config>
14#include <__type_traits/conjunction.h>
15#include <__type_traits/desugars_to.h>
16#include <__type_traits/enable_if.h>
17#include <__utility/default_three_way_comparator.h>
18
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header
21#endif
22
23// This file implements a __lazy_synth_three_way_comparator, which tries to build an efficient three way comparison from
24// a binary comparator. That is done in multiple steps:
25// 1) Check whether the comparator desugars to a less-than operator
26// If that is the case, check whether there exists a specialization of `__default_three_way_comparator`, which
27// can be specialized to implement a three way comparator for the specific types.
28// 2) Fall back to doing a lazy less than/greater than comparison
29
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32template <class _Comparator, class _LHS, class _RHS>
33struct __lazy_compare_result {
34 const _Comparator& __comp_;
35 const _LHS& __lhs_;
36 const _RHS& __rhs_;
37
38 _LIBCPP_HIDE_FROM_ABI
39 __lazy_compare_result(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator& __comp,
40 _LIBCPP_CTOR_LIFETIMEBOUND const _LHS& __lhs,
41 _LIBCPP_CTOR_LIFETIMEBOUND const _RHS& __rhs)
42 : __comp_(__comp), __lhs_(__lhs), __rhs_(__rhs) {}
43
44 _LIBCPP_HIDE_FROM_ABI bool __less() const {
45 bool __result = __comp_(__lhs_, __rhs_);
46 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__result ? !static_cast<bool>(__comp_(__rhs_, __lhs_)) : true,
47 "Comparator does not induce a strict weak ordering");
48 return __result;
49 }
50
51 _LIBCPP_HIDE_FROM_ABI bool __greater() const {
52 bool __result = __comp_(__rhs_, __lhs_);
53 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__result ? !static_cast<bool>(__comp_(__lhs_, __rhs_)) : true,
54 "Comparator does not induce a strict weak ordering");
55 return __result;
56 }
57};
58
59// This class provides three way comparison between _LHS and _RHS as efficiently as possible. This can be specialized if
60// a comparator only compares part of the object, potentially allowing an efficient three way comparison between the
61// subobjects. The specialization should use the __lazy_synth_three_way_comparator for the subobjects to achieve this.
62template <class _Comparator, class _LHS, class _RHS, class = void>
63struct __lazy_synth_three_way_comparator {
64 const _Comparator& __comp_;
65
66 _LIBCPP_HIDE_FROM_ABI __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator& __comp)
67 : __comp_(__comp) {}
68
69 _LIBCPP_HIDE_FROM_ABI __lazy_compare_result<_Comparator, _LHS, _RHS>
70 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) const {
71 return __lazy_compare_result<_Comparator, _LHS, _RHS>(__comp_, __lhs, __rhs);
72 }
73};
74
75struct __eager_compare_result {
76 int __res_;
77
78 _LIBCPP_HIDE_FROM_ABI explicit __eager_compare_result(int __res) : __res_(__res) {}
79
80 _LIBCPP_HIDE_FROM_ABI bool __less() const { return __res_ < 0; }
81 _LIBCPP_HIDE_FROM_ABI bool __greater() const { return __res_ > 0; }
82};
83
84template <class _Comparator, class _LHS, class _RHS>
85struct __lazy_synth_three_way_comparator<_Comparator,
86 _LHS,
87 _RHS,
88 __enable_if_t<_And<__desugars_to<__less_tag, _Comparator, _LHS, _RHS>,
89 __has_default_three_way_comparator<_LHS, _RHS> >::value> > {
90 // This lifetimebound annotation is technically incorrect, but other specializations actually capture the lifetime of
91 // the comparator.
92 _LIBCPP_HIDE_FROM_ABI __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator&) {}
93
94 // Same comment as above.
95 _LIBCPP_HIDE_FROM_ABI static __eager_compare_result
96 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) {
97 return __eager_compare_result(__default_three_way_comparator<_LHS, _RHS>()(__lhs, __rhs));
98 }
99};
100
101template <class _Comparator, class _LHS, class _RHS>
102struct __lazy_synth_three_way_comparator<_Comparator,
103 _LHS,
104 _RHS,
105 __enable_if_t<_And<__desugars_to<__greater_tag, _Comparator, _LHS, _RHS>,
106 __has_default_three_way_comparator<_LHS, _RHS> >::value> > {
107 // This lifetimebound annotation is technically incorrect, but other specializations actually capture the lifetime of
108 // the comparator.
109 _LIBCPP_HIDE_FROM_ABI __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator&) {}
110
111 // Same comment as above.
112 _LIBCPP_HIDE_FROM_ABI static __eager_compare_result
113 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) {
114 return __eager_compare_result(-__default_three_way_comparator<_LHS, _RHS>()(__lhs, __rhs));
115 }
116};
117
118_LIBCPP_END_NAMESPACE_STD
119
120#endif // _LIBCPP___UTILITY_LAZY_SYNTH_THREE_WAY_COMPARATOR_H
lib/libcxx/include/__utility/pair.h+22-25
...@@ -18,7 +18,6 @@...@@ -18,7 +18,6 @@
18#include <__fwd/array.h>18#include <__fwd/array.h>
19#include <__fwd/pair.h>19#include <__fwd/pair.h>
20#include <__fwd/tuple.h>20#include <__fwd/tuple.h>
21#include <__tuple/tuple_indices.h>
22#include <__tuple/tuple_like_no_subrange.h>21#include <__tuple/tuple_like_no_subrange.h>
23#include <__tuple/tuple_size.h>22#include <__tuple/tuple_size.h>
24#include <__type_traits/common_reference.h>23#include <__type_traits/common_reference.h>
...@@ -32,14 +31,13 @@...@@ -32,14 +31,13 @@
32#include <__type_traits/is_implicitly_default_constructible.h>31#include <__type_traits/is_implicitly_default_constructible.h>
33#include <__type_traits/is_nothrow_assignable.h>32#include <__type_traits/is_nothrow_assignable.h>
34#include <__type_traits/is_nothrow_constructible.h>33#include <__type_traits/is_nothrow_constructible.h>
35#include <__type_traits/is_replaceable.h>
36#include <__type_traits/is_same.h>
37#include <__type_traits/is_swappable.h>34#include <__type_traits/is_swappable.h>
38#include <__type_traits/is_trivially_relocatable.h>35#include <__type_traits/is_trivially_relocatable.h>
39#include <__type_traits/nat.h>36#include <__type_traits/nat.h>
40#include <__type_traits/unwrap_ref.h>37#include <__type_traits/unwrap_ref.h>
41#include <__utility/declval.h>38#include <__utility/declval.h>
42#include <__utility/forward.h>39#include <__utility/forward.h>
40#include <__utility/integer_sequence.h>
43#include <__utility/move.h>41#include <__utility/move.h>
44#include <__utility/piecewise_construct.h>42#include <__utility/piecewise_construct.h>
4543
...@@ -102,7 +100,6 @@ struct pair...@@ -102,7 +100,6 @@ struct pair
102 __conditional_t<__libcpp_is_trivially_relocatable<_T1>::value && __libcpp_is_trivially_relocatable<_T2>::value,100 __conditional_t<__libcpp_is_trivially_relocatable<_T1>::value && __libcpp_is_trivially_relocatable<_T2>::value,
103 pair,101 pair,
104 void>;102 void>;
105 using __replaceable _LIBCPP_NODEBUG = __conditional_t<__is_replaceable_v<_T1> && __is_replaceable_v<_T2>, pair, void>;
106103
107 _LIBCPP_HIDE_FROM_ABI pair(pair const&) = default;104 _LIBCPP_HIDE_FROM_ABI pair(pair const&) = default;
108 _LIBCPP_HIDE_FROM_ABI pair(pair&&) = default;105 _LIBCPP_HIDE_FROM_ABI pair(pair&&) = default;
...@@ -222,11 +219,7 @@ struct pair...@@ -222,11 +219,7 @@ struct pair
222 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20219 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
223 pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept(220 pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept(
224 is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)221 is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)
225 : pair(__pc,222 : pair(__pc, __first_args, __second_args, __index_sequence_for<_Args1...>(), __index_sequence_for<_Args2...>()) {}
226 __first_args,
227 __second_args,
228 typename __make_tuple_indices<sizeof...(_Args1)>::type(),
229 typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
230223
231 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&224 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&
232 operator=(__conditional_t<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value,225 operator=(__conditional_t<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value,
...@@ -440,8 +433,8 @@ private:...@@ -440,8 +433,8 @@ private:
440 pair(piecewise_construct_t,433 pair(piecewise_construct_t,
441 tuple<_Args1...>& __first_args,434 tuple<_Args1...>& __first_args,
442 tuple<_Args2...>& __second_args,435 tuple<_Args2...>& __second_args,
443 __tuple_indices<_I1...>,436 __index_sequence<_I1...>,
444 __tuple_indices<_I2...>)437 __index_sequence<_I2...>)
445 : first(std::forward<_Args1>(std::get<_I1>(__first_args))...),438 : first(std::forward<_Args1>(std::get<_I1>(__first_args))...),
446 second(std::forward<_Args2>(std::get<_I2>(__second_args))...) {}439 second(std::forward<_Args2>(std::get<_I2>(__second_args))...) {}
447#endif440#endif
...@@ -546,8 +539,8 @@ swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x...@@ -546,8 +539,8 @@ swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x
546#endif539#endif
547540
548template <class _T1, class _T2>541template <class _T1, class _T2>
549inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> >542[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
550make_pair(_T1&& __t1, _T2&& __t2) {543pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> > make_pair(_T1&& __t1, _T2&& __t2) {
551 return pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> >(std::forward<_T1>(__t1), std::forward<_T2>(__t2));544 return pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> >(std::forward<_T1>(__t1), std::forward<_T2>(__t2));
552}545}
553546
...@@ -619,67 +612,71 @@ struct __get_pair<1> {...@@ -619,67 +612,71 @@ struct __get_pair<1> {
619};612};
620613
621template <size_t _Ip, class _T1, class _T2>614template <size_t _Ip, class _T1, class _T2>
622inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&615[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
616typename tuple_element<_Ip, pair<_T1, _T2> >::type&
623get(pair<_T1, _T2>& __p) _NOEXCEPT {617get(pair<_T1, _T2>& __p) _NOEXCEPT {
624 return __get_pair<_Ip>::get(__p);618 return __get_pair<_Ip>::get(__p);
625}619}
626620
627template <size_t _Ip, class _T1, class _T2>621template <size_t _Ip, class _T1, class _T2>
628inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&622[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
623_LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
629get(const pair<_T1, _T2>& __p) _NOEXCEPT {624get(const pair<_T1, _T2>& __p) _NOEXCEPT {
630 return __get_pair<_Ip>::get(__p);625 return __get_pair<_Ip>::get(__p);
631}626}
632627
633template <size_t _Ip, class _T1, class _T2>628template <size_t _Ip, class _T1, class _T2>
634inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&629[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
630typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
635get(pair<_T1, _T2>&& __p) _NOEXCEPT {631get(pair<_T1, _T2>&& __p) _NOEXCEPT {
636 return __get_pair<_Ip>::get(std::move(__p));632 return __get_pair<_Ip>::get(std::move(__p));
637}633}
638634
639template <size_t _Ip, class _T1, class _T2>635template <size_t _Ip, class _T1, class _T2>
640inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&636[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
637_LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
641get(const pair<_T1, _T2>&& __p) _NOEXCEPT {638get(const pair<_T1, _T2>&& __p) _NOEXCEPT {
642 return __get_pair<_Ip>::get(std::move(__p));639 return __get_pair<_Ip>::get(std::move(__p));
643}640}
644641
645#if _LIBCPP_STD_VER >= 14642#if _LIBCPP_STD_VER >= 14
646template <class _T1, class _T2>643template <class _T1, class _T2>
647inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {644[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {
648 return __p.first;645 return __p.first;
649}646}
650647
651template <class _T1, class _T2>648template <class _T1, class _T2>
652inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {649[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {
653 return __p.first;650 return __p.first;
654}651}
655652
656template <class _T1, class _T2>653template <class _T1, class _T2>
657inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {654[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
658 return std::forward<_T1&&>(__p.first);655 return std::forward<_T1&&>(__p.first);
659}656}
660657
661template <class _T1, class _T2>658template <class _T1, class _T2>
662inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {659[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {
663 return std::forward<_T1 const&&>(__p.first);660 return std::forward<_T1 const&&>(__p.first);
664}661}
665662
666template <class _T2, class _T1>663template <class _T2, class _T1>
667inline _LIBCPP_HIDE_FROM_ABI constexpr _T2& get(pair<_T1, _T2>& __p) _NOEXCEPT {664[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2& get(pair<_T1, _T2>& __p) _NOEXCEPT {
668 return __p.second;665 return __p.second;
669}666}
670667
671template <class _T2, class _T1>668template <class _T2, class _T1>
672inline _LIBCPP_HIDE_FROM_ABI constexpr _T2 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {669[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {
673 return __p.second;670 return __p.second;
674}671}
675672
676template <class _T2, class _T1>673template <class _T2, class _T1>
677inline _LIBCPP_HIDE_FROM_ABI constexpr _T2&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {674[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
678 return std::forward<_T2&&>(__p.second);675 return std::forward<_T2&&>(__p.second);
679}676}
680677
681template <class _T2, class _T1>678template <class _T2, class _T1>
682inline _LIBCPP_HIDE_FROM_ABI constexpr _T2 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {679[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {
683 return std::forward<_T2 const&&>(__p.second);680 return std::forward<_T2 const&&>(__p.second);
684}681}
685682
lib/libcxx/include/__utility/scope_guard.h+2
...@@ -43,6 +43,8 @@ public:...@@ -43,6 +43,8 @@ public:
43#endif43#endif
44};44};
4545
46_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__scope_guard);
47
46template <class _Func>48template <class _Func>
47_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __scope_guard<_Func> __make_scope_guard(_Func __func) {49_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __scope_guard<_Func> __make_scope_guard(_Func __func) {
48 return __scope_guard<_Func>(std::move(__func));50 return __scope_guard<_Func>(std::move(__func));
lib/libcxx/include/__utility/try_key_extraction.h created+114
...@@ -0,0 +1,114 @@
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_TRY_EXTRACT_KEY_H
10#define _LIBCPP___UTILITY_TRY_EXTRACT_KEY_H
11
12#include <__config>
13#include <__fwd/pair.h>
14#include <__fwd/tuple.h>
15#include <__type_traits/enable_if.h>
16#include <__type_traits/is_same.h>
17#include <__type_traits/remove_const.h>
18#include <__type_traits/remove_const_ref.h>
19#include <__utility/declval.h>
20#include <__utility/forward.h>
21#include <__utility/piecewise_construct.h>
22#include <__utility/priority_tag.h>
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28_LIBCPP_BEGIN_NAMESPACE_STD
29
30template <class _KeyT, class _Ret, class _WithKey, class _WithoutKey, class... _Args>
31_LIBCPP_HIDE_FROM_ABI _Ret
32__try_key_extraction_impl(__priority_tag<0>, _WithKey, _WithoutKey __without_key, _Args&&... __args) {
33 return __without_key(std::forward<_Args>(__args)...);
34}
35
36template <class _KeyT,
37 class _Ret,
38 class _WithKey,
39 class _WithoutKey,
40 class _Arg,
41 __enable_if_t<is_same<_KeyT, __remove_const_ref_t<_Arg> >::value, int> = 0>
42_LIBCPP_HIDE_FROM_ABI _Ret
43__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg&& __arg) {
44 return __with_key(__arg, std::forward<_Arg>(__arg));
45}
46
47template <class _KeyT,
48 class _Ret,
49 class _WithKey,
50 class _WithoutKey,
51 class _Arg,
52 __enable_if_t<__is_pair_v<__remove_const_ref_t<_Arg> > &&
53 is_same<__remove_const_t<typename __remove_const_ref_t<_Arg>::first_type>, _KeyT>::value,
54 int> = 0>
55_LIBCPP_HIDE_FROM_ABI _Ret
56__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg&& __arg) {
57 return __with_key(__arg.first, std::forward<_Arg>(__arg));
58}
59
60template <class _KeyT,
61 class _Ret,
62 class _WithKey,
63 class _WithoutKey,
64 class _Arg1,
65 class _Arg2,
66 __enable_if_t<is_same<_KeyT, __remove_const_ref_t<_Arg1> >::value, int> = 0>
67_LIBCPP_HIDE_FROM_ABI _Ret
68__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));
70}
71
72#ifndef _LIBCPP_CXX03_LANG
73template <class _KeyT,
74 class _Ret,
75 class _WithKey,
76 class _WithoutKey,
77 class _PiecewiseConstruct,
78 class _Tuple1,
79 class _Tuple2,
80 __enable_if_t<is_same<__remove_const_ref_t<_PiecewiseConstruct>, piecewise_construct_t>::value &&
81 __is_tuple_v<_Tuple1> && tuple_size<_Tuple1>::value == 1 &&
82 is_same<__remove_const_ref_t<typename tuple_element<0, _Tuple1>::type>, _KeyT>::value,
83 int> = 0>
84_LIBCPP_HIDE_FROM_ABI _Ret __try_key_extraction_impl(
85 __priority_tag<1>,
86 _WithKey __with_key,
87 _WithoutKey,
88 _PiecewiseConstruct&& __pc,
89 _Tuple1&& __tuple1,
90 _Tuple2&& __tuple2) {
91 return __with_key(
92 std::get<0>(__tuple1),
93 std::forward<_PiecewiseConstruct>(__pc),
94 std::forward<_Tuple1>(__tuple1),
95 std::forward<_Tuple2>(__tuple2));
96}
97#endif // _LIBCPP_CXX03_LANG
98
99// This function tries extracting the given _KeyT from _Args...
100// If it succeeds to extract the key, it calls the `__with_key` function with the extracted key and all of the
101// arguments. Otherwise it calls the `__without_key` function with all of the arguments.
102//
103// Both `__with_key` and `__without_key` must take all arguments by reference.
104template <class _KeyT, class _WithKey, class _WithoutKey, class... _Args>
105_LIBCPP_HIDE_FROM_ABI decltype(std::declval<_WithoutKey>()(std::declval<_Args>()...))
106__try_key_extraction(_WithKey __with_key, _WithoutKey __without_key, _Args&&... __args) {
107 using _Ret = decltype(__without_key(std::forward<_Args>(__args)...));
108 return std::__try_key_extraction_impl<_KeyT, _Ret>(
109 __priority_tag<1>(), __with_key, __without_key, std::forward<_Args>(__args)...);
110}
111
112_LIBCPP_END_NAMESPACE_STD
113
114#endif // _LIBCPP___UTILITY_TRY_EXTRACT_KEY_H
lib/libcxx/include/__vector/vector.h+187-160
...@@ -12,18 +12,17 @@...@@ -12,18 +12,17 @@
12#include <__algorithm/copy.h>12#include <__algorithm/copy.h>
13#include <__algorithm/copy_n.h>13#include <__algorithm/copy_n.h>
14#include <__algorithm/fill_n.h>14#include <__algorithm/fill_n.h>
15#include <__algorithm/iterator_operations.h>
15#include <__algorithm/max.h>16#include <__algorithm/max.h>
16#include <__algorithm/min.h>17#include <__algorithm/min.h>
17#include <__algorithm/move.h>18#include <__algorithm/move.h>
18#include <__algorithm/move_backward.h>19#include <__algorithm/move_backward.h>
19#include <__algorithm/ranges_copy_n.h>
20#include <__algorithm/rotate.h>20#include <__algorithm/rotate.h>
21#include <__assert>21#include <__assert>
22#include <__config>22#include <__config>
23#include <__debug_utils/sanitizers.h>23#include <__debug_utils/sanitizers.h>
24#include <__format/enable_insertable.h>24#include <__format/enable_insertable.h>
25#include <__fwd/vector.h>25#include <__fwd/vector.h>
26#include <__iterator/advance.h>
27#include <__iterator/bounded_iter.h>26#include <__iterator/bounded_iter.h>
28#include <__iterator/concepts.h>27#include <__iterator/concepts.h>
29#include <__iterator/distance.h>28#include <__iterator/distance.h>
...@@ -43,6 +42,7 @@...@@ -43,6 +42,7 @@
43#include <__memory/temp_value.h>42#include <__memory/temp_value.h>
44#include <__memory/uninitialized_algorithms.h>43#include <__memory/uninitialized_algorithms.h>
45#include <__ranges/access.h>44#include <__ranges/access.h>
45#include <__ranges/as_rvalue_view.h>
46#include <__ranges/concepts.h>46#include <__ranges/concepts.h>
47#include <__ranges/container_compatible_range.h>47#include <__ranges/container_compatible_range.h>
48#include <__ranges/from_range.h>48#include <__ranges/from_range.h>
...@@ -55,7 +55,6 @@...@@ -55,7 +55,6 @@
55#include <__type_traits/is_nothrow_assignable.h>55#include <__type_traits/is_nothrow_assignable.h>
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_replaceable.h>
59#include <__type_traits/is_same.h>58#include <__type_traits/is_same.h>
60#include <__type_traits/is_trivially_relocatable.h>59#include <__type_traits/is_trivially_relocatable.h>
61#include <__type_traits/type_identity.h>60#include <__type_traits/type_identity.h>
...@@ -86,6 +85,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -86,6 +85,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
8685
87template <class _Tp, class _Allocator /* = allocator<_Tp> */>86template <class _Tp, class _Allocator /* = allocator<_Tp> */>
88class vector {87class vector {
88 template <class _Up, class _Alloc>
89 using __split_buffer _LIBCPP_NODEBUG = std::__split_buffer<_Up, _Alloc, __split_buffer_pointer_layout>;
90
89public:91public:
90 //92 //
91 // Types93 // Types
...@@ -113,7 +115,7 @@ public:...@@ -113,7 +115,7 @@ public:
113 using reverse_iterator = std::reverse_iterator<iterator>;115 using reverse_iterator = std::reverse_iterator<iterator>;
114 using const_reverse_iterator = std::reverse_iterator<const_iterator>;116 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
115117
116 // A vector containers the following members which may be trivially relocatable:118 // A vector contains the following members which may be trivially relocatable:
117 // - pointer: may be trivially relocatable, so it's checked119 // - pointer: may be trivially relocatable, so it's checked
118 // - allocator_type: may be trivially relocatable, so it's checked120 // - allocator_type: may be trivially relocatable, so it's checked
119 // vector doesn't contain any self-references, so it's trivially relocatable if its members are.121 // vector doesn't contain any self-references, so it's trivially relocatable if its members are.
...@@ -121,10 +123,6 @@ public:...@@ -121,10 +123,6 @@ public:
121 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<allocator_type>::value,123 __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<allocator_type>::value,
122 vector,124 vector,
123 void>;125 void>;
124 using __replaceable _LIBCPP_NODEBUG =
125 __conditional_t<__is_replaceable_v<pointer> && __container_allocator_is_replaceable<__alloc_traits>::value,
126 vector,
127 void>;
128126
129 static_assert(__check_valid_allocator<allocator_type>::value, "");127 static_assert(__check_valid_allocator<allocator_type>::value, "");
130 static_assert(is_same<typename allocator_type::value_type, value_type>::value,128 static_assert(is_same<typename allocator_type::value_type, value_type>::value,
...@@ -174,7 +172,7 @@ public:...@@ -174,7 +172,7 @@ public:
174 __guard.__complete();172 __guard.__complete();
175 }173 }
176174
177 template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>175 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
178 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI176 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
179 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)
180 : __alloc_(__a) {178 : __alloc_(__a) {
...@@ -317,7 +315,7 @@ public:...@@ -317,7 +315,7 @@ public:
317 is_constructible<value_type, typename iterator_traits<_ForwardIterator>::reference>::value,315 is_constructible<value_type, typename iterator_traits<_ForwardIterator>::reference>::value,
318 int> = 0>316 int> = 0>
319 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(_ForwardIterator __first, _ForwardIterator __last) {317 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(_ForwardIterator __first, _ForwardIterator __last) {
320 __assign_with_size(__first, __last, std::distance(__first, __last));318 __assign_with_size<_ClassicAlgPolicy>(__first, __last, std::distance(__first, __last));
321 }319 }
322320
323#if _LIBCPP_STD_VER >= 23321#if _LIBCPP_STD_VER >= 23
...@@ -325,7 +323,7 @@ public:...@@ -325,7 +323,7 @@ public:
325 _LIBCPP_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) {323 _LIBCPP_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) {
326 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {324 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
327 auto __n = static_cast<size_type>(ranges::distance(__range));325 auto __n = static_cast<size_type>(ranges::distance(__range));
328 __assign_with_size(ranges::begin(__range), ranges::end(__range), __n);326 __assign_with_size<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), __n);
329327
330 } else {328 } else {
331 __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));329 __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
...@@ -341,59 +339,67 @@ public:...@@ -341,59 +339,67 @@ public:
341 }339 }
342#endif340#endif
343341
344 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {342 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
345 return this->__alloc_;343 return this->__alloc_;
346 }344 }
347345
348 //346 //
349 // Iterators347 // Iterators
350 //348 //
351 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {349 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
352 return __make_iter(__add_alignment_assumption(this->__begin_));350 return __make_iter(__add_alignment_assumption(this->__begin_));
353 }351 }
354 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {352 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
355 return __make_iter(__add_alignment_assumption(this->__begin_));353 return __make_iter(__add_alignment_assumption(this->__begin_));
356 }354 }
357 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {355 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
358 return __make_iter(__add_alignment_assumption(this->__end_));356 return __make_iter(__add_alignment_assumption(this->__end_));
359 }357 }
360 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {358 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
361 return __make_iter(__add_alignment_assumption(this->__end_));359 return __make_iter(__add_alignment_assumption(this->__end_));
362 }360 }
363361
364 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {362 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {
365 return reverse_iterator(end());363 return reverse_iterator(end());
366 }364 }
367 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {365 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
366 rbegin() const _NOEXCEPT {
368 return const_reverse_iterator(end());367 return const_reverse_iterator(end());
369 }368 }
370 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT {369 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT {
371 return reverse_iterator(begin());370 return reverse_iterator(begin());
372 }371 }
373 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {372 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
374 return const_reverse_iterator(begin());373 return const_reverse_iterator(begin());
375 }374 }
376375
377 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }376 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
378 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }377 return begin();
379 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {378 }
379 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {
380 return end();
381 }
382 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
383 crbegin() const _NOEXCEPT {
380 return rbegin();384 return rbegin();
381 }385 }
382 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }386 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {
387 return rend();
388 }
383389
384 //390 //
385 // [vector.capacity], capacity391 // [vector.capacity], capacity
386 //392 //
387 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {393 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
388 return static_cast<size_type>(this->__end_ - this->__begin_);394 return static_cast<size_type>(this->__end_ - this->__begin_);
389 }395 }
390 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {396 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
391 return static_cast<size_type>(this->__cap_ - this->__begin_);397 return static_cast<size_type>(this->__cap_ - this->__begin_);
392 }398 }
393 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {399 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
394 return this->__begin_ == this->__end_;400 return this->__begin_ == this->__end_;
395 }401 }
396 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {402 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
397 return std::min<size_type>(__alloc_traits::max_size(this->__alloc_), numeric_limits<difference_type>::max());403 return std::min<size_type>(__alloc_traits::max_size(this->__alloc_), numeric_limits<difference_type>::max());
398 }404 }
399 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);405 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
...@@ -402,38 +408,39 @@ public:...@@ -402,38 +408,39 @@ public:
402 //408 //
403 // element access409 // element access
404 //410 //
405 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT {411 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT {
406 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");412 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
407 return this->__begin_[__n];413 return this->__begin_[__n];
408 }414 }
409 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const _NOEXCEPT {415 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference
416 operator[](size_type __n) const _NOEXCEPT {
410 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");417 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
411 return this->__begin_[__n];418 return this->__begin_[__n];
412 }419 }
413 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) {420 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) {
414 if (__n >= size())421 if (__n >= size())
415 this->__throw_out_of_range();422 this->__throw_out_of_range();
416 return this->__begin_[__n];423 return this->__begin_[__n];
417 }424 }
418 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const {425 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const {
419 if (__n >= size())426 if (__n >= size())
420 this->__throw_out_of_range();427 this->__throw_out_of_range();
421 return this->__begin_[__n];428 return this->__begin_[__n];
422 }429 }
423430
424 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {431 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {
425 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");432 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
426 return *this->__begin_;433 return *this->__begin_;
427 }434 }
428 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {435 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
429 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");436 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
430 return *this->__begin_;437 return *this->__begin_;
431 }438 }
432 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {439 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
433 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");440 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
434 return *(this->__end_ - 1);441 return *(this->__end_ - 1);
435 }442 }
436 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {443 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
437 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");444 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
438 return *(this->__end_ - 1);445 return *(this->__end_ - 1);
439 }446 }
...@@ -441,11 +448,11 @@ public:...@@ -441,11 +448,11 @@ public:
441 //448 //
442 // [vector.data], data access449 // [vector.data], data access
443 //450 //
444 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI value_type* data() _NOEXCEPT {451 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI value_type* data() _NOEXCEPT {
445 return std::__to_address(this->__begin_);452 return std::__to_address(this->__begin_);
446 }453 }
447454
448 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const value_type* data() const _NOEXCEPT {455 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const value_type* data() const _NOEXCEPT {
449 return std::__to_address(this->__begin_);456 return std::__to_address(this->__begin_);
450 }457 }
451458
...@@ -478,7 +485,21 @@ public:...@@ -478,7 +485,21 @@ public:
478#if _LIBCPP_STD_VER >= 23485#if _LIBCPP_STD_VER >= 23
479 template <_ContainerCompatibleRange<_Tp> _Range>486 template <_ContainerCompatibleRange<_Tp> _Range>
480 _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {487 _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {
481 insert_range(end(), std::forward<_Range>(__range));488 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
489 auto __len = ranges::distance(__range);
490 if (__len <= __cap_ - __end_) {
491 __construct_at_end(ranges::begin(__range), ranges::end(__range), __len);
492 } else {
493 __split_buffer<value_type, allocator_type> __buffer(__recommend(size() + __len), size(), __alloc_);
494 __buffer.__construct_at_end_with_size(ranges::begin(__range), __len);
495 __swap_out_circular_buffer(__buffer);
496 }
497 } else {
498 vector __buffer(__alloc_);
499 for (auto&& __val : __range)
500 __buffer.emplace_back(std::forward<decltype(__val)>(__val));
501 append_range(ranges::as_rvalue_view(__buffer));
502 }
482 }503 }
483#endif504#endif
484505
...@@ -512,7 +533,7 @@ public:...@@ -512,7 +533,7 @@ public:
512 int> = 0>533 int> = 0>
513 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator534 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
514 insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last) {535 insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last) {
515 return __insert_with_size(__position, __first, __last, std::distance(__first, __last));536 return __insert_with_size<_ClassicAlgPolicy>(__position, __first, __last, std::distance(__first, __last));
516 }537 }
517538
518#if _LIBCPP_STD_VER >= 23539#if _LIBCPP_STD_VER >= 23
...@@ -520,7 +541,7 @@ public:...@@ -520,7 +541,7 @@ public:
520 _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {541 _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
521 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {542 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
522 auto __n = static_cast<size_type>(ranges::distance(__range));543 auto __n = static_cast<size_type>(ranges::distance(__range));
523 return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);544 return __insert_with_size<_RangeAlgPolicy>(__position, ranges::begin(__range), ranges::end(__range), __n);
524545
525 } else {546 } else {
526 return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));547 return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
...@@ -613,12 +634,13 @@ private:...@@ -613,12 +634,13 @@ private:
613 // The `_Iterator` in `*_with_size` functions can be input-only only if called from `*_range` (since C++23).634 // The `_Iterator` in `*_with_size` functions can be input-only only if called from `*_range` (since C++23).
614 // Otherwise, `_Iterator` is a forward iterator.635 // Otherwise, `_Iterator` is a forward iterator.
615636
616 template <class _Iterator, class _Sentinel>637 template <class _AlgPolicy, class _Iterator, class _Sentinel>
617 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void638 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
618 __assign_with_size(_Iterator __first, _Sentinel __last, difference_type __n);639 __assign_with_size(_Iterator __first, _Sentinel __last, difference_type __n);
619640
620 template <class _Iterator,641 template <class _AlgPolicy,
621 __enable_if_t<!is_same<decltype(*std::declval<_Iterator&>())&&, value_type&&>::value, int> = 0>642 class _Iterator,
643 __enable_if_t<!is_same<__policy_value_type<_AlgPolicy, _Iterator>, value_type>::value, int> = 0>
622 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void644 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
623 __insert_assign_n_unchecked(_Iterator __first, difference_type __n, pointer __position) {645 __insert_assign_n_unchecked(_Iterator __first, difference_type __n, pointer __position) {
624 for (pointer __end_position = __position + __n; __position != __end_position; ++__position, (void)++__first) {646 for (pointer __end_position = __position + __n; __position != __end_position; ++__position, (void)++__first) {
...@@ -627,25 +649,19 @@ private:...@@ -627,25 +649,19 @@ private:
627 }649 }
628 }650 }
629651
630 template <class _Iterator,652 template <class _AlgPolicy,
631 __enable_if_t<is_same<decltype(*std::declval<_Iterator&>())&&, value_type&&>::value, int> = 0>653 class _Iterator,
654 __enable_if_t<is_same<__policy_value_type<_AlgPolicy, _Iterator>, value_type>::value, int> = 0>
632 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void655 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
633 __insert_assign_n_unchecked(_Iterator __first, difference_type __n, pointer __position) {656 __insert_assign_n_unchecked(_Iterator __first, difference_type __n, pointer __position) {
634#if _LIBCPP_STD_VER >= 23657 std::__copy_n<_AlgPolicy>(std::move(__first), __n, __position);
635 if constexpr (!forward_iterator<_Iterator>) { // Handles input-only sized ranges for insert_range
636 ranges::copy_n(std::move(__first), __n, __position);
637 } else
638#endif
639 {
640 std::copy_n(__first, __n, __position);
641 }
642 }658 }
643659
644 template <class _InputIterator, class _Sentinel>660 template <class _InputIterator, class _Sentinel>
645 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator661 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
646 __insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last);662 __insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last);
647663
648 template <class _Iterator, class _Sentinel>664 template <class _AlgPolicy, class _Iterator, class _Sentinel>
649 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator665 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
650 __insert_with_size(const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n);666 __insert_with_size(const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n);
651667
...@@ -653,9 +669,6 @@ private:...@@ -653,9 +669,6 @@ private:
653 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void669 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
654 __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);670 __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);
655671
656 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n);
657 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n, const_reference __x);
658
659 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator __make_iter(pointer __p) _NOEXCEPT {672 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator __make_iter(pointer __p) _NOEXCEPT {
660#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR673#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR
661 // Bound the iterator according to the capacity, rather than the size.674 // Bound the iterator according to the capacity, rather than the size.
...@@ -689,9 +702,9 @@ private:...@@ -689,9 +702,9 @@ private:
689 }702 }
690703
691 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void704 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
692 __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v);705 __swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v);
693 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer706 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer
694 __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p);707 __swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v, pointer __p);
695 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void708 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
696 __move_range(pointer __from_s, pointer __from_e, pointer __to);709 __move_range(pointer __from_s, pointer __from_e, pointer __to);
697 _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)
...@@ -811,26 +824,44 @@ private:...@@ -811,26 +824,44 @@ private:
811 __add_alignment_assumption(_Ptr __p) _NOEXCEPT {824 __add_alignment_assumption(_Ptr __p) _NOEXCEPT {
812 return __p;825 return __p;
813 }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 }
814};845};
815846
816#if _LIBCPP_STD_VER >= 17847#if _LIBCPP_STD_VER >= 17
817template <class _InputIterator,848template <class _InputIterator,
818 class _Alloc = allocator<__iter_value_type<_InputIterator>>,849 class _Alloc = allocator<__iterator_value_type<_InputIterator>>,
819 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,850 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
820 class = enable_if_t<__is_allocator<_Alloc>::value> >851 class = enable_if_t<__is_allocator_v<_Alloc>>>
821vector(_InputIterator, _InputIterator) -> vector<__iter_value_type<_InputIterator>, _Alloc>;852vector(_InputIterator, _InputIterator) -> vector<__iterator_value_type<_InputIterator>, _Alloc>;
822853
823template <class _InputIterator,854template <class _InputIterator,
824 class _Alloc,855 class _Alloc,
825 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,856 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
826 class = enable_if_t<__is_allocator<_Alloc>::value> >857 class = enable_if_t<__is_allocator_v<_Alloc>>>
827vector(_InputIterator, _InputIterator, _Alloc) -> vector<__iter_value_type<_InputIterator>, _Alloc>;858vector(_InputIterator, _InputIterator, _Alloc) -> vector<__iterator_value_type<_InputIterator>, _Alloc>;
828#endif859#endif
829860
830#if _LIBCPP_STD_VER >= 23861#if _LIBCPP_STD_VER >= 23
831template <ranges::input_range _Range,862template <ranges::input_range _Range,
832 class _Alloc = allocator<ranges::range_value_t<_Range>>,863 class _Alloc = allocator<ranges::range_value_t<_Range>>,
833 class = enable_if_t<__is_allocator<_Alloc>::value> >864 class = enable_if_t<__is_allocator_v<_Alloc>>>
834vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;865vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;
835#endif866#endif
836867
...@@ -839,17 +870,16 @@ vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_...@@ -839,17 +870,16 @@ vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_
839// function has a strong exception guarantee.870// function has a strong exception guarantee.
840template <class _Tp, class _Allocator>871template <class _Tp, class _Allocator>
841_LIBCPP_CONSTEXPR_SINCE_CXX20 void872_LIBCPP_CONSTEXPR_SINCE_CXX20 void
842vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v) {873vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v) {
843 __annotate_delete();874 __annotate_delete();
844 auto __new_begin = __v.__begin_ - (__end_ - __begin_);875 auto __new_begin = __v.begin() - size();
845 std::__uninitialized_allocator_relocate(876 std::__uninitialized_allocator_relocate(
846 this->__alloc_, std::__to_address(__begin_), std::__to_address(__end_), std::__to_address(__new_begin));877 this->__alloc_, std::__to_address(__begin_), std::__to_address(__end_), std::__to_address(__new_begin));
847 __v.__begin_ = __new_begin;878 __v.__set_valid_range(__new_begin, __v.end());
848 __end_ = __begin_; // All the objects have been destroyed by relocating them.879 __end_ = __begin_; // All the objects have been destroyed by relocating them.
849 std::swap(this->__begin_, __v.__begin_);880
850 std::swap(this->__end_, __v.__end_);881 __swap_layouts(__v);
851 std::swap(this->__cap_, __v.__cap_);882 __v.__set_data(__v.begin());
852 __v.__first_ = __v.__begin_;
853 __annotate_new(size());883 __annotate_new(size());
854}884}
855885
...@@ -859,27 +889,25 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a...@@ -859,27 +889,25 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
859// function has a strong exception guarantee if __begin_ == __p || __end_ == __p.889// function has a strong exception guarantee if __begin_ == __p || __end_ == __p.
860template <class _Tp, class _Allocator>890template <class _Tp, class _Allocator>
861_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer891_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer
862vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p) {892vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v, pointer __p) {
863 __annotate_delete();893 __annotate_delete();
864 pointer __ret = __v.__begin_;894 pointer __ret = __v.begin();
865895
866 // Relocate [__p, __end_) first to avoid having a hole in [__begin_, __end_)896 // Relocate [__p, __end_) first to avoid having a hole in [__begin_, __end_)
867 // in case something in [__begin_, __p) throws.897 // in case something in [__begin_, __p) throws.
868 std::__uninitialized_allocator_relocate(898 std::__uninitialized_allocator_relocate(
869 this->__alloc_, std::__to_address(__p), std::__to_address(__end_), std::__to_address(__v.__end_));899 this->__alloc_, std::__to_address(__p), std::__to_address(__end_), std::__to_address(__v.end()));
870 __v.__end_ += (__end_ - __p);900 auto __relocated_so_far = __end_ - __p;
901 __v.__set_sentinel(__v.end() + __relocated_so_far);
871 __end_ = __p; // The objects in [__p, __end_) have been destroyed by relocating them.902 __end_ = __p; // The objects in [__p, __end_) have been destroyed by relocating them.
872 auto __new_begin = __v.__begin_ - (__p - __begin_);903 auto __new_begin = __v.begin() - (__p - __begin_);
873904
874 std::__uninitialized_allocator_relocate(905 std::__uninitialized_allocator_relocate(
875 this->__alloc_, std::__to_address(__begin_), std::__to_address(__p), std::__to_address(__new_begin));906 this->__alloc_, std::__to_address(__begin_), std::__to_address(__p), std::__to_address(__new_begin));
876 __v.__begin_ = __new_begin;907 __v.__set_valid_range(__new_begin, __v.end());
877 __end_ = __begin_; // All the objects have been destroyed by relocating them.908 __end_ = __begin_; // All the objects have been destroyed by relocating them.
878909 __swap_layouts(__v);
879 std::swap(this->__begin_, __v.__begin_);910 __v.__set_data(__v.begin());
880 std::swap(this->__end_, __v.__end_);
881 std::swap(this->__cap_, __v.__cap_);
882 __v.__first_ = __v.__begin_;
883 __annotate_new(size());911 __annotate_new(size());
884 return __ret;912 return __ret;
885}913}
...@@ -945,36 +973,6 @@ vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __...@@ -945,36 +973,6 @@ vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __
945 __tx.__pos_ = std::__uninitialized_allocator_copy(this->__alloc_, std::move(__first), std::move(__last), __tx.__pos_);973 __tx.__pos_ = std::__uninitialized_allocator_copy(this->__alloc_, std::move(__first), std::move(__last), __tx.__pos_);
946}974}
947975
948// Default constructs __n objects starting at __end_
949// throws if construction throws
950// Postcondition: size() == size() + __n
951// Exception safety: strong.
952template <class _Tp, class _Allocator>
953_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__append(size_type __n) {
954 if (static_cast<size_type>(this->__cap_ - this->__end_) >= __n)
955 this->__construct_at_end(__n);
956 else {
957 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), this->__alloc_);
958 __v.__construct_at_end(__n);
959 __swap_out_circular_buffer(__v);
960 }
961}
962
963// Default constructs __n objects starting at __end_
964// throws if construction throws
965// Postcondition: size() == size() + __n
966// Exception safety: strong.
967template <class _Tp, class _Allocator>
968_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x) {
969 if (static_cast<size_type>(this->__cap_ - this->__end_) >= __n)
970 this->__construct_at_end(__n, __x);
971 else {
972 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), this->__alloc_);
973 __v.__construct_at_end(__n, __x);
974 __swap_out_circular_buffer(__v);
975 }
976}
977
978template <class _Tp, class _Allocator>976template <class _Tp, class _Allocator>
979_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocator>::vector(vector&& __x)977_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocator>::vector(vector&& __x)
980#if _LIBCPP_STD_VER >= 17978#if _LIBCPP_STD_VER >= 17
...@@ -1051,20 +1049,14 @@ vector<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentinel __l...@@ -1051,20 +1049,14 @@ vector<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentinel __l
1051}1049}
10521050
1053template <class _Tp, class _Allocator>1051template <class _Tp, class _Allocator>
1054template <class _Iterator, class _Sentinel>1052template <class _AlgPolicy, class _Iterator, class _Sentinel>
1055_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void1053_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
1056vector<_Tp, _Allocator>::__assign_with_size(_Iterator __first, _Sentinel __last, difference_type __n) {1054vector<_Tp, _Allocator>::__assign_with_size(_Iterator __first, _Sentinel __last, difference_type __n) {
1057 size_type __new_size = static_cast<size_type>(__n);1055 size_type __new_size = static_cast<size_type>(__n);
1058 if (__new_size <= capacity()) {1056 if (__new_size <= capacity()) {
1059 if (__new_size > size()) {1057 if (__new_size > size()) {
1060#if _LIBCPP_STD_VER >= 231058 auto __mid = std::__copy_n<_AlgPolicy>(std::move(__first), size(), this->__begin_).first;
1061 auto __mid = ranges::copy_n(std::move(__first), size(), this->__begin_).in;
1062 __construct_at_end(std::move(__mid), std::move(__last), __new_size - size());1059 __construct_at_end(std::move(__mid), std::move(__last), __new_size - size());
1063#else
1064 _Iterator __mid = std::next(__first, size());
1065 std::copy(__first, __mid, this->__begin_);
1066 __construct_at_end(__mid, __last, __new_size - size());
1067#endif
1068 } else {1060 } else {
1069 pointer __m = std::__copy(std::move(__first), __last, this->__begin_).second;1061 pointer __m = std::__copy(std::move(__first), __last, this->__begin_).second;
1070 this->__destruct_at_end(__m);1062 this->__destruct_at_end(__m);
...@@ -1097,7 +1089,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::reserve(size_type __...@@ -1097,7 +1089,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::reserve(size_type __
1097 if (__n > capacity()) {1089 if (__n > capacity()) {
1098 if (__n > max_size())1090 if (__n > max_size())
1099 this->__throw_length_error();1091 this->__throw_length_error();
1100 __split_buffer<value_type, allocator_type&> __v(__n, size(), this->__alloc_);1092 __split_buffer<value_type, allocator_type> __v(__n, size(), this->__alloc_);
1101 __swap_out_circular_buffer(__v);1093 __swap_out_circular_buffer(__v);
1102 }1094 }
1103}1095}
...@@ -1108,7 +1100,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::shrink_to_fit() _NOE...@@ -1108,7 +1100,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::shrink_to_fit() _NOE
1108#if _LIBCPP_HAS_EXCEPTIONS1100#if _LIBCPP_HAS_EXCEPTIONS
1109 try {1101 try {
1110#endif // _LIBCPP_HAS_EXCEPTIONS1102#endif // _LIBCPP_HAS_EXCEPTIONS
1111 __split_buffer<value_type, allocator_type&> __v(size(), size(), this->__alloc_);1103 __split_buffer<value_type, allocator_type> __v(size(), size(), this->__alloc_);
1112 // The Standard mandates shrink_to_fit() does not increase the capacity.1104 // The Standard mandates shrink_to_fit() does not increase the capacity.
1113 // With equal capacity keep the existing buffer. This avoids extra work1105 // With equal capacity keep the existing buffer. This avoids extra work
1114 // due to swapping the elements.1106 // due to swapping the elements.
...@@ -1125,14 +1117,33 @@ template <class _Tp, class _Allocator>...@@ -1125,14 +1117,33 @@ template <class _Tp, class _Allocator>
1125template <class... _Args>1117template <class... _Args>
1126_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer1118_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer
1127vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) {1119vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) {
1128 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), this->__alloc_);1120 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), size(), this->__alloc_);
1129 // __v.emplace_back(std::forward<_Args>(__args)...);1121 // __v.emplace_back(std::forward<_Args>(__args)...);
1130 __alloc_traits::construct(this->__alloc_, std::__to_address(__v.__end_), std::forward<_Args>(__args)...);1122 pointer __end = __v.end();
1131 __v.__end_++;1123 __alloc_traits::construct(this->__alloc_, std::__to_address(__end), std::forward<_Args>(__args)...);
1124 __v.__set_sentinel(++__end);
1132 __swap_out_circular_buffer(__v);1125 __swap_out_circular_buffer(__v);
1133 return this->__end_;1126 return this->__end_;
1134}1127}
11351128
1129// This makes the compiler inline `__else()` if `__cond` is known to be false. Currently LLVM doesn't do that without
1130// the `__builtin_constant_p`, since it considers `__else` unlikely even through it's known to be run.
1131// See https://llvm.org/PR154292
1132template <class _If, class _Else>
1133_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __if_likely_else(bool __cond, _If __if, _Else __else) {
1134 if (__builtin_constant_p(__cond)) {
1135 if (__cond)
1136 __if();
1137 else
1138 __else();
1139 } else {
1140 if (__cond) [[__likely__]]
1141 __if();
1142 else
1143 __else();
1144 }
1145}
1146
1136template <class _Tp, class _Allocator>1147template <class _Tp, class _Allocator>
1137template <class... _Args>1148template <class... _Args>
1138_LIBCPP_CONSTEXPR_SINCE_CXX20 inline1149_LIBCPP_CONSTEXPR_SINCE_CXX20 inline
...@@ -1143,12 +1154,14 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline...@@ -1143,12 +1154,14 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline
1143#endif1154#endif
1144 vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) {1155 vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
1145 pointer __end = this->__end_;1156 pointer __end = this->__end_;
1146 if (__end < this->__cap_) {1157 std::__if_likely_else(
1147 __emplace_back_assume_capacity(std::forward<_Args>(__args)...);1158 __end < this->__cap_,
1148 ++__end;1159 [&] {
1149 } else {1160 __emplace_back_assume_capacity(std::forward<_Args>(__args)...);
1150 __end = __emplace_back_slow_path(std::forward<_Args>(__args)...);1161 ++__end;
1151 }1162 },
1163 [&] { __end = __emplace_back_slow_path(std::forward<_Args>(__args)...); });
1164
1152 this->__end_ = __end;1165 this->__end_ = __end;
1153#if _LIBCPP_STD_VER >= 171166#if _LIBCPP_STD_VER >= 17
1154 return *(__end - 1);1167 return *(__end - 1);
...@@ -1207,7 +1220,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)...@@ -1207,7 +1220,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
1207 *__p = *__xr;1220 *__p = *__xr;
1208 }1221 }
1209 } else {1222 } else {
1210 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);1223 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);
1211 __v.emplace_back(__x);1224 __v.emplace_back(__x);
1212 __p = __swap_out_circular_buffer(__v, __p);1225 __p = __swap_out_circular_buffer(__v, __p);
1213 }1226 }
...@@ -1226,7 +1239,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {...@@ -1226,7 +1239,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {
1226 *__p = std::move(__x);1239 *__p = std::move(__x);
1227 }1240 }
1228 } else {1241 } else {
1229 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);1242 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);
1230 __v.emplace_back(std::move(__x));1243 __v.emplace_back(std::move(__x));
1231 __p = __swap_out_circular_buffer(__v, __p);1244 __p = __swap_out_circular_buffer(__v, __p);
1232 }1245 }
...@@ -1247,7 +1260,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {...@@ -1247,7 +1260,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {
1247 *__p = std::move(__tmp.get());1260 *__p = std::move(__tmp.get());
1248 }1261 }
1249 } else {1262 } else {
1250 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);1263 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);
1251 __v.emplace_back(std::forward<_Args>(__args)...);1264 __v.emplace_back(std::forward<_Args>(__args)...);
1252 __p = __swap_out_circular_buffer(__v, __p);1265 __p = __swap_out_circular_buffer(__v, __p);
1253 }1266 }
...@@ -1275,7 +1288,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_...@@ -1275,7 +1288,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_
1275 std::fill_n(__p, __n, *__xr);1288 std::fill_n(__p, __n, *__xr);
1276 }1289 }
1277 } else {1290 } else {
1278 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, this->__alloc_);1291 __split_buffer<value_type, allocator_type> __v(__recommend(size() + __n), __p - this->__begin_, this->__alloc_);
1279 __v.__construct_at_end(__n, __x);1292 __v.__construct_at_end(__n, __x);
1280 __p = __swap_out_circular_buffer(__v, __p);1293 __p = __swap_out_circular_buffer(__v, __p);
1281 }1294 }
...@@ -1296,28 +1309,28 @@ vector<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inpu...@@ -1296,28 +1309,28 @@ vector<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inpu
1296 if (__first == __last)1309 if (__first == __last)
1297 (void)std::rotate(__p, __old_last, this->__end_);1310 (void)std::rotate(__p, __old_last, this->__end_);
1298 else {1311 else {
1299 __split_buffer<value_type, allocator_type&> __v(__alloc_);1312 __split_buffer<value_type, allocator_type> __v(__alloc_);
1300 auto __guard = std::__make_exception_guard(1313 auto __guard = std::__make_exception_guard(
1301 _AllocatorDestroyRangeReverse<allocator_type, pointer>(__alloc_, __old_last, this->__end_));1314 _AllocatorDestroyRangeReverse<allocator_type, pointer>(__alloc_, __old_last, this->__end_));
1302 __v.__construct_at_end_with_sentinel(std::move(__first), std::move(__last));1315 __v.__construct_at_end_with_sentinel(std::move(__first), std::move(__last));
1303 __split_buffer<value_type, allocator_type&> __merged(1316 __split_buffer<value_type, allocator_type> __merged(
1304 __recommend(size() + __v.size()), __off, __alloc_); // has `__off` positions available at the front1317 __recommend(size() + __v.size()), __off, __alloc_); // has `__off` positions available at the front
1305 std::__uninitialized_allocator_relocate(1318 std::__uninitialized_allocator_relocate(
1306 __alloc_, std::__to_address(__old_last), std::__to_address(this->__end_), std::__to_address(__merged.__end_));1319 __alloc_, std::__to_address(__old_last), std::__to_address(this->__end_), std::__to_address(__merged.end()));
1307 __guard.__complete(); // Release the guard once objects in [__old_last_, __end_) have been successfully relocated.1320 __guard.__complete(); // Release the guard once objects in [__old_last_, __end_) have been successfully relocated.
1308 __merged.__end_ += this->__end_ - __old_last;1321 __merged.__set_sentinel(__merged.end() + (this->__end_ - __old_last));
1309 this->__end_ = __old_last;1322 this->__end_ = __old_last;
1310 std::__uninitialized_allocator_relocate(1323 std::__uninitialized_allocator_relocate(
1311 __alloc_, std::__to_address(__v.__begin_), std::__to_address(__v.__end_), std::__to_address(__merged.__end_));1324 __alloc_, std::__to_address(__v.begin()), std::__to_address(__v.end()), std::__to_address(__merged.end()));
1312 __merged.__end_ += __v.size();1325 __merged.__set_sentinel(__merged.size() + __v.size());
1313 __v.__end_ = __v.__begin_;1326 __v.__set_sentinel(__v.begin());
1314 __p = __swap_out_circular_buffer(__merged, __p);1327 __p = __swap_out_circular_buffer(__merged, __p);
1315 }1328 }
1316 return __make_iter(__p);1329 return __make_iter(__p);
1317}1330}
13181331
1319template <class _Tp, class _Allocator>1332template <class _Tp, class _Allocator>
1320template <class _Iterator, class _Sentinel>1333template <class _AlgPolicy, class _Iterator, class _Sentinel>
1321_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::iterator1334_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::iterator
1322vector<_Tp, _Allocator>::__insert_with_size(1335vector<_Tp, _Allocator>::__insert_with_size(
1323 const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n) {1336 const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n) {
...@@ -1338,15 +1351,15 @@ vector<_Tp, _Allocator>::__insert_with_size(...@@ -1338,15 +1351,15 @@ vector<_Tp, _Allocator>::__insert_with_size(
1338 __construct_at_end(__m, __last, __n - __dx);1351 __construct_at_end(__m, __last, __n - __dx);
1339 if (__dx > 0) {1352 if (__dx > 0) {
1340 __move_range(__p, __old_last, __p + __n);1353 __move_range(__p, __old_last, __p + __n);
1341 __insert_assign_n_unchecked(__first, __dx, __p);1354 __insert_assign_n_unchecked<_AlgPolicy>(__first, __dx, __p);
1342 }1355 }
1343 }1356 }
1344 } else {1357 } else {
1345 __move_range(__p, __old_last, __p + __n);1358 __move_range(__p, __old_last, __p + __n);
1346 __insert_assign_n_unchecked(std::move(__first), __n, __p);1359 __insert_assign_n_unchecked<_AlgPolicy>(std::move(__first), __n, __p);
1347 }1360 }
1348 } else {1361 } else {
1349 __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, this->__alloc_);1362 __split_buffer<value_type, allocator_type> __v(__recommend(size() + __n), __p - this->__begin_, this->__alloc_);
1350 __v.__construct_at_end_with_size(std::move(__first), __n);1363 __v.__construct_at_end_with_size(std::move(__first), __n);
1351 __p = __swap_out_circular_buffer(__v, __p);1364 __p = __swap_out_circular_buffer(__v, __p);
1352 }1365 }
...@@ -1355,21 +1368,35 @@ vector<_Tp, _Allocator>::__insert_with_size(...@@ -1355,21 +1368,35 @@ vector<_Tp, _Allocator>::__insert_with_size(
1355}1368}
13561369
1357template <class _Tp, class _Allocator>1370template <class _Tp, class _Allocator>
1358_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __sz) {1371_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __new_size) {
1359 size_type __cs = size();1372 size_type __current_size = size();
1360 if (__cs < __sz)1373 if (__current_size < __new_size) {
1361 this->__append(__sz - __cs);1374 if (__new_size <= capacity()) {
1362 else if (__cs > __sz)1375 __construct_at_end(__new_size - __current_size);
1363 this->__destruct_at_end(this->__begin_ + __sz);1376 } else {
1377 __split_buffer<value_type, allocator_type> __v(__recommend(__new_size), __current_size, __alloc_);
1378 __v.__construct_at_end(__new_size - __current_size);
1379 __swap_out_circular_buffer(__v);
1380 }
1381 } else if (__current_size > __new_size) {
1382 this->__destruct_at_end(this->__begin_ + __new_size);
1383 }
1364}1384}
13651385
1366template <class _Tp, class _Allocator>1386template <class _Tp, class _Allocator>
1367_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __sz, const_reference __x) {1387_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __new_size, const_reference __x) {
1368 size_type __cs = size();1388 size_type __current_size = size();
1369 if (__cs < __sz)1389 if (__current_size < __new_size) {
1370 this->__append(__sz - __cs, __x);1390 if (__new_size <= capacity())
1371 else if (__cs > __sz)1391 __construct_at_end(__new_size - __current_size, __x);
1372 this->__destruct_at_end(this->__begin_ + __sz);1392 else {
1393 __split_buffer<value_type, allocator_type> __v(__recommend(__new_size), __current_size, __alloc_);
1394 __v.__construct_at_end(__new_size - __current_size, __x);
1395 __swap_out_circular_buffer(__v);
1396 }
1397 } else if (__current_size > __new_size) {
1398 this->__destruct_at_end(this->__begin_ + __new_size);
1399 }
1373}1400}
13741401
1375template <class _Tp, class _Allocator>1402template <class _Tp, class _Allocator>
lib/libcxx/include/__vector/vector_bool.h+76-83
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__algorithm/copy.h>12#include <__algorithm/copy.h>
13#include <__algorithm/copy_backward.h>13#include <__algorithm/copy_backward.h>
14#include <__algorithm/copy_n.h>
14#include <__algorithm/fill_n.h>15#include <__algorithm/fill_n.h>
15#include <__algorithm/iterator_operations.h>16#include <__algorithm/iterator_operations.h>
16#include <__algorithm/max.h>17#include <__algorithm/max.h>
...@@ -19,7 +20,7 @@...@@ -19,7 +20,7 @@
19#include <__bit_reference>20#include <__bit_reference>
20#include <__config>21#include <__config>
21#include <__functional/unary_function.h>22#include <__functional/unary_function.h>
22#include <__fwd/bit_reference.h> // TODO: This is a workaround for https://github.com/llvm/llvm-project/issues/13181423#include <__fwd/bit_reference.h> // TODO: This is a workaround for https://llvm.org/PR131814
23#include <__fwd/functional.h>24#include <__fwd/functional.h>
24#include <__fwd/vector.h>25#include <__fwd/vector.h>
25#include <__iterator/distance.h>26#include <__iterator/distance.h>
...@@ -234,74 +235,89 @@ public:...@@ -234,74 +235,89 @@ public:
234 }235 }
235#endif236#endif
236237
237 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {238 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {
238 return allocator_type(this->__alloc_);239 return allocator_type(this->__alloc_);
239 }240 }
240241
241 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type max_size() const _NOEXCEPT;242 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type max_size() const _NOEXCEPT;
242 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type capacity() const _NOEXCEPT {243 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type capacity() const _NOEXCEPT {
243 return __internal_cap_to_external(__cap_);244 return __internal_cap_to_external(__cap_);
244 }245 }
245 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT { return __size_; }246 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT {
247 return __size_;
248 }
246 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT {249 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT {
247 return __size_ == 0;250 return __size_ == 0;
248 }251 }
249 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __n);252 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __n);
250 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT;253 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT;
251254
252 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT { return __make_iter(0); }255 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT {
253 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT { return __make_iter(0); }256 return __make_iter(0);
254 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT { return __make_iter(__size_); }257 }
255 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {258 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT {
259 return __make_iter(0);
260 }
261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT {
262 return __make_iter(__size_);
263 }
264 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {
256 return __make_iter(__size_);265 return __make_iter(__size_);
257 }266 }
258267
259 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rbegin() _NOEXCEPT {268 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rbegin() _NOEXCEPT {
260 return reverse_iterator(end());269 return reverse_iterator(end());
261 }270 }
262 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator rbegin() const _NOEXCEPT {271 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator
272 rbegin() const _NOEXCEPT {
263 return const_reverse_iterator(end());273 return const_reverse_iterator(end());
264 }274 }
265 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rend() _NOEXCEPT {275 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rend() _NOEXCEPT {
266 return reverse_iterator(begin());276 return reverse_iterator(begin());
267 }277 }
268 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator rend() const _NOEXCEPT {278 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator rend() const _NOEXCEPT {
269 return const_reverse_iterator(begin());279 return const_reverse_iterator(begin());
270 }280 }
271281
272 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT { return __make_iter(0); }282 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT {
273 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT {283 return __make_iter(0);
284 }
285 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT {
274 return __make_iter(__size_);286 return __make_iter(__size_);
275 }287 }
276 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crbegin() const _NOEXCEPT {288 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator
289 crbegin() const _NOEXCEPT {
277 return rbegin();290 return rbegin();
278 }291 }
279 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT { return rend(); }292 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT {
293 return rend();
294 }
280295
281 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __n) {296 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __n) {
282 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector<bool>::operator[] index out of bounds");297 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector<bool>::operator[] index out of bounds");
283 return __make_ref(__n);298 return __make_ref(__n);
284 }299 }
285 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __n) const {300 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference
301 operator[](size_type __n) const {
286 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector<bool>::operator[] index out of bounds");302 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector<bool>::operator[] index out of bounds");
287 return __make_ref(__n);303 return __make_ref(__n);
288 }304 }
289 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference at(size_type __n);305 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference at(size_type __n);
290 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference at(size_type __n) const;306 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference at(size_type __n) const;
291307
292 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() {308 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() {
293 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::front() called on an empty vector");309 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::front() called on an empty vector");
294 return __make_ref(0);310 return __make_ref(0);
295 }311 }
296 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const {312 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const {
297 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::front() called on an empty vector");313 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::front() called on an empty vector");
298 return __make_ref(0);314 return __make_ref(0);
299 }315 }
300 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() {316 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() {
301 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::back() called on an empty vector");317 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::back() called on an empty vector");
302 return __make_ref(__size_ - 1);318 return __make_ref(__size_ - 1);
303 }319 }
304 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const {320 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const {
305 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::back() called on an empty vector");321 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector<bool>::back() called on an empty vector");
306 return __make_ref(__size_ - 1);322 return __make_ref(__size_ - 1);
307 }323 }
...@@ -463,7 +479,6 @@ private:...@@ -463,7 +479,6 @@ private:
463 return (__new_size + (__bits_per_word - 1)) & ~((size_type)__bits_per_word - 1);479 return (__new_size + (__bits_per_word - 1)) & ~((size_type)__bits_per_word - 1);
464 }480 }
465 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __recommend(size_type __new_size) const;481 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __recommend(size_type __new_size) const;
466 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end(size_type __n, bool __x);
467 template <class _InputIterator, class _Sentinel>482 template <class _InputIterator, class _Sentinel>
468 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void483 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
469 __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);484 __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);
...@@ -552,20 +567,6 @@ vector<bool, _Allocator>::__recommend(size_type __new_size) const {...@@ -552,20 +567,6 @@ vector<bool, _Allocator>::__recommend(size_type __new_size) const {
552 return std::max<size_type>(2 * __cap, __align_it(__new_size));567 return std::max<size_type>(2 * __cap, __align_it(__new_size));
553}568}
554569
555// Default constructs __n objects starting at __end_
556// Precondition: size() + __n <= capacity()
557// Postcondition: size() == size() + __n
558template <class _Allocator>
559inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
560vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x) {
561 _LIBCPP_ASSERT_INTERNAL(
562 capacity() >= size() + __n, "vector<bool>::__construct_at_end called with insufficient capacity");
563 std::fill_n(end(), __n, __x);
564 this->__size_ += __n;
565 if (end().__ctz_ != 0) // Ensure uninitialized leading bits in the last word are set to zero
566 std::fill_n(end(), __bits_per_word - end().__ctz_, 0);
567}
568
569template <class _Allocator>570template <class _Allocator>
570template <class _InputIterator, class _Sentinel>571template <class _InputIterator, class _Sentinel>
571_LIBCPP_CONSTEXPR_SINCE_CXX20 void572_LIBCPP_CONSTEXPR_SINCE_CXX20 void
...@@ -598,7 +599,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n)...@@ -598,7 +599,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n)
598 : __begin_(nullptr), __size_(0), __cap_(0) {599 : __begin_(nullptr), __size_(0), __cap_(0) {
599 if (__n > 0) {600 if (__n > 0) {
600 __vallocate(__n);601 __vallocate(__n);
601 __construct_at_end(__n, false);602 std::fill_n(__begin_, __external_cap_to_internal(__n), __storage_type(0));
603 __size_ = __n;
602 }604 }
603}605}
604606
...@@ -608,7 +610,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, co...@@ -608,7 +610,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, co
608 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(static_cast<__storage_allocator>(__a)) {610 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(static_cast<__storage_allocator>(__a)) {
609 if (__n > 0) {611 if (__n > 0) {
610 __vallocate(__n);612 __vallocate(__n);
611 __construct_at_end(__n, false);613 std::fill_n(__begin_, __external_cap_to_internal(__n), __storage_type(0));
614 __size_ = __n;
612 }615 }
613}616}
614#endif617#endif
...@@ -618,7 +621,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, co...@@ -618,7 +621,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, co
618 : __begin_(nullptr), __size_(0), __cap_(0) {621 : __begin_(nullptr), __size_(0), __cap_(0) {
619 if (__n > 0) {622 if (__n > 0) {
620 __vallocate(__n);623 __vallocate(__n);
621 __construct_at_end(__n, __x);624 std::fill_n(__begin_, __external_cap_to_internal(__n), __storage_type(0) - __x);
625 __size_ = __n;
622 }626 }
623}627}
624628
...@@ -628,7 +632,8 @@ vector<bool, _Allocator>::vector(size_type __n, const value_type& __x, const all...@@ -628,7 +632,8 @@ vector<bool, _Allocator>::vector(size_type __n, const value_type& __x, const all
628 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(static_cast<__storage_allocator>(__a)) {632 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(static_cast<__storage_allocator>(__a)) {
629 if (__n > 0) {633 if (__n > 0) {
630 __vallocate(__n);634 __vallocate(__n);
631 __construct_at_end(__n, __x);635 std::fill_n(__begin_, __external_cap_to_internal(__n), __storage_type(0) - __x);
636 __size_ = __n;
632 }637 }
633}638}
634639
...@@ -697,7 +702,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(const vector& __v...@@ -697,7 +702,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(const vector& __v
697 __alloc_(__storage_traits::select_on_container_copy_construction(__v.__alloc_)) {702 __alloc_(__storage_traits::select_on_container_copy_construction(__v.__alloc_)) {
698 if (__v.size() > 0) {703 if (__v.size() > 0) {
699 __vallocate(__v.size());704 __vallocate(__v.size());
700 __construct_at_end(__v.begin(), __v.end(), __v.size());705 std::copy_n(__v.__begin_, __external_cap_to_internal(__v.size()), __begin_);
706 __size_ = __v.size();
701 }707 }
702}708}
703709
...@@ -706,7 +712,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(const vector& __v...@@ -706,7 +712,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(const vector& __v
706 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(__a) {712 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(__a) {
707 if (__v.size() > 0) {713 if (__v.size() > 0) {
708 __vallocate(__v.size());714 __vallocate(__v.size());
709 __construct_at_end(__v.begin(), __v.end(), __v.size());715 std::copy_n(__v.__begin_, __external_cap_to_internal(__v.size()), __begin_);
716 __size_ = __v.size();
710 }717 }
711}718}
712719
...@@ -719,7 +726,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>& vector<bool, _Allocator>...@@ -719,7 +726,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>& vector<bool, _Allocator>
719 __vdeallocate();726 __vdeallocate();
720 __vallocate(__v.__size_);727 __vallocate(__v.__size_);
721 }728 }
722 std::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);729 std::copy_n(__v.__begin_, __external_cap_to_internal(__v.size()), __begin_);
723 }730 }
724 __size_ = __v.__size_;731 __size_ = __v.__size_;
725 }732 }
...@@ -754,7 +761,8 @@ vector<bool, _Allocator>::vector(vector&& __v, const __type_identity_t<allocator...@@ -754,7 +761,8 @@ vector<bool, _Allocator>::vector(vector&& __v, const __type_identity_t<allocator
754 __v.__cap_ = __v.__size_ = 0;761 __v.__cap_ = __v.__size_ = 0;
755 } else if (__v.size() > 0) {762 } else if (__v.size() > 0) {
756 __vallocate(__v.size());763 __vallocate(__v.size());
757 __construct_at_end(__v.begin(), __v.end(), __v.size());764 __size_ = __v.__size_;
765 std::copy_n(__v.__begin_, __external_cap_to_internal(__v.size()), __begin_);
758 }766 }
759}767}
760768
...@@ -849,7 +857,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::reserve(size_type _...@@ -849,7 +857,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::reserve(size_type _
849 this->__throw_length_error();857 this->__throw_length_error();
850 vector __v(this->get_allocator());858 vector __v(this->get_allocator());
851 __v.__vallocate(__n);859 __v.__vallocate(__n);
852 __v.__construct_at_end(this->begin(), this->end(), this->size());860 __v.__size_ = __size_;
861 std::copy_n(__begin_, __external_cap_to_internal(__size_), __v.__begin_);
853 swap(__v);862 swap(__v);
854 }863 }
855}864}
...@@ -956,21 +965,14 @@ vector<bool, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inp...@@ -956,21 +965,14 @@ vector<bool, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inp
956 }965 }
957 vector __v(get_allocator());966 vector __v(get_allocator());
958 if (__first != __last) {967 if (__first != __last) {
959#if _LIBCPP_HAS_EXCEPTIONS968 auto __guard = std::__make_exception_guard([&] { erase(__old_end, end()); });
960 try {969 __v.__assign_with_sentinel(std::move(__first), std::move(__last));
961#endif // _LIBCPP_HAS_EXCEPTIONS970 difference_type __old_size = static_cast<difference_type>(__old_end - begin());
962 __v.__assign_with_sentinel(std::move(__first), std::move(__last));971 difference_type __old_p = __p - begin();
963 difference_type __old_size = static_cast<difference_type>(__old_end - begin());972 reserve(__recommend(size() + __v.size()));
964 difference_type __old_p = __p - begin();973 __p = begin() + __old_p;
965 reserve(__recommend(size() + __v.size()));974 __old_end = begin() + __old_size;
966 __p = begin() + __old_p;975 __guard.__complete();
967 __old_end = begin() + __old_size;
968#if _LIBCPP_HAS_EXCEPTIONS
969 } catch (...) {
970 erase(__old_end, end());
971 throw;
972 }
973#endif // _LIBCPP_HAS_EXCEPTIONS
974 }976 }
975 __p = std::rotate(__p, __old_end, end());977 __p = std::rotate(__p, __old_end, end());
976 insert(__p, __v.begin(), __v.end());978 insert(__p, __v.begin(), __v.end());
...@@ -1048,25 +1050,16 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::swap(vector& __x)...@@ -1048,25 +1050,16 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::swap(vector& __x)
1048}1050}
10491051
1050template <class _Allocator>1052template <class _Allocator>
1051_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::resize(size_type __sz, value_type __x) {1053_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::resize(size_type __new_size, value_type __x) {
1052 size_type __cs = size();1054 size_type __current_size = size();
1053 if (__cs < __sz) {1055 if (__new_size < __current_size) {
1054 iterator __r;1056 __size_ = __new_size;
1055 size_type __c = capacity();1057 return;
1056 size_type __n = __sz - __cs;1058 }
1057 if (__n <= __c && __cs <= __c - __n) {1059
1058 __r = end();1060 reserve(__new_size);
1059 __size_ += __n;1061 std::fill_n(end(), __new_size - __current_size, __x);
1060 } else {1062 __size_ = __new_size;
1061 vector __v(get_allocator());
1062 __v.reserve(__recommend(__size_ + __n));
1063 __v.__size_ = __size_ + __n;
1064 __r = std::copy(cbegin(), cend(), __v.begin());
1065 swap(__v);
1066 }
1067 std::fill_n(__r, __n, __x);
1068 } else
1069 __size_ = __sz;
1070}1063}
10711064
1072template <class _Allocator>1065template <class _Allocator>
lib/libcxx/include/any+118-155
...@@ -84,14 +84,12 @@ namespace std {...@@ -84,14 +84,12 @@ namespace std {
84# include <__cxx03/__config>84# include <__cxx03/__config>
85#else85#else
86# include <__config>86# include <__config>
87# include <__memory/allocator.h>87# include <__memory/construct_at.h>
88# include <__memory/allocator_destructor.h>88# include <__new/allocate.h>
89# include <__memory/allocator_traits.h>
90# include <__memory/unique_ptr.h>
91# include <__type_traits/add_cv_quals.h>89# include <__type_traits/add_cv_quals.h>
92# include <__type_traits/add_pointer.h>90# include <__type_traits/add_pointer.h>
93# include <__type_traits/aligned_storage.h>
94# include <__type_traits/conditional.h>91# include <__type_traits/conditional.h>
92# include <__type_traits/conjunction.h>
95# include <__type_traits/decay.h>93# include <__type_traits/decay.h>
96# include <__type_traits/enable_if.h>94# include <__type_traits/enable_if.h>
97# include <__type_traits/is_constructible.h>95# include <__type_traits/is_constructible.h>
...@@ -100,9 +98,11 @@ namespace std {...@@ -100,9 +98,11 @@ namespace std {
100# include <__type_traits/is_reference.h>98# include <__type_traits/is_reference.h>
101# include <__type_traits/is_same.h>99# include <__type_traits/is_same.h>
102# include <__type_traits/is_void.h>100# include <__type_traits/is_void.h>
101# include <__type_traits/negation.h>
103# include <__type_traits/remove_cv.h>102# include <__type_traits/remove_cv.h>
104# include <__type_traits/remove_cvref.h>103# include <__type_traits/remove_cvref.h>
105# include <__type_traits/remove_reference.h>104# include <__type_traits/remove_reference.h>
105# include <__utility/exception_guard.h>
106# include <__utility/forward.h>106# include <__utility/forward.h>
107# include <__utility/in_place.h>107# include <__utility/in_place.h>
108# include <__utility/move.h>108# include <__utility/move.h>
...@@ -142,21 +142,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -142,21 +142,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD
142class any;142class any;
143143
144template <class _ValueType>144template <class _ValueType>
145_LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const*) _NOEXCEPT;145_LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const*) noexcept;
146146
147template <class _ValueType>147template <class _ValueType>
148_LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any*) _NOEXCEPT;148_LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any*) noexcept;
149149
150namespace __any_imp {150namespace __any_imp {
151_LIBCPP_SUPPRESS_DEPRECATED_PUSH151inline constexpr size_t __small_buffer_size = 3 * sizeof(void*);
152using _Buffer _LIBCPP_NODEBUG = aligned_storage_t<3 * sizeof(void*), alignof(void*)>;152inline constexpr size_t __small_buffer_alignment = alignof(void*);
153_LIBCPP_SUPPRESS_DEPRECATED_POP
154153
155template <class _Tp>154template <class _Tp>
156using _IsSmallObject _LIBCPP_NODEBUG =155using _IsSmallObject _LIBCPP_NODEBUG =
157 integral_constant<bool,156 integral_constant<bool,
158 sizeof(_Tp) <= sizeof(_Buffer) && alignof(_Buffer) % alignof(_Tp) == 0 &&157 sizeof(_Tp) <= __small_buffer_size && alignof(_Tp) <= __small_buffer_alignment &&
159 is_nothrow_move_constructible<_Tp>::value >;158 is_nothrow_move_constructible_v<_Tp>>;
160159
161enum class _Action { _Destroy, _Copy, _Move, _Get, _TypeInfo };160enum class _Action { _Destroy, _Copy, _Move, _Get, _TypeInfo };
162161
...@@ -192,37 +191,44 @@ using _Handler _LIBCPP_NODEBUG = conditional_t< _IsSmallObject<_Tp>::value, _Sma...@@ -192,37 +191,44 @@ using _Handler _LIBCPP_NODEBUG = conditional_t< _IsSmallObject<_Tp>::value, _Sma
192class any {191class any {
193public:192public:
194 // construct/destruct193 // construct/destruct
195 _LIBCPP_HIDE_FROM_ABI constexpr any() _NOEXCEPT : __h_(nullptr) {}194 _LIBCPP_HIDE_FROM_ABI constexpr any() noexcept : __h_(nullptr) {}
196195
197 _LIBCPP_HIDE_FROM_ABI any(any const& __other) : __h_(nullptr) {196 _LIBCPP_HIDE_FROM_ABI any(any const& __other) : __h_(nullptr) {
198 if (__other.__h_)197 if (__other.__h_)
199 __other.__call(_Action::_Copy, this);198 __other.__call(_Action::_Copy, this);
200 }199 }
201200
202 _LIBCPP_HIDE_FROM_ABI any(any&& __other) _NOEXCEPT : __h_(nullptr) {201 _LIBCPP_HIDE_FROM_ABI any(any&& __other) noexcept : __h_(nullptr) {
203 if (__other.__h_)202 if (__other.__h_)
204 __other.__call(_Action::_Move, this);203 __other.__call(_Action::_Move, this);
205 }204 }
206205
207 template < class _ValueType,206 template <
208 class _Tp = decay_t<_ValueType>,207 class _ValueType,
209 class = enable_if_t< !is_same<_Tp, any>::value && !__is_inplace_type<_ValueType>::value &&208 class _Tp = decay_t<_ValueType>,
210 is_copy_constructible<_Tp>::value> >209 enable_if_t<_And<_Not<is_same<_Tp, any>>, _Not<__is_inplace_type<_ValueType>>, is_copy_constructible<_Tp>>::value,
211 _LIBCPP_HIDE_FROM_ABI any(_ValueType&& __value);210 int> = 0>
211 _LIBCPP_HIDE_FROM_ABI any(_ValueType&& __value) : __h_(nullptr) {
212 __any_imp::_Handler<_Tp>::__create(*this, std::forward<_ValueType>(__value));
213 }
212214
213 template <class _ValueType,215 template <class _ValueType,
214 class... _Args,216 class... _Args,
215 class _Tp = decay_t<_ValueType>,217 class _Tp = decay_t<_ValueType>,
216 class = enable_if_t< is_constructible<_Tp, _Args...>::value && is_copy_constructible<_Tp>::value > >218 enable_if_t<is_constructible_v<_Tp, _Args...> && is_copy_constructible_v<_Tp>, int> = 0>
217 _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, _Args&&... __args);219 _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, _Args&&... __args) {
220 __any_imp::_Handler<_Tp>::__create(*this, std::forward<_Args>(__args)...);
221 }
218222
219 template <class _ValueType,223 template <
220 class _Up,224 class _ValueType,
221 class... _Args,225 class _Up,
222 class _Tp = decay_t<_ValueType>,226 class... _Args,
223 class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&227 class _Tp = decay_t<_ValueType>,
224 is_copy_constructible<_Tp>::value> >228 enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && is_copy_constructible_v<_Tp>, int> = 0>
225 _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args);229 _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
230 __any_imp::_Handler<_Tp>::__create(*this, __il, std::forward<_Args>(__args)...);
231 }
226232
227 _LIBCPP_HIDE_FROM_ABI ~any() { this->reset(); }233 _LIBCPP_HIDE_FROM_ABI ~any() { this->reset(); }
228234
...@@ -232,43 +238,65 @@ public:...@@ -232,43 +238,65 @@ public:
232 return *this;238 return *this;
233 }239 }
234240
235 _LIBCPP_HIDE_FROM_ABI any& operator=(any&& __rhs) _NOEXCEPT {241 _LIBCPP_HIDE_FROM_ABI any& operator=(any&& __rhs) noexcept {
236 any(std::move(__rhs)).swap(*this);242 any(std::move(__rhs)).swap(*this);
237 return *this;243 return *this;
238 }244 }
239245
240 template < class _ValueType,
241 class _Tp = decay_t<_ValueType>,
242 class = enable_if_t< !is_same<_Tp, any>::value && is_copy_constructible<_Tp>::value> >
243 _LIBCPP_HIDE_FROM_ABI any& operator=(_ValueType&& __rhs);
244
245 template <class _ValueType,246 template <class _ValueType,
246 class... _Args,247 class _Tp = decay_t<_ValueType>,
247 class _Tp = decay_t<_ValueType>,248 enable_if_t<!is_same_v<_Tp, any> && is_copy_constructible_v<_Tp>, int> = 0>
248 class = enable_if_t< is_constructible<_Tp, _Args...>::value && is_copy_constructible<_Tp>::value> >249 _LIBCPP_HIDE_FROM_ABI any& operator=(_ValueType&& __rhs) {
249 _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&...);250 any(std::forward<_ValueType>(__rhs)).swap(*this);
251 return *this;
252 }
250253
251 template <class _ValueType,254 template <class _ValueType,
252 class _Up,
253 class... _Args,255 class... _Args,
254 class _Tp = decay_t<_ValueType>,256 class _Tp = decay_t<_ValueType>,
255 class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&257 enable_if_t<is_constructible_v<_Tp, _Args...> && is_copy_constructible_v<_Tp>, int> = 0>
256 is_copy_constructible<_Tp>::value> >258 _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&... __args) {
257 _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up>, _Args&&...);259 reset();
260 return __any_imp::_Handler<_Tp>::__create(*this, std::forward<_Args>(__args)...);
261 }
262
263 template <
264 class _ValueType,
265 class _Up,
266 class... _Args,
267 class _Tp = decay_t<_ValueType>,
268 enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && is_copy_constructible_v<_Tp>, int> = 0>
269 _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
270 reset();
271 return __any_imp::_Handler<_Tp>::__create(*this, __il, std::forward<_Args>(__args)...);
272 }
258273
259 // 6.3.3 any modifiers274 // 6.3.3 any modifiers
260 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT {275 _LIBCPP_HIDE_FROM_ABI void reset() noexcept {
261 if (__h_)276 if (__h_)
262 this->__call(_Action::_Destroy);277 this->__call(_Action::_Destroy);
263 }278 }
264279
265 _LIBCPP_HIDE_FROM_ABI void swap(any& __rhs) _NOEXCEPT;280 _LIBCPP_HIDE_FROM_ABI void swap(any& __rhs) noexcept {
281 if (this == &__rhs)
282 return;
283 if (__h_ && __rhs.__h_) {
284 any __tmp;
285 __rhs.__call(_Action::_Move, &__tmp);
286 this->__call(_Action::_Move, &__rhs);
287 __tmp.__call(_Action::_Move, this);
288 } else if (__h_) {
289 this->__call(_Action::_Move, &__rhs);
290 } else if (__rhs.__h_) {
291 __rhs.__call(_Action::_Move, this);
292 }
293 }
266294
267 // 6.3.4 any observers295 // 6.3.4 any observers
268 _LIBCPP_HIDE_FROM_ABI bool has_value() const _NOEXCEPT { return __h_ != nullptr; }296 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool has_value() const noexcept { return __h_ != nullptr; }
269297
270# if _LIBCPP_HAS_RTTI298# if _LIBCPP_HAS_RTTI
271 _LIBCPP_HIDE_FROM_ABI const type_info& type() const _NOEXCEPT {299 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const type_info& type() const noexcept {
272 if (__h_) {300 if (__h_) {
273 return *static_cast<type_info const*>(this->__call(_Action::_TypeInfo));301 return *static_cast<type_info const*>(this->__call(_Action::_TypeInfo));
274 } else {302 } else {
...@@ -285,7 +313,7 @@ private:...@@ -285,7 +313,7 @@ private:
285 union _Storage {313 union _Storage {
286 _LIBCPP_HIDE_FROM_ABI constexpr _Storage() : __ptr(nullptr) {}314 _LIBCPP_HIDE_FROM_ABI constexpr _Storage() : __ptr(nullptr) {}
287 void* __ptr;315 void* __ptr;
288 __any_imp::_Buffer __buf;316 alignas(__any_imp::__small_buffer_alignment) char __buf[__any_imp::__small_buffer_size];
289 };317 };
290318
291 _LIBCPP_HIDE_FROM_ABI void*319 _LIBCPP_HIDE_FROM_ABI void*
...@@ -305,10 +333,10 @@ private:...@@ -305,10 +333,10 @@ private:
305 friend struct __any_imp::_LargeHandler;333 friend struct __any_imp::_LargeHandler;
306334
307 template <class _ValueType>335 template <class _ValueType>
308 friend add_pointer_t<add_const_t<_ValueType>> any_cast(any const*) _NOEXCEPT;336 friend add_pointer_t<add_const_t<_ValueType>> any_cast(any const*) noexcept;
309337
310 template <class _ValueType>338 template <class _ValueType>
311 friend add_pointer_t<_ValueType> any_cast(any*) _NOEXCEPT;339 friend add_pointer_t<_ValueType> any_cast(any*) noexcept;
312340
313 _HandleFuncPtr __h_ = nullptr;341 _HandleFuncPtr __h_ = nullptr;
314 _Storage __s_;342 _Storage __s_;
...@@ -339,22 +367,14 @@ struct _SmallHandler {...@@ -339,22 +367,14 @@ struct _SmallHandler {
339367
340 template <class... _Args>368 template <class... _Args>
341 _LIBCPP_HIDE_FROM_ABI static _Tp& __create(any& __dest, _Args&&... __args) {369 _LIBCPP_HIDE_FROM_ABI static _Tp& __create(any& __dest, _Args&&... __args) {
342 typedef allocator<_Tp> _Alloc;370 auto __ret = std::__construct_at(reinterpret_cast<_Tp*>(&__dest.__s_.__buf), std::forward<_Args>(__args)...);
343 typedef allocator_traits<_Alloc> _ATraits;
344 _Alloc __a;
345 _Tp* __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s_.__buf));
346 _ATraits::construct(__a, __ret, std::forward<_Args>(__args)...);
347 __dest.__h_ = &_SmallHandler::__handle;371 __dest.__h_ = &_SmallHandler::__handle;
348 return *__ret;372 return *__ret;
349 }373 }
350374
351private:375private:
352 _LIBCPP_HIDE_FROM_ABI static void __destroy(any& __this) {376 _LIBCPP_HIDE_FROM_ABI static void __destroy(any& __this) {
353 typedef allocator<_Tp> _Alloc;377 std::__destroy_at(reinterpret_cast<_Tp*>(&__this.__s_.__buf));
354 typedef allocator_traits<_Alloc> _ATraits;
355 _Alloc __a;
356 _Tp* __p = static_cast<_Tp*>(static_cast<void*>(&__this.__s_.__buf));
357 _ATraits::destroy(__a, __p);
358 __this.__h_ = nullptr;378 __this.__h_ = nullptr;
359 }379 }
360380
...@@ -406,26 +426,20 @@ struct _LargeHandler {...@@ -406,26 +426,20 @@ struct _LargeHandler {
406426
407 template <class... _Args>427 template <class... _Args>
408 _LIBCPP_HIDE_FROM_ABI static _Tp& __create(any& __dest, _Args&&... __args) {428 _LIBCPP_HIDE_FROM_ABI static _Tp& __create(any& __dest, _Args&&... __args) {
409 typedef allocator<_Tp> _Alloc;429 _Tp* __ptr = static_cast<_Tp*>(std::__libcpp_allocate<_Tp>(__element_count(1)));
410 typedef allocator_traits<_Alloc> _ATraits;430 std::__exception_guard __guard([&] { std::__libcpp_deallocate<_Tp>(__ptr, __element_count(1)); });
411 typedef __allocator_destructor<_Alloc> _Dp;431 std::__construct_at(__ptr, std::forward<_Args>(__args)...);
412 _Alloc __a;432 __guard.__complete();
413 unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));433 __dest.__s_.__ptr = __ptr;
414 _Tp* __ret = __hold.get();
415 _ATraits::construct(__a, __ret, std::forward<_Args>(__args)...);
416 __dest.__s_.__ptr = __hold.release();
417 __dest.__h_ = &_LargeHandler::__handle;434 __dest.__h_ = &_LargeHandler::__handle;
418 return *__ret;435 return *__ptr;
419 }436 }
420437
421private:438private:
422 _LIBCPP_HIDE_FROM_ABI static void __destroy(any& __this) {439 _LIBCPP_HIDE_FROM_ABI static void __destroy(any& __this) {
423 typedef allocator<_Tp> _Alloc;
424 typedef allocator_traits<_Alloc> _ATraits;
425 _Alloc __a;
426 _Tp* __p = static_cast<_Tp*>(__this.__s_.__ptr);440 _Tp* __p = static_cast<_Tp*>(__this.__s_.__ptr);
427 _ATraits::destroy(__a, __p);441 std::__destroy_at(__p);
428 _ATraits::deallocate(__a, __p, 1);442 std::__libcpp_deallocate<_Tp>(__p, __element_count(1));
429 __this.__h_ = nullptr;443 __this.__h_ = nullptr;
430 }444 }
431445
...@@ -456,72 +470,24 @@ private:...@@ -456,72 +470,24 @@ private:
456470
457} // namespace __any_imp471} // namespace __any_imp
458472
459template <class _ValueType, class _Tp, class>
460any::any(_ValueType&& __v) : __h_(nullptr) {
461 __any_imp::_Handler<_Tp>::__create(*this, std::forward<_ValueType>(__v));
462}
463
464template <class _ValueType, class... _Args, class _Tp, class>
465any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
466 __any_imp::_Handler<_Tp>::__create(*this, std::forward<_Args>(__args)...);
467}
468
469template <class _ValueType, class _Up, class... _Args, class _Tp, class>
470any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
471 __any_imp::_Handler<_Tp>::__create(*this, __il, std::forward<_Args>(__args)...);
472}
473
474template <class _ValueType, class, class>
475inline _LIBCPP_HIDE_FROM_ABI any& any::operator=(_ValueType&& __v) {
476 any(std::forward<_ValueType>(__v)).swap(*this);
477 return *this;
478}
479
480template <class _ValueType, class... _Args, class _Tp, class>
481inline _LIBCPP_HIDE_FROM_ABI _Tp& any::emplace(_Args&&... __args) {
482 reset();
483 return __any_imp::_Handler<_Tp>::__create(*this, std::forward<_Args>(__args)...);
484}
485
486template <class _ValueType, class _Up, class... _Args, class _Tp, class>
487inline _LIBCPP_HIDE_FROM_ABI _Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
488 reset();
489 return __any_imp::_Handler<_Tp>::__create(*this, __il, std::forward<_Args>(__args)...);
490}
491
492inline _LIBCPP_HIDE_FROM_ABI void any::swap(any& __rhs) _NOEXCEPT {
493 if (this == &__rhs)
494 return;
495 if (__h_ && __rhs.__h_) {
496 any __tmp;
497 __rhs.__call(_Action::_Move, &__tmp);
498 this->__call(_Action::_Move, &__rhs);
499 __tmp.__call(_Action::_Move, this);
500 } else if (__h_) {
501 this->__call(_Action::_Move, &__rhs);
502 } else if (__rhs.__h_) {
503 __rhs.__call(_Action::_Move, this);
504 }
505}
506
507// 6.4 Non-member functions473// 6.4 Non-member functions
508474
509inline _LIBCPP_HIDE_FROM_ABI void swap(any& __lhs, any& __rhs) _NOEXCEPT { __lhs.swap(__rhs); }475inline _LIBCPP_HIDE_FROM_ABI void swap(any& __lhs, any& __rhs) noexcept { __lhs.swap(__rhs); }
510476
511template <class _Tp, class... _Args>477template <class _Tp, class... _Args>
512inline _LIBCPP_HIDE_FROM_ABI any make_any(_Args&&... __args) {478[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI any make_any(_Args&&... __args) {
513 return any(in_place_type<_Tp>, std::forward<_Args>(__args)...);479 return any(in_place_type<_Tp>, std::forward<_Args>(__args)...);
514}480}
515481
516template <class _Tp, class _Up, class... _Args>482template <class _Tp, class _Up, class... _Args>
517inline _LIBCPP_HIDE_FROM_ABI any make_any(initializer_list<_Up> __il, _Args&&... __args) {483[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI any make_any(initializer_list<_Up> __il, _Args&&... __args) {
518 return any(in_place_type<_Tp>, __il, std::forward<_Args>(__args)...);484 return any(in_place_type<_Tp>, __il, std::forward<_Args>(__args)...);
519}485}
520486
521template <class _ValueType>487template <class _ValueType>
522inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any const& __v) {488[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any const& __v) {
523 using _RawValueType = __remove_cvref_t<_ValueType>;489 using _RawValueType = __remove_cvref_t<_ValueType>;
524 static_assert(is_constructible<_ValueType, _RawValueType const&>::value,490 static_assert(is_constructible_v<_ValueType, _RawValueType const&>,
525 "ValueType is required to be a const lvalue reference "491 "ValueType is required to be a const lvalue reference "
526 "or a CopyConstructible type");492 "or a CopyConstructible type");
527 auto __tmp = std::any_cast<add_const_t<_RawValueType>>(&__v);493 auto __tmp = std::any_cast<add_const_t<_RawValueType>>(&__v);
...@@ -531,9 +497,9 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any const& __v) {...@@ -531,9 +497,9 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any const& __v) {
531}497}
532498
533template <class _ValueType>499template <class _ValueType>
534inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any& __v) {500[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any& __v) {
535 using _RawValueType = __remove_cvref_t<_ValueType>;501 using _RawValueType = __remove_cvref_t<_ValueType>;
536 static_assert(is_constructible<_ValueType, _RawValueType&>::value,502 static_assert(is_constructible_v<_ValueType, _RawValueType&>,
537 "ValueType is required to be an lvalue reference "503 "ValueType is required to be an lvalue reference "
538 "or a CopyConstructible type");504 "or a CopyConstructible type");
539 auto __tmp = std::any_cast<_RawValueType>(&__v);505 auto __tmp = std::any_cast<_RawValueType>(&__v);
...@@ -543,9 +509,9 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any& __v) {...@@ -543,9 +509,9 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any& __v) {
543}509}
544510
545template <class _ValueType>511template <class _ValueType>
546inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any&& __v) {512[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any&& __v) {
547 using _RawValueType = __remove_cvref_t<_ValueType>;513 using _RawValueType = __remove_cvref_t<_ValueType>;
548 static_assert(is_constructible<_ValueType, _RawValueType>::value,514 static_assert(is_constructible_v<_ValueType, _RawValueType>,
549 "ValueType is required to be an rvalue reference "515 "ValueType is required to be an rvalue reference "
550 "or a CopyConstructible type");516 "or a CopyConstructible type");
551 auto __tmp = std::any_cast<_RawValueType>(&__v);517 auto __tmp = std::any_cast<_RawValueType>(&__v);
...@@ -555,39 +521,31 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any&& __v) {...@@ -555,39 +521,31 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType any_cast(any&& __v) {
555}521}
556522
557template <class _ValueType>523template <class _ValueType>
558inline _LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const* __any) _NOEXCEPT {524[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const* __any) noexcept {
559 static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");525 static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
560 static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a reference.");526 static_assert(!is_reference_v<_ValueType>, "_ValueType may not be a reference.");
561 return std::any_cast<_ValueType>(const_cast<any*>(__any));527 return std::any_cast<_ValueType>(const_cast<any*>(__any));
562}528}
563529
564template <class _RetType>
565inline _LIBCPP_HIDE_FROM_ABI _RetType __pointer_or_func_cast(void* __p, /*IsFunction*/ false_type) noexcept {
566 return static_cast<_RetType>(__p);
567}
568
569template <class _RetType>
570inline _LIBCPP_HIDE_FROM_ABI _RetType __pointer_or_func_cast(void*, /*IsFunction*/ true_type) noexcept {
571 return nullptr;
572}
573
574template <class _ValueType>530template <class _ValueType>
575_LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) _NOEXCEPT {531[[nodiscard]] _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) noexcept {
576 using __any_imp::_Action;532 using __any_imp::_Action;
577 static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");533 static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
578 static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a reference.");534 static_assert(!is_reference_v<_ValueType>, "_ValueType may not be a reference.");
579 typedef add_pointer_t<_ValueType> _ReturnType;535 if constexpr (!is_function_v<_ValueType>) {
580 if (__any && __any->__h_) {536 using _ReturnType = add_pointer_t<_ValueType>;
581 void* __p = __any->__call(537 if (__any && __any->__h_) {
582 _Action::_Get,538 void* __p = __any->__call(
583 nullptr,539 _Action::_Get,
540 nullptr,
584# if _LIBCPP_HAS_RTTI541# if _LIBCPP_HAS_RTTI
585 &typeid(_ValueType),542 &typeid(_ValueType),
586# else543# else
587 nullptr,544 nullptr,
588# endif545# endif
589 __any_imp::__get_fallback_typeid<_ValueType>());546 __any_imp::__get_fallback_typeid<_ValueType>());
590 return std::__pointer_or_func_cast<_ReturnType>(__p, is_function<_ValueType>{});547 return static_cast<_ReturnType>(__p);
548 }
591 }549 }
592 return nullptr;550 return nullptr;
593}551}
...@@ -613,6 +571,11 @@ _LIBCPP_POP_MACROS...@@ -613,6 +571,11 @@ _LIBCPP_POP_MACROS
613# include <type_traits>571# include <type_traits>
614# include <variant>572# include <variant>
615# endif573# endif
574
575# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
576# include <cstring>
577# include <limits>
578# endif
616#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)579#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
617580
618#endif // _LIBCPP_ANY581#endif // _LIBCPP_ANY
lib/libcxx/include/array+88-56
...@@ -134,7 +134,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce...@@ -134,7 +134,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
134# include <__type_traits/is_const.h>134# include <__type_traits/is_const.h>
135# include <__type_traits/is_constructible.h>135# include <__type_traits/is_constructible.h>
136# include <__type_traits/is_nothrow_constructible.h>136# include <__type_traits/is_nothrow_constructible.h>
137# include <__type_traits/is_replaceable.h>
138# include <__type_traits/is_same.h>137# include <__type_traits/is_same.h>
139# include <__type_traits/is_swappable.h>138# include <__type_traits/is_swappable.h>
140# include <__type_traits/is_trivially_relocatable.h>139# include <__type_traits/is_trivially_relocatable.h>
...@@ -176,7 +175,6 @@ template <class _Tp, size_t _Size>...@@ -176,7 +175,6 @@ template <class _Tp, size_t _Size>
176struct array {175struct array {
177 using __trivially_relocatable _LIBCPP_NODEBUG =176 using __trivially_relocatable _LIBCPP_NODEBUG =
178 __conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, array, void>;177 __conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, array, void>;
179 using __replaceable _LIBCPP_NODEBUG = __conditional_t<__is_replaceable_v<_Tp>, array, void>;
180178
181 // types:179 // types:
182 using __self _LIBCPP_NODEBUG = array;180 using __self _LIBCPP_NODEBUG = array;
...@@ -212,28 +210,28 @@ struct array {...@@ -212,28 +210,28 @@ struct array {
212 }210 }
213211
214 // iterators:212 // iterators:
215 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT {213 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT {
216# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)214# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
217 return std::__make_static_bounded_iter<_Size>(data(), data());215 return std::__make_static_bounded_iter<_Size>(data(), data());
218# else216# else
219 return iterator(data());217 return iterator(data());
220# endif218# endif
221 }219 }
222 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT {220 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT {
223# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)221# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
224 return std::__make_static_bounded_iter<_Size>(data(), data());222 return std::__make_static_bounded_iter<_Size>(data(), data());
225# else223# else
226 return const_iterator(data());224 return const_iterator(data());
227# endif225# endif
228 }226 }
229 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT {227 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT {
230# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)228# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
231 return std::__make_static_bounded_iter<_Size>(data() + _Size, data());229 return std::__make_static_bounded_iter<_Size>(data() + _Size, data());
232# else230# else
233 return iterator(data() + _Size);231 return iterator(data() + _Size);
234# endif232# endif
235 }233 }
236 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT {234 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT {
237# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)235# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
238 return std::__make_static_bounded_iter<_Size>(data() + _Size, data());236 return std::__make_static_bounded_iter<_Size>(data() + _Size, data());
239# else237# else
...@@ -241,62 +239,81 @@ struct array {...@@ -241,62 +239,81 @@ struct array {
241# endif239# endif
242 }240 }
243241
244 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rbegin() _NOEXCEPT {242 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rbegin() _NOEXCEPT {
245 return reverse_iterator(end());243 return reverse_iterator(end());
246 }244 }
247 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator rbegin() const _NOEXCEPT {245 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator
246 rbegin() const _NOEXCEPT {
248 return const_reverse_iterator(end());247 return const_reverse_iterator(end());
249 }248 }
250 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rend() _NOEXCEPT {249 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rend() _NOEXCEPT {
251 return reverse_iterator(begin());250 return reverse_iterator(begin());
252 }251 }
253 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator rend() const _NOEXCEPT {252 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator rend() const _NOEXCEPT {
254 return const_reverse_iterator(begin());253 return const_reverse_iterator(begin());
255 }254 }
256255
257 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT { return begin(); }256 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT {
258 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT { return end(); }257 return begin();
259 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crbegin() const _NOEXCEPT {258 }
259 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT {
260 return end();
261 }
262 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator
263 crbegin() const _NOEXCEPT {
260 return rbegin();264 return rbegin();
261 }265 }
262 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT { return rend(); }266 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT {
267 return rend();
268 }
263269
264 // capacity:270 // capacity:
265 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return _Size; }271 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return _Size; }
266 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT { return _Size; }272 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT { return _Size; }
267 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return _Size == 0; }273 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return _Size == 0; }
268274
269 // element access:275 // element access:
270 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type __n) _NOEXCEPT {276 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type __n) _NOEXCEPT {
271 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");277 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");
272 return __elems_[__n];278 return __elems_[__n];
273 }279 }
274 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type __n) const _NOEXCEPT {280 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference
281 operator[](size_type __n) const _NOEXCEPT {
275 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");282 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");
276 return __elems_[__n];283 return __elems_[__n];
277 }284 }
278285
279 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n) {286 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n) {
280 if (__n >= _Size)287 if (__n >= _Size)
281 std::__throw_out_of_range("array::at");288 std::__throw_out_of_range("array::at");
282 return __elems_[__n];289 return __elems_[__n];
283 }290 }
284291
285 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const {292 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const {
286 if (__n >= _Size)293 if (__n >= _Size)
287 std::__throw_out_of_range("array::at");294 std::__throw_out_of_range("array::at");
288 return __elems_[__n];295 return __elems_[__n];
289 }296 }
290297
291 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT { return (*this)[0]; }298 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT {
292 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT { return (*this)[0]; }299 return (*this)[0];
293 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT { return (*this)[_Size - 1]; }300 }
294 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT {301 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT {
302 return (*this)[0];
303 }
304 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT {
305 return (*this)[_Size - 1];
306 }
307 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT {
295 return (*this)[_Size - 1];308 return (*this)[_Size - 1];
296 }309 }
297310
298 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 value_type* data() _NOEXCEPT { return __elems_; }311 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 value_type* data() _NOEXCEPT {
299 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const value_type* data() const _NOEXCEPT { return __elems_; }312 return __elems_;
313 }
314 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const value_type* data() const _NOEXCEPT {
315 return __elems_;
316 }
300};317};
301318
302template <class _Tp>319template <class _Tp>
...@@ -330,8 +347,10 @@ struct array<_Tp, 0> {...@@ -330,8 +347,10 @@ struct array<_Tp, 0> {
330 };347 };
331 _ALIGNAS_TYPE(_ArrayInStructT) _EmptyType __elems_[sizeof(_ArrayInStructT)];348 _ALIGNAS_TYPE(_ArrayInStructT) _EmptyType __elems_[sizeof(_ArrayInStructT)];
332349
333 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 value_type* data() _NOEXCEPT { return nullptr; }350 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 value_type* data() _NOEXCEPT { return nullptr; }
334 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const value_type* data() const _NOEXCEPT { return nullptr; }351 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const value_type* data() const _NOEXCEPT {
352 return nullptr;
353 }
335354
336 // No explicit construct/copy/destroy for aggregate type355 // No explicit construct/copy/destroy for aggregate type
337 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void fill(const value_type&) {356 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void fill(const value_type&) {
...@@ -343,28 +362,28 @@ struct array<_Tp, 0> {...@@ -343,28 +362,28 @@ struct array<_Tp, 0> {
343 }362 }
344363
345 // iterators:364 // iterators:
346 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT {365 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT {
347# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)366# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
348 return std::__make_static_bounded_iter<0>(data(), data());367 return std::__make_static_bounded_iter<0>(data(), data());
349# else368# else
350 return iterator(data());369 return iterator(data());
351# endif370# endif
352 }371 }
353 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT {372 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT {
354# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)373# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
355 return std::__make_static_bounded_iter<0>(data(), data());374 return std::__make_static_bounded_iter<0>(data(), data());
356# else375# else
357 return const_iterator(data());376 return const_iterator(data());
358# endif377# endif
359 }378 }
360 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT {379 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT {
361# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)380# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
362 return std::__make_static_bounded_iter<0>(data(), data());381 return std::__make_static_bounded_iter<0>(data(), data());
363# else382# else
364 return iterator(data());383 return iterator(data());
365# endif384# endif
366 }385 }
367 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT {386 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT {
368# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)387# if defined(_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY)
369 return std::__make_static_bounded_iter<0>(data(), data());388 return std::__make_static_bounded_iter<0>(data(), data());
370# else389# else
...@@ -372,68 +391,77 @@ struct array<_Tp, 0> {...@@ -372,68 +391,77 @@ struct array<_Tp, 0> {
372# endif391# endif
373 }392 }
374393
375 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rbegin() _NOEXCEPT {394 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rbegin() _NOEXCEPT {
376 return reverse_iterator(end());395 return reverse_iterator(end());
377 }396 }
378 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator rbegin() const _NOEXCEPT {397 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator
398 rbegin() const _NOEXCEPT {
379 return const_reverse_iterator(end());399 return const_reverse_iterator(end());
380 }400 }
381 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rend() _NOEXCEPT {401 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator rend() _NOEXCEPT {
382 return reverse_iterator(begin());402 return reverse_iterator(begin());
383 }403 }
384 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator rend() const _NOEXCEPT {404 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator rend() const _NOEXCEPT {
385 return const_reverse_iterator(begin());405 return const_reverse_iterator(begin());
386 }406 }
387407
388 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT { return begin(); }408 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT {
389 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT { return end(); }409 return begin();
390 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crbegin() const _NOEXCEPT {410 }
411 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT {
412 return end();
413 }
414 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator
415 crbegin() const _NOEXCEPT {
391 return rbegin();416 return rbegin();
392 }417 }
393 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT { return rend(); }418 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT {
419 return rend();
420 }
394421
395 // capacity:422 // capacity:
396 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return 0; }423 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return 0; }
397 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT { return 0; }424 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT { return 0; }
398 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return true; }425 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return true; }
399426
400 // element access:427 // element access:
401 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type) _NOEXCEPT {428 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type) _NOEXCEPT {
402 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");429 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
403 __libcpp_unreachable();430 __libcpp_unreachable();
404 }431 }
405432
406 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type) const _NOEXCEPT {433 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference
434 operator[](size_type) const _NOEXCEPT {
407 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");435 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
408 __libcpp_unreachable();436 __libcpp_unreachable();
409 }437 }
410438
411 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type) {439 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type) {
412 std::__throw_out_of_range("array<T, 0>::at");440 std::__throw_out_of_range("array<T, 0>::at");
413 __libcpp_unreachable();441 __libcpp_unreachable();
414 }442 }
415443
416 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type) const {444 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type) const {
417 std::__throw_out_of_range("array<T, 0>::at");445 std::__throw_out_of_range("array<T, 0>::at");
418 __libcpp_unreachable();446 __libcpp_unreachable();
419 }447 }
420448
421 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT {449 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT {
422 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");450 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");
423 __libcpp_unreachable();451 __libcpp_unreachable();
424 }452 }
425453
426 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT {454 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT {
427 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");455 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");
428 __libcpp_unreachable();456 __libcpp_unreachable();
429 }457 }
430458
431 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT {459 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT {
432 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");460 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");
433 __libcpp_unreachable();461 __libcpp_unreachable();
434 }462 }
435463
436 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT {464 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT {
437 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");465 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");
438 __libcpp_unreachable();466 __libcpp_unreachable();
439 }467 }
...@@ -503,25 +531,29 @@ struct tuple_element<_Ip, array<_Tp, _Size> > {...@@ -503,25 +531,29 @@ struct tuple_element<_Ip, array<_Tp, _Size> > {
503};531};
504532
505template <size_t _Ip, class _Tp, size_t _Size>533template <size_t _Ip, class _Tp, size_t _Size>
506inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp& get(array<_Tp, _Size>& __a) _NOEXCEPT {534[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp&
535get(array<_Tp, _Size>& __a) _NOEXCEPT {
507 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)");536 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)");
508 return __a.__elems_[_Ip];537 return __a.__elems_[_Ip];
509}538}
510539
511template <size_t _Ip, class _Tp, size_t _Size>540template <size_t _Ip, class _Tp, size_t _Size>
512inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& get(const array<_Tp, _Size>& __a) _NOEXCEPT {541[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&
542get(const array<_Tp, _Size>& __a) _NOEXCEPT {
513 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)");543 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)");
514 return __a.__elems_[_Ip];544 return __a.__elems_[_Ip];
515}545}
516546
517template <size_t _Ip, class _Tp, size_t _Size>547template <size_t _Ip, class _Tp, size_t _Size>
518inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp&& get(array<_Tp, _Size>&& __a) _NOEXCEPT {548[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp&&
549get(array<_Tp, _Size>&& __a) _NOEXCEPT {
519 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)");550 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)");
520 return std::move(__a.__elems_[_Ip]);551 return std::move(__a.__elems_[_Ip]);
521}552}
522553
523template <size_t _Ip, class _Tp, size_t _Size>554template <size_t _Ip, class _Tp, size_t _Size>
524inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&& get(const array<_Tp, _Size>&& __a) _NOEXCEPT {555[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&&
556get(const array<_Tp, _Size>&& __a) _NOEXCEPT {
525 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array &&)");557 static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array &&)");
526 return std::move(__a.__elems_[_Ip]);558 return std::move(__a.__elems_[_Ip]);
527}559}
...@@ -541,7 +573,7 @@ __to_array_rvalue_impl(_Tp (&&__arr)[_Size], index_sequence<_Index...>) {...@@ -541,7 +573,7 @@ __to_array_rvalue_impl(_Tp (&&__arr)[_Size], index_sequence<_Index...>) {
541}573}
542574
543template <typename _Tp, size_t _Size>575template <typename _Tp, size_t _Size>
544_LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>576[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>
545to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {577to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
546 static_assert(!is_array_v<_Tp>, "[array.creation]/1: to_array does not accept multidimensional arrays.");578 static_assert(!is_array_v<_Tp>, "[array.creation]/1: to_array does not accept multidimensional arrays.");
547 static_assert(is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements.");579 static_assert(is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements.");
...@@ -549,7 +581,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {...@@ -549,7 +581,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
549}581}
550582
551template <typename _Tp, size_t _Size>583template <typename _Tp, size_t _Size>
552_LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>584[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>
553to_array(_Tp (&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {585to_array(_Tp (&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
554 static_assert(!is_array_v<_Tp>, "[array.creation]/4: to_array does not accept multidimensional arrays.");586 static_assert(!is_array_v<_Tp>, "[array.creation]/4: to_array does not accept multidimensional arrays.");
555 static_assert(is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements.");587 static_assert(is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements.");
lib/libcxx/include/atomic+2
...@@ -608,6 +608,8 @@ template <class T>...@@ -608,6 +608,8 @@ template <class T>
608# include <__atomic/atomic_init.h>608# include <__atomic/atomic_init.h>
609# include <__atomic/atomic_lock_free.h>609# include <__atomic/atomic_lock_free.h>
610# include <__atomic/atomic_sync.h>610# include <__atomic/atomic_sync.h>
611# include <__atomic/atomic_sync_timed.h>
612# include <__atomic/atomic_waitable_traits.h>
611# include <__atomic/check_memory_order.h>613# include <__atomic/check_memory_order.h>
612# include <__atomic/contention_t.h>614# include <__atomic/contention_t.h>
613# include <__atomic/fence.h>615# include <__atomic/fence.h>
lib/libcxx/include/barrier+20-24
...@@ -57,8 +57,6 @@ namespace std...@@ -57,8 +57,6 @@ namespace std
57# include <__atomic/memory_order.h>57# include <__atomic/memory_order.h>
58# include <__cstddef/ptrdiff_t.h>58# include <__cstddef/ptrdiff_t.h>
59# include <__memory/unique_ptr.h>59# include <__memory/unique_ptr.h>
60# include <__thread/poll_with_backoff.h>
61# include <__thread/timed_backoff_policy.h>
62# include <__utility/move.h>60# include <__utility/move.h>
63# include <cstdint>61# include <cstdint>
64# include <limits>62# include <limits>
...@@ -97,19 +95,20 @@ using __barrier_phase_t _LIBCPP_NODEBUG = uint8_t;...@@ -97,19 +95,20 @@ using __barrier_phase_t _LIBCPP_NODEBUG = uint8_t;
9795
98class __barrier_algorithm_base;96class __barrier_algorithm_base;
9997
100_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base*98[[__gnu__::__returns_nonnull__, __gnu__::__malloc__]]
101__construct_barrier_algorithm_base(ptrdiff_t& __expected);99_LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorithm_base(ptrdiff_t& __expected);
102100
103_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI bool101_LIBCPP_EXPORTED_FROM_ABI bool
104__arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase) noexcept;102__arrive_barrier_algorithm_base([[__gnu__::__nonnull__]] _LIBCPP_NOESCAPE __barrier_algorithm_base* __barrier,
103 __barrier_phase_t __old_phase) noexcept;
105104
106_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void105_LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(
107__destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier) noexcept;106 [[__gnu__::__nonnull__]] _LIBCPP_NOESCAPE __barrier_algorithm_base* __barrier) noexcept;
108107
109template <class _CompletionF>108template <class _CompletionF>
110class __barrier_base {109class __barrier_base {
111 ptrdiff_t __expected_;110 ptrdiff_t __expected_;
112 unique_ptr<__barrier_algorithm_base, void (*)(__barrier_algorithm_base*)> __base_;111 unique_ptr<__barrier_algorithm_base, void (*)(_LIBCPP_NOESCAPE __barrier_algorithm_base*)> __base_;
113 atomic<ptrdiff_t> __expected_adjustment_;112 atomic<ptrdiff_t> __expected_adjustment_;
114 _CompletionF __completion_;113 _CompletionF __completion_;
115 atomic<__barrier_phase_t> __phase_;114 atomic<__barrier_phase_t> __phase_;
...@@ -119,14 +118,13 @@ public:...@@ -119,14 +118,13 @@ public:
119118
120 static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return numeric_limits<ptrdiff_t>::max(); }119 static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return numeric_limits<ptrdiff_t>::max(); }
121120
122 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI121 _LIBCPP_HIDE_FROM_ABI __barrier_base(ptrdiff_t __expected, _CompletionF __completion = _CompletionF())
123 __barrier_base(ptrdiff_t __expected, _CompletionF __completion = _CompletionF())
124 : __expected_(__expected),122 : __expected_(__expected),
125 __base_(std::__construct_barrier_algorithm_base(this->__expected_), &__destroy_barrier_algorithm_base),123 __base_(std::__construct_barrier_algorithm_base(this->__expected_), &__destroy_barrier_algorithm_base),
126 __expected_adjustment_(0),124 __expected_adjustment_(0),
127 __completion_(std::move(__completion)),125 __completion_(std::move(__completion)),
128 __phase_(0) {}126 __phase_(0) {}
129 [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update) {127 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update) {
130 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(128 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
131 __update <= __expected_, "update is greater than the expected count for the current barrier phase");129 __update <= __expected_, "update is greater than the expected count for the current barrier phase");
132130
...@@ -141,11 +139,10 @@ public:...@@ -141,11 +139,10 @@ public:
141 }139 }
142 return __old_phase;140 return __old_phase;
143 }141 }
144 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(arrival_token&& __old_phase) const {142 _LIBCPP_HIDE_FROM_ABI void wait(arrival_token&& __old_phase) const {
145 auto const __test_fn = [this, __old_phase]() -> bool { return __phase_.load(memory_order_acquire) != __old_phase; };143 __phase_.wait(__old_phase, std::memory_order_acquire);
146 std::__libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy());
147 }144 }
148 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void arrive_and_drop() {145 _LIBCPP_HIDE_FROM_ABI void arrive_and_drop() {
149 __expected_adjustment_.fetch_sub(1, memory_order_relaxed);146 __expected_adjustment_.fetch_sub(1, memory_order_relaxed);
150 (void)arrive(1);147 (void)arrive(1);
151 }148 }
...@@ -158,9 +155,10 @@ class barrier {...@@ -158,9 +155,10 @@ class barrier {
158public:155public:
159 using arrival_token = typename __barrier_base<_CompletionF>::arrival_token;156 using arrival_token = typename __barrier_base<_CompletionF>::arrival_token;
160157
161 static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return __barrier_base<_CompletionF>::max(); }158 [[nodiscard]] static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept {
159 return __barrier_base<_CompletionF>::max();
160 }
162161
163 _LIBCPP_AVAILABILITY_SYNC
164 _LIBCPP_HIDE_FROM_ABI explicit barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())162 _LIBCPP_HIDE_FROM_ABI explicit barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
165 : __b_(__count, std::move(__completion)) {163 : __b_(__count, std::move(__completion)) {
166 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(164 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
...@@ -175,15 +173,13 @@ public:...@@ -175,15 +173,13 @@ public:
175 barrier(barrier const&) = delete;173 barrier(barrier const&) = delete;
176 barrier& operator=(barrier const&) = delete;174 barrier& operator=(barrier const&) = delete;
177175
178 [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update = 1) {176 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update = 1) {
179 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update > 0, "barrier:arrive must be called with a value greater than 0");177 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update > 0, "barrier:arrive must be called with a value greater than 0");
180 return __b_.arrive(__update);178 return __b_.arrive(__update);
181 }179 }
182 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(arrival_token&& __phase) const {180 _LIBCPP_HIDE_FROM_ABI void wait(arrival_token&& __phase) const { __b_.wait(std::move(__phase)); }
183 __b_.wait(std::move(__phase));181 _LIBCPP_HIDE_FROM_ABI void arrive_and_wait() { wait(arrive()); }
184 }182 _LIBCPP_HIDE_FROM_ABI void arrive_and_drop() { __b_.arrive_and_drop(); }
185 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void arrive_and_wait() { wait(arrive()); }
186 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void arrive_and_drop() { __b_.arrive_and_drop(); }
187};183};
188184
189_LIBCPP_END_NAMESPACE_STD185_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/bitset+49-30
...@@ -147,7 +147,6 @@ template <size_t N> struct hash<std::bitset<N>>;...@@ -147,7 +147,6 @@ template <size_t N> struct hash<std::bitset<N>>;
147# include <__functional/hash.h>147# include <__functional/hash.h>
148# include <__functional/identity.h>148# include <__functional/identity.h>
149# include <__functional/unary_function.h>149# include <__functional/unary_function.h>
150# include <__tuple/tuple_indices.h>
151# include <__type_traits/enable_if.h>150# include <__type_traits/enable_if.h>
152# include <__type_traits/integral_constant.h>151# include <__type_traits/integral_constant.h>
153# include <__type_traits/is_char_like_type.h>152# include <__type_traits/is_char_like_type.h>
...@@ -314,7 +313,7 @@ private:...@@ -314,7 +313,7 @@ private:
314 _LIBCPP_HIDE_FROM_ABI void __init(unsigned long long __v, true_type) _NOEXCEPT;313 _LIBCPP_HIDE_FROM_ABI void __init(unsigned long long __v, true_type) _NOEXCEPT;
315# else314# else
316 template <size_t... _Indices>315 template <size_t... _Indices>
317 _LIBCPP_HIDE_FROM_ABI constexpr __bitset(unsigned long long __v, std::__tuple_indices<_Indices...>) _NOEXCEPT316 _LIBCPP_HIDE_FROM_ABI constexpr __bitset(unsigned long long __v, __index_sequence<_Indices...>) _NOEXCEPT
318 : __first_{static_cast<__storage_type>(__v >> (_Indices * __bits_per_word))...} {}317 : __first_{static_cast<__storage_type>(__v >> (_Indices * __bits_per_word))...} {}
319# endif // _LIBCPP_CXX03_LANG318# endif // _LIBCPP_CXX03_LANG
320};319};
...@@ -352,10 +351,9 @@ template <size_t _N_words, size_t _Size>...@@ -352,10 +351,9 @@ template <size_t _N_words, size_t _Size>
352inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT351inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
353# ifndef _LIBCPP_CXX03_LANG352# ifndef _LIBCPP_CXX03_LANG
354 : __bitset(__v,353 : __bitset(__v,
355 std::__make_indices_imp< (_N_words < (sizeof(unsigned long long) - 1) / sizeof(__storage_type) + 1)354 __make_index_sequence<(_N_words < (sizeof(unsigned long long) - 1) / sizeof(__storage_type) + 1)
356 ? _N_words355 ? _N_words
357 : (sizeof(unsigned long long) - 1) / sizeof(__storage_type) + 1,356 : (sizeof(unsigned long long) - 1) / sizeof(__storage_type) + 1>())
358 0>{})
359# endif357# endif
360{358{
361# ifdef _LIBCPP_CXX03_LANG359# ifdef _LIBCPP_CXX03_LANG
...@@ -677,53 +675,63 @@ public:...@@ -677,53 +675,63 @@ public:
677 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& set(size_t __pos, bool __val = true);675 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& set(size_t __pos, bool __val = true);
678 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset() _NOEXCEPT;676 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset() _NOEXCEPT;
679 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset(size_t __pos);677 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset(size_t __pos);
680 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator~() const _NOEXCEPT;678 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator~() const _NOEXCEPT;
681 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip() _NOEXCEPT;679 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip() _NOEXCEPT;
682 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip(size_t __pos);680 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip(size_t __pos);
683681
684 // element access:682 // element access:
685# ifdef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL683 // TODO(LLVM 24): Remove the opt-out
686 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator[](size_t __p) const {684# ifndef _LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF
685 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator[](size_t __p) const {
687 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");686 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");
688 return __base::__make_ref(__p);687 return __base::__make_ref(__p);
689 }688 }
690# else689# else
691 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __const_reference operator[](size_t __p) const {690 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __const_reference operator[](size_t __p) const {
692 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");691 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");
693 return __base::__make_ref(__p);692 return __base::__make_ref(__p);
694 }693 }
695# endif694# endif
696 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator[](size_t __p) {695 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator[](size_t __p) {
697 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");696 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");
698 return __base::__make_ref(__p);697 return __base::__make_ref(__p);
699 }698 }
700 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const { return __base::to_ulong(); }699 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const {
701 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const {700 return __base::to_ulong();
701 }
702 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const {
702 return __base::to_ullong();703 return __base::to_ullong();
703 }704 }
704 template <class _CharT, class _Traits, class _Allocator>705 template <class _CharT, class _Traits, class _Allocator>
705 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, _Allocator>706 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, _Allocator>
706 to_string(_CharT __zero = _CharT('0'), _CharT __one = _CharT('1')) const;707 to_string(_CharT __zero = _CharT('0'), _CharT __one = _CharT('1')) const;
707 template <class _CharT, class _Traits>708 template <class _CharT, class _Traits>
708 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, allocator<_CharT> >709 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
710 _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, allocator<_CharT> >
709 to_string(_CharT __zero = _CharT('0'), _CharT __one = _CharT('1')) const;711 to_string(_CharT __zero = _CharT('0'), _CharT __one = _CharT('1')) const;
710 template <class _CharT>712 template <class _CharT>
711 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> >713 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
714 _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> >
712 to_string(_CharT __zero = _CharT('0'), _CharT __one = _CharT('1')) const;715 to_string(_CharT __zero = _CharT('0'), _CharT __one = _CharT('1')) const;
713 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<char, char_traits<char>, allocator<char> >716 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
717 _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<char, char_traits<char>, allocator<char> >
714 to_string(char __zero = '0', char __one = '1') const;718 to_string(char __zero = '0', char __one = '1') const;
715 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t count() const _NOEXCEPT;719 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t count() const _NOEXCEPT;
716 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT { return _Size; }720 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT { return _Size; }
717 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const bitset& __rhs) const _NOEXCEPT;721 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const bitset& __rhs) const _NOEXCEPT;
718# if _LIBCPP_STD_VER <= 17722# if _LIBCPP_STD_VER <= 17
719 _LIBCPP_HIDE_FROM_ABI bool operator!=(const bitset& __rhs) const _NOEXCEPT;723 _LIBCPP_HIDE_FROM_ABI bool operator!=(const bitset& __rhs) const _NOEXCEPT;
720# endif724# endif
721 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool test(size_t __pos) const;725 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool test(size_t __pos) const;
722 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT { return __base::all(); }726 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT {
723 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT { return __base::any(); }727 return __base::all();
724 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none() const _NOEXCEPT { return !any(); }728 }
725 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator<<(size_t __pos) const _NOEXCEPT;729 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT {
726 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator>>(size_t __pos) const _NOEXCEPT;730 return __base::any();
731 }
732 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none() const _NOEXCEPT { return !any(); }
733 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator<<(size_t __pos) const _NOEXCEPT;
734 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator>>(size_t __pos) const _NOEXCEPT;
727735
728private:736private:
729 template <class _CharT, class _Traits>737 template <class _CharT, class _Traits>
...@@ -869,7 +877,16 @@ bitset<_Size>::to_string(char __zero, char __one) const {...@@ -869,7 +877,16 @@ bitset<_Size>::to_string(char __zero, char __one) const {
869877
870template <size_t _Size>878template <size_t _Size>
871inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t bitset<_Size>::count() const _NOEXCEPT {879inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t bitset<_Size>::count() const _NOEXCEPT {
872 return static_cast<size_t>(std::count(__base::__make_iter(0), __base::__make_iter(_Size), true));880# if defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(_LIBCPP_CXX03_LANG)
881 if constexpr (_Size == 0) {
882 return 0;
883 } else if constexpr (_Size <= __base::__bits_per_word) {
884 return __builtin_popcountg(static_cast<unsigned _BitInt(_Size)>(__base::__first_));
885 } else
886# endif
887 {
888 return static_cast<size_t>(std::count(__base::__make_iter(0), __base::__make_iter(_Size), true));
889 }
873}890}
874891
875template <size_t _Size>892template <size_t _Size>
...@@ -912,7 +929,7 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT {...@@ -912,7 +929,7 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT {
912}929}
913930
914template <size_t _Size>931template <size_t _Size>
915inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>932[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
916operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {933operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
917 bitset<_Size> __r = __x;934 bitset<_Size> __r = __x;
918 __r &= __y;935 __r &= __y;
...@@ -920,7 +937,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {...@@ -920,7 +937,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
920}937}
921938
922template <size_t _Size>939template <size_t _Size>
923inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>940[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
924operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {941operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
925 bitset<_Size> __r = __x;942 bitset<_Size> __r = __x;
926 __r |= __y;943 __r |= __y;
...@@ -928,7 +945,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {...@@ -928,7 +945,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
928}945}
929946
930template <size_t _Size>947template <size_t _Size>
931inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>948[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
932operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {949operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
933 bitset<_Size> __r = __x;950 bitset<_Size> __r = __x;
934 __r ^= __y;951 __r ^= __y;
...@@ -937,7 +954,9 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {...@@ -937,7 +954,9 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
937954
938template <size_t _Size>955template <size_t _Size>
939struct hash<bitset<_Size> > : public __unary_function<bitset<_Size>, size_t> {956struct hash<bitset<_Size> > : public __unary_function<bitset<_Size>, size_t> {
940 _LIBCPP_HIDE_FROM_ABI size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT { return __bs.__hash_code(); }957 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT {
958 return __bs.__hash_code();
959 }
941};960};
942961
943template <class _CharT, class _Traits, size_t _Size>962template <class _CharT, class _Traits, size_t _Size>
lib/libcxx/include/ccomplex+3-11
...@@ -26,18 +26,10 @@...@@ -26,18 +26,10 @@
26# pragma GCC system_header26# pragma GCC system_header
27# endif27# endif
2828
29# if _LIBCPP_STD_VER >= 2029# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
3030# warning <ccomplex> is deprecated in C++17 and removed in C++20. Include <complex> instead.
31using __standard_header_ccomplex
32 _LIBCPP_DEPRECATED_("removed in C++20. Include <complex> instead.") _LIBCPP_NODEBUG = void;
33using __use_standard_header_ccomplex _LIBCPP_NODEBUG = __standard_header_ccomplex;
34
35# elif _LIBCPP_STD_VER >= 17
36
37using __standard_header_ccomplex _LIBCPP_DEPRECATED_("Include <complex> instead.") _LIBCPP_NODEBUG = void;
38using __use_standard_header_ccomplex _LIBCPP_NODEBUG = __standard_header_ccomplex;
39
40# endif31# endif
32
41#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)33#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
4234
43#endif // _LIBCPP_CCOMPLEX35#endif // _LIBCPP_CCOMPLEX
lib/libcxx/include/chrono+47
...@@ -218,6 +218,9 @@ template <class ToDuration, class Rep, class Period>...@@ -218,6 +218,9 @@ template <class ToDuration, class Rep, class Period>
218template <class ToDuration, class Rep, class Period>218template <class ToDuration, class Rep, class Period>
219 constexpr ToDuration round(const duration<Rep, Period>& d); // C++17219 constexpr ToDuration round(const duration<Rep, Period>& d); // C++17
220220
221template <class T> struct is_clock; // C++20
222template <class T> inline constexpr bool is_clock_v = is_clock<T>::value; // C++20
223
221// duration I/O224// duration I/O
222template<class charT, class traits, class Rep, class Period> // C++20225template<class charT, class traits, class Rep, class Period> // C++20
223 basic_ostream<charT, traits>&226 basic_ostream<charT, traits>&
...@@ -1035,6 +1038,49 @@ constexpr chrono::year operator ""y(unsigned lo...@@ -1035,6 +1038,49 @@ constexpr chrono::year operator ""y(unsigned lo
1035} // chrono_literals1038} // chrono_literals
1036} // literals1039} // literals
10371040
1041namespace std {
1042 template<class T>
1043 struct hash; // C++26
1044 template<class Rep, class Period>
1045 struct hash<chrono::duration<Rep, Period>>; // C++26
1046 template<class Clock, class Duration>
1047 struct hash<chrono::time_point<Clock, Duration>>; // C++26
1048 template<>
1049 struct hash<chrono::day>; // C++26
1050 template<>
1051 struct hash<chrono::month>; // C++26
1052 template<>
1053 struct hash<chrono::year>; // C++26
1054 template<>
1055 struct hash<chrono::weekday>; // C++26
1056 template<>
1057 struct hash<chrono::weekday_indexed>; // C++26
1058 template<>
1059 struct hash<chrono::weekday_last>; // C++26
1060 template<>
1061 struct hash<chrono::month_day>; // C++26
1062 template<>
1063 struct hash<chrono::month_day_last>; // C++26
1064 template<>
1065 struct hash<chrono::month_weekday>; // C++26
1066 template<>
1067 struct hash<chrono::month_weekday_last>; // C++26
1068 template<>
1069 struct hash<chrono::year_month>; // C++26
1070 template<>
1071 struct hash<chrono::year_month_day>; // C++26
1072 template<>
1073 struct hash<chrono::year_month_day_last>; // C++26
1074 template<>
1075 struct hash<chrono::year_month_weekday>; // C++26
1076 template<>
1077 struct hash<chrono::year_month_weekday_last>; // C++26
1078 template<class Duration, class TimeZonePtr>
1079 struct hash<chrono::zoned_time<Duration, TimeZonePtr>>; // C++26
1080 template<>
1081 struct hash<chrono::leap_second>; // C++26
1082} // namespace std
1083
1038} // std1084} // std
1039*/1085*/
10401086
...@@ -1057,6 +1103,7 @@ constexpr chrono::year operator ""y(unsigned lo...@@ -1057,6 +1103,7 @@ constexpr chrono::year operator ""y(unsigned lo
1057# include <__chrono/day.h>1103# include <__chrono/day.h>
1058# include <__chrono/exception.h>1104# include <__chrono/exception.h>
1059# include <__chrono/hh_mm_ss.h>1105# include <__chrono/hh_mm_ss.h>
1106# include <__chrono/is_clock.h>
1060# include <__chrono/literals.h>1107# include <__chrono/literals.h>
1061# include <__chrono/local_info.h>1108# include <__chrono/local_info.h>
1062# include <__chrono/month.h>1109# include <__chrono/month.h>
lib/libcxx/include/ciso646+3-6
...@@ -24,13 +24,10 @@...@@ -24,13 +24,10 @@
24# pragma GCC system_header24# pragma GCC system_header
25# endif25# endif
2626
27# if _LIBCPP_STD_VER >= 2027# if _LIBCPP_STD_VER >= 20 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
2828# warning <ciso646> is removed in C++20. Include <version> instead.
29using __standard_header_ciso646
30 _LIBCPP_DEPRECATED_("removed in C++20. Include <version> instead.") _LIBCPP_NODEBUG = void;
31using __use_standard_header_ciso646 _LIBCPP_NODEBUG = __standard_header_ciso646;
32
33# endif29# endif
30
34#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)31#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
3532
36#endif // _LIBCPP_CISO64633#endif // _LIBCPP_CISO646
lib/libcxx/include/complex+77-65
...@@ -319,8 +319,8 @@ public:...@@ -319,8 +319,8 @@ public:
319 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 complex(const complex<_Xp>& __c)319 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 complex(const complex<_Xp>& __c)
320 : __re_(__c.real()), __im_(__c.imag()) {}320 : __re_(__c.real()), __im_(__c.imag()) {}
321321
322 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 value_type real() const { return __re_; }322 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 value_type real() const { return __re_; }
323 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 value_type imag() const { return __im_; }323 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 value_type imag() const { return __im_; }
324324
325 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }325 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }
326 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }326 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }
...@@ -432,8 +432,8 @@ public:...@@ -432,8 +432,8 @@ public:
432 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);432 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
433 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);433 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
434434
435 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float real() const { return __re_; }435 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float real() const { return __re_; }
436 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float imag() const { return __im_; }436 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float imag() const { return __im_; }
437437
438 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }438 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }
439 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }439 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }
...@@ -529,8 +529,8 @@ public:...@@ -529,8 +529,8 @@ public:
529 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<float>& __c);529 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
530 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);530 _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
531531
532 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double real() const { return __re_; }532 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double real() const { return __re_; }
533 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double imag() const { return __im_; }533 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double imag() const { return __im_; }
534534
535 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }535 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }
536 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }536 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }
...@@ -630,8 +630,8 @@ public:...@@ -630,8 +630,8 @@ public:
630 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<float>& __c);630 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
631 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<double>& __c);631 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
632632
633 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double real() const { return __re_; }633 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double real() const { return __re_; }
634 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double imag() const { return __im_; }634 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double imag() const { return __im_; }
635635
636 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }636 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; }
637 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }637 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; }
...@@ -732,7 +732,7 @@ inline _LIBCPP_CONSTEXPR complex<long double>::complex(const complex<double>& __...@@ -732,7 +732,7 @@ inline _LIBCPP_CONSTEXPR complex<long double>::complex(const complex<double>& __
732// 26.3.6 operators:732// 26.3.6 operators:
733733
734template <class _Tp>734template <class _Tp>
735inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>735[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
736operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) {736operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) {
737 complex<_Tp> __t(__x);737 complex<_Tp> __t(__x);
738 __t += __y;738 __t += __y;
...@@ -740,7 +740,7 @@ operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) {...@@ -740,7 +740,7 @@ operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) {
740}740}
741741
742template <class _Tp>742template <class _Tp>
743inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>743[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
744operator+(const complex<_Tp>& __x, const _Tp& __y) {744operator+(const complex<_Tp>& __x, const _Tp& __y) {
745 complex<_Tp> __t(__x);745 complex<_Tp> __t(__x);
746 __t += __y;746 __t += __y;
...@@ -748,7 +748,7 @@ operator+(const complex<_Tp>& __x, const _Tp& __y) {...@@ -748,7 +748,7 @@ operator+(const complex<_Tp>& __x, const _Tp& __y) {
748}748}
749749
750template <class _Tp>750template <class _Tp>
751inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>751[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
752operator+(const _Tp& __x, const complex<_Tp>& __y) {752operator+(const _Tp& __x, const complex<_Tp>& __y) {
753 complex<_Tp> __t(__y);753 complex<_Tp> __t(__y);
754 __t += __x;754 __t += __x;
...@@ -756,7 +756,7 @@ operator+(const _Tp& __x, const complex<_Tp>& __y) {...@@ -756,7 +756,7 @@ operator+(const _Tp& __x, const complex<_Tp>& __y) {
756}756}
757757
758template <class _Tp>758template <class _Tp>
759inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>759[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
760operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) {760operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) {
761 complex<_Tp> __t(__x);761 complex<_Tp> __t(__x);
762 __t -= __y;762 __t -= __y;
...@@ -764,7 +764,7 @@ operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) {...@@ -764,7 +764,7 @@ operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) {
764}764}
765765
766template <class _Tp>766template <class _Tp>
767inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>767[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
768operator-(const complex<_Tp>& __x, const _Tp& __y) {768operator-(const complex<_Tp>& __x, const _Tp& __y) {
769 complex<_Tp> __t(__x);769 complex<_Tp> __t(__x);
770 __t -= __y;770 __t -= __y;
...@@ -772,7 +772,7 @@ operator-(const complex<_Tp>& __x, const _Tp& __y) {...@@ -772,7 +772,7 @@ operator-(const complex<_Tp>& __x, const _Tp& __y) {
772}772}
773773
774template <class _Tp>774template <class _Tp>
775inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>775[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
776operator-(const _Tp& __x, const complex<_Tp>& __y) {776operator-(const _Tp& __x, const complex<_Tp>& __y) {
777 complex<_Tp> __t(-__y);777 complex<_Tp> __t(-__y);
778 __t += __x;778 __t += __x;
...@@ -780,13 +780,13 @@ operator-(const _Tp& __x, const complex<_Tp>& __y) {...@@ -780,13 +780,13 @@ operator-(const _Tp& __x, const complex<_Tp>& __y) {
780}780}
781781
782template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> >782template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> >
783_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>783[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
784operator*(const complex<_Tp>& __lhs, const complex<_Tp>& __rhs) {784operator*(const complex<_Tp>& __lhs, const complex<_Tp>& __rhs) {
785 return complex<_Tp>(__from_builtin_tag(), __lhs.__builtin() * __rhs.__builtin());785 return complex<_Tp>(__from_builtin_tag(), __lhs.__builtin() * __rhs.__builtin());
786}786}
787787
788template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> >788template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> >
789_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>789[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
790operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) {790operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) {
791 _Tp __a = __z.real();791 _Tp __a = __z.real();
792 _Tp __b = __z.imag();792 _Tp __b = __z.imag();
...@@ -797,7 +797,7 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) {...@@ -797,7 +797,7 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) {
797}797}
798798
799template <class _Tp>799template <class _Tp>
800inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>800[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
801operator*(const complex<_Tp>& __x, const _Tp& __y) {801operator*(const complex<_Tp>& __x, const _Tp& __y) {
802 complex<_Tp> __t(__x);802 complex<_Tp> __t(__x);
803 __t *= __y;803 __t *= __y;
...@@ -805,7 +805,7 @@ operator*(const complex<_Tp>& __x, const _Tp& __y) {...@@ -805,7 +805,7 @@ operator*(const complex<_Tp>& __x, const _Tp& __y) {
805}805}
806806
807template <class _Tp>807template <class _Tp>
808inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>808[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
809operator*(const _Tp& __x, const complex<_Tp>& __y) {809operator*(const _Tp& __x, const complex<_Tp>& __y) {
810 complex<_Tp> __t(__y);810 complex<_Tp> __t(__y);
811 __t *= __x;811 __t *= __x;
...@@ -813,13 +813,13 @@ operator*(const _Tp& __x, const complex<_Tp>& __y) {...@@ -813,13 +813,13 @@ operator*(const _Tp& __x, const complex<_Tp>& __y) {
813}813}
814814
815template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> >815template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> >
816_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>816[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
817operator/(const complex<_Tp>& __lhs, const complex<_Tp>& __rhs) {817operator/(const complex<_Tp>& __lhs, const complex<_Tp>& __rhs) {
818 return complex<_Tp>(__from_builtin_tag(), __lhs.__builtin() / __rhs.__builtin());818 return complex<_Tp>(__from_builtin_tag(), __lhs.__builtin() / __rhs.__builtin());
819}819}
820820
821template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> >821template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> >
822_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>822[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
823operator/(const complex<_Tp>& __z, const complex<_Tp>& __w) {823operator/(const complex<_Tp>& __z, const complex<_Tp>& __w) {
824 _Tp __a = __z.real();824 _Tp __a = __z.real();
825 _Tp __b = __z.imag();825 _Tp __b = __z.imag();
...@@ -831,13 +831,13 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w) {...@@ -831,13 +831,13 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w) {
831}831}
832832
833template <class _Tp>833template <class _Tp>
834inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>834[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
835operator/(const complex<_Tp>& __x, const _Tp& __y) {835operator/(const complex<_Tp>& __x, const _Tp& __y) {
836 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);836 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
837}837}
838838
839template <class _Tp>839template <class _Tp>
840inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>840[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
841operator/(const _Tp& __x, const complex<_Tp>& __y) {841operator/(const _Tp& __x, const complex<_Tp>& __y) {
842 complex<_Tp> __t(__x);842 complex<_Tp> __t(__x);
843 __t /= __y;843 __t /= __y;
...@@ -845,12 +845,14 @@ operator/(const _Tp& __x, const complex<_Tp>& __y) {...@@ -845,12 +845,14 @@ operator/(const _Tp& __x, const complex<_Tp>& __y) {
845}845}
846846
847template <class _Tp>847template <class _Tp>
848inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator+(const complex<_Tp>& __x) {848[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
849operator+(const complex<_Tp>& __x) {
849 return __x;850 return __x;
850}851}
851852
852template <class _Tp>853template <class _Tp>
853inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator-(const complex<_Tp>& __x) {854[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
855operator-(const complex<_Tp>& __x) {
854 return complex<_Tp>(-__x.real(), -__x.imag());856 return complex<_Tp>(-__x.real(), -__x.imag());
855}857}
856858
...@@ -912,12 +914,13 @@ struct __libcpp_complex_overload_traits<_Tp, false, true> {...@@ -912,12 +914,13 @@ struct __libcpp_complex_overload_traits<_Tp, false, true> {
912// real914// real
913915
914template <class _Tp>916template <class _Tp>
915inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp real(const complex<_Tp>& __c) {917[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp real(const complex<_Tp>& __c) {
916 return __c.real();918 return __c.real();
917}919}
918920
919template <class _Tp>921template <class _Tp>
920inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename __libcpp_complex_overload_traits<_Tp>::_ValueType922[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
923typename __libcpp_complex_overload_traits<_Tp>::_ValueType
921real(_Tp __re) {924real(_Tp __re) {
922 return __re;925 return __re;
923}926}
...@@ -925,12 +928,13 @@ real(_Tp __re) {...@@ -925,12 +928,13 @@ real(_Tp __re) {
925// imag928// imag
926929
927template <class _Tp>930template <class _Tp>
928inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp imag(const complex<_Tp>& __c) {931[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp imag(const complex<_Tp>& __c) {
929 return __c.imag();932 return __c.imag();
930}933}
931934
932template <class _Tp>935template <class _Tp>
933inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename __libcpp_complex_overload_traits<_Tp>::_ValueType936[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
937typename __libcpp_complex_overload_traits<_Tp>::_ValueType
934imag(_Tp) {938imag(_Tp) {
935 return 0;939 return 0;
936}940}
...@@ -938,36 +942,36 @@ imag(_Tp) {...@@ -938,36 +942,36 @@ imag(_Tp) {
938// abs942// abs
939943
940template <class _Tp>944template <class _Tp>
941inline _LIBCPP_HIDE_FROM_ABI _Tp abs(const complex<_Tp>& __c) {945[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _Tp abs(const complex<_Tp>& __c) {
942 return std::hypot(__c.real(), __c.imag());946 return std::hypot(__c.real(), __c.imag());
943}947}
944948
945// arg949// arg
946950
947template <class _Tp>951template <class _Tp>
948inline _LIBCPP_HIDE_FROM_ABI _Tp arg(const complex<_Tp>& __c) {952[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _Tp arg(const complex<_Tp>& __c) {
949 return std::atan2(__c.imag(), __c.real());953 return std::atan2(__c.imag(), __c.real());
950}954}
951955
952template <class _Tp, __enable_if_t<is_same<_Tp, long double>::value, int> = 0>956template <class _Tp, __enable_if_t<is_same<_Tp, long double>::value, int> = 0>
953inline _LIBCPP_HIDE_FROM_ABI long double arg(_Tp __re) {957[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double arg(_Tp __re) {
954 return std::atan2l(0.L, __re);958 return std::atan2l(0.L, __re);
955}959}
956960
957template <class _Tp, __enable_if_t<is_integral<_Tp>::value || is_same<_Tp, double>::value, int> = 0>961template <class _Tp, __enable_if_t<is_integral<_Tp>::value || is_same<_Tp, double>::value, int> = 0>
958inline _LIBCPP_HIDE_FROM_ABI double arg(_Tp __re) {962[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double arg(_Tp __re) {
959 return std::atan2(0., __re);963 return std::atan2(0., __re);
960}964}
961965
962template <class _Tp, __enable_if_t<is_same<_Tp, float>::value, int> = 0>966template <class _Tp, __enable_if_t<is_same<_Tp, float>::value, int> = 0>
963inline _LIBCPP_HIDE_FROM_ABI float arg(_Tp __re) {967[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float arg(_Tp __re) {
964 return std::atan2f(0.F, __re);968 return std::atan2f(0.F, __re);
965}969}
966970
967// norm971// norm
968972
969template <class _Tp>973template <class _Tp>
970inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp norm(const complex<_Tp>& __c) {974[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp norm(const complex<_Tp>& __c) {
971 if (std::__constexpr_isinf(__c.real()))975 if (std::__constexpr_isinf(__c.real()))
972 return std::abs(__c.real());976 return std::abs(__c.real());
973 if (std::__constexpr_isinf(__c.imag()))977 if (std::__constexpr_isinf(__c.imag()))
...@@ -976,7 +980,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp norm(const comple...@@ -976,7 +980,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp norm(const comple
976}980}
977981
978template <class _Tp>982template <class _Tp>
979inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __libcpp_complex_overload_traits<_Tp>::_ValueType983[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
984typename __libcpp_complex_overload_traits<_Tp>::_ValueType
980norm(_Tp __re) {985norm(_Tp __re) {
981 typedef typename __libcpp_complex_overload_traits<_Tp>::_ValueType _ValueType;986 typedef typename __libcpp_complex_overload_traits<_Tp>::_ValueType _ValueType;
982 return static_cast<_ValueType>(__re) * __re;987 return static_cast<_ValueType>(__re) * __re;
...@@ -985,12 +990,14 @@ norm(_Tp __re) {...@@ -985,12 +990,14 @@ norm(_Tp __re) {
985// conj990// conj
986991
987template <class _Tp>992template <class _Tp>
988inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> conj(const complex<_Tp>& __c) {993[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
994conj(const complex<_Tp>& __c) {
989 return complex<_Tp>(__c.real(), -__c.imag());995 return complex<_Tp>(__c.real(), -__c.imag());
990}996}
991997
992template <class _Tp>998template <class _Tp>
993inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __libcpp_complex_overload_traits<_Tp>::_ComplexType999[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1000typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
994conj(_Tp __re) {1001conj(_Tp __re) {
995 typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;1002 typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
996 return _ComplexType(__re);1003 return _ComplexType(__re);
...@@ -999,7 +1006,7 @@ conj(_Tp __re) {...@@ -999,7 +1006,7 @@ conj(_Tp __re) {
999// proj1006// proj
10001007
1001template <class _Tp>1008template <class _Tp>
1002inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> proj(const complex<_Tp>& __c) {1009[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> proj(const complex<_Tp>& __c) {
1003 complex<_Tp> __r = __c;1010 complex<_Tp> __r = __c;
1004 if (std::isinf(__c.real()) || std::isinf(__c.imag()))1011 if (std::isinf(__c.real()) || std::isinf(__c.imag()))
1005 __r = complex<_Tp>(INFINITY, std::copysign(_Tp(0), __c.imag()));1012 __r = complex<_Tp>(INFINITY, std::copysign(_Tp(0), __c.imag()));
...@@ -1007,14 +1014,16 @@ inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> proj(const complex<_Tp>& __c) {...@@ -1007,14 +1014,16 @@ inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> proj(const complex<_Tp>& __c) {
1007}1014}
10081015
1009template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0>1016template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0>
1010inline _LIBCPP_HIDE_FROM_ABI typename __libcpp_complex_overload_traits<_Tp>::_ComplexType proj(_Tp __re) {1017[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
1018proj(_Tp __re) {
1011 if (std::isinf(__re))1019 if (std::isinf(__re))
1012 __re = std::abs(__re);1020 __re = std::abs(__re);
1013 return complex<_Tp>(__re);1021 return complex<_Tp>(__re);
1014}1022}
10151023
1016template <class _Tp, __enable_if_t<is_integral<_Tp>::value, int> = 0>1024template <class _Tp, __enable_if_t<is_integral<_Tp>::value, int> = 0>
1017inline _LIBCPP_HIDE_FROM_ABI typename __libcpp_complex_overload_traits<_Tp>::_ComplexType proj(_Tp __re) {1025[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
1026proj(_Tp __re) {
1018 typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;1027 typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
1019 return _ComplexType(__re);1028 return _ComplexType(__re);
1020}1029}
...@@ -1022,7 +1031,7 @@ inline _LIBCPP_HIDE_FROM_ABI typename __libcpp_complex_overload_traits<_Tp>::_Co...@@ -1022,7 +1031,7 @@ inline _LIBCPP_HIDE_FROM_ABI typename __libcpp_complex_overload_traits<_Tp>::_Co
1022// polar1031// polar
10231032
1024template <class _Tp>1033template <class _Tp>
1025_LIBCPP_HIDE_FROM_ABI complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta = _Tp()) {1034[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta = _Tp()) {
1026 if (std::isnan(__rho) || std::signbit(__rho))1035 if (std::isnan(__rho) || std::signbit(__rho))
1027 return complex<_Tp>(_Tp(NAN), _Tp(NAN));1036 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
1028 if (std::isnan(__theta)) {1037 if (std::isnan(__theta)) {
...@@ -1047,21 +1056,21 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta =...@@ -1047,21 +1056,21 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta =
1047// log1056// log
10481057
1049template <class _Tp>1058template <class _Tp>
1050inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> log(const complex<_Tp>& __x) {1059[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> log(const complex<_Tp>& __x) {
1051 return complex<_Tp>(std::log(std::abs(__x)), std::arg(__x));1060 return complex<_Tp>(std::log(std::abs(__x)), std::arg(__x));
1052}1061}
10531062
1054// log101063// log10
10551064
1056template <class _Tp>1065template <class _Tp>
1057inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> log10(const complex<_Tp>& __x) {1066[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> log10(const complex<_Tp>& __x) {
1058 return std::log(__x) / std::log(_Tp(10));1067 return std::log(__x) / std::log(_Tp(10));
1059}1068}
10601069
1061// sqrt1070// sqrt
10621071
1063template <class _Tp>1072template <class _Tp>
1064_LIBCPP_HIDE_FROM_ABI complex<_Tp> sqrt(const complex<_Tp>& __x) {1073[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> sqrt(const complex<_Tp>& __x) {
1065 if (std::isinf(__x.imag()))1074 if (std::isinf(__x.imag()))
1066 return complex<_Tp>(_Tp(INFINITY), __x.imag());1075 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1067 if (std::isinf(__x.real())) {1076 if (std::isinf(__x.real())) {
...@@ -1075,7 +1084,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> sqrt(const complex<_Tp>& __x) {...@@ -1075,7 +1084,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> sqrt(const complex<_Tp>& __x) {
1075// exp1084// exp
10761085
1077template <class _Tp>1086template <class _Tp>
1078_LIBCPP_HIDE_FROM_ABI complex<_Tp> exp(const complex<_Tp>& __x) {1087[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> exp(const complex<_Tp>& __x) {
1079 _Tp __i = __x.imag();1088 _Tp __i = __x.imag();
1080 if (__i == 0) {1089 if (__i == 0) {
1081 return complex<_Tp>(std::exp(__x.real()), std::copysign(_Tp(0), __x.imag()));1090 return complex<_Tp>(std::exp(__x.real()), std::copysign(_Tp(0), __x.imag()));
...@@ -1097,24 +1106,27 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> exp(const complex<_Tp>& __x) {...@@ -1097,24 +1106,27 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> exp(const complex<_Tp>& __x) {
1097// pow1106// pow
10981107
1099template <class _Tp>1108template <class _Tp>
1100inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> pow(const complex<_Tp>& __x, const complex<_Tp>& __y) {1109[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> pow(const complex<_Tp>& __x, const complex<_Tp>& __y) {
1101 return std::exp(__y * std::log(__x));1110 return std::exp(__y * std::log(__x));
1102}1111}
11031112
1104template <class _Tp, class _Up, __enable_if_t<is_floating_point<_Tp>::value && is_floating_point<_Up>::value, int> = 0>1113template <class _Tp, class _Up, __enable_if_t<is_floating_point<_Tp>::value && is_floating_point<_Up>::value, int> = 0>
1105inline _LIBCPP_HIDE_FROM_ABI complex<__promote_t<_Tp, _Up> > pow(const complex<_Tp>& __x, const complex<_Up>& __y) {1114[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<__promote_t<_Tp, _Up> >
1115pow(const complex<_Tp>& __x, const complex<_Up>& __y) {
1106 typedef complex<__promote_t<_Tp, _Up> > result_type;1116 typedef complex<__promote_t<_Tp, _Up> > result_type;
1107 return std::pow(result_type(__x), result_type(__y));1117 return std::pow(result_type(__x), result_type(__y));
1108}1118}
11091119
1110template <class _Tp, class _Up, __enable_if_t<is_floating_point<_Tp>::value && is_arithmetic<_Up>::value, int> = 0>1120template <class _Tp, class _Up, __enable_if_t<is_floating_point<_Tp>::value && is_arithmetic<_Up>::value, int> = 0>
1111inline _LIBCPP_HIDE_FROM_ABI complex<__promote_t<_Tp, _Up> > pow(const complex<_Tp>& __x, const _Up& __y) {1121[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<__promote_t<_Tp, _Up> >
1122pow(const complex<_Tp>& __x, const _Up& __y) {
1112 typedef complex<__promote_t<_Tp, _Up> > result_type;1123 typedef complex<__promote_t<_Tp, _Up> > result_type;
1113 return std::pow(result_type(__x), result_type(__y));1124 return std::pow(result_type(__x), result_type(__y));
1114}1125}
11151126
1116template <class _Tp, class _Up, __enable_if_t<is_arithmetic<_Tp>::value && is_floating_point<_Up>::value, int> = 0>1127template <class _Tp, class _Up, __enable_if_t<is_arithmetic<_Tp>::value && is_floating_point<_Up>::value, int> = 0>
1117inline _LIBCPP_HIDE_FROM_ABI complex<__promote_t<_Tp, _Up> > pow(const _Tp& __x, const complex<_Up>& __y) {1128[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<__promote_t<_Tp, _Up> >
1129pow(const _Tp& __x, const complex<_Up>& __y) {
1118 typedef complex<__promote_t<_Tp, _Up> > result_type;1130 typedef complex<__promote_t<_Tp, _Up> > result_type;
1119 return std::pow(result_type(__x), result_type(__y));1131 return std::pow(result_type(__x), result_type(__y));
1120}1132}
...@@ -1129,7 +1141,7 @@ inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> __sqr(const complex<_Tp>& __x) {...@@ -1129,7 +1141,7 @@ inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> __sqr(const complex<_Tp>& __x) {
1129// asinh1141// asinh
11301142
1131template <class _Tp>1143template <class _Tp>
1132_LIBCPP_HIDE_FROM_ABI complex<_Tp> asinh(const complex<_Tp>& __x) {1144[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> asinh(const complex<_Tp>& __x) {
1133 const _Tp __pi(atan2(+0., -0.));1145 const _Tp __pi(atan2(+0., -0.));
1134 if (std::isinf(__x.real())) {1146 if (std::isinf(__x.real())) {
1135 if (std::isnan(__x.imag()))1147 if (std::isnan(__x.imag()))
...@@ -1154,7 +1166,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> asinh(const complex<_Tp>& __x) {...@@ -1154,7 +1166,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> asinh(const complex<_Tp>& __x) {
1154// acosh1166// acosh
11551167
1156template <class _Tp>1168template <class _Tp>
1157_LIBCPP_HIDE_FROM_ABI complex<_Tp> acosh(const complex<_Tp>& __x) {1169[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> acosh(const complex<_Tp>& __x) {
1158 const _Tp __pi(atan2(+0., -0.));1170 const _Tp __pi(atan2(+0., -0.));
1159 if (std::isinf(__x.real())) {1171 if (std::isinf(__x.real())) {
1160 if (std::isnan(__x.imag()))1172 if (std::isnan(__x.imag()))
...@@ -1183,7 +1195,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> acosh(const complex<_Tp>& __x) {...@@ -1183,7 +1195,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> acosh(const complex<_Tp>& __x) {
1183// atanh1195// atanh
11841196
1185template <class _Tp>1197template <class _Tp>
1186_LIBCPP_HIDE_FROM_ABI complex<_Tp> atanh(const complex<_Tp>& __x) {1198[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> atanh(const complex<_Tp>& __x) {
1187 const _Tp __pi(atan2(+0., -0.));1199 const _Tp __pi(atan2(+0., -0.));
1188 if (std::isinf(__x.imag())) {1200 if (std::isinf(__x.imag())) {
1189 return complex<_Tp>(std::copysign(_Tp(0), __x.real()), std::copysign(__pi / _Tp(2), __x.imag()));1201 return complex<_Tp>(std::copysign(_Tp(0), __x.real()), std::copysign(__pi / _Tp(2), __x.imag()));
...@@ -1209,7 +1221,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> atanh(const complex<_Tp>& __x) {...@@ -1209,7 +1221,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> atanh(const complex<_Tp>& __x) {
1209// sinh1221// sinh
12101222
1211template <class _Tp>1223template <class _Tp>
1212_LIBCPP_HIDE_FROM_ABI complex<_Tp> sinh(const complex<_Tp>& __x) {1224[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> sinh(const complex<_Tp>& __x) {
1213 if (std::isinf(__x.real()) && !std::isfinite(__x.imag()))1225 if (std::isinf(__x.real()) && !std::isfinite(__x.imag()))
1214 return complex<_Tp>(__x.real(), _Tp(NAN));1226 return complex<_Tp>(__x.real(), _Tp(NAN));
1215 if (__x.real() == 0 && !std::isfinite(__x.imag()))1227 if (__x.real() == 0 && !std::isfinite(__x.imag()))
...@@ -1222,7 +1234,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> sinh(const complex<_Tp>& __x) {...@@ -1222,7 +1234,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> sinh(const complex<_Tp>& __x) {
1222// cosh1234// cosh
12231235
1224template <class _Tp>1236template <class _Tp>
1225_LIBCPP_HIDE_FROM_ABI complex<_Tp> cosh(const complex<_Tp>& __x) {1237[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> cosh(const complex<_Tp>& __x) {
1226 if (std::isinf(__x.real()) && !std::isfinite(__x.imag()))1238 if (std::isinf(__x.real()) && !std::isfinite(__x.imag()))
1227 return complex<_Tp>(std::abs(__x.real()), _Tp(NAN));1239 return complex<_Tp>(std::abs(__x.real()), _Tp(NAN));
1228 if (__x.real() == 0 && !std::isfinite(__x.imag()))1240 if (__x.real() == 0 && !std::isfinite(__x.imag()))
...@@ -1237,7 +1249,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> cosh(const complex<_Tp>& __x) {...@@ -1237,7 +1249,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> cosh(const complex<_Tp>& __x) {
1237// tanh1249// tanh
12381250
1239template <class _Tp>1251template <class _Tp>
1240_LIBCPP_HIDE_FROM_ABI complex<_Tp> tanh(const complex<_Tp>& __x) {1252[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> tanh(const complex<_Tp>& __x) {
1241 if (std::isinf(__x.real())) {1253 if (std::isinf(__x.real())) {
1242 if (!std::isfinite(__x.imag()))1254 if (!std::isfinite(__x.imag()))
1243 return complex<_Tp>(std::copysign(_Tp(1), __x.real()), _Tp(0));1255 return complex<_Tp>(std::copysign(_Tp(1), __x.real()), _Tp(0));
...@@ -1257,7 +1269,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> tanh(const complex<_Tp>& __x) {...@@ -1257,7 +1269,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> tanh(const complex<_Tp>& __x) {
1257// asin1269// asin
12581270
1259template <class _Tp>1271template <class _Tp>
1260_LIBCPP_HIDE_FROM_ABI complex<_Tp> asin(const complex<_Tp>& __x) {1272[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> asin(const complex<_Tp>& __x) {
1261 complex<_Tp> __z = std::asinh(complex<_Tp>(-__x.imag(), __x.real()));1273 complex<_Tp> __z = std::asinh(complex<_Tp>(-__x.imag(), __x.real()));
1262 return complex<_Tp>(__z.imag(), -__z.real());1274 return complex<_Tp>(__z.imag(), -__z.real());
1263}1275}
...@@ -1265,7 +1277,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> asin(const complex<_Tp>& __x) {...@@ -1265,7 +1277,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> asin(const complex<_Tp>& __x) {
1265// acos1277// acos
12661278
1267template <class _Tp>1279template <class _Tp>
1268_LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) {1280[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) {
1269 const _Tp __pi(atan2(+0., -0.));1281 const _Tp __pi(atan2(+0., -0.));
1270 if (std::isinf(__x.real())) {1282 if (std::isinf(__x.real())) {
1271 if (std::isnan(__x.imag()))1283 if (std::isnan(__x.imag()))
...@@ -1297,7 +1309,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) {...@@ -1297,7 +1309,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) {
1297// atan1309// atan
12981310
1299template <class _Tp>1311template <class _Tp>
1300_LIBCPP_HIDE_FROM_ABI complex<_Tp> atan(const complex<_Tp>& __x) {1312[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> atan(const complex<_Tp>& __x) {
1301 complex<_Tp> __z = std::atanh(complex<_Tp>(-__x.imag(), __x.real()));1313 complex<_Tp> __z = std::atanh(complex<_Tp>(-__x.imag(), __x.real()));
1302 return complex<_Tp>(__z.imag(), -__z.real());1314 return complex<_Tp>(__z.imag(), -__z.real());
1303}1315}
...@@ -1305,7 +1317,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> atan(const complex<_Tp>& __x) {...@@ -1305,7 +1317,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> atan(const complex<_Tp>& __x) {
1305// sin1317// sin
13061318
1307template <class _Tp>1319template <class _Tp>
1308_LIBCPP_HIDE_FROM_ABI complex<_Tp> sin(const complex<_Tp>& __x) {1320[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> sin(const complex<_Tp>& __x) {
1309 complex<_Tp> __z = std::sinh(complex<_Tp>(-__x.imag(), __x.real()));1321 complex<_Tp> __z = std::sinh(complex<_Tp>(-__x.imag(), __x.real()));
1310 return complex<_Tp>(__z.imag(), -__z.real());1322 return complex<_Tp>(__z.imag(), -__z.real());
1311}1323}
...@@ -1313,14 +1325,14 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> sin(const complex<_Tp>& __x) {...@@ -1313,14 +1325,14 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> sin(const complex<_Tp>& __x) {
1313// cos1325// cos
13141326
1315template <class _Tp>1327template <class _Tp>
1316inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> cos(const complex<_Tp>& __x) {1328[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI complex<_Tp> cos(const complex<_Tp>& __x) {
1317 return std::cosh(complex<_Tp>(-__x.imag(), __x.real()));1329 return std::cosh(complex<_Tp>(-__x.imag(), __x.real()));
1318}1330}
13191331
1320// tan1332// tan
13211333
1322template <class _Tp>1334template <class _Tp>
1323_LIBCPP_HIDE_FROM_ABI complex<_Tp> tan(const complex<_Tp>& __x) {1335[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI complex<_Tp> tan(const complex<_Tp>& __x) {
1324 complex<_Tp> __z = std::tanh(complex<_Tp>(-__x.imag(), __x.real()));1336 complex<_Tp> __z = std::tanh(complex<_Tp>(-__x.imag(), __x.real()));
1325 return complex<_Tp>(__z.imag(), -__z.real());1337 return complex<_Tp>(__z.imag(), -__z.real());
1326}1338}
...@@ -1398,7 +1410,7 @@ struct tuple_element<_Ip, complex<_Tp>> {...@@ -1398,7 +1410,7 @@ struct tuple_element<_Ip, complex<_Tp>> {
1398};1410};
13991411
1400template <size_t _Ip, class _Xp>1412template <size_t _Ip, class _Xp>
1401_LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>& __z) noexcept {1413[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>& __z) noexcept {
1402 static_assert(_Ip < 2, "Index value is out of range.");1414 static_assert(_Ip < 2, "Index value is out of range.");
1403 if constexpr (_Ip == 0) {1415 if constexpr (_Ip == 0) {
1404 return __z.__re_;1416 return __z.__re_;
...@@ -1408,7 +1420,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>& __z) noexcept {...@@ -1408,7 +1420,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>& __z) noexcept {
1408}1420}
14091421
1410template <size_t _Ip, class _Xp>1422template <size_t _Ip, class _Xp>
1411_LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&& __z) noexcept {1423[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&& __z) noexcept {
1412 static_assert(_Ip < 2, "Index value is out of range.");1424 static_assert(_Ip < 2, "Index value is out of range.");
1413 if constexpr (_Ip == 0) {1425 if constexpr (_Ip == 0) {
1414 return std::move(__z.__re_);1426 return std::move(__z.__re_);
...@@ -1418,7 +1430,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&& __z) noexcept {...@@ -1418,7 +1430,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&& __z) noexcept {
1418}1430}
14191431
1420template <size_t _Ip, class _Xp>1432template <size_t _Ip, class _Xp>
1421_LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>& __z) noexcept {1433[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>& __z) noexcept {
1422 static_assert(_Ip < 2, "Index value is out of range.");1434 static_assert(_Ip < 2, "Index value is out of range.");
1423 if constexpr (_Ip == 0) {1435 if constexpr (_Ip == 0) {
1424 return __z.__re_;1436 return __z.__re_;
...@@ -1428,7 +1440,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>& __z) noexcept...@@ -1428,7 +1440,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>& __z) noexcept
1428}1440}
14291441
1430template <size_t _Ip, class _Xp>1442template <size_t _Ip, class _Xp>
1431_LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&& __z) noexcept {1443[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&& __z) noexcept {
1432 static_assert(_Ip < 2, "Index value is out of range.");1444 static_assert(_Ip < 2, "Index value is out of range.");
1433 if constexpr (_Ip == 0) {1445 if constexpr (_Ip == 0) {
1434 return std::move(__z.__re_);1446 return std::move(__z.__re_);
lib/libcxx/include/complex.h+10-10
...@@ -18,19 +18,19 @@...@@ -18,19 +18,19 @@
18*/18*/
1919
20#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)20#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
21# include <__cxx03/complex.h>21# include <__cxx03/__config>
22#else22#else
23# include <__config>23# include <__config>
24#endif
2425
25# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
26# pragma GCC system_header27# pragma GCC system_header
27# endif28#endif
2829
29# ifdef __cplusplus30#ifdef __cplusplus
30# include <complex>31# include <complex>
31# elif __has_include_next(<complex.h>)32#elif __has_include_next(<complex.h>)
32# include_next <complex.h>33# include_next <complex.h>
33# endif34#endif
34#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
3535
36#endif // _LIBCPP_COMPLEX_H36#endif // _LIBCPP_COMPLEX_H
lib/libcxx/include/condition_variable+3-3
...@@ -206,14 +206,14 @@ public:...@@ -206,14 +206,14 @@ public:
206# if _LIBCPP_STD_VER >= 20206# if _LIBCPP_STD_VER >= 20
207207
208 template <class _Lock, class _Predicate>208 template <class _Lock, class _Predicate>
209 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool wait(_Lock& __lock, stop_token __stoken, _Predicate __pred);209 _LIBCPP_HIDE_FROM_ABI bool wait(_Lock& __lock, stop_token __stoken, _Predicate __pred);
210210
211 template <class _Lock, class _Clock, class _Duration, class _Predicate>211 template <class _Lock, class _Clock, class _Duration, class _Predicate>
212 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool wait_until(212 _LIBCPP_HIDE_FROM_ABI bool wait_until(
213 _Lock& __lock, stop_token __stoken, const chrono::time_point<_Clock, _Duration>& __abs_time, _Predicate __pred);213 _Lock& __lock, stop_token __stoken, const chrono::time_point<_Clock, _Duration>& __abs_time, _Predicate __pred);
214214
215 template <class _Lock, class _Rep, class _Period, class _Predicate>215 template <class _Lock, class _Rep, class _Period, class _Predicate>
216 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool216 _LIBCPP_HIDE_FROM_ABI bool
217 wait_for(_Lock& __lock, stop_token __stoken, const chrono::duration<_Rep, _Period>& __rel_time, _Predicate __pred);217 wait_for(_Lock& __lock, stop_token __stoken, const chrono::duration<_Rep, _Period>& __rel_time, _Predicate __pred);
218218
219# endif // _LIBCPP_STD_VER >= 20219# endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/cstdalign+3-10
...@@ -43,17 +43,10 @@ Macros:...@@ -43,17 +43,10 @@ Macros:
43# undef __alignof_is_defined43# undef __alignof_is_defined
44# define __alignof_is_defined 144# define __alignof_is_defined 1
4545
46# if _LIBCPP_STD_VER >= 2046# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
4747# warning <cstdalign> is deprecated in C++17 and removed in C++20.
48using __standard_header_cstdalign _LIBCPP_DEPRECATED_("removed in C++20.") _LIBCPP_NODEBUG = void;
49using __use_standard_header_cstdalign _LIBCPP_NODEBUG = __standard_header_cstdalign;
50
51# elif _LIBCPP_STD_VER >= 17
52
53using __standard_header_cstdalign _LIBCPP_DEPRECATED _LIBCPP_NODEBUG = void;
54using __use_standard_header_cstdalign _LIBCPP_NODEBUG = __standard_header_cstdalign;
55
56# endif48# endif
49
57#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)50#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
5851
59#endif // _LIBCPP_CSTDALIGN52#endif // _LIBCPP_CSTDALIGN
lib/libcxx/include/cstdbool+3-10
...@@ -31,17 +31,10 @@ Macros:...@@ -31,17 +31,10 @@ Macros:
31# undef __bool_true_false_are_defined31# undef __bool_true_false_are_defined
32# define __bool_true_false_are_defined 132# define __bool_true_false_are_defined 1
3333
34# if _LIBCPP_STD_VER >= 2034# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
3535# warning <cstdbool> is deprecated in C++17 and removed in C++20.
36using __standard_header_cstdbool _LIBCPP_DEPRECATED_("removed in C++20.") _LIBCPP_NODEBUG = void;
37using __use_standard_header_cstdbool _LIBCPP_NODEBUG = __standard_header_cstdbool;
38
39# elif _LIBCPP_STD_VER >= 17
40
41using __standard_header_cstdbool _LIBCPP_DEPRECATED _LIBCPP_NODEBUG = void;
42using __use_standard_header_cstdbool _LIBCPP_NODEBUG = __standard_header_cstdbool;
43
44# endif36# endif
37
45#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)38#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
4639
47#endif // _LIBCPP_CSTDBOOL40#endif // _LIBCPP_CSTDBOOL
lib/libcxx/include/ctgmath+2-11
...@@ -28,17 +28,8 @@...@@ -28,17 +28,8 @@
28# pragma GCC system_header28# pragma GCC system_header
29# endif29# endif
3030
31# if _LIBCPP_STD_VER >= 2031# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
3232# warning <ctgmath> is deprecated in C++17 and removed in C++20. Include <cmath> and <complex> instead.
33using __standard_header_ctgmath
34 _LIBCPP_DEPRECATED_("removed in C++20. Include <cmath> and <complex> instead.") _LIBCPP_NODEBUG = void;
35using __use_standard_header_ctgmath _LIBCPP_NODEBUG = __standard_header_ctgmath;
36
37# elif _LIBCPP_STD_VER >= 17
38
39using __standard_header_ctgmath _LIBCPP_DEPRECATED_("Include <cmath> and <complex> instead.") _LIBCPP_NODEBUG = void;
40using __use_standard_header_ctgmath _LIBCPP_NODEBUG = __standard_header_ctgmath;
41
42# endif33# endif
4334
44#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)35#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/ctype.h+24-24
...@@ -30,36 +30,36 @@ int toupper(int c);...@@ -30,36 +30,36 @@ int toupper(int c);
30*/30*/
3131
32#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)32#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
33# include <__cxx03/ctype.h>33# include <__cxx03/__config>
34#else34#else
35# include <__config>35# include <__config>
36#endif
3637
37# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)38#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
38# pragma GCC system_header39# pragma GCC system_header
39# endif40#endif
4041
41# if __has_include_next(<ctype.h>)42#if __has_include_next(<ctype.h>)
42# include_next <ctype.h>43# include_next <ctype.h>
43# endif44#endif
4445
45# ifdef __cplusplus46#ifdef __cplusplus
4647
47# undef isalnum48# undef isalnum
48# undef isalpha49# undef isalpha
49# undef isblank50# undef isblank
50# undef iscntrl51# undef iscntrl
51# undef isdigit52# undef isdigit
52# undef isgraph53# undef isgraph
53# undef islower54# undef islower
54# undef isprint55# undef isprint
55# undef ispunct56# undef ispunct
56# undef isspace57# undef isspace
57# undef isupper58# undef isupper
58# undef isxdigit59# undef isxdigit
59# undef tolower60# undef tolower
60# undef toupper61# undef toupper
6162
62# endif63#endif
63#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
6464
65#endif // _LIBCPP_CTYPE_H65#endif // _LIBCPP_CTYPE_H
lib/libcxx/include/cwchar+2-2
...@@ -231,8 +231,8 @@ __constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count)...@@ -231,8 +231,8 @@ __constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count)
231231
232template <class _Tp, class _Up>232template <class _Tp, class _Up>
233_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp* __str, _Up __value, size_t __count) {233_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp* __str, _Up __value, size_t __count) {
234 static_assert(sizeof(_Tp) == sizeof(wchar_t)&& _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t) &&234 static_assert(sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t) &&
235 __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value,235 __is_trivially_equality_comparable_v<_Tp, _Tp>,
236 "Calling wmemchr on non-trivially equality comparable types is unsafe.");236 "Calling wmemchr on non-trivially equality comparable types is unsafe.");
237237
238# if __has_builtin(__builtin_wmemchr)238# if __has_builtin(__builtin_wmemchr)
lib/libcxx/include/deque+109-225
...@@ -191,9 +191,9 @@ template <class T, class Allocator, class Predicate>...@@ -191,9 +191,9 @@ template <class T, class Allocator, class Predicate>
191# include <__algorithm/min.h>191# include <__algorithm/min.h>
192# include <__algorithm/move.h>192# include <__algorithm/move.h>
193# include <__algorithm/move_backward.h>193# include <__algorithm/move_backward.h>
194# include <__algorithm/ranges_copy_n.h>
194# include <__algorithm/remove.h>195# include <__algorithm/remove.h>
195# include <__algorithm/remove_if.h>196# include <__algorithm/remove_if.h>
196# include <__algorithm/unwrap_iter.h>
197# include <__assert>197# include <__assert>
198# include <__config>198# include <__config>
199# include <__debug_utils/sanitizers.h>199# include <__debug_utils/sanitizers.h>
...@@ -220,21 +220,19 @@ template <class T, class Allocator, class Predicate>...@@ -220,21 +220,19 @@ template <class T, class Allocator, class Predicate>
220# include <__ranges/concepts.h>220# include <__ranges/concepts.h>
221# include <__ranges/container_compatible_range.h>221# include <__ranges/container_compatible_range.h>
222# include <__ranges/from_range.h>222# include <__ranges/from_range.h>
223# include <__ranges/size.h>
224# include <__split_buffer>223# include <__split_buffer>
225# include <__type_traits/conditional.h>224# include <__type_traits/conditional.h>
226# include <__type_traits/container_traits.h>225# include <__type_traits/container_traits.h>
227# include <__type_traits/disjunction.h>
228# include <__type_traits/enable_if.h>226# include <__type_traits/enable_if.h>
229# include <__type_traits/is_allocator.h>227# include <__type_traits/is_allocator.h>
230# include <__type_traits/is_convertible.h>228# include <__type_traits/is_convertible.h>
231# include <__type_traits/is_nothrow_assignable.h>229# include <__type_traits/is_nothrow_assignable.h>
232# include <__type_traits/is_nothrow_constructible.h>230# include <__type_traits/is_nothrow_constructible.h>
233# include <__type_traits/is_replaceable.h>
234# include <__type_traits/is_same.h>231# include <__type_traits/is_same.h>
235# include <__type_traits/is_swappable.h>232# include <__type_traits/is_swappable.h>
236# include <__type_traits/is_trivially_relocatable.h>233# include <__type_traits/is_trivially_relocatable.h>
237# include <__type_traits/type_identity.h>234# include <__type_traits/type_identity.h>
235# include <__utility/exception_guard.h>
238# include <__utility/forward.h>236# include <__utility/forward.h>
239# include <__utility/move.h>237# include <__utility/move.h>
240# include <__utility/pair.h>238# include <__utility/pair.h>
...@@ -461,9 +459,8 @@ private:...@@ -461,9 +459,8 @@ private:
461 __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer, _DiffType, _BlockSize>;459 __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer, _DiffType, _BlockSize>;
462460
463public:461public:
464 using __is_segmented_iterator _LIBCPP_NODEBUG = true_type;462 using __segment_iterator _LIBCPP_NODEBUG = _MapPointer;
465 using __segment_iterator _LIBCPP_NODEBUG = _MapPointer;463 using __local_iterator _LIBCPP_NODEBUG = _Pointer;
466 using __local_iterator _LIBCPP_NODEBUG = _Pointer;
467464
468 static _LIBCPP_HIDE_FROM_ABI __segment_iterator __segment(_Iterator __iter) { return __iter.__m_iter_; }465 static _LIBCPP_HIDE_FROM_ABI __segment_iterator __segment(_Iterator __iter) { return __iter.__m_iter_; }
469 static _LIBCPP_HIDE_FROM_ABI __local_iterator __local(_Iterator __iter) { return __iter.__ptr_; }466 static _LIBCPP_HIDE_FROM_ABI __local_iterator __local(_Iterator __iter) { return __iter.__ptr_; }
...@@ -488,6 +485,9 @@ const _DiffType __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer,...@@ -488,6 +485,9 @@ const _DiffType __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer,
488485
489template <class _Tp, class _Allocator /*= allocator<_Tp>*/>486template <class _Tp, class _Allocator /*= allocator<_Tp>*/>
490class deque {487class deque {
488 template <class _Up, class _Alloc>
489 using __split_buffer _LIBCPP_NODEBUG = std::__split_buffer<_Up, _Alloc, __split_buffer_pointer_layout>;
490
491public:491public:
492 // types:492 // types:
493493
...@@ -531,10 +531,6 @@ public:...@@ -531,10 +531,6 @@ public:
531 __libcpp_is_trivially_relocatable<__map>::value && __libcpp_is_trivially_relocatable<allocator_type>::value,531 __libcpp_is_trivially_relocatable<__map>::value && __libcpp_is_trivially_relocatable<allocator_type>::value,
532 deque,532 deque,
533 void>;533 void>;
534 using __replaceable _LIBCPP_NODEBUG =
535 __conditional_t<__is_replaceable_v<__map> && __container_allocator_is_replaceable<__alloc_traits>::value,
536 deque,
537 void>;
538534
539 static_assert(is_nothrow_default_constructible<allocator_type>::value ==535 static_assert(is_nothrow_default_constructible<allocator_type>::value ==
540 is_nothrow_default_constructible<__pointer_allocator>::value,536 is_nothrow_default_constructible<__pointer_allocator>::value,
...@@ -635,7 +631,7 @@ public:...@@ -635,7 +631,7 @@ public:
635# endif631# endif
636 _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);632 _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
637633
638 template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>634 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
639 _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v, const allocator_type& __a)635 _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v, const allocator_type& __a)
640 : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {636 : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
641 __annotate_new(0);637 __annotate_new(0);
...@@ -703,8 +699,16 @@ public:...@@ -703,8 +699,16 @@ public:
703 __assign_with_size_random_access(ranges::begin(__range), __n);699 __assign_with_size_random_access(ranges::begin(__range), __n);
704700
705 } else if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {701 } else if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
706 auto __n = static_cast<size_type>(ranges::distance(__range));702 auto __n = ranges::distance(__range);
707 __assign_with_size(ranges::begin(__range), __n);703 auto __first = ranges::begin(__range);
704
705 auto __result = std::ranges::copy_n(std::move(__first), std::min<size_t>(__n, size()), begin());
706
707 if (static_cast<size_type>(__n) > size()) {
708 __append_with_size(std::move(__result.in), __n - size());
709 } else {
710 __erase_to_end(__result.out);
711 }
708712
709 } else {713 } else {
710 __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));714 __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
...@@ -720,45 +724,53 @@ public:...@@ -720,45 +724,53 @@ public:
720724
721 // iterators:725 // iterators:
722726
723 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {727 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
724 __map_pointer __mp = __map_.begin() + __start_ / __block_size;728 __map_pointer __mp = __map_.begin() + __start_ / __block_size;
725 return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);729 return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
726 }730 }
727731
728 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {732 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
729 __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size);733 __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size);
730 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);734 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
731 }735 }
732736
733 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {737 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
734 size_type __p = size() + __start_;738 size_type __p = size() + __start_;
735 __map_pointer __mp = __map_.begin() + __p / __block_size;739 __map_pointer __mp = __map_.begin() + __p / __block_size;
736 return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);740 return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
737 }741 }
738742
739 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {743 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
740 size_type __p = size() + __start_;744 size_type __p = size() + __start_;
741 __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);745 __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);
742 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);746 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
743 }747 }
744748
745 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }749 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
746 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }750 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {
747 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }751 return const_reverse_iterator(end());
748 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }752 }
753 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
754 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
755 return const_reverse_iterator(begin());
756 }
749757
750 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }758 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
751 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }759 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
752 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }760 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {
753 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(begin()); }761 return const_reverse_iterator(end());
762 }
763 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {
764 return const_reverse_iterator(begin());
765 }
754766
755 // capacity:767 // capacity:
756 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size(); }768 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size(); }
757769
758 _LIBCPP_HIDE_FROM_ABI size_type& __size() _NOEXCEPT { return __size_; }770 _LIBCPP_HIDE_FROM_ABI size_type& __size() _NOEXCEPT { return __size_; }
759 _LIBCPP_HIDE_FROM_ABI const size_type& __size() const _NOEXCEPT { return __size_; }771 _LIBCPP_HIDE_FROM_ABI const size_type& __size() const _NOEXCEPT { return __size_; }
760772
761 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {773 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
762 return std::min<size_type>(__alloc_traits::max_size(__alloc()), numeric_limits<difference_type>::max());774 return std::min<size_type>(__alloc_traits::max_size(__alloc()), numeric_limits<difference_type>::max());
763 }775 }
764 _LIBCPP_HIDE_FROM_ABI void resize(size_type __n);776 _LIBCPP_HIDE_FROM_ABI void resize(size_type __n);
...@@ -767,18 +779,22 @@ public:...@@ -767,18 +779,22 @@ public:
767 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }779 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }
768780
769 // element access:781 // element access:
770 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __i) _NOEXCEPT;782 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __i) _NOEXCEPT;
771 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __i) const _NOEXCEPT;783 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __i) const _NOEXCEPT;
772 _LIBCPP_HIDE_FROM_ABI reference at(size_type __i);784 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference at(size_type __i);
773 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __i) const;785 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __i) const;
774 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT;786 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT;
775 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT;787 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT;
776 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT;788 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT;
777 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT;789 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT;
778790
779 // 23.2.2.3 modifiers:791 // 23.2.2.3 modifiers:
780 _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);792 _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
781 _LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __v);793 _LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __v);
794
795 template <class... _Args>
796 _LIBCPP_HIDE_FROM_ABI iterator __emplace(const_iterator __p, _Args&&... __args);
797
782# ifndef _LIBCPP_CXX03_LANG798# ifndef _LIBCPP_CXX03_LANG
783# if _LIBCPP_STD_VER >= 17799# if _LIBCPP_STD_VER >= 17
784 template <class... _Args>800 template <class... _Args>
...@@ -791,8 +807,11 @@ public:...@@ -791,8 +807,11 @@ public:
791 template <class... _Args>807 template <class... _Args>
792 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);808 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
793# endif809# endif
810
794 template <class... _Args>811 template <class... _Args>
795 _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);812 _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args) {
813 return __emplace(__p, std::forward<_Args>(__args)...);
814 }
796815
797 _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);816 _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
798 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v);817 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v);
...@@ -805,17 +824,21 @@ public:...@@ -805,17 +824,21 @@ public:
805824
806 template <_ContainerCompatibleRange<_Tp> _Range>825 template <_ContainerCompatibleRange<_Tp> _Range>
807 _LIBCPP_HIDE_FROM_ABI void append_range(_Range&& __range) {826 _LIBCPP_HIDE_FROM_ABI void append_range(_Range&& __range) {
808 insert_range(end(), std::forward<_Range>(__range));827 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
828 __append_with_size(ranges::begin(__range), ranges::distance(__range));
829 } else {
830 __append_with_sentinel(ranges::begin(__range), ranges::end(__range));
831 }
809 }832 }
810# endif833# endif
811834
812 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v);835 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) { return __emplace(__p, std::move(__v)); }
813836
814 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {837 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {
815 return insert(__p, __il.begin(), __il.end());838 return insert(__p, __il.begin(), __il.end());
816 }839 }
817# endif // _LIBCPP_CXX03_LANG840# endif // _LIBCPP_CXX03_LANG
818 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v);841 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) { return __emplace(__p, __v); }
819 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);842 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);
820 template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>843 template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>
821 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l);844 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l);
...@@ -1109,7 +1132,7 @@ public:...@@ -1109,7 +1132,7 @@ public:
1109 // This function tests deque object annotations.1132 // This function tests deque object annotations.
1110 if (empty()) {1133 if (empty()) {
1111 for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) {1134 for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) {
1112 if (!__sanitizer_verify_double_ended_contiguous_container(1135 if (!::__sanitizer_verify_double_ended_contiguous_container(
1113 std::__to_address(*__it),1136 std::__to_address(*__it),
1114 std::__to_address(*__it),1137 std::__to_address(*__it),
1115 std::__to_address(*__it),1138 std::__to_address(*__it),
...@@ -1141,7 +1164,7 @@ public:...@@ -1141,7 +1164,7 @@ public:
11411164
1142 // Is the block before or after deque blocks that contain elements?1165 // Is the block before or after deque blocks that contain elements?
1143 if (__it < __first_mp || __it > __last_mp) {1166 if (__it < __first_mp || __it > __last_mp) {
1144 if (!__sanitizer_verify_double_ended_contiguous_container(1167 if (!::__sanitizer_verify_double_ended_contiguous_container(
1145 std::__to_address(*__it),1168 std::__to_address(*__it),
1146 std::__to_address(*__it),1169 std::__to_address(*__it),
1147 std::__to_address(*__it),1170 std::__to_address(*__it),
...@@ -1151,7 +1174,7 @@ public:...@@ -1151,7 +1174,7 @@ public:
1151 const void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (const void*)std::__to_address(*__it);1174 const void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (const void*)std::__to_address(*__it);
1152 const void* __containers_buffer_end =1175 const void* __containers_buffer_end =
1153 (__it == __last_mp) ? __p_end : (const void*)std::__to_address(*__it + __block_size);1176 (__it == __last_mp) ? __p_end : (const void*)std::__to_address(*__it + __block_size);
1154 if (!__sanitizer_verify_double_ended_contiguous_container(1177 if (!::__sanitizer_verify_double_ended_contiguous_container(
1155 std::__to_address(*__it),1178 std::__to_address(*__it),
1156 __containers_buffer_beg,1179 __containers_buffer_beg,
1157 __containers_buffer_end,1180 __containers_buffer_end,
...@@ -1191,7 +1214,7 @@ private:...@@ -1191,7 +1214,7 @@ private:
11911214
1192 template <class _RandomAccessIterator>1215 template <class _RandomAccessIterator>
1193 _LIBCPP_HIDE_FROM_ABI void __assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n);1216 _LIBCPP_HIDE_FROM_ABI void __assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n);
1194 template <class _Iterator>1217 template <class _AlgPolicy, class _Iterator>
1195 _LIBCPP_HIDE_FROM_ABI void __assign_with_size(_Iterator __f, difference_type __n);1218 _LIBCPP_HIDE_FROM_ABI void __assign_with_size(_Iterator __f, difference_type __n);
11961219
1197 template <class _Iterator, class _Sentinel>1220 template <class _Iterator, class _Sentinel>
...@@ -1239,8 +1262,8 @@ private:...@@ -1239,8 +1262,8 @@ private:
1239 clear();1262 clear();
1240 shrink_to_fit();1263 shrink_to_fit();
1241 }1264 }
1242 __alloc() = __c.__alloc();1265 __alloc() = __c.__alloc();
1243 __map_.__alloc_ = __c.__map_.__alloc_;1266 __map_.__get_allocator() = __c.__map_.__get_allocator();
1244 }1267 }
12451268
1246 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const deque&, false_type) {}1269 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const deque&, false_type) {}
...@@ -1256,22 +1279,22 @@ _LIBCPP_CONSTEXPR const typename allocator_traits<_Alloc>::difference_type deque...@@ -1256,22 +1279,22 @@ _LIBCPP_CONSTEXPR const typename allocator_traits<_Alloc>::difference_type deque
12561279
1257# if _LIBCPP_STD_VER >= 171280# if _LIBCPP_STD_VER >= 17
1258template <class _InputIterator,1281template <class _InputIterator,
1259 class _Alloc = allocator<__iter_value_type<_InputIterator>>,1282 class _Alloc = allocator<__iterator_value_type<_InputIterator>>,
1260 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1283 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1261 class = enable_if_t<__is_allocator<_Alloc>::value> >1284 class = enable_if_t<__is_allocator_v<_Alloc>>>
1262deque(_InputIterator, _InputIterator) -> deque<__iter_value_type<_InputIterator>, _Alloc>;1285deque(_InputIterator, _InputIterator) -> deque<__iterator_value_type<_InputIterator>, _Alloc>;
12631286
1264template <class _InputIterator,1287template <class _InputIterator,
1265 class _Alloc,1288 class _Alloc,
1266 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1289 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1267 class = enable_if_t<__is_allocator<_Alloc>::value> >1290 class = enable_if_t<__is_allocator_v<_Alloc>>>
1268deque(_InputIterator, _InputIterator, _Alloc) -> deque<__iter_value_type<_InputIterator>, _Alloc>;1291deque(_InputIterator, _InputIterator, _Alloc) -> deque<__iterator_value_type<_InputIterator>, _Alloc>;
1269# endif1292# endif
12701293
1271# if _LIBCPP_STD_VER >= 231294# if _LIBCPP_STD_VER >= 23
1272template <ranges::input_range _Range,1295template <ranges::input_range _Range,
1273 class _Alloc = allocator<ranges::range_value_t<_Range>>,1296 class _Alloc = allocator<ranges::range_value_t<_Range>>,
1274 class = enable_if_t<__is_allocator<_Alloc>::value> >1297 class = enable_if_t<__is_allocator_v<_Alloc>>>
1275deque(from_range_t, _Range&&, _Alloc = _Alloc()) -> deque<ranges::range_value_t<_Range>, _Alloc>;1298deque(from_range_t, _Range&&, _Alloc = _Alloc()) -> deque<ranges::range_value_t<_Range>, _Alloc>;
1276# endif1299# endif
12771300
...@@ -1319,7 +1342,7 @@ deque<_Tp, _Allocator>::deque(const deque& __c)...@@ -1319,7 +1342,7 @@ deque<_Tp, _Allocator>::deque(const deque& __c)
1319 : __map_(__pointer_allocator(__alloc_traits::select_on_container_copy_construction(__c.__alloc()))),1342 : __map_(__pointer_allocator(__alloc_traits::select_on_container_copy_construction(__c.__alloc()))),
1320 __start_(0),1343 __start_(0),
1321 __size_(0),1344 __size_(0),
1322 __alloc_(__map_.__alloc_) {1345 __alloc_(__map_.__get_allocator()) {
1323 __annotate_new(0);1346 __annotate_new(0);
1324 __append(__c.begin(), __c.end());1347 __append(__c.begin(), __c.end());
1325}1348}
...@@ -1451,24 +1474,6 @@ deque<_Tp, _Allocator>::__assign_with_size_random_access(_RandomAccessIterator _...@@ -1451,24 +1474,6 @@ deque<_Tp, _Allocator>::__assign_with_size_random_access(_RandomAccessIterator _
1451 __erase_to_end(std::copy_n(__f, __n, begin()));1474 __erase_to_end(std::copy_n(__f, __n, begin()));
1452}1475}
14531476
1454template <class _Tp, class _Allocator>
1455template <class _Iterator>
1456_LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__assign_with_size(_Iterator __f, difference_type __n) {
1457 if (static_cast<size_type>(__n) > size()) {
1458 auto __added_size = __n - size();
1459
1460 auto __i = begin();
1461 for (auto __count = size(); __count != 0; --__count) {
1462 *__i++ = *__f++;
1463 }
1464
1465 __append_with_size(__f, __added_size);
1466
1467 } else {
1468 __erase_to_end(std::copy_n(__f, __n, begin()));
1469 }
1470}
1471
1472template <class _Tp, class _Allocator>1477template <class _Tp, class _Allocator>
1473void deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v) {1478void deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v) {
1474 if (__n > size()) {1479 if (__n > size()) {
...@@ -1661,56 +1666,11 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) {...@@ -1661,56 +1666,11 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) {
1661 return *begin();1666 return *begin();
1662# endif1667# endif
1663}1668}
16641669# endif // _LIBCPP_CXX03_LANG
1665template <class _Tp, class _Allocator>
1666typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) {
1667 size_type __pos = __p - begin();
1668 size_type __to_end = size() - __pos;
1669 allocator_type& __a = __alloc();
1670 if (__pos < __to_end) { // insert by shifting things backward
1671 if (__front_spare() == 0)
1672 __add_front_capacity();
1673 // __front_spare() >= 1
1674 __annotate_increase_front(1);
1675 if (__pos == 0) {
1676 __alloc_traits::construct(__a, std::addressof(*--begin()), std::move(__v));
1677 --__start_;
1678 ++__size();
1679 } else {
1680 iterator __b = begin();
1681 iterator __bm1 = std::prev(__b);
1682 __alloc_traits::construct(__a, std::addressof(*__bm1), std::move(*__b));
1683 --__start_;
1684 ++__size();
1685 if (__pos > 1)
1686 __b = std::move(std::next(__b), __b + __pos, __b);
1687 *__b = std::move(__v);
1688 }
1689 } else { // insert by shifting things forward
1690 if (__back_spare() == 0)
1691 __add_back_capacity();
1692 // __back_capacity >= 1
1693 __annotate_increase_back(1);
1694 size_type __de = size() - __pos;
1695 if (__de == 0) {
1696 __alloc_traits::construct(__a, std::addressof(*end()), std::move(__v));
1697 ++__size();
1698 } else {
1699 iterator __e = end();
1700 iterator __em1 = std::prev(__e);
1701 __alloc_traits::construct(__a, std::addressof(*__e), std::move(*__em1));
1702 ++__size();
1703 if (__de > 1)
1704 __e = std::move_backward(__e - __de, __em1, __e);
1705 *--__e = std::move(__v);
1706 }
1707 }
1708 return begin() + __pos;
1709}
17101670
1711template <class _Tp, class _Allocator>1671template <class _Tp, class _Allocator>
1712template <class... _Args>1672template <class... _Args>
1713typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args) {1673typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::__emplace(const_iterator __p, _Args&&... __args) {
1714 size_type __pos = __p - begin();1674 size_type __pos = __p - begin();
1715 size_type __to_end = size() - __pos;1675 size_type __to_end = size() - __pos;
1716 allocator_type& __a = __alloc();1676 allocator_type& __a = __alloc();
...@@ -1757,60 +1717,6 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_...@@ -1757,60 +1717,6 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_
1757 return begin() + __pos;1717 return begin() + __pos;
1758}1718}
17591719
1760# endif // _LIBCPP_CXX03_LANG
1761
1762template <class _Tp, class _Allocator>
1763typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) {
1764 size_type __pos = __p - begin();
1765 size_type __to_end = size() - __pos;
1766 allocator_type& __a = __alloc();
1767 if (__pos < __to_end) { // insert by shifting things backward
1768 if (__front_spare() == 0)
1769 __add_front_capacity();
1770 // __front_spare() >= 1
1771 __annotate_increase_front(1);
1772 if (__pos == 0) {
1773 __alloc_traits::construct(__a, std::addressof(*--begin()), __v);
1774 --__start_;
1775 ++__size();
1776 } else {
1777 const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
1778 iterator __b = begin();
1779 iterator __bm1 = std::prev(__b);
1780 if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
1781 __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
1782 __alloc_traits::construct(__a, std::addressof(*__bm1), std::move(*__b));
1783 --__start_;
1784 ++__size();
1785 if (__pos > 1)
1786 __b = __move_and_check(std::next(__b), __b + __pos, __b, __vt);
1787 *__b = *__vt;
1788 }
1789 } else { // insert by shifting things forward
1790 if (__back_spare() == 0)
1791 __add_back_capacity();
1792 // __back_capacity >= 1
1793 __annotate_increase_back(1);
1794 size_type __de = size() - __pos;
1795 if (__de == 0) {
1796 __alloc_traits::construct(__a, std::addressof(*end()), __v);
1797 ++__size();
1798 } else {
1799 const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
1800 iterator __e = end();
1801 iterator __em1 = std::prev(__e);
1802 if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
1803 __vt = pointer_traits<const_pointer>::pointer_to(*__e);
1804 __alloc_traits::construct(__a, std::addressof(*__e), std::move(*__em1));
1805 ++__size();
1806 if (__de > 1)
1807 __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
1808 *--__e = *__vt;
1809 }
1810 }
1811 return begin() + __pos;
1812}
1813
1814template <class _Tp, class _Allocator>1720template <class _Tp, class _Allocator>
1815typename deque<_Tp, _Allocator>::iterator1721typename deque<_Tp, _Allocator>::iterator
1816deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v) {1722deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v) {
...@@ -1874,9 +1780,9 @@ template <class _Tp, class _Allocator>...@@ -1874,9 +1780,9 @@ template <class _Tp, class _Allocator>
1874template <class _Iterator, class _Sentinel>1780template <class _Iterator, class _Sentinel>
1875_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator1781_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
1876deque<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l) {1782deque<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l) {
1877 __split_buffer<value_type, allocator_type&> __buf(__alloc());1783 __split_buffer<value_type, allocator_type> __buf(__alloc());
1878 __buf.__construct_at_end_with_sentinel(std::move(__f), std::move(__l));1784 __buf.__construct_at_end_with_sentinel(std::move(__f), std::move(__l));
1879 typedef typename __split_buffer<value_type, allocator_type&>::iterator __bi;1785 typedef typename __split_buffer<value_type, allocator_type>::iterator __bi;
1880 return insert(__p, move_iterator<__bi>(__buf.begin()), move_iterator<__bi>(__buf.end()));1786 return insert(__p, move_iterator<__bi>(__buf.begin()), move_iterator<__bi>(__buf.end()));
1881}1787}
18821788
...@@ -1891,9 +1797,9 @@ template <class _Tp, class _Allocator>...@@ -1891,9 +1797,9 @@ template <class _Tp, class _Allocator>
1891template <class _Iterator>1797template <class _Iterator>
1892_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator1798_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
1893deque<_Tp, _Allocator>::__insert_with_size(const_iterator __p, _Iterator __f, size_type __n) {1799deque<_Tp, _Allocator>::__insert_with_size(const_iterator __p, _Iterator __f, size_type __n) {
1894 __split_buffer<value_type, allocator_type&> __buf(__n, 0, __alloc());1800 __split_buffer<value_type, allocator_type> __buf(__n, 0, __alloc());
1895 __buf.__construct_at_end_with_size(__f, __n);1801 __buf.__construct_at_end_with_size(std::move(__f), __n);
1896 typedef typename __split_buffer<value_type, allocator_type&>::iterator __fwd;1802 typedef typename __split_buffer<value_type, allocator_type>::iterator __fwd;
1897 return insert(__p, move_iterator<__fwd>(__buf.begin()), move_iterator<__fwd>(__buf.end()));1803 return insert(__p, move_iterator<__fwd>(__buf.begin()), move_iterator<__fwd>(__buf.end()));
1898}1804}
18991805
...@@ -2071,8 +1977,8 @@ void deque<_Tp, _Allocator>::__add_front_capacity() {...@@ -2071,8 +1977,8 @@ void deque<_Tp, _Allocator>::__add_front_capacity() {
2071 }1977 }
2072 // Else need to allocate 1 buffer, *and* we need to reallocate __map_.1978 // Else need to allocate 1 buffer, *and* we need to reallocate __map_.
2073 else {1979 else {
2074 __split_buffer<pointer, __pointer_allocator&> __buf(1980 __split_buffer<pointer, __pointer_allocator> __buf(
2075 std::max<size_type>(2 * __map_.capacity(), 1), 0, __map_.__alloc_);1981 std::max<size_type>(2 * __map_.capacity(), 1), 0, __map_.__get_allocator());
20761982
2077 typedef __allocator_destructor<_Allocator> _Dp;1983 typedef __allocator_destructor<_Allocator> _Dp;
2078 unique_ptr<pointer, _Dp> __hold(__alloc_traits::allocate(__a, __block_size), _Dp(__a, __block_size));1984 unique_ptr<pointer, _Dp> __hold(__alloc_traits::allocate(__a, __block_size), _Dp(__a, __block_size));
...@@ -2081,10 +1987,7 @@ void deque<_Tp, _Allocator>::__add_front_capacity() {...@@ -2081,10 +1987,7 @@ void deque<_Tp, _Allocator>::__add_front_capacity() {
20811987
2082 for (__map_pointer __i = __map_.begin(); __i != __map_.end(); ++__i)1988 for (__map_pointer __i = __map_.begin(); __i != __map_.end(); ++__i)
2083 __buf.emplace_back(*__i);1989 __buf.emplace_back(*__i);
2084 std::swap(__map_.__first_, __buf.__first_);1990 __map_.__swap_without_allocator(__buf);
2085 std::swap(__map_.__begin_, __buf.__begin_);
2086 std::swap(__map_.__end_, __buf.__end_);
2087 std::swap(__map_.__cap_, __buf.__cap_);
2088 __start_ = __map_.size() == 1 ? __block_size / 2 : __start_ + __block_size;1991 __start_ = __map_.size() == 1 ? __block_size / 2 : __start_ + __block_size;
2089 }1992 }
2090 __annotate_whole_block(0, __asan_poison);1993 __annotate_whole_block(0, __asan_poison);
...@@ -2134,34 +2037,26 @@ void deque<_Tp, _Allocator>::__add_front_capacity(size_type __n) {...@@ -2134,34 +2037,26 @@ void deque<_Tp, _Allocator>::__add_front_capacity(size_type __n) {
2134 // Else need to allocate __nb buffers, *and* we need to reallocate __map_.2037 // Else need to allocate __nb buffers, *and* we need to reallocate __map_.
2135 else {2038 else {
2136 size_type __ds = (__nb + __back_capacity) * __block_size - __map_.empty();2039 size_type __ds = (__nb + __back_capacity) * __block_size - __map_.empty();
2137 __split_buffer<pointer, __pointer_allocator&> __buf(2040 __split_buffer<pointer, __pointer_allocator> __buf(
2138 std::max<size_type>(2 * __map_.capacity(), __nb + __map_.size()), 0, __map_.__alloc_);2041 std::max<size_type>(2 * __map_.capacity(), __nb + __map_.size()), 0, __map_.__get_allocator());
2139# if _LIBCPP_HAS_EXCEPTIONS2042 auto __guard = std::__make_exception_guard([&] {
2140 try {
2141# endif // _LIBCPP_HAS_EXCEPTIONS
2142 for (; __nb > 0; --__nb) {
2143 __buf.emplace_back(__alloc_traits::allocate(__a, __block_size));
2144 // ASan: this is empty container, we have to poison whole block
2145 __annotate_poison_block(std::__to_address(__buf.back()), std::__to_address(__buf.back() + __block_size));
2146 }
2147# if _LIBCPP_HAS_EXCEPTIONS
2148 } catch (...) {
2149 __annotate_delete();2043 __annotate_delete();
2150 for (__map_pointer __i = __buf.begin(); __i != __buf.end(); ++__i)2044 for (__map_pointer __i = __buf.begin(); __i != __buf.end(); ++__i)
2151 __alloc_traits::deallocate(__a, *__i, __block_size);2045 __alloc_traits::deallocate(__a, *__i, __block_size);
2152 throw;2046 });
2047 for (; __nb > 0; --__nb) {
2048 __buf.emplace_back(__alloc_traits::allocate(__a, __block_size));
2049 // ASan: this is empty container, we have to poison whole block
2050 __annotate_poison_block(std::__to_address(__buf.back()), std::__to_address(__buf.back() + __block_size));
2153 }2051 }
2154# endif // _LIBCPP_HAS_EXCEPTIONS2052 __guard.__complete();
2155 for (; __back_capacity > 0; --__back_capacity) {2053 for (; __back_capacity > 0; --__back_capacity) {
2156 __buf.emplace_back(__map_.back());2054 __buf.emplace_back(__map_.back());
2157 __map_.pop_back();2055 __map_.pop_back();
2158 }2056 }
2159 for (__map_pointer __i = __map_.begin(); __i != __map_.end(); ++__i)2057 for (__map_pointer __i = __map_.begin(); __i != __map_.end(); ++__i)
2160 __buf.emplace_back(*__i);2058 __buf.emplace_back(*__i);
2161 std::swap(__map_.__first_, __buf.__first_);2059 __map_.__swap_without_allocator(__buf);
2162 std::swap(__map_.__begin_, __buf.__begin_);
2163 std::swap(__map_.__end_, __buf.__end_);
2164 std::swap(__map_.__cap_, __buf.__cap_);
2165 __start_ += __ds;2060 __start_ += __ds;
2166 }2061 }
2167}2062}
...@@ -2194,8 +2089,8 @@ void deque<_Tp, _Allocator>::__add_back_capacity() {...@@ -2194,8 +2089,8 @@ void deque<_Tp, _Allocator>::__add_back_capacity() {
2194 }2089 }
2195 // Else need to allocate 1 buffer, *and* we need to reallocate __map_.2090 // Else need to allocate 1 buffer, *and* we need to reallocate __map_.
2196 else {2091 else {
2197 __split_buffer<pointer, __pointer_allocator&> __buf(2092 __split_buffer<pointer, __pointer_allocator> __buf(
2198 std::max<size_type>(2 * __map_.capacity(), 1), __map_.size(), __map_.__alloc_);2093 std::max<size_type>(2 * __map_.capacity(), 1), __map_.size(), __map_.__get_allocator());
21992094
2200 typedef __allocator_destructor<_Allocator> _Dp;2095 typedef __allocator_destructor<_Allocator> _Dp;
2201 unique_ptr<pointer, _Dp> __hold(__alloc_traits::allocate(__a, __block_size), _Dp(__a, __block_size));2096 unique_ptr<pointer, _Dp> __hold(__alloc_traits::allocate(__a, __block_size), _Dp(__a, __block_size));
...@@ -2204,10 +2099,7 @@ void deque<_Tp, _Allocator>::__add_back_capacity() {...@@ -2204,10 +2099,7 @@ void deque<_Tp, _Allocator>::__add_back_capacity() {
22042099
2205 for (__map_pointer __i = __map_.end(); __i != __map_.begin();)2100 for (__map_pointer __i = __map_.end(); __i != __map_.begin();)
2206 __buf.emplace_front(*--__i);2101 __buf.emplace_front(*--__i);
2207 std::swap(__map_.__first_, __buf.__first_);2102 __map_.__swap_without_allocator(__buf);
2208 std::swap(__map_.__begin_, __buf.__begin_);
2209 std::swap(__map_.__end_, __buf.__end_);
2210 std::swap(__map_.__cap_, __buf.__cap_);
2211 __annotate_whole_block(__map_.size() - 1, __asan_poison);2103 __annotate_whole_block(__map_.size() - 1, __asan_poison);
2212 }2104 }
2213}2105}
...@@ -2257,36 +2149,28 @@ void deque<_Tp, _Allocator>::__add_back_capacity(size_type __n) {...@@ -2257,36 +2149,28 @@ void deque<_Tp, _Allocator>::__add_back_capacity(size_type __n) {
2257 // Else need to allocate __nb buffers, *and* we need to reallocate __map_.2149 // Else need to allocate __nb buffers, *and* we need to reallocate __map_.
2258 else {2150 else {
2259 size_type __ds = __front_capacity * __block_size;2151 size_type __ds = __front_capacity * __block_size;
2260 __split_buffer<pointer, __pointer_allocator&> __buf(2152 __split_buffer<pointer, __pointer_allocator> __buf(
2261 std::max<size_type>(2 * __map_.capacity(), __nb + __map_.size()),2153 std::max<size_type>(2 * __map_.capacity(), __nb + __map_.size()),
2262 __map_.size() - __front_capacity,2154 __map_.size() - __front_capacity,
2263 __map_.__alloc_);2155 __map_.__get_allocator());
2264# if _LIBCPP_HAS_EXCEPTIONS2156 auto __guard = std::__make_exception_guard([&] {
2265 try {
2266# endif // _LIBCPP_HAS_EXCEPTIONS
2267 for (; __nb > 0; --__nb) {
2268 __buf.emplace_back(__alloc_traits::allocate(__a, __block_size));
2269 // ASan: this is an empty container, we have to poison the whole block
2270 __annotate_poison_block(std::__to_address(__buf.back()), std::__to_address(__buf.back() + __block_size));
2271 }
2272# if _LIBCPP_HAS_EXCEPTIONS
2273 } catch (...) {
2274 __annotate_delete();2157 __annotate_delete();
2275 for (__map_pointer __i = __buf.begin(); __i != __buf.end(); ++__i)2158 for (__map_pointer __i = __buf.begin(); __i != __buf.end(); ++__i)
2276 __alloc_traits::deallocate(__a, *__i, __block_size);2159 __alloc_traits::deallocate(__a, *__i, __block_size);
2277 throw;2160 });
2161 for (; __nb > 0; --__nb) {
2162 __buf.emplace_back(__alloc_traits::allocate(__a, __block_size));
2163 // ASan: this is an empty container, we have to poison the whole block
2164 __annotate_poison_block(std::__to_address(__buf.back()), std::__to_address(__buf.back() + __block_size));
2278 }2165 }
2279# endif // _LIBCPP_HAS_EXCEPTIONS2166 __guard.__complete();
2280 for (; __front_capacity > 0; --__front_capacity) {2167 for (; __front_capacity > 0; --__front_capacity) {
2281 __buf.emplace_back(__map_.front());2168 __buf.emplace_back(__map_.front());
2282 __map_.pop_front();2169 __map_.pop_front();
2283 }2170 }
2284 for (__map_pointer __i = __map_.end(); __i != __map_.begin();)2171 for (__map_pointer __i = __map_.end(); __i != __map_.begin();)
2285 __buf.emplace_front(*--__i);2172 __buf.emplace_front(*--__i);
2286 std::swap(__map_.__first_, __buf.__first_);2173 __map_.__swap_without_allocator(__buf);
2287 std::swap(__map_.__begin_, __buf.__begin_);
2288 std::swap(__map_.__end_, __buf.__end_);
2289 std::swap(__map_.__cap_, __buf.__cap_);
2290 __start_ -= __ds;2174 __start_ -= __ds;
2291 }2175 }
2292}2176}
lib/libcxx/include/errno.h+269-269
...@@ -23,381 +23,381 @@ Macros:...@@ -23,381 +23,381 @@ Macros:
23*/23*/
2424
25#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)25#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
26# include <__cxx03/errno.h>26# include <__cxx03/__config>
27#else27#else
28# include <__config>28# include <__config>
29#endif
2930
30# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)31#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
31# pragma GCC system_header32# pragma GCC system_header
32# endif33#endif
3334
34# if __has_include_next(<errno.h>)35#if __has_include_next(<errno.h>)
35# include_next <errno.h>36# include_next <errno.h>
36# endif37#endif
3738
38# ifdef __cplusplus39#ifdef __cplusplus
3940
40# if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)41# if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
4142
42# ifdef ELAST43# ifdef ELAST
4344
44static const int __elast1 = ELAST + 1;45static const int __elast1 = ELAST + 1;
45static const int __elast2 = ELAST + 2;46static const int __elast2 = ELAST + 2;
4647
47# else48# else
4849
49static const int __elast1 = 104;50static const int __elast1 = 104;
50static const int __elast2 = 105;51static const int __elast2 = 105;
5152
52# endif53# endif
5354
54# ifdef ENOTRECOVERABLE55# ifdef ENOTRECOVERABLE
5556
56# define EOWNERDEAD __elast157# define EOWNERDEAD __elast1
5758
58# ifdef ELAST59# ifdef ELAST
59# undef ELAST60# undef ELAST
60# define ELAST EOWNERDEAD61# define ELAST EOWNERDEAD
61# endif62# endif
6263
63# elif defined(EOWNERDEAD)64# elif defined(EOWNERDEAD)
6465
65# define ENOTRECOVERABLE __elast166# define ENOTRECOVERABLE __elast1
66# ifdef ELAST67# ifdef ELAST
67# undef ELAST68# undef ELAST
68# define ELAST ENOTRECOVERABLE69# define ELAST ENOTRECOVERABLE
69# endif70# endif
7071
71# else // defined(EOWNERDEAD)72# else // defined(EOWNERDEAD)
7273
73# define EOWNERDEAD __elast174# define EOWNERDEAD __elast1
74# define ENOTRECOVERABLE __elast275# define ENOTRECOVERABLE __elast2
75# ifdef ELAST76# ifdef ELAST
76# undef ELAST77# undef ELAST
77# define ELAST ENOTRECOVERABLE78# define ELAST ENOTRECOVERABLE
78# endif79# endif
7980
80# endif // defined(EOWNERDEAD)81# endif // defined(EOWNERDEAD)
8182
82# endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)83# endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
8384
84// supply errno values likely to be missing, particularly on Windows85// supply errno values likely to be missing, particularly on Windows
8586
86# ifndef EAFNOSUPPORT87# ifndef EAFNOSUPPORT
87# define EAFNOSUPPORT 990188# define EAFNOSUPPORT 9901
88# endif89# endif
8990
90# ifndef EADDRINUSE91# ifndef EADDRINUSE
91# define EADDRINUSE 990292# define EADDRINUSE 9902
92# endif93# endif
9394
94# ifndef EADDRNOTAVAIL95# ifndef EADDRNOTAVAIL
95# define EADDRNOTAVAIL 990396# define EADDRNOTAVAIL 9903
96# endif97# endif
9798
98# ifndef EISCONN99# ifndef EISCONN
99# define EISCONN 9904100# define EISCONN 9904
100# endif101# endif
101102
102# ifndef EBADMSG103# ifndef EBADMSG
103# define EBADMSG 9905104# define EBADMSG 9905
104# endif105# endif
105106
106# ifndef ECONNABORTED107# ifndef ECONNABORTED
107# define ECONNABORTED 9906108# define ECONNABORTED 9906
108# endif109# endif
109110
110# ifndef EALREADY111# ifndef EALREADY
111# define EALREADY 9907112# define EALREADY 9907
112# endif113# endif
113114
114# ifndef ECONNREFUSED115# ifndef ECONNREFUSED
115# define ECONNREFUSED 9908116# define ECONNREFUSED 9908
116# endif117# endif
117118
118# ifndef ECONNRESET119# ifndef ECONNRESET
119# define ECONNRESET 9909120# define ECONNRESET 9909
120# endif121# endif
121122
122# ifndef EDESTADDRREQ123# ifndef EDESTADDRREQ
123# define EDESTADDRREQ 9910124# define EDESTADDRREQ 9910
124# endif125# endif
125126
126# ifndef EHOSTUNREACH127# ifndef EHOSTUNREACH
127# define EHOSTUNREACH 9911128# define EHOSTUNREACH 9911
128# endif129# endif
129130
130# ifndef EIDRM131# ifndef EIDRM
131# define EIDRM 9912132# define EIDRM 9912
132# endif133# endif
133134
134# ifndef EMSGSIZE135# ifndef EMSGSIZE
135# define EMSGSIZE 9913136# define EMSGSIZE 9913
136# endif137# endif
137138
138# ifndef ENETDOWN139# ifndef ENETDOWN
139# define ENETDOWN 9914140# define ENETDOWN 9914
140# endif141# endif
141142
142# ifndef ENETRESET143# ifndef ENETRESET
143# define ENETRESET 9915144# define ENETRESET 9915
144# endif145# endif
145146
146# ifndef ENETUNREACH147# ifndef ENETUNREACH
147# define ENETUNREACH 9916148# define ENETUNREACH 9916
148# endif149# endif
149150
150# ifndef ENOBUFS151# ifndef ENOBUFS
151# define ENOBUFS 9917152# define ENOBUFS 9917
152# endif153# endif
153154
154# ifndef ENOLINK155# ifndef ENOLINK
155# define ENOLINK 9918156# define ENOLINK 9918
156# endif157# endif
157158
158# ifndef ENODATA159# ifndef ENODATA
159# define ENODATA 9919160# define ENODATA 9919
160# endif161# endif
161162
162# ifndef ENOMSG163# ifndef ENOMSG
163# define ENOMSG 9920164# define ENOMSG 9920
164# endif165# endif
165166
166# ifndef ENOPROTOOPT167# ifndef ENOPROTOOPT
167# define ENOPROTOOPT 9921168# define ENOPROTOOPT 9921
168# endif169# endif
169170
170# ifndef ENOSR171# ifndef ENOSR
171# define ENOSR 9922172# define ENOSR 9922
172# endif173# endif
173174
174# ifndef ENOTSOCK175# ifndef ENOTSOCK
175# define ENOTSOCK 9923176# define ENOTSOCK 9923
176# endif177# endif
177178
178# ifndef ENOSTR179# ifndef ENOSTR
179# define ENOSTR 9924180# define ENOSTR 9924
180# endif181# endif
181182
182# ifndef ENOTCONN183# ifndef ENOTCONN
183# define ENOTCONN 9925184# define ENOTCONN 9925
184# endif185# endif
185186
186# ifndef ENOTSUP187# ifndef ENOTSUP
187# define ENOTSUP 9926188# define ENOTSUP 9926
188# endif189# endif
189190
190# ifndef ECANCELED191# ifndef ECANCELED
191# define ECANCELED 9927192# define ECANCELED 9927
192# endif193# endif
193194
194# ifndef EINPROGRESS195# ifndef EINPROGRESS
195# define EINPROGRESS 9928196# define EINPROGRESS 9928
196# endif197# endif
197198
198# ifndef EOPNOTSUPP199# ifndef EOPNOTSUPP
199# define EOPNOTSUPP 9929200# define EOPNOTSUPP 9929
200# endif201# endif
201202
202# ifndef EWOULDBLOCK203# ifndef EWOULDBLOCK
203# define EWOULDBLOCK 9930204# define EWOULDBLOCK 9930
204# endif205# endif
205206
206# ifndef EOWNERDEAD207# ifndef EOWNERDEAD
207# define EOWNERDEAD 9931208# define EOWNERDEAD 9931
208# endif209# endif
209210
210# ifndef EPROTO211# ifndef EPROTO
211# define EPROTO 9932212# define EPROTO 9932
212# endif213# endif
213214
214# ifndef EPROTONOSUPPORT215# ifndef EPROTONOSUPPORT
215# define EPROTONOSUPPORT 9933216# define EPROTONOSUPPORT 9933
216# endif217# endif
217218
218# ifndef ENOTRECOVERABLE219# ifndef ENOTRECOVERABLE
219# define ENOTRECOVERABLE 9934220# define ENOTRECOVERABLE 9934
220# endif221# endif
221222
222# ifndef ETIME223# ifndef ETIME
223# define ETIME 9935224# define ETIME 9935
224# endif225# endif
225226
226# ifndef ETXTBSY227# ifndef ETXTBSY
227# define ETXTBSY 9936228# define ETXTBSY 9936
228# endif229# endif
229230
230# ifndef ETIMEDOUT231# ifndef ETIMEDOUT
231# define ETIMEDOUT 9938232# define ETIMEDOUT 9938
232# endif233# endif
233234
234# ifndef ELOOP235# ifndef ELOOP
235# define ELOOP 9939236# define ELOOP 9939
236# endif237# endif
237238
238# ifndef EOVERFLOW239# ifndef EOVERFLOW
239# define EOVERFLOW 9940240# define EOVERFLOW 9940
240# endif241# endif
241242
242# ifndef EPROTOTYPE243# ifndef EPROTOTYPE
243# define EPROTOTYPE 9941244# define EPROTOTYPE 9941
244# endif245# endif
245246
246# ifndef ENOSYS247# ifndef ENOSYS
247# define ENOSYS 9942248# define ENOSYS 9942
248# endif249# endif
249250
250# ifndef EINVAL251# ifndef EINVAL
251# define EINVAL 9943252# define EINVAL 9943
252# endif253# endif
253254
254# ifndef ERANGE255# ifndef ERANGE
255# define ERANGE 9944256# define ERANGE 9944
256# endif257# endif
257258
258# ifndef EILSEQ259# ifndef EILSEQ
259# define EILSEQ 9945260# define EILSEQ 9945
260# endif261# endif
261262
262// Windows Mobile doesn't appear to define these:263// Windows Mobile doesn't appear to define these:
263264
264# ifndef E2BIG265# ifndef E2BIG
265# define E2BIG 9946266# define E2BIG 9946
266# endif267# endif
267268
268# ifndef EDOM269# ifndef EDOM
269# define EDOM 9947270# define EDOM 9947
270# endif271# endif
271272
272# ifndef EFAULT273# ifndef EFAULT
273# define EFAULT 9948274# define EFAULT 9948
274# endif275# endif
275276
276# ifndef EBADF277# ifndef EBADF
277# define EBADF 9949278# define EBADF 9949
278# endif279# endif
279280
280# ifndef EPIPE281# ifndef EPIPE
281# define EPIPE 9950282# define EPIPE 9950
282# endif283# endif
283284
284# ifndef EXDEV285# ifndef EXDEV
285# define EXDEV 9951286# define EXDEV 9951
286# endif287# endif
287288
288# ifndef EBUSY289# ifndef EBUSY
289# define EBUSY 9952290# define EBUSY 9952
290# endif291# endif
291292
292# ifndef ENOTEMPTY293# ifndef ENOTEMPTY
293# define ENOTEMPTY 9953294# define ENOTEMPTY 9953
294# endif295# endif
295296
296# ifndef ENOEXEC297# ifndef ENOEXEC
297# define ENOEXEC 9954298# define ENOEXEC 9954
298# endif299# endif
299300
300# ifndef EEXIST301# ifndef EEXIST
301# define EEXIST 9955302# define EEXIST 9955
302# endif303# endif
303304
304# ifndef EFBIG305# ifndef EFBIG
305# define EFBIG 9956306# define EFBIG 9956
306# endif307# endif
307308
308# ifndef ENAMETOOLONG309# ifndef ENAMETOOLONG
309# define ENAMETOOLONG 9957310# define ENAMETOOLONG 9957
310# endif311# endif
311312
312# ifndef ENOTTY313# ifndef ENOTTY
313# define ENOTTY 9958314# define ENOTTY 9958
314# endif315# endif
315316
316# ifndef EINTR317# ifndef EINTR
317# define EINTR 9959318# define EINTR 9959
318# endif319# endif
319320
320# ifndef ESPIPE321# ifndef ESPIPE
321# define ESPIPE 9960322# define ESPIPE 9960
322# endif323# endif
323324
324# ifndef EIO325# ifndef EIO
325# define EIO 9961326# define EIO 9961
326# endif327# endif
327328
328# ifndef EISDIR329# ifndef EISDIR
329# define EISDIR 9962330# define EISDIR 9962
330# endif331# endif
331332
332# ifndef ECHILD333# ifndef ECHILD
333# define ECHILD 9963334# define ECHILD 9963
334# endif335# endif
335336
336# ifndef ENOLCK337# ifndef ENOLCK
337# define ENOLCK 9964338# define ENOLCK 9964
338# endif339# endif
339340
340# ifndef ENOSPC341# ifndef ENOSPC
341# define ENOSPC 9965342# define ENOSPC 9965
342# endif343# endif
343344
344# ifndef ENXIO345# ifndef ENXIO
345# define ENXIO 9966346# define ENXIO 9966
346# endif347# endif
347348
348# ifndef ENODEV349# ifndef ENODEV
349# define ENODEV 9967350# define ENODEV 9967
350# endif351# endif
351352
352# ifndef ENOENT353# ifndef ENOENT
353# define ENOENT 9968354# define ENOENT 9968
354# endif355# endif
355356
356# ifndef ESRCH357# ifndef ESRCH
357# define ESRCH 9969358# define ESRCH 9969
358# endif359# endif
359360
360# ifndef ENOTDIR361# ifndef ENOTDIR
361# define ENOTDIR 9970362# define ENOTDIR 9970
362# endif363# endif
363364
364# ifndef ENOMEM365# ifndef ENOMEM
365# define ENOMEM 9971366# define ENOMEM 9971
366# endif367# endif
367368
368# ifndef EPERM369# ifndef EPERM
369# define EPERM 9972370# define EPERM 9972
370# endif371# endif
371372
372# ifndef EACCES373# ifndef EACCES
373# define EACCES 9973374# define EACCES 9973
374# endif375# endif
375376
376# ifndef EROFS377# ifndef EROFS
377# define EROFS 9974378# define EROFS 9974
378# endif379# endif
379380
380# ifndef EDEADLK381# ifndef EDEADLK
381# define EDEADLK 9975382# define EDEADLK 9975
382# endif383# endif
383384
384# ifndef EAGAIN385# ifndef EAGAIN
385# define EAGAIN 9976386# define EAGAIN 9976
386# endif387# endif
387388
388# ifndef ENFILE389# ifndef ENFILE
389# define ENFILE 9977390# define ENFILE 9977
390# endif391# endif
391392
392# ifndef EMFILE393# ifndef EMFILE
393# define EMFILE 9978394# define EMFILE 9978
394# endif395# endif
395396
396# ifndef EMLINK397# ifndef EMLINK
397# define EMLINK 9979398# define EMLINK 9979
398# endif399# endif
399400
400# endif // __cplusplus401#endif // __cplusplus
401#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
402402
403#endif // _LIBCPP_ERRNO_H403#endif // _LIBCPP_ERRNO_H
lib/libcxx/include/exception+4-1
...@@ -93,10 +93,13 @@ template <class E> void rethrow_if_nested(const E& e);...@@ -93,10 +93,13 @@ template <class E> void rethrow_if_nested(const E& e);
9393
94# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2094# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
95# include <cstddef>95# include <cstddef>
96# include <cstdlib>
97# include <new>96# include <new>
98# include <type_traits>97# include <type_traits>
99# endif98# endif
99
100# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
101# include <cstdlib>
102# endif
100#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)103#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
101104
102#endif // _LIBCPP_EXCEPTION105#endif // _LIBCPP_EXCEPTION
lib/libcxx/include/ext/hash_map+7-48
...@@ -206,6 +206,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>...@@ -206,6 +206,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
206#else206#else
207# include <__config>207# include <__config>
208# include <__hash_table>208# include <__hash_table>
209# include <__memory/compressed_pair.h>
209# include <algorithm>210# include <algorithm>
210# include <ext/__hash>211# include <ext/__hash>
211# include <functional>212# include <functional>
...@@ -224,21 +225,9 @@ _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <un...@@ -224,21 +225,9 @@ _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <un
224225
225namespace __gnu_cxx {226namespace __gnu_cxx {
226227
227template <class _Tp, class _Hash, bool = std::is_empty<_Hash>::value && !std::__libcpp_is_final<_Hash>::value >
228class __hash_map_hasher : private _Hash {
229public:
230 _LIBCPP_HIDE_FROM_ABI __hash_map_hasher() : _Hash() {}
231 _LIBCPP_HIDE_FROM_ABI __hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
232 _LIBCPP_HIDE_FROM_ABI const _Hash& hash_function() const { return *this; }
233 _LIBCPP_HIDE_FROM_ABI size_t operator()(const _Tp& __x) const { return static_cast<const _Hash&>(*this)(__x.first); }
234 _LIBCPP_HIDE_FROM_ABI size_t operator()(const typename _Tp::first_type& __x) const {
235 return static_cast<const _Hash&>(*this)(__x);
236 }
237};
238
239template <class _Tp, class _Hash>228template <class _Tp, class _Hash>
240class __hash_map_hasher<_Tp, _Hash, false> {229class __hash_map_hasher {
241 _Hash __hash_;230 _LIBCPP_COMPRESSED_ELEMENT(_Hash, __hash_);
242231
243public:232public:
244 _LIBCPP_HIDE_FROM_ABI __hash_map_hasher() : __hash_() {}233 _LIBCPP_HIDE_FROM_ABI __hash_map_hasher() : __hash_() {}
...@@ -248,30 +237,9 @@ public:...@@ -248,30 +237,9 @@ public:
248 _LIBCPP_HIDE_FROM_ABI size_t operator()(const typename _Tp::first_type& __x) const { return __hash_(__x); }237 _LIBCPP_HIDE_FROM_ABI size_t operator()(const typename _Tp::first_type& __x) const { return __hash_(__x); }
249};238};
250239
251template <class _Tp, class _Pred, bool = std::is_empty<_Pred>::value && !std::__libcpp_is_final<_Pred>::value >
252class __hash_map_equal : private _Pred {
253public:
254 _LIBCPP_HIDE_FROM_ABI __hash_map_equal() : _Pred() {}
255 _LIBCPP_HIDE_FROM_ABI __hash_map_equal(const _Pred& __p) : _Pred(__p) {}
256 _LIBCPP_HIDE_FROM_ABI const _Pred& key_eq() const { return *this; }
257 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
258 return static_cast<const _Pred&>(*this)(__x.first, __y.first);
259 }
260 _LIBCPP_HIDE_FROM_ABI bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const {
261 return static_cast<const _Pred&>(*this)(__x, __y.first);
262 }
263 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const {
264 return static_cast<const _Pred&>(*this)(__x.first, __y);
265 }
266 _LIBCPP_HIDE_FROM_ABI bool
267 operator()(const typename _Tp::first_type& __x, const typename _Tp::first_type& __y) const {
268 return static_cast<const _Pred&>(*this)(__x, __y);
269 }
270};
271
272template <class _Tp, class _Pred>240template <class _Tp, class _Pred>
273class __hash_map_equal<_Tp, _Pred, false> {241class __hash_map_equal {
274 _Pred __pred_;242 _LIBCPP_COMPRESSED_ELEMENT(_Pred, __pred_);
275243
276public:244public:
277 _LIBCPP_HIDE_FROM_ABI __hash_map_equal() : __pred_() {}245 _LIBCPP_HIDE_FROM_ABI __hash_map_equal() : __pred_() {}
...@@ -467,8 +435,6 @@ private:...@@ -467,8 +435,6 @@ private:
467435
468 __table __table_;436 __table __table_;
469437
470 typedef typename __table::__node_pointer __node_pointer;
471 typedef typename __table::__node_const_pointer __node_const_pointer;
472 typedef typename __table::__node_traits __node_traits;438 typedef typename __table::__node_traits __node_traits;
473 typedef typename __table::__node_allocator __node_allocator;439 typedef typename __table::__node_allocator __node_allocator;
474 typedef typename __table::__node __node;440 typedef typename __table::__node __node;
...@@ -604,10 +570,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map(...@@ -604,10 +570,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map(
604}570}
605571
606template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>572template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
607hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map(const hash_map& __u) : __table_(__u.__table_) {573hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map(const hash_map& __u) : __table_(__u.__table_) {}
608 __table_.__rehash_unique(__u.bucket_count());
609 insert(__u.begin(), __u.end());
610}
611574
612template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>575template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
613typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder576typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
...@@ -693,7 +656,6 @@ private:...@@ -693,7 +656,6 @@ private:
693656
694 __table __table_;657 __table __table_;
695658
696 typedef typename __table::__node_traits __node_traits;
697 typedef typename __table::__node_allocator __node_allocator;659 typedef typename __table::__node_allocator __node_allocator;
698 typedef typename __table::__node __node;660 typedef typename __table::__node __node;
699 typedef __hash_map_node_destructor<__node_allocator> _Dp;661 typedef __hash_map_node_destructor<__node_allocator> _Dp;
...@@ -822,10 +784,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(...@@ -822,10 +784,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(
822}784}
823785
824template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>786template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
825hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(const hash_multimap& __u) : __table_(__u.__table_) {787hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(const hash_multimap& __u) : __table_(__u.__table_) {}
826 __table_.__rehash_multi(__u.bucket_count());
827 insert(__u.begin(), __u.end());
828}
829788
830template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>789template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
831template <class _InputIterator>790template <class _InputIterator>
lib/libcxx/include/ext/hash_set+2-8
...@@ -356,10 +356,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(...@@ -356,10 +356,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(
356}356}
357357
358template <class _Value, class _Hash, class _Pred, class _Alloc>358template <class _Value, class _Hash, class _Pred, class _Alloc>
359hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(const hash_set& __u) : __table_(__u.__table_) {359hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(const hash_set& __u) : __table_(__u.__table_) {}
360 __table_.__rehash_unique(__u.bucket_count());
361 insert(__u.begin(), __u.end());
362}
363360
364template <class _Value, class _Hash, class _Pred, class _Alloc>361template <class _Value, class _Hash, class _Pred, class _Alloc>
365template <class _InputIterator>362template <class _InputIterator>
...@@ -534,10 +531,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(...@@ -534,10 +531,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(
534}531}
535532
536template <class _Value, class _Hash, class _Pred, class _Alloc>533template <class _Value, class _Hash, class _Pred, class _Alloc>
537hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(const hash_multiset& __u) : __table_(__u.__table_) {534hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(const hash_multiset& __u) : __table_(__u.__table_) {}
538 __table_.__rehash_multi(__u.bucket_count());
539 insert(__u.begin(), __u.end());
540}
541535
542template <class _Value, class _Hash, class _Pred, class _Alloc>536template <class _Value, class _Hash, class _Pred, class _Alloc>
543template <class _InputIterator>537template <class _InputIterator>
lib/libcxx/include/fenv.h+43-43
...@@ -50,69 +50,69 @@ int feupdateenv(const fenv_t* envp);...@@ -50,69 +50,69 @@ int feupdateenv(const fenv_t* envp);
50*/50*/
5151
52#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)52#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
53# include <__cxx03/fenv.h>53# include <__cxx03/__config>
54#else54#else
55# include <__config>55# include <__config>
56#endif
5657
57# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)58#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
58# pragma GCC system_header59# pragma GCC system_header
59# endif60#endif
6061
61# if __has_include_next(<fenv.h>)62#if __has_include_next(<fenv.h>)
62# include_next <fenv.h>63# include_next <fenv.h>
63# endif64#endif
6465
65# ifdef __cplusplus66#ifdef __cplusplus
6667
67extern "C++" {68extern "C++" {
6869
69# ifdef feclearexcept70# ifdef feclearexcept
70# undef feclearexcept71# undef feclearexcept
71# endif72# endif
7273
73# ifdef fegetexceptflag74# ifdef fegetexceptflag
74# undef fegetexceptflag75# undef fegetexceptflag
75# endif76# endif
7677
77# ifdef feraiseexcept78# ifdef feraiseexcept
78# undef feraiseexcept79# undef feraiseexcept
79# endif80# endif
8081
81# ifdef fesetexceptflag82# ifdef fesetexceptflag
82# undef fesetexceptflag83# undef fesetexceptflag
83# endif84# endif
8485
85# ifdef fetestexcept86# ifdef fetestexcept
86# undef fetestexcept87# undef fetestexcept
87# endif88# endif
8889
89# ifdef fegetround90# ifdef fegetround
90# undef fegetround91# undef fegetround
91# endif92# endif
9293
93# ifdef fesetround94# ifdef fesetround
94# undef fesetround95# undef fesetround
95# endif96# endif
9697
97# ifdef fegetenv98# ifdef fegetenv
98# undef fegetenv99# undef fegetenv
99# endif100# endif
100101
101# ifdef feholdexcept102# ifdef feholdexcept
102# undef feholdexcept103# undef feholdexcept
103# endif104# endif
104105
105# ifdef fesetenv106# ifdef fesetenv
106# undef fesetenv107# undef fesetenv
107# endif108# endif
108109
109# ifdef feupdateenv110# ifdef feupdateenv
110# undef feupdateenv111# undef feupdateenv
111# endif112# endif
112113
113} // extern "C++"114} // extern "C++"
114115
115# endif // defined(__cplusplus)116#endif // defined(__cplusplus)
116#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
117117
118#endif // _LIBCPP_FENV_H118#endif // _LIBCPP_FENV_H
lib/libcxx/include/flat_map+663-11
...@@ -17,18 +17,359 @@...@@ -17,18 +17,359 @@
17#include <initializer_list> // see [initializer.list.syn]17#include <initializer_list> // see [initializer.list.syn]
1818
19namespace std {19namespace std {
20 struct sorted_unique_t { explicit sorted_unique_t() = default; };
21 inline constexpr sorted_unique_t sorted_unique{};
22
20 // [flat.map], class template flat_map23 // [flat.map], class template flat_map
21 template<class Key, class T, class Compare = less<Key>,24 template<class Key, class T, class Compare = less<Key>,
22 class KeyContainer = vector<Key>, class MappedContainer = vector<T>>25 class KeyContainer = vector<Key>, class MappedContainer = vector<T>>
23 class flat_map;26 class flat_map {
27 public:
28 // types
29 using key_type = Key;
30 using mapped_type = T;
31 using value_type = pair<key_type, mapped_type>;
32 using key_compare = Compare;
33 using reference = pair<const key_type&, mapped_type&>;
34 using const_reference = pair<const key_type&, const mapped_type&>;
35 using size_type = size_t;
36 using difference_type = ptrdiff_t;
37 using iterator = implementation-defined; // see [container.requirements]
38 using const_iterator = implementation-defined; // see [container.requirements]
39 using reverse_iterator = std::reverse_iterator<iterator>;
40 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
41 using key_container_type = KeyContainer;
42 using mapped_container_type = MappedContainer;
2443
25 struct sorted_unique_t { explicit sorted_unique_t() = default; };44 class value_compare {
26 inline constexpr sorted_unique_t sorted_unique{};45 private:
46 key_compare comp; // exposition only
47 constexpr value_compare(key_compare c) : comp(c) { } // exposition only
48
49 public:
50 constexpr bool operator()(const_reference x, const_reference y) const {
51 return comp(x.first, y.first);
52 }
53 };
54
55 struct containers {
56 key_container_type keys;
57 mapped_container_type values;
58 };
59
60 // [flat.map.cons], constructors
61 constexpr flat_map() : flat_map(key_compare()) { }
62
63 constexpr flat_map(const flat_map&);
64 constexpr flat_map(flat_map&&);
65 constexpr flat_map& operator=(const flat_map&);
66 constexpr flat_map& operator=(flat_map&&);
67
68 constexpr explicit flat_map(const key_compare& comp)
69 : c(), compare(comp) { }
70
71 constexpr flat_map(key_container_type key_cont, mapped_container_type mapped_cont,
72 const key_compare& comp = key_compare());
73
74 constexpr flat_map(sorted_unique_t, key_container_type key_cont,
75 mapped_container_type mapped_cont,
76 const key_compare& comp = key_compare());
77
78 template<class InputIterator>
79 constexpr flat_map(InputIterator first, InputIterator last,
80 const key_compare& comp = key_compare())
81 : c(), compare(comp) { insert(first, last); }
82
83 template<class InputIterator>
84 constexpr flat_map(sorted_unique_t, InputIterator first, InputIterator last,
85 const key_compare& comp = key_compare())
86 : c(), compare(comp) { insert(sorted_unique, first, last); }
87
88 template<container-compatible-range<value_type> R>
89 constexpr flat_map(from_range_t, R&& rg)
90 : flat_map(from_range, std::forward<R>(rg), key_compare()) { }
91 template<container-compatible-range<value_type> R>
92 constexpr flat_map(from_range_t, R&& rg, const key_compare& comp)
93 : flat_map(comp) { insert_range(std::forward<R>(rg)); }
94
95 constexpr flat_map(initializer_list<value_type> il, const key_compare& comp = key_compare())
96 : flat_map(il.begin(), il.end(), comp) { }
97
98 constexpr flat_map(sorted_unique_t, initializer_list<value_type> il,
99 const key_compare& comp = key_compare())
100 : flat_map(sorted_unique, il.begin(), il.end(), comp) { }
101
102 // [flat.map.cons.alloc], constructors with allocators
103
104 template<class Alloc>
105 constexpr explicit flat_map(const Alloc& a);
106 template<class Alloc>
107 constexpr flat_map(const key_compare& comp, const Alloc& a);
108 template<class Alloc>
109 constexpr flat_map(const key_container_type& key_cont,
110 const mapped_container_type& mapped_cont,
111 const Alloc& a);
112 template<class Alloc>
113 constexpr flat_map(const key_container_type& key_cont,
114 const mapped_container_type& mapped_cont,
115 const key_compare& comp, const Alloc& a);
116 template<class Alloc>
117 constexpr flat_map(sorted_unique_t, const key_container_type& key_cont,
118 const mapped_container_type& mapped_cont, const Alloc& a);
119 template<class Alloc>
120 constexpr flat_map(sorted_unique_t, const key_container_type& key_cont,
121 const mapped_container_type& mapped_cont, const key_compare& comp,
122 const Alloc& a);
123 template<class Alloc>
124 constexpr flat_map(const flat_map&, const Alloc& a);
125 template<class Alloc>
126 constexpr flat_map(flat_map&&, const Alloc& a);
127 template<class InputIterator, class Alloc>
128 constexpr flat_map(InputIterator first, InputIterator last, const Alloc& a);
129 template<class InputIterator, class Alloc>
130 constexpr flat_map(InputIterator first, InputIterator last,
131 const key_compare& comp, const Alloc& a);
132 template<class InputIterator, class Alloc>
133 constexpr flat_map(sorted_unique_t, InputIterator first, InputIterator last,
134 const Alloc& a);
135 template<class InputIterator, class Alloc>
136 constexpr flat_map(sorted_unique_t, InputIterator first, InputIterator last,
137 const key_compare& comp, const Alloc& a);
138 template<container-compatible-range<value_type> R, class Alloc>
139 constexpr flat_map(from_range_t, R&& rg, const Alloc& a);
140 template<container-compatible-range<value_type> R, class Alloc>
141 constexpr flat_map(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
142 template<class Alloc>
143 constexpr flat_map(initializer_list<value_type> il, const Alloc& a);
144 template<class Alloc>
145 constexpr flat_map(initializer_list<value_type> il, const key_compare& comp,
146 const Alloc& a);
147 template<class Alloc>
148 constexpr flat_map(sorted_unique_t, initializer_list<value_type> il, const Alloc& a);
149 template<class Alloc>
150 constexpr flat_map(sorted_unique_t, initializer_list<value_type> il,
151 const key_compare& comp, const Alloc& a);
152
153 constexpr flat_map& operator=(initializer_list<value_type>);
154
155 // iterators
156 constexpr iterator begin() noexcept;
157 constexpr const_iterator begin() const noexcept;
158 constexpr iterator end() noexcept;
159 constexpr const_iterator end() const noexcept;
160
161 constexpr reverse_iterator rbegin() noexcept;
162 constexpr const_reverse_iterator rbegin() const noexcept;
163 constexpr reverse_iterator rend() noexcept;
164 constexpr const_reverse_iterator rend() const noexcept;
165
166 constexpr const_iterator cbegin() const noexcept;
167 constexpr const_iterator cend() const noexcept;
168 constexpr const_reverse_iterator crbegin() const noexcept;
169 constexpr const_reverse_iterator crend() const noexcept;
170
171 // [flat.map.capacity], capacity
172 constexpr bool empty() const noexcept;
173 constexpr size_type size() const noexcept;
174 constexpr size_type max_size() const noexcept;
175
176 // [flat.map.access], element access
177 constexpr mapped_type& operator[](const key_type& x);
178 constexpr mapped_type& operator[](key_type&& x);
179 template<class K> constexpr mapped_type& operator[](K&& x);
180 constexpr mapped_type& at(const key_type& x);
181 constexpr const mapped_type& at(const key_type& x) const;
182 template<class K> constexpr mapped_type& at(const K& x);
183 template<class K> constexpr const mapped_type& at(const K& x) const;
184
185 // [flat.map.modifiers], modifiers
186 template<class... Args> constexpr pair<iterator, bool> emplace(Args&&... args);
187 template<class... Args>
188 constexpr iterator emplace_hint(const_iterator position, Args&&... args);
189
190 constexpr pair<iterator, bool> insert(const value_type& x)
191 { return emplace(x); }
192 constexpr pair<iterator, bool> insert(value_type&& x)
193 { return emplace(std::move(x)); }
194 constexpr iterator insert(const_iterator position, const value_type& x)
195 { return emplace_hint(position, x); }
196 constexpr iterator insert(const_iterator position, value_type&& x)
197 { return emplace_hint(position, std::move(x)); }
198
199 template<class P> constexpr pair<iterator, bool> insert(P&& x);
200 template<class P>
201 constexpr iterator insert(const_iterator position, P&&);
202 template<class InputIterator>
203 constexpr void insert(InputIterator first, InputIterator last);
204 template<class InputIterator>
205 constexpr void insert(sorted_unique_t, InputIterator first, InputIterator last);
206 template<container-compatible-range<value_type> R>
207 constexpr void insert_range(R&& rg);
208 template<container-compatible-range<value_type> R>
209 constexpr void insert_range(sorted_unique_t, R&& rg);
210
211 constexpr void insert(initializer_list<value_type> il)
212 { insert(il.begin(), il.end()); }
213 constexpr void insert(sorted_unique_t, initializer_list<value_type> il)
214 { insert(sorted_unique, il.begin(), il.end()); }
215
216 constexpr containers extract() &&;
217 constexpr void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont);
218
219 template<class... Args>
220 constexpr pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);
221 template<class... Args>
222 constexpr pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
223 template<class K, class... Args>
224 constexpr pair<iterator, bool> try_emplace(K&& k, Args&&... args);
225 template<class... Args>
226 constexpr iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args);
227 template<class... Args>
228 constexpr iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);
229 template<class K, class... Args>
230 constexpr iterator try_emplace(const_iterator hint, K&& k, Args&&... args);
231 template<class M>
232 constexpr pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);
233 template<class M>
234 constexpr pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);
235 template<class K, class M>
236 constexpr pair<iterator, bool> insert_or_assign(K&& k, M&& obj);
237 template<class M>
238 constexpr iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);
239 template<class M>
240 constexpr iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);
241 template<class K, class M>
242 constexpr iterator insert_or_assign(const_iterator hint, K&& k, M&& obj);
243
244 constexpr iterator erase(iterator position);
245 constexpr iterator erase(const_iterator position);
246 constexpr size_type erase(const key_type& x);
247 template<class K> constexpr size_type erase(K&& x);
248 constexpr iterator erase(const_iterator first, const_iterator last);
249
250 constexpr void swap(flat_map& y) noexcept(see below);
251 constexpr void clear() noexcept;
252
253 // observers
254 constexpr key_compare key_comp() const;
255 constexpr value_compare value_comp() const;
256
257 constexpr const key_container_type& keys() const noexcept { return c.keys; }
258 constexpr const mapped_container_type& values() const noexcept { return c.values; }
259
260 // map operations
261 constexpr iterator find(const key_type& x);
262 constexpr const_iterator find(const key_type& x) const;
263 template<class K> constexpr iterator find(const K& x);
264 template<class K> constexpr const_iterator find(const K& x) const;
265
266 constexpr size_type count(const key_type& x) const;
267 template<class K> constexpr size_type count(const K& x) const;
268
269 constexpr bool contains(const key_type& x) const;
270 template<class K> constexpr bool contains(const K& x) const;
271
272 constexpr iterator lower_bound(const key_type& x);
273 constexpr const_iterator lower_bound(const key_type& x) const;
274 template<class K> constexpr iterator lower_bound(const K& x);
275 template<class K> constexpr const_iterator lower_bound(const K& x) const;
276
277 constexpr iterator upper_bound(const key_type& x);
278 constexpr const_iterator upper_bound(const key_type& x) const;
279 template<class K> constexpr iterator upper_bound(const K& x);
280 template<class K> constexpr const_iterator upper_bound(const K& x) const;
281
282 constexpr pair<iterator, iterator> equal_range(const key_type& x);
283 constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
284 template<class K> constexpr pair<iterator, iterator> equal_range(const K& x);
285 template<class K>
286 constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
287
288 friend constexpr bool operator==(const flat_map& x, const flat_map& y);
289
290 friend constexpr synth-three-way-result<value_type>
291 operator<=>(const flat_map& x, const flat_map& y);
292
293 friend constexpr void swap(flat_map& x, flat_map& y) noexcept(noexcept(x.swap(y)))
294 { x.swap(y); }
295
296 private:
297 containers c; // exposition only
298 key_compare compare; // exposition only
299
300 struct key-equiv { // exposition only
301 constexpr key-equiv(key_compare c) : comp(c) { }
302 constexpr bool operator()(const_reference x, const_reference y) const {
303 return !comp(x.first, y.first) && !comp(y.first, x.first);
304 }
305 key_compare comp;
306 };
307 };
308
309 template<class KeyContainer, class MappedContainer,
310 class Compare = less<typename KeyContainer::value_type>>
311 flat_map(KeyContainer, MappedContainer, Compare = Compare())
312 -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type,
313 Compare, KeyContainer, MappedContainer>;
314
315 template<class KeyContainer, class MappedContainer, class Allocator>
316 flat_map(KeyContainer, MappedContainer, Allocator)
317 -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type,
318 less<typename KeyContainer::value_type>, KeyContainer, MappedContainer>;
319 template<class KeyContainer, class MappedContainer, class Compare, class Allocator>
320 flat_map(KeyContainer, MappedContainer, Compare, Allocator)
321 -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type,
322 Compare, KeyContainer, MappedContainer>;
323
324 template<class KeyContainer, class MappedContainer,
325 class Compare = less<typename KeyContainer::value_type>>
326 flat_map(sorted_unique_t, KeyContainer, MappedContainer, Compare = Compare())
327 -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type,
328 Compare, KeyContainer, MappedContainer>;
329
330 template<class KeyContainer, class MappedContainer, class Allocator>
331 flat_map(sorted_unique_t, KeyContainer, MappedContainer, Allocator)
332 -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type,
333 less<typename KeyContainer::value_type>, KeyContainer, MappedContainer>;
334 template<class KeyContainer, class MappedContainer, class Compare, class Allocator>
335 flat_map(sorted_unique_t, KeyContainer, MappedContainer, Compare, Allocator)
336 -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type,
337 Compare, KeyContainer, MappedContainer>;
338
339 template<class InputIterator, class Compare = less<iter-key-type<InputIterator>>>
340 flat_map(InputIterator, InputIterator, Compare = Compare())
341 -> flat_map<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>, Compare>;
342
343 template<class InputIterator, class Compare = less<iter-key-type<InputIterator>>>
344 flat_map(sorted_unique_t, InputIterator, InputIterator, Compare = Compare())
345 -> flat_map<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>, Compare>;
346
347 template<ranges::input_range R, class Compare = less<range-key-type<R>>,
348 class Allocator = allocator<byte>>
349 flat_map(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
350 -> flat_map<range-key-type<R>, range-mapped-type<R>, Compare,
351 vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>>,
352 vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>>;
353
354 template<ranges::input_range R, class Allocator>
355 flat_map(from_range_t, R&&, Allocator)
356 -> flat_map<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>,
357 vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>>,
358 vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>>;
359
360 template<class Key, class T, class Compare = less<Key>>
361 flat_map(initializer_list<pair<Key, T>>, Compare = Compare())
362 -> flat_map<Key, T, Compare>;
363
364 template<class Key, class T, class Compare = less<Key>>
365 flat_map(sorted_unique_t, initializer_list<pair<Key, T>>, Compare = Compare())
366 -> flat_map<Key, T, Compare>;
27367
28 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,368 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,
29 class Allocator>369 class Allocator>
30 struct uses_allocator<flat_map<Key, T, Compare, KeyContainer, MappedContainer>,370 struct uses_allocator<flat_map<Key, T, Compare, KeyContainer, MappedContainer>, Allocator>
31 Allocator>;371 : bool_constant<uses_allocator_v<KeyContainer, Allocator> &&
372 uses_allocator_v<MappedContainer, Allocator>> { };
32373
33 // [flat.map.erasure], erasure for flat_map374 // [flat.map.erasure], erasure for flat_map
34 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,375 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,
...@@ -36,18 +377,329 @@ namespace std {...@@ -36,18 +377,329 @@ namespace std {
36 typename flat_map<Key, T, Compare, KeyContainer, MappedContainer>::size_type377 typename flat_map<Key, T, Compare, KeyContainer, MappedContainer>::size_type
37 erase_if(flat_map<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred);378 erase_if(flat_map<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred);
38379
380 struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; };
381 inline constexpr sorted_equivalent_t sorted_equivalent{};
382
39 // [flat.multimap], class template flat_multimap383 // [flat.multimap], class template flat_multimap
40 template<class Key, class T, class Compare = less<Key>,384 template<class Key, class T, class Compare = less<Key>,
41 class KeyContainer = vector<Key>, class MappedContainer = vector<T>>385 class KeyContainer = vector<Key>, class MappedContainer = vector<T>>
42 class flat_multimap;386 class flat_multimap {
387 public:
388 // types
389 using key_type = Key;
390 using mapped_type = T;
391 using value_type = pair<key_type, mapped_type>;
392 using key_compare = Compare;
393 using reference = pair<const key_type&, mapped_type&>;
394 using const_reference = pair<const key_type&, const mapped_type&>;
395 using size_type = size_t;
396 using difference_type = ptrdiff_t;
397 using iterator = implementation-defined; // see [container.requirements]
398 using const_iterator = implementation-defined; // see [container.requirements]
399 using reverse_iterator = std::reverse_iterator<iterator>;
400 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
401 using key_container_type = KeyContainer;
402 using mapped_container_type = MappedContainer;
43403
44 struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; };404 class value_compare {
45 inline constexpr sorted_equivalent_t sorted_equivalent{};405 private:
406 key_compare comp; // exposition only
407 constexpr value_compare(key_compare c) : comp(c) { } // exposition only
408
409 public:
410 constexpr bool operator()(const_reference x, const_reference y) const {
411 return comp(x.first, y.first);
412 }
413 };
414
415 struct containers {
416 key_container_type keys;
417 mapped_container_type values;
418 };
419
420 // [flat.multimap.cons], constructors
421 constexpr flat_multimap() : flat_multimap(key_compare()) { }
422
423 constexpr flat_multimap(const flat_multimap&);
424 constexpr flat_multimap(flat_multimap&&);
425 constexpr flat_multimap& operator=(const flat_multimap&);
426 constexpr flat_multimap& operator=(flat_multimap&&);
427
428 constexpr explicit flat_multimap(const key_compare& comp)
429 : c(), compare(comp) { }
430
431 constexpr flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont,
432 const key_compare& comp = key_compare());
433
434 constexpr flat_multimap(sorted_equivalent_t,
435 key_container_type key_cont, mapped_container_type mapped_cont,
436 const key_compare& comp = key_compare());
437
438 template<class InputIterator>
439 constexpr flat_multimap(InputIterator first, InputIterator last,
440 const key_compare& comp = key_compare())
441 : c(), compare(comp)
442 { insert(first, last); }
443
444 template<class InputIterator>
445 constexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last,
446 const key_compare& comp = key_compare())
447 : c(), compare(comp) { insert(sorted_equivalent, first, last); }
448
449 template<container-compatible-range<value_type> R>
450 constexpr flat_multimap(from_range_t, R&& rg)
451 : flat_multimap(from_range, std::forward<R>(rg), key_compare()) { }
452 template<container-compatible-range<value_type> R>
453 constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp)
454 : flat_multimap(comp) { insert_range(std::forward<R>(rg)); }
455
456 constexpr flat_multimap(initializer_list<value_type> il,
457 const key_compare& comp = key_compare())
458 : flat_multimap(il.begin(), il.end(), comp) { }
459
460 constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il,
461 const key_compare& comp = key_compare())
462 : flat_multimap(sorted_equivalent, il.begin(), il.end(), comp) { }
463
464 // [flat.multimap.cons.alloc], constructors with allocators
465
466 template<class Alloc>
467 constexpr explicit flat_multimap(const Alloc& a);
468 template<class Alloc>
469 constexpr flat_multimap(const key_compare& comp, const Alloc& a);
470 template<class Alloc>
471 constexpr flat_multimap(const key_container_type& key_cont,
472 const mapped_container_type& mapped_cont, const Alloc& a);
473 template<class Alloc>
474 constexpr flat_multimap(const key_container_type& key_cont,
475 const mapped_container_type& mapped_cont,
476 const key_compare& comp, const Alloc& a);
477 template<class Alloc>
478 constexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont,
479 const mapped_container_type& mapped_cont, const Alloc& a);
480 template<class Alloc>
481 constexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont,
482 const mapped_container_type& mapped_cont,
483 const key_compare& comp, const Alloc& a);
484 template<class Alloc>
485 constexpr flat_multimap(const flat_multimap&, const Alloc& a);
486 template<class Alloc>
487 constexpr flat_multimap(flat_multimap&&, const Alloc& a);
488 template<class InputIterator, class Alloc>
489 constexpr flat_multimap(InputIterator first, InputIterator last, const Alloc& a);
490 template<class InputIterator, class Alloc>
491 constexpr flat_multimap(InputIterator first, InputIterator last,
492 const key_compare& comp, const Alloc& a);
493 template<class InputIterator, class Alloc>
494 constexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last,
495 const Alloc& a);
496 template<class InputIterator, class Alloc>
497 constexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last,
498 const key_compare& comp, const Alloc& a);
499 template<container-compatible-range<value_type> R, class Alloc>
500 constexpr flat_multimap(from_range_t, R&& rg, const Alloc& a);
501 template<container-compatible-range<value_type> R, class Alloc>
502 constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
503 template<class Alloc>
504 constexpr flat_multimap(initializer_list<value_type> il, const Alloc& a);
505 template<class Alloc>
506 constexpr flat_multimap(initializer_list<value_type> il, const key_compare& comp,
507 const Alloc& a);
508 template<class Alloc>
509 constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il,
510 const Alloc& a);
511 template<class Alloc>
512 constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il,
513 const key_compare& comp, const Alloc& a);
514
515 flat_multimap& operator=(initializer_list<value_type>);
516
517 // iterators
518 constexpr iterator begin() noexcept;
519 constexpr const_iterator begin() const noexcept;
520 constexpr iterator end() noexcept;
521 constexpr const_iterator end() const noexcept;
522
523 constexpr reverse_iterator rbegin() noexcept;
524 constexpr const_reverse_iterator rbegin() const noexcept;
525 constexpr reverse_iterator rend() noexcept;
526 constexpr const_reverse_iterator rend() const noexcept;
527
528 constexpr const_iterator cbegin() const noexcept;
529 constexpr const_iterator cend() const noexcept;
530 constexpr const_reverse_iterator crbegin() const noexcept;
531 constexpr const_reverse_iterator crend() const noexcept;
532
533 // capacity
534 constexpr bool empty() const noexcept;
535 constexpr size_type size() const noexcept;
536 constexpr size_type max_size() const noexcept;
537
538 // modifiers
539 template<class... Args> constexpr iterator emplace(Args&&... args);
540 template<class... Args>
541 constexpr iterator emplace_hint(const_iterator position, Args&&... args);
542
543 constexpr iterator insert(const value_type& x)
544 { return emplace(x); }
545 constexpr iterator insert(value_type&& x)
546 { return emplace(std::move(x)); }
547 constexpr iterator insert(const_iterator position, const value_type& x)
548 { return emplace_hint(position, x); }
549 constexpr iterator insert(const_iterator position, value_type&& x)
550 { return emplace_hint(position, std::move(x)); }
551
552 template<class P> constexpr iterator insert(P&& x);
553 template<class P>
554 constexpr iterator insert(const_iterator position, P&&);
555 template<class InputIterator>
556 constexpr void insert(InputIterator first, InputIterator last);
557 template<class InputIterator>
558 constexpr void insert(sorted_equivalent_t, InputIterator first, InputIterator last);
559 template<container-compatible-range<value_type> R>
560 constexpr void insert_range(R&& rg);
561 template<container-compatible-range<value_type> R>
562 constexpr void insert_range(sorted_equivalent_t, R&& rg);
563
564 constexpr void insert(initializer_list<value_type> il)
565 { insert(il.begin(), il.end()); }
566 constexpr void insert(sorted_equivalent_t, initializer_list<value_type> il)
567 { insert(sorted_equivalent, il.begin(), il.end()); }
568
569 constexpr containers extract() &&;
570 constexpr void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont);
571
572 constexpr iterator erase(iterator position);
573 constexpr iterator erase(const_iterator position);
574 constexpr size_type erase(const key_type& x);
575 template<class K> constexpr size_type erase(K&& x);
576 constexpr iterator erase(const_iterator first, const_iterator last);
577
578 constexpr void swap(flat_multimap&)
579 noexcept(is_nothrow_swappable_v<key_container_type> &&
580 is_nothrow_swappable_v<mapped_container_type> &&
581 is_nothrow_swappable_v<key_compare>);
582 constexpr void clear() noexcept;
583
584 // observers
585 constexpr key_compare key_comp() const;
586 constexpr value_compare value_comp() const;
587
588 constexpr const key_container_type& keys() const noexcept { return c.keys; }
589 constexpr const mapped_container_type& values() const noexcept { return c.values; }
590
591 // map operations
592 constexpr iterator find(const key_type& x);
593 constexpr const_iterator find(const key_type& x) const;
594 template<class K> constexpr iterator find(const K& x);
595 template<class K> constexpr const_iterator find(const K& x) const;
596
597 constexpr size_type count(const key_type& x) const;
598 template<class K> constexpr size_type count(const K& x) const;
599
600 constexpr bool contains(const key_type& x) const;
601 template<class K> constexpr bool contains(const K& x) const;
602
603 constexpr iterator lower_bound(const key_type& x);
604 constexpr const_iterator lower_bound(const key_type& x) const;
605 template<class K> constexpr iterator lower_bound(const K& x);
606 template<class K> constexpr const_iterator lower_bound(const K& x) const;
607
608 constexpr iterator upper_bound(const key_type& x);
609 constexpr const_iterator upper_bound(const key_type& x) const;
610 template<class K> constexpr iterator upper_bound(const K& x);
611 template<class K> constexpr const_iterator upper_bound(const K& x) const;
612
613 constexpr pair<iterator, iterator> equal_range(const key_type& x);
614 constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
615 template<class K>
616 constexpr pair<iterator, iterator> equal_range(const K& x);
617 template<class K>
618 constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
619
620 friend constexpr bool operator==(const flat_multimap& x, const flat_multimap& y);
621
622 friend constexpr synth-three-way-result<value_type>
623 operator<=>(const flat_multimap& x, const flat_multimap& y);
624
625 friend constexpr void swap(flat_multimap& x, flat_multimap& y)
626 noexcept(noexcept(x.swap(y)))
627 { x.swap(y); }
628
629 private:
630 containers c; // exposition only
631 key_compare compare; // exposition only
632 };
633
634 template<class KeyContainer, class MappedContainer,
635 class Compare = less<typename KeyContainer::value_type>>
636 flat_multimap(KeyContainer, MappedContainer, Compare = Compare())
637 -> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
638 Compare, KeyContainer, MappedContainer>;
639
640 template<class KeyContainer, class MappedContainer, class Allocator>
641 flat_multimap(KeyContainer, MappedContainer, Allocator)
642 -> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
643 less<typename KeyContainer::value_type>, KeyContainer, MappedContainer>;
644 template<class KeyContainer, class MappedContainer, class Compare, class Allocator>
645 flat_multimap(KeyContainer, MappedContainer, Compare, Allocator)
646 -> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
647 Compare, KeyContainer, MappedContainer>;
648
649 template<class KeyContainer, class MappedContainer,
650 class Compare = less<typename KeyContainer::value_type>>
651 flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare = Compare())
652 -> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
653 Compare, KeyContainer, MappedContainer>;
654
655 template<class KeyContainer, class MappedContainer, class Allocator>
656 flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Allocator)
657 -> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
658 less<typename KeyContainer::value_type>, KeyContainer, MappedContainer>;
659 template<class KeyContainer, class MappedContainer, class Compare, class Allocator>
660 flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare, Allocator)
661 -> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
662 Compare, KeyContainer, MappedContainer>;
663
664 template<class InputIterator, class Compare = less<iter-key-type<InputIterator>>>
665 flat_multimap(InputIterator, InputIterator, Compare = Compare())
666 -> flat_multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>, Compare>;
667
668 template<class InputIterator, class Compare = less<iter-key-type<InputIterator>>>
669 flat_multimap(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare())
670 -> flat_multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>, Compare>;
671
672 template<ranges::input_range R, class Compare = less<range-key-type<R>>,
673 class Allocator = allocator<byte>>
674 flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
675 -> flat_multimap<range-key-type<R>, range-mapped-type<R>, Compare,
676 vector<range-key-type<R>,
677 alloc-rebind<Allocator, range-key-type<R>>>,
678 vector<range-mapped-type<R>,
679 alloc-rebind<Allocator, range-mapped-type<R>>>>;
680
681 template<ranges::input_range R, class Allocator>
682 flat_multimap(from_range_t, R&&, Allocator)
683 -> flat_multimap<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>,
684 vector<range-key-type<R>,
685 alloc-rebind<Allocator, range-key-type<R>>>,
686 vector<range-mapped-type<R>,
687 alloc-rebind<Allocator, range-mapped-type<R>>>>;
688
689 template<class Key, class T, class Compare = less<Key>>
690 flat_multimap(initializer_list<pair<Key, T>>, Compare = Compare())
691 -> flat_multimap<Key, T, Compare>;
692
693 template<class Key, class T, class Compare = less<Key>>
694 flat_multimap(sorted_equivalent_t, initializer_list<pair<Key, T>>, Compare = Compare())
695 -> flat_multimap<Key, T, Compare>;
46696
47 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,697 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,
48 class Allocator>698 class Allocator>
49 struct uses_allocator<flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>,699 struct uses_allocator<flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>,
50 Allocator>;700 Allocator>
701 : bool_constant<uses_allocator_v<KeyContainer, Allocator> &&
702 uses_allocator_v<MappedContainer, Allocator>> { };
51703
52 // [flat.multimap.erasure], erasure for flat_multimap704 // [flat.multimap.erasure], erasure for flat_multimap
53 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,705 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,
lib/libcxx/include/flat_set+543-8
...@@ -17,30 +17,565 @@...@@ -17,30 +17,565 @@
17#include <initializer_list> // see [initializer.list.syn]17#include <initializer_list> // see [initializer.list.syn]
1818
19namespace std {19namespace std {
20 struct sorted_unique_t { explicit sorted_unique_t() = default; };
21 inline constexpr sorted_unique_t sorted_unique{};
22
20 // [flat.set], class template flat_set23 // [flat.set], class template flat_set
21 template<class Key, class Compare = less<Key>, class KeyContainer = vector<Key>>24 template<class Key, class Compare = less<Key>, class KeyContainer = vector<Key>>
22 class flat_set;25 class flat_set {
26 public:
27 // types
28 using key_type = Key;
29 using value_type = Key;
30 using key_compare = Compare;
31 using value_compare = Compare;
32 using reference = value_type&;
33 using const_reference = const value_type&;
34 using size_type = KeyContainer::size_type;
35 using difference_type = KeyContainer::difference_type;
36 using iterator = implementation-defined; // see [container.requirements]
37 using const_iterator = implementation-defined; // see [container.requirements]
38 using reverse_iterator = std::reverse_iterator<iterator>;
39 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
40 using container_type = KeyContainer;
2341
24 struct sorted_unique_t { explicit sorted_unique_t() = default; };42 // [flat.set.cons], constructors
25 inline constexpr sorted_unique_t sorted_unique{};43 constexpr flat_set() : flat_set(key_compare()) { }
44
45 constexpr flat_set(const flat_set&);
46 constexpr flat_set(flat_set&&);
47 constexpr flat_set& operator=(const flat_set&);
48 constexpr flat_set& operator=(flat_set&&);
49
50 constexpr explicit flat_set(const key_compare& comp)
51 : c(), compare(comp) { }
52
53 constexpr explicit flat_set(container_type cont, const key_compare& comp = key_compare());
54
55 constexpr flat_set(sorted_unique_t, container_type cont,
56 const key_compare& comp = key_compare())
57 : c(std::move(cont)), compare(comp) { }
58
59 template<class InputIterator>
60 constexpr flat_set(InputIterator first, InputIterator last,
61 const key_compare& comp = key_compare())
62 : c(), compare(comp)
63 { insert(first, last); }
64
65 template<class InputIterator>
66 constexpr flat_set(sorted_unique_t, InputIterator first, InputIterator last,
67 const key_compare& comp = key_compare())
68 : c(first, last), compare(comp) { }
69
70 template<container-compatible-range<value_type> R>
71 constexpr flat_set(from_range_t, R&& rg)
72 : flat_set(from_range, std::forward<R>(rg), key_compare()) { }
73 template<container-compatible-range<value_type> R>
74 constexpr flat_set(from_range_t, R&& rg, const key_compare& comp)
75 : flat_set(comp)
76 { insert_range(std::forward<R>(rg)); }
77
78 constexpr flat_set(initializer_list<value_type> il, const key_compare& comp = key_compare())
79 : flat_set(il.begin(), il.end(), comp) { }
80
81 constexpr flat_set(sorted_unique_t, initializer_list<value_type> il,
82 const key_compare& comp = key_compare())
83 : flat_set(sorted_unique, il.begin(), il.end(), comp) { }
84
85 // [flat.set.cons.alloc], constructors with allocators
86
87 template<class Alloc>
88 constexpr explicit flat_set(const Alloc& a);
89 template<class Alloc>
90 constexpr flat_set(const key_compare& comp, const Alloc& a);
91 template<class Alloc>
92 constexpr flat_set(const container_type& cont, const Alloc& a);
93 template<class Alloc>
94 constexpr flat_set(const container_type& cont, const key_compare& comp, const Alloc& a);
95 template<class Alloc>
96 constexpr flat_set(sorted_unique_t, const container_type& cont, const Alloc& a);
97 template<class Alloc>
98 constexpr flat_set(sorted_unique_t, const container_type& cont,
99 const key_compare& comp, const Alloc& a);
100 template<class Alloc>
101 constexpr flat_set(const flat_set&, const Alloc& a);
102 template<class Alloc>
103 constexpr flat_set(flat_set&&, const Alloc& a);
104 template<class InputIterator, class Alloc>
105 constexpr flat_set(InputIterator first, InputIterator last, const Alloc& a);
106 template<class InputIterator, class Alloc>
107 constexpr flat_set(InputIterator first, InputIterator last,
108 const key_compare& comp, const Alloc& a);
109 template<class InputIterator, class Alloc>
110 constexpr flat_set(sorted_unique_t, InputIterator first, InputIterator last,
111 const Alloc& a);
112 template<class InputIterator, class Alloc>
113 constexpr flat_set(sorted_unique_t, InputIterator first, InputIterator last,
114 const key_compare& comp, const Alloc& a);
115 template<container-compatible-range<value_type> R, class Alloc>
116 constexpr flat_set(from_range_t, R&& rg, const Alloc& a);
117 template<container-compatible-range<value_type> R, class Alloc>
118 constexpr flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
119 template<class Alloc>
120 constexpr flat_set(initializer_list<value_type> il, const Alloc& a);
121 template<class Alloc>
122 constexpr flat_set(initializer_list<value_type> il, const key_compare& comp,
123 const Alloc& a);
124 template<class Alloc>
125 constexpr flat_set(sorted_unique_t, initializer_list<value_type> il, const Alloc& a);
126 template<class Alloc>
127 constexpr flat_set(sorted_unique_t, initializer_list<value_type> il,
128 const key_compare& comp, const Alloc& a);
129
130 constexpr flat_set& operator=(initializer_list<value_type>);
131
132 // iterators
133 constexpr iterator begin() noexcept;
134 constexpr const_iterator begin() const noexcept;
135 constexpr iterator end() noexcept;
136 constexpr const_iterator end() const noexcept;
137
138 constexpr reverse_iterator rbegin() noexcept;
139 constexpr const_reverse_iterator rbegin() const noexcept;
140 constexpr reverse_iterator rend() noexcept;
141 constexpr const_reverse_iterator rend() const noexcept;
142
143 constexpr const_iterator cbegin() const noexcept;
144 constexpr const_iterator cend() const noexcept;
145 constexpr const_reverse_iterator crbegin() const noexcept;
146 constexpr const_reverse_iterator crend() const noexcept;
147
148 // capacity
149 constexpr bool empty() const noexcept;
150 constexpr size_type size() const noexcept;
151 constexpr size_type max_size() const noexcept;
152
153 // [flat.set.modifiers], modifiers
154 template<class... Args> constexpr pair<iterator, bool> emplace(Args&&... args);
155 template<class... Args>
156 constexpr iterator emplace_hint(const_iterator position, Args&&... args);
157
158 constexpr pair<iterator, bool> insert(const value_type& x)
159 { return emplace(x); }
160 constexpr pair<iterator, bool> insert(value_type&& x)
161 { return emplace(std::move(x)); }
162 template<class K> constexpr pair<iterator, bool> insert(K&& x);
163 constexpr iterator insert(const_iterator position, const value_type& x)
164 { return emplace_hint(position, x); }
165 constexpr iterator insert(const_iterator position, value_type&& x)
166 { return emplace_hint(position, std::move(x)); }
167 template<class K> constexpr iterator insert(const_iterator hint, K&& x);
168
169 template<class InputIterator>
170 constexpr void insert(InputIterator first, InputIterator last);
171 template<class InputIterator>
172 constexpr void insert(sorted_unique_t, InputIterator first, InputIterator last);
173 template<container-compatible-range<value_type> R>
174 constexpr void insert_range(R&& rg);
175 template<container-compatible-range<value_type> R>
176 constexpr void insert_range(sorted_unique_t, R&& rg);
177
178 constexpr void insert(initializer_list<value_type> il)
179 { insert(il.begin(), il.end()); }
180 constexpr void insert(sorted_unique_t, initializer_list<value_type> il)
181 { insert(sorted_unique, il.begin(), il.end()); }
182
183 constexpr container_type extract() &&;
184 constexpr void replace(container_type&&);
185
186 constexpr iterator erase(iterator position) requires (!same_as<iterator, const_iterator>);
187 constexpr iterator erase(const_iterator position);
188 constexpr size_type erase(const key_type& x);
189 template<class K> constexpr size_type erase(K&& x);
190 constexpr iterator erase(const_iterator first, const_iterator last);
191
192 constexpr void swap(flat_set& y) noexcept(see below);
193 constexpr void clear() noexcept;
194
195 // observers
196 constexpr key_compare key_comp() const;
197 constexpr value_compare value_comp() const;
198
199 // set operations
200 constexpr iterator find(const key_type& x);
201 constexpr const_iterator find(const key_type& x) const;
202 template<class K> constexpr iterator find(const K& x);
203 template<class K> constexpr const_iterator find(const K& x) const;
204
205 constexpr size_type count(const key_type& x) const;
206 template<class K> constexpr size_type count(const K& x) const;
207
208 constexpr bool contains(const key_type& x) const;
209 template<class K> constexpr bool contains(const K& x) const;
210
211 constexpr iterator lower_bound(const key_type& x);
212 constexpr const_iterator lower_bound(const key_type& x) const;
213 template<class K> constexpr iterator lower_bound(const K& x);
214 template<class K> constexpr const_iterator lower_bound(const K& x) const;
215
216 constexpr iterator upper_bound(const key_type& x);
217 constexpr const_iterator upper_bound(const key_type& x) const;
218 template<class K> constexpr iterator upper_bound(const K& x);
219 template<class K> constexpr const_iterator upper_bound(const K& x) const;
220
221 constexpr pair<iterator, iterator> equal_range(const key_type& x);
222 constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
223 template<class K>
224 constexpr pair<iterator, iterator> equal_range(const K& x);
225 template<class K>
226 constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
227
228 friend constexpr bool operator==(const flat_set& x, const flat_set& y);
229
230 friend constexpr synth-three-way-result<value_type>
231 operator<=>(const flat_set& x, const flat_set& y);
232
233 friend constexpr void swap(flat_set& x, flat_set& y) noexcept(noexcept(x.swap(y)))
234 { x.swap(y); }
235
236 private:
237 container_type c; // exposition only
238 key_compare compare; // exposition only
239 };
240
241 template<class KeyContainer, class Compare = less<typename KeyContainer::value_type>>
242 flat_set(KeyContainer, Compare = Compare())
243 -> flat_set<typename KeyContainer::value_type, Compare, KeyContainer>;
244 template<class KeyContainer, class Allocator>
245 flat_set(KeyContainer, Allocator)
246 -> flat_set<typename KeyContainer::value_type,
247 less<typename KeyContainer::value_type>, KeyContainer>;
248 template<class KeyContainer, class Compare, class Allocator>
249 flat_set(KeyContainer, Compare, Allocator)
250 -> flat_set<typename KeyContainer::value_type, Compare, KeyContainer>;
251
252 template<class KeyContainer, class Compare = less<typename KeyContainer::value_type>>
253 flat_set(sorted_unique_t, KeyContainer, Compare = Compare())
254 -> flat_set<typename KeyContainer::value_type, Compare, KeyContainer>;
255 template<class KeyContainer, class Allocator>
256 flat_set(sorted_unique_t, KeyContainer, Allocator)
257 -> flat_set<typename KeyContainer::value_type,
258 less<typename KeyContainer::value_type>, KeyContainer>;
259 template<class KeyContainer, class Compare, class Allocator>
260 flat_set(sorted_unique_t, KeyContainer, Compare, Allocator)
261 -> flat_set<typename KeyContainer::value_type, Compare, KeyContainer>;
262
263 template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
264 flat_set(InputIterator, InputIterator, Compare = Compare())
265 -> flat_set<iter-value-type<InputIterator>, Compare>;
266
267 template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
268 flat_set(sorted_unique_t, InputIterator, InputIterator, Compare = Compare())
269 -> flat_set<iter-value-type<InputIterator>, Compare>;
270
271 template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
272 class Allocator = allocator<ranges::range_value_t<R>>>
273 flat_set(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
274 -> flat_set<ranges::range_value_t<R>, Compare,
275 vector<ranges::range_value_t<R>,
276 alloc-rebind<Allocator, ranges::range_value_t<R>>>>;
277
278 template<ranges::input_range R, class Allocator>
279 flat_set(from_range_t, R&&, Allocator)
280 -> flat_set<ranges::range_value_t<R>, less<ranges::range_value_t<R>>,
281 vector<ranges::range_value_t<R>,
282 alloc-rebind<Allocator, ranges::range_value_t<R>>>>;
283
284 template<class Key, class Compare = less<Key>>
285 flat_set(initializer_list<Key>, Compare = Compare())
286 -> flat_set<Key, Compare>;
287
288 template<class Key, class Compare = less<Key>>
289 flat_set(sorted_unique_t, initializer_list<Key>, Compare = Compare())
290 -> flat_set<Key, Compare>;
26291
27 template<class Key, class Compare, class KeyContainer, class Allocator>292 template<class Key, class Compare, class KeyContainer, class Allocator>
28 struct uses_allocator<flat_set<Key, Compare, KeyContainer>, Allocator>;293 struct uses_allocator<flat_set<Key, Compare, KeyContainer>, Allocator>
294 : bool_constant<uses_allocator_v<KeyContainer, Allocator>> { };
29295
30 // [flat.set.erasure], erasure for flat_set296 // [flat.set.erasure], erasure for flat_set
31 template<class Key, class Compare, class KeyContainer, class Predicate>297 template<class Key, class Compare, class KeyContainer, class Predicate>
32 typename flat_set<Key, Compare, KeyContainer>::size_type298 typename flat_set<Key, Compare, KeyContainer>::size_type
33 erase_if(flat_set<Key, Compare, KeyContainer>& c, Predicate pred);299 erase_if(flat_set<Key, Compare, KeyContainer>& c, Predicate pred);
34300
301 struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; };
302 inline constexpr sorted_equivalent_t sorted_equivalent{};
303
35 // [flat.multiset], class template flat_multiset304 // [flat.multiset], class template flat_multiset
36 template<class Key, class Compare = less<Key>, class KeyContainer = vector<Key>>305 template<class Key, class Compare = less<Key>, class KeyContainer = vector<Key>>
37 class flat_multiset;306 class flat_multiset {
307 public:
308 // types
309 using key_type = Key;
310 using value_type = Key;
311 using key_compare = Compare;
312 using value_compare = Compare;
313 using reference = value_type&;
314 using const_reference = const value_type&;
315 using size_type = KeyContainer::size_type;
316 using difference_type = KeyContainer::difference_type;
317 using iterator = implementation-defined; // see [container.requirements]
318 using const_iterator = implementation-defined; // see [container.requirements]
319 using reverse_iterator = std::reverse_iterator<iterator>;
320 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
321 using container_type = KeyContainer;
38322
39 struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; };323 // [flat.multiset.cons], constructors
40 inline constexpr sorted_equivalent_t sorted_equivalent{};324 constexpr flat_multiset() : flat_multiset(key_compare()) { }
325
326 constexpr flat_multiset(const flat_multiset&);
327 constexpr flat_multiset(flat_multiset&&);
328 constexpr flat_multiset& operator=(const flat_multiset&);
329 constexpr flat_multiset& operator=(flat_multiset&&);
330
331 constexpr explicit flat_multiset(const key_compare& comp)
332 : c(), compare(comp) { }
333
334 constexpr explicit flat_multiset(container_type cont,
335 const key_compare& comp = key_compare());
336
337 constexpr flat_multiset(sorted_equivalent_t, container_type cont,
338 const key_compare& comp = key_compare())
339 : c(std::move(cont)), compare(comp) { }
340
341 template<class InputIterator>
342 constexpr flat_multiset(InputIterator first, InputIterator last,
343 const key_compare& comp = key_compare())
344 : c(), compare(comp)
345 { insert(first, last); }
346
347 template<class InputIterator>
348 constexpr flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
349 const key_compare& comp = key_compare())
350 : c(first, last), compare(comp) { }
351
352 template<container-compatible-range<value_type> R>
353 constexpr flat_multiset(from_range_t, R&& rg)
354 : flat_multiset(from_range, std::forward<R>(rg), key_compare()) { }
355 template<container-compatible-range<value_type> R>
356 constexpr flat_multiset(from_range_t, R&& rg, const key_compare& comp)
357 : flat_multiset(comp)
358 { insert_range(std::forward<R>(rg)); }
359
360 constexpr flat_multiset(initializer_list<value_type> il,
361 const key_compare& comp = key_compare())
362 : flat_multiset(il.begin(), il.end(), comp) { }
363
364 constexpr flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
365 const key_compare& comp = key_compare())
366 : flat_multiset(sorted_equivalent, il.begin(), il.end(), comp) { }
367
368 // [flat.multiset.cons.alloc], constructors with allocators
369
370 template<class Alloc>
371 constexpr explicit flat_multiset(const Alloc& a);
372 template<class Alloc>
373 constexpr flat_multiset(const key_compare& comp, const Alloc& a);
374 template<class Alloc>
375 constexpr flat_multiset(const container_type& cont, const Alloc& a);
376 template<class Alloc>
377 constexpr flat_multiset(const container_type& cont, const key_compare& comp,
378 const Alloc& a);
379 template<class Alloc>
380 constexpr flat_multiset(sorted_equivalent_t, const container_type& cont, const Alloc& a);
381 template<class Alloc>
382 constexpr flat_multiset(sorted_equivalent_t, const container_type& cont,
383 const key_compare& comp, const Alloc& a);
384 template<class Alloc>
385 constexpr flat_multiset(const flat_multiset&, const Alloc& a);
386 template<class Alloc>
387 constexpr flat_multiset(flat_multiset&&, const Alloc& a);
388 template<class InputIterator, class Alloc>
389 constexpr flat_multiset(InputIterator first, InputIterator last, const Alloc& a);
390 template<class InputIterator, class Alloc>
391 constexpr flat_multiset(InputIterator first, InputIterator last,
392 const key_compare& comp, const Alloc& a);
393 template<class InputIterator, class Alloc>
394 constexpr flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
395 const Alloc& a);
396 template<class InputIterator, class Alloc>
397 constexpr flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
398 const key_compare& comp, const Alloc& a);
399 template<container-compatible-range<value_type> R, class Alloc>
400 constexpr flat_multiset(from_range_t, R&& rg, const Alloc& a);
401 template<container-compatible-range<value_type> R, class Alloc>
402 constexpr flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
403 template<class Alloc>
404 constexpr flat_multiset(initializer_list<value_type> il, const Alloc& a);
405 template<class Alloc>
406 constexpr flat_multiset(initializer_list<value_type> il, const key_compare& comp,
407 const Alloc& a);
408 template<class Alloc>
409 constexpr flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
410 const Alloc& a);
411 template<class Alloc>
412 constexpr flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
413 const key_compare& comp, const Alloc& a);
414
415 constexpr flat_multiset& operator=(initializer_list<value_type>);
416
417 // iterators
418 constexpr iterator begin() noexcept;
419 constexpr const_iterator begin() const noexcept;
420 constexpr iterator end() noexcept;
421 constexpr const_iterator end() const noexcept;
422
423 constexpr reverse_iterator rbegin() noexcept;
424 constexpr const_reverse_iterator rbegin() const noexcept;
425 constexpr reverse_iterator rend() noexcept;
426 constexpr const_reverse_iterator rend() const noexcept;
427
428 constexpr const_iterator cbegin() const noexcept;
429 constexpr const_iterator cend() const noexcept;
430 constexpr const_reverse_iterator crbegin() const noexcept;
431 constexpr const_reverse_iterator crend() const noexcept;
432
433 // capacity
434 constexpr bool empty() const noexcept;
435 constexpr size_type size() const noexcept;
436 constexpr size_type max_size() const noexcept;
437
438 // [flat.multiset.modifiers], modifiers
439 template<class... Args> constexpr iterator emplace(Args&&... args);
440 template<class... Args>
441 constexpr iterator emplace_hint(const_iterator position, Args&&... args);
442
443 constexpr iterator insert(const value_type& x)
444 { return emplace(x); }
445 constexpr iterator insert(value_type&& x)
446 { return emplace(std::move(x)); }
447 constexpr iterator insert(const_iterator position, const value_type& x)
448 { return emplace_hint(position, x); }
449 constexpr iterator insert(const_iterator position, value_type&& x)
450 { return emplace_hint(position, std::move(x)); }
451
452 template<class InputIterator>
453 constexpr void insert(InputIterator first, InputIterator last);
454 template<class InputIterator>
455 constexpr void insert(sorted_equivalent_t, InputIterator first, InputIterator last);
456 template<container-compatible-range<value_type> R>
457 constexpr void insert_range(R&& rg);
458 template<container-compatible-range<value_type> R>
459 constexpr void insert_range(sorted_equivalent_t, R&& rg);
460
461 constexpr void insert(initializer_list<value_type> il)
462 { insert(il.begin(), il.end()); }
463 constexpr void insert(sorted_equivalent_t, initializer_list<value_type> il)
464 { insert(sorted_equivalent, il.begin(), il.end()); }
465
466 constexpr container_type extract() &&;
467 constexpr void replace(container_type&&);
468
469 constexpr iterator erase(iterator position) requires (!same_as<iterator, const_iterator>);
470 constexpr iterator erase(const_iterator position);
471 constexpr size_type erase(const key_type& x);
472 template<class K> constexpr size_type erase(K&& x);
473 constexpr iterator erase(const_iterator first, const_iterator last);
474
475 constexpr void swap(flat_multiset& y) noexcept(see below);
476 constexpr void clear() noexcept;
477
478 // observers
479 constexpr key_compare key_comp() const;
480 constexpr value_compare value_comp() const;
481
482 // set operations
483 constexpr iterator find(const key_type& x);
484 constexpr const_iterator find(const key_type& x) const;
485 template<class K> constexpr iterator find(const K& x);
486 template<class K> constexpr const_iterator find(const K& x) const;
487
488 constexpr size_type count(const key_type& x) const;
489 template<class K> constexpr size_type count(const K& x) const;
490
491 constexpr bool contains(const key_type& x) const;
492 template<class K> constexpr bool contains(const K& x) const;
493
494 constexpr iterator lower_bound(const key_type& x);
495 constexpr const_iterator lower_bound(const key_type& x) const;
496 template<class K> constexpr iterator lower_bound(const K& x);
497 template<class K> constexpr const_iterator lower_bound(const K& x) const;
498
499 constexpr iterator upper_bound(const key_type& x);
500 constexpr const_iterator upper_bound(const key_type& x) const;
501 template<class K> constexpr iterator upper_bound(const K& x);
502 template<class K> constexpr const_iterator upper_bound(const K& x) const;
503
504 constexpr pair<iterator, iterator> equal_range(const key_type& x);
505 constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
506 template<class K>
507 constexpr pair<iterator, iterator> equal_range(const K& x);
508 template<class K>
509 constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
510
511 friend constexpr bool operator==(const flat_multiset& x, const flat_multiset& y);
512
513 friend constexpr synth-three-way-result<value_type>
514 operator<=>(const flat_multiset& x, const flat_multiset& y);
515
516 friend constexpr void swap(flat_multiset& x, flat_multiset& y)
517 noexcept(noexcept(x.swap(y)))
518 { x.swap(y); }
519
520 private:
521 container_type c; // exposition only
522 key_compare compare; // exposition only
523 };
524
525 template<class KeyContainer, class Compare = less<typename KeyContainer::value_type>>
526 flat_multiset(KeyContainer, Compare = Compare())
527 -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
528 template<class KeyContainer, class Allocator>
529 flat_multiset(KeyContainer, Allocator)
530 -> flat_multiset<typename KeyContainer::value_type,
531 less<typename KeyContainer::value_type>, KeyContainer>;
532 template<class KeyContainer, class Compare, class Allocator>
533 flat_multiset(KeyContainer, Compare, Allocator)
534 -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
535
536 template<class KeyContainer, class Compare = less<typename KeyContainer::value_type>>
537 flat_multiset(sorted_equivalent_t, KeyContainer, Compare = Compare())
538 -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
539 template<class KeyContainer, class Allocator>
540 flat_multiset(sorted_equivalent_t, KeyContainer, Allocator)
541 -> flat_multiset<typename KeyContainer::value_type,
542 less<typename KeyContainer::value_type>, KeyContainer>;
543 template<class KeyContainer, class Compare, class Allocator>
544 flat_multiset(sorted_equivalent_t, KeyContainer, Compare, Allocator)
545 -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
546
547 template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
548 flat_multiset(InputIterator, InputIterator, Compare = Compare())
549 -> flat_multiset<iter-value-type<InputIterator>, Compare>;
550
551 template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
552 flat_multiset(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare())
553 -> flat_multiset<iter-value-type<InputIterator>, Compare>;
554
555 template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
556 class Allocator = allocator<ranges::range_value_t<R>>>
557 flat_multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
558 -> flat_multiset<ranges::range_value_t<R>, Compare,
559 vector<ranges::range_value_t<R>,
560 alloc-rebind<Allocator, ranges::range_value_t<R>>>>;
561
562 template<ranges::input_range R, class Allocator>
563 flat_multiset(from_range_t, R&&, Allocator)
564 -> flat_multiset<ranges::range_value_t<R>, less<ranges::range_value_t<R>>,
565 vector<ranges::range_value_t<R>,
566 alloc-rebind<Allocator, ranges::range_value_t<R>>>>;
567
568 template<class Key, class Compare = less<Key>>
569 flat_multiset(initializer_list<Key>, Compare = Compare())
570 -> flat_multiset<Key, Compare>;
571
572 template<class Key, class Compare = less<Key>>
573 flat_multiset(sorted_equivalent_t, initializer_list<Key>, Compare = Compare())
574 -> flat_multiset<Key, Compare>;
41575
42 template<class Key, class Compare, class KeyContainer, class Allocator>576 template<class Key, class Compare, class KeyContainer, class Allocator>
43 struct uses_allocator<flat_multiset<Key, Compare, KeyContainer>, Allocator>;577 struct uses_allocator<flat_multiset<Key, Compare, KeyContainer>, Allocator>
578 : bool_constant<uses_allocator_v<KeyContainer, Allocator>> { };
44579
45 // [flat.multiset.erasure], erasure for flat_multiset580 // [flat.multiset.erasure], erasure for flat_multiset
46 template<class Key, class Compare, class KeyContainer, class Predicate>581 template<class Key, class Compare, class KeyContainer, class Predicate>
lib/libcxx/include/float.h+16-16
...@@ -71,29 +71,29 @@ Macros:...@@ -71,29 +71,29 @@ Macros:
71*/71*/
7272
73#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)73#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
74# include <__cxx03/float.h>74# include <__cxx03/__config>
75#else75#else
76# include <__config>76# include <__config>
77#endif
7778
78# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)79#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
79# pragma GCC system_header80# pragma GCC system_header
80# endif81#endif
8182
82# if __has_include_next(<float.h>)83#if __has_include_next(<float.h>)
83# include_next <float.h>84# include_next <float.h>
84# endif85#endif
8586
86# ifdef __cplusplus87#ifdef __cplusplus
8788
88# ifndef FLT_EVAL_METHOD89# ifndef FLT_EVAL_METHOD
89# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__90# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
90# endif91# endif
9192
92# ifndef DECIMAL_DIG93# ifndef DECIMAL_DIG
93# define DECIMAL_DIG __DECIMAL_DIG__94# define DECIMAL_DIG __DECIMAL_DIG__
94# endif95# endif
9596
96# endif // __cplusplus97#endif // __cplusplus
97#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
9898
99#endif // _LIBCPP_FLOAT_H99#endif // _LIBCPP_FLOAT_H
lib/libcxx/include/forward_list+33-53
...@@ -223,18 +223,17 @@ template <class T, class Allocator, class Predicate>...@@ -223,18 +223,17 @@ template <class T, class Allocator, class Predicate>
223# include <__ranges/concepts.h>223# include <__ranges/concepts.h>
224# include <__ranges/container_compatible_range.h>224# include <__ranges/container_compatible_range.h>
225# include <__ranges/from_range.h>225# include <__ranges/from_range.h>
226# include <__type_traits/conditional.h>
227# include <__type_traits/container_traits.h>226# include <__type_traits/container_traits.h>
228# include <__type_traits/enable_if.h>227# include <__type_traits/enable_if.h>
229# include <__type_traits/is_allocator.h>228# include <__type_traits/is_allocator.h>
230# include <__type_traits/is_const.h>229# include <__type_traits/is_const.h>
231# include <__type_traits/is_nothrow_assignable.h>230# include <__type_traits/is_nothrow_assignable.h>
232# include <__type_traits/is_nothrow_constructible.h>231# include <__type_traits/is_nothrow_constructible.h>
233# include <__type_traits/is_pointer.h>
234# include <__type_traits/is_same.h>232# include <__type_traits/is_same.h>
235# include <__type_traits/is_swappable.h>233# include <__type_traits/is_swappable.h>
236# include <__type_traits/remove_cv.h>234# include <__type_traits/remove_cv.h>
237# include <__type_traits/type_identity.h>235# include <__type_traits/type_identity.h>
236# include <__utility/exception_guard.h>
238# include <__utility/forward.h>237# include <__utility/forward.h>
239# include <__utility/move.h>238# include <__utility/move.h>
240# include <__utility/swap.h>239# include <__utility/swap.h>
...@@ -283,17 +282,6 @@ struct __forward_node_traits {...@@ -283,17 +282,6 @@ struct __forward_node_traits {
283 typedef _NodePtr __node_pointer;282 typedef _NodePtr __node_pointer;
284 typedef __forward_begin_node<_NodePtr> __begin_node;283 typedef __forward_begin_node<_NodePtr> __begin_node;
285 typedef __rebind_pointer_t<_NodePtr, __begin_node> __begin_node_pointer;284 typedef __rebind_pointer_t<_NodePtr, __begin_node> __begin_node_pointer;
286
287// TODO(LLVM 22): Remove this check
288# ifndef _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
289 static_assert(sizeof(__begin_node_pointer) == sizeof(__node_pointer) && _LIBCPP_ALIGNOF(__begin_node_pointer) ==
290 _LIBCPP_ALIGNOF(__node_pointer),
291 "It looks like you are using std::forward_list with a fancy pointer type that thas a different "
292 "representation depending on whether it points to a forward_list base pointer or a forward_list node "
293 "pointer (both of which are implementation details of the standard library). This means that your ABI "
294 "is being broken between LLVM 19 and LLVM 20. If you don't care about your ABI being broken, define "
295 "the _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB macro to silence this diagnostic.");
296# endif
297};285};
298286
299template <class _NodePtr>287template <class _NodePtr>
...@@ -680,7 +668,7 @@ public:...@@ -680,7 +668,7 @@ public:
680# endif668# endif
681 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);669 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);
682670
683 template <__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>671 template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
684 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI672 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI
685 forward_list(size_type __n, const value_type& __v, const allocator_type& __a)673 forward_list(size_type __n, const value_type& __v, const allocator_type& __a)
686 : __base(__a) {674 : __base(__a) {
...@@ -744,50 +732,52 @@ public:...@@ -744,50 +732,52 @@ public:
744732
745 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);733 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
746734
747 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {735 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
748 return allocator_type(this->__alloc_);736 return allocator_type(this->__alloc_);
749 }737 }
750738
751 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {739 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
752 return iterator(__base::__before_begin()->__next_);740 return iterator(__base::__before_begin()->__next_);
753 }741 }
754 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {742 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
755 return const_iterator(__base::__before_begin()->__next_);743 return const_iterator(__base::__before_begin()->__next_);
756 }744 }
757 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(nullptr); }745 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
758 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {746 return iterator(nullptr);
747 }
748 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
759 return const_iterator(nullptr);749 return const_iterator(nullptr);
760 }750 }
761751
762 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {752 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
763 return const_iterator(__base::__before_begin()->__next_);753 return const_iterator(__base::__before_begin()->__next_);
764 }754 }
765 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {755 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {
766 return const_iterator(nullptr);756 return const_iterator(nullptr);
767 }757 }
768758
769 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator before_begin() _NOEXCEPT {759 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator before_begin() _NOEXCEPT {
770 return iterator(__base::__before_begin());760 return iterator(__base::__before_begin());
771 }761 }
772 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator before_begin() const _NOEXCEPT {762 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator before_begin() const _NOEXCEPT {
773 return const_iterator(__base::__before_begin());763 return const_iterator(__base::__before_begin());
774 }764 }
775 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cbefore_begin() const _NOEXCEPT {765 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cbefore_begin() const _NOEXCEPT {
776 return const_iterator(__base::__before_begin());766 return const_iterator(__base::__before_begin());
777 }767 }
778768
779 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {769 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
780 return __base::__before_begin()->__next_ == nullptr;770 return __base::__before_begin()->__next_ == nullptr;
781 }771 }
782 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {772 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
783 return std::min<size_type>(__node_traits::max_size(this->__alloc_), numeric_limits<difference_type>::max());773 return std::min<size_type>(__node_traits::max_size(this->__alloc_), numeric_limits<difference_type>::max());
784 }774 }
785775
786 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reference front() {776 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reference front() {
787 _LIBCPP_ASSERT_NON_NULL(!empty(), "forward_list::front called on an empty list");777 _LIBCPP_ASSERT_NON_NULL(!empty(), "forward_list::front called on an empty list");
788 return __base::__before_begin()->__next_->__get_value();778 return __base::__before_begin()->__next_->__get_value();
789 }779 }
790 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference front() const {780 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference front() const {
791 _LIBCPP_ASSERT_NON_NULL(!empty(), "forward_list::front called on an empty list");781 _LIBCPP_ASSERT_NON_NULL(!empty(), "forward_list::front called on an empty list");
792 return __base::__before_begin()->__next_->__get_value();782 return __base::__before_begin()->__next_->__get_value();
793 }783 }
...@@ -918,22 +908,22 @@ private:...@@ -918,22 +908,22 @@ private:
918908
919# if _LIBCPP_STD_VER >= 17909# if _LIBCPP_STD_VER >= 17
920template <class _InputIterator,910template <class _InputIterator,
921 class _Alloc = allocator<__iter_value_type<_InputIterator>>,911 class _Alloc = allocator<__iterator_value_type<_InputIterator>>,
922 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,912 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
923 class = enable_if_t<__is_allocator<_Alloc>::value> >913 class = enable_if_t<__is_allocator_v<_Alloc>>>
924forward_list(_InputIterator, _InputIterator) -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;914forward_list(_InputIterator, _InputIterator) -> forward_list<__iterator_value_type<_InputIterator>, _Alloc>;
925915
926template <class _InputIterator,916template <class _InputIterator,
927 class _Alloc,917 class _Alloc,
928 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,918 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
929 class = enable_if_t<__is_allocator<_Alloc>::value> >919 class = enable_if_t<__is_allocator_v<_Alloc>>>
930forward_list(_InputIterator, _InputIterator, _Alloc) -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;920forward_list(_InputIterator, _InputIterator, _Alloc) -> forward_list<__iterator_value_type<_InputIterator>, _Alloc>;
931# endif921# endif
932922
933# if _LIBCPP_STD_VER >= 23923# if _LIBCPP_STD_VER >= 23
934template <ranges::input_range _Range,924template <ranges::input_range _Range,
935 class _Alloc = allocator<ranges::range_value_t<_Range>>,925 class _Alloc = allocator<ranges::range_value_t<_Range>>,
936 class = enable_if_t<__is_allocator<_Alloc>::value> >926 class = enable_if_t<__is_allocator_v<_Alloc>>>
937forward_list(from_range_t, _Range&&, _Alloc = _Alloc()) -> forward_list<ranges::range_value_t<_Range>, _Alloc>;927forward_list(from_range_t, _Range&&, _Alloc = _Alloc()) -> forward_list<ranges::range_value_t<_Range>, _Alloc>;
938# endif928# endif
939929
...@@ -1180,22 +1170,17 @@ forward_list<_Tp, _Alloc>::__insert_after(const_iterator __p, size_type __n, _Ar...@@ -1180,22 +1170,17 @@ forward_list<_Tp, _Alloc>::__insert_after(const_iterator __p, size_type __n, _Ar
1180 if (__n > 0) {1170 if (__n > 0) {
1181 __node_pointer __first = this->__create_node(/* next = */ nullptr, std::forward<_Args>(__args)...);1171 __node_pointer __first = this->__create_node(/* next = */ nullptr, std::forward<_Args>(__args)...);
1182 __node_pointer __last = __first;1172 __node_pointer __last = __first;
1183# if _LIBCPP_HAS_EXCEPTIONS1173 auto __guard = std::__make_exception_guard([&] {
1184 try {
1185# endif // _LIBCPP_HAS_EXCEPTIONS
1186 for (--__n; __n != 0; --__n, __last = __last->__next_) {
1187 __last->__next_ = this->__create_node(/* next = */ nullptr, std::forward<_Args>(__args)...);
1188 }
1189# if _LIBCPP_HAS_EXCEPTIONS
1190 } catch (...) {
1191 while (__first != nullptr) {1174 while (__first != nullptr) {
1192 __node_pointer __next = __first->__next_;1175 __node_pointer __next = __first->__next_;
1193 this->__delete_node(__first);1176 this->__delete_node(__first);
1194 __first = __next;1177 __first = __next;
1195 }1178 }
1196 throw;1179 });
1180 for (--__n; __n != 0; --__n, __last = __last->__next_) {
1181 __last->__next_ = this->__create_node(/* next = */ nullptr, std::forward<_Args>(__args)...);
1197 }1182 }
1198# endif // _LIBCPP_HAS_EXCEPTIONS1183 __guard.__complete();
1199 __last->__next_ = __r->__next_;1184 __last->__next_ = __r->__next_;
1200 __r->__next_ = __first;1185 __r->__next_ = __first;
1201 __r = std::__static_fancy_pointer_cast<__begin_node_pointer>(__last);1186 __r = std::__static_fancy_pointer_cast<__begin_node_pointer>(__last);
...@@ -1220,22 +1205,17 @@ forward_list<_Tp, _Alloc>::__insert_after_with_sentinel(const_iterator __p, _Inp...@@ -1220,22 +1205,17 @@ forward_list<_Tp, _Alloc>::__insert_after_with_sentinel(const_iterator __p, _Inp
1220 __node_pointer __first = this->__create_node(/* next = */ nullptr, *__f);1205 __node_pointer __first = this->__create_node(/* next = */ nullptr, *__f);
1221 __node_pointer __last = __first;1206 __node_pointer __last = __first;
12221207
1223# if _LIBCPP_HAS_EXCEPTIONS1208 auto __guard = std::__make_exception_guard([&] {
1224 try {
1225# endif // _LIBCPP_HAS_EXCEPTIONS
1226 for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_))) {
1227 __last->__next_ = this->__create_node(/* next = */ nullptr, *__f);
1228 }
1229# if _LIBCPP_HAS_EXCEPTIONS
1230 } catch (...) {
1231 while (__first != nullptr) {1209 while (__first != nullptr) {
1232 __node_pointer __next = __first->__next_;1210 __node_pointer __next = __first->__next_;
1233 this->__delete_node(__first);1211 this->__delete_node(__first);
1234 __first = __next;1212 __first = __next;
1235 }1213 }
1236 throw;1214 });
1215 for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_))) {
1216 __last->__next_ = this->__create_node(/* next = */ nullptr, *__f);
1237 }1217 }
1238# endif // _LIBCPP_HAS_EXCEPTIONS1218 __guard.__complete();
12391219
1240 __last->__next_ = __r->__next_;1220 __last->__next_ = __r->__next_;
1241 __r->__next_ = __first;1221 __r->__next_ = __first;
lib/libcxx/include/fstream+57-42
...@@ -221,7 +221,7 @@ _LIBCPP_PUSH_MACROS...@@ -221,7 +221,7 @@ _LIBCPP_PUSH_MACROS
221221
222_LIBCPP_BEGIN_NAMESPACE_STD222_LIBCPP_BEGIN_NAMESPACE_STD
223223
224# if _LIBCPP_STD_VER >= 26 && defined(_LIBCPP_WIN32API)224# if _LIBCPP_STD_VER >= 23 && defined(_LIBCPP_WIN32API)
225_LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) noexcept;225_LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) noexcept;
226# endif226# endif
227227
...@@ -254,7 +254,7 @@ public:...@@ -254,7 +254,7 @@ public:
254 void swap(basic_filebuf& __rhs);254 void swap(basic_filebuf& __rhs);
255255
256 // 27.9.1.4 Members:256 // 27.9.1.4 Members:
257 _LIBCPP_HIDE_FROM_ABI bool is_open() const;257 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_open() const;
258 basic_filebuf* open(const char* __s, ios_base::openmode __mode);258 basic_filebuf* open(const char* __s, ios_base::openmode __mode);
259# if _LIBCPP_HAS_OPEN_WITH_WCHAR259# if _LIBCPP_HAS_OPEN_WITH_WCHAR
260 basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode);260 basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode);
...@@ -262,15 +262,14 @@ public:...@@ -262,15 +262,14 @@ public:
262 _LIBCPP_HIDE_FROM_ABI basic_filebuf* open(const string& __s, ios_base::openmode __mode);262 _LIBCPP_HIDE_FROM_ABI basic_filebuf* open(const string& __s, ios_base::openmode __mode);
263263
264# if _LIBCPP_STD_VER >= 17264# if _LIBCPP_STD_VER >= 17
265 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI basic_filebuf*265 _LIBCPP_HIDE_FROM_ABI basic_filebuf* open(const filesystem::path& __p, ios_base::openmode __mode) {
266 open(const filesystem::path& __p, ios_base::openmode __mode) {
267 return open(__p.c_str(), __mode);266 return open(__p.c_str(), __mode);
268 }267 }
269# endif268# endif
270 _LIBCPP_HIDE_FROM_ABI basic_filebuf* __open(int __fd, ios_base::openmode __mode);269 _LIBCPP_HIDE_FROM_ABI basic_filebuf* __open(int __fd, ios_base::openmode __mode);
271 basic_filebuf* close();270 basic_filebuf* close();
272# if _LIBCPP_STD_VER >= 26271# if _LIBCPP_STD_VER >= 26
273 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept {272 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept {
274 _LIBCPP_ASSERT_UNCATEGORIZED(this->is_open(), "File must be opened");273 _LIBCPP_ASSERT_UNCATEGORIZED(this->is_open(), "File must be opened");
275# if defined(_LIBCPP_WIN32API)274# if defined(_LIBCPP_WIN32API)
276 return std::__filebuf_windows_native_handle(__file_);275 return std::__filebuf_windows_native_handle(__file_);
...@@ -299,6 +298,16 @@ protected:...@@ -299,6 +298,16 @@ protected:
299 int sync() override;298 int sync() override;
300 void imbue(const locale& __loc) override;299 void imbue(const locale& __loc) override;
301300
301 _LIBCPP_HIDE_FROM_ABI_VIRTUAL streamsize xsputn(const char_type* __str, streamsize __len) override {
302 if (__always_noconv_ && __len >= (this->epptr() - this->pbase())) {
303 if (traits_type::eq_int_type(overflow(), traits_type::eof()))
304 return 0;
305
306 return std::fwrite(__str, sizeof(char_type), __len, __file_);
307 }
308 return basic_streambuf<_CharT, _Traits>::xsputn(__str, __len);
309 }
310
302private:311private:
303 char* __extbuf_;312 char* __extbuf_;
304 const char* __extbufnext_;313 const char* __extbufnext_;
...@@ -401,6 +410,14 @@ private:...@@ -401,6 +410,14 @@ private:
401 }410 }
402 }411 }
403 }412 }
413
414 _LIBCPP_HIDE_FROM_ABI typename traits_type::int_type __overflow_failed() {
415 if (this->pptr() == this->epptr() + 1) {
416 this->pbump(-1); // lose the character we overflowed above -- we don't really have a
417 // choice since we couldn't commit the contents of the put area
418 }
419 return traits_type::eof();
420 }
404};421};
405422
406template <class _CharT, class _Traits>423template <class _CharT, class _Traits>
...@@ -742,7 +759,12 @@ basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::close() {...@@ -742,7 +759,12 @@ basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::close() {
742 if (fclose(__h.release()))759 if (fclose(__h.release()))
743 __rt = nullptr;760 __rt = nullptr;
744 __file_ = nullptr;761 __file_ = nullptr;
745 setbuf(0, 0);762 // Reset the get and the put areas without getting rid of the underlying buffers,
763 // which might have been configured by the user. Make sure to keep the buffers
764 // since the user may re-open the stream.
765 this->setg(nullptr, nullptr, nullptr);
766 this->setp(nullptr, nullptr);
767 __cm_ = __no_io_operations;
746 }768 }
747 return __rt;769 return __rt;
748}770}
...@@ -821,14 +843,6 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>...@@ -821,14 +843,6 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
821843
822template <class _CharT, class _Traits>844template <class _CharT, class _Traits>
823typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::overflow(int_type __c) {845typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::overflow(int_type __c) {
824 auto __failed = [this]() {
825 if (this->pptr() == this->epptr() + 1) {
826 this->pbump(-1); // lose the character we overflowed above -- we don't really have a
827 // choice since we couldn't commit the contents of the put area
828 }
829 return traits_type::eof();
830 };
831
832 if (__file_ == nullptr)846 if (__file_ == nullptr)
833 return traits_type::eof();847 return traits_type::eof();
834 __write_mode();848 __write_mode();
...@@ -850,7 +864,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>...@@ -850,7 +864,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
850 if (__always_noconv_) {864 if (__always_noconv_) {
851 size_t __n = static_cast<size_t>(this->pptr() - this->pbase());865 size_t __n = static_cast<size_t>(this->pptr() - this->pbase());
852 if (std::fwrite(this->pbase(), sizeof(char_type), __n, __file_) != __n) {866 if (std::fwrite(this->pbase(), sizeof(char_type), __n, __file_) != __n) {
853 return __failed();867 return __overflow_failed();
854 }868 }
855 } else {869 } else {
856 if (!__cv_)870 if (!__cv_)
...@@ -864,14 +878,14 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>...@@ -864,14 +878,14 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
864 do {878 do {
865 codecvt_base::result __r = __cv_->out(__st_, __b, __p, __end, __extbuf_, __extbuf_ + __ebs_, __extbuf_end);879 codecvt_base::result __r = __cv_->out(__st_, __b, __p, __end, __extbuf_, __extbuf_ + __ebs_, __extbuf_end);
866 if (__end == __b) {880 if (__end == __b) {
867 return __failed();881 return __overflow_failed();
868 }882 }
869883
870 // No conversion needed: output characters directly to the file, done.884 // No conversion needed: output characters directly to the file, done.
871 if (__r == codecvt_base::noconv) {885 if (__r == codecvt_base::noconv) {
872 size_t __n = static_cast<size_t>(__p - __b);886 size_t __n = static_cast<size_t>(__p - __b);
873 if (std::fwrite(__b, 1, __n, __file_) != __n) {887 if (std::fwrite(__b, 1, __n, __file_) != __n) {
874 return __failed();888 return __overflow_failed();
875 }889 }
876 break;890 break;
877891
...@@ -879,7 +893,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>...@@ -879,7 +893,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
879 } else if (__r == codecvt_base::ok) {893 } else if (__r == codecvt_base::ok) {
880 size_t __n = static_cast<size_t>(__extbuf_end - __extbuf_);894 size_t __n = static_cast<size_t>(__extbuf_end - __extbuf_);
881 if (std::fwrite(__extbuf_, 1, __n, __file_) != __n) {895 if (std::fwrite(__extbuf_, 1, __n, __file_) != __n) {
882 return __failed();896 return __overflow_failed();
883 }897 }
884 break;898 break;
885899
...@@ -888,13 +902,13 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>...@@ -888,13 +902,13 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
888 } else if (__r == codecvt_base::partial) {902 } else if (__r == codecvt_base::partial) {
889 size_t __n = static_cast<size_t>(__extbuf_end - __extbuf_);903 size_t __n = static_cast<size_t>(__extbuf_end - __extbuf_);
890 if (std::fwrite(__extbuf_, 1, __n, __file_) != __n) {904 if (std::fwrite(__extbuf_, 1, __n, __file_) != __n) {
891 return __failed();905 return __overflow_failed();
892 }906 }
893 __b = const_cast<char_type*>(__end);907 __b = const_cast<char_type*>(__end);
894 continue;908 continue;
895909
896 } else {910 } else {
897 return __failed();911 return __overflow_failed();
898 }912 }
899 } while (true);913 } while (true);
900 }914 }
...@@ -977,7 +991,7 @@ template <class _CharT, class _Traits>...@@ -977,7 +991,7 @@ template <class _CharT, class _Traits>
977int basic_filebuf<_CharT, _Traits>::__fseek(FILE* __file, pos_type __offset, int __whence) {991int basic_filebuf<_CharT, _Traits>::__fseek(FILE* __file, pos_type __offset, int __whence) {
978# if defined(_LIBCPP_MSVCRT_LIKE)992# if defined(_LIBCPP_MSVCRT_LIKE)
979 return _fseeki64(__file, __offset, __whence);993 return _fseeki64(__file, __offset, __whence);
980# elif defined(_NEWLIB_VERSION)994# elif _LIBCPP_LIBC_NEWLIB
981 return fseek(__file, __offset, __whence);995 return fseek(__file, __offset, __whence);
982# else996# else
983 return ::fseeko(__file, __offset, __whence);997 return ::fseeko(__file, __offset, __whence);
...@@ -988,7 +1002,7 @@ template <class _CharT, class _Traits>...@@ -988,7 +1002,7 @@ template <class _CharT, class _Traits>
988typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>::__ftell(FILE* __file) {1002typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>::__ftell(FILE* __file) {
989# if defined(_LIBCPP_MSVCRT_LIKE)1003# if defined(_LIBCPP_MSVCRT_LIKE)
990 return _ftelli64(__file);1004 return _ftelli64(__file);
991# elif defined(_NEWLIB_VERSION)1005# elif _LIBCPP_LIBC_NEWLIB
992 return ftell(__file);1006 return ftell(__file);
993# else1007# else
994 return ftello(__file);1008 return ftello(__file);
...@@ -1147,27 +1161,27 @@ public:...@@ -1147,27 +1161,27 @@ public:
1147 _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);1161 _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
1148# if _LIBCPP_STD_VER >= 171162# if _LIBCPP_STD_VER >= 17
1149 template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>1163 template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>
1150 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY1164 _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const _Tp& __p, ios_base::openmode __mode = ios_base::in)
1151 _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const _Tp& __p, ios_base::openmode __mode = ios_base::in)
1152 : basic_ifstream(__p.c_str(), __mode) {}1165 : basic_ifstream(__p.c_str(), __mode) {}
1153# endif // _LIBCPP_STD_VER >= 171166# endif // _LIBCPP_STD_VER >= 17
1154 _LIBCPP_HIDE_FROM_ABI basic_ifstream(basic_ifstream&& __rhs);1167 _LIBCPP_HIDE_FROM_ABI basic_ifstream(basic_ifstream&& __rhs);
1155 _LIBCPP_HIDE_FROM_ABI basic_ifstream& operator=(basic_ifstream&& __rhs);1168 _LIBCPP_HIDE_FROM_ABI basic_ifstream& operator=(basic_ifstream&& __rhs);
1156 _LIBCPP_HIDE_FROM_ABI void swap(basic_ifstream& __rhs);1169 _LIBCPP_HIDE_FROM_ABI void swap(basic_ifstream& __rhs);
11571170
1158 _LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;1171 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;
1159# if _LIBCPP_STD_VER >= 261172# if _LIBCPP_STD_VER >= 26
1160 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept { return rdbuf()->native_handle(); }1173 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept {
1174 return rdbuf()->native_handle();
1175 }
1161# endif1176# endif
1162 _LIBCPP_HIDE_FROM_ABI bool is_open() const;1177 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_open() const;
1163 void open(const char* __s, ios_base::openmode __mode = ios_base::in);1178 void open(const char* __s, ios_base::openmode __mode = ios_base::in);
1164# if _LIBCPP_HAS_OPEN_WITH_WCHAR1179# if _LIBCPP_HAS_OPEN_WITH_WCHAR
1165 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);1180 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
1166# endif1181# endif
1167 void open(const string& __s, ios_base::openmode __mode = ios_base::in);1182 void open(const string& __s, ios_base::openmode __mode = ios_base::in);
1168# if _LIBCPP_STD_VER >= 171183# if _LIBCPP_STD_VER >= 17
1169 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI void1184 _LIBCPP_HIDE_FROM_ABI void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) {
1170 open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) {
1171 return open(__p.c_str(), __mode);1185 return open(__p.c_str(), __mode);
1172 }1186 }
1173# endif // _LIBCPP_STD_VER >= 171187# endif // _LIBCPP_STD_VER >= 17
...@@ -1304,8 +1318,7 @@ public:...@@ -1304,8 +1318,7 @@ public:
13041318
1305# if _LIBCPP_STD_VER >= 171319# if _LIBCPP_STD_VER >= 17
1306 template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>1320 template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>
1307 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY1321 _LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const _Tp& __p, ios_base::openmode __mode = ios_base::out)
1308 _LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const _Tp& __p, ios_base::openmode __mode = ios_base::out)
1309 : basic_ofstream(__p.c_str(), __mode) {}1322 : basic_ofstream(__p.c_str(), __mode) {}
1310# endif // _LIBCPP_STD_VER >= 171323# endif // _LIBCPP_STD_VER >= 17
13111324
...@@ -1313,11 +1326,13 @@ public:...@@ -1313,11 +1326,13 @@ public:
1313 _LIBCPP_HIDE_FROM_ABI basic_ofstream& operator=(basic_ofstream&& __rhs);1326 _LIBCPP_HIDE_FROM_ABI basic_ofstream& operator=(basic_ofstream&& __rhs);
1314 _LIBCPP_HIDE_FROM_ABI void swap(basic_ofstream& __rhs);1327 _LIBCPP_HIDE_FROM_ABI void swap(basic_ofstream& __rhs);
13151328
1316 _LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;1329 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;
1317# if _LIBCPP_STD_VER >= 261330# if _LIBCPP_STD_VER >= 26
1318 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept { return rdbuf()->native_handle(); }1331 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept {
1332 return rdbuf()->native_handle();
1333 }
1319# endif1334# endif
1320 _LIBCPP_HIDE_FROM_ABI bool is_open() const;1335 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_open() const;
1321 void open(const char* __s, ios_base::openmode __mode = ios_base::out);1336 void open(const char* __s, ios_base::openmode __mode = ios_base::out);
1322# if _LIBCPP_HAS_OPEN_WITH_WCHAR1337# if _LIBCPP_HAS_OPEN_WITH_WCHAR
1323 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);1338 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
...@@ -1325,8 +1340,7 @@ public:...@@ -1325,8 +1340,7 @@ public:
1325 void open(const string& __s, ios_base::openmode __mode = ios_base::out);1340 void open(const string& __s, ios_base::openmode __mode = ios_base::out);
13261341
1327# if _LIBCPP_STD_VER >= 171342# if _LIBCPP_STD_VER >= 17
1328 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI void1343 _LIBCPP_HIDE_FROM_ABI void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) {
1329 open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) {
1330 return open(__p.c_str(), __mode);1344 return open(__p.c_str(), __mode);
1331 }1345 }
1332# endif // _LIBCPP_STD_VER >= 171346# endif // _LIBCPP_STD_VER >= 17
...@@ -1466,8 +1480,7 @@ public:...@@ -1466,8 +1480,7 @@ public:
14661480
1467# if _LIBCPP_STD_VER >= 171481# if _LIBCPP_STD_VER >= 17
1468 template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>1482 template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>
1469 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI explicit basic_fstream(1483 _LIBCPP_HIDE_FROM_ABI explicit basic_fstream(const _Tp& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
1470 const _Tp& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
1471 : basic_fstream(__p.c_str(), __mode) {}1484 : basic_fstream(__p.c_str(), __mode) {}
1472# endif // _LIBCPP_STD_VER >= 171485# endif // _LIBCPP_STD_VER >= 17
14731486
...@@ -1477,11 +1490,13 @@ public:...@@ -1477,11 +1490,13 @@ public:
14771490
1478 _LIBCPP_HIDE_FROM_ABI void swap(basic_fstream& __rhs);1491 _LIBCPP_HIDE_FROM_ABI void swap(basic_fstream& __rhs);
14791492
1480 _LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;1493 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;
1481# if _LIBCPP_STD_VER >= 261494# if _LIBCPP_STD_VER >= 26
1482 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept { return rdbuf()->native_handle(); }1495 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept {
1496 return rdbuf()->native_handle();
1497 }
1483# endif1498# endif
1484 _LIBCPP_HIDE_FROM_ABI bool is_open() const;1499 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_open() const;
1485 _LIBCPP_HIDE_FROM_ABI void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);1500 _LIBCPP_HIDE_FROM_ABI void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
1486# if _LIBCPP_HAS_OPEN_WITH_WCHAR1501# if _LIBCPP_HAS_OPEN_WITH_WCHAR
1487 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);1502 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
...@@ -1489,7 +1504,7 @@ public:...@@ -1489,7 +1504,7 @@ public:
1489 _LIBCPP_HIDE_FROM_ABI void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);1504 _LIBCPP_HIDE_FROM_ABI void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
14901505
1491# if _LIBCPP_STD_VER >= 171506# if _LIBCPP_STD_VER >= 17
1492 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI void1507 _LIBCPP_HIDE_FROM_ABI void
1493 open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) {1508 open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) {
1494 return open(__p.c_str(), __mode);1509 return open(__p.c_str(), __mode);
1495 }1510 }
lib/libcxx/include/future+41-51
...@@ -397,12 +397,14 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;...@@ -397,12 +397,14 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
397# include <__type_traits/decay.h>397# include <__type_traits/decay.h>
398# include <__type_traits/enable_if.h>398# include <__type_traits/enable_if.h>
399# include <__type_traits/invoke.h>399# include <__type_traits/invoke.h>
400# include <__type_traits/is_constructible.h>
400# include <__type_traits/is_same.h>401# include <__type_traits/is_same.h>
401# include <__type_traits/remove_cvref.h>402# include <__type_traits/remove_cvref.h>
402# include <__type_traits/remove_reference.h>403# include <__type_traits/remove_reference.h>
403# include <__type_traits/strip_signature.h>404# include <__type_traits/strip_signature.h>
404# include <__type_traits/underlying_type.h>405# include <__type_traits/underlying_type.h>
405# include <__utility/auto_cast.h>406# include <__utility/auto_cast.h>
407# include <__utility/exception_guard.h>
406# include <__utility/forward.h>408# include <__utility/forward.h>
407# include <__utility/move.h>409# include <__utility/move.h>
408# include <__utility/swap.h>410# include <__utility/swap.h>
...@@ -477,13 +479,13 @@ inline _LIBCPP_HIDE_FROM_ABI launch& operator^=(launch& __x, launch __y) {...@@ -477,13 +479,13 @@ inline _LIBCPP_HIDE_FROM_ABI launch& operator^=(launch& __x, launch __y) {
477_LIBCPP_DECLARE_STRONG_ENUM(future_status){ready, timeout, deferred};479_LIBCPP_DECLARE_STRONG_ENUM(future_status){ready, timeout, deferred};
478_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)480_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
479481
480_LIBCPP_EXPORTED_FROM_ABI const error_category& future_category() _NOEXCEPT;482[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& future_category() _NOEXCEPT;
481483
482inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(future_errc __e) _NOEXCEPT {484[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(future_errc __e) _NOEXCEPT {
483 return error_code(static_cast<int>(__e), future_category());485 return error_code(static_cast<int>(__e), future_category());
484}486}
485487
486inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(future_errc __e) _NOEXCEPT {488[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(future_errc __e) _NOEXCEPT {
487 return error_condition(static_cast<int>(__e), future_category());489 return error_condition(static_cast<int>(__e), future_category());
488}490}
489491
...@@ -502,7 +504,7 @@ public:...@@ -502,7 +504,7 @@ public:
502 _LIBCPP_HIDE_FROM_ABI explicit future_error(future_errc __ec) : future_error(std::make_error_code(__ec)) {}504 _LIBCPP_HIDE_FROM_ABI explicit future_error(future_errc __ec) : future_error(std::make_error_code(__ec)) {}
503# endif505# endif
504506
505 _LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }507 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
506508
507 _LIBCPP_HIDE_FROM_ABI future_error(const future_error&) _NOEXCEPT = default;509 _LIBCPP_HIDE_FROM_ABI future_error(const future_error&) _NOEXCEPT = default;
508 ~future_error() _NOEXCEPT override;510 ~future_error() _NOEXCEPT override;
...@@ -583,12 +585,9 @@ inline future_status __assoc_sub_state::wait_for(const chrono::duration<_Rep, _P...@@ -583,12 +585,9 @@ inline future_status __assoc_sub_state::wait_for(const chrono::duration<_Rep, _P
583template <class _Rp>585template <class _Rp>
584class _LIBCPP_HIDDEN __assoc_state : public __assoc_sub_state {586class _LIBCPP_HIDDEN __assoc_state : public __assoc_sub_state {
585 typedef __assoc_sub_state base;587 typedef __assoc_sub_state base;
586 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
587 typedef typename aligned_storage<sizeof(_Rp), _LIBCPP_ALIGNOF(_Rp)>::type _Up;
588 _LIBCPP_SUPPRESS_DEPRECATED_POP
589588
590protected:589protected:
591 _Up __value_;590 _ALIGNAS_TYPE(_Rp) char __value_[sizeof(_Rp)];
592591
593 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;592 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;
594593
...@@ -943,15 +942,15 @@ public:...@@ -943,15 +942,15 @@ public:
943 }942 }
944943
945 _LIBCPP_HIDE_FROM_ABI ~future();944 _LIBCPP_HIDE_FROM_ABI ~future();
946 _LIBCPP_HIDE_FROM_ABI shared_future<_Rp> share() _NOEXCEPT;945 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_future<_Rp> share() _NOEXCEPT;
947946
948 // retrieving the value947 // retrieving the value
949 _LIBCPP_HIDE_FROM_ABI _Rp get();948 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Rp get();
950949
951 _LIBCPP_HIDE_FROM_ABI void swap(future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }950 _LIBCPP_HIDE_FROM_ABI void swap(future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
952951
953 // functions to check state952 // functions to check state
954 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }953 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }
955954
956 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }955 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }
957 template <class _Rep, class _Period>956 template <class _Rep, class _Period>
...@@ -1014,15 +1013,15 @@ public:...@@ -1014,15 +1013,15 @@ public:
1014 }1013 }
10151014
1016 _LIBCPP_HIDE_FROM_ABI ~future();1015 _LIBCPP_HIDE_FROM_ABI ~future();
1017 _LIBCPP_HIDE_FROM_ABI shared_future<_Rp&> share() _NOEXCEPT;1016 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_future<_Rp&> share() _NOEXCEPT;
10181017
1019 // retrieving the value1018 // retrieving the value
1020 _LIBCPP_HIDE_FROM_ABI _Rp& get();1019 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Rp& get();
10211020
1022 _LIBCPP_HIDE_FROM_ABI void swap(future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1021 _LIBCPP_HIDE_FROM_ABI void swap(future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
10231022
1024 // functions to check state1023 // functions to check state
1025 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }1024 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }
10261025
1027 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }1026 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }
1028 template <class _Rep, class _Period>1027 template <class _Rep, class _Period>
...@@ -1089,7 +1088,7 @@ public:...@@ -1089,7 +1088,7 @@ public:
1089 _LIBCPP_HIDE_FROM_ABI void swap(future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1088 _LIBCPP_HIDE_FROM_ABI void swap(future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
10901089
1091 // functions to check state1090 // functions to check state
1092 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }1091 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }
10931092
1094 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }1093 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }
1095 template <class _Rep, class _Period>1094 template <class _Rep, class _Period>
...@@ -1139,7 +1138,7 @@ public:...@@ -1139,7 +1138,7 @@ public:
1139 _LIBCPP_HIDE_FROM_ABI void swap(promise& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1138 _LIBCPP_HIDE_FROM_ABI void swap(promise& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
11401139
1141 // retrieving the result1140 // retrieving the result
1142 _LIBCPP_HIDE_FROM_ABI future<_Rp> get_future();1141 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<_Rp> get_future();
11431142
1144 // setting the result1143 // setting the result
1145 _LIBCPP_HIDE_FROM_ABI void set_value(const _Rp& __r);1144 _LIBCPP_HIDE_FROM_ABI void set_value(const _Rp& __r);
...@@ -1256,7 +1255,7 @@ public:...@@ -1256,7 +1255,7 @@ public:
1256 _LIBCPP_HIDE_FROM_ABI void swap(promise& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1255 _LIBCPP_HIDE_FROM_ABI void swap(promise& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
12571256
1258 // retrieving the result1257 // retrieving the result
1259 _LIBCPP_HIDE_FROM_ABI future<_Rp&> get_future();1258 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<_Rp&> get_future();
12601259
1261 // setting the result1260 // setting the result
1262 _LIBCPP_HIDE_FROM_ABI void set_value(_Rp& __r);1261 _LIBCPP_HIDE_FROM_ABI void set_value(_Rp& __r);
...@@ -1366,7 +1365,7 @@ public:...@@ -1366,7 +1365,7 @@ public:
1366 _LIBCPP_HIDE_FROM_ABI void swap(promise& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1365 _LIBCPP_HIDE_FROM_ABI void swap(promise& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
13671366
1368 // retrieving the result1367 // retrieving the result
1369 future<void> get_future();1368 [[__nodiscard__]] future<void> get_future();
13701369
1371 // setting the result1370 // setting the result
1372 void set_value();1371 void set_value();
...@@ -1639,10 +1638,10 @@ public:...@@ -1639,10 +1638,10 @@ public:
1639 __p_.swap(__other.__p_);1638 __p_.swap(__other.__p_);
1640 }1639 }
16411640
1642 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __p_.__state_ != nullptr; }1641 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __p_.__state_ != nullptr; }
16431642
1644 // result retrieval1643 // result retrieval
1645 _LIBCPP_HIDE_FROM_ABI future<_Rp> get_future() { return __p_.get_future(); }1644 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<_Rp> get_future() { return __p_.get_future(); }
16461645
1647 // execution1646 // execution
1648 _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args);1647 _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args);
...@@ -1728,10 +1727,10 @@ public:...@@ -1728,10 +1727,10 @@ public:
1728 __p_.swap(__other.__p_);1727 __p_.swap(__other.__p_);
1729 }1728 }
17301729
1731 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __p_.__state_ != nullptr; }1730 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __p_.__state_ != nullptr; }
17321731
1733 // result retrieval1732 // result retrieval
1734 _LIBCPP_HIDE_FROM_ABI future<void> get_future() { return __p_.get_future(); }1733 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<void> get_future() { return __p_.get_future(); }
17351734
1736 // execution1735 // execution
1737 _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args);1736 _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args);
...@@ -1815,16 +1814,9 @@ template <class _Rp, class _Fp>...@@ -1815,16 +1814,9 @@ template <class _Rp, class _Fp>
1815_LIBCPP_HIDE_FROM_ABI future<_Rp> __make_async_assoc_state(_Fp&& __f) {1814_LIBCPP_HIDE_FROM_ABI future<_Rp> __make_async_assoc_state(_Fp&& __f) {
1816 unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count> __h(1815 unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count> __h(
1817 new __async_assoc_state<_Rp, _Fp>(std::forward<_Fp>(__f)));1816 new __async_assoc_state<_Rp, _Fp>(std::forward<_Fp>(__f)));
1818# if _LIBCPP_HAS_EXCEPTIONS1817 auto __guard = std::__make_exception_guard([&] { __h->__make_ready(); });
1819 try {1818 std::thread(&__async_assoc_state<_Rp, _Fp>::__execute, __h.get()).detach();
1820# endif1819 __guard.__complete();
1821 std::thread(&__async_assoc_state<_Rp, _Fp>::__execute, __h.get()).detach();
1822# if _LIBCPP_HAS_EXCEPTIONS
1823 } catch (...) {
1824 __h->__make_ready();
1825 throw;
1826 }
1827# endif
1828 return future<_Rp>(__h.get());1820 return future<_Rp>(__h.get());
1829}1821}
18301822
...@@ -1837,20 +1829,16 @@ class _LIBCPP_HIDDEN __async_func {...@@ -1837,20 +1829,16 @@ class _LIBCPP_HIDDEN __async_func {
1837public:1829public:
1838 using _Rp _LIBCPP_NODEBUG = __invoke_result_t<_Fp, _Args...>;1830 using _Rp _LIBCPP_NODEBUG = __invoke_result_t<_Fp, _Args...>;
18391831
1840 _LIBCPP_HIDE_FROM_ABI explicit __async_func(_Fp&& __f, _Args&&... __args)1832 template <class _Gp, class... _BArgs>
1841 : __f_(std::move(__f), std::move(__args)...) {}1833 _LIBCPP_HIDE_FROM_ABI explicit __async_func(_Gp&& __g, _BArgs&&... __bargs)
1834 : __f_(std::forward<_Gp>(__g), std::forward<_BArgs>(__bargs)...) {}
18421835
1843 _LIBCPP_HIDE_FROM_ABI __async_func(__async_func&& __f) : __f_(std::move(__f.__f_)) {}1836 _LIBCPP_HIDE_FROM_ABI __async_func(__async_func&& __f) : __f_(std::move(__f.__f_)) {}
18441837
1845 _LIBCPP_HIDE_FROM_ABI _Rp operator()() {1838 _LIBCPP_HIDE_FROM_ABI _Rp operator()() {
1846 typedef typename __make_tuple_indices<1 + sizeof...(_Args), 1>::type _Index;1839 return [&]<size_t... _Indices>(__index_sequence<_Indices...>) -> _Rp {
1847 return __execute(_Index());1840 return std::__invoke(std::move(std::get<_Indices>(__f_))...);
1848 }1841 }(__index_sequence_for<_Fp, _Args...>{});
1849
1850private:
1851 template <size_t... _Indices>
1852 _LIBCPP_HIDE_FROM_ABI _Rp __execute(__tuple_indices<_Indices...>) {
1853 return std::__invoke(std::move(std::get<0>(__f_)), std::move(std::get<_Indices>(__f_))...);
1854 }1842 }
1855};1843};
18561844
...@@ -1861,6 +1849,10 @@ inline _LIBCPP_HIDE_FROM_ABI bool __does_policy_contain(launch __policy, launch...@@ -1861,6 +1849,10 @@ inline _LIBCPP_HIDE_FROM_ABI bool __does_policy_contain(launch __policy, launch
1861template <class _Fp, class... _Args>1849template <class _Fp, class... _Args>
1862[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<__invoke_result_t<__decay_t<_Fp>, __decay_t<_Args>...> >1850[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI future<__invoke_result_t<__decay_t<_Fp>, __decay_t<_Args>...> >
1863async(launch __policy, _Fp&& __f, _Args&&... __args) {1851async(launch __policy, _Fp&& __f, _Args&&... __args) {
1852 static_assert(is_constructible<__decay_t<_Fp>, _Fp>::value, "");
1853 static_assert(_And<is_constructible<__decay_t<_Args>, _Args>...>::value, "");
1854 static_assert(__is_invocable_v<__decay_t<_Fp>, __decay_t<_Args>...>, "");
1855
1864 typedef __async_func<__decay_t<_Fp>, __decay_t<_Args>...> _BF;1856 typedef __async_func<__decay_t<_Fp>, __decay_t<_Args>...> _BF;
1865 typedef typename _BF::_Rp _Rp;1857 typedef typename _BF::_Rp _Rp;
18661858
...@@ -1868,8 +1860,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args) {...@@ -1868,8 +1860,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args) {
1868 try {1860 try {
1869# endif1861# endif
1870 if (__does_policy_contain(__policy, launch::async))1862 if (__does_policy_contain(__policy, launch::async))
1871 return std::__make_async_assoc_state<_Rp>(1863 return std::__make_async_assoc_state<_Rp>(_BF(std::forward<_Fp>(__f), std::forward<_Args>(__args)...));
1872 _BF(_LIBCPP_AUTO_CAST(std::forward<_Fp>(__f)), _LIBCPP_AUTO_CAST(std::forward<_Args>(__args))...));
1873# if _LIBCPP_HAS_EXCEPTIONS1864# if _LIBCPP_HAS_EXCEPTIONS
1874 } catch (...) {1865 } catch (...) {
1875 if (__policy == launch::async)1866 if (__policy == launch::async)
...@@ -1878,8 +1869,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args) {...@@ -1878,8 +1869,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args) {
1878# endif1869# endif
18791870
1880 if (__does_policy_contain(__policy, launch::deferred))1871 if (__does_policy_contain(__policy, launch::deferred))
1881 return std::__make_deferred_assoc_state<_Rp>(1872 return std::__make_deferred_assoc_state<_Rp>(_BF(std::forward<_Fp>(__f), std::forward<_Args>(__args)...));
1882 _BF(_LIBCPP_AUTO_CAST(std::forward<_Fp>(__f)), _LIBCPP_AUTO_CAST(std::forward<_Args>(__args))...));
1883 return future<_Rp>{};1873 return future<_Rp>{};
1884}1874}
18851875
...@@ -1915,12 +1905,12 @@ public:...@@ -1915,12 +1905,12 @@ public:
1915 }1905 }
19161906
1917 // retrieving the value1907 // retrieving the value
1918 _LIBCPP_HIDE_FROM_ABI const _Rp& get() const { return __state_->copy(); }1908 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Rp& get() const { return __state_->copy(); }
19191909
1920 _LIBCPP_HIDE_FROM_ABI void swap(shared_future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1910 _LIBCPP_HIDE_FROM_ABI void swap(shared_future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
19211911
1922 // functions to check state1912 // functions to check state
1923 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }1913 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }
19241914
1925 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }1915 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }
1926 template <class _Rep, class _Period>1916 template <class _Rep, class _Period>
...@@ -1971,12 +1961,12 @@ public:...@@ -1971,12 +1961,12 @@ public:
1971 }1961 }
19721962
1973 // retrieving the value1963 // retrieving the value
1974 _LIBCPP_HIDE_FROM_ABI _Rp& get() const { return __state_->copy(); }1964 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _Rp& get() const { return __state_->copy(); }
19751965
1976 _LIBCPP_HIDE_FROM_ABI void swap(shared_future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }1966 _LIBCPP_HIDE_FROM_ABI void swap(shared_future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
19771967
1978 // functions to check state1968 // functions to check state
1979 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }1969 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }
19801970
1981 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }1971 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }
1982 template <class _Rep, class _Period>1972 template <class _Rep, class _Period>
...@@ -2032,7 +2022,7 @@ public:...@@ -2032,7 +2022,7 @@ public:
2032 _LIBCPP_HIDE_FROM_ABI void swap(shared_future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }2022 _LIBCPP_HIDE_FROM_ABI void swap(shared_future& __rhs) _NOEXCEPT { std::swap(__state_, __rhs.__state_); }
20332023
2034 // functions to check state2024 // functions to check state
2035 _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }2025 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool valid() const _NOEXCEPT { return __state_ != nullptr; }
20362026
2037 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }2027 _LIBCPP_HIDE_FROM_ABI void wait() const { __state_->wait(); }
2038 template <class _Rep, class _Period>2028 template <class _Rep, class _Period>
lib/libcxx/include/initializer_list+9-3
...@@ -78,11 +78,17 @@ public:...@@ -78,11 +78,17 @@ public:
7878
79 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}79 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}
8080
81 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t size() const _NOEXCEPT { return __size_; }81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t size() const _NOEXCEPT {
82 return __size_;
83 }
8284
83 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT { return __begin_; }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT {
86 return __begin_;
87 }
8488
85 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT { return __begin_ + __size_; }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT {
90 return __begin_ + __size_;
91 }
86};92};
8793
88template <class _Ep>94template <class _Ep>
lib/libcxx/include/inttypes.h+16-16
...@@ -236,33 +236,33 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int...@@ -236,33 +236,33 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
236*/236*/
237237
238#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)238#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
239# include <__cxx03/inttypes.h>239# include <__cxx03/__config>
240#else240#else
241# include <__config>241# include <__config>
242#endif
242243
243# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)244#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
244# pragma GCC system_header245# pragma GCC system_header
245# endif246#endif
246247
247/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed248/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
248 for C++11 unless __STDC_FORMAT_MACROS is defined249 for C++11 unless __STDC_FORMAT_MACROS is defined
249*/250*/
250# if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)251#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
251# define __STDC_FORMAT_MACROS252# define __STDC_FORMAT_MACROS
252# endif253#endif
253254
254# if __has_include_next(<inttypes.h>)255#if __has_include_next(<inttypes.h>)
255# include_next <inttypes.h>256# include_next <inttypes.h>
256# endif257#endif
257258
258# ifdef __cplusplus259#ifdef __cplusplus
259260
260# include <stdint.h>261# include <stdint.h>
261262
262# undef imaxabs263# undef imaxabs
263# undef imaxdiv264# undef imaxdiv
264265
265# endif // __cplusplus266#endif // __cplusplus
266#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
267267
268#endif // _LIBCPP_INTTYPES_H268#endif // _LIBCPP_INTTYPES_H
lib/libcxx/include/ios+28-28
...@@ -305,25 +305,25 @@ public:...@@ -305,25 +305,25 @@ public:
305 class _LIBCPP_EXPORTED_FROM_ABI Init;305 class _LIBCPP_EXPORTED_FROM_ABI Init;
306306
307 // 27.5.2.2 fmtflags state:307 // 27.5.2.2 fmtflags state:
308 _LIBCPP_HIDE_FROM_ABI fmtflags flags() const;308 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI fmtflags flags() const;
309 _LIBCPP_HIDE_FROM_ABI fmtflags flags(fmtflags __fmtfl);309 _LIBCPP_HIDE_FROM_ABI fmtflags flags(fmtflags __fmtfl);
310 _LIBCPP_HIDE_FROM_ABI fmtflags setf(fmtflags __fmtfl);310 _LIBCPP_HIDE_FROM_ABI fmtflags setf(fmtflags __fmtfl);
311 _LIBCPP_HIDE_FROM_ABI fmtflags setf(fmtflags __fmtfl, fmtflags __mask);311 _LIBCPP_HIDE_FROM_ABI fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
312 _LIBCPP_HIDE_FROM_ABI void unsetf(fmtflags __mask);312 _LIBCPP_HIDE_FROM_ABI void unsetf(fmtflags __mask);
313313
314 _LIBCPP_HIDE_FROM_ABI streamsize precision() const;314 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI streamsize precision() const;
315 _LIBCPP_HIDE_FROM_ABI streamsize precision(streamsize __prec);315 _LIBCPP_HIDE_FROM_ABI streamsize precision(streamsize __prec);
316 _LIBCPP_HIDE_FROM_ABI streamsize width() const;316 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI streamsize width() const;
317 _LIBCPP_HIDE_FROM_ABI streamsize width(streamsize __wide);317 _LIBCPP_HIDE_FROM_ABI streamsize width(streamsize __wide);
318318
319 // 27.5.2.3 locales:319 // 27.5.2.3 locales:
320 locale imbue(const locale& __loc);320 locale imbue(const locale& __loc);
321 locale getloc() const;321 [[__nodiscard__]] locale getloc() const;
322322
323 // 27.5.2.5 storage:323 // 27.5.2.5 storage:
324 static int xalloc();324 [[__nodiscard__]] static int xalloc();
325 long& iword(int __index);325 [[__nodiscard__]] long& iword(int __index);
326 void*& pword(int __index);326 [[__nodiscard__]] void*& pword(int __index);
327327
328 // destructor328 // destructor
329 virtual ~ios_base();329 virtual ~ios_base();
...@@ -338,16 +338,16 @@ public:...@@ -338,16 +338,16 @@ public:
338338
339 static bool sync_with_stdio(bool __sync = true);339 static bool sync_with_stdio(bool __sync = true);
340340
341 _LIBCPP_HIDE_FROM_ABI iostate rdstate() const;341 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iostate rdstate() const;
342 void clear(iostate __state = goodbit);342 void clear(iostate __state = goodbit);
343 _LIBCPP_HIDE_FROM_ABI void setstate(iostate __state);343 _LIBCPP_HIDE_FROM_ABI void setstate(iostate __state);
344344
345 _LIBCPP_HIDE_FROM_ABI bool good() const;345 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool good() const;
346 _LIBCPP_HIDE_FROM_ABI bool eof() const;346 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool eof() const;
347 _LIBCPP_HIDE_FROM_ABI bool fail() const;347 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool fail() const;
348 _LIBCPP_HIDE_FROM_ABI bool bad() const;348 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool bad() const;
349349
350 _LIBCPP_HIDE_FROM_ABI iostate exceptions() const;350 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iostate exceptions() const;
351 _LIBCPP_HIDE_FROM_ABI void exceptions(iostate __iostate);351 _LIBCPP_HIDE_FROM_ABI void exceptions(iostate __iostate);
352352
353 void __set_badbit_and_consider_rethrow();353 void __set_badbit_and_consider_rethrow();
...@@ -425,13 +425,13 @@ template <>...@@ -425,13 +425,13 @@ template <>
425struct is_error_code_enum<io_errc::__lx> : public true_type {};425struct is_error_code_enum<io_errc::__lx> : public true_type {};
426# endif426# endif
427427
428_LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT;428[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT;
429429
430inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(io_errc __e) _NOEXCEPT {430[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(io_errc __e) _NOEXCEPT {
431 return error_code(static_cast<int>(__e), iostream_category());431 return error_code(static_cast<int>(__e), iostream_category());
432}432}
433433
434inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(io_errc __e) _NOEXCEPT {434[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(io_errc __e) _NOEXCEPT {
435 return error_condition(static_cast<int>(__e), iostream_category());435 return error_condition(static_cast<int>(__e), iostream_category());
436}436}
437437
...@@ -580,16 +580,16 @@ public:...@@ -580,16 +580,16 @@ public:
580 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); }580 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); }
581# endif581# endif
582582
583 _LIBCPP_HIDE_FROM_ABI bool operator!() const { return fail(); }583 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool operator!() const { return fail(); }
584 _LIBCPP_HIDE_FROM_ABI iostate rdstate() const { return ios_base::rdstate(); }584 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iostate rdstate() const { return ios_base::rdstate(); }
585 _LIBCPP_HIDE_FROM_ABI void clear(iostate __state = goodbit) { ios_base::clear(__state); }585 _LIBCPP_HIDE_FROM_ABI void clear(iostate __state = goodbit) { ios_base::clear(__state); }
586 _LIBCPP_HIDE_FROM_ABI void setstate(iostate __state) { ios_base::setstate(__state); }586 _LIBCPP_HIDE_FROM_ABI void setstate(iostate __state) { ios_base::setstate(__state); }
587 _LIBCPP_HIDE_FROM_ABI bool good() const { return ios_base::good(); }587 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool good() const { return ios_base::good(); }
588 _LIBCPP_HIDE_FROM_ABI bool eof() const { return ios_base::eof(); }588 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool eof() const { return ios_base::eof(); }
589 _LIBCPP_HIDE_FROM_ABI bool fail() const { return ios_base::fail(); }589 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool fail() const { return ios_base::fail(); }
590 _LIBCPP_HIDE_FROM_ABI bool bad() const { return ios_base::bad(); }590 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool bad() const { return ios_base::bad(); }
591591
592 _LIBCPP_HIDE_FROM_ABI iostate exceptions() const { return ios_base::exceptions(); }592 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iostate exceptions() const { return ios_base::exceptions(); }
593 _LIBCPP_HIDE_FROM_ABI void exceptions(iostate __iostate) { ios_base::exceptions(__iostate); }593 _LIBCPP_HIDE_FROM_ABI void exceptions(iostate __iostate) { ios_base::exceptions(__iostate); }
594594
595 // 27.5.4.1 Constructor/destructor:595 // 27.5.4.1 Constructor/destructor:
...@@ -597,21 +597,21 @@ public:...@@ -597,21 +597,21 @@ public:
597 ~basic_ios() override;597 ~basic_ios() override;
598598
599 // 27.5.4.2 Members:599 // 27.5.4.2 Members:
600 _LIBCPP_HIDE_FROM_ABI basic_ostream<char_type, traits_type>* tie() const;600 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_ostream<char_type, traits_type>* tie() const;
601 _LIBCPP_HIDE_FROM_ABI basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);601 _LIBCPP_HIDE_FROM_ABI basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
602602
603 _LIBCPP_HIDE_FROM_ABI basic_streambuf<char_type, traits_type>* rdbuf() const;603 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_streambuf<char_type, traits_type>* rdbuf() const;
604 _LIBCPP_HIDE_FROM_ABI basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);604 _LIBCPP_HIDE_FROM_ABI basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
605605
606 basic_ios& copyfmt(const basic_ios& __rhs);606 basic_ios& copyfmt(const basic_ios& __rhs);
607607
608 _LIBCPP_HIDE_FROM_ABI char_type fill() const;608 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type fill() const;
609 _LIBCPP_HIDE_FROM_ABI char_type fill(char_type __ch);609 _LIBCPP_HIDE_FROM_ABI char_type fill(char_type __ch);
610610
611 _LIBCPP_HIDE_FROM_ABI locale imbue(const locale& __loc);611 _LIBCPP_HIDE_FROM_ABI locale imbue(const locale& __loc);
612612
613 _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const;613 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const;
614 _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const;614 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const;
615615
616protected:616protected:
617 _LIBCPP_HIDE_FROM_ABI basic_ios() {617 _LIBCPP_HIDE_FROM_ABI basic_ios() {
lib/libcxx/include/istream+19-13
...@@ -70,6 +70,7 @@ public:...@@ -70,6 +70,7 @@ public:
70 basic_istream& getline(char_type* s, streamsize n, char_type delim);70 basic_istream& getline(char_type* s, streamsize n, char_type delim);
7171
72 basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());72 basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());
73 basic_istream& ignore(streamsize n, char_type delim); // Since C++26, implemented as a DR
73 int_type peek();74 int_type peek();
74 basic_istream& read (char_type* s, streamsize n);75 basic_istream& read (char_type* s, streamsize n);
75 streamsize readsome(char_type* s, streamsize n);76 streamsize readsome(char_type* s, streamsize n);
...@@ -172,6 +173,7 @@ template <class Stream, class T>...@@ -172,6 +173,7 @@ template <class Stream, class T>
172# include <__type_traits/conjunction.h>173# include <__type_traits/conjunction.h>
173# include <__type_traits/enable_if.h>174# include <__type_traits/enable_if.h>
174# include <__type_traits/is_base_of.h>175# include <__type_traits/is_base_of.h>
176# include <__type_traits/is_same.h>
175# include <__type_traits/make_unsigned.h>177# include <__type_traits/make_unsigned.h>
176# include <__utility/declval.h>178# include <__utility/declval.h>
177# include <__utility/forward.h>179# include <__utility/forward.h>
...@@ -207,7 +209,7 @@ public:...@@ -207,7 +209,7 @@ public:
207 typedef typename traits_type::off_type off_type;209 typedef typename traits_type::off_type off_type;
208210
209 // 27.7.1.1.1 Constructor/destructor:211 // 27.7.1.1.1 Constructor/destructor:
210 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb)212 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb)
211 : __gc_(0) {213 : __gc_(0) {
212 this->init(__sb);214 this->init(__sb);
213 }215 }
...@@ -219,7 +221,7 @@ protected:...@@ -219,7 +221,7 @@ protected:
219 // 27.7.1.1.2 Assign/swap:221 // 27.7.1.1.2 Assign/swap:
220 inline _LIBCPP_HIDE_FROM_ABI basic_istream& operator=(basic_istream&& __rhs);222 inline _LIBCPP_HIDE_FROM_ABI basic_istream& operator=(basic_istream&& __rhs);
221223
222 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void swap(basic_istream& __rhs) {224 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void swap(basic_istream& __rhs) {
223 std::swap(__gc_, __rhs.__gc_);225 std::swap(__gc_, __rhs.__gc_);
224 basic_ios<char_type, traits_type>::swap(__rhs);226 basic_ios<char_type, traits_type>::swap(__rhs);
225 }227 }
...@@ -232,17 +234,17 @@ public:...@@ -232,17 +234,17 @@ public:
232 class sentry;234 class sentry;
233235
234 // 27.7.1.2 Formatted input:236 // 27.7.1.2 Formatted input:
235 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&)) {237 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&)) {
236 return __pf(*this);238 return __pf(*this);
237 }239 }
238240
239 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream&241 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream&
240 operator>>(basic_ios<char_type, traits_type>& (*__pf)(basic_ios<char_type, traits_type>&)) {242 operator>>(basic_ios<char_type, traits_type>& (*__pf)(basic_ios<char_type, traits_type>&)) {
241 __pf(*this);243 __pf(*this);
242 return *this;244 return *this;
243 }245 }
244246
245 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& operator>>(ios_base& (*__pf)(ios_base&)) {247 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream& operator>>(ios_base& (*__pf)(ios_base&)) {
246 __pf(*this);248 __pf(*this);
247 return *this;249 return *this;
248 }250 }
...@@ -263,35 +265,39 @@ public:...@@ -263,35 +265,39 @@ public:
263 basic_istream& operator>>(void*& __p);265 basic_istream& operator>>(void*& __p);
264266
265 // 27.7.1.3 Unformatted input:267 // 27.7.1.3 Unformatted input:
266 _LIBCPP_HIDE_FROM_ABI streamsize gcount() const { return __gc_; }268 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI streamsize gcount() const { return __gc_; }
267 int_type get();269 int_type get();
268270
269 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& get(char_type& __c) {271 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream& get(char_type& __c) {
270 int_type __ch = get();272 int_type __ch = get();
271 if (__ch != traits_type::eof())273 if (__ch != traits_type::eof())
272 __c = traits_type::to_char_type(__ch);274 __c = traits_type::to_char_type(__ch);
273 return *this;275 return *this;
274 }276 }
275277
276 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& get(char_type* __s, streamsize __n) {278 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream& get(char_type* __s, streamsize __n) {
277 return get(__s, __n, this->widen('\n'));279 return get(__s, __n, this->widen('\n'));
278 }280 }
279281
280 basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);282 basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);
281283
282 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& get(basic_streambuf<char_type, traits_type>& __sb) {284 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream& get(basic_streambuf<char_type, traits_type>& __sb) {
283 return get(__sb, this->widen('\n'));285 return get(__sb, this->widen('\n'));
284 }286 }
285287
286 basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);288 basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
287289
288 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& getline(char_type* __s, streamsize __n) {290 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_istream& getline(char_type* __s, streamsize __n) {
289 return getline(__s, __n, this->widen('\n'));291 return getline(__s, __n, this->widen('\n'));
290 }292 }
291293
292 basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);294 basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);
293295
294 basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());296 basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
297 template <class _Tp = char_type, __enable_if_t<is_same<_Tp, char>::value, int> = 0>
298 _LIBCPP_HIDE_FROM_ABI basic_istream& ignore(streamsize __n, char_type __delim) {
299 return ignore(__n, traits_type::to_int_type(__delim));
300 }
295 int_type peek();301 int_type peek();
296 basic_istream& read(char_type* __s, streamsize __n);302 basic_istream& read(char_type* __s, streamsize __n);
297 streamsize readsome(char_type* __s, streamsize __n);303 streamsize readsome(char_type* __s, streamsize __n);
...@@ -300,7 +306,7 @@ public:...@@ -300,7 +306,7 @@ public:
300 basic_istream& unget();306 basic_istream& unget();
301 int sync();307 int sync();
302308
303 pos_type tellg();309 [[__nodiscard__]] pos_type tellg();
304 basic_istream& seekg(pos_type __pos);310 basic_istream& seekg(pos_type __pos);
305 basic_istream& seekg(off_type __off, ios_base::seekdir __dir);311 basic_istream& seekg(off_type __off, ios_base::seekdir __dir);
306};312};
...@@ -1178,7 +1184,7 @@ public:...@@ -1178,7 +1184,7 @@ public:
1178 typedef typename traits_type::off_type off_type;1184 typedef typename traits_type::off_type off_type;
11791185
1180 // constructor/destructor1186 // constructor/destructor
1181 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)1187 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
1182 : basic_istream<_CharT, _Traits>(__sb) {}1188 : basic_istream<_CharT, _Traits>(__sb) {}
11831189
1184 ~basic_iostream() override;1190 ~basic_iostream() override;
...@@ -1189,7 +1195,7 @@ protected:...@@ -1189,7 +1195,7 @@ protected:
1189 // assign/swap1195 // assign/swap
1190 inline _LIBCPP_HIDE_FROM_ABI basic_iostream& operator=(basic_iostream&& __rhs);1196 inline _LIBCPP_HIDE_FROM_ABI basic_iostream& operator=(basic_iostream&& __rhs);
11911197
1192 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void swap(basic_iostream& __rhs) {1198 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void swap(basic_iostream& __rhs) {
1193 basic_istream<char_type, traits_type>::swap(__rhs);1199 basic_istream<char_type, traits_type>::swap(__rhs);
1194 }1200 }
1195};1201};
lib/libcxx/include/iterator+10
...@@ -737,6 +737,16 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;...@@ -737,6 +737,16 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
737# include <compare>737# include <compare>
738# include <concepts>738# include <concepts>
739739
740// [range.access.general]
741# if _LIBCPP_STD_VER >= 20
742# include <__ranges/access.h>
743# include <__ranges/data.h>
744# include <__ranges/empty.h>
745# include <__ranges/rbegin.h>
746# include <__ranges/rend.h>
747# include <__ranges/size.h>
748# endif
749
740# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)750# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
741# pragma GCC system_header751# pragma GCC system_header
742# endif752# endif
lib/libcxx/include/latch+7-5
...@@ -70,7 +70,9 @@ class latch {...@@ -70,7 +70,9 @@ class latch {
70 atomic<ptrdiff_t> __a_;70 atomic<ptrdiff_t> __a_;
7171
72public:72public:
73 static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return numeric_limits<ptrdiff_t>::max(); }73 [[nodiscard]] static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept {
74 return numeric_limits<ptrdiff_t>::max();
75 }
7476
75 inline _LIBCPP_HIDE_FROM_ABI constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected) {77 inline _LIBCPP_HIDE_FROM_ABI constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected) {
76 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(78 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
...@@ -87,7 +89,7 @@ public:...@@ -87,7 +89,7 @@ public:
87 latch(const latch&) = delete;89 latch(const latch&) = delete;
88 latch& operator=(const latch&) = delete;90 latch& operator=(const latch&) = delete;
8991
90 inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void count_down(ptrdiff_t __update = 1) {92 inline _LIBCPP_HIDE_FROM_ABI void count_down(ptrdiff_t __update = 1) {
91 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update >= 0, "latch::count_down called with a negative value");93 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update >= 0, "latch::count_down called with a negative value");
92 auto const __old = __a_.fetch_sub(__update, memory_order_release);94 auto const __old = __a_.fetch_sub(__update, memory_order_release);
93 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(95 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
...@@ -97,16 +99,16 @@ public:...@@ -97,16 +99,16 @@ public:
97 if (__old == __update)99 if (__old == __update)
98 __a_.notify_all();100 __a_.notify_all();
99 }101 }
100 inline _LIBCPP_HIDE_FROM_ABI bool try_wait() const noexcept {102 [[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI bool try_wait() const noexcept {
101 auto __value = __a_.load(memory_order_acquire);103 auto __value = __a_.load(memory_order_acquire);
102 return try_wait_impl(__value);104 return try_wait_impl(__value);
103 }105 }
104 inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait() const {106 inline _LIBCPP_HIDE_FROM_ABI void wait() const {
105 std::__atomic_wait_unless(__a_, memory_order_acquire, [this](ptrdiff_t& __value) -> bool {107 std::__atomic_wait_unless(__a_, memory_order_acquire, [this](ptrdiff_t& __value) -> bool {
106 return try_wait_impl(__value);108 return try_wait_impl(__value);
107 });109 });
108 }110 }
109 inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void arrive_and_wait(ptrdiff_t __update = 1) {111 inline _LIBCPP_HIDE_FROM_ABI void arrive_and_wait(ptrdiff_t __update = 1) {
110 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update >= 0, "latch::arrive_and_wait called with a negative value");112 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update >= 0, "latch::arrive_and_wait called with a negative value");
111 // other preconditions on __update are checked in count_down()113 // other preconditions on __update are checked in count_down()
112114
lib/libcxx/include/limits+4-4
...@@ -107,7 +107,7 @@ template<> class numeric_limits<cv long double>;...@@ -107,7 +107,7 @@ template<> class numeric_limits<cv long double>;
107#else107#else
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_signed.h>110# include <__type_traits/is_same.h>
111111
112# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)112# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
113# pragma GCC system_header113# pragma GCC system_header
...@@ -217,10 +217,10 @@ protected:...@@ -217,10 +217,10 @@ protected:
217217
218 static _LIBCPP_CONSTEXPR const bool is_iec559 = false;218 static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
219 static _LIBCPP_CONSTEXPR const bool is_bounded = true;219 static _LIBCPP_CONSTEXPR const bool is_bounded = true;
220 static _LIBCPP_CONSTEXPR const bool is_modulo = !std::is_signed<_Tp>::value;220 static _LIBCPP_CONSTEXPR const bool is_modulo = !is_signed;
221221
222# if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || defined(__wasm__)222# if defined(__i386__) || defined(__x86_64__) || defined(__wasm__)
223 static _LIBCPP_CONSTEXPR const bool traps = true;223 static _LIBCPP_CONSTEXPR const bool traps = is_same<decltype(+_Tp(0)), _Tp>::value;
224# else224# else
225 static _LIBCPP_CONSTEXPR const bool traps = false;225 static _LIBCPP_CONSTEXPR const bool traps = false;
226# endif226# endif
lib/libcxx/include/list+61-79
...@@ -228,15 +228,14 @@ template <class T, class Allocator, class Predicate>...@@ -228,15 +228,14 @@ template <class T, class Allocator, class Predicate>
228# include <__ranges/concepts.h>228# include <__ranges/concepts.h>
229# include <__ranges/container_compatible_range.h>229# include <__ranges/container_compatible_range.h>
230# include <__ranges/from_range.h>230# include <__ranges/from_range.h>
231# include <__type_traits/conditional.h>
232# include <__type_traits/container_traits.h>231# include <__type_traits/container_traits.h>
233# include <__type_traits/enable_if.h>232# include <__type_traits/enable_if.h>
234# include <__type_traits/is_allocator.h>233# include <__type_traits/is_allocator.h>
235# include <__type_traits/is_nothrow_assignable.h>234# include <__type_traits/is_nothrow_assignable.h>
236# include <__type_traits/is_nothrow_constructible.h>235# include <__type_traits/is_nothrow_constructible.h>
237# include <__type_traits/is_pointer.h>
238# include <__type_traits/is_same.h>236# include <__type_traits/is_same.h>
239# include <__type_traits/type_identity.h>237# include <__type_traits/type_identity.h>
238# include <__utility/exception_guard.h>
240# include <__utility/forward.h>239# include <__utility/forward.h>
241# include <__utility/move.h>240# include <__utility/move.h>
242# include <__utility/swap.h>241# include <__utility/swap.h>
...@@ -275,17 +274,6 @@ template <class _Tp, class _VoidPtr>...@@ -275,17 +274,6 @@ template <class _Tp, class _VoidPtr>
275struct __list_node_pointer_traits {274struct __list_node_pointer_traits {
276 typedef __rebind_pointer_t<_VoidPtr, __list_node<_Tp, _VoidPtr> > __node_pointer;275 typedef __rebind_pointer_t<_VoidPtr, __list_node<_Tp, _VoidPtr> > __node_pointer;
277 typedef __rebind_pointer_t<_VoidPtr, __list_node_base<_Tp, _VoidPtr> > __base_pointer;276 typedef __rebind_pointer_t<_VoidPtr, __list_node_base<_Tp, _VoidPtr> > __base_pointer;
278
279// TODO(LLVM 22): Remove this check
280# ifndef _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
281 static_assert(sizeof(__node_pointer) == sizeof(__node_pointer) && _LIBCPP_ALIGNOF(__base_pointer) ==
282 _LIBCPP_ALIGNOF(__node_pointer),
283 "It looks like you are using std::list with a fancy pointer type that thas a different representation "
284 "depending on whether it points to a list base pointer or a list node pointer (both of which are "
285 "implementation details of the standard library). This means that your ABI is being broken between "
286 "LLVM 19 and LLVM 20. If you don't care about your ABI being broken, define the "
287 "_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB macro to silence this diagnostic.");
288# endif
289};277};
290278
291template <class _Tp, class _VoidPtr>279template <class _Tp, class _VoidPtr>
...@@ -724,7 +712,7 @@ public:...@@ -724,7 +712,7 @@ public:
724 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);712 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);
725# endif713# endif
726 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);714 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);
727 template <__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>715 template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
728 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI716 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI
729 list(size_type __n, const value_type& __x, const allocator_type& __a)717 list(size_type __n, const value_type& __x, const allocator_type& __a)
730 : __base(__a) {718 : __base(__a) {
...@@ -786,57 +774,71 @@ public:...@@ -786,57 +774,71 @@ public:
786774
787 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __x);775 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __x);
788776
789 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT;777 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT;
790778
791 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return this->__size_; }779 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
780 return this->__size_;
781 }
792 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {782 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
793 return __base::empty();783 return __base::empty();
794 }784 }
795 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {785 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
796 return std::min<size_type>(this->__node_alloc_max_size(), numeric_limits<difference_type >::max());786 return std::min<size_type>(this->__node_alloc_max_size(), numeric_limits<difference_type >::max());
797 }787 }
798788
799 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __base::begin(); }789 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
800 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __base::begin(); }790 return __base::begin();
801 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __base::end(); }791 }
802 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __base::end(); }792 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
803 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {793 return __base::begin();
794 }
795 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
796 return __base::end();
797 }
798 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
799 return __base::end();
800 }
801 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
804 return __base::begin();802 return __base::begin();
805 }803 }
806 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __base::end(); }804 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {
805 return __base::end();
806 }
807807
808 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {808 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {
809 return reverse_iterator(end());809 return reverse_iterator(end());
810 }810 }
811 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {811 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
812 rbegin() const _NOEXCEPT {
812 return const_reverse_iterator(end());813 return const_reverse_iterator(end());
813 }814 }
814 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT {815 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT {
815 return reverse_iterator(begin());816 return reverse_iterator(begin());
816 }817 }
817 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {818 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
818 return const_reverse_iterator(begin());819 return const_reverse_iterator(begin());
819 }820 }
820 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {821 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
822 crbegin() const _NOEXCEPT {
821 return const_reverse_iterator(end());823 return const_reverse_iterator(end());
822 }824 }
823 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {825 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {
824 return const_reverse_iterator(begin());826 return const_reverse_iterator(begin());
825 }827 }
826828
827 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reference front() {829 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reference front() {
828 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");830 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");
829 return __base::__end_.__next_->__as_node()->__get_value();831 return __base::__end_.__next_->__as_node()->__get_value();
830 }832 }
831 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference front() const {833 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference front() const {
832 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");834 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");
833 return __base::__end_.__next_->__as_node()->__get_value();835 return __base::__end_.__next_->__as_node()->__get_value();
834 }836 }
835 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reference back() {837 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI reference back() {
836 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");838 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");
837 return __base::__end_.__prev_->__as_node()->__get_value();839 return __base::__end_.__prev_->__as_node()->__get_value();
838 }840 }
839 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference back() const {841 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference back() const {
840 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");842 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");
841 return __base::__end_.__prev_->__as_node()->__get_value();843 return __base::__end_.__prev_->__as_node()->__get_value();
842 }844 }
...@@ -1000,22 +1002,22 @@ private:...@@ -1000,22 +1002,22 @@ private:
10001002
1001# if _LIBCPP_STD_VER >= 171003# if _LIBCPP_STD_VER >= 17
1002template <class _InputIterator,1004template <class _InputIterator,
1003 class _Alloc = allocator<__iter_value_type<_InputIterator>>,1005 class _Alloc = allocator<__iterator_value_type<_InputIterator>>,
1004 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1006 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1005 class = enable_if_t<__is_allocator<_Alloc>::value> >1007 class = enable_if_t<__is_allocator_v<_Alloc>>>
1006list(_InputIterator, _InputIterator) -> list<__iter_value_type<_InputIterator>, _Alloc>;1008list(_InputIterator, _InputIterator) -> list<__iterator_value_type<_InputIterator>, _Alloc>;
10071009
1008template <class _InputIterator,1010template <class _InputIterator,
1009 class _Alloc,1011 class _Alloc,
1010 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1012 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1011 class = enable_if_t<__is_allocator<_Alloc>::value> >1013 class = enable_if_t<__is_allocator_v<_Alloc>>>
1012list(_InputIterator, _InputIterator, _Alloc) -> list<__iter_value_type<_InputIterator>, _Alloc>;1014list(_InputIterator, _InputIterator, _Alloc) -> list<__iterator_value_type<_InputIterator>, _Alloc>;
1013# endif1015# endif
10141016
1015# if _LIBCPP_STD_VER >= 231017# if _LIBCPP_STD_VER >= 23
1016template <ranges::input_range _Range,1018template <ranges::input_range _Range,
1017 class _Alloc = allocator<ranges::range_value_t<_Range>>,1019 class _Alloc = allocator<ranges::range_value_t<_Range>>,
1018 class = enable_if_t<__is_allocator<_Alloc>::value> >1020 class = enable_if_t<__is_allocator_v<_Alloc>>>
1019list(from_range_t, _Range&&, _Alloc = _Alloc()) -> list<ranges::range_value_t<_Range>, _Alloc>;1021list(from_range_t, _Range&&, _Alloc = _Alloc()) -> list<ranges::range_value_t<_Range>, _Alloc>;
1020# endif1022# endif
10211023
...@@ -1233,14 +1235,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _...@@ -1233,14 +1235,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
1233 ++__ds;1235 ++__ds;
1234 __r = iterator(__node->__as_link());1236 __r = iterator(__node->__as_link());
1235 iterator __e = __r;1237 iterator __e = __r;
1236# if _LIBCPP_HAS_EXCEPTIONS1238 auto __guard = std::__make_exception_guard([&] {
1237 try {
1238# endif // _LIBCPP_HAS_EXCEPTIONS
1239 for (--__n; __n != 0; --__n, (void)++__e, ++__ds) {
1240 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr, __x)->__as_link();
1241 }
1242# if _LIBCPP_HAS_EXCEPTIONS
1243 } catch (...) {
1244 while (true) {1239 while (true) {
1245 __base_pointer __prev = __e.__ptr_->__prev_;1240 __base_pointer __prev = __e.__ptr_->__prev_;
1246 __node_pointer __current = __e.__ptr_->__as_node();1241 __node_pointer __current = __e.__ptr_->__as_node();
...@@ -1249,9 +1244,11 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _...@@ -1249,9 +1244,11 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
1249 break;1244 break;
1250 __e = iterator(__prev);1245 __e = iterator(__prev);
1251 }1246 }
1252 throw;1247 });
1248 for (--__n; __n != 0; --__n, (void)++__e, ++__ds) {
1249 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr, __x)->__as_link();
1253 }1250 }
1254# endif // _LIBCPP_HAS_EXCEPTIONS1251 __guard.__complete();
1255 __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);1252 __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
1256 this->__size_ += __ds;1253 this->__size_ += __ds;
1257 }1254 }
...@@ -1276,14 +1273,7 @@ list<_Tp, _Alloc>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Se...@@ -1276,14 +1273,7 @@ list<_Tp, _Alloc>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Se
1276 ++__ds;1273 ++__ds;
1277 __r = iterator(__node->__as_link());1274 __r = iterator(__node->__as_link());
1278 iterator __e = __r;1275 iterator __e = __r;
1279# if _LIBCPP_HAS_EXCEPTIONS1276 auto __guard = std::__make_exception_guard([&] {
1280 try {
1281# endif // _LIBCPP_HAS_EXCEPTIONS
1282 for (++__f; __f != __l; ++__f, (void)++__e, ++__ds) {
1283 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr, *__f)->__as_link();
1284 }
1285# if _LIBCPP_HAS_EXCEPTIONS
1286 } catch (...) {
1287 while (true) {1277 while (true) {
1288 __base_pointer __prev = __e.__ptr_->__prev_;1278 __base_pointer __prev = __e.__ptr_->__prev_;
1289 __node_pointer __current = __e.__ptr_->__as_node();1279 __node_pointer __current = __e.__ptr_->__as_node();
...@@ -1292,9 +1282,11 @@ list<_Tp, _Alloc>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Se...@@ -1292,9 +1282,11 @@ list<_Tp, _Alloc>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Se
1292 break;1282 break;
1293 __e = iterator(__prev);1283 __e = iterator(__prev);
1294 }1284 }
1295 throw;1285 });
1286 for (++__f; __f != __l; ++__f, (void)++__e, ++__ds) {
1287 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr, *__f)->__as_link();
1296 }1288 }
1297# endif // _LIBCPP_HAS_EXCEPTIONS1289 __guard.__complete();
1298 __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);1290 __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
1299 this->__size_ += __ds;1291 this->__size_ += __ds;
1300 }1292 }
...@@ -1452,14 +1444,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n) {...@@ -1452,14 +1444,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n) {
1452 ++__ds;1444 ++__ds;
1453 iterator __r = iterator(__node->__as_link());1445 iterator __r = iterator(__node->__as_link());
1454 iterator __e = __r;1446 iterator __e = __r;
1455# if _LIBCPP_HAS_EXCEPTIONS1447 auto __guard = std::__make_exception_guard([&] {
1456 try {
1457# endif // _LIBCPP_HAS_EXCEPTIONS
1458 for (--__n; __n != 0; --__n, (void)++__e, ++__ds) {
1459 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr)->__as_link();
1460 }
1461# if _LIBCPP_HAS_EXCEPTIONS
1462 } catch (...) {
1463 while (true) {1448 while (true) {
1464 __base_pointer __prev = __e.__ptr_->__prev_;1449 __base_pointer __prev = __e.__ptr_->__prev_;
1465 __node_pointer __current = __e.__ptr_->__as_node();1450 __node_pointer __current = __e.__ptr_->__as_node();
...@@ -1468,9 +1453,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n) {...@@ -1468,9 +1453,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n) {
1468 break;1453 break;
1469 __e = iterator(__prev);1454 __e = iterator(__prev);
1470 }1455 }
1471 throw;1456 });
1457 for (--__n; __n != 0; --__n, (void)++__e, ++__ds) {
1458 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr)->__as_link();
1472 }1459 }
1473# endif // _LIBCPP_HAS_EXCEPTIONS1460 __guard.__complete();
1474 __link_nodes_at_back(__r.__ptr_, __e.__ptr_);1461 __link_nodes_at_back(__r.__ptr_, __e.__ptr_);
1475 this->__size_ += __ds;1462 this->__size_ += __ds;
1476 }1463 }
...@@ -1488,14 +1475,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n, cons...@@ -1488,14 +1475,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n, cons
1488 __base_pointer __nl = __node->__as_link();1475 __base_pointer __nl = __node->__as_link();
1489 iterator __r = iterator(__nl);1476 iterator __r = iterator(__nl);
1490 iterator __e = __r;1477 iterator __e = __r;
1491# if _LIBCPP_HAS_EXCEPTIONS1478 auto __guard = std::__make_exception_guard([&] {
1492 try {
1493# endif // _LIBCPP_HAS_EXCEPTIONS
1494 for (--__n; __n != 0; --__n, (void)++__e, ++__ds) {
1495 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr, __x)->__as_link();
1496 }
1497# if _LIBCPP_HAS_EXCEPTIONS
1498 } catch (...) {
1499 while (true) {1479 while (true) {
1500 __base_pointer __prev = __e.__ptr_->__prev_;1480 __base_pointer __prev = __e.__ptr_->__prev_;
1501 __node_pointer __current = __e.__ptr_->__as_node();1481 __node_pointer __current = __e.__ptr_->__as_node();
...@@ -1504,9 +1484,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n, cons...@@ -1504,9 +1484,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void list<_Tp, _Alloc>::resize(size_type __n, cons
1504 break;1484 break;
1505 __e = iterator(__prev);1485 __e = iterator(__prev);
1506 }1486 }
1507 throw;1487 });
1488 for (--__n; __n != 0; --__n, (void)++__e, ++__ds) {
1489 __e.__ptr_->__next_ = this->__create_node(/* prev = */ __e.__ptr_, /* next = */ nullptr, __x)->__as_link();
1508 }1490 }
1509# endif // _LIBCPP_HAS_EXCEPTIONS1491 __guard.__complete();
1510 __link_nodes(__base::__end_as_link(), __r.__ptr_, __e.__ptr_);1492 __link_nodes(__base::__end_as_link(), __r.__ptr_, __e.__ptr_);
1511 this->__size_ += __ds;1493 this->__size_ += __ds;
1512 }1494 }
lib/libcxx/include/map+386-274
...@@ -577,12 +577,12 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20...@@ -577,12 +577,12 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
577# include <__algorithm/equal.h>577# include <__algorithm/equal.h>
578# include <__algorithm/lexicographical_compare.h>578# include <__algorithm/lexicographical_compare.h>
579# include <__algorithm/lexicographical_compare_three_way.h>579# include <__algorithm/lexicographical_compare_three_way.h>
580# include <__algorithm/specialized_algorithms.h>
580# include <__assert>581# include <__assert>
581# include <__config>582# include <__config>
582# include <__functional/binary_function.h>583# include <__functional/binary_function.h>
583# include <__functional/is_transparent.h>584# include <__functional/is_transparent.h>
584# include <__functional/operations.h>585# include <__functional/operations.h>
585# include <__fwd/map.h>
586# include <__iterator/erase_if_container.h>586# include <__iterator/erase_if_container.h>
587# include <__iterator/iterator_traits.h>587# include <__iterator/iterator_traits.h>
588# include <__iterator/ranges_iterator_traits.h>588# include <__iterator/ranges_iterator_traits.h>
...@@ -590,19 +590,23 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20...@@ -590,19 +590,23 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
590# include <__memory/addressof.h>590# include <__memory/addressof.h>
591# include <__memory/allocator.h>591# include <__memory/allocator.h>
592# include <__memory/allocator_traits.h>592# include <__memory/allocator_traits.h>
593# include <__memory/compressed_pair.h>
593# include <__memory/pointer_traits.h>594# include <__memory/pointer_traits.h>
594# include <__memory/unique_ptr.h>595# include <__memory/unique_ptr.h>
595# include <__memory_resource/polymorphic_allocator.h>596# include <__memory_resource/polymorphic_allocator.h>
596# include <__node_handle>597# include <__node_handle>
598# include <__ranges/access.h>
597# include <__ranges/concepts.h>599# include <__ranges/concepts.h>
598# include <__ranges/container_compatible_range.h>600# include <__ranges/container_compatible_range.h>
599# include <__ranges/from_range.h>601# include <__ranges/from_range.h>
600# include <__tree>602# include <__tree>
601# include <__type_traits/container_traits.h>603# include <__type_traits/container_traits.h>
602# include <__type_traits/is_allocator.h>604# include <__type_traits/is_allocator.h>
605# include <__type_traits/make_transparent.h>
603# include <__type_traits/remove_const.h>606# include <__type_traits/remove_const.h>
604# include <__type_traits/type_identity.h>607# include <__type_traits/type_identity.h>
605# include <__utility/forward.h>608# include <__utility/forward.h>
609# include <__utility/lazy_synth_three_way_comparator.h>
606# include <__utility/pair.h>610# include <__utility/pair.h>
607# include <__utility/piecewise_construct.h>611# include <__utility/piecewise_construct.h>
608# include <__utility/swap.h>612# include <__utility/swap.h>
...@@ -632,47 +636,9 @@ _LIBCPP_PUSH_MACROS...@@ -632,47 +636,9 @@ _LIBCPP_PUSH_MACROS
632636
633_LIBCPP_BEGIN_NAMESPACE_STD637_LIBCPP_BEGIN_NAMESPACE_STD
634638
635template <class _Key,
636 class _CP,
637 class _Compare,
638 bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value>
639class __map_value_compare : private _Compare {
640public:
641 _LIBCPP_HIDE_FROM_ABI __map_value_compare() _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
642 : _Compare() {}
643 _LIBCPP_HIDE_FROM_ABI __map_value_compare(_Compare __c) _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
644 : _Compare(__c) {}
645 _LIBCPP_HIDE_FROM_ABI const _Compare& key_comp() const _NOEXCEPT { return *this; }
646 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _CP& __y) const {
647 return static_cast<const _Compare&>(*this)(__x.first, __y.first);
648 }
649 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _Key& __y) const {
650 return static_cast<const _Compare&>(*this)(__x.first, __y);
651 }
652 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const {
653 return static_cast<const _Compare&>(*this)(__x, __y.first);
654 }
655 _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) {
656 using std::swap;
657 swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
658 }
659
660# if _LIBCPP_STD_VER >= 14
661 template <typename _K2>
662 _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _CP& __y) const {
663 return static_cast<const _Compare&>(*this)(__x, __y.first);
664 }
665
666 template <typename _K2>
667 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _K2& __y) const {
668 return static_cast<const _Compare&>(*this)(__x.first, __y);
669 }
670# endif
671};
672
673template <class _Key, class _CP, class _Compare>639template <class _Key, class _CP, class _Compare>
674class __map_value_compare<_Key, _CP, _Compare, false> {640class __map_value_compare {
675 _Compare __comp_;641 _LIBCPP_COMPRESSED_ELEMENT(_Compare, __comp_);
676642
677public:643public:
678 _LIBCPP_HIDE_FROM_ABI __map_value_compare() _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)644 _LIBCPP_HIDE_FROM_ABI __map_value_compare() _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
...@@ -684,7 +650,7 @@ public:...@@ -684,7 +650,7 @@ public:
684 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _CP& __y) const { return __comp_(__x.first, __y.first); }650 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _CP& __y) const { return __comp_(__x.first, __y.first); }
685 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _Key& __y) const { return __comp_(__x.first, __y); }651 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _Key& __y) const { return __comp_(__x.first, __y); }
686 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const { return __comp_(__x, __y.first); }652 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const { return __comp_(__x, __y.first); }
687 void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) {653 _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) {
688 using std::swap;654 using std::swap;
689 swap(__comp_, __y.__comp_);655 swap(__comp_, __y.__comp_);
690 }656 }
...@@ -702,9 +668,58 @@ public:...@@ -702,9 +668,58 @@ public:
702# endif668# endif
703};669};
704670
705template <class _Key, class _CP, class _Compare, bool __b>671template <class _Key, class _MapValueT, class _Compare>
672struct __make_transparent<_Key, __map_value_compare<_Key, _MapValueT, _Compare> > {
673 using type _LIBCPP_NODEBUG = __map_value_compare<_Key, _MapValueT, __make_transparent_t<_Key, _Compare> >;
674};
675
676# if _LIBCPP_STD_VER >= 14
677template <class _MapValueT, class _Key, class _Compare>
678struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _MapValueT, _MapValueT> {
679 __lazy_synth_three_way_comparator<_Compare, _Key, _Key> __comp_;
680
681 __lazy_synth_three_way_comparator(
682 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)
683 : __comp_(__comp.key_comp()) {}
684
685 _LIBCPP_HIDE_FROM_ABI auto
686 operator()(_LIBCPP_LIFETIMEBOUND const _MapValueT& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {
687 return __comp_(__lhs.first, __rhs.first);
688 }
689};
690
691template <class _MapValueT, class _Key, class _TransparentKey, class _Compare>
692struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _TransparentKey, _MapValueT> {
693 __lazy_synth_three_way_comparator<_Compare, _TransparentKey, _Key> __comp_;
694
695 __lazy_synth_three_way_comparator(
696 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)
697 : __comp_(__comp.key_comp()) {}
698
699 _LIBCPP_HIDE_FROM_ABI auto
700 operator()(_LIBCPP_LIFETIMEBOUND const _TransparentKey& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {
701 return __comp_(__lhs, __rhs.first);
702 }
703};
704
705template <class _MapValueT, class _Key, class _TransparentKey, class _Compare>
706struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _MapValueT, _TransparentKey> {
707 __lazy_synth_three_way_comparator<_Compare, _Key, _TransparentKey> __comp_;
708
709 __lazy_synth_three_way_comparator(
710 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)
711 : __comp_(__comp.key_comp()) {}
712
713 _LIBCPP_HIDE_FROM_ABI auto
714 operator()(_LIBCPP_LIFETIMEBOUND const _MapValueT& __lhs, _LIBCPP_LIFETIMEBOUND const _TransparentKey& __rhs) const {
715 return __comp_(__lhs.first, __rhs);
716 }
717};
718# endif // _LIBCPP_STD_VER >= 14
719
720template <class _Key, class _CP, class _Compare>
706inline _LIBCPP_HIDE_FROM_ABI void721inline _LIBCPP_HIDE_FROM_ABI void
707swap(__map_value_compare<_Key, _CP, _Compare, __b>& __x, __map_value_compare<_Key, _CP, _Compare, __b>& __y)722swap(__map_value_compare<_Key, _CP, _Compare>& __x, __map_value_compare<_Key, _CP, _Compare>& __y)
708 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {723 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
709 __x.swap(__y);724 __x.swap(__y);
710}725}
...@@ -742,9 +757,9 @@ public:...@@ -742,9 +757,9 @@ public:
742757
743 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {758 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {
744 if (__second_constructed)759 if (__second_constructed)
745 __alloc_traits::destroy(__na_, std::addressof(__p->__value_.second));760 __alloc_traits::destroy(__na_, std::addressof(__p->__get_value().second));
746 if (__first_constructed)761 if (__first_constructed)
747 __alloc_traits::destroy(__na_, std::addressof(__p->__value_.first));762 __alloc_traits::destroy(__na_, std::addressof(__p->__get_value().first));
748 if (__p)763 if (__p)
749 __alloc_traits::deallocate(__na_, __p, 1);764 __alloc_traits::deallocate(__na_, __p, 1);
750 }765 }
...@@ -804,7 +819,26 @@ public:...@@ -804,7 +819,26 @@ public:
804 friend class multimap;819 friend class multimap;
805 template <class>820 template <class>
806 friend class __map_const_iterator;821 friend class __map_const_iterator;
822
823 template <class, class...>
824 friend struct __specialized_algorithm;
825};
826
827# ifndef _LIBCPP_CXX03_LANG
828template <class _Alg, class _TreeIterator>
829struct __specialized_algorithm<_Alg, __iterator_pair<__map_iterator<_TreeIterator>, __map_iterator<_TreeIterator>>> {
830 using __base _LIBCPP_NODEBUG = __specialized_algorithm<_Alg, __iterator_pair<_TreeIterator, _TreeIterator>>;
831
832 static const bool __has_algorithm = __base::__has_algorithm;
833
834 using __iterator _LIBCPP_NODEBUG = __map_iterator<_TreeIterator>;
835
836 template <class... _Args>
837 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Args&&... __args) {
838 __base()(__first.__i_, __last.__i_, std::forward<_Args>(__args)...);
839 }
807};840};
841# endif
808842
809template <class _TreeIterator>843template <class _TreeIterator>
810class __map_const_iterator {844class __map_const_iterator {
...@@ -859,9 +893,33 @@ public:...@@ -859,9 +893,33 @@ public:
859 friend class multimap;893 friend class multimap;
860 template <class, class, class>894 template <class, class, class>
861 friend class __tree_const_iterator;895 friend class __tree_const_iterator;
896
897 template <class, class...>
898 friend struct __specialized_algorithm;
862};899};
863900
864template <class _Key, class _Tp, class _Compare, class _Allocator>901# ifndef _LIBCPP_CXX03_LANG
902template <class _Alg, class _TreeIterator>
903struct __specialized_algorithm<
904 _Alg,
905 __iterator_pair<__map_const_iterator<_TreeIterator>, __map_const_iterator<_TreeIterator>>> {
906 using __base _LIBCPP_NODEBUG = __specialized_algorithm<_Alg, __iterator_pair<_TreeIterator, _TreeIterator>>;
907
908 static const bool __has_algorithm = __base::__has_algorithm;
909
910 using __iterator _LIBCPP_NODEBUG = __map_const_iterator<_TreeIterator>;
911
912 template <class... _Args>
913 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Args&&... __args) {
914 __base()(__first.__i_, __last.__i_, std::forward<_Args>(__args)...);
915 }
916};
917# endif
918
919template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
920class multimap;
921
922template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
865class map {923class map {
866public:924public:
867 // types:925 // types:
...@@ -970,17 +1028,17 @@ public:...@@ -970,17 +1028,17 @@ public:
970 : map(from_range, std::forward<_Range>(__range), key_compare(), __a) {}1028 : map(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
971# endif1029# endif
9721030
973 _LIBCPP_HIDE_FROM_ABI map(const map& __m) : __tree_(__m.__tree_) { insert(__m.begin(), __m.end()); }1031 _LIBCPP_HIDE_FROM_ABI map(const map& __m) = default;
9741032
975 _LIBCPP_HIDE_FROM_ABI map& operator=(const map& __m) = default;1033 _LIBCPP_HIDE_FROM_ABI map& operator=(const map& __m) = default;
9761034
977# ifndef _LIBCPP_CXX03_LANG1035# ifndef _LIBCPP_CXX03_LANG
9781036
979 _LIBCPP_HIDE_FROM_ABI map(map&& __m) noexcept(is_nothrow_move_constructible<__base>::value) = default;1037 _LIBCPP_HIDE_FROM_ABI map(map&& __m) = default;
9801038
981 _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a);1039 _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a) : __tree_(std::move(__m.__tree_), __a) {}
9821040
983 _LIBCPP_HIDE_FROM_ABI map& operator=(map&& __m) noexcept(is_nothrow_move_assignable<__base>::value) = default;1041 _LIBCPP_HIDE_FROM_ABI map& operator=(map&& __m) = default;
9841042
985 _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())1043 _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
986 : __tree_(__vc(__comp)) {1044 : __tree_(__vc(__comp)) {
...@@ -998,7 +1056,8 @@ public:...@@ -998,7 +1056,8 @@ public:
998# endif1056# endif
9991057
1000 _LIBCPP_HIDE_FROM_ABI map& operator=(initializer_list<value_type> __il) {1058 _LIBCPP_HIDE_FROM_ABI map& operator=(initializer_list<value_type> __il) {
1001 __tree_.__assign_unique(__il.begin(), __il.end());1059 clear();
1060 insert(__il.begin(), __il.end());
1002 return *this;1061 return *this;
1003 }1062 }
10041063
...@@ -1006,43 +1065,66 @@ public:...@@ -1006,43 +1065,66 @@ public:
10061065
1007 _LIBCPP_HIDE_FROM_ABI explicit map(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}1066 _LIBCPP_HIDE_FROM_ABI explicit map(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}
10081067
1009 _LIBCPP_HIDE_FROM_ABI map(const map& __m, const allocator_type& __a)1068 _LIBCPP_HIDE_FROM_ABI map(const map& __m, const allocator_type& __alloc) : __tree_(__m.__tree_, __alloc) {}
1010 : __tree_(__m.__tree_.value_comp(), typename __base::allocator_type(__a)) {
1011 insert(__m.begin(), __m.end());
1012 }
10131069
1014 _LIBCPP_HIDE_FROM_ABI ~map() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); }1070 _LIBCPP_HIDE_FROM_ABI ~map() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
10151071
1016 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }1072 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
1017 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }1073 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
1018 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }1074 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
1019 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }1075 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
10201076
1021 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }1077 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
1022 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }1078 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {
1023 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }1079 return const_reverse_iterator(end());
1024 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }1080 }
1081 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
1082 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
1083 return const_reverse_iterator(begin());
1084 }
10251085
1026 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }1086 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
1027 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }1087 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
1028 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }1088 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
1029 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1089 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
10301090
1031 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }1091 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }
1032 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }1092 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }
1033 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }1093 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
10341094
1035 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);1095 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
1036# ifndef _LIBCPP_CXX03_LANG1096# ifndef _LIBCPP_CXX03_LANG
1037 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);1097 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
1038# endif1098# endif
10391099
1040 _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);1100 template <class _Arg,
1041 _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;1101 __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) {
1103 auto [_, __child] = __tree_.__find_equal(__arg);
1104 if (__child == nullptr)
1105 std::__throw_out_of_range("map::at: key not found");
1106 return static_cast<__node_pointer>(__child)->__get_value().second;
1107 }
1108
1109 template <class _Arg,
1110 __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 {
1112 auto [_, __child] = __tree_.__find_equal(__arg);
1113 if (__child == nullptr)
1114 std::__throw_out_of_range("map::at: key not found");
1115 return static_cast<__node_pointer>(__child)->__get_value().second;
1116 }
10421117
1043 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return allocator_type(__tree_.__alloc()); }1118 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
1044 _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }1119 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;
1045 _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return value_compare(__tree_.value_comp().key_comp()); }1120
1121 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
1122 return allocator_type(__tree_.__alloc());
1123 }
1124 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }
1125 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const {
1126 return value_compare(__tree_.value_comp().key_comp());
1127 }
10461128
1047# ifndef _LIBCPP_CXX03_LANG1129# ifndef _LIBCPP_CXX03_LANG
1048 template <class... _Args>1130 template <class... _Args>
...@@ -1052,7 +1134,7 @@ public:...@@ -1052,7 +1134,7 @@ public:
10521134
1053 template <class... _Args>1135 template <class... _Args>
1054 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {1136 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
1055 return __tree_.__emplace_hint_unique(__p.__i_, std::forward<_Args>(__args)...);1137 return __tree_.__emplace_hint_unique(__p.__i_, std::forward<_Args>(__args)...).first;
1056 }1138 }
10571139
1058 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>1140 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
...@@ -1062,7 +1144,7 @@ public:...@@ -1062,7 +1144,7 @@ public:
10621144
1063 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>1145 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
1064 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {1146 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {
1065 return __tree_.__emplace_hint_unique(__pos.__i_, std::forward<_Pp>(__p));1147 return __tree_.__emplace_hint_unique(__pos.__i_, std::forward<_Pp>(__p)).first;
1066 }1148 }
10671149
1068# endif // _LIBCPP_CXX03_LANG1150# endif // _LIBCPP_CXX03_LANG
...@@ -1070,7 +1152,7 @@ public:...@@ -1070,7 +1152,7 @@ public:
1070 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__emplace_unique(__v); }1152 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__emplace_unique(__v); }
10711153
1072 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {1154 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
1073 return __tree_.__emplace_hint_unique(__p.__i_, __v);1155 return __tree_.__emplace_hint_unique(__p.__i_, __v).first;
1074 }1156 }
10751157
1076# ifndef _LIBCPP_CXX03_LANG1158# ifndef _LIBCPP_CXX03_LANG
...@@ -1079,25 +1161,21 @@ public:...@@ -1079,25 +1161,21 @@ public:
1079 }1161 }
10801162
1081 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {1163 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
1082 return __tree_.__emplace_hint_unique(__p.__i_, std::move(__v));1164 return __tree_.__emplace_hint_unique(__p.__i_, std::move(__v)).first;
1083 }1165 }
10841166
1085 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }1167 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
1086# endif1168# endif
10871169
1088 template <class _InputIterator>1170 template <class _InputIterator>
1089 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {1171 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {
1090 for (const_iterator __e = cend(); __f != __l; ++__f)1172 __tree_.__insert_range_unique(__first, __last);
1091 insert(__e.__i_, *__f);
1092 }1173 }
10931174
1094# if _LIBCPP_STD_VER >= 231175# if _LIBCPP_STD_VER >= 23
1095 template <_ContainerCompatibleRange<value_type> _Range>1176 template <_ContainerCompatibleRange<value_type> _Range>
1096 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {1177 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
1097 const_iterator __end = cend();1178 __tree_.__insert_range_unique(ranges::begin(__range), ranges::end(__range));
1098 for (auto&& __element : __range) {
1099 insert(__end.__i_, std::forward<decltype(__element)>(__element));
1100 }
1101 }1179 }
1102# endif1180# endif
11031181
...@@ -1105,17 +1183,13 @@ public:...@@ -1105,17 +1183,13 @@ public:
11051183
1106 template <class... _Args>1184 template <class... _Args>
1107 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {1185 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {
1108 return __tree_.__emplace_unique_key_args(1186 return __tree_.__emplace_unique(
1109 __k,1187 std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple(std::forward<_Args>(__args)...));
1110 std::piecewise_construct,
1111 std::forward_as_tuple(__k),
1112 std::forward_as_tuple(std::forward<_Args>(__args)...));
1113 }1188 }
11141189
1115 template <class... _Args>1190 template <class... _Args>
1116 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {1191 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {
1117 return __tree_.__emplace_unique_key_args(1192 return __tree_.__emplace_unique(
1118 __k,
1119 std::piecewise_construct,1193 std::piecewise_construct,
1120 std::forward_as_tuple(std::move(__k)),1194 std::forward_as_tuple(std::move(__k)),
1121 std::forward_as_tuple(std::forward<_Args>(__args)...));1195 std::forward_as_tuple(std::forward<_Args>(__args)...));
...@@ -1124,9 +1198,8 @@ public:...@@ -1124,9 +1198,8 @@ public:
1124 template <class... _Args>1198 template <class... _Args>
1125 _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) {1199 _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) {
1126 return __tree_1200 return __tree_
1127 .__emplace_hint_unique_key_args(1201 .__emplace_hint_unique(
1128 __h.__i_,1202 __h.__i_,
1129 __k,
1130 std::piecewise_construct,1203 std::piecewise_construct,
1131 std::forward_as_tuple(__k),1204 std::forward_as_tuple(__k),
1132 std::forward_as_tuple(std::forward<_Args>(__args)...))1205 std::forward_as_tuple(std::forward<_Args>(__args)...))
...@@ -1136,9 +1209,8 @@ public:...@@ -1136,9 +1209,8 @@ public:
1136 template <class... _Args>1209 template <class... _Args>
1137 _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) {1210 _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) {
1138 return __tree_1211 return __tree_
1139 .__emplace_hint_unique_key_args(1212 .__emplace_hint_unique(
1140 __h.__i_,1213 __h.__i_,
1141 __k,
1142 std::piecewise_construct,1214 std::piecewise_construct,
1143 std::forward_as_tuple(std::move(__k)),1215 std::forward_as_tuple(std::move(__k)),
1144 std::forward_as_tuple(std::forward<_Args>(__args)...))1216 std::forward_as_tuple(std::forward<_Args>(__args)...))
...@@ -1147,27 +1219,25 @@ public:...@@ -1147,27 +1219,25 @@ public:
11471219
1148 template <class _Vp>1220 template <class _Vp>
1149 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {1221 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {
1150 iterator __p = lower_bound(__k);1222 auto __result = __tree_.__emplace_unique(__k, std::forward<_Vp>(__v));
1151 if (__p != end() && !key_comp()(__k, __p->first)) {1223 auto& [__iter, __inserted] = __result;
1152 __p->second = std::forward<_Vp>(__v);1224 if (!__inserted)
1153 return std::make_pair(__p, false);1225 __iter->second = std::forward<_Vp>(__v);
1154 }1226 return __result;
1155 return std::make_pair(emplace_hint(__p, __k, std::forward<_Vp>(__v)), true);
1156 }1227 }
11571228
1158 template <class _Vp>1229 template <class _Vp>
1159 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {1230 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
1160 iterator __p = lower_bound(__k);1231 auto __result = __tree_.__emplace_unique(std::move(__k), std::forward<_Vp>(__v));
1161 if (__p != end() && !key_comp()(__k, __p->first)) {1232 auto& [__iter, __inserted] = __result;
1162 __p->second = std::forward<_Vp>(__v);1233 if (!__inserted)
1163 return std::make_pair(__p, false);1234 __iter->second = std::forward<_Vp>(__v);
1164 }1235 return __result;
1165 return std::make_pair(emplace_hint(__p, std::move(__k), std::forward<_Vp>(__v)), true);
1166 }1236 }
11671237
1168 template <class _Vp>1238 template <class _Vp>
1169 _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) {1239 _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) {
1170 auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(__h.__i_, __k, __k, std::forward<_Vp>(__v));1240 auto [__r, __inserted] = __tree_.__emplace_hint_unique(__h.__i_, __k, std::forward<_Vp>(__v));
11711241
1172 if (!__inserted)1242 if (!__inserted)
1173 __r->second = std::forward<_Vp>(__v);1243 __r->second = std::forward<_Vp>(__v);
...@@ -1177,8 +1247,7 @@ public:...@@ -1177,8 +1247,7 @@ public:
11771247
1178 template <class _Vp>1248 template <class _Vp>
1179 _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) {1249 _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) {
1180 auto [__r, __inserted] =1250 auto [__r, __inserted] = __tree_.__emplace_hint_unique(__h.__i_, std::move(__k), std::forward<_Vp>(__v));
1181 __tree_.__emplace_hint_unique_key_args(__h.__i_, __k, std::move(__k), std::forward<_Vp>(__v));
11821251
1183 if (!__inserted)1252 if (!__inserted)
1184 __r->second = std::forward<_Vp>(__v);1253 __r->second = std::forward<_Vp>(__v);
...@@ -1207,10 +1276,10 @@ public:...@@ -1207,10 +1276,10 @@ public:
1207 "node_type with incompatible allocator passed to map::insert()");1276 "node_type with incompatible allocator passed to map::insert()");
1208 return __tree_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));1277 return __tree_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
1209 }1278 }
1210 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1279 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
1211 return __tree_.template __node_handle_extract<node_type>(__key);1280 return __tree_.template __node_handle_extract<node_type>(__key);
1212 }1281 }
1213 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1282 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
1214 return __tree_.template __node_handle_extract<node_type>(__it.__i_);1283 return __tree_.template __node_handle_extract<node_type>(__it.__i_);
1215 }1284 }
1216 template <class _Compare2>1285 template <class _Compare2>
...@@ -1241,75 +1310,105 @@ public:...@@ -1241,75 +1310,105 @@ public:
12411310
1242 _LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); }1311 _LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); }
12431312
1244 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }1313 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
1245 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }1314 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
1246# if _LIBCPP_STD_VER >= 141315# if _LIBCPP_STD_VER >= 14
1247 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1316 template <typename _K2,
1248 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1317 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1318 int> = 0>
1319 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1249 return __tree_.find(__k);1320 return __tree_.find(__k);
1250 }1321 }
1251 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1322 template <typename _K2,
1252 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1323 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1324 int> = 0>
1325 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1253 return __tree_.find(__k);1326 return __tree_.find(__k);
1254 }1327 }
1255# endif1328# endif
12561329
1257 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); }1330 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
1331 return __tree_.__count_unique(__k);
1332 }
1258# if _LIBCPP_STD_VER >= 141333# if _LIBCPP_STD_VER >= 14
1259 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1334 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1260 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1335 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1261 return __tree_.__count_multi(__k);1336 return __tree_.__count_multi(__k);
1262 }1337 }
1263# endif1338# endif
12641339
1265# if _LIBCPP_STD_VER >= 201340# if _LIBCPP_STD_VER >= 20
1266 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1341 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
1267 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1342 template <typename _K2,
1268 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1343 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1344 int> = 0>
1345 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1269 return find(__k) != end();1346 return find(__k) != end();
1270 }1347 }
1271# endif // _LIBCPP_STD_VER >= 201348# endif // _LIBCPP_STD_VER >= 20
12721349
1273 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }1350 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {
1274 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }1351 return __tree_.__lower_bound_unique(__k);
1352 }
1353
1354 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {
1355 return __tree_.__lower_bound_unique(__k);
1356 }
1357
1358 // The transparent versions of the lookup functions use the _multi version, since a non-element key is allowed to
1359 // match multiple elements.
1275# if _LIBCPP_STD_VER >= 141360# if _LIBCPP_STD_VER >= 14
1276 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1361 template <typename _K2,
1277 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {1362 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1278 return __tree_.lower_bound(__k);1363 int> = 0>
1364 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
1365 return __tree_.__lower_bound_multi(__k);
1279 }1366 }
12801367
1281 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1368 template <typename _K2,
1282 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {1369 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1283 return __tree_.lower_bound(__k);1370 int> = 0>
1371 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
1372 return __tree_.__lower_bound_multi(__k);
1284 }1373 }
1285# endif1374# endif
12861375
1287 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }1376 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {
1288 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }1377 return __tree_.__upper_bound_unique(__k);
1289# if _LIBCPP_STD_VER >= 14
1290 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1291 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
1292 return __tree_.upper_bound(__k);
1293 }1378 }
1294 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1379
1295 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {1380 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {
1296 return __tree_.upper_bound(__k);1381 return __tree_.__upper_bound_unique(__k);
1382 }
1383
1384# if _LIBCPP_STD_VER >= 14
1385 template <typename _K2,
1386 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1387 int> = 0>
1388 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
1389 return __tree_.__upper_bound_multi(__k);
1390 }
1391 template <typename _K2,
1392 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,
1393 int> = 0>
1394 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
1395 return __tree_.__upper_bound_multi(__k);
1297 }1396 }
1298# endif1397# endif
12991398
1300 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1399 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
1301 return __tree_.__equal_range_unique(__k);1400 return __tree_.__equal_range_unique(__k);
1302 }1401 }
1303 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1402 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
1304 return __tree_.__equal_range_unique(__k);1403 return __tree_.__equal_range_unique(__k);
1305 }1404 }
1306# if _LIBCPP_STD_VER >= 141405# if _LIBCPP_STD_VER >= 14
1307 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1406 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1308 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1407 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1309 return __tree_.__equal_range_multi(__k);1408 return __tree_.__equal_range_multi(__k);
1310 }1409 }
1311 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1410 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1312 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1411 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1313 return __tree_.__equal_range_multi(__k);1412 return __tree_.__equal_range_multi(__k);
1314 }1413 }
1315# endif1414# endif
...@@ -1319,7 +1418,6 @@ private:...@@ -1319,7 +1418,6 @@ private:
1319 typedef typename __base::__node_allocator __node_allocator;1418 typedef typename __base::__node_allocator __node_allocator;
1320 typedef typename __base::__node_pointer __node_pointer;1419 typedef typename __base::__node_pointer __node_pointer;
1321 typedef typename __base::__node_base_pointer __node_base_pointer;1420 typedef typename __base::__node_base_pointer __node_base_pointer;
1322 typedef typename __base::__parent_pointer __parent_pointer;
13231421
1324 typedef __map_node_destructor<__node_allocator> _Dp;1422 typedef __map_node_destructor<__node_allocator> _Dp;
1325 typedef unique_ptr<__node, _Dp> __node_holder;1423 typedef unique_ptr<__node, _Dp> __node_holder;
...@@ -1327,6 +1425,8 @@ private:...@@ -1327,6 +1425,8 @@ private:
1327# ifdef _LIBCPP_CXX03_LANG1425# ifdef _LIBCPP_CXX03_LANG
1328 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_with_key(const key_type& __k);1426 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_with_key(const key_type& __k);
1329# endif1427# endif
1428
1429 friend struct __specialized_algorithm<_Algorithm::__for_each, __single_range<map> >;
1330};1430};
13311431
1332# if _LIBCPP_STD_VER >= 171432# if _LIBCPP_STD_VER >= 17
...@@ -1334,8 +1434,8 @@ template <class _InputIterator,...@@ -1334,8 +1434,8 @@ template <class _InputIterator,
1334 class _Compare = less<__iter_key_type<_InputIterator>>,1434 class _Compare = less<__iter_key_type<_InputIterator>>,
1335 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,1435 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
1336 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,1436 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1337 class = enable_if_t<!__is_allocator<_Compare>::value, void>,1437 class = enable_if_t<!__is_allocator_v<_Compare>>,
1338 class = enable_if_t<__is_allocator<_Allocator>::value, void>>1438 class = enable_if_t<__is_allocator_v<_Allocator>>>
1339map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())1439map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
1340 -> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;1440 -> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
13411441
...@@ -1343,8 +1443,8 @@ map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocat...@@ -1343,8 +1443,8 @@ map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocat
1343template <ranges::input_range _Range,1443template <ranges::input_range _Range,
1344 class _Compare = less<__range_key_type<_Range>>,1444 class _Compare = less<__range_key_type<_Range>>,
1345 class _Allocator = allocator<__range_to_alloc_type<_Range>>,1445 class _Allocator = allocator<__range_to_alloc_type<_Range>>,
1346 class = enable_if_t<!__is_allocator<_Compare>::value, void>,1446 class = enable_if_t<!__is_allocator_v<_Compare>>,
1347 class = enable_if_t<__is_allocator<_Allocator>::value, void>>1447 class = enable_if_t<__is_allocator_v<_Allocator>>>
1348map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())1448map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
1349 -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;1449 -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
1350# endif1450# endif
...@@ -1353,16 +1453,15 @@ template <class _Key,...@@ -1353,16 +1453,15 @@ template <class _Key,
1353 class _Tp,1453 class _Tp,
1354 class _Compare = less<remove_const_t<_Key>>,1454 class _Compare = less<remove_const_t<_Key>>,
1355 class _Allocator = allocator<pair<const _Key, _Tp>>,1455 class _Allocator = allocator<pair<const _Key, _Tp>>,
1356 class = enable_if_t<!__is_allocator<_Compare>::value, void>,1456 class = enable_if_t<!__is_allocator_v<_Compare>>,
1357 class = enable_if_t<__is_allocator<_Allocator>::value, void>>1457 class = enable_if_t<__is_allocator_v<_Allocator>>>
1358map(initializer_list<pair<_Key, _Tp>>,1458map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
1359 _Compare = _Compare(),1459 -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
1360 _Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
13611460
1362template <class _InputIterator,1461template <class _InputIterator,
1363 class _Allocator,1462 class _Allocator,
1364 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,1463 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1365 class = enable_if_t<__is_allocator<_Allocator>::value, void>>1464 class = enable_if_t<__is_allocator_v<_Allocator>>>
1366map(_InputIterator, _InputIterator, _Allocator)1465map(_InputIterator, _InputIterator, _Allocator)
1367 -> map<__iter_key_type<_InputIterator>,1466 -> map<__iter_key_type<_InputIterator>,
1368 __iter_mapped_type<_InputIterator>,1467 __iter_mapped_type<_InputIterator>,
...@@ -1370,44 +1469,44 @@ map(_InputIterator, _InputIterator, _Allocator)...@@ -1370,44 +1469,44 @@ map(_InputIterator, _InputIterator, _Allocator)
1370 _Allocator>;1469 _Allocator>;
13711470
1372# if _LIBCPP_STD_VER >= 231471# if _LIBCPP_STD_VER >= 23
1373template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>1472template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1374map(from_range_t, _Range&&, _Allocator)1473map(from_range_t, _Range&&, _Allocator)
1375 -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;1474 -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
1376# endif1475# endif
13771476
1378template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>1477template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1379map(initializer_list<pair<_Key, _Tp>>,1478map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1380 _Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;1479 -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
1381# endif1480# endif
13821481
1383# ifndef _LIBCPP_CXX03_LANG1482# if _LIBCPP_STD_VER >= 14
1384template <class _Key, class _Tp, class _Compare, class _Allocator>1483template <class _Key, class _Tp, class _Compare, class _Allocator>
1385map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)1484struct __specialized_algorithm<_Algorithm::__for_each, __single_range<map<_Key, _Tp, _Compare, _Allocator>>> {
1386 : __tree_(std::move(__m.__tree_), typename __base::allocator_type(__a)) {1485 using __map _LIBCPP_NODEBUG = map<_Key, _Tp, _Compare, _Allocator>;
1387 if (__a != __m.get_allocator()) {1486
1388 const_iterator __e = cend();1487 static const bool __has_algorithm = true;
1389 while (!__m.empty()) {1488
1390 __tree_.__insert_unique_from_orphaned_node(__e.__i_, std::move(__m.__tree_.remove(__m.begin().__i_)->__value_));1489 template <class _Map, class _Func, class _Proj>
1391 }1490 _LIBCPP_HIDE_FROM_ABI static auto operator()(_Map&& __map, _Func __func, _Proj __proj) {
1491 auto [_, __func2] = __specialized_algorithm<_Algorithm::__for_each, __single_range<typename __map::__base>>()(
1492 __map.__tree_, std::move(__func), std::move(__proj));
1493 return std::make_pair(__map.end(), std::move(__func2));
1392 }1494 }
1393}1495};
1496# endif
13941497
1498# ifndef _LIBCPP_CXX03_LANG
1395template <class _Key, class _Tp, class _Compare, class _Allocator>1499template <class _Key, class _Tp, class _Compare, class _Allocator>
1396_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {1500_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {
1397 return __tree_1501 return __tree_.__emplace_unique(std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
1398 .__emplace_unique_key_args(__k, std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
1399 .first->second;1502 .first->second;
1400}1503}
14011504
1402template <class _Key, class _Tp, class _Compare, class _Allocator>1505template <class _Key, class _Tp, class _Compare, class _Allocator>
1403_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) {1506_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) {
1404 // TODO investigate this clang-tidy warning.
1405 // NOLINTBEGIN(bugprone-use-after-move)
1406 return __tree_1507 return __tree_
1407 .__emplace_unique_key_args(1508 .__emplace_unique(std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
1408 __k, std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
1409 .first->second;1509 .first->second;
1410 // NOLINTEND(bugprone-use-after-move)
1411}1510}
14121511
1413# else // _LIBCPP_CXX03_LANG1512# else // _LIBCPP_CXX03_LANG
...@@ -1417,44 +1516,41 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder...@@ -1417,44 +1516,41 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
1417map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type& __k) {1516map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type& __k) {
1418 __node_allocator& __na = __tree_.__node_alloc();1517 __node_allocator& __na = __tree_.__node_alloc();
1419 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));1518 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1420 __node_traits::construct(__na, std::addressof(__h->__value_.first), __k);1519 __node_traits::construct(__na, std::addressof(__h->__get_value().first), __k);
1421 __h.get_deleter().__first_constructed = true;1520 __h.get_deleter().__first_constructed = true;
1422 __node_traits::construct(__na, std::addressof(__h->__value_.second));1521 __node_traits::construct(__na, std::addressof(__h->__get_value().second));
1423 __h.get_deleter().__second_constructed = true;1522 __h.get_deleter().__second_constructed = true;
1424 return __h;1523 return __h;
1425}1524}
14261525
1427template <class _Key, class _Tp, class _Compare, class _Allocator>1526template <class _Key, class _Tp, class _Compare, class _Allocator>
1428_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {1527_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {
1429 __parent_pointer __parent;1528 auto [__parent, __child] = __tree_.__find_equal(__k);
1430 __node_base_pointer& __child = __tree_.__find_equal(__parent, __k);1529 __node_pointer __r = static_cast<__node_pointer>(__child);
1431 __node_pointer __r = static_cast<__node_pointer>(__child);
1432 if (__child == nullptr) {1530 if (__child == nullptr) {
1433 __node_holder __h = __construct_node_with_key(__k);1531 __node_holder __h = __construct_node_with_key(__k);
1434 __tree_.__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1532 __tree_.__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1435 __r = __h.release();1533 __r = __h.release();
1436 }1534 }
1437 return __r->__value_.second;1535 return __r->__get_value().second;
1438}1536}
14391537
1440# endif // _LIBCPP_CXX03_LANG1538# endif // _LIBCPP_CXX03_LANG
14411539
1442template <class _Key, class _Tp, class _Compare, class _Allocator>1540template <class _Key, class _Tp, class _Compare, class _Allocator>
1443_Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) {1541_Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) {
1444 __parent_pointer __parent;1542 auto [_, __child] = __tree_.__find_equal(__k);
1445 __node_base_pointer& __child = __tree_.__find_equal(__parent, __k);
1446 if (__child == nullptr)1543 if (__child == nullptr)
1447 std::__throw_out_of_range("map::at: key not found");1544 std::__throw_out_of_range("map::at: key not found");
1448 return static_cast<__node_pointer>(__child)->__value_.second;1545 return static_cast<__node_pointer>(__child)->__get_value().second;
1449}1546}
14501547
1451template <class _Key, class _Tp, class _Compare, class _Allocator>1548template <class _Key, class _Tp, class _Compare, class _Allocator>
1452const _Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const {1549const _Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const {
1453 __parent_pointer __parent;1550 auto [_, __child] = __tree_.__find_equal(__k);
1454 __node_base_pointer __child = __tree_.__find_equal(__parent, __k);
1455 if (__child == nullptr)1551 if (__child == nullptr)
1456 std::__throw_out_of_range("map::at: key not found");1552 std::__throw_out_of_range("map::at: key not found");
1457 return static_cast<__node_pointer>(__child)->__value_.second;1553 return static_cast<__node_pointer>(__child)->__get_value().second;
1458}1554}
14591555
1460template <class _Key, class _Tp, class _Compare, class _Allocator>1556template <class _Key, class _Tp, class _Compare, class _Allocator>
...@@ -1637,22 +1733,17 @@ public:...@@ -1637,22 +1733,17 @@ public:
1637 : multimap(from_range, std::forward<_Range>(__range), key_compare(), __a) {}1733 : multimap(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
1638# endif1734# endif
16391735
1640 _LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m)1736 _LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m) = default;
1641 : __tree_(__m.__tree_.value_comp(),
1642 __alloc_traits::select_on_container_copy_construction(__m.__tree_.__alloc())) {
1643 insert(__m.begin(), __m.end());
1644 }
16451737
1646 _LIBCPP_HIDE_FROM_ABI multimap& operator=(const multimap& __m) = default;1738 _LIBCPP_HIDE_FROM_ABI multimap& operator=(const multimap& __m) = default;
16471739
1648# ifndef _LIBCPP_CXX03_LANG1740# ifndef _LIBCPP_CXX03_LANG
16491741
1650 _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m) noexcept(is_nothrow_move_constructible<__base>::value) = default;1742 _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m) = default;
16511743
1652 _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a);1744 _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a) : __tree_(std::move(__m.__tree_), __a) {}
16531745
1654 _LIBCPP_HIDE_FROM_ABI multimap&1746 _LIBCPP_HIDE_FROM_ABI multimap& operator=(multimap&& __m) = default;
1655 operator=(multimap&& __m) noexcept(is_nothrow_move_assignable<__base>::value) = default;
16561747
1657 _LIBCPP_HIDE_FROM_ABI multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())1748 _LIBCPP_HIDE_FROM_ABI multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
1658 : __tree_(__vc(__comp)) {1749 : __tree_(__vc(__comp)) {
...@@ -1671,7 +1762,8 @@ public:...@@ -1671,7 +1762,8 @@ public:
1671# endif1762# endif
16721763
1673 _LIBCPP_HIDE_FROM_ABI multimap& operator=(initializer_list<value_type> __il) {1764 _LIBCPP_HIDE_FROM_ABI multimap& operator=(initializer_list<value_type> __il) {
1674 __tree_.__assign_multi(__il.begin(), __il.end());1765 clear();
1766 insert(__il.begin(), __il.end());
1675 return *this;1767 return *this;
1676 }1768 }
16771769
...@@ -1679,37 +1771,42 @@ public:...@@ -1679,37 +1771,42 @@ public:
16791771
1680 _LIBCPP_HIDE_FROM_ABI explicit multimap(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}1772 _LIBCPP_HIDE_FROM_ABI explicit multimap(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}
16811773
1682 _LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m, const allocator_type& __a)1774 _LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m, const allocator_type& __a) : __tree_(__m.__tree_, __a) {}
1683 : __tree_(__m.__tree_.value_comp(), typename __base::allocator_type(__a)) {
1684 insert(__m.begin(), __m.end());
1685 }
16861775
1687 _LIBCPP_HIDE_FROM_ABI ~multimap() {1776 _LIBCPP_HIDE_FROM_ABI ~multimap() {
1688 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");1777 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");
1689 }1778 }
16901779
1691 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }1780 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
1692 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }1781 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
1693 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }1782 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
1694 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }1783 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
16951784
1696 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }1785 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
1697 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }1786 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {
1698 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }1787 return const_reverse_iterator(end());
1699 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }1788 }
1789 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
1790 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
1791 return const_reverse_iterator(begin());
1792 }
17001793
1701 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }1794 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
1702 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }1795 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
1703 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }1796 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
1704 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1797 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
17051798
1706 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }1799 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }
1707 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }1800 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }
1708 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }1801 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
17091802
1710 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return allocator_type(__tree_.__alloc()); }1803 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
1711 _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }1804 return allocator_type(__tree_.__alloc());
1712 _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return value_compare(__tree_.value_comp().key_comp()); }1805 }
1806 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }
1807 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const {
1808 return value_compare(__tree_.value_comp().key_comp());
1809 }
17131810
1714# ifndef _LIBCPP_CXX03_LANG1811# ifndef _LIBCPP_CXX03_LANG
17151812
...@@ -1751,17 +1848,13 @@ public:...@@ -1751,17 +1848,13 @@ public:
17511848
1752 template <class _InputIterator>1849 template <class _InputIterator>
1753 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {1850 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {
1754 for (const_iterator __e = cend(); __f != __l; ++__f)1851 __tree_.__insert_range_multi(__f, __l);
1755 __tree_.__emplace_hint_multi(__e.__i_, *__f);
1756 }1852 }
17571853
1758# if _LIBCPP_STD_VER >= 231854# if _LIBCPP_STD_VER >= 23
1759 template <_ContainerCompatibleRange<value_type> _Range>1855 template <_ContainerCompatibleRange<value_type> _Range>
1760 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {1856 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
1761 const_iterator __end = cend();1857 __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range));
1762 for (auto&& __element : __range) {
1763 __tree_.__emplace_hint_multi(__end.__i_, std::forward<decltype(__element)>(__element));
1764 }
1765 }1858 }
1766# endif1859# endif
17671860
...@@ -1783,10 +1876,10 @@ public:...@@ -1783,10 +1876,10 @@ public:
1783 "node_type with incompatible allocator passed to multimap::insert()");1876 "node_type with incompatible allocator passed to multimap::insert()");
1784 return __tree_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));1877 return __tree_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
1785 }1878 }
1786 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1879 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
1787 return __tree_.template __node_handle_extract<node_type>(__key);1880 return __tree_.template __node_handle_extract<node_type>(__key);
1788 }1881 }
1789 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1882 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
1790 return __tree_.template __node_handle_extract<node_type>(__it.__i_);1883 return __tree_.template __node_handle_extract<node_type>(__it.__i_);
1791 }1884 }
1792 template <class _Compare2>1885 template <class _Compare2>
...@@ -1821,75 +1914,89 @@ public:...@@ -1821,75 +1914,89 @@ public:
1821 __tree_.swap(__m.__tree_);1914 __tree_.swap(__m.__tree_);
1822 }1915 }
18231916
1824 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }1917 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
1825 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }1918 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
1826# if _LIBCPP_STD_VER >= 141919# if _LIBCPP_STD_VER >= 14
1827 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1920 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1828 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1921 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1829 return __tree_.find(__k);1922 return __tree_.find(__k);
1830 }1923 }
1831 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1924 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1832 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1925 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1833 return __tree_.find(__k);1926 return __tree_.find(__k);
1834 }1927 }
1835# endif1928# endif
18361929
1837 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); }1930 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
1931 return __tree_.__count_multi(__k);
1932 }
1838# if _LIBCPP_STD_VER >= 141933# if _LIBCPP_STD_VER >= 14
1839 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1934 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1840 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1935 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1841 return __tree_.__count_multi(__k);1936 return __tree_.__count_multi(__k);
1842 }1937 }
1843# endif1938# endif
18441939
1845# if _LIBCPP_STD_VER >= 201940# if _LIBCPP_STD_VER >= 20
1846 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1941 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
1847 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1942 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1848 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1943 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1849 return find(__k) != end();1944 return find(__k) != end();
1850 }1945 }
1851# endif // _LIBCPP_STD_VER >= 201946# endif // _LIBCPP_STD_VER >= 20
18521947
1853 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }1948 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {
1854 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }1949 return __tree_.__lower_bound_multi(__k);
1950 }
1951
1952 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {
1953 return __tree_.__lower_bound_multi(__k);
1954 }
1955
1855# if _LIBCPP_STD_VER >= 141956# if _LIBCPP_STD_VER >= 14
1856 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1957 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1857 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {1958 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
1858 return __tree_.lower_bound(__k);1959 return __tree_.__lower_bound_multi(__k);
1859 }1960 }
18601961
1861 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1962 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1862 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {1963 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
1863 return __tree_.lower_bound(__k);1964 return __tree_.__lower_bound_multi(__k);
1864 }1965 }
1865# endif1966# endif
18661967
1867 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }1968 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {
1868 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }1969 return __tree_.__upper_bound_multi(__k);
1970 }
1971
1972 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {
1973 return __tree_.__upper_bound_multi(__k);
1974 }
1975
1869# if _LIBCPP_STD_VER >= 141976# if _LIBCPP_STD_VER >= 14
1870 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1977 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1871 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {1978 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
1872 return __tree_.upper_bound(__k);1979 return __tree_.__upper_bound_multi(__k);
1873 }1980 }
1874 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1981 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1875 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {1982 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
1876 return __tree_.upper_bound(__k);1983 return __tree_.__upper_bound_multi(__k);
1877 }1984 }
1878# endif1985# endif
18791986
1880 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1987 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
1881 return __tree_.__equal_range_multi(__k);1988 return __tree_.__equal_range_multi(__k);
1882 }1989 }
1883 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1990 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
1884 return __tree_.__equal_range_multi(__k);1991 return __tree_.__equal_range_multi(__k);
1885 }1992 }
1886# if _LIBCPP_STD_VER >= 141993# if _LIBCPP_STD_VER >= 14
1887 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1994 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1888 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1995 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1889 return __tree_.__equal_range_multi(__k);1996 return __tree_.__equal_range_multi(__k);
1890 }1997 }
1891 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1998 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1892 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1999 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1893 return __tree_.__equal_range_multi(__k);2000 return __tree_.__equal_range_multi(__k);
1894 }2001 }
1895# endif2002# endif
...@@ -1901,6 +2008,8 @@ private:...@@ -1901,6 +2008,8 @@ private:
19012008
1902 typedef __map_node_destructor<__node_allocator> _Dp;2009 typedef __map_node_destructor<__node_allocator> _Dp;
1903 typedef unique_ptr<__node, _Dp> __node_holder;2010 typedef unique_ptr<__node, _Dp> __node_holder;
2011
2012 friend struct __specialized_algorithm<_Algorithm::__for_each, __single_range<multimap> >;
1904};2013};
19052014
1906# if _LIBCPP_STD_VER >= 172015# if _LIBCPP_STD_VER >= 17
...@@ -1908,8 +2017,8 @@ template <class _InputIterator,...@@ -1908,8 +2017,8 @@ template <class _InputIterator,
1908 class _Compare = less<__iter_key_type<_InputIterator>>,2017 class _Compare = less<__iter_key_type<_InputIterator>>,
1909 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,2018 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
1910 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,2019 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1911 class = enable_if_t<!__is_allocator<_Compare>::value, void>,2020 class = enable_if_t<!__is_allocator_v<_Compare>>,
1912 class = enable_if_t<__is_allocator<_Allocator>::value, void>>2021 class = enable_if_t<__is_allocator_v<_Allocator>>>
1913multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())2022multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
1914 -> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;2023 -> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
19152024
...@@ -1917,8 +2026,8 @@ multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Al...@@ -1917,8 +2026,8 @@ multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Al
1917template <ranges::input_range _Range,2026template <ranges::input_range _Range,
1918 class _Compare = less<__range_key_type<_Range>>,2027 class _Compare = less<__range_key_type<_Range>>,
1919 class _Allocator = allocator<__range_to_alloc_type<_Range>>,2028 class _Allocator = allocator<__range_to_alloc_type<_Range>>,
1920 class = enable_if_t<!__is_allocator<_Compare>::value, void>,2029 class = enable_if_t<!__is_allocator_v<_Compare>>,
1921 class = enable_if_t<__is_allocator<_Allocator>::value, void>>2030 class = enable_if_t<__is_allocator_v<_Allocator>>>
1922multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())2031multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
1923 -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;2032 -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
1924# endif2033# endif
...@@ -1927,16 +2036,15 @@ template <class _Key,...@@ -1927,16 +2036,15 @@ template <class _Key,
1927 class _Tp,2036 class _Tp,
1928 class _Compare = less<remove_const_t<_Key>>,2037 class _Compare = less<remove_const_t<_Key>>,
1929 class _Allocator = allocator<pair<const _Key, _Tp>>,2038 class _Allocator = allocator<pair<const _Key, _Tp>>,
1930 class = enable_if_t<!__is_allocator<_Compare>::value, void>,2039 class = enable_if_t<!__is_allocator_v<_Compare>>,
1931 class = enable_if_t<__is_allocator<_Allocator>::value, void>>2040 class = enable_if_t<__is_allocator_v<_Allocator>>>
1932multimap(initializer_list<pair<_Key, _Tp>>,2041multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
1933 _Compare = _Compare(),2042 -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
1934 _Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
19352043
1936template <class _InputIterator,2044template <class _InputIterator,
1937 class _Allocator,2045 class _Allocator,
1938 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,2046 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1939 class = enable_if_t<__is_allocator<_Allocator>::value, void>>2047 class = enable_if_t<__is_allocator_v<_Allocator>>>
1940multimap(_InputIterator, _InputIterator, _Allocator)2048multimap(_InputIterator, _InputIterator, _Allocator)
1941 -> multimap<__iter_key_type<_InputIterator>,2049 -> multimap<__iter_key_type<_InputIterator>,
1942 __iter_mapped_type<_InputIterator>,2050 __iter_mapped_type<_InputIterator>,
...@@ -1944,26 +2052,30 @@ multimap(_InputIterator, _InputIterator, _Allocator)...@@ -1944,26 +2052,30 @@ multimap(_InputIterator, _InputIterator, _Allocator)
1944 _Allocator>;2052 _Allocator>;
19452053
1946# if _LIBCPP_STD_VER >= 232054# if _LIBCPP_STD_VER >= 23
1947template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>2055template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1948multimap(from_range_t, _Range&&, _Allocator)2056multimap(from_range_t, _Range&&, _Allocator)
1949 -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;2057 -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
1950# endif2058# endif
19512059
1952template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>2060template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1953multimap(initializer_list<pair<_Key, _Tp>>,2061multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
1954 _Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;2062 -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
1955# endif2063# endif
19562064
1957# ifndef _LIBCPP_CXX03_LANG2065# if _LIBCPP_STD_VER >= 14
1958template <class _Key, class _Tp, class _Compare, class _Allocator>2066template <class _Key, class _Tp, class _Compare, class _Allocator>
1959multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)2067struct __specialized_algorithm<_Algorithm::__for_each, __single_range<multimap<_Key, _Tp, _Compare, _Allocator>>> {
1960 : __tree_(std::move(__m.__tree_), typename __base::allocator_type(__a)) {2068 using __map _LIBCPP_NODEBUG = multimap<_Key, _Tp, _Compare, _Allocator>;
1961 if (__a != __m.get_allocator()) {2069
1962 const_iterator __e = cend();2070 static const bool __has_algorithm = true;
1963 while (!__m.empty())2071
1964 __tree_.__insert_multi_from_orphaned_node(__e.__i_, std::move(__m.__tree_.remove(__m.begin().__i_)->__value_));2072 template <class _Map, class _Func, class _Proj>
2073 _LIBCPP_HIDE_FROM_ABI static auto operator()(_Map&& __map, _Func __func, _Proj __proj) {
2074 auto [_, __func2] = __specialized_algorithm<_Algorithm::__for_each, __single_range<typename __map::__base>>()(
2075 __map.__tree_, std::move(__func), std::move(__proj));
2076 return std::make_pair(__map.end(), std::move(__func2));
1965 }2077 }
1966}2078};
1967# endif2079# endif
19682080
1969template <class _Key, class _Tp, class _Compare, class _Allocator>2081template <class _Key, class _Tp, class _Compare, class _Allocator>
lib/libcxx/include/math.h+19
...@@ -429,6 +429,25 @@ using std::__math::isnormal;...@@ -429,6 +429,25 @@ using std::__math::isnormal;
429using std::__math::isunordered;429using std::__math::isunordered;
430# endif // _LIBCPP_MSVCRT430# endif // _LIBCPP_MSVCRT
431431
432# if defined(_LIBCPP_MSVCRT) && _LIBCPP_STD_VER >= 20
433// MS UCRT incorrectly defines some functions in a way not working with integer types. Until C++20, this was worked
434// around by -fdelayed-template-parsing. Since C++20, we can use standard feature "requires" instead.
435
436// TODO: Remove the workaround once UCRT fixes these functions. Note that this doesn't seem planned as of 2025-07 per
437// https://developercommunity.visualstudio.com/t/10294165.
438
439using std::__math::__ucrt::isfinite;
440using std::__math::__ucrt::isgreater;
441using std::__math::__ucrt::isgreaterequal;
442using std::__math::__ucrt::isinf;
443using std::__math::__ucrt::isless;
444using std::__math::__ucrt::islessequal;
445using std::__math::__ucrt::islessgreater;
446using std::__math::__ucrt::isnan;
447using std::__math::__ucrt::isnormal;
448using std::__math::__ucrt::isunordered;
449# endif // defined(_LIBCPP_MSVCRT) && _LIBCPP_STD_VER >= 20
450
432// We have to provide double overloads for <math.h> to work on platforms that don't provide the full set of math451// We have to provide double overloads for <math.h> to work on platforms that don't provide the full set of math
433// functions. To make the overload set work with multiple functions that take the same arguments, we make our overloads452// functions. To make the overload set work with multiple functions that take the same arguments, we make our overloads
434// templates. Functions are preferred over function templates during overload resolution, which means that our overload453// templates. Functions are preferred over function templates during overload resolution, which means that our overload
lib/libcxx/include/mdspan+1-5
...@@ -450,11 +450,7 @@ namespace std {...@@ -450,11 +450,7 @@ namespace std {
450# include <__config>450# include <__config>
451451
452# if _LIBCPP_STD_VER >= 23452# if _LIBCPP_STD_VER >= 23
453# include <__fwd/mdspan.h> // TODO(boomanaiden154): This is currently a453# include <__fwd/mdspan.h>
454 // non-standard extension to include
455 // std::dynamic_extent tracked by LWG issue 4275.
456 // This comment should be deleted or the include
457 // deleted upon resolution.
458# include <__fwd/span.h>454# include <__fwd/span.h>
459# include <__mdspan/default_accessor.h>455# include <__mdspan/default_accessor.h>
460# include <__mdspan/extents.h>456# include <__mdspan/extents.h>
lib/libcxx/include/mutex+29-19
...@@ -229,12 +229,12 @@ public:...@@ -229,12 +229,12 @@ public:
229 recursive_mutex& operator=(const recursive_mutex&) = delete;229 recursive_mutex& operator=(const recursive_mutex&) = delete;
230230
231 void lock();231 void lock();
232 bool try_lock() _NOEXCEPT;232 [[__nodiscard__]] bool try_lock() _NOEXCEPT;
233 void unlock() _NOEXCEPT;233 void unlock() _NOEXCEPT;
234234
235 typedef __libcpp_recursive_mutex_t* native_handle_type;235 typedef __libcpp_recursive_mutex_t* native_handle_type;
236236
237 _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }237 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }
238};238};
239239
240class _LIBCPP_EXPORTED_FROM_ABI timed_mutex {240class _LIBCPP_EXPORTED_FROM_ABI timed_mutex {
...@@ -251,14 +251,14 @@ public:...@@ -251,14 +251,14 @@ public:
251251
252public:252public:
253 void lock();253 void lock();
254 bool try_lock() _NOEXCEPT;254 [[__nodiscard__]] bool try_lock() _NOEXCEPT;
255 template <class _Rep, class _Period>255 template <class _Rep, class _Period>
256 _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {256 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {
257 return try_lock_until(chrono::steady_clock::now() + __d);257 return try_lock_until(chrono::steady_clock::now() + __d);
258 }258 }
259259
260 template <class _Clock, class _Duration>260 template <class _Clock, class _Duration>
261 _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {
262 using namespace chrono;262 using namespace chrono;
263 unique_lock<mutex> __lk(__m_);263 unique_lock<mutex> __lk(__m_);
264 bool __no_timeout = _Clock::now() < __t;264 bool __no_timeout = _Clock::now() < __t;
...@@ -288,14 +288,14 @@ public:...@@ -288,14 +288,14 @@ public:
288 recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;288 recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
289289
290 void lock();290 void lock();
291 bool try_lock() _NOEXCEPT;291 [[__nodiscard__]] bool try_lock() _NOEXCEPT;
292 template <class _Rep, class _Period>292 template <class _Rep, class _Period>
293 _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {293 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {
294 return try_lock_until(chrono::steady_clock::now() + __d);294 return try_lock_until(chrono::steady_clock::now() + __d);
295 }295 }
296296
297 template <class _Clock, class _Duration>297 template <class _Clock, class _Duration>
298 _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {298 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {
299 using namespace chrono;299 using namespace chrono;
300 __thread_id __id = this_thread::get_id();300 __thread_id __id = this_thread::get_id();
301 unique_lock<mutex> __lk(__m_);301 unique_lock<mutex> __lk(__m_);
...@@ -320,7 +320,7 @@ public:...@@ -320,7 +320,7 @@ public:
320};320};
321321
322template <class _L0, class _L1>322template <class _L0, class _L1>
323_LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1) {323[[__nodiscard__]] _LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1) {
324 unique_lock<_L0> __u0(__l0, try_to_lock_t());324 unique_lock<_L0> __u0(__l0, try_to_lock_t());
325 if (__u0.owns_lock()) {325 if (__u0.owns_lock()) {
326 if (__l1.try_lock()) {326 if (__l1.try_lock()) {
...@@ -335,7 +335,8 @@ _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1) {...@@ -335,7 +335,8 @@ _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1) {
335# ifndef _LIBCPP_CXX03_LANG335# ifndef _LIBCPP_CXX03_LANG
336336
337template <class _L0, class _L1, class _L2, class... _L3>337template <class _L0, class _L1, class _L2, class... _L3>
338_LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {338[[__nodiscard__]] _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
339 _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
339 int __r = 0;340 int __r = 0;
340 unique_lock<_L0> __u0(__l0, try_to_lock);341 unique_lock<_L0> __u0(__l0, try_to_lock);
341 if (__u0.owns_lock()) {342 if (__u0.owns_lock()) {
...@@ -350,8 +351,11 @@ _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3...@@ -350,8 +351,11 @@ _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3
350351
351# endif // _LIBCPP_CXX03_LANG352# endif // _LIBCPP_CXX03_LANG
352353
354// We're using unique_lock to implement the functions, which thread annotations don't support. So we have to disable
355// the analysis inside the function.
353template <class _L0, class _L1>356template <class _L0, class _L1>
354_LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1) {357_LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1)
358 _LIBCPP_ACQUIRE_CAPABILITY(__l0, __l1) {
355 while (true) {359 while (true) {
356 {360 {
357 unique_lock<_L0> __u0(__l0);361 unique_lock<_L0> __u0(__l0);
...@@ -375,7 +379,7 @@ _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1) {...@@ -375,7 +379,7 @@ _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1) {
375# ifndef _LIBCPP_CXX03_LANG379# ifndef _LIBCPP_CXX03_LANG
376380
377template <class _L0, class _L1, class _L2, class... _L3>381template <class _L0, class _L1, class _L2, class... _L3>
378void __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {382_LIBCPP_NO_THREAD_SAFETY_ANALYSIS void __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
379 while (true) {383 while (true) {
380 switch (__i) {384 switch (__i) {
381 case 0: {385 case 0: {
...@@ -410,8 +414,14 @@ void __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {...@@ -410,8 +414,14 @@ void __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
410 }414 }
411}415}
412416
417// We're using unique_lock to implement the functions, which thread annotations don't support. So we have to disable
418// the analysis inside the function.
413template <class _L0, class _L1, class _L2, class... _L3>419template <class _L0, class _L1, class _L2, class... _L3>
414inline _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {420_LIBCPP_NO_THREAD_SAFETY_ANALYSIS inline _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3)
421# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2101
422 _LIBCPP_ACQUIRE_CAPABILITY(__l0, __l1, __l2, __l3...)
423# endif
424{
415 std::__lock_first(0, __l0, __l1, __l2, __l3...);425 std::__lock_first(0, __l0, __l1, __l2, __l3...);
416}426}
417427
...@@ -469,17 +479,14 @@ public:...@@ -469,17 +479,14 @@ public:
469479
470 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) {}480 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) {}
471481
472 _LIBCPP_HIDE_FROM_ABI ~scoped_lock() {482 _LIBCPP_HIDE_FROM_ABI ~scoped_lock() { __unlock_unpack(make_index_sequence<sizeof...(_MArgs)>(), __t_); }
473 typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices;
474 __unlock_unpack(_Indices{}, __t_);
475 }
476483
477 scoped_lock(scoped_lock const&) = delete;484 scoped_lock(scoped_lock const&) = delete;
478 scoped_lock& operator=(scoped_lock const&) = delete;485 scoped_lock& operator=(scoped_lock const&) = delete;
479486
480private:487private:
481 template <size_t... _Indx>488 template <size_t... _Indx>
482 _LIBCPP_HIDE_FROM_ABI static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {489 _LIBCPP_HIDE_FROM_ABI static void __unlock_unpack(index_sequence<_Indx...>, _MutexTuple& __mt) {
483 (std::get<_Indx>(__mt).unlock(), ...);490 (std::get<_Indx>(__mt).unlock(), ...);
484 }491 }
485492
...@@ -494,6 +501,10 @@ _LIBCPP_END_NAMESPACE_STD...@@ -494,6 +501,10 @@ _LIBCPP_END_NAMESPACE_STD
494501
495_LIBCPP_POP_MACROS502_LIBCPP_POP_MACROS
496503
504# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
505# include <typeinfo>
506# endif
507
497# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20508# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
498# include <atomic>509# include <atomic>
499# include <concepts>510# include <concepts>
...@@ -507,7 +518,6 @@ _LIBCPP_POP_MACROS...@@ -507,7 +518,6 @@ _LIBCPP_POP_MACROS
507# include <stdexcept>518# include <stdexcept>
508# include <system_error>519# include <system_error>
509# include <type_traits>520# include <type_traits>
510# include <typeinfo>
511# endif521# endif
512#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)522#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
513523
lib/libcxx/include/optional+644-149
...@@ -20,6 +20,11 @@ namespace std {...@@ -20,6 +20,11 @@ namespace std {
20 template <class T>20 template <class T>
21 class optional;21 class optional;
2222
23 template<class T>
24 constexpr bool ranges::enable_view<optional<T>> = true;
25 template<class T>
26 constexpr auto format_kind<optional<T>> = range_format::disabled;
27
23 template<class T>28 template<class T>
24 concept is-derived-from-optional = requires(const T& t) { // exposition only29 concept is-derived-from-optional = requires(const T& t) { // exposition only
25 []<class U>(const optional<U>&){ }(t);30 []<class U>(const optional<U>&){ }(t);
...@@ -102,6 +107,8 @@ namespace std {...@@ -102,6 +107,8 @@ namespace std {
102 class optional {107 class optional {
103 public:108 public:
104 using value_type = T;109 using value_type = T;
110 using iterator = implementation-defined; // see [optional.iterators]
111 using const_iterator = implementation-defined; // see [optional.iterators]
105112
106 // [optional.ctor], constructors113 // [optional.ctor], constructors
107 constexpr optional() noexcept;114 constexpr optional() noexcept;
...@@ -112,7 +119,7 @@ namespace std {...@@ -112,7 +119,7 @@ namespace std {
112 constexpr explicit optional(in_place_t, Args &&...);119 constexpr explicit optional(in_place_t, Args &&...);
113 template<class U, class... Args>120 template<class U, class... Args>
114 constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);121 constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);
115 template<class U = T>122 template<class U = remove_cv_t<T>>
116 constexpr explicit(see-below) optional(U &&);123 constexpr explicit(see-below) optional(U &&);
117 template<class U>124 template<class U>
118 explicit(see-below) optional(const optional<U> &); // constexpr in C++20125 explicit(see-below) optional(const optional<U> &); // constexpr in C++20
...@@ -126,7 +133,7 @@ namespace std {...@@ -126,7 +133,7 @@ namespace std {
126 optional &operator=(nullopt_t) noexcept; // constexpr in C++20133 optional &operator=(nullopt_t) noexcept; // constexpr in C++20
127 constexpr optional &operator=(const optional &);134 constexpr optional &operator=(const optional &);
128 constexpr optional &operator=(optional &&) noexcept(see below);135 constexpr optional &operator=(optional &&) noexcept(see below);
129 template<class U = T> optional &operator=(U &&); // constexpr in C++20136 template<class U = remove_cv_t<T>> optional &operator=(U &&); // constexpr in C++20
130 template<class U> optional &operator=(const optional<U> &); // constexpr in C++20137 template<class U> optional &operator=(const optional<U> &); // constexpr in C++20
131 template<class U> optional &operator=(optional<U> &&); // constexpr in C++20138 template<class U> optional &operator=(optional<U> &&); // constexpr in C++20
132 template<class... Args> T& emplace(Args &&...); // constexpr in C++20139 template<class... Args> T& emplace(Args &&...); // constexpr in C++20
...@@ -135,6 +142,12 @@ namespace std {...@@ -135,6 +142,12 @@ namespace std {
135 // [optional.swap], swap142 // [optional.swap], swap
136 void swap(optional &) noexcept(see below ); // constexpr in C++20143 void swap(optional &) noexcept(see below ); // constexpr in C++20
137144
145 // [optional.iterators], iterator support
146 constexpr iterator begin() noexcept;
147 constexpr const_iterator begin() const noexcept;
148 constexpr iterator end() noexcept;
149 constexpr const_iterator end() const noexcept;
150
138 // [optional.observe], observers151 // [optional.observe], observers
139 constexpr T const *operator->() const noexcept;152 constexpr T const *operator->() const noexcept;
140 constexpr T *operator->() noexcept;153 constexpr T *operator->() noexcept;
...@@ -148,8 +161,8 @@ namespace std {...@@ -148,8 +161,8 @@ namespace std {
148 constexpr T &value() &;161 constexpr T &value() &;
149 constexpr T &&value() &&;162 constexpr T &&value() &&;
150 constexpr const T &&value() const &&;163 constexpr const T &&value() const &&;
151 template<class U> constexpr T value_or(U &&) const &;164 template<class U = remove_cv_t<T>> constexpr T value_or(U &&) const &;
152 template<class U> constexpr T value_or(U &&) &&;165 template<class U = remove_cv_t<T>> constexpr T value_or(U &&) &&;
153166
154 // [optional.monadic], monadic operations167 // [optional.monadic], monadic operations
155 template<class F> constexpr auto and_then(F&& f) &; // since C++23168 template<class F> constexpr auto and_then(F&& f) &; // since C++23
...@@ -173,6 +186,71 @@ namespace std {...@@ -173,6 +186,71 @@ namespace std {
173 template<class T>186 template<class T>
174 optional(T) -> optional<T>;187 optional(T) -> optional<T>;
175188
189 template<class T>
190 class optional<T&> { // since C++26
191 public:
192 using value_type = T;
193 using iterator = implementation-defined; // see [optional.ref.iterators]
194
195 public:
196 // [optional.ref.ctor], constructors
197 constexpr optional() noexcept = default;
198 constexpr optional(nullopt_t) noexcept : optional() {}
199 constexpr optional(const optional& rhs) noexcept = default;
200
201 template<class Arg>
202 constexpr explicit optional(in_place_t, Arg&& arg);
203 template<class U>
204 constexpr explicit(see below) optional(U&& u) noexcept(see below);
205 template<class U>
206 constexpr explicit(see below) optional(optional<U>& rhs) noexcept(see below);
207 template<class U>
208 constexpr explicit(see below) optional(const optional<U>& rhs) noexcept(see below);
209 template<class U>
210 constexpr explicit(see below) optional(optional<U>&& rhs) noexcept(see below);
211 template<class U>
212 constexpr explicit(see below) optional(const optional<U>&& rhs) noexcept(see below);
213
214 constexpr ~optional() = default;
215
216 // [optional.ref.assign], assignment
217 constexpr optional& operator=(nullopt_t) noexcept;
218 constexpr optional& operator=(const optional& rhs) noexcept = default;
219
220 template<class U> constexpr T& emplace(U&& u) noexcept(see below);
221
222 // [optional.ref.swap], swap
223 constexpr void swap(optional& rhs) noexcept;
224
225 // [optional.ref.iterators], iterator support
226 constexpr iterator begin() const noexcept;
227 constexpr iterator end() const noexcept;
228
229 // [optional.ref.observe], observers
230 constexpr T* operator->() const noexcept;
231 constexpr T& operator*() const noexcept;
232 constexpr explicit operator bool() const noexcept;
233 constexpr bool has_value() const noexcept;
234 constexpr T& value() const; // freestanding-deleted
235 template<class U = remove_cv_t<T>>
236 constexpr remove_cv_t<T> value_or(U&& u) const;
237
238 // [optional.ref.monadic], monadic operations
239 template<class F> constexpr auto and_then(F&& f) const;
240 template<class F> constexpr optional<invoke_result_t<F, T&>> transform(F&& f) const;
241 template<class F> constexpr optional or_else(F&& f) const;
242
243 // [optional.ref.mod], modifiers
244 constexpr void reset() noexcept;
245
246 private:
247 T* val = nullptr; // exposition only
248
249 // [optional.ref.expos], exposition only helper functions
250 template<class U>
251 constexpr void convert-ref-init-val(U&& u); // exposition only
252 };
253
176} // namespace std254} // namespace std
177255
178*/256*/
...@@ -186,13 +264,19 @@ namespace std {...@@ -186,13 +264,19 @@ namespace std {
186# include <__compare/three_way_comparable.h>264# include <__compare/three_way_comparable.h>
187# include <__concepts/invocable.h>265# include <__concepts/invocable.h>
188# include <__config>266# include <__config>
267# include <__cstddef/ptrdiff_t.h>
189# include <__exception/exception.h>268# include <__exception/exception.h>
269# include <__format/range_format.h>
190# include <__functional/hash.h>270# include <__functional/hash.h>
191# include <__functional/invoke.h>271# include <__functional/invoke.h>
192# include <__functional/unary_function.h>272# include <__functional/unary_function.h>
193# include <__fwd/functional.h>273# include <__fwd/functional.h>
274# include <__iterator/bounded_iter.h>
275# include <__iterator/wrap_iter.h>
194# include <__memory/addressof.h>276# include <__memory/addressof.h>
195# include <__memory/construct_at.h>277# include <__memory/construct_at.h>
278# include <__ranges/enable_borrowed_range.h>
279# include <__ranges/enable_view.h>
196# include <__tuple/sfinae_helpers.h>280# include <__tuple/sfinae_helpers.h>
197# include <__type_traits/add_pointer.h>281# include <__type_traits/add_pointer.h>
198# include <__type_traits/conditional.h>282# include <__type_traits/conditional.h>
...@@ -200,6 +284,7 @@ namespace std {...@@ -200,6 +284,7 @@ namespace std {
200# include <__type_traits/decay.h>284# include <__type_traits/decay.h>
201# include <__type_traits/disjunction.h>285# include <__type_traits/disjunction.h>
202# include <__type_traits/enable_if.h>286# include <__type_traits/enable_if.h>
287# include <__type_traits/integral_constant.h>
203# include <__type_traits/invoke.h>288# include <__type_traits/invoke.h>
204# include <__type_traits/is_array.h>289# include <__type_traits/is_array.h>
205# include <__type_traits/is_assignable.h>290# include <__type_traits/is_assignable.h>
...@@ -207,11 +292,11 @@ namespace std {...@@ -207,11 +292,11 @@ namespace std {
207# include <__type_traits/is_convertible.h>292# include <__type_traits/is_convertible.h>
208# include <__type_traits/is_core_convertible.h>293# include <__type_traits/is_core_convertible.h>
209# include <__type_traits/is_destructible.h>294# include <__type_traits/is_destructible.h>
295# include <__type_traits/is_function.h>
210# include <__type_traits/is_nothrow_assignable.h>296# include <__type_traits/is_nothrow_assignable.h>
211# include <__type_traits/is_nothrow_constructible.h>297# include <__type_traits/is_nothrow_constructible.h>
212# include <__type_traits/is_object.h>298# include <__type_traits/is_object.h>
213# include <__type_traits/is_reference.h>299# include <__type_traits/is_reference.h>
214# include <__type_traits/is_replaceable.h>
215# include <__type_traits/is_same.h>300# include <__type_traits/is_same.h>
216# include <__type_traits/is_scalar.h>301# include <__type_traits/is_scalar.h>
217# include <__type_traits/is_swappable.h>302# include <__type_traits/is_swappable.h>
...@@ -220,6 +305,7 @@ namespace std {...@@ -220,6 +305,7 @@ namespace std {
220# include <__type_traits/is_trivially_destructible.h>305# include <__type_traits/is_trivially_destructible.h>
221# include <__type_traits/is_trivially_relocatable.h>306# include <__type_traits/is_trivially_relocatable.h>
222# include <__type_traits/negation.h>307# include <__type_traits/negation.h>
308# include <__type_traits/reference_constructs_from_temporary.h>
223# include <__type_traits/remove_const.h>309# include <__type_traits/remove_const.h>
224# include <__type_traits/remove_cv.h>310# include <__type_traits/remove_cv.h>
225# include <__type_traits/remove_cvref.h>311# include <__type_traits/remove_cvref.h>
...@@ -255,7 +341,7 @@ public:...@@ -255,7 +341,7 @@ public:
255 _LIBCPP_HIDE_FROM_ABI bad_optional_access& operator=(const bad_optional_access&) _NOEXCEPT = default;341 _LIBCPP_HIDE_FROM_ABI bad_optional_access& operator=(const bad_optional_access&) _NOEXCEPT = default;
256 // Get the key function ~bad_optional_access() into the dylib342 // Get the key function ~bad_optional_access() into the dylib
257 ~bad_optional_access() _NOEXCEPT override;343 ~bad_optional_access() _NOEXCEPT override;
258 const char* what() const _NOEXCEPT override;344 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
259};345};
260346
261} // namespace std347} // namespace std
...@@ -358,7 +444,7 @@ struct __optional_storage_base : __optional_destruct_base<_Tp> {...@@ -358,7 +444,7 @@ struct __optional_storage_base : __optional_destruct_base<_Tp> {
358 using value_type = _Tp;444 using value_type = _Tp;
359 using __base::__base;445 using __base::__base;
360446
361 _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__engaged_; }447 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__engaged_; }
362448
363 _LIBCPP_HIDE_FROM_ABI constexpr value_type& __get() & noexcept { return this->__val_; }449 _LIBCPP_HIDE_FROM_ABI constexpr value_type& __get() & noexcept { return this->__val_; }
364 _LIBCPP_HIDE_FROM_ABI constexpr const value_type& __get() const& noexcept { return this->__val_; }450 _LIBCPP_HIDE_FROM_ABI constexpr const value_type& __get() const& noexcept { return this->__val_; }
...@@ -390,58 +476,60 @@ struct __optional_storage_base : __optional_destruct_base<_Tp> {...@@ -390,58 +476,60 @@ struct __optional_storage_base : __optional_destruct_base<_Tp> {
390 __construct(std::forward<_That>(__opt).__get());476 __construct(std::forward<_That>(__opt).__get());
391 }477 }
392 }478 }
479
480 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
481 __swap(__optional_storage_base& __rhs) noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_swappable_v<_Tp>) {
482 using std::swap;
483 if (this->has_value() == __rhs.has_value()) {
484 if (this->has_value())
485 swap(this->__get(), __rhs.__get());
486 } else {
487 if (this->has_value()) {
488 __rhs.__construct(std::move(this->__get()));
489 this->reset();
490 } else {
491 this->__construct(std::move(__rhs.__get()));
492 __rhs.reset();
493 }
494 }
495 }
393};496};
394497
395// optional<T&> is currently required to be ill-formed. However, it may
396// be allowed in the future. For this reason, it has already been implemented
397// to ensure we can make the change in an ABI-compatible manner.
398template <class _Tp>498template <class _Tp>
399struct __optional_storage_base<_Tp, true> {499struct __optional_storage_base<_Tp, true> {
400 using value_type = _Tp;500 using value_type = _Tp;
401 using __raw_type _LIBCPP_NODEBUG = remove_reference_t<_Tp>;501 using __raw_type _LIBCPP_NODEBUG = remove_reference_t<_Tp>;
402 __raw_type* __value_;502 __raw_type* __value_;
403503
504 _LIBCPP_HIDE_FROM_ABI constexpr __optional_storage_base() noexcept : __value_(nullptr) {}
505
404 template <class _Up>506 template <class _Up>
405 static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() {507 _LIBCPP_HIDE_FROM_ABI constexpr void __convert_init_ref_val(_Up&& __val) noexcept {
406 using _RawUp = __libcpp_remove_reference_t<_Up>;508 _Tp& __r(std::forward<_Up>(__val));
407 using _UpPtr = _RawUp*;509 __value_ = std::addressof(__r);
408 using _RawTp = __libcpp_remove_reference_t<_Tp>;
409 using _TpPtr = _RawTp*;
410 using _CheckLValueArg =
411 integral_constant<bool,
412 (is_lvalue_reference<_Up>::value && is_convertible<_UpPtr, _TpPtr>::value) ||
413 is_same<_RawUp, reference_wrapper<_RawTp>>::value ||
414 is_same<_RawUp, reference_wrapper<__remove_const_t<_RawTp>>>::value >;
415 return (is_lvalue_reference<_Tp>::value && _CheckLValueArg::value) ||
416 (is_rvalue_reference<_Tp>::value && !is_lvalue_reference<_Up>::value &&
417 is_convertible<_UpPtr, _TpPtr>::value);
418 }510 }
419511
420 _LIBCPP_HIDE_FROM_ABI constexpr __optional_storage_base() noexcept : __value_(nullptr) {}
421
422 template <class _UArg>512 template <class _UArg>
423 _LIBCPP_HIDE_FROM_ABI constexpr explicit __optional_storage_base(in_place_t, _UArg&& __uarg)513 _LIBCPP_HIDE_FROM_ABI constexpr explicit __optional_storage_base(in_place_t, _UArg&& __uarg) {
424 : __value_(std::addressof(__uarg)) {514 static_assert(!__reference_constructs_from_temporary_v<_Tp, _UArg>,
425 static_assert(__can_bind_reference<_UArg>(),515 "Attempted to construct a reference element in optional from a "
426 "Attempted to construct a reference element in tuple from a "
427 "possible temporary");516 "possible temporary");
517 __convert_init_ref_val(std::forward<_UArg>(__uarg));
428 }518 }
429519
430 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reset() noexcept { __value_ = nullptr; }520 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reset() noexcept { __value_ = nullptr; }
431521
432 _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return __value_ != nullptr; }522 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return __value_ != nullptr; }
433
434 _LIBCPP_HIDE_FROM_ABI constexpr value_type& __get() const& noexcept { return *__value_; }
435523
436 _LIBCPP_HIDE_FROM_ABI constexpr value_type&& __get() const&& noexcept { return std::forward<value_type>(*__value_); }524 _LIBCPP_HIDE_FROM_ABI constexpr value_type& __get() const noexcept { return *__value_; }
437525
438 template <class _UArg>526 template <class _UArg>
439 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_UArg&& __val) {527 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_UArg&& __val) {
440 _LIBCPP_ASSERT_INTERNAL(!has_value(), "__construct called for engaged __optional_storage");528 _LIBCPP_ASSERT_INTERNAL(!has_value(), "__construct called for engaged __optional_storage");
441 static_assert(__can_bind_reference<_UArg>(),529 static_assert(!__reference_constructs_from_temporary_v<_Tp, _UArg>,
442 "Attempted to construct a reference element in tuple from a "530 "Attempted to construct a reference element in tuple from a "
443 "possible temporary");531 "possible temporary");
444 __value_ = std::addressof(__val);532 __convert_init_ref_val(std::forward<_UArg>(__val));
445 }533 }
446534
447 template <class _That>535 template <class _That>
...@@ -462,9 +550,13 @@ struct __optional_storage_base<_Tp, true> {...@@ -462,9 +550,13 @@ struct __optional_storage_base<_Tp, true> {
462 __construct(std::forward<_That>(__opt).__get());550 __construct(std::forward<_That>(__opt).__get());
463 }551 }
464 }552 }
553
554 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __swap(__optional_storage_base& __rhs) noexcept {
555 std::swap(__value_, __rhs.__value_);
556 }
465};557};
466558
467template <class _Tp, bool = is_trivially_copy_constructible<_Tp>::value>559template <class _Tp, bool = is_trivially_copy_constructible_v<_Tp> || is_lvalue_reference_v<_Tp>>
468struct __optional_copy_base : __optional_storage_base<_Tp> {560struct __optional_copy_base : __optional_storage_base<_Tp> {
469 using __optional_storage_base<_Tp>::__optional_storage_base;561 using __optional_storage_base<_Tp>::__optional_storage_base;
470};562};
...@@ -484,7 +576,7 @@ struct __optional_copy_base<_Tp, false> : __optional_storage_base<_Tp> {...@@ -484,7 +576,7 @@ struct __optional_copy_base<_Tp, false> : __optional_storage_base<_Tp> {
484 _LIBCPP_HIDE_FROM_ABI __optional_copy_base& operator=(__optional_copy_base&&) = default;576 _LIBCPP_HIDE_FROM_ABI __optional_copy_base& operator=(__optional_copy_base&&) = default;
485};577};
486578
487template <class _Tp, bool = is_trivially_move_constructible<_Tp>::value>579template <class _Tp, bool = is_trivially_move_constructible_v<_Tp> || is_lvalue_reference_v<_Tp>>
488struct __optional_move_base : __optional_copy_base<_Tp> {580struct __optional_move_base : __optional_copy_base<_Tp> {
489 using __optional_copy_base<_Tp>::__optional_copy_base;581 using __optional_copy_base<_Tp>::__optional_copy_base;
490};582};
...@@ -507,8 +599,9 @@ struct __optional_move_base<_Tp, false> : __optional_copy_base<_Tp> {...@@ -507,8 +599,9 @@ struct __optional_move_base<_Tp, false> : __optional_copy_base<_Tp> {
507};599};
508600
509template <class _Tp,601template <class _Tp,
510 bool = is_trivially_destructible<_Tp>::value && is_trivially_copy_constructible<_Tp>::value &&602 bool = (is_trivially_destructible_v<_Tp> && is_trivially_copy_constructible_v<_Tp> &&
511 is_trivially_copy_assignable<_Tp>::value>603 is_trivially_copy_assignable_v<_Tp>) ||
604 is_lvalue_reference_v<_Tp>>
512struct __optional_copy_assign_base : __optional_move_base<_Tp> {605struct __optional_copy_assign_base : __optional_move_base<_Tp> {
513 using __optional_move_base<_Tp>::__optional_move_base;606 using __optional_move_base<_Tp>::__optional_move_base;
514};607};
...@@ -531,8 +624,9 @@ struct __optional_copy_assign_base<_Tp, false> : __optional_move_base<_Tp> {...@@ -531,8 +624,9 @@ struct __optional_copy_assign_base<_Tp, false> : __optional_move_base<_Tp> {
531};624};
532625
533template <class _Tp,626template <class _Tp,
534 bool = is_trivially_destructible<_Tp>::value && is_trivially_move_constructible<_Tp>::value &&627 bool = (is_trivially_destructible_v<_Tp> && is_trivially_move_constructible_v<_Tp> &&
535 is_trivially_move_assignable<_Tp>::value>628 is_trivially_move_assignable_v<_Tp>) ||
629 is_lvalue_reference_v<_Tp>>
536struct __optional_move_assign_base : __optional_copy_assign_base<_Tp> {630struct __optional_move_assign_base : __optional_copy_assign_base<_Tp> {
537 using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base;631 using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base;
538};632};
...@@ -561,12 +655,24 @@ using __optional_sfinae_ctor_base_t _LIBCPP_NODEBUG =...@@ -561,12 +655,24 @@ using __optional_sfinae_ctor_base_t _LIBCPP_NODEBUG =
561655
562template <class _Tp>656template <class _Tp>
563using __optional_sfinae_assign_base_t _LIBCPP_NODEBUG =657using __optional_sfinae_assign_base_t _LIBCPP_NODEBUG =
564 __sfinae_assign_base< (is_copy_constructible<_Tp>::value && is_copy_assignable<_Tp>::value),658 __sfinae_assign_base< (is_copy_constructible_v<_Tp> && is_copy_assignable_v<_Tp>) || is_lvalue_reference_v<_Tp>,
565 (is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value) >;659 (is_move_constructible_v<_Tp> && is_move_assignable_v<_Tp>) || is_lvalue_reference_v<_Tp>>;
566660
567template <class _Tp>661template <class _Tp>
568class optional;662class optional;
569663
664# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
665template <class _Tp>
666constexpr bool ranges::enable_view<optional<_Tp>> = true;
667
668template <class _Tp>
669constexpr range_format format_kind<optional<_Tp>> = range_format::disabled;
670
671template <class _Tp>
672constexpr bool ranges::enable_borrowed_range<optional<_Tp&>> = true;
673
674# endif
675
570# if _LIBCPP_STD_VER >= 20676# if _LIBCPP_STD_VER >= 20
571677
572template <class _Tp>678template <class _Tp>
...@@ -579,29 +685,150 @@ struct __is_std_optional : false_type {};...@@ -579,29 +685,150 @@ struct __is_std_optional : false_type {};
579template <class _Tp>685template <class _Tp>
580struct __is_std_optional<optional<_Tp>> : true_type {};686struct __is_std_optional<optional<_Tp>> : true_type {};
581687
688template <class _Tp, class... _Args>
689inline constexpr bool __is_constructible_for_optional_v = is_constructible_v<_Tp, _Args...>;
690
691template <class _Tp, class... _Args>
692struct __is_constructible_for_optional : bool_constant<__is_constructible_for_optional_v<_Tp, _Args...>> {};
693
694template <class _Tp, class _Up, class... _Args>
695inline constexpr bool __is_constructible_for_optional_initializer_list_v =
696 is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>;
697
698# if _LIBCPP_STD_VER >= 26
699template <class _Tp, class... _Args>
700inline constexpr bool __is_constructible_for_optional_v<_Tp&, _Args...> = false;
701template <class _Tp, class _Arg>
702inline constexpr bool __is_constructible_for_optional_v<_Tp&, _Arg> =
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
708
709template <class _Tp, class = void>
710struct __optional_iterator {};
711
712# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
713
714template <class _Tp>
715struct __optional_iterator<_Tp, enable_if_t<is_object_v<_Tp>>> {
716private:
717 using __pointer _LIBCPP_NODEBUG = add_pointer_t<_Tp>;
718 using __const_pointer _LIBCPP_NODEBUG = add_pointer_t<const _Tp>;
719
720public:
721# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
722 using iterator = __bounded_iter<__wrap_iter<__pointer>>;
723 using const_iterator = __bounded_iter<__wrap_iter<__const_pointer>>;
724# else
725 using iterator = __wrap_iter<__pointer>;
726 using const_iterator = __wrap_iter<__const_pointer>;
727# endif
728
729 // [optional.iterators], iterator support
730 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() noexcept {
731 auto& __derived_self = static_cast<optional<_Tp>&>(*this);
732 auto* __ptr = std::addressof(__derived_self.__get());
733
734# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
735 return std::__make_bounded_iter(
736 __wrap_iter<__pointer>(__ptr),
737 __wrap_iter<__pointer>(__ptr),
738 __wrap_iter<__pointer>(__ptr) + (__derived_self.has_value() ? 1 : 0));
739# else
740 return iterator(__ptr);
741# endif
742 }
743
744 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {
745 auto& __derived_self = static_cast<const optional<_Tp>&>(*this);
746 auto* __ptr = std::addressof(__derived_self.__get());
747
748# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
749 return std::__make_bounded_iter(
750 __wrap_iter<__const_pointer>(__ptr),
751 __wrap_iter<__const_pointer>(__ptr),
752 __wrap_iter<__const_pointer>(__ptr) + (__derived_self.has_value() ? 1 : 0));
753# else
754 return const_iterator(__ptr);
755# endif
756 }
757
758 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator end() noexcept {
759 return begin() + (static_cast<optional<_Tp>&>(*this).has_value() ? 1 : 0);
760 }
761 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept {
762 return begin() + (static_cast<const optional<_Tp>&>(*this).has_value() ? 1 : 0);
763 }
764};
765
766template <class _Tp>
767struct __optional_iterator<_Tp&, enable_if_t<is_object_v<_Tp> && !__is_unbounded_array_v<_Tp> >> {
768private:
769 using __pointer _LIBCPP_NODEBUG = add_pointer_t<_Tp>;
770
771public:
772# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
773 using iterator = __bounded_iter<__wrap_iter<__pointer>>;
774# else
775 using iterator = __wrap_iter<__pointer>;
776# endif
777
778 // [optional.ref.iterators], iterator support
779
780 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const noexcept {
781 auto& __derived_self = static_cast<const optional<_Tp&>&>(*this);
782 auto* __ptr = __derived_self.has_value() ? std::addressof(__derived_self.__get()) : nullptr;
783
784# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
785 return std::__make_bounded_iter(
786 __wrap_iter<__pointer>(__ptr),
787 __wrap_iter<__pointer>(__ptr),
788 __wrap_iter<__pointer>(__ptr) + (__derived_self.has_value() ? 1 : 0));
789# else
790 return iterator(__ptr);
791# endif
792 }
793
794 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const noexcept {
795 return begin() + (static_cast<const optional<_Tp&>&>(*this).has_value() ? 1 : 0);
796 }
797};
798
799# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
800
582template <class _Tp>801template <class _Tp>
583class _LIBCPP_DECLSPEC_EMPTY_BASES optional802class _LIBCPP_DECLSPEC_EMPTY_BASES optional
584 : private __optional_move_assign_base<_Tp>,803 : private __optional_move_assign_base<_Tp>,
585 private __optional_sfinae_ctor_base_t<_Tp>,804 private __optional_sfinae_ctor_base_t<_Tp>,
586 private __optional_sfinae_assign_base_t<_Tp> {805 private __optional_sfinae_assign_base_t<_Tp>,
806 public __optional_iterator<_Tp> {
587 using __base _LIBCPP_NODEBUG = __optional_move_assign_base<_Tp>;807 using __base _LIBCPP_NODEBUG = __optional_move_assign_base<_Tp>;
588808
589public:809public:
590 using value_type = _Tp;810 using value_type = __libcpp_remove_reference_t<_Tp>;
591811
592 using __trivially_relocatable _LIBCPP_NODEBUG =812 using __trivially_relocatable _LIBCPP_NODEBUG =
593 conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, optional, void>;813 conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, optional, void>;
594 using __replaceable _LIBCPP_NODEBUG = conditional_t<__is_replaceable_v<_Tp>, optional, void>;
595814
596private:815private:
597 // Disable the reference extension using this static assert.816 static_assert(!is_same_v<__remove_cvref_t<_Tp>, in_place_t>,
598 static_assert(!is_same_v<__remove_cvref_t<value_type>, in_place_t>,
599 "instantiation of optional with in_place_t is ill-formed");817 "instantiation of optional with in_place_t is ill-formed");
600 static_assert(!is_same_v<__remove_cvref_t<value_type>, nullopt_t>,818 static_assert(!is_same_v<__remove_cvref_t<_Tp>, nullopt_t>, "instantiation of optional with nullopt_t is ill-formed");
601 "instantiation of optional with nullopt_t is ill-formed");819# if _LIBCPP_STD_VER >= 26
602 static_assert(!is_reference_v<value_type>, "instantiation of optional with a reference type is ill-formed");820 static_assert(!is_rvalue_reference_v<_Tp>, "instantiation of optional with an rvalue reference type is ill-formed");
603 static_assert(is_destructible_v<value_type>, "instantiation of optional with a non-destructible type is ill-formed");821# else
604 static_assert(!is_array_v<value_type>, "instantiation of optional with an array type is ill-formed");822 static_assert(!is_reference_v<_Tp>, "instantiation of optional with a reference type is ill-formed");
823# endif
824 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");
826
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# endif
605832
606 // LWG2756: conditionally explicit conversion from _Up833 // LWG2756: conditionally explicit conversion from _Up
607 struct _CheckOptionalArgsConstructor {834 struct _CheckOptionalArgsConstructor {
...@@ -674,45 +901,131 @@ public:...@@ -674,45 +901,131 @@ public:
674 _LIBCPP_HIDE_FROM_ABI constexpr optional(optional&&) = default;901 _LIBCPP_HIDE_FROM_ABI constexpr optional(optional&&) = default;
675 _LIBCPP_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {}902 _LIBCPP_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {}
676903
677 template <class _InPlaceT,904 template <
678 class... _Args,905 class _InPlaceT,
679 enable_if_t<_And<_IsSame<_InPlaceT, in_place_t>, is_constructible<value_type, _Args...>>::value, int> = 0>906 class... _Args,
907 enable_if_t<_And<_IsSame<_InPlaceT, in_place_t>, __is_constructible_for_optional<_Tp, _Args...>>::value, int> = 0>
680 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_InPlaceT, _Args&&... __args)908 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_InPlaceT, _Args&&... __args)
681 : __base(in_place, std::forward<_Args>(__args)...) {}909 : __base(in_place, std::forward<_Args>(__args)...) {}
682910
683 template <class _Up,911 template <class _Up,
684 class... _Args,912 class... _Args,
685 enable_if_t<is_constructible_v<value_type, initializer_list<_Up>&, _Args...>, int> = 0>913 enable_if_t<__is_constructible_for_optional_initializer_list_v<_Tp, _Up, _Args...>, int> = 0>
686 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)914 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
687 : __base(in_place, __il, std::forward<_Args>(__args)...) {}915 : __base(in_place, __il, std::forward<_Args>(__args)...) {}
688916
689 template <class _Up = value_type,917 template <class _Up = _Tp, enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>(), int> = 0>
690 enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>(), int> = 0>918 _LIBCPP_HIDE_FROM_ABI constexpr optional(_Up&& __v)
691 _LIBCPP_HIDE_FROM_ABI constexpr optional(_Up&& __v) : __base(in_place, std::forward<_Up>(__v)) {}919# if _LIBCPP_STD_VER >= 26
920 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
921# endif
922 : __base(in_place, std::forward<_Up>(__v)) {
923 }
692924
693 template <class _Up, enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>(), int> = 0>925 template <class _Up = remove_cv_t<_Tp>,
694 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_Up&& __v) : __base(in_place, std::forward<_Up>(__v)) {}926 enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>(), int> = 0>
927 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_Up&& __v)
928# if _LIBCPP_STD_VER >= 26
929 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
930# endif
931 : __base(in_place, std::forward<_Up>(__v)) {
932 }
695933
696 // LWG2756: conditionally explicit conversion from const optional<_Up>&934 // LWG2756: conditionally explicit conversion from const optional<_Up>&
697 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>(), int> = 0>935 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>(), int> = 0>
698 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>& __v) {936 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>& __v)
937# if _LIBCPP_STD_VER >= 26
938 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up&>)
939# endif
940 {
699 this->__construct_from(__v);941 this->__construct_from(__v);
700 }942 }
701 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>(), int> = 0>943 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>(), int> = 0>
702 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(const optional<_Up>& __v) {944 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(const optional<_Up>& __v)
945# if _LIBCPP_STD_VER >= 26
946 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up&>)
947# endif
948 {
703 this->__construct_from(__v);949 this->__construct_from(__v);
704 }950 }
705951
706 // LWG2756: conditionally explicit conversion from optional<_Up>&&952 // LWG2756: conditionally explicit conversion from optional<_Up>&&
707 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_implicit<_Up>(), int> = 0>953 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_implicit<_Up>(), int> = 0>
708 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(optional<_Up>&& __v) {954 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(optional<_Up>&& __v)
955# if _LIBCPP_STD_VER >= 26
956 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
957# endif
958 {
709 this->__construct_from(std::move(__v));959 this->__construct_from(std::move(__v));
710 }960 }
711 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_explicit<_Up>(), int> = 0>961 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_explicit<_Up>(), int> = 0>
712 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(optional<_Up>&& __v) {962 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(optional<_Up>&& __v)
963# if _LIBCPP_STD_VER >= 26
964 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
965# endif
966 {
713 this->__construct_from(std::move(__v));967 this->__construct_from(std::move(__v));
714 }968 }
715969
970 // deleted optional<T&> constructors and additional optional<T&> constructors
971# if _LIBCPP_STD_VER >= 26
972 // optional(U&&)
973 template <class _Up = _Tp, enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>(), int> = 0>
974 requires __libcpp_opt_ref_ctor_deleted<_Up>
975 optional(_Up&&) = delete;
976
977 template <class _Up = remove_cv_t<_Tp>,
978 enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>(), int> = 0>
979 requires __libcpp_opt_ref_ctor_deleted<_Up>
980 explicit optional(_Up&&) = delete;
981
982 // optional(optional<U>& rhs)
983 template <class _Up>
984 requires(!__libcpp_opt_ref_ctor_deleted<_Up>) && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
985 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up&>
986 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!is_convertible_v<_Up&, _Tp&>)
987 optional(optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up&>) {
988 this->__construct_from(__rhs);
989 }
990
991 template <class _Up>
992 requires __libcpp_opt_ref_ctor_deleted<_Up> && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
993 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up&>
994 constexpr explicit optional(optional<_Up>& __rhs) noexcept = delete;
995
996 // optional(const optional<U>&)
997 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>(), int> = 0>
998 requires __libcpp_opt_ref_ctor_deleted<_Up>
999 optional(const optional<_Up>&) = delete;
1000
1001 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>(), int> = 0>
1002 requires __libcpp_opt_ref_ctor_deleted<_Up>
1003 explicit optional(const optional<_Up>&) = delete;
1004
1005 // optional(optional<U>&&)
1006 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_implicit<_Up>(), int> = 0>
1007 requires __libcpp_opt_ref_ctor_deleted<_Up>
1008 optional(optional<_Up>&&) = delete;
1009
1010 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_explicit<_Up>(), int> = 0>
1011 requires __libcpp_opt_ref_ctor_deleted<_Up>
1012 explicit optional(optional<_Up>&&) = delete;
1013
1014 // optional(const optional<U>&&)
1015 template <class _Up>
1016 requires(!__libcpp_opt_ref_ctor_deleted<_Up>) && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
1017 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up>
1018 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!is_convertible_v<const _Up, _Tp&>)
1019 optional(const optional<_Up>&& __v) noexcept(is_nothrow_constructible_v<_Tp&, const _Up>) {
1020 this->__construct_from(std::move(__v));
1021 }
1022
1023 template <class _Up>
1024 requires __libcpp_opt_ref_ctor_deleted<_Up> && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
1025 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up>
1026 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>&& __v) noexcept = delete;
1027# endif
1028
716# if _LIBCPP_STD_VER >= 231029# if _LIBCPP_STD_VER >= 23
717 template <class _Tag,1030 template <class _Tag,
718 class _Fp,1031 class _Fp,
...@@ -731,11 +1044,12 @@ public:...@@ -731,11 +1044,12 @@ public:
731 _LIBCPP_HIDE_FROM_ABI constexpr optional& operator=(optional&&) = default;1044 _LIBCPP_HIDE_FROM_ABI constexpr optional& operator=(optional&&) = default;
7321045
733 // LWG27561046 // LWG2756
734 template <class _Up = value_type,1047 template <class _Up = remove_cv_t<_Tp>,
735 enable_if_t<_And<_IsNotSame<__remove_cvref_t<_Up>, optional>,1048 enable_if_t<_And<_IsNotSame<__remove_cvref_t<_Up>, optional>,
736 _Or<_IsNotSame<__remove_cvref_t<_Up>, value_type>, _Not<is_scalar<value_type>>>,1049 _Or<_IsNotSame<__remove_cvref_t<_Up>, _Tp>, _Not<is_scalar<_Tp>>>,
737 is_constructible<value_type, _Up>,1050 is_constructible<_Tp, _Up>,
738 is_assignable<value_type&, _Up>>::value,1051 is_assignable<_Tp&, _Up>,
1052 is_object<_Tp>>::value,
739 int> = 0>1053 int> = 0>
740 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional& operator=(_Up&& __v) {1054 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional& operator=(_Up&& __v) {
741 if (this->has_value())1055 if (this->has_value())
...@@ -759,8 +1073,12 @@ public:...@@ -759,8 +1073,12 @@ public:
759 return *this;1073 return *this;
760 }1074 }
7611075
762 template <class... _Args, enable_if_t<is_constructible_v<value_type, _Args...>, int> = 0>1076 template <class... _Args, enable_if_t<__is_constructible_for_optional_v<_Tp, _Args...>, int> = 0>
763 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) {1077 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args)
1078# if _LIBCPP_STD_VER >= 26
1079 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp, _Args...>)
1080# endif
1081 {
764 reset();1082 reset();
765 this->__construct(std::forward<_Args>(__args)...);1083 this->__construct(std::forward<_Args>(__args)...);
766 return this->__get();1084 return this->__get();
...@@ -768,56 +1086,72 @@ public:...@@ -768,56 +1086,72 @@ public:
7681086
769 template <class _Up,1087 template <class _Up,
770 class... _Args,1088 class... _Args,
771 enable_if_t<is_constructible_v<value_type, initializer_list<_Up>&, _Args...>, int> = 0>1089 enable_if_t<__is_constructible_for_optional_initializer_list_v<_Tp, _Up, _Args...>, int> = 0>
772 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {1090 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
773 reset();1091 reset();
774 this->__construct(__il, std::forward<_Args>(__args)...);1092 this->__construct(__il, std::forward<_Args>(__args)...);
775 return this->__get();1093 return this->__get();
776 }1094 }
7771095
778 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void1096 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(optional& __opt) noexcept(
779 swap(optional& __opt) noexcept(is_nothrow_move_constructible_v<value_type> && is_nothrow_swappable_v<value_type>) {1097 (is_nothrow_move_constructible_v<_Tp> && is_nothrow_swappable_v<_Tp>)
780 if (this->has_value() == __opt.has_value()) {1098# if _LIBCPP_STD_VER >= 26
781 using std::swap;1099 || is_lvalue_reference_v<_Tp>
782 if (this->has_value())1100# endif
783 swap(this->__get(), __opt.__get());1101 ) {
784 } else {1102 this->__swap(__opt);
785 if (this->has_value()) {
786 __opt.__construct(std::move(this->__get()));
787 reset();
788 } else {
789 this->__construct(std::move(__opt.__get()));
790 __opt.reset();
791 }
792 }
793 }1103 }
7941104
795 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<value_type const> operator->() const noexcept {1105 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp const> operator->() const noexcept
1106# if _LIBCPP_STD_VER >= 26
1107 requires(is_object_v<_Tp>)
1108# endif
1109 {
796 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");1110 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
797 return std::addressof(this->__get());1111 return std::addressof(this->__get());
798 }1112 }
7991113
800 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<value_type> operator->() noexcept {1114 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> operator->() noexcept
1115# if _LIBCPP_STD_VER >= 26
1116 requires(is_object_v<_Tp>)
1117# endif
1118 {
801 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");1119 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
802 return std::addressof(this->__get());1120 return std::addressof(this->__get());
803 }1121 }
8041122
805 _LIBCPP_HIDE_FROM_ABI constexpr const value_type& operator*() const& noexcept {1123 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const& noexcept
1124# if _LIBCPP_STD_VER >= 26
1125 requires(is_object_v<_Tp>)
1126# endif
1127 {
806 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");1128 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
807 return this->__get();1129 return this->__get();
808 }1130 }
8091131
810 _LIBCPP_HIDE_FROM_ABI constexpr value_type& operator*() & noexcept {1132 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() & noexcept
1133# if _LIBCPP_STD_VER >= 26
1134 requires(is_object_v<_Tp>)
1135# endif
1136 {
811 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");1137 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
812 return this->__get();1138 return this->__get();
813 }1139 }
8141140
815 _LIBCPP_HIDE_FROM_ABI constexpr value_type&& operator*() && noexcept {1141 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator*() && noexcept
1142# if _LIBCPP_STD_VER >= 26
1143 requires(is_object_v<_Tp>)
1144# endif
1145 {
816 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");1146 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
817 return std::move(this->__get());1147 return std::move(this->__get());
818 }1148 }
8191149
820 _LIBCPP_HIDE_FROM_ABI constexpr const value_type&& operator*() const&& noexcept {1150 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& operator*() const&& noexcept
1151# if _LIBCPP_STD_VER >= 26
1152 requires(is_object_v<_Tp>)
1153# endif
1154 {
821 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");1155 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
822 return std::move(this->__get());1156 return std::move(this->__get());
823 }1157 }
...@@ -827,48 +1161,73 @@ public:...@@ -827,48 +1161,73 @@ public:
827 using __base::__get;1161 using __base::__get;
828 using __base::has_value;1162 using __base::has_value;
8291163
830 _LIBCPP_HIDE_FROM_ABI constexpr value_type const& value() const& {1164 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& value() const&
1165# if _LIBCPP_STD_VER >= 26
1166 requires(is_object_v<_Tp>)
1167# endif
1168 {
831 if (!this->has_value())1169 if (!this->has_value())
832 std::__throw_bad_optional_access();1170 std::__throw_bad_optional_access();
833 return this->__get();1171 return this->__get();
834 }1172 }
8351173
836 _LIBCPP_HIDE_FROM_ABI constexpr value_type& value() & {1174 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() &
1175# if _LIBCPP_STD_VER >= 26
1176 requires(is_object_v<_Tp>)
1177# endif
1178 {
837 if (!this->has_value())1179 if (!this->has_value())
838 std::__throw_bad_optional_access();1180 std::__throw_bad_optional_access();
839 return this->__get();1181 return this->__get();
840 }1182 }
8411183
842 _LIBCPP_HIDE_FROM_ABI constexpr value_type&& value() && {1184 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& value() &&
1185# if _LIBCPP_STD_VER >= 26
1186 requires(is_object_v<_Tp>)
1187# endif
1188 {
843 if (!this->has_value())1189 if (!this->has_value())
844 std::__throw_bad_optional_access();1190 std::__throw_bad_optional_access();
845 return std::move(this->__get());1191 return std::move(this->__get());
846 }1192 }
8471193
848 _LIBCPP_HIDE_FROM_ABI constexpr value_type const&& value() const&& {1194 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp const&& value() const&&
1195# if _LIBCPP_STD_VER >= 26
1196 requires(is_object_v<_Tp>)
1197# endif
1198 {
849 if (!this->has_value())1199 if (!this->has_value())
850 std::__throw_bad_optional_access();1200 std::__throw_bad_optional_access();
851 return std::move(this->__get());1201 return std::move(this->__get());
852 }1202 }
8531203
854 template <class _Up>1204 template <class _Up = remove_cv_t<_Tp>>
855 _LIBCPP_HIDE_FROM_ABI constexpr value_type value_or(_Up&& __v) const& {1205# if _LIBCPP_STD_VER >= 26
856 static_assert(is_copy_constructible_v<value_type>, "optional<T>::value_or: T must be copy constructible");1206 requires(is_object_v<_Tp>)
857 static_assert(is_convertible_v<_Up, value_type>, "optional<T>::value_or: U must be convertible to T");1207# endif
858 return this->has_value() ? this->__get() : static_cast<value_type>(std::forward<_Up>(__v));1208 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) const& {
1209 static_assert(is_copy_constructible_v<_Tp>, "optional<T>::value_or: T must be copy constructible");
1210 static_assert(is_convertible_v<_Up, _Tp>, "optional<T>::value_or: U must be convertible to T");
1211 return this->has_value() ? this->__get() : static_cast<_Tp>(std::forward<_Up>(__v));
859 }1212 }
8601213
861 template <class _Up>1214 template <class _Up = remove_cv_t<_Tp>>
862 _LIBCPP_HIDE_FROM_ABI constexpr value_type value_or(_Up&& __v) && {1215# if _LIBCPP_STD_VER >= 26
863 static_assert(is_move_constructible_v<value_type>, "optional<T>::value_or: T must be move constructible");1216 requires(is_object_v<_Tp>)
864 static_assert(is_convertible_v<_Up, value_type>, "optional<T>::value_or: U must be convertible to T");1217# endif
865 return this->has_value() ? std::move(this->__get()) : static_cast<value_type>(std::forward<_Up>(__v));1218 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) && {
1219 static_assert(is_move_constructible_v<_Tp>, "optional<T>::value_or: T must be move constructible");
1220 static_assert(is_convertible_v<_Up, _Tp>, "optional<T>::value_or: U must be convertible to T");
1221 return this->has_value() ? std::move(this->__get()) : static_cast<_Tp>(std::forward<_Up>(__v));
866 }1222 }
8671223
868# if _LIBCPP_STD_VER >= 231224# if _LIBCPP_STD_VER >= 23
869 template <class _Func>1225 template <class _Func>
870 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {1226# if _LIBCPP_STD_VER >= 26
871 using _Up = invoke_result_t<_Func, value_type&>;1227 requires(is_object_v<_Tp>)
1228# endif
1229 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {
1230 using _Up = invoke_result_t<_Func, _Tp&>;
872 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1231 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
873 "Result of f(value()) must be a specialization of std::optional");1232 "Result of f(value()) must be a specialization of std::optional");
874 if (*this)1233 if (*this)
...@@ -877,8 +1236,11 @@ public:...@@ -877,8 +1236,11 @@ public:
877 }1236 }
8781237
879 template <class _Func>1238 template <class _Func>
880 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {1239# if _LIBCPP_STD_VER >= 26
881 using _Up = invoke_result_t<_Func, const value_type&>;1240 requires(is_object_v<_Tp>)
1241# endif
1242 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {
1243 using _Up = invoke_result_t<_Func, const _Tp&>;
882 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1244 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
883 "Result of f(value()) must be a specialization of std::optional");1245 "Result of f(value()) must be a specialization of std::optional");
884 if (*this)1246 if (*this)
...@@ -887,8 +1249,11 @@ public:...@@ -887,8 +1249,11 @@ public:
887 }1249 }
8881250
889 template <class _Func>1251 template <class _Func>
890 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {1252# if _LIBCPP_STD_VER >= 26
891 using _Up = invoke_result_t<_Func, value_type&&>;1253 requires(is_object_v<_Tp>)
1254# endif
1255 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {
1256 using _Up = invoke_result_t<_Func, _Tp&&>;
892 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1257 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
893 "Result of f(std::move(value())) must be a specialization of std::optional");1258 "Result of f(std::move(value())) must be a specialization of std::optional");
894 if (*this)1259 if (*this)
...@@ -897,8 +1262,11 @@ public:...@@ -897,8 +1262,11 @@ public:
897 }1262 }
8981263
899 template <class _Func>1264 template <class _Func>
900 _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {1265# if _LIBCPP_STD_VER >= 26
901 using _Up = invoke_result_t<_Func, const value_type&&>;1266 requires(is_object_v<_Tp>)
1267# endif
1268 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
1269 using _Up = invoke_result_t<_Func, const _Tp&&>;
902 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1270 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
903 "Result of f(std::move(value())) must be a specialization of std::optional");1271 "Result of f(std::move(value())) must be a specialization of std::optional");
904 if (*this)1272 if (*this)
...@@ -907,8 +1275,11 @@ public:...@@ -907,8 +1275,11 @@ public:
907 }1275 }
9081276
909 template <class _Func>1277 template <class _Func>
910 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {1278# if _LIBCPP_STD_VER >= 26
911 using _Up = remove_cv_t<invoke_result_t<_Func, value_type&>>;1279 requires(is_object_v<_Tp>)
1280# endif
1281 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {
1282 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&>>;
912 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");1283 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
913 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");1284 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");
914 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");1285 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");
...@@ -919,8 +1290,11 @@ public:...@@ -919,8 +1290,11 @@ public:
919 }1290 }
9201291
921 template <class _Func>1292 template <class _Func>
922 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {1293# if _LIBCPP_STD_VER >= 26
923 using _Up = remove_cv_t<invoke_result_t<_Func, const value_type&>>;1294 requires(is_object_v<_Tp>)
1295# endif
1296 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {
1297 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&>>;
924 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");1298 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
925 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");1299 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");
926 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");1300 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");
...@@ -931,8 +1305,11 @@ public:...@@ -931,8 +1305,11 @@ public:
931 }1305 }
9321306
933 template <class _Func>1307 template <class _Func>
934 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {1308# if _LIBCPP_STD_VER >= 26
935 using _Up = remove_cv_t<invoke_result_t<_Func, value_type&&>>;1309 requires(is_object_v<_Tp>)
1310# endif
1311 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {
1312 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&&>>;
936 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");1313 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
937 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");1314 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");
938 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");1315 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");
...@@ -943,8 +1320,11 @@ public:...@@ -943,8 +1320,11 @@ public:
943 }1320 }
9441321
945 template <class _Func>1322 template <class _Func>
946 _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {1323# if _LIBCPP_STD_VER >= 26
947 using _Up = remove_cvref_t<invoke_result_t<_Func, const value_type&&>>;1324 requires(is_object_v<_Tp>)
1325# endif
1326 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {
1327 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&&>>;
948 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");1328 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
949 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");1329 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");
950 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");1330 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");
...@@ -955,8 +1335,11 @@ public:...@@ -955,8 +1335,11 @@ public:
955 }1335 }
9561336
957 template <invocable _Func>1337 template <invocable _Func>
958 _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const&1338 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const&
959 requires is_copy_constructible_v<value_type>1339 requires is_copy_constructible_v<_Tp>
1340# if _LIBCPP_STD_VER >= 26
1341 && (is_object_v<_Tp>)
1342# endif
960 {1343 {
961 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,1344 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
962 "Result of f() should be the same type as this optional");1345 "Result of f() should be the same type as this optional");
...@@ -966,8 +1349,11 @@ public:...@@ -966,8 +1349,11 @@ public:
966 }1349 }
9671350
968 template <invocable _Func>1351 template <invocable _Func>
969 _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) &&1352 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) &&
970 requires is_move_constructible_v<value_type>1353 requires is_move_constructible_v<_Tp>
1354# if _LIBCPP_STD_VER >= 26
1355 && (is_object_v<_Tp>)
1356# endif
971 {1357 {
972 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,1358 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
973 "Result of f() should be the same type as this optional");1359 "Result of f() should be the same type as this optional");
...@@ -978,6 +1364,78 @@ public:...@@ -978,6 +1364,78 @@ public:
978# endif // _LIBCPP_STD_VER >= 231364# endif // _LIBCPP_STD_VER >= 23
9791365
980 using __base::reset;1366 using __base::reset;
1367
1368// optional<T&> overloads
1369# if _LIBCPP_STD_VER >= 26
1370
1371 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> operator->() const noexcept
1372 requires(is_lvalue_reference_v<_Tp>)
1373 {
1374 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
1375 return std::addressof(this->__get());
1376 }
1377
1378 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() const noexcept
1379 requires(is_lvalue_reference_v<_Tp>)
1380 {
1381 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
1382 return this->__get();
1383 }
1384
1385 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() const
1386 requires(is_lvalue_reference_v<_Tp>)
1387 {
1388 if (!this->has_value())
1389 std::__throw_bad_optional_access();
1390 return this->__get();
1391 }
1392
1393 template <class _Up = remove_cvref_t<_Tp>>
1394 requires(is_lvalue_reference_v<_Tp> && is_object_v<__libcpp_remove_reference_t<_Tp>> &&
1395 !is_array_v<__libcpp_remove_reference_t<_Tp>>)
1396 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decay_t<_Tp> value_or(_Up&& __v) const {
1397 static_assert(
1398 is_constructible_v<remove_cvref_t<_Tp>, _Tp&>, "optional<T&>::value_or: remove_cv_t<T> must be constructible");
1399 static_assert(
1400 is_convertible_v<_Up, remove_cvref_t<_Tp>>, "optional<T&>::value_or: U must be convertible to remove_cv_t<T>");
1401 return this->has_value() ? this->__get() : static_cast<remove_cvref_t<_Tp>>(std::forward<_Up>(__v));
1402 }
1403
1404 template <class _Func>
1405 requires(is_lvalue_reference_v<_Tp>)
1406 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const {
1407 using _Up = invoke_result_t<_Func, _Tp&>;
1408 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
1409 "Result of f(value()) must be a specialization of std::optional");
1410 if (*this)
1411 return std::invoke(std::forward<_Func>(__f), value());
1412 return remove_cvref_t<_Up>();
1413 }
1414
1415 template <class _Func>
1416 requires(is_lvalue_reference_v<_Tp>)
1417 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional<remove_cv_t<invoke_result_t<_Func, _Tp&>>>
1418 transform(_Func&& __f) const {
1419 using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&>>;
1420 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
1421 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");
1422 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");
1423 static_assert(is_object_v<_Up>, "Result of f(value()) should be an object type");
1424 if (*this)
1425 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());
1426 return optional<_Up>();
1427 }
1428
1429 template <invocable _Func>
1430 requires(is_lvalue_reference_v<_Tp>)
1431 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const {
1432 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
1433 "Result of f() should be the same type as this optional");
1434 if (*this)
1435 return *this;
1436 return std::forward<_Func>(__f)();
1437 }
1438# endif
981};1439};
9821440
983template <class _Tp>1441template <class _Tp>
...@@ -1154,7 +1612,9 @@ template <...@@ -1154,7 +1612,9 @@ template <
1154 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() == std::declval<const _Up&>()), bool>,1612 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() == std::declval<const _Up&>()), bool>,
1155 int> = 0>1613 int> = 0>
1156_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const optional<_Tp>& __x, const _Up& __v) {1614_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const optional<_Tp>& __x, const _Up& __v) {
1157 return static_cast<bool>(__x) ? *__x == __v : false;1615 if (__x.has_value())
1616 return *__x == __v;
1617 return false;
1158}1618}
11591619
1160template <1620template <
...@@ -1163,7 +1623,9 @@ template <...@@ -1163,7 +1623,9 @@ template <
1163 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() == std::declval<const _Up&>()), bool>,1623 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() == std::declval<const _Up&>()), bool>,
1164 int> = 0>1624 int> = 0>
1165_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const _Tp& __v, const optional<_Up>& __x) {1625_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const _Tp& __v, const optional<_Up>& __x) {
1166 return static_cast<bool>(__x) ? __v == *__x : false;1626 if (__x.has_value())
1627 return __v == *__x;
1628 return false;
1167}1629}
11681630
1169template <1631template <
...@@ -1172,7 +1634,9 @@ template <...@@ -1172,7 +1634,9 @@ template <
1172 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() != std::declval<const _Up&>()), bool>,1634 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() != std::declval<const _Up&>()), bool>,
1173 int> = 0>1635 int> = 0>
1174_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const optional<_Tp>& __x, const _Up& __v) {1636_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const optional<_Tp>& __x, const _Up& __v) {
1175 return static_cast<bool>(__x) ? *__x != __v : true;1637 if (__x.has_value())
1638 return *__x != __v;
1639 return true;
1176}1640}
11771641
1178template <1642template <
...@@ -1181,7 +1645,9 @@ template <...@@ -1181,7 +1645,9 @@ template <
1181 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() != std::declval<const _Up&>()), bool>,1645 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() != std::declval<const _Up&>()), bool>,
1182 int> = 0>1646 int> = 0>
1183_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const _Tp& __v, const optional<_Up>& __x) {1647_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const _Tp& __v, const optional<_Up>& __x) {
1184 return static_cast<bool>(__x) ? __v != *__x : true;1648 if (__x.has_value())
1649 return __v != *__x;
1650 return true;
1185}1651}
11861652
1187template < class _Tp,1653template < class _Tp,
...@@ -1189,7 +1655,9 @@ template < class _Tp,...@@ -1189,7 +1655,9 @@ template < class _Tp,
1189 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() < std::declval<const _Up&>()), bool>,1655 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() < std::declval<const _Up&>()), bool>,
1190 int> = 0>1656 int> = 0>
1191_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const optional<_Tp>& __x, const _Up& __v) {1657_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const optional<_Tp>& __x, const _Up& __v) {
1192 return static_cast<bool>(__x) ? *__x < __v : true;1658 if (__x.has_value())
1659 return *__x < __v;
1660 return true;
1193}1661}
11941662
1195template < class _Tp,1663template < class _Tp,
...@@ -1197,7 +1665,9 @@ template < class _Tp,...@@ -1197,7 +1665,9 @@ template < class _Tp,
1197 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() < std::declval<const _Up&>()), bool>,1665 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() < std::declval<const _Up&>()), bool>,
1198 int> = 0>1666 int> = 0>
1199_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const _Tp& __v, const optional<_Up>& __x) {1667_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const _Tp& __v, const optional<_Up>& __x) {
1200 return static_cast<bool>(__x) ? __v < *__x : false;1668 if (__x.has_value())
1669 return __v < *__x;
1670 return false;
1201}1671}
12021672
1203template <1673template <
...@@ -1206,7 +1676,9 @@ template <...@@ -1206,7 +1676,9 @@ template <
1206 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() <= std::declval<const _Up&>()), bool>,1676 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() <= std::declval<const _Up&>()), bool>,
1207 int> = 0>1677 int> = 0>
1208_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const optional<_Tp>& __x, const _Up& __v) {1678_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const optional<_Tp>& __x, const _Up& __v) {
1209 return static_cast<bool>(__x) ? *__x <= __v : true;1679 if (__x.has_value())
1680 return *__x <= __v;
1681 return true;
1210}1682}
12111683
1212template <1684template <
...@@ -1215,7 +1687,9 @@ template <...@@ -1215,7 +1687,9 @@ template <
1215 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() <= std::declval<const _Up&>()), bool>,1687 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() <= std::declval<const _Up&>()), bool>,
1216 int> = 0>1688 int> = 0>
1217_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const _Tp& __v, const optional<_Up>& __x) {1689_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const _Tp& __v, const optional<_Up>& __x) {
1218 return static_cast<bool>(__x) ? __v <= *__x : false;1690 if (__x.has_value())
1691 return __v <= *__x;
1692 return false;
1219}1693}
12201694
1221template < class _Tp,1695template < class _Tp,
...@@ -1223,7 +1697,9 @@ template < class _Tp,...@@ -1223,7 +1697,9 @@ template < class _Tp,
1223 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() > std::declval<const _Up&>()), bool>,1697 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() > std::declval<const _Up&>()), bool>,
1224 int> = 0>1698 int> = 0>
1225_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const optional<_Tp>& __x, const _Up& __v) {1699_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const optional<_Tp>& __x, const _Up& __v) {
1226 return static_cast<bool>(__x) ? *__x > __v : false;1700 if (__x.has_value())
1701 return *__x > __v;
1702 return false;
1227}1703}
12281704
1229template < class _Tp,1705template < class _Tp,
...@@ -1231,7 +1707,9 @@ template < class _Tp,...@@ -1231,7 +1707,9 @@ template < class _Tp,
1231 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() > std::declval<const _Up&>()), bool>,1707 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() > std::declval<const _Up&>()), bool>,
1232 int> = 0>1708 int> = 0>
1233_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const _Tp& __v, const optional<_Up>& __x) {1709_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const _Tp& __v, const optional<_Up>& __x) {
1234 return static_cast<bool>(__x) ? __v > *__x : true;1710 if (__x.has_value())
1711 return __v > *__x;
1712 return true;
1235}1713}
12361714
1237template <1715template <
...@@ -1240,7 +1718,9 @@ template <...@@ -1240,7 +1718,9 @@ template <
1240 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() >= std::declval<const _Up&>()), bool>,1718 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() >= std::declval<const _Up&>()), bool>,
1241 int> = 0>1719 int> = 0>
1242_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const optional<_Tp>& __x, const _Up& __v) {1720_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const optional<_Tp>& __x, const _Up& __v) {
1243 return static_cast<bool>(__x) ? *__x >= __v : false;1721 if (__x.has_value())
1722 return *__x >= __v;
1723 return false;
1244}1724}
12451725
1246template <1726template <
...@@ -1249,7 +1729,9 @@ template <...@@ -1249,7 +1729,9 @@ template <
1249 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() >= std::declval<const _Up&>()), bool>,1729 enable_if_t<__is_core_convertible_v<decltype(std::declval<const _Tp&>() >= std::declval<const _Up&>()), bool>,
1250 int> = 0>1730 int> = 0>
1251_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const _Tp& __v, const optional<_Up>& __x) {1731_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const _Tp& __v, const optional<_Up>& __x) {
1252 return static_cast<bool>(__x) ? __v >= *__x : true;1732 if (__x.has_value())
1733 return __v >= *__x;
1734 return true;
1253}1735}
12541736
1255# if _LIBCPP_STD_VER >= 201737# if _LIBCPP_STD_VER >= 20
...@@ -1264,23 +1746,36 @@ operator<=>(const optional<_Tp>& __x, const _Up& __v) {...@@ -1264,23 +1746,36 @@ operator<=>(const optional<_Tp>& __x, const _Up& __v) {
1264# endif // _LIBCPP_STD_VER >= 201746# endif // _LIBCPP_STD_VER >= 20
12651747
1266template <class _Tp, enable_if_t< is_move_constructible_v<_Tp> && is_swappable_v<_Tp>, int> = 0>1748template <class _Tp, enable_if_t< is_move_constructible_v<_Tp> && is_swappable_v<_Tp>, int> = 0>
1267inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void1749inline _LIBCPP_HIDE_FROM_ABI
1268swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) {1750_LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) {
1269 __x.swap(__y);1751 __x.swap(__y);
1270}1752}
12711753
1272template <class _Tp>1754struct __make_optional_barrier_tag {
1273_LIBCPP_HIDE_FROM_ABI constexpr optional<decay_t<_Tp>> make_optional(_Tp&& __v) {1755 explicit __make_optional_barrier_tag() = default;
1756};
1757
1758template <
1759# if _LIBCPP_STD_VER >= 26
1760 __make_optional_barrier_tag = __make_optional_barrier_tag{},
1761# endif
1762 class _Tp,
1763 enable_if_t<is_constructible_v<decay_t<_Tp>, _Tp>, int> = 0>
1764[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional<decay_t<_Tp>> make_optional(_Tp&& __v) {
1274 return optional<decay_t<_Tp>>(std::forward<_Tp>(__v));1765 return optional<decay_t<_Tp>>(std::forward<_Tp>(__v));
1275}1766}
12761767
1277template <class _Tp, class... _Args>1768template <class _Tp, class... _Args, enable_if_t<__is_constructible_for_optional_v<_Tp, _Args...>, int> = 0>
1278_LIBCPP_HIDE_FROM_ABI constexpr optional<_Tp> make_optional(_Args&&... __args) {1769[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional<_Tp> make_optional(_Args&&... __args) {
1279 return optional<_Tp>(in_place, std::forward<_Args>(__args)...);1770 return optional<_Tp>(in_place, std::forward<_Args>(__args)...);
1280}1771}
12811772
1282template <class _Tp, class _Up, class... _Args>1773template <class _Tp,
1283_LIBCPP_HIDE_FROM_ABI constexpr optional<_Tp> make_optional(initializer_list<_Up> __il, _Args&&... __args) {1774 class _Up,
1775 class... _Args,
1776 enable_if_t<__is_constructible_for_optional_initializer_list_v<_Tp, _Up, _Args...>, int> = 0>
1777[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional<_Tp>
1778make_optional(initializer_list<_Up> __il, _Args&&... __args) {
1284 return optional<_Tp>(in_place, __il, std::forward<_Args>(__args)...);1779 return optional<_Tp>(in_place, __il, std::forward<_Args>(__args)...);
1285}1780}
12861781
...@@ -1291,7 +1786,7 @@ struct hash< __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>> > {...@@ -1291,7 +1786,7 @@ struct hash< __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>> > {
1291 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;1786 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
1292# endif1787# endif
12931788
1294 _LIBCPP_HIDE_FROM_ABI size_t operator()(const optional<_Tp>& __opt) const {1789 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const optional<_Tp>& __opt) const {
1295 return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;1790 return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;
1296 }1791 }
1297};1792};
lib/libcxx/include/print+9-5
...@@ -329,7 +329,8 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,...@@ -329,7 +329,8 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
329} // namespace __print329} // namespace __print
330330
331template <class... _Args>331template <class... _Args>
332_LIBCPP_HIDE_FROM_ABI void print(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args) {332_LIBCPP_HIDE_FROM_ABI void
333print(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt, _Args&&... __args) {
333# if _LIBCPP_HAS_UNICODE334# if _LIBCPP_HAS_UNICODE
334 if constexpr (__print::__use_unicode_execution_charset)335 if constexpr (__print::__use_unicode_execution_charset)
335 __print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), false);336 __print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
...@@ -346,7 +347,8 @@ _LIBCPP_HIDE_FROM_ABI void print(format_string<_Args...> __fmt, _Args&&... __arg...@@ -346,7 +347,8 @@ _LIBCPP_HIDE_FROM_ABI void print(format_string<_Args...> __fmt, _Args&&... __arg
346}347}
347348
348template <class... _Args>349template <class... _Args>
349_LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args) {350_LIBCPP_HIDE_FROM_ABI void
351println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt, _Args&&... __args) {
350# if _LIBCPP_HAS_UNICODE352# if _LIBCPP_HAS_UNICODE
351 // Note the wording in the Standard is inefficient. The output of353 // Note the wording in the Standard is inefficient. The output of
352 // std::format is a std::string which is then copied. This solution354 // std::format is a std::string which is then copied. This solution
...@@ -361,7 +363,7 @@ _LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt...@@ -361,7 +363,7 @@ _LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt
361}363}
362364
363template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).365template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
364_LIBCPP_HIDE_FROM_ABI inline void println(FILE* __stream) {366_LIBCPP_HIDE_FROM_ABI inline void println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream) {
365 std::print(__stream, "\n");367 std::print(__stream, "\n");
366}368}
367369
...@@ -377,7 +379,8 @@ _LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __a...@@ -377,7 +379,8 @@ _LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __a
377379
378# if _LIBCPP_HAS_UNICODE380# if _LIBCPP_HAS_UNICODE
379template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).381template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
380_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(FILE* __stream, string_view __fmt, format_args __args) {382_LIBCPP_HIDE_FROM_ABI inline void
383vprint_unicode(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, string_view __fmt, format_args __args) {
381 __print::__vprint_unicode(__stream, __fmt, __args, false);384 __print::__vprint_unicode(__stream, __fmt, __args, false);
382}385}
383386
...@@ -389,7 +392,8 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(string_view __fmt, format_args...@@ -389,7 +392,8 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(string_view __fmt, format_args
389# endif // _LIBCPP_HAS_UNICODE392# endif // _LIBCPP_HAS_UNICODE
390393
391template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).394template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
392_LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args) {395_LIBCPP_HIDE_FROM_ABI inline void
396vprint_nonunicode(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, string_view __fmt, format_args __args) {
393 __print::__vprint_nonunicode(__stream, __fmt, __args, false);397 __print::__vprint_nonunicode(__stream, __fmt, __args, false);
394}398}
395399
lib/libcxx/include/queue+39-37
...@@ -376,12 +376,12 @@ public:...@@ -376,12 +376,12 @@ public:
376# endif // _LIBCPP_CXX03_LANG376# endif // _LIBCPP_CXX03_LANG
377377
378 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }378 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
379 _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }379 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
380380
381 _LIBCPP_HIDE_FROM_ABI reference front() { return c.front(); }381 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference front() { return c.front(); }
382 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return c.front(); }382 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference front() const { return c.front(); }
383 _LIBCPP_HIDE_FROM_ABI reference back() { return c.back(); }383 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference back() { return c.back(); }
384 _LIBCPP_HIDE_FROM_ABI const_reference back() const { return c.back(); }384 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference back() const { return c.back(); }
385385
386 _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }386 _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }
387# ifndef _LIBCPP_CXX03_LANG387# ifndef _LIBCPP_CXX03_LANG
...@@ -437,19 +437,19 @@ public:...@@ -437,19 +437,19 @@ public:
437};437};
438438
439# if _LIBCPP_STD_VER >= 17439# if _LIBCPP_STD_VER >= 17
440template <class _Container, class = enable_if_t<!__is_allocator<_Container>::value> >440template <class _Container, class = enable_if_t<!__is_allocator_v<_Container>>>
441queue(_Container) -> queue<typename _Container::value_type, _Container>;441queue(_Container) -> queue<typename _Container::value_type, _Container>;
442442
443template <class _Container,443template <class _Container,
444 class _Alloc,444 class _Alloc,
445 class = enable_if_t<!__is_allocator<_Container>::value>,445 class = enable_if_t<!__is_allocator_v<_Container>>,
446 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >446 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
447queue(_Container, _Alloc) -> queue<typename _Container::value_type, _Container>;447queue(_Container, _Alloc) -> queue<typename _Container::value_type, _Container>;
448# endif448# endif
449449
450# if _LIBCPP_STD_VER >= 23450# if _LIBCPP_STD_VER >= 23
451template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>451template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
452queue(_InputIterator, _InputIterator) -> queue<__iter_value_type<_InputIterator>>;452queue(_InputIterator, _InputIterator) -> queue<__iterator_value_type<_InputIterator>>;
453453
454template <ranges::input_range _Range>454template <ranges::input_range _Range>
455queue(from_range_t, _Range&&) -> queue<ranges::range_value_t<_Range>>;455queue(from_range_t, _Range&&) -> queue<ranges::range_value_t<_Range>>;
...@@ -457,11 +457,11 @@ queue(from_range_t, _Range&&) -> queue<ranges::range_value_t<_Range>>;...@@ -457,11 +457,11 @@ queue(from_range_t, _Range&&) -> queue<ranges::range_value_t<_Range>>;
457template <class _InputIterator,457template <class _InputIterator,
458 class _Alloc,458 class _Alloc,
459 __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,459 __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
460 __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>460 __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
461queue(_InputIterator, _InputIterator, _Alloc)461queue(_InputIterator, _InputIterator, _Alloc)
462 -> queue<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;462 -> queue<__iterator_value_type<_InputIterator>, deque<__iterator_value_type<_InputIterator>, _Alloc>>;
463463
464template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>464template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
465queue(from_range_t, _Range&&, _Alloc)465queue(from_range_t, _Range&&, _Alloc)
466 -> queue<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;466 -> queue<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
467# endif467# endif
...@@ -664,8 +664,10 @@ public:...@@ -664,8 +664,10 @@ public:
664# endif664# endif
665665
666 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }666 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
667 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }667 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
668 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.front(); }668 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI const_reference top() const {
669 return c.front();
670 }
669671
670 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v);672 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v);
671# ifndef _LIBCPP_CXX03_LANG673# ifndef _LIBCPP_CXX03_LANG
...@@ -700,45 +702,45 @@ public:...@@ -700,45 +702,45 @@ public:
700# if _LIBCPP_STD_VER >= 17702# if _LIBCPP_STD_VER >= 17
701template <class _Compare,703template <class _Compare,
702 class _Container,704 class _Container,
703 class = enable_if_t<!__is_allocator<_Compare>::value>,705 class = enable_if_t<!__is_allocator_v<_Compare>>,
704 class = enable_if_t<!__is_allocator<_Container>::value> >706 class = enable_if_t<!__is_allocator_v<_Container>>>
705priority_queue(_Compare, _Container) -> priority_queue<typename _Container::value_type, _Container, _Compare>;707priority_queue(_Compare, _Container) -> priority_queue<typename _Container::value_type, _Container, _Compare>;
706708
707template <class _InputIterator,709template <class _InputIterator,
708 class _Compare = less<__iter_value_type<_InputIterator>>,710 class _Compare = less<__iterator_value_type<_InputIterator>>,
709 class _Container = vector<__iter_value_type<_InputIterator>>,711 class _Container = vector<__iterator_value_type<_InputIterator>>,
710 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,712 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
711 class = enable_if_t<!__is_allocator<_Compare>::value>,713 class = enable_if_t<!__is_allocator_v<_Compare>>,
712 class = enable_if_t<!__is_allocator<_Container>::value> >714 class = enable_if_t<!__is_allocator_v<_Container>>>
713priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container())715priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container())
714 -> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>;716 -> priority_queue<__iterator_value_type<_InputIterator>, _Container, _Compare>;
715717
716template <class _Compare,718template <class _Compare,
717 class _Container,719 class _Container,
718 class _Alloc,720 class _Alloc,
719 class = enable_if_t<!__is_allocator<_Compare>::value>,721 class = enable_if_t<!__is_allocator_v<_Compare>>,
720 class = enable_if_t<!__is_allocator<_Container>::value>,722 class = enable_if_t<!__is_allocator_v<_Container>>,
721 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >723 class = enable_if_t<uses_allocator<_Container, _Alloc>::value>>
722priority_queue(_Compare, _Container, _Alloc) -> priority_queue<typename _Container::value_type, _Container, _Compare>;724priority_queue(_Compare, _Container, _Alloc) -> priority_queue<typename _Container::value_type, _Container, _Compare>;
723725
724template <class _InputIterator,726template <class _InputIterator,
725 class _Allocator,727 class _Allocator,
726 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,728 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
727 class = enable_if_t<__is_allocator<_Allocator>::value> >729 class = enable_if_t<__is_allocator_v<_Allocator>>>
728priority_queue(_InputIterator, _InputIterator, _Allocator)730priority_queue(_InputIterator, _InputIterator, _Allocator)
729 -> priority_queue<__iter_value_type<_InputIterator>,731 -> priority_queue<__iterator_value_type<_InputIterator>,
730 vector<__iter_value_type<_InputIterator>, _Allocator>,732 vector<__iterator_value_type<_InputIterator>, _Allocator>,
731 less<__iter_value_type<_InputIterator>>>;733 less<__iterator_value_type<_InputIterator>>>;
732734
733template <class _InputIterator,735template <class _InputIterator,
734 class _Compare,736 class _Compare,
735 class _Allocator,737 class _Allocator,
736 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,738 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
737 class = enable_if_t<!__is_allocator<_Compare>::value>,739 class = enable_if_t<!__is_allocator_v<_Compare>>,
738 class = enable_if_t<__is_allocator<_Allocator>::value> >740 class = enable_if_t<__is_allocator_v<_Allocator>>>
739priority_queue(_InputIterator, _InputIterator, _Compare, _Allocator)741priority_queue(_InputIterator, _InputIterator, _Compare, _Allocator)
740 -> priority_queue<__iter_value_type<_InputIterator>,742 -> priority_queue<__iterator_value_type<_InputIterator>,
741 vector<__iter_value_type<_InputIterator>, _Allocator>,743 vector<__iterator_value_type<_InputIterator>, _Allocator>,
742 _Compare>;744 _Compare>;
743745
744template <class _InputIterator,746template <class _InputIterator,
...@@ -746,8 +748,8 @@ template <class _InputIterator,...@@ -746,8 +748,8 @@ template <class _InputIterator,
746 class _Container,748 class _Container,
747 class _Alloc,749 class _Alloc,
748 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,750 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
749 class = enable_if_t<!__is_allocator<_Compare>::value>,751 class = enable_if_t<!__is_allocator_v<_Compare>>,
750 class = enable_if_t<!__is_allocator<_Container>::value>,752 class = enable_if_t<!__is_allocator_v<_Container>>,
751 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >753 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
752priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)754priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)
753 -> priority_queue<typename _Container::value_type, _Container, _Compare>;755 -> priority_queue<typename _Container::value_type, _Container, _Compare>;
...@@ -757,19 +759,19 @@ priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)...@@ -757,19 +759,19 @@ priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)
757759
758template <ranges::input_range _Range,760template <ranges::input_range _Range,
759 class _Compare = less<ranges::range_value_t<_Range>>,761 class _Compare = less<ranges::range_value_t<_Range>>,
760 class = enable_if_t<!__is_allocator<_Compare>::value>>762 class = enable_if_t<!__is_allocator_v<_Compare>>>
761priority_queue(from_range_t, _Range&&, _Compare = _Compare())763priority_queue(from_range_t, _Range&&, _Compare = _Compare())
762 -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>>, _Compare>;764 -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>>, _Compare>;
763765
764template <ranges::input_range _Range,766template <ranges::input_range _Range,
765 class _Compare,767 class _Compare,
766 class _Alloc,768 class _Alloc,
767 class = enable_if_t<!__is_allocator<_Compare>::value>,769 class = enable_if_t<!__is_allocator_v<_Compare>>,
768 class = enable_if_t<__is_allocator<_Alloc>::value>>770 class = enable_if_t<__is_allocator_v<_Alloc>>>
769priority_queue(from_range_t, _Range&&, _Compare, _Alloc)771priority_queue(from_range_t, _Range&&, _Compare, _Alloc)
770 -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>, _Compare>;772 -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>, _Compare>;
771773
772template <ranges::input_range _Range, class _Alloc, class = enable_if_t<__is_allocator<_Alloc>::value>>774template <ranges::input_range _Range, class _Alloc, class = enable_if_t<__is_allocator_v<_Alloc>>>
773priority_queue(from_range_t, _Range&&, _Alloc)775priority_queue(from_range_t, _Range&&, _Alloc)
774 -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>>;776 -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>>;
775777
lib/libcxx/include/ranges+48
...@@ -116,6 +116,10 @@ namespace std::ranges {...@@ -116,6 +116,10 @@ namespace std::ranges {
116 // [range.dangling], dangling iterator handling116 // [range.dangling], dangling iterator handling
117 struct dangling;117 struct dangling;
118118
119 // [range.elementsof], class template elements_of
120 template<range R, class Allocator = allocator<byte>>
121 struct elements_of;
122
119 template<range R>123 template<range R>
120 using borrowed_iterator_t = see below;124 using borrowed_iterator_t = see below;
121125
...@@ -267,6 +271,11 @@ namespace std::ranges {...@@ -267,6 +271,11 @@ namespace std::ranges {
267 template<class W, class Bound>271 template<class W, class Bound>
268 inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true;272 inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true;
269273
274 namespace views {
275 inline constexpr unspecified iota = unspecified;
276 inline constexpr unspecified indices = unspecified; // Since C++26
277 }
278
270 // [range.repeat], repeat view279 // [range.repeat], repeat view
271 template<class T>280 template<class T>
272 concept integer-like-with-usable-difference-type = // exposition only281 concept integer-like-with-usable-difference-type = // exposition only
...@@ -339,6 +348,41 @@ namespace std::ranges {...@@ -339,6 +348,41 @@ namespace std::ranges {
339348
340 namespace views { inline constexpr unspecified zip = unspecified; } // C++23349 namespace views { inline constexpr unspecified zip = unspecified; } // C++23
341350
351 // [range.zip.transform], zip transform view
352 template<move_constructible F, input_range... Views>
353 requires (view<Views> && ...) && (sizeof...(Views) > 0) && is_object_v<F> &&
354 regular_invocable<F&, range_reference_t<Views>...> &&
355 can-reference<invoke_result_t<F&, range_reference_t<Views>...>>
356 class zip_transform_view; // C++23
357
358 namespace views { inline constexpr unspecified zip_transform = unspecified; } // C++23
359
360 // [range.adjacent], adjacent view
361 template<forward_range V, size_t N>
362 requires view<V> && (N > 0)
363 class adjacent_view;
364
365 template<class V, size_t N>
366 constexpr bool enable_borrowed_range<adjacent_view<V, N>> =
367 enable_borrowed_range<V>;
368
369 namespace views {
370 template<size_t N>
371 constexpr unspecified adjacent = unspecified;
372 inline constexpr auto pairwise = adjacent<2>;
373 }
374
375 // [range.adjacent.transform], adjacent transform view
376 template<forward_range V, move_constructible F, size_t N>
377 requires see below
378 class adjacent_transform_view;
379
380 namespace views {
381 template<size_t N>
382 constexpr unspecified adjacent_transform = unspecified;
383 inline constexpr auto pairwise_transform = adjacent_transform<2>;
384 }
385
342 // [range.as.rvalue]386 // [range.as.rvalue]
343 template <view V>387 template <view V>
344 requires input_range<V>388 requires input_range<V>
...@@ -404,6 +448,7 @@ namespace std {...@@ -404,6 +448,7 @@ namespace std {
404# include <__ranges/data.h>448# include <__ranges/data.h>
405# include <__ranges/drop_view.h>449# include <__ranges/drop_view.h>
406# include <__ranges/drop_while_view.h>450# include <__ranges/drop_while_view.h>
451# include <__ranges/elements_of.h>
407# include <__ranges/elements_view.h>452# include <__ranges/elements_view.h>
408# include <__ranges/empty.h>453# include <__ranges/empty.h>
409# include <__ranges/empty_view.h>454# include <__ranges/empty_view.h>
...@@ -433,12 +478,15 @@ namespace std {...@@ -433,12 +478,15 @@ namespace std {
433# endif478# endif
434479
435# if _LIBCPP_STD_VER >= 23480# if _LIBCPP_STD_VER >= 23
481# include <__ranges/adjacent_transform_view.h>
482# include <__ranges/adjacent_view.h>
436# include <__ranges/as_rvalue_view.h>483# include <__ranges/as_rvalue_view.h>
437# include <__ranges/chunk_by_view.h>484# include <__ranges/chunk_by_view.h>
438# include <__ranges/from_range.h>485# include <__ranges/from_range.h>
439# include <__ranges/join_with_view.h>486# include <__ranges/join_with_view.h>
440# include <__ranges/repeat_view.h>487# include <__ranges/repeat_view.h>
441# include <__ranges/to.h>488# include <__ranges/to.h>
489# include <__ranges/zip_transform_view.h>
442# include <__ranges/zip_view.h>490# include <__ranges/zip_view.h>
443# endif491# endif
444492
lib/libcxx/include/regex+33-31
...@@ -986,7 +986,7 @@ public:...@@ -986,7 +986,7 @@ public:
986 explicit regex_error(regex_constants::error_type __ecode);986 explicit regex_error(regex_constants::error_type __ecode);
987 _LIBCPP_HIDE_FROM_ABI regex_error(const regex_error&) _NOEXCEPT = default;987 _LIBCPP_HIDE_FROM_ABI regex_error(const regex_error&) _NOEXCEPT = default;
988 ~regex_error() _NOEXCEPT override;988 ~regex_error() _NOEXCEPT override;
989 _LIBCPP_HIDE_FROM_ABI regex_constants::error_type code() const { return __code_; }989 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI regex_constants::error_type code() const { return __code_; }
990};990};
991991
992template <regex_constants::error_type _Ev>992template <regex_constants::error_type _Ev>
...@@ -1004,7 +1004,7 @@ public:...@@ -1004,7 +1004,7 @@ public:
1004 typedef _CharT char_type;1004 typedef _CharT char_type;
1005 typedef basic_string<char_type> string_type;1005 typedef basic_string<char_type> string_type;
1006 typedef locale locale_type;1006 typedef locale locale_type;
1007# if defined(__BIONIC__) || defined(_NEWLIB_VERSION)1007# if defined(__BIONIC__) || _LIBCPP_LIBC_NEWLIB
1008 // Originally bionic's ctype_base used its own ctype masks because the1008 // Originally bionic's ctype_base used its own ctype masks because the
1009 // builtin ctype implementation wasn't in libc++ yet. Bionic's ctype mask1009 // builtin ctype implementation wasn't in libc++ yet. Bionic's ctype mask
1010 // was only 8 bits wide and already saturated, so it used a wider type here1010 // was only 8 bits wide and already saturated, so it used a wider type here
...@@ -1013,9 +1013,7 @@ public:...@@ -1013,9 +1013,7 @@ public:
1013 // implementation, but this was not updated to match. Since then Android has1013 // implementation, but this was not updated to match. Since then Android has
1014 // needed to maintain a stable libc++ ABI, and this can't be changed without1014 // needed to maintain a stable libc++ ABI, and this can't be changed without
1015 // an ABI break.1015 // an ABI break.
1016 // We also need this workaround for newlib since _NEWLIB_VERSION is not1016 // We also need this workaround for newlib since newlib is
1017 // defined yet inside __config, so we can't set the
1018 // _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE macro. Additionally, newlib is
1019 // often used for space constrained environments, so it makes sense not to1017 // often used for space constrained environments, so it makes sense not to
1020 // duplicate the ctype table.1018 // duplicate the ctype table.
1021 typedef uint16_t char_class_type;1019 typedef uint16_t char_class_type;
...@@ -2120,7 +2118,7 @@ public:...@@ -2120,7 +2118,7 @@ public:
2120 __ranges_.push_back(2118 __ranges_.push_back(
2121 std::make_pair(__traits_.transform(__b.begin(), __b.end()), __traits_.transform(__e.begin(), __e.end())));2119 std::make_pair(__traits_.transform(__b.begin(), __b.end()), __traits_.transform(__e.begin(), __e.end())));
2122 } else {2120 } else {
2123 if (__b.size() != 1 || __e.size() != 1)2121 if (__b.size() != 1 || __e.size() != 1 || char_traits<typename string_type::value_type>::lt(__e[0], __b[0]))
2124 std::__throw_regex_error<regex_constants::error_range>();2122 std::__throw_regex_error<regex_constants::error_range>();
2125 if (__icase_) {2123 if (__icase_) {
2126 __b[0] = __traits_.translate_nocase(__b[0]);2124 __b[0] = __traits_.translate_nocase(__b[0]);
...@@ -2414,8 +2412,8 @@ public:...@@ -2414,8 +2412,8 @@ public:
2414# endif // _LIBCPP_CXX03_LANG2412# endif // _LIBCPP_CXX03_LANG
24152413
2416 // const operations:2414 // const operations:
2417 _LIBCPP_HIDE_FROM_ABI unsigned mark_count() const { return __marked_count_; }2415 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unsigned mark_count() const { return __marked_count_; }
2418 _LIBCPP_HIDE_FROM_ABI flag_type flags() const { return __flags_; }2416 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI flag_type flags() const { return __flags_; }
24192417
2420 // locale:2418 // locale:
2421 _LIBCPP_HIDE_FROM_ABI locale_type imbue(locale_type __loc) {2419 _LIBCPP_HIDE_FROM_ABI locale_type imbue(locale_type __loc) {
...@@ -2423,7 +2421,7 @@ public:...@@ -2423,7 +2421,7 @@ public:
2423 __start_.reset();2421 __start_.reset();
2424 return __traits_.imbue(__loc);2422 return __traits_.imbue(__loc);
2425 }2423 }
2426 _LIBCPP_HIDE_FROM_ABI locale_type getloc() const { return __traits_.getloc(); }2424 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI locale_type getloc() const { return __traits_.getloc(); }
24272425
2428 // swap:2426 // swap:
2429 void swap(basic_regex& __r);2427 void swap(basic_regex& __r);
...@@ -4208,17 +4206,17 @@ public:...@@ -4208,17 +4206,17 @@ public:
42084206
4209 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR sub_match() : matched() {}4207 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR sub_match() : matched() {}
42104208
4211 _LIBCPP_HIDE_FROM_ABI difference_type length() const {4209 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI difference_type length() const {
4212 return matched ? std::distance(this->first, this->second) : 0;4210 return matched ? std::distance(this->first, this->second) : 0;
4213 }4211 }
4214 _LIBCPP_HIDE_FROM_ABI string_type str() const {4212 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type str() const {
4215 return matched ? string_type(this->first, this->second) : string_type();4213 return matched ? string_type(this->first, this->second) : string_type();
4216 }4214 }
4217 _LIBCPP_HIDE_FROM_ABI operator string_type() const { return str(); }4215 _LIBCPP_HIDE_FROM_ABI operator string_type() const { return str(); }
42184216
4219 _LIBCPP_HIDE_FROM_ABI int compare(const sub_match& __s) const { return str().compare(__s.str()); }4217 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int compare(const sub_match& __s) const { return str().compare(__s.str()); }
4220 _LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const { return str().compare(__s); }4218 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const { return str().compare(__s); }
4221 _LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const { return str().compare(__s); }4219 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const { return str().compare(__s); }
42224220
4223 _LIBCPP_HIDE_FROM_ABI void swap(sub_match& __s) _NOEXCEPT_(__is_nothrow_swappable_v<_BidirectionalIterator>) {4221 _LIBCPP_HIDE_FROM_ABI void swap(sub_match& __s) _NOEXCEPT_(__is_nothrow_swappable_v<_BidirectionalIterator>) {
4224 this->pair<_BidirectionalIterator, _BidirectionalIterator>::swap(__s);4222 this->pair<_BidirectionalIterator, _BidirectionalIterator>::swap(__s);
...@@ -4583,49 +4581,53 @@ public:...@@ -4583,49 +4581,53 @@ public:
4583 _LIBCPP_HIDE_FROM_ABI bool ready() const { return __ready_; }4581 _LIBCPP_HIDE_FROM_ABI bool ready() const { return __ready_; }
45844582
4585 // size:4583 // size:
4586 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __matches_.size(); }4584 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __matches_.size(); }
4587 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __matches_.max_size(); }4585 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __matches_.max_size(); }
4588 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }4586 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }
45894587
4590 // element access:4588 // element access:
4591 _LIBCPP_HIDE_FROM_ABI difference_type length(size_type __sub = 0) const {4589 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI difference_type length(size_type __sub = 0) const {
4592 // If the match results are not ready, this will return `0`.4590 // If the match results are not ready, this will return `0`.
4593 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::length() called when not ready");4591 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::length() called when not ready");
4594 return (*this)[__sub].length();4592 return (*this)[__sub].length();
4595 }4593 }
4596 _LIBCPP_HIDE_FROM_ABI difference_type position(size_type __sub = 0) const {4594 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI difference_type position(size_type __sub = 0) const {
4597 // If the match results are not ready, this will return the result of subtracting two default-constructed iterators4595 // If the match results are not ready, this will return the result of subtracting two default-constructed iterators
4598 // (which is typically a well-defined operation).4596 // (which is typically a well-defined operation).
4599 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::position() called when not ready");4597 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::position() called when not ready");
4600 return std::distance(__position_start_, (*this)[__sub].first);4598 return std::distance(__position_start_, (*this)[__sub].first);
4601 }4599 }
4602 _LIBCPP_HIDE_FROM_ABI string_type str(size_type __sub = 0) const {4600 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type str(size_type __sub = 0) const {
4603 // If the match results are not ready, this will return an empty string.4601 // If the match results are not ready, this will return an empty string.
4604 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::str() called when not ready");4602 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::str() called when not ready");
4605 return (*this)[__sub].str();4603 return (*this)[__sub].str();
4606 }4604 }
4607 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const {4605 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const {
4608 // If the match results are not ready, this call will be equivalent to calling this function with `__n >= size()`,4606 // If the match results are not ready, this call will be equivalent to calling this function with `__n >= size()`,
4609 // returning an empty subrange.4607 // returning an empty subrange.
4610 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::operator[]() called when not ready");4608 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::operator[]() called when not ready");
4611 return __n < __matches_.size() ? __matches_[__n] : __unmatched_;4609 return __n < __matches_.size() ? __matches_[__n] : __unmatched_;
4612 }4610 }
46134611
4614 _LIBCPP_HIDE_FROM_ABI const_reference prefix() const {4612 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference prefix() const {
4615 // If the match results are not ready, this will return a default-constructed empty `__suffix_`.4613 // If the match results are not ready, this will return a default-constructed empty `__suffix_`.
4616 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::prefix() called when not ready");4614 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::prefix() called when not ready");
4617 return __prefix_;4615 return __prefix_;
4618 }4616 }
4619 _LIBCPP_HIDE_FROM_ABI const_reference suffix() const {4617 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference suffix() const {
4620 // If the match results are not ready, this will return a default-constructed empty `__suffix_`.4618 // If the match results are not ready, this will return a default-constructed empty `__suffix_`.
4621 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::suffix() called when not ready");4619 _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::suffix() called when not ready");
4622 return __suffix_;4620 return __suffix_;
4623 }4621 }
46244622
4625 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return empty() ? __matches_.end() : __matches_.begin(); }4623 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const {
4626 _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __matches_.end(); }4624 return empty() ? __matches_.end() : __matches_.begin();
4627 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const { return empty() ? __matches_.end() : __matches_.begin(); }4625 }
4628 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const { return __matches_.end(); }4626 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __matches_.end(); }
4627 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const {
4628 return empty() ? __matches_.end() : __matches_.begin();
4629 }
4630 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const { return __matches_.end(); }
46294631
4630 // format:4632 // format:
4631 template <class _OutputIter>4633 template <class _OutputIter>
...@@ -4641,14 +4643,14 @@ public:...@@ -4641,14 +4643,14 @@ public:
4641 return format(__output_iter, __fmt.data(), __fmt.data() + __fmt.size(), __flags);4643 return format(__output_iter, __fmt.data(), __fmt.data() + __fmt.size(), __flags);
4642 }4644 }
4643 template <class _ST, class _SA>4645 template <class _ST, class _SA>
4644 _LIBCPP_HIDE_FROM_ABI basic_string<char_type, _ST, _SA>4646 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_string<char_type, _ST, _SA>
4645 format(const basic_string<char_type, _ST, _SA>& __fmt,4647 format(const basic_string<char_type, _ST, _SA>& __fmt,
4646 regex_constants::match_flag_type __flags = regex_constants::format_default) const {4648 regex_constants::match_flag_type __flags = regex_constants::format_default) const {
4647 basic_string<char_type, _ST, _SA> __r;4649 basic_string<char_type, _ST, _SA> __r;
4648 format(std::back_inserter(__r), __fmt.data(), __fmt.data() + __fmt.size(), __flags);4650 format(std::back_inserter(__r), __fmt.data(), __fmt.data() + __fmt.size(), __flags);
4649 return __r;4651 return __r;
4650 }4652 }
4651 _LIBCPP_HIDE_FROM_ABI string_type4653 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type
4652 format(const char_type* __fmt, regex_constants::match_flag_type __flags = regex_constants::format_default) const {4654 format(const char_type* __fmt, regex_constants::match_flag_type __flags = regex_constants::format_default) const {
4653 string_type __r;4655 string_type __r;
4654 format(std::back_inserter(__r), __fmt, __fmt + char_traits<char_type>::length(__fmt), __flags);4656 format(std::back_inserter(__r), __fmt, __fmt + char_traits<char_type>::length(__fmt), __flags);
...@@ -4656,7 +4658,7 @@ public:...@@ -4656,7 +4658,7 @@ public:
4656 }4658 }
46574659
4658 // allocator:4660 // allocator:
4659 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return __matches_.get_allocator(); }4661 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return __matches_.get_allocator(); }
46604662
4661 // swap:4663 // swap:
4662 void swap(match_results& __m);4664 void swap(match_results& __m);
...@@ -5377,7 +5379,7 @@ public:...@@ -5377,7 +5379,7 @@ public:
5377 _LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_iterator& __x) const { return !(*this == __x); }5379 _LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_iterator& __x) const { return !(*this == __x); }
5378# endif5380# endif
53795381
5380 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __match_; }5382 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __match_; }
5381 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return std::addressof(__match_); }5383 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return std::addressof(__match_); }
53825384
5383 regex_iterator& operator++();5385 regex_iterator& operator++();
...@@ -5558,7 +5560,7 @@ public:...@@ -5558,7 +5560,7 @@ public:
5558 _LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_token_iterator& __x) const { return !(*this == __x); }5560 _LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_token_iterator& __x) const { return !(*this == __x); }
5559# endif5561# endif
55605562
5561 _LIBCPP_HIDE_FROM_ABI const value_type& operator*() const { return *__result_; }5563 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const value_type& operator*() const { return *__result_; }
5562 _LIBCPP_HIDE_FROM_ABI const value_type* operator->() const { return __result_; }5564 _LIBCPP_HIDE_FROM_ABI const value_type* operator->() const { return __result_; }
55635565
5564 regex_token_iterator& operator++();5566 regex_token_iterator& operator++();
lib/libcxx/include/scoped_allocator+16-11
...@@ -382,13 +382,17 @@ public:...@@ -382,13 +382,17 @@ public:
382 // scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default;382 // scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default;
383 // ~scoped_allocator_adaptor() = default;383 // ~scoped_allocator_adaptor() = default;
384384
385 _LIBCPP_HIDE_FROM_ABI inner_allocator_type& inner_allocator() _NOEXCEPT { return _Base::inner_allocator(); }385 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI inner_allocator_type& inner_allocator() _NOEXCEPT {
386 _LIBCPP_HIDE_FROM_ABI const inner_allocator_type& inner_allocator() const _NOEXCEPT {386 return _Base::inner_allocator();
387 }
388 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const inner_allocator_type& inner_allocator() const _NOEXCEPT {
387 return _Base::inner_allocator();389 return _Base::inner_allocator();
388 }390 }
389391
390 _LIBCPP_HIDE_FROM_ABI outer_allocator_type& outer_allocator() _NOEXCEPT { return _Base::outer_allocator(); }392 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI outer_allocator_type& outer_allocator() _NOEXCEPT {
391 _LIBCPP_HIDE_FROM_ABI const outer_allocator_type& outer_allocator() const _NOEXCEPT {393 return _Base::outer_allocator();
394 }
395 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const outer_allocator_type& outer_allocator() const _NOEXCEPT {
392 return _Base::outer_allocator();396 return _Base::outer_allocator();
393 }397 }
394398
...@@ -403,7 +407,7 @@ public:...@@ -403,7 +407,7 @@ public:
403 allocator_traits<outer_allocator_type>::deallocate(outer_allocator(), __p, __n);407 allocator_traits<outer_allocator_type>::deallocate(outer_allocator(), __p, __n);
404 }408 }
405409
406 _LIBCPP_HIDE_FROM_ABI size_type max_size() const {410 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const {
407 return allocator_traits<outer_allocator_type>::max_size(outer_allocator());411 return allocator_traits<outer_allocator_type>::max_size(outer_allocator());
408 }412 }
409413
...@@ -434,10 +438,10 @@ public:...@@ -434,10 +438,10 @@ public:
434 piecewise_construct,438 piecewise_construct,
435 __transform_tuple(typename __uses_alloc_ctor< _T1, inner_allocator_type&, _Args1... >::type(),439 __transform_tuple(typename __uses_alloc_ctor< _T1, inner_allocator_type&, _Args1... >::type(),
436 std::move(__x),440 std::move(__x),
437 typename __make_tuple_indices<sizeof...(_Args1)>::type{}),441 __index_sequence_for<_Args1...>()),
438 __transform_tuple(typename __uses_alloc_ctor< _T2, inner_allocator_type&, _Args2... >::type(),442 __transform_tuple(typename __uses_alloc_ctor< _T2, inner_allocator_type&, _Args2... >::type(),
439 std::move(__y),443 std::move(__y),
440 typename __make_tuple_indices<sizeof...(_Args2)>::type{}));444 __index_sequence_for<_Args2...>()));
441 }445 }
442446
443 template <class _T1, class _T2>447 template <class _T1, class _T2>
...@@ -473,7 +477,8 @@ public:...@@ -473,7 +477,8 @@ public:
473 allocator_traits<typename _OM::type>::destroy(_OM()(outer_allocator()), __p);477 allocator_traits<typename _OM::type>::destroy(_OM()(outer_allocator()), __p);
474 }478 }
475479
476 _LIBCPP_HIDE_FROM_ABI scoped_allocator_adaptor select_on_container_copy_construction() const _NOEXCEPT {480 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI scoped_allocator_adaptor
481 select_on_container_copy_construction() const _NOEXCEPT {
477 return _Base::select_on_container_copy_construction();482 return _Base::select_on_container_copy_construction();
478 }483 }
479484
...@@ -503,20 +508,20 @@ private:...@@ -503,20 +508,20 @@ private:
503508
504 template <class... _Args, size_t... _Idx>509 template <class... _Args, size_t... _Idx>
505 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&...>510 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&...>
506 __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t, __tuple_indices<_Idx...>) {511 __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t, __index_sequence<_Idx...>) {
507 return std::forward_as_tuple(std::get<_Idx>(std::move(__t))...);512 return std::forward_as_tuple(std::get<_Idx>(std::move(__t))...);
508 }513 }
509514
510 template <class... _Args, size_t... _Idx>515 template <class... _Args, size_t... _Idx>
511 _LIBCPP_HIDE_FROM_ABI tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>516 _LIBCPP_HIDE_FROM_ABI tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>
512 __transform_tuple(integral_constant<int, 1>, tuple<_Args...>&& __t, __tuple_indices<_Idx...>) {517 __transform_tuple(integral_constant<int, 1>, tuple<_Args...>&& __t, __index_sequence<_Idx...>) {
513 using _Tup = tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>;518 using _Tup = tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>;
514 return _Tup(allocator_arg, inner_allocator(), std::get<_Idx>(std::move(__t))...);519 return _Tup(allocator_arg, inner_allocator(), std::get<_Idx>(std::move(__t))...);
515 }520 }
516521
517 template <class... _Args, size_t... _Idx>522 template <class... _Args, size_t... _Idx>
518 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&..., inner_allocator_type&>523 _LIBCPP_HIDE_FROM_ABI tuple<_Args&&..., inner_allocator_type&>
519 __transform_tuple(integral_constant<int, 2>, tuple<_Args...>&& __t, __tuple_indices<_Idx...>) {524 __transform_tuple(integral_constant<int, 2>, tuple<_Args...>&& __t, __index_sequence<_Idx...>) {
520 using _Tup = tuple<_Args&&..., inner_allocator_type&>;525 using _Tup = tuple<_Args&&..., inner_allocator_type&>;
521 return _Tup(std::get<_Idx>(std::move(__t))..., inner_allocator());526 return _Tup(std::get<_Idx>(std::move(__t))..., inner_allocator());
522 }527 }
lib/libcxx/include/semaphore+15-18
...@@ -55,12 +55,11 @@ using binary_semaphore = counting_semaphore<1>; // since C++20...@@ -55,12 +55,11 @@ using binary_semaphore = counting_semaphore<1>; // since C++20
55# include <__assert>55# include <__assert>
56# include <__atomic/atomic.h>56# include <__atomic/atomic.h>
57# include <__atomic/atomic_sync.h>57# include <__atomic/atomic_sync.h>
58# include <__atomic/atomic_sync_timed.h>
58# include <__atomic/memory_order.h>59# include <__atomic/memory_order.h>
59# include <__chrono/time_point.h>60# include <__chrono/time_point.h>
60# include <__cstddef/ptrdiff_t.h>61# include <__cstddef/ptrdiff_t.h>
61# include <__thread/poll_with_backoff.h>
62# include <__thread/support.h>62# include <__thread/support.h>
63# include <__thread/timed_backoff_policy.h>
64# include <limits>63# include <limits>
65# include <version>64# include <version>
6665
...@@ -90,7 +89,7 @@ class __atomic_semaphore_base {...@@ -90,7 +89,7 @@ class __atomic_semaphore_base {
9089
91public:90public:
92 _LIBCPP_HIDE_FROM_ABI constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a_(__count) {}91 _LIBCPP_HIDE_FROM_ABI constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a_(__count) {}
93 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void release(ptrdiff_t __update = 1) {92 _LIBCPP_HIDE_FROM_ABI void release(ptrdiff_t __update = 1) {
94 auto __old = __a_.fetch_add(__update, memory_order_release);93 auto __old = __a_.fetch_add(__update, memory_order_release);
95 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(94 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
96 __update <= _LIBCPP_SEMAPHORE_MAX - __old, "update is greater than the expected value");95 __update <= _LIBCPP_SEMAPHORE_MAX - __old, "update is greater than the expected value");
...@@ -98,26 +97,26 @@ public:...@@ -98,26 +97,26 @@ public:
98 __a_.notify_all();97 __a_.notify_all();
99 }98 }
100 }99 }
101 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void acquire() {100 _LIBCPP_HIDE_FROM_ABI void acquire() {
102 std::__atomic_wait_unless(__a_, memory_order_relaxed, [this](ptrdiff_t& __old) {101 std::__atomic_wait_unless(__a_, memory_order_relaxed, [this](ptrdiff_t& __old) {
103 return __try_acquire_impl(__old);102 return __try_acquire_impl(__old);
104 });103 });
105 }104 }
106 template <class _Rep, class _Period>105 template <class _Rep, class _Period>
107 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool106 _LIBCPP_HIDE_FROM_ABI bool try_acquire_for(chrono::duration<_Rep, _Period> const& __rel_time) {
108 try_acquire_for(chrono::duration<_Rep, _Period> const& __rel_time) {
109 if (__rel_time == chrono::duration<_Rep, _Period>::zero())107 if (__rel_time == chrono::duration<_Rep, _Period>::zero())
110 return try_acquire();108 return try_acquire();
111 auto const __poll_fn = [this]() { return try_acquire(); };109
112 return std::__libcpp_thread_poll_with_backoff(__poll_fn, __libcpp_timed_backoff_policy(), __rel_time);110 return std::__atomic_wait_unless_with_timeout(
111 __a_, memory_order_relaxed, [this](ptrdiff_t& __old) { return __try_acquire_impl(__old); }, __rel_time);
113 }112 }
114 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool try_acquire() {113 _LIBCPP_HIDE_FROM_ABI bool try_acquire() {
115 auto __old = __a_.load(memory_order_relaxed);114 auto __old = __a_.load(memory_order_relaxed);
116 return __try_acquire_impl(__old);115 return __try_acquire_impl(__old);
117 }116 }
118117
119private:118private:
120 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool __try_acquire_impl(ptrdiff_t& __old) {119 _LIBCPP_HIDE_FROM_ABI bool __try_acquire_impl(ptrdiff_t& __old) {
121 while (true) {120 while (true) {
122 if (__old == 0)121 if (__old == 0)
123 return false;122 return false;
...@@ -134,7 +133,7 @@ class counting_semaphore {...@@ -134,7 +133,7 @@ class counting_semaphore {
134public:133public:
135 static_assert(__least_max_value >= 0, "The least maximum value must be a positive number");134 static_assert(__least_max_value >= 0, "The least maximum value must be a positive number");
136135
137 static constexpr ptrdiff_t max() noexcept { return __least_max_value; }136 [[nodiscard]] static constexpr ptrdiff_t max() noexcept { return __least_max_value; }
138137
139 _LIBCPP_HIDE_FROM_ABI constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore_(__count) {138 _LIBCPP_HIDE_FROM_ABI constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore_(__count) {
140 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(139 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
...@@ -151,20 +150,18 @@ public:...@@ -151,20 +150,18 @@ public:
151 counting_semaphore(const counting_semaphore&) = delete;150 counting_semaphore(const counting_semaphore&) = delete;
152 counting_semaphore& operator=(const counting_semaphore&) = delete;151 counting_semaphore& operator=(const counting_semaphore&) = delete;
153152
154 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void release(ptrdiff_t __update = 1) {153 _LIBCPP_HIDE_FROM_ABI void release(ptrdiff_t __update = 1) {
155 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update >= 0, "counting_semaphore:release called with a negative value");154 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update >= 0, "counting_semaphore:release called with a negative value");
156 __semaphore_.release(__update);155 __semaphore_.release(__update);
157 }156 }
158 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void acquire() { __semaphore_.acquire(); }157 _LIBCPP_HIDE_FROM_ABI void acquire() { __semaphore_.acquire(); }
159 template <class _Rep, class _Period>158 template <class _Rep, class _Period>
160 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool159 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool try_acquire_for(chrono::duration<_Rep, _Period> const& __rel_time) {
161 try_acquire_for(chrono::duration<_Rep, _Period> const& __rel_time) {
162 return __semaphore_.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time));160 return __semaphore_.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time));
163 }161 }
164 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool try_acquire() { return __semaphore_.try_acquire(); }162 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool try_acquire() { return __semaphore_.try_acquire(); }
165 template <class _Clock, class _Duration>163 template <class _Clock, class _Duration>
166 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool164 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool try_acquire_until(chrono::time_point<_Clock, _Duration> const& __abs_time) {
167 try_acquire_until(chrono::time_point<_Clock, _Duration> const& __abs_time) {
168 auto const __current = _Clock::now();165 auto const __current = _Clock::now();
169 if (__current >= __abs_time)166 if (__current >= __abs_time)
170 return try_acquire();167 return try_acquire();
lib/libcxx/include/set+220-192
...@@ -518,19 +518,19 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20...@@ -518,19 +518,19 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
518# include <__algorithm/equal.h>518# include <__algorithm/equal.h>
519# include <__algorithm/lexicographical_compare.h>519# include <__algorithm/lexicographical_compare.h>
520# include <__algorithm/lexicographical_compare_three_way.h>520# include <__algorithm/lexicographical_compare_three_way.h>
521# include <__algorithm/specialized_algorithms.h>
521# include <__assert>522# include <__assert>
522# include <__config>523# include <__config>
523# include <__functional/is_transparent.h>524# include <__functional/is_transparent.h>
524# include <__functional/operations.h>525# include <__functional/operations.h>
525# include <__fwd/set.h>
526# include <__iterator/erase_if_container.h>526# include <__iterator/erase_if_container.h>
527# include <__iterator/iterator_traits.h>527# include <__iterator/iterator_traits.h>
528# include <__iterator/ranges_iterator_traits.h>
529# include <__iterator/reverse_iterator.h>528# include <__iterator/reverse_iterator.h>
530# include <__memory/allocator.h>529# include <__memory/allocator.h>
531# include <__memory/allocator_traits.h>530# include <__memory/allocator_traits.h>
532# include <__memory_resource/polymorphic_allocator.h>531# include <__memory_resource/polymorphic_allocator.h>
533# include <__node_handle>532# include <__node_handle>
533# include <__ranges/access.h>
534# include <__ranges/concepts.h>534# include <__ranges/concepts.h>
535# include <__ranges/container_compatible_range.h>535# include <__ranges/container_compatible_range.h>
536# include <__ranges/from_range.h>536# include <__ranges/from_range.h>
...@@ -538,7 +538,6 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20...@@ -538,7 +538,6 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
538# include <__type_traits/container_traits.h>538# include <__type_traits/container_traits.h>
539# include <__type_traits/enable_if.h>539# include <__type_traits/enable_if.h>
540# include <__type_traits/is_allocator.h>540# include <__type_traits/is_allocator.h>
541# include <__type_traits/is_nothrow_assignable.h>
542# include <__type_traits/is_nothrow_constructible.h>541# include <__type_traits/is_nothrow_constructible.h>
543# include <__type_traits/is_same.h>542# include <__type_traits/is_same.h>
544# include <__type_traits/is_swappable.h>543# include <__type_traits/is_swappable.h>
...@@ -570,7 +569,10 @@ _LIBCPP_PUSH_MACROS...@@ -570,7 +569,10 @@ _LIBCPP_PUSH_MACROS
570569
571_LIBCPP_BEGIN_NAMESPACE_STD570_LIBCPP_BEGIN_NAMESPACE_STD
572571
573template <class _Key, class _Compare, class _Allocator>572template <class _Key, class _Compare = less<_Key>, class _Allocator = allocator<_Key> >
573class multiset;
574
575template <class _Key, class _Compare = less<_Key>, class _Allocator = allocator<_Key> >
574class set {576class set {
575public:577public:
576 // types:578 // types:
...@@ -660,22 +662,20 @@ public:...@@ -660,22 +662,20 @@ public:
660 : set(from_range, std::forward<_Range>(__range), key_compare(), __a) {}662 : set(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
661# endif663# endif
662664
663 _LIBCPP_HIDE_FROM_ABI set(const set& __s) : __tree_(__s.__tree_) { insert(__s.begin(), __s.end()); }665 _LIBCPP_HIDE_FROM_ABI set(const set& __s) = default;
664666
665 _LIBCPP_HIDE_FROM_ABI set& operator=(const set& __s) = default;667 _LIBCPP_HIDE_FROM_ABI set& operator=(const set& __s) = default;
666668
667# ifndef _LIBCPP_CXX03_LANG669# ifndef _LIBCPP_CXX03_LANG
668 _LIBCPP_HIDE_FROM_ABI set(set&& __s) noexcept(is_nothrow_move_constructible<__base>::value) = default;670 _LIBCPP_HIDE_FROM_ABI set(set&& __s) = default;
669# endif // _LIBCPP_CXX03_LANG671# endif // _LIBCPP_CXX03_LANG
670672
671 _LIBCPP_HIDE_FROM_ABI explicit set(const allocator_type& __a) : __tree_(__a) {}673 _LIBCPP_HIDE_FROM_ABI explicit set(const allocator_type& __a) : __tree_(__a) {}
672674
673 _LIBCPP_HIDE_FROM_ABI set(const set& __s, const allocator_type& __a) : __tree_(__s.__tree_.value_comp(), __a) {675 _LIBCPP_HIDE_FROM_ABI set(const set& __s, const allocator_type& __alloc) : __tree_(__s.__tree_, __alloc) {}
674 insert(__s.begin(), __s.end());
675 }
676676
677# ifndef _LIBCPP_CXX03_LANG677# ifndef _LIBCPP_CXX03_LANG
678 _LIBCPP_HIDE_FROM_ABI set(set&& __s, const allocator_type& __a);678 _LIBCPP_HIDE_FROM_ABI set(set&& __s, const allocator_type& __alloc) : __tree_(std::move(__s.__tree_), __alloc) {}
679679
680 _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())680 _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
681 : __tree_(__comp) {681 : __tree_(__comp) {
...@@ -693,36 +693,38 @@ public:...@@ -693,36 +693,38 @@ public:
693# endif693# endif
694694
695 _LIBCPP_HIDE_FROM_ABI set& operator=(initializer_list<value_type> __il) {695 _LIBCPP_HIDE_FROM_ABI set& operator=(initializer_list<value_type> __il) {
696 __tree_.__assign_unique(__il.begin(), __il.end());696 clear();
697 insert(__il.begin(), __il.end());
697 return *this;698 return *this;
698 }699 }
699700
700 _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) noexcept(is_nothrow_move_assignable<__base>::value) {701 _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) = default;
701 __tree_ = std::move(__s.__tree_);
702 return *this;
703 }
704# endif // _LIBCPP_CXX03_LANG702# endif // _LIBCPP_CXX03_LANG
705703
706 _LIBCPP_HIDE_FROM_ABI ~set() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); }704 _LIBCPP_HIDE_FROM_ABI ~set() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
707705
708 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }706 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
709 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }707 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
710 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }708 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
711 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }709 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
712710
713 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }711 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
714 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }712 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {
715 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }713 return const_reverse_iterator(end());
716 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }714 }
715 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
716 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
717 return const_reverse_iterator(begin());
718 }
717719
718 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }720 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
719 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }721 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
720 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }722 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
721 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }723 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
722724
723 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }725 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }
724 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }726 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }
725 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }727 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
726728
727 // modifiers:729 // modifiers:
728# ifndef _LIBCPP_CXX03_LANG730# ifndef _LIBCPP_CXX03_LANG
...@@ -732,28 +734,24 @@ public:...@@ -732,28 +734,24 @@ public:
732 }734 }
733 template <class... _Args>735 template <class... _Args>
734 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {736 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
735 return __tree_.__emplace_hint_unique(__p, std::forward<_Args>(__args)...);737 return __tree_.__emplace_hint_unique(__p, std::forward<_Args>(__args)...).first;
736 }738 }
737# endif // _LIBCPP_CXX03_LANG739# endif // _LIBCPP_CXX03_LANG
738740
739 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__emplace_unique(__v); }741 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__emplace_unique(__v); }
740 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {742 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
741 return __tree_.__emplace_hint_unique(__p, __v);743 return __tree_.__emplace_hint_unique(__p, __v).first;
742 }744 }
743745
744 template <class _InputIterator>746 template <class _InputIterator>
745 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {747 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {
746 for (const_iterator __e = cend(); __f != __l; ++__f)748 __tree_.__insert_range_unique(__first, __last);
747 __tree_.__emplace_hint_unique(__e, *__f);
748 }749 }
749750
750# if _LIBCPP_STD_VER >= 23751# if _LIBCPP_STD_VER >= 23
751 template <_ContainerCompatibleRange<value_type> _Range>752 template <_ContainerCompatibleRange<value_type> _Range>
752 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {753 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
753 const_iterator __end = cend();754 __tree_.__insert_range_unique(ranges::begin(__range), ranges::end(__range));
754 for (auto&& __element : __range) {
755 __tree_.__emplace_hint_unique(__end, std::forward<decltype(__element)>(__element));
756 }
757 }755 }
758# endif756# endif
759757
...@@ -763,7 +761,7 @@ public:...@@ -763,7 +761,7 @@ public:
763 }761 }
764762
765 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {763 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
766 return __tree_.__emplace_hint_unique(__p, std::move(__v));764 return __tree_.__emplace_hint_unique(__p, std::move(__v)).first;
767 }765 }
768766
769 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }767 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
...@@ -785,10 +783,10 @@ public:...@@ -785,10 +783,10 @@ public:
785 "node_type with incompatible allocator passed to set::insert()");783 "node_type with incompatible allocator passed to set::insert()");
786 return __tree_.template __node_handle_insert_unique<node_type>(__hint, std::move(__nh));784 return __tree_.template __node_handle_insert_unique<node_type>(__hint, std::move(__nh));
787 }785 }
788 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {786 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
789 return __tree_.template __node_handle_extract<node_type>(__key);787 return __tree_.template __node_handle_extract<node_type>(__key);
790 }788 }
791 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {789 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
792 return __tree_.template __node_handle_extract<node_type>(__it);790 return __tree_.template __node_handle_extract<node_type>(__it);
793 }791 }
794 template <class _Compare2>792 template <class _Compare2>
...@@ -819,101 +817,120 @@ public:...@@ -819,101 +817,120 @@ public:
819817
820 _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); }818 _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); }
821819
822 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }820 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }
823 _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); }821 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); }
824 _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }822 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }
825823
826 // set operations:824 // set operations:
827 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }825 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
828 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }826 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
829# if _LIBCPP_STD_VER >= 14827# if _LIBCPP_STD_VER >= 14
830 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>828 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
831 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {829 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
832 return __tree_.find(__k);830 return __tree_.find(__k);
833 }831 }
834 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>832 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
835 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {833 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
836 return __tree_.find(__k);834 return __tree_.find(__k);
837 }835 }
838# endif836# endif
839837
840 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); }838 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
839 return __tree_.__count_unique(__k);
840 }
841# if _LIBCPP_STD_VER >= 14841# if _LIBCPP_STD_VER >= 14
842 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>842 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
843 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {843 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
844 return __tree_.__count_multi(__k);844 return __tree_.__count_multi(__k);
845 }845 }
846# endif846# endif
847847
848# if _LIBCPP_STD_VER >= 20848# if _LIBCPP_STD_VER >= 20
849 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }849 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
850 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>850 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
851 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {851 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
852 return find(__k) != end();852 return find(__k) != end();
853 }853 }
854# endif // _LIBCPP_STD_VER >= 20854# endif // _LIBCPP_STD_VER >= 20
855855
856 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }856 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {
857 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }857 return __tree_.__lower_bound_unique(__k);
858 }
859
860 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {
861 return __tree_.__lower_bound_unique(__k);
862 }
863
864 // The transparent versions of the lookup functions use the _multi version, since a non-element key is allowed to
865 // match multiple elements.
858# if _LIBCPP_STD_VER >= 14866# if _LIBCPP_STD_VER >= 14
859 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>867 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
860 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {868 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
861 return __tree_.lower_bound(__k);869 return __tree_.__lower_bound_multi(__k);
862 }870 }
863871
864 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>872 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
865 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {873 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
866 return __tree_.lower_bound(__k);874 return __tree_.__lower_bound_multi(__k);
867 }875 }
868# endif876# endif
869877
870 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }878 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {
871 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }879 return __tree_.__upper_bound_unique(__k);
880 }
881
882 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {
883 return __tree_.__upper_bound_unique(__k);
884 }
885
872# if _LIBCPP_STD_VER >= 14886# if _LIBCPP_STD_VER >= 14
873 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>887 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
874 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {888 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
875 return __tree_.upper_bound(__k);889 return __tree_.__upper_bound_multi(__k);
876 }890 }
877 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>891 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
878 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {892 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
879 return __tree_.upper_bound(__k);893 return __tree_.__upper_bound_multi(__k);
880 }894 }
881# endif895# endif
882896
883 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {897 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
884 return __tree_.__equal_range_unique(__k);898 return __tree_.__equal_range_unique(__k);
885 }899 }
886 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {900 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
887 return __tree_.__equal_range_unique(__k);901 return __tree_.__equal_range_unique(__k);
888 }902 }
889# if _LIBCPP_STD_VER >= 14903# if _LIBCPP_STD_VER >= 14
890 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>904 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
891 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {905 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
892 return __tree_.__equal_range_multi(__k);906 return __tree_.__equal_range_multi(__k);
893 }907 }
894 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>908 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
895 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {909 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
896 return __tree_.__equal_range_multi(__k);910 return __tree_.__equal_range_multi(__k);
897 }911 }
898# endif912# endif
913
914 template <class, class...>
915 friend struct __specialized_algorithm;
899};916};
900917
901# if _LIBCPP_STD_VER >= 17918# if _LIBCPP_STD_VER >= 17
902template <class _InputIterator,919template <class _InputIterator,
903 class _Compare = less<__iter_value_type<_InputIterator>>,920 class _Compare = less<__iterator_value_type<_InputIterator>>,
904 class _Allocator = allocator<__iter_value_type<_InputIterator>>,921 class _Allocator = allocator<__iterator_value_type<_InputIterator>>,
905 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,922 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
906 class = enable_if_t<__is_allocator<_Allocator>::value, void>,923 class = enable_if_t<__is_allocator_v<_Allocator>>,
907 class = enable_if_t<!__is_allocator<_Compare>::value, void>>924 class = enable_if_t<!__is_allocator_v<_Compare>>>
908set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())925set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
909 -> set<__iter_value_type<_InputIterator>, _Compare, _Allocator>;926 -> set<__iterator_value_type<_InputIterator>, _Compare, _Allocator>;
910927
911# if _LIBCPP_STD_VER >= 23928# if _LIBCPP_STD_VER >= 23
912template <ranges::input_range _Range,929template <ranges::input_range _Range,
913 class _Compare = less<ranges::range_value_t<_Range>>,930 class _Compare = less<ranges::range_value_t<_Range>>,
914 class _Allocator = allocator<ranges::range_value_t<_Range>>,931 class _Allocator = allocator<ranges::range_value_t<_Range>>,
915 class = enable_if_t<__is_allocator<_Allocator>::value, void>,932 class = enable_if_t<__is_allocator_v<_Allocator>>,
916 class = enable_if_t<!__is_allocator<_Compare>::value, void>>933 class = enable_if_t<!__is_allocator_v<_Compare>>>
917set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())934set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
918 -> set<ranges::range_value_t<_Range>, _Compare, _Allocator>;935 -> set<ranges::range_value_t<_Range>, _Compare, _Allocator>;
919# endif936# endif
...@@ -921,41 +938,43 @@ set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())...@@ -921,41 +938,43 @@ set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
921template <class _Key,938template <class _Key,
922 class _Compare = less<_Key>,939 class _Compare = less<_Key>,
923 class _Allocator = allocator<_Key>,940 class _Allocator = allocator<_Key>,
924 class = enable_if_t<!__is_allocator<_Compare>::value, void>,941 class = enable_if_t<!__is_allocator_v<_Compare>>,
925 class = enable_if_t<__is_allocator<_Allocator>::value, void>>942 class = enable_if_t<__is_allocator_v<_Allocator>>>
926set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) -> set<_Key, _Compare, _Allocator>;943set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) -> set<_Key, _Compare, _Allocator>;
927944
928template <class _InputIterator,945template <class _InputIterator,
929 class _Allocator,946 class _Allocator,
930 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,947 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
931 class = enable_if_t<__is_allocator<_Allocator>::value, void>>948 class = enable_if_t<__is_allocator_v<_Allocator>>>
932set(_InputIterator,949set(_InputIterator, _InputIterator, _Allocator)
933 _InputIterator,950 -> set<__iterator_value_type<_InputIterator>, less<__iterator_value_type<_InputIterator>>, _Allocator>;
934 _Allocator) -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
935951
936# if _LIBCPP_STD_VER >= 23952# if _LIBCPP_STD_VER >= 23
937template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>953template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
938set(from_range_t,954set(from_range_t, _Range&&, _Allocator)
939 _Range&&,955 -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
940 _Allocator) -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
941# endif956# endif
942957
943template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>958template <class _Key, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
944set(initializer_list<_Key>, _Allocator) -> set<_Key, less<_Key>, _Allocator>;959set(initializer_list<_Key>, _Allocator) -> set<_Key, less<_Key>, _Allocator>;
945# endif960# endif
946961
947# ifndef _LIBCPP_CXX03_LANG962# if _LIBCPP_STD_VER >= 14
963template <class _Alg, class _Key, class _Compare, class _Allocator>
964struct __specialized_algorithm<_Alg, __single_range<set<_Key, _Compare, _Allocator>>> {
965 using __set _LIBCPP_NODEBUG = set<_Key, _Compare, _Allocator>;
948966
949template <class _Key, class _Compare, class _Allocator>967 static const bool __has_algorithm =
950set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a) : __tree_(std::move(__s.__tree_), __a) {968 __specialized_algorithm<_Alg, __single_range<typename __set::__base>>::__has_algorithm;
951 if (__a != __s.get_allocator()) {
952 const_iterator __e = cend();
953 while (!__s.empty())
954 insert(__e, std::move(__s.__tree_.remove(__s.begin())->__value_));
955 }
956}
957969
958# endif // _LIBCPP_CXX03_LANG970 // set's begin() and end() are identical with and without const qualification
971 template <class... _Args>
972 _LIBCPP_HIDE_FROM_ABI static auto operator()(const __set& __set, _Args&&... __args) {
973 return __specialized_algorithm<_Alg, __single_range<typename __set::__base>>()(
974 __set.__tree_, std::forward<_Args>(__args)...);
975 }
976};
977# endif
959978
960template <class _Key, class _Compare, class _Allocator>979template <class _Key, class _Compare, class _Allocator>
961inline _LIBCPP_HIDE_FROM_ABI bool980inline _LIBCPP_HIDE_FROM_ABI bool
...@@ -1119,24 +1138,17 @@ public:...@@ -1119,24 +1138,17 @@ public:
1119 : multiset(from_range, std::forward<_Range>(__range), key_compare(), __a) {}1138 : multiset(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
1120# endif1139# endif
11211140
1122 _LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s)1141 _LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s) = default;
1123 : __tree_(__s.__tree_.value_comp(),
1124 __alloc_traits::select_on_container_copy_construction(__s.__tree_.__alloc())) {
1125 insert(__s.begin(), __s.end());
1126 }
11271142
1128 _LIBCPP_HIDE_FROM_ABI multiset& operator=(const multiset& __s) = default;1143 _LIBCPP_HIDE_FROM_ABI multiset& operator=(const multiset& __s) = default;
11291144
1130# ifndef _LIBCPP_CXX03_LANG1145# ifndef _LIBCPP_CXX03_LANG
1131 _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) noexcept(is_nothrow_move_constructible<__base>::value) = default;1146 _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) = default;
11321147
1133 _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a);1148 _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a) : __tree_(std::move(__s.__tree_), __a) {}
1134# endif // _LIBCPP_CXX03_LANG1149# endif // _LIBCPP_CXX03_LANG
1135 _LIBCPP_HIDE_FROM_ABI explicit multiset(const allocator_type& __a) : __tree_(__a) {}1150 _LIBCPP_HIDE_FROM_ABI explicit multiset(const allocator_type& __a) : __tree_(__a) {}
1136 _LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s, const allocator_type& __a)1151 _LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s, const allocator_type& __a) : __tree_(__s.__tree_, __a) {}
1137 : __tree_(__s.__tree_.value_comp(), __a) {
1138 insert(__s.begin(), __s.end());
1139 }
11401152
1141# ifndef _LIBCPP_CXX03_LANG1153# ifndef _LIBCPP_CXX03_LANG
1142 _LIBCPP_HIDE_FROM_ABI multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())1154 _LIBCPP_HIDE_FROM_ABI multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
...@@ -1156,38 +1168,40 @@ public:...@@ -1156,38 +1168,40 @@ public:
1156# endif1168# endif
11571169
1158 _LIBCPP_HIDE_FROM_ABI multiset& operator=(initializer_list<value_type> __il) {1170 _LIBCPP_HIDE_FROM_ABI multiset& operator=(initializer_list<value_type> __il) {
1159 __tree_.__assign_multi(__il.begin(), __il.end());1171 clear();
1172 insert(__il.begin(), __il.end());
1160 return *this;1173 return *this;
1161 }1174 }
11621175
1163 _LIBCPP_HIDE_FROM_ABI multiset& operator=(multiset&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) {1176 _LIBCPP_HIDE_FROM_ABI multiset& operator=(multiset&& __s) = default;
1164 __tree_ = std::move(__s.__tree_);
1165 return *this;
1166 }
1167# endif // _LIBCPP_CXX03_LANG1177# endif // _LIBCPP_CXX03_LANG
11681178
1169 _LIBCPP_HIDE_FROM_ABI ~multiset() {1179 _LIBCPP_HIDE_FROM_ABI ~multiset() {
1170 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");1180 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");
1171 }1181 }
11721182
1173 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }1183 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
1174 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }1184 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
1175 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }1185 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
1176 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }1186 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
11771187
1178 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }1188 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
1179 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }1189 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {
1180 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }1190 return const_reverse_iterator(end());
1181 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }1191 }
1192 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
1193 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
1194 return const_reverse_iterator(begin());
1195 }
11821196
1183 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }1197 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
1184 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }1198 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
1185 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }1199 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
1186 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1200 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
11871201
1188 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }1202 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }
1189 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }1203 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }
1190 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }1204 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
11911205
1192 // modifiers:1206 // modifiers:
1193# ifndef _LIBCPP_CXX03_LANG1207# ifndef _LIBCPP_CXX03_LANG
...@@ -1207,18 +1221,14 @@ public:...@@ -1207,18 +1221,14 @@ public:
1207 }1221 }
12081222
1209 template <class _InputIterator>1223 template <class _InputIterator>
1210 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {1224 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {
1211 for (const_iterator __e = cend(); __f != __l; ++__f)1225 __tree_.__insert_range_multi(__first, __last);
1212 __tree_.__emplace_hint_multi(__e, *__f);
1213 }1226 }
12141227
1215# if _LIBCPP_STD_VER >= 231228# if _LIBCPP_STD_VER >= 23
1216 template <_ContainerCompatibleRange<value_type> _Range>1229 template <_ContainerCompatibleRange<value_type> _Range>
1217 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {1230 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
1218 const_iterator __end = cend();1231 __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range));
1219 for (auto&& __element : __range) {
1220 __tree_.__emplace_hint_multi(__end, std::forward<decltype(__element)>(__element));
1221 }
1222 }1232 }
1223# endif1233# endif
12241234
...@@ -1248,10 +1258,10 @@ public:...@@ -1248,10 +1258,10 @@ public:
1248 "node_type with incompatible allocator passed to multiset::insert()");1258 "node_type with incompatible allocator passed to multiset::insert()");
1249 return __tree_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));1259 return __tree_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
1250 }1260 }
1251 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
1252 return __tree_.template __node_handle_extract<node_type>(__key);1262 return __tree_.template __node_handle_extract<node_type>(__key);
1253 }1263 }
1254 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1264 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
1255 return __tree_.template __node_handle_extract<node_type>(__it);1265 return __tree_.template __node_handle_extract<node_type>(__it);
1256 }1266 }
1257 template <class _Compare2>1267 template <class _Compare2>
...@@ -1284,101 +1294,118 @@ public:...@@ -1284,101 +1294,118 @@ public:
1284 __tree_.swap(__s.__tree_);1294 __tree_.swap(__s.__tree_);
1285 }1295 }
12861296
1287 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }1297 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }
1288 _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); }1298 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); }
1289 _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }1299 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }
12901300
1291 // set operations:1301 // set operations:
1292 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }1302 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
1293 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }1303 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
1294# if _LIBCPP_STD_VER >= 141304# if _LIBCPP_STD_VER >= 14
1295 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1305 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1296 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1306 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1297 return __tree_.find(__k);1307 return __tree_.find(__k);
1298 }1308 }
1299 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1309 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1300 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1310 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1301 return __tree_.find(__k);1311 return __tree_.find(__k);
1302 }1312 }
1303# endif1313# endif
13041314
1305 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); }1315 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
1316 return __tree_.__count_multi(__k);
1317 }
1306# if _LIBCPP_STD_VER >= 141318# if _LIBCPP_STD_VER >= 14
1307 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1319 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1308 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1320 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1309 return __tree_.__count_multi(__k);1321 return __tree_.__count_multi(__k);
1310 }1322 }
1311# endif1323# endif
13121324
1313# if _LIBCPP_STD_VER >= 201325# if _LIBCPP_STD_VER >= 20
1314 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1326 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
1315 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1327 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1316 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1328 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1317 return find(__k) != end();1329 return find(__k) != end();
1318 }1330 }
1319# endif // _LIBCPP_STD_VER >= 201331# endif // _LIBCPP_STD_VER >= 20
13201332
1321 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }1333 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {
1322 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }1334 return __tree_.__lower_bound_multi(__k);
1335 }
1336
1337 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {
1338 return __tree_.__lower_bound_multi(__k);
1339 }
1340
1323# if _LIBCPP_STD_VER >= 141341# if _LIBCPP_STD_VER >= 14
1324 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1342 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1325 _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {1343 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
1326 return __tree_.lower_bound(__k);1344 return __tree_.__lower_bound_multi(__k);
1327 }1345 }
13281346
1329 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1347 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1330 _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {1348 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
1331 return __tree_.lower_bound(__k);1349 return __tree_.__lower_bound_multi(__k);
1332 }1350 }
1333# endif1351# endif
13341352
1335 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }1353 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {
1336 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }1354 return __tree_.__upper_bound_multi(__k);
1355 }
1356
1357 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {
1358 return __tree_.__upper_bound_multi(__k);
1359 }
1360
1337# if _LIBCPP_STD_VER >= 141361# if _LIBCPP_STD_VER >= 14
1338 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1362 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1339 _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {1363 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
1340 return __tree_.upper_bound(__k);1364 return __tree_.__upper_bound_multi(__k);
1341 }1365 }
1342 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1366 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1343 _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {1367 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
1344 return __tree_.upper_bound(__k);1368 return __tree_.__upper_bound_multi(__k);
1345 }1369 }
1346# endif1370# endif
13471371
1348 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1372 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
1349 return __tree_.__equal_range_multi(__k);1373 return __tree_.__equal_range_multi(__k);
1350 }1374 }
1351 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1375 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
1352 return __tree_.__equal_range_multi(__k);1376 return __tree_.__equal_range_multi(__k);
1353 }1377 }
1354# if _LIBCPP_STD_VER >= 141378# if _LIBCPP_STD_VER >= 14
1355 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1379 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1356 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1380 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1357 return __tree_.__equal_range_multi(__k);1381 return __tree_.__equal_range_multi(__k);
1358 }1382 }
1359 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1383 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1360 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1384 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1361 return __tree_.__equal_range_multi(__k);1385 return __tree_.__equal_range_multi(__k);
1362 }1386 }
1363# endif1387# endif
1388
1389 template <class, class...>
1390 friend struct __specialized_algorithm;
1364};1391};
13651392
1366# if _LIBCPP_STD_VER >= 171393# if _LIBCPP_STD_VER >= 17
1367template <class _InputIterator,1394template <class _InputIterator,
1368 class _Compare = less<__iter_value_type<_InputIterator>>,1395 class _Compare = less<__iterator_value_type<_InputIterator>>,
1369 class _Allocator = allocator<__iter_value_type<_InputIterator>>,1396 class _Allocator = allocator<__iterator_value_type<_InputIterator>>,
1370 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,1397 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1371 class = enable_if_t<__is_allocator<_Allocator>::value, void>,1398 class = enable_if_t<__is_allocator_v<_Allocator>>,
1372 class = enable_if_t<!__is_allocator<_Compare>::value, void>>1399 class = enable_if_t<!__is_allocator_v<_Compare>>>
1373multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())1400multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
1374 -> multiset<__iter_value_type<_InputIterator>, _Compare, _Allocator>;1401 -> multiset<__iterator_value_type<_InputIterator>, _Compare, _Allocator>;
13751402
1376# if _LIBCPP_STD_VER >= 231403# if _LIBCPP_STD_VER >= 23
1377template <ranges::input_range _Range,1404template <ranges::input_range _Range,
1378 class _Compare = less<ranges::range_value_t<_Range>>,1405 class _Compare = less<ranges::range_value_t<_Range>>,
1379 class _Allocator = allocator<ranges::range_value_t<_Range>>,1406 class _Allocator = allocator<ranges::range_value_t<_Range>>,
1380 class = enable_if_t<__is_allocator<_Allocator>::value, void>,1407 class = enable_if_t<__is_allocator_v<_Allocator>>,
1381 class = enable_if_t<!__is_allocator<_Compare>::value, void>>1408 class = enable_if_t<!__is_allocator_v<_Compare>>>
1382multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())1409multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
1383 -> multiset<ranges::range_value_t<_Range>, _Compare, _Allocator>;1410 -> multiset<ranges::range_value_t<_Range>, _Compare, _Allocator>;
1384# endif1411# endif
...@@ -1386,43 +1413,44 @@ multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(...@@ -1386,43 +1413,44 @@ multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(
1386template <class _Key,1413template <class _Key,
1387 class _Compare = less<_Key>,1414 class _Compare = less<_Key>,
1388 class _Allocator = allocator<_Key>,1415 class _Allocator = allocator<_Key>,
1389 class = enable_if_t<__is_allocator<_Allocator>::value, void>,1416 class = enable_if_t<__is_allocator_v<_Allocator>>,
1390 class = enable_if_t<!__is_allocator<_Compare>::value, void>>1417 class = enable_if_t<!__is_allocator_v<_Compare>>>
1391multiset(initializer_list<_Key>,1418multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator())
1392 _Compare = _Compare(),1419 -> multiset<_Key, _Compare, _Allocator>;
1393 _Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>;
13941420
1395template <class _InputIterator,1421template <class _InputIterator,
1396 class _Allocator,1422 class _Allocator,
1397 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,1423 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1398 class = enable_if_t<__is_allocator<_Allocator>::value, void>>1424 class = enable_if_t<__is_allocator_v<_Allocator>>>
1399multiset(_InputIterator, _InputIterator, _Allocator)1425multiset(_InputIterator, _InputIterator, _Allocator)
1400 -> multiset<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;1426 -> multiset<__iterator_value_type<_InputIterator>, less<__iterator_value_type<_InputIterator>>, _Allocator>;
14011427
1402# if _LIBCPP_STD_VER >= 231428# if _LIBCPP_STD_VER >= 23
1403template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>1429template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1404multiset(from_range_t,1430multiset(from_range_t, _Range&&, _Allocator)
1405 _Range&&,1431 -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
1406 _Allocator) -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
1407# endif1432# endif
14081433
1409template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>1434template <class _Key, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1410multiset(initializer_list<_Key>, _Allocator) -> multiset<_Key, less<_Key>, _Allocator>;1435multiset(initializer_list<_Key>, _Allocator) -> multiset<_Key, less<_Key>, _Allocator>;
1411# endif1436# endif
14121437
1413# ifndef _LIBCPP_CXX03_LANG1438# if _LIBCPP_STD_VER >= 14
1439template <class _Alg, class _Key, class _Compare, class _Allocator>
1440struct __specialized_algorithm<_Alg, __single_range<multiset<_Key, _Compare, _Allocator>>> {
1441 using __set _LIBCPP_NODEBUG = multiset<_Key, _Compare, _Allocator>;
14141442
1415template <class _Key, class _Compare, class _Allocator>1443 static const bool __has_algorithm =
1416multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)1444 __specialized_algorithm<_Alg, __single_range<typename __set::__base>>::__has_algorithm;
1417 : __tree_(std::move(__s.__tree_), __a) {
1418 if (__a != __s.get_allocator()) {
1419 const_iterator __e = cend();
1420 while (!__s.empty())
1421 insert(__e, std::move(__s.__tree_.remove(__s.begin())->__value_));
1422 }
1423}
14241445
1425# endif // _LIBCPP_CXX03_LANG1446 // set's begin() and end() are identical with and without const qualification
1447 template <class... _Args>
1448 _LIBCPP_HIDE_FROM_ABI static auto operator()(const __set& __set, _Args&&... __args) {
1449 return __specialized_algorithm<_Alg, __single_range<typename __set::__base>>()(
1450 __set.__tree_, std::forward<_Args>(__args)...);
1451 }
1452};
1453# endif
14261454
1427template <class _Key, class _Compare, class _Allocator>1455template <class _Key, class _Compare, class _Allocator>
1428inline _LIBCPP_HIDE_FROM_ABI bool1456inline _LIBCPP_HIDE_FROM_ABI bool
lib/libcxx/include/shared_mutex+3-8
...@@ -138,6 +138,7 @@ template <class Mutex>...@@ -138,6 +138,7 @@ template <class Mutex>
138# include <__mutex/tag_types.h>138# include <__mutex/tag_types.h>
139# include <__mutex/unique_lock.h>139# include <__mutex/unique_lock.h>
140# include <__system_error/throw_system_error.h>140# include <__system_error/throw_system_error.h>
141# include <__utility/move.h>
141# include <__utility/swap.h>142# include <__utility/swap.h>
142# include <cerrno>143# include <cerrno>
143# include <version>144# include <version>
...@@ -340,14 +341,8 @@ public:...@@ -340,14 +341,8 @@ public:
340 }341 }
341342
342 _LIBCPP_HIDE_FROM_ABI shared_lock& operator=(shared_lock&& __u) _NOEXCEPT {343 _LIBCPP_HIDE_FROM_ABI shared_lock& operator=(shared_lock&& __u) _NOEXCEPT {
343 if (__owns_)344 if (this != std::addressof(__u))
344 __m_->unlock_shared();345 shared_lock(std::move(__u)).swap(*this);
345 __m_ = nullptr;
346 __owns_ = false;
347 __m_ = __u.__m_;
348 __owns_ = __u.__owns_;
349 __u.__m_ = nullptr;
350 __u.__owns_ = false;
351 return *this;346 return *this;
352 }347 }
353348
lib/libcxx/include/span+53-37
...@@ -310,30 +310,32 @@ public:...@@ -310,30 +310,32 @@ public:
310 }310 }
311311
312 template <size_t _Count>312 template <size_t _Count>
313 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> first() const noexcept {313 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> first() const noexcept {
314 static_assert(_Count <= _Extent, "span<T, N>::first<Count>(): Count out of range");314 static_assert(_Count <= _Extent, "span<T, N>::first<Count>(): Count out of range");
315 return span<element_type, _Count>{data(), _Count};315 return span<element_type, _Count>{data(), _Count};
316 }316 }
317317
318 template <size_t _Count>318 template <size_t _Count>
319 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> last() const noexcept {319 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> last() const noexcept {
320 static_assert(_Count <= _Extent, "span<T, N>::last<Count>(): Count out of range");320 static_assert(_Count <= _Extent, "span<T, N>::last<Count>(): Count out of range");
321 return span<element_type, _Count>{data() + size() - _Count, _Count};321 return span<element_type, _Count>{data() + size() - _Count, _Count};
322 }322 }
323323
324 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept {324 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent>
325 first(size_type __count) const noexcept {
325 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T, N>::first(count): count out of range");326 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T, N>::first(count): count out of range");
326 return {data(), __count};327 return {data(), __count};
327 }328 }
328329
329 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent> last(size_type __count) const noexcept {330 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent>
331 last(size_type __count) const noexcept {
330 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T, N>::last(count): count out of range");332 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T, N>::last(count): count out of range");
331 return {data() + size() - __count, __count};333 return {data() + size() - __count, __count};
332 }334 }
333335
334 template <size_t _Offset, size_t _Count = dynamic_extent>336 template <size_t _Offset, size_t _Count = dynamic_extent>
335 _LIBCPP_HIDE_FROM_ABI constexpr auto337 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto subspan() const noexcept
336 subspan() const noexcept -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset> {338 -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset> {
337 static_assert(_Offset <= _Extent, "span<T, N>::subspan<Offset, Count>(): Offset out of range");339 static_assert(_Offset <= _Extent, "span<T, N>::subspan<Offset, Count>(): Offset out of range");
338 static_assert(_Count == dynamic_extent || _Count <= _Extent - _Offset,340 static_assert(_Count == dynamic_extent || _Count <= _Extent - _Offset,
339 "span<T, N>::subspan<Offset, Count>(): Offset + Count out of range");341 "span<T, N>::subspan<Offset, Count>(): Offset + Count out of range");
...@@ -342,7 +344,7 @@ public:...@@ -342,7 +344,7 @@ public:
342 return _ReturnType{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};344 return _ReturnType{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};
343 }345 }
344346
345 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent>347 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent>
346 subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept {348 subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept {
347 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");349 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
348 if (__count == dynamic_extent)350 if (__count == dynamic_extent)
...@@ -352,52 +354,58 @@ public:...@@ -352,52 +354,58 @@ public:
352 return {data() + __offset, __count};354 return {data() + __offset, __count};
353 }355 }
354356
355 _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept { return _Extent; }357 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept { return _Extent; }
356 _LIBCPP_HIDE_FROM_ABI constexpr size_type size_bytes() const noexcept { return _Extent * sizeof(element_type); }358 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size_bytes() const noexcept {
359 return _Extent * sizeof(element_type);
360 }
357 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const noexcept { return _Extent == 0; }361 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const noexcept { return _Extent == 0; }
358362
359 _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept {363 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept {
360 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T, N>::operator[](index): index out of range");364 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T, N>::operator[](index): index out of range");
361 return __data_[__idx];365 return __data_[__idx];
362 }366 }
363367
364# if _LIBCPP_STD_VER >= 26368# if _LIBCPP_STD_VER >= 26
365 _LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __index) const {369 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __index) const {
366 if (__index >= size())370 if (__index >= size())
367 std::__throw_out_of_range("span");371 std::__throw_out_of_range("span");
368 return __data_[__index];372 return __data_[__index];
369 }373 }
370# endif374# endif
371375
372 _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept {376 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept {
373 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::front() on empty span");377 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::front() on empty span");
374 return __data_[0];378 return __data_[0];
375 }379 }
376380
377 _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept {381 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept {
378 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::back() on empty span");382 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::back() on empty span");
379 return __data_[size() - 1];383 return __data_[size() - 1];
380 }384 }
381385
382 _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept { return __data_; }386 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept { return __data_; }
383387
384 // [span.iter], span iterator support388 // [span.iter], span iterator support
385 _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept {389 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept {
386# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS390# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
387 return std::__make_bounded_iter(data(), data(), data() + size());391 return std::__make_bounded_iter(data(), data(), data() + size());
388# else392# else
389 return iterator(data());393 return iterator(data());
390# endif394# endif
391 }395 }
392 _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept {396 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept {
393# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS397# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
394 return std::__make_bounded_iter(data() + size(), data(), data() + size());398 return std::__make_bounded_iter(data() + size(), data(), data() + size());
395# else399# else
396 return iterator(data() + size());400 return iterator(data() + size());
397# endif401# endif
398 }402 }
399 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); }403 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rbegin() const noexcept {
400 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rend() const noexcept { return reverse_iterator(begin()); }404 return reverse_iterator(end());
405 }
406 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rend() const noexcept {
407 return reverse_iterator(begin());
408 }
401409
402 _LIBCPP_HIDE_FROM_ABI span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept {410 _LIBCPP_HIDE_FROM_ABI span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept {
403 return span<const byte, _Extent * sizeof(element_type)>{reinterpret_cast<const byte*>(data()), size_bytes()};411 return span<const byte, _Extent * sizeof(element_type)>{reinterpret_cast<const byte*>(data()), size_bytes()};
...@@ -478,36 +486,38 @@ public:...@@ -478,36 +486,38 @@ public:
478 : __data_{__other.data()}, __size_{__other.size()} {}486 : __data_{__other.data()}, __size_{__other.size()} {}
479487
480 template <size_t _Count>488 template <size_t _Count>
481 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> first() const noexcept {489 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> first() const noexcept {
482 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count <= size(), "span<T>::first<Count>(): Count out of range");490 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count <= size(), "span<T>::first<Count>(): Count out of range");
483 return span<element_type, _Count>{data(), _Count};491 return span<element_type, _Count>{data(), _Count};
484 }492 }
485493
486 template <size_t _Count>494 template <size_t _Count>
487 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> last() const noexcept {495 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> last() const noexcept {
488 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count <= size(), "span<T>::last<Count>(): Count out of range");496 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count <= size(), "span<T>::last<Count>(): Count out of range");
489 return span<element_type, _Count>{data() + size() - _Count, _Count};497 return span<element_type, _Count>{data() + size() - _Count, _Count};
490 }498 }
491499
492 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept {500 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent>
501 first(size_type __count) const noexcept {
493 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T>::first(count): count out of range");502 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T>::first(count): count out of range");
494 return {data(), __count};503 return {data(), __count};
495 }504 }
496505
497 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent> last(size_type __count) const noexcept {506 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, dynamic_extent>
507 last(size_type __count) const noexcept {
498 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T>::last(count): count out of range");508 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T>::last(count): count out of range");
499 return {data() + size() - __count, __count};509 return {data() + size() - __count, __count};
500 }510 }
501511
502 template <size_t _Offset, size_t _Count = dynamic_extent>512 template <size_t _Offset, size_t _Count = dynamic_extent>
503 _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> subspan() const noexcept {513 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr span<element_type, _Count> subspan() const noexcept {
504 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");514 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
505 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count == dynamic_extent || _Count <= size() - _Offset,515 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count == dynamic_extent || _Count <= size() - _Offset,
506 "span<T>::subspan<Offset, Count>(): Offset + Count out of range");516 "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
507 return span<element_type, _Count>{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};517 return span<element_type, _Count>{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};
508 }518 }
509519
510 constexpr span<element_type, dynamic_extent> _LIBCPP_HIDE_FROM_ABI520 [[nodiscard]] constexpr span<element_type, dynamic_extent> _LIBCPP_HIDE_FROM_ABI
511 subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept {521 subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept {
512 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");522 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
513 if (__count == dynamic_extent)523 if (__count == dynamic_extent)
...@@ -517,52 +527,58 @@ public:...@@ -517,52 +527,58 @@ public:
517 return {data() + __offset, __count};527 return {data() + __offset, __count};
518 }528 }
519529
520 _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept { return __size_; }530 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept { return __size_; }
521 _LIBCPP_HIDE_FROM_ABI constexpr size_type size_bytes() const noexcept { return __size_ * sizeof(element_type); }531 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size_bytes() const noexcept {
532 return __size_ * sizeof(element_type);
533 }
522 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const noexcept { return __size_ == 0; }534 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const noexcept { return __size_ == 0; }
523535
524 _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept {536 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept {
525 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T>::operator[](index): index out of range");537 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T>::operator[](index): index out of range");
526 return __data_[__idx];538 return __data_[__idx];
527 }539 }
528540
529# if _LIBCPP_STD_VER >= 26541# if _LIBCPP_STD_VER >= 26
530 _LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __index) const {542 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __index) const {
531 if (__index >= size())543 if (__index >= size())
532 std::__throw_out_of_range("span");544 std::__throw_out_of_range("span");
533 return __data_[__index];545 return __data_[__index];
534 }546 }
535# endif547# endif
536548
537 _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept {549 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept {
538 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::front() on empty span");550 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::front() on empty span");
539 return __data_[0];551 return __data_[0];
540 }552 }
541553
542 _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept {554 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept {
543 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::back() on empty span");555 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::back() on empty span");
544 return __data_[size() - 1];556 return __data_[size() - 1];
545 }557 }
546558
547 _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept { return __data_; }559 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept { return __data_; }
548560
549 // [span.iter], span iterator support561 // [span.iter], span iterator support
550 _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept {562 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept {
551# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS563# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
552 return std::__make_bounded_iter(data(), data(), data() + size());564 return std::__make_bounded_iter(data(), data(), data() + size());
553# else565# else
554 return iterator(data());566 return iterator(data());
555# endif567# endif
556 }568 }
557 _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept {569 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept {
558# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS570# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
559 return std::__make_bounded_iter(data() + size(), data(), data() + size());571 return std::__make_bounded_iter(data() + size(), data(), data() + size());
560# else572# else
561 return iterator(data() + size());573 return iterator(data() + size());
562# endif574# endif
563 }575 }
564 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); }576 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rbegin() const noexcept {
565 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rend() const noexcept { return reverse_iterator(begin()); }577 return reverse_iterator(end());
578 }
579 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator rend() const noexcept {
580 return reverse_iterator(begin());
581 }
566582
567 _LIBCPP_HIDE_FROM_ABI span<const byte, dynamic_extent> __as_bytes() const noexcept {583 _LIBCPP_HIDE_FROM_ABI span<const byte, dynamic_extent> __as_bytes() const noexcept {
568 return {reinterpret_cast<const byte*>(data()), size_bytes()};584 return {reinterpret_cast<const byte*>(data()), size_bytes()};
...@@ -585,13 +601,13 @@ inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true;...@@ -585,13 +601,13 @@ inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true;
585601
586// as_bytes & as_writable_bytes602// as_bytes & as_writable_bytes
587template <class _Tp, size_t _Extent>603template <class _Tp, size_t _Extent>
588_LIBCPP_HIDE_FROM_ABI auto as_bytes(span<_Tp, _Extent> __s) noexcept {604[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto as_bytes(span<_Tp, _Extent> __s) noexcept {
589 return __s.__as_bytes();605 return __s.__as_bytes();
590}606}
591607
592template <class _Tp, size_t _Extent>608template <class _Tp, size_t _Extent>
593 requires(!is_const_v<_Tp>)609 requires(!is_const_v<_Tp>)
594_LIBCPP_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept {610[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept {
595 return __s.__as_writable_bytes();611 return __s.__as_writable_bytes();
596}612}
597613
lib/libcxx/include/sstream+34-28
...@@ -461,15 +461,15 @@ public:...@@ -461,15 +461,15 @@ public:
461 // [stringbuf.members] Member functions:461 // [stringbuf.members] Member functions:
462462
463# if _LIBCPP_STD_VER >= 20463# if _LIBCPP_STD_VER >= 20
464 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const noexcept { return __str_.get_allocator(); }464 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const noexcept { return __str_.get_allocator(); }
465# endif465# endif
466466
467# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)467# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
468 string_type str() const;468 [[__nodiscard__]] string_type str() const;
469# else469# else
470 _LIBCPP_HIDE_FROM_ABI string_type str() const& { return str(__str_.get_allocator()); }470 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() const& { return str(__str_.get_allocator()); }
471471
472 _LIBCPP_HIDE_FROM_ABI string_type str() && {472 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() && {
473 const basic_string_view<_CharT, _Traits> __view = view();473 const basic_string_view<_CharT, _Traits> __view = view();
474 typename string_type::size_type __pos = __view.empty() ? 0 : __view.data() - __str_.data();474 typename string_type::size_type __pos = __view.empty() ? 0 : __view.data() - __str_.data();
475 // In C++23, this is just string_type(std::move(__str_), __pos, __view.size(), __str_.get_allocator());475 // In C++23, this is just string_type(std::move(__str_), __pos, __view.size(), __str_.get_allocator());
...@@ -484,12 +484,12 @@ public:...@@ -484,12 +484,12 @@ public:
484484
485# if _LIBCPP_STD_VER >= 20485# if _LIBCPP_STD_VER >= 20
486 template <class _SAlloc>486 template <class _SAlloc>
487 requires __is_allocator<_SAlloc>::value487 requires __is_allocator_v<_SAlloc>
488 _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {488 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
489 return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa);489 return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa);
490 }490 }
491491
492 _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept;492 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept;
493# endif // _LIBCPP_STD_VER >= 20493# endif // _LIBCPP_STD_VER >= 20
494494
495 void str(const string_type& __s) {495 void str(const string_type& __s) {
...@@ -949,26 +949,28 @@ public:...@@ -949,26 +949,28 @@ public:
949 }949 }
950950
951 // [istringstream.members] Member functions:951 // [istringstream.members] Member functions:
952 _LIBCPP_HIDE_FROM_ABI basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {952 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
953 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(std::addressof(__sb_));953 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(std::addressof(__sb_));
954 }954 }
955955
956# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)956# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
957 _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }957 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
958# else958# else
959 _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }959 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }
960960
961 _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }961 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }
962# endif962# endif
963963
964# if _LIBCPP_STD_VER >= 20964# if _LIBCPP_STD_VER >= 20
965 template <class _SAlloc>965 template <class _SAlloc>
966 requires __is_allocator<_SAlloc>::value966 requires __is_allocator_v<_SAlloc>
967 _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {967 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
968 return __sb_.str(__sa);968 return __sb_.str(__sa);
969 }969 }
970970
971 _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }971 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept {
972 return __sb_.view();
973 }
972# endif // _LIBCPP_STD_VER >= 20974# endif // _LIBCPP_STD_VER >= 20
973975
974 _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }976 _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
...@@ -1087,26 +1089,28 @@ public:...@@ -1087,26 +1089,28 @@ public:
1087 }1089 }
10881090
1089 // [ostringstream.members] Member functions:1091 // [ostringstream.members] Member functions:
1090 _LIBCPP_HIDE_FROM_ABI basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {1092 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
1091 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(std::addressof(__sb_));1093 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(std::addressof(__sb_));
1092 }1094 }
10931095
1094# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)1096# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
1095 _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }1097 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
1096# else1098# else
1097 _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }1099 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }
10981100
1099 _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }1101 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }
1100# endif1102# endif
11011103
1102# if _LIBCPP_STD_VER >= 201104# if _LIBCPP_STD_VER >= 20
1103 template <class _SAlloc>1105 template <class _SAlloc>
1104 requires __is_allocator<_SAlloc>::value1106 requires __is_allocator_v<_SAlloc>
1105 _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {1107 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
1106 return __sb_.str(__sa);1108 return __sb_.str(__sa);
1107 }1109 }
11081110
1109 _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }1111 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept {
1112 return __sb_.view();
1113 }
1110# endif // _LIBCPP_STD_VER >= 201114# endif // _LIBCPP_STD_VER >= 20
11111115
1112 _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }1116 _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
...@@ -1227,26 +1231,28 @@ public:...@@ -1227,26 +1231,28 @@ public:
1227 }1231 }
12281232
1229 // [stringstream.members] Member functions:1233 // [stringstream.members] Member functions:
1230 _LIBCPP_HIDE_FROM_ABI basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {1234 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
1231 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(std::addressof(__sb_));1235 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(std::addressof(__sb_));
1232 }1236 }
12331237
1234# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)1238# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
1235 _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }1239 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
1236# else1240# else
1237 _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }1241 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }
12381242
1239 _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }1243 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }
1240# endif1244# endif
12411245
1242# if _LIBCPP_STD_VER >= 201246# if _LIBCPP_STD_VER >= 20
1243 template <class _SAlloc>1247 template <class _SAlloc>
1244 requires __is_allocator<_SAlloc>::value1248 requires __is_allocator_v<_SAlloc>
1245 _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {1249 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
1246 return __sb_.str(__sa);1250 return __sb_.str(__sa);
1247 }1251 }
12481252
1249 _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }1253 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept {
1254 return __sb_.view();
1255 }
1250# endif // _LIBCPP_STD_VER >= 201256# endif // _LIBCPP_STD_VER >= 20
12511257
1252 _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }1258 _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
lib/libcxx/include/stack+13-15
...@@ -235,9 +235,9 @@ public:...@@ -235,9 +235,9 @@ public:
235# endif235# endif
236236
237 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }237 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
238 _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }238 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
239 _LIBCPP_HIDE_FROM_ABI reference top() { return c.back(); }239 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reference top() { return c.back(); }
240 _LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.back(); }240 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.back(); }
241241
242 _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }242 _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }
243# ifndef _LIBCPP_CXX03_LANG243# ifndef _LIBCPP_CXX03_LANG
...@@ -294,19 +294,19 @@ public:...@@ -294,19 +294,19 @@ public:
294};294};
295295
296# if _LIBCPP_STD_VER >= 17296# if _LIBCPP_STD_VER >= 17
297template <class _Container, class = enable_if_t<!__is_allocator<_Container>::value> >297template <class _Container, class = enable_if_t<!__is_allocator_v<_Container>>>
298stack(_Container) -> stack<typename _Container::value_type, _Container>;298stack(_Container) -> stack<typename _Container::value_type, _Container>;
299299
300template <class _Container,300template <class _Container,
301 class _Alloc,301 class _Alloc,
302 class = enable_if_t<!__is_allocator<_Container>::value>,302 class = enable_if_t<!__is_allocator_v<_Container>>,
303 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >303 class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
304stack(_Container, _Alloc) -> stack<typename _Container::value_type, _Container>;304stack(_Container, _Alloc) -> stack<typename _Container::value_type, _Container>;
305# endif305# endif
306306
307# if _LIBCPP_STD_VER >= 23307# if _LIBCPP_STD_VER >= 23
308template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>308template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
309stack(_InputIterator, _InputIterator) -> stack<__iter_value_type<_InputIterator>>;309stack(_InputIterator, _InputIterator) -> stack<__iterator_value_type<_InputIterator>>;
310310
311template <ranges::input_range _Range>311template <ranges::input_range _Range>
312stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;312stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;
...@@ -314,15 +314,13 @@ stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;...@@ -314,15 +314,13 @@ stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;
314template <class _InputIterator,314template <class _InputIterator,
315 class _Alloc,315 class _Alloc,
316 __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,316 __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
317 __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>317 __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
318stack(_InputIterator,318stack(_InputIterator, _InputIterator, _Alloc)
319 _InputIterator,319 -> stack<__iterator_value_type<_InputIterator>, deque<__iterator_value_type<_InputIterator>, _Alloc>>;
320 _Alloc) -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;320
321321template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
322template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>322stack(from_range_t, _Range&&, _Alloc)
323stack(from_range_t,323 -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
324 _Range&&,
325 _Alloc) -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
326324
327# endif325# endif
328326
lib/libcxx/include/stddef.h+10-10
...@@ -25,24 +25,24 @@ Types:...@@ -25,24 +25,24 @@ Types:
25*/25*/
2626
27#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)27#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
28# include <__cxx03/stddef.h>28# include <__cxx03/__config>
29#else29#else
30# include <__config>30# include <__config>
31#endif
3132
32# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)33#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
33# pragma GCC system_header34# pragma GCC system_header
34# endif35#endif
3536
36// Note: This include is outside of header guards because we sometimes get included multiple times37// Note: This include is outside of header guards because we sometimes get included multiple times
37// with different defines and the underlying <stddef.h> will know how to deal with that.38// with different defines and the underlying <stddef.h> will know how to deal with that.
38# include_next <stddef.h>39#include_next <stddef.h>
3940
40# ifndef _LIBCPP_STDDEF_H41#ifndef _LIBCPP_STDDEF_H
41# define _LIBCPP_STDDEF_H42# define _LIBCPP_STDDEF_H
4243
43# ifdef __cplusplus44# ifdef __cplusplus
44typedef decltype(nullptr) nullptr_t;45typedef decltype(nullptr) nullptr_t;
45# endif46# endif
46# endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
4747
48#endif // _LIBCPP_STDDEF_H48#endif // _LIBCPP_STDDEF_H
lib/libcxx/include/stdexcept+2-2
...@@ -91,7 +91,7 @@ public:...@@ -91,7 +91,7 @@ public:
9191
92 ~logic_error() _NOEXCEPT override;92 ~logic_error() _NOEXCEPT override;
9393
94 const char* what() const _NOEXCEPT override;94 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
95# else95# else
9696
97public:97public:
...@@ -115,7 +115,7 @@ public:...@@ -115,7 +115,7 @@ public:
115115
116 ~runtime_error() _NOEXCEPT override;116 ~runtime_error() _NOEXCEPT override;
117117
118 const char* what() const _NOEXCEPT override;118 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
119# else119# else
120120
121public:121public:
lib/libcxx/include/stdio.h+20-21
...@@ -88,35 +88,34 @@ void perror(const char* s);...@@ -88,35 +88,34 @@ void perror(const char* s);
88*/88*/
8989
90#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)90#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
91# include <__cxx03/stdio.h>91# include <__cxx03/__config>
92#else92#else
93# include <__config>93# include <__config>
94#endif
9495
95# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)96#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
96# pragma GCC system_header97# pragma GCC system_header
97# endif98#endif
9899
99// The inclusion of the system's <stdio.h> is intentionally done once outside of any include100// The inclusion of the system's <stdio.h> is intentionally done once outside of any include
100// guards because some code expects to be able to include the underlying system header multiple101// guards because some code expects to be able to include the underlying system header multiple
101// times to get different definitions based on the macros that are set before inclusion.102// times to get different definitions based on the macros that are set before inclusion.
102# if __has_include_next(<stdio.h>)103#if __has_include_next(<stdio.h>)
103# include_next <stdio.h>104# include_next <stdio.h>
104# endif105#endif
105106
106# ifndef _LIBCPP_STDIO_H107#ifndef _LIBCPP_STDIO_H
107# define _LIBCPP_STDIO_H108# define _LIBCPP_STDIO_H
108109
109# ifdef __cplusplus110# ifdef __cplusplus
110111
111# undef getc112# undef getc
112# undef putc113# undef putc
113# undef clearerr114# undef clearerr
114# undef feof115# undef feof
115# undef ferror116# undef ferror
116# undef putchar117# undef putchar
117# undef getchar118# undef getchar
118119
119# endif // __cplusplus120# endif // __cplusplus
120# endif // _LIBCPP_STDIO_H121#endif // _LIBCPP_STDIO_H
121
122#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/streambuf+59-19
...@@ -119,6 +119,7 @@ protected:...@@ -119,6 +119,7 @@ protected:
119# include <__locale>119# include <__locale>
120# include <__type_traits/is_same.h>120# include <__type_traits/is_same.h>
121# include <__utility/is_valid_range.h>121# include <__utility/is_valid_range.h>
122# include <__utility/scope_guard.h>
122# include <climits>123# include <climits>
123# include <ios>124# include <ios>
124# include <iosfwd>125# include <iosfwd>
...@@ -149,47 +150,56 @@ public:...@@ -149,47 +150,56 @@ public:
149 virtual ~basic_streambuf() {}150 virtual ~basic_streambuf() {}
150151
151 // 27.6.2.2.1 locales:152 // 27.6.2.2.1 locales:
152 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 locale pubimbue(const locale& __loc) {153 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 locale pubimbue(const locale& __loc) {
153 imbue(__loc);154 imbue(__loc);
154 locale __r = __loc_;155 locale __r = __loc_;
155 __loc_ = __loc;156 __loc_ = __loc;
156 return __r;157 return __r;
157 }158 }
158159
159 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 locale getloc() const { return __loc_; }160 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 locale getloc() const { return __loc_; }
160161
161 // 27.6.2.2.2 buffer and positioning:162 // 27.6.2.2.2 buffer and positioning:
162 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_streambuf* pubsetbuf(char_type* __s, streamsize __n) {163 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 basic_streambuf* pubsetbuf(char_type* __s, streamsize __n) {
163 return setbuf(__s, __n);164 return setbuf(__s, __n);
164 }165 }
165166
166 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 pos_type167 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 pos_type
167 pubseekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __which = ios_base::in | ios_base::out) {168 pubseekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __which = ios_base::in | ios_base::out) {
168 return seekoff(__off, __way, __which);169 return seekoff(__off, __way, __which);
169 }170 }
170171
171 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 pos_type172 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 pos_type
172 pubseekpos(pos_type __sp, ios_base::openmode __which = ios_base::in | ios_base::out) {173 pubseekpos(pos_type __sp, ios_base::openmode __which = ios_base::in | ios_base::out) {
173 return seekpos(__sp, __which);174 return seekpos(__sp, __which);
174 }175 }
175176
176 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int pubsync() { return sync(); }177 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int pubsync() { return sync(); }
177178
178 // Get and put areas:179 // Get and put areas:
179 // 27.6.2.2.3 Get area:180 // 27.6.2.2.3 Get area:
180 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 streamsize in_avail() {181 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 streamsize in_avail() {
182 __check_invariants();
183 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
184
181 if (gptr() < egptr())185 if (gptr() < egptr())
182 return static_cast<streamsize>(egptr() - gptr());186 return static_cast<streamsize>(egptr() - gptr());
183 return showmanyc();187 return showmanyc();
184 }188 }
185189
186 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type snextc() {190 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int_type snextc() {
191 __check_invariants();
192 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
193
187 if (sbumpc() == traits_type::eof())194 if (sbumpc() == traits_type::eof())
188 return traits_type::eof();195 return traits_type::eof();
189 return sgetc();196 return sgetc();
190 }197 }
191198
192 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sbumpc() {199 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int_type sbumpc() {
200 __check_invariants();
201 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
202
193 if (gptr() == egptr())203 if (gptr() == egptr())
194 return uflow();204 return uflow();
195 int_type __c = traits_type::to_int_type(*gptr());205 int_type __c = traits_type::to_int_type(*gptr());
...@@ -197,23 +207,32 @@ public:...@@ -197,23 +207,32 @@ public:
197 return __c;207 return __c;
198 }208 }
199209
200 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sgetc() {210 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int_type sgetc() {
211 __check_invariants();
212 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
213
201 if (gptr() == egptr())214 if (gptr() == egptr())
202 return underflow();215 return underflow();
203 return traits_type::to_int_type(*gptr());216 return traits_type::to_int_type(*gptr());
204 }217 }
205218
206 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 streamsize sgetn(char_type* __s, streamsize __n) { return xsgetn(__s, __n); }219 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 streamsize sgetn(char_type* __s, streamsize __n) { return xsgetn(__s, __n); }
207220
208 // 27.6.2.2.4 Putback:221 // 27.6.2.2.4 Putback:
209 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sputbackc(char_type __c) {222 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int_type sputbackc(char_type __c) {
223 __check_invariants();
224 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
225
210 if (eback() == gptr() || !traits_type::eq(__c, *(gptr() - 1)))226 if (eback() == gptr() || !traits_type::eq(__c, *(gptr() - 1)))
211 return pbackfail(traits_type::to_int_type(__c));227 return pbackfail(traits_type::to_int_type(__c));
212 this->gbump(-1);228 this->gbump(-1);
213 return traits_type::to_int_type(*gptr());229 return traits_type::to_int_type(*gptr());
214 }230 }
215231
216 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sungetc() {232 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int_type sungetc() {
233 __check_invariants();
234 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
235
217 if (eback() == gptr())236 if (eback() == gptr())
218 return pbackfail();237 return pbackfail();
219 this->gbump(-1);238 this->gbump(-1);
...@@ -221,7 +240,10 @@ public:...@@ -221,7 +240,10 @@ public:
221 }240 }
222241
223 // 27.6.2.2.5 Put area:242 // 27.6.2.2.5 Put area:
224 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sputc(char_type __c) {243 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 int_type sputc(char_type __c) {
244 __check_invariants();
245 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
246
225 if (pptr() == epptr())247 if (pptr() == epptr())
226 return overflow(traits_type::to_int_type(__c));248 return overflow(traits_type::to_int_type(__c));
227 *pptr() = __c;249 *pptr() = __c;
...@@ -229,7 +251,7 @@ public:...@@ -229,7 +251,7 @@ public:
229 return traits_type::to_int_type(__c);251 return traits_type::to_int_type(__c);
230 }252 }
231253
232 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 streamsize sputn(const char_type* __s, streamsize __n) {254 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 streamsize sputn(const char_type* __s, streamsize __n) {
233 return xsputn(__s, __n);255 return xsputn(__s, __n);
234 }256 }
235257
...@@ -270,12 +292,12 @@ protected:...@@ -270,12 +292,12 @@ protected:
270 _LIBCPP_HIDE_FROM_ABI char_type* gptr() const { return __ninp_; }292 _LIBCPP_HIDE_FROM_ABI char_type* gptr() const { return __ninp_; }
271 _LIBCPP_HIDE_FROM_ABI char_type* egptr() const { return __einp_; }293 _LIBCPP_HIDE_FROM_ABI char_type* egptr() const { return __einp_; }
272294
273 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void gbump(int __n) { __ninp_ += __n; }295 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void gbump(int __n) { __ninp_ += __n; }
274296
275 // gbump takes an int, so it might not be able to represent the offset we want to add.297 // gbump takes an int, so it might not be able to represent the offset we want to add.
276 _LIBCPP_HIDE_FROM_ABI void __gbump_ptrdiff(ptrdiff_t __n) { __ninp_ += __n; }298 _LIBCPP_HIDE_FROM_ABI void __gbump_ptrdiff(ptrdiff_t __n) { __ninp_ += __n; }
277299
278 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) {300 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) {
279 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gbeg, __gnext), "[gbeg, gnext) must be a valid range");301 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gbeg, __gnext), "[gbeg, gnext) must be a valid range");
280 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gbeg, __gend), "[gbeg, gend) must be a valid range");302 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gbeg, __gend), "[gbeg, gend) must be a valid range");
281 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gnext, __gend), "[gnext, gend) must be a valid range");303 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gnext, __gend), "[gnext, gend) must be a valid range");
...@@ -289,11 +311,11 @@ protected:...@@ -289,11 +311,11 @@ protected:
289 _LIBCPP_HIDE_FROM_ABI char_type* pptr() const { return __nout_; }311 _LIBCPP_HIDE_FROM_ABI char_type* pptr() const { return __nout_; }
290 _LIBCPP_HIDE_FROM_ABI char_type* epptr() const { return __eout_; }312 _LIBCPP_HIDE_FROM_ABI char_type* epptr() const { return __eout_; }
291313
292 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void pbump(int __n) { __nout_ += __n; }314 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void pbump(int __n) { __nout_ += __n; }
293315
294 _LIBCPP_HIDE_FROM_ABI void __pbump(streamsize __n) { __nout_ += __n; }316 _LIBCPP_HIDE_FROM_ABI void __pbump(streamsize __n) { __nout_ += __n; }
295317
296 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void setp(char_type* __pbeg, char_type* __pend) {318 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 void setp(char_type* __pbeg, char_type* __pend) {
297 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__pbeg, __pend), "[pbeg, pend) must be a valid range");319 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__pbeg, __pend), "[pbeg, pend) must be a valid range");
298 __bout_ = __nout_ = __pbeg;320 __bout_ = __nout_ = __pbeg;
299 __eout_ = __pend;321 __eout_ = __pend;
...@@ -317,6 +339,9 @@ protected:...@@ -317,6 +339,9 @@ protected:
317 virtual streamsize showmanyc() { return 0; }339 virtual streamsize showmanyc() { return 0; }
318340
319 virtual streamsize xsgetn(char_type* __s, streamsize __n) {341 virtual streamsize xsgetn(char_type* __s, streamsize __n) {
342 __check_invariants();
343 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
344
320 int_type __c;345 int_type __c;
321 streamsize __i = 0;346 streamsize __i = 0;
322 while (__i < __n) {347 while (__i < __n) {
...@@ -338,6 +363,9 @@ protected:...@@ -338,6 +363,9 @@ protected:
338363
339 virtual int_type underflow() { return traits_type::eof(); }364 virtual int_type underflow() { return traits_type::eof(); }
340 virtual int_type uflow() {365 virtual int_type uflow() {
366 __check_invariants();
367 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
368
341 if (underflow() == traits_type::eof())369 if (underflow() == traits_type::eof())
342 return traits_type::eof();370 return traits_type::eof();
343 int_type __c = traits_type::to_int_type(*gptr());371 int_type __c = traits_type::to_int_type(*gptr());
...@@ -350,6 +378,9 @@ protected:...@@ -350,6 +378,9 @@ protected:
350378
351 // 27.6.2.4.5 Put area:379 // 27.6.2.4.5 Put area:
352 virtual streamsize xsputn(const char_type* __s, streamsize __n) {380 virtual streamsize xsputn(const char_type* __s, streamsize __n) {
381 __check_invariants();
382 auto __guard = std::__make_scope_guard([this] { this->__check_invariants(); });
383
353 streamsize __i = 0;384 streamsize __i = 0;
354 while (__i < __n) {385 while (__i < __n) {
355 if (pptr() >= epptr()) {386 if (pptr() >= epptr()) {
...@@ -370,6 +401,15 @@ protected:...@@ -370,6 +401,15 @@ protected:
370401
371 virtual int_type overflow(int_type = traits_type::eof()) { return traits_type::eof(); }402 virtual int_type overflow(int_type = traits_type::eof()) { return traits_type::eof(); }
372403
404 // This function checks some invariants of the class (it isn't exhaustive).
405 _LIBCPP_HIDE_FROM_ABI void __check_invariants() const {
406 _LIBCPP_ASSERT_INTERNAL(pbase() <= pptr(), "this is an invariant of the class");
407 _LIBCPP_ASSERT_INTERNAL(pptr() <= epptr(), "this is an invariant of the class");
408
409 _LIBCPP_ASSERT_INTERNAL(eback() <= gptr(), "this is an invariant of the class");
410 _LIBCPP_ASSERT_INTERNAL(gptr() <= egptr(), "this is an invariant of the class");
411 }
412
373private:413private:
374 locale __loc_;414 locale __loc_;
375 char_type* __binp_ = nullptr;415 char_type* __binp_ = nullptr;
lib/libcxx/include/string+574-573
...@@ -280,6 +280,8 @@ public:...@@ -280,6 +280,8 @@ public:
280 basic_string substr(size_type pos = 0, size_type n = npos) const; // constexpr in C++20, removed in C++23280 basic_string substr(size_type pos = 0, size_type n = npos) const; // constexpr in C++20, removed in C++23
281 basic_string substr(size_type pos = 0, size_type n = npos) const&; // since C++23281 basic_string substr(size_type pos = 0, size_type n = npos) const&; // since C++23
282 constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&; // since C++23282 constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&; // since C++23
283 constexpr basic_string_view<charT, traits> subview(size_type pos = 0,
284 size_type n = npos) const; // since C++26
283 void swap(basic_string& str)285 void swap(basic_string& str)
284 noexcept(allocator_traits<allocator_type>::propagate_on_container_swap::value ||286 noexcept(allocator_traits<allocator_type>::propagate_on_container_swap::value ||
285 allocator_traits<allocator_type>::is_always_equal::value); // C++17, constexpr since C++20287 allocator_traits<allocator_type>::is_always_equal::value); // C++17, constexpr since C++20
...@@ -598,9 +600,9 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -598,9 +600,9 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
598# include <__debug_utils/sanitizers.h>600# include <__debug_utils/sanitizers.h>
599# include <__format/enable_insertable.h>601# include <__format/enable_insertable.h>
600# include <__functional/hash.h>602# include <__functional/hash.h>
603# include <__functional/is_transparent.h>
601# include <__functional/unary_function.h>604# include <__functional/unary_function.h>
602# include <__fwd/string.h>605# include <__fwd/string.h>
603# include <__ios/fpos.h>
604# include <__iterator/bounded_iter.h>606# include <__iterator/bounded_iter.h>
605# include <__iterator/distance.h>607# include <__iterator/distance.h>
606# include <__iterator/iterator_traits.h>608# include <__iterator/iterator_traits.h>
...@@ -620,7 +622,6 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -620,7 +622,6 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
620# include <__ranges/concepts.h>622# include <__ranges/concepts.h>
621# include <__ranges/container_compatible_range.h>623# include <__ranges/container_compatible_range.h>
622# include <__ranges/from_range.h>624# include <__ranges/from_range.h>
623# include <__ranges/size.h>
624# include <__string/char_traits.h>625# include <__string/char_traits.h>
625# include <__string/extern_template_lists.h>626# include <__string/extern_template_lists.h>
626# include <__type_traits/conditional.h>627# include <__type_traits/conditional.h>
...@@ -628,24 +629,23 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -628,24 +629,23 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
628# include <__type_traits/is_allocator.h>629# include <__type_traits/is_allocator.h>
629# include <__type_traits/is_array.h>630# include <__type_traits/is_array.h>
630# include <__type_traits/is_convertible.h>631# include <__type_traits/is_convertible.h>
632# include <__type_traits/is_generic_transparent_comparator.h>
631# include <__type_traits/is_nothrow_assignable.h>633# include <__type_traits/is_nothrow_assignable.h>
632# include <__type_traits/is_nothrow_constructible.h>634# include <__type_traits/is_nothrow_constructible.h>
633# include <__type_traits/is_replaceable.h>
634# include <__type_traits/is_same.h>635# include <__type_traits/is_same.h>
635# include <__type_traits/is_standard_layout.h>636# include <__type_traits/is_standard_layout.h>
636# include <__type_traits/is_trivially_constructible.h>637# include <__type_traits/is_trivially_constructible.h>
637# include <__type_traits/is_trivially_copyable.h>638# include <__type_traits/is_trivially_copyable.h>
638# include <__type_traits/is_trivially_relocatable.h>639# include <__type_traits/is_trivially_relocatable.h>
639# include <__type_traits/remove_cvref.h>640# include <__type_traits/remove_cvref.h>
640# include <__type_traits/void_t.h>641# include <__utility/default_three_way_comparator.h>
641# include <__utility/auto_cast.h>642# include <__utility/exception_guard.h>
642# include <__utility/declval.h>
643# include <__utility/forward.h>643# include <__utility/forward.h>
644# include <__utility/is_pointer_in_range.h>644# include <__utility/is_pointer_in_range.h>
645# include <__utility/move.h>645# include <__utility/move.h>
646# include <__utility/no_destroy.h>
646# include <__utility/scope_guard.h>647# include <__utility/scope_guard.h>
647# include <__utility/swap.h>648# include <__utility/swap.h>
648# include <__utility/unreachable.h>
649# include <climits>649# include <climits>
650# include <cstdio> // EOF650# include <cstdio> // EOF
651# include <cstring>651# include <cstring>
...@@ -700,18 +700,18 @@ __concatenate_strings(const _Allocator& __alloc,...@@ -700,18 +700,18 @@ __concatenate_strings(const _Allocator& __alloc,
700 __type_identity_t<basic_string_view<_CharT, _Traits> > __str2);700 __type_identity_t<basic_string_view<_CharT, _Traits> > __str2);
701701
702template <class _Iter>702template <class _Iter>
703struct __string_is_trivial_iterator : public false_type {};703inline const bool __string_is_trivial_iterator_v = false;
704704
705template <class _Tp>705template <class _Tp>
706struct __string_is_trivial_iterator<_Tp*> : public is_arithmetic<_Tp> {};706inline const bool __string_is_trivial_iterator_v<_Tp*> = is_arithmetic<_Tp>::value;
707707
708template <class _Iter>708template <class _Iter>
709struct __string_is_trivial_iterator<__wrap_iter<_Iter> > : public __string_is_trivial_iterator<_Iter> {};709inline const bool __string_is_trivial_iterator_v<__wrap_iter<_Iter> > = __string_is_trivial_iterator_v<_Iter>;
710710
711template <class _CharT, class _Traits, class _Tp>711template <class _CharT, class _Traits, class _Tp>
712struct __can_be_converted_to_string_view712inline const bool __can_be_converted_to_string_view_v =
713 : public _BoolConstant< is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&713 is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
714 !is_convertible<const _Tp&, const _CharT*>::value > {};714 !is_convertible<const _Tp&, const _CharT*>::value;
715715
716struct __uninitialized_size_tag {};716struct __uninitialized_size_tag {};
717struct __init_with_sentinel_tag {};717struct __init_with_sentinel_tag {};
...@@ -756,20 +756,13 @@ public:...@@ -756,20 +756,13 @@ public:
756 // external memory. In such cases, the destructor is responsible for unpoisoning756 // external memory. In such cases, the destructor is responsible for unpoisoning
757 // the memory to avoid triggering false positives.757 // the memory to avoid triggering false positives.
758 // Therefore it's crucial to ensure the destructor is called.758 // Therefore it's crucial to ensure the destructor is called.
759 //759 using __trivially_relocatable _LIBCPP_NODEBUG = void;
760 // However, it is replaceable since implementing move-assignment as a destroy + move-construct
761 // will maintain the right ASAN state.
762 using __trivially_relocatable = void;
763# else760# else
764 using __trivially_relocatable _LIBCPP_NODEBUG = __conditional_t<761 using __trivially_relocatable _LIBCPP_NODEBUG = __conditional_t<
765 __libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value,762 __libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value,
766 basic_string,763 basic_string,
767 void>;764 void>;
768# endif765# endif
769 using __replaceable _LIBCPP_NODEBUG =
770 __conditional_t<__is_replaceable_v<pointer> && __container_allocator_is_replaceable<__alloc_traits>::value,
771 basic_string,
772 void>;
773766
774# if __has_feature(address_sanitizer) && _LIBCPP_INSTRUMENTED_WITH_ASAN767# if __has_feature(address_sanitizer) && _LIBCPP_INSTRUMENTED_WITH_ASAN
775 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __asan_volatile_wrapper(pointer const& __ptr) const {768 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __asan_volatile_wrapper(pointer const& __ptr) const {
...@@ -819,12 +812,21 @@ public:...@@ -819,12 +812,21 @@ public:
819 using reverse_iterator = std::reverse_iterator<iterator>;812 using reverse_iterator = std::reverse_iterator<iterator>;
820 using const_reverse_iterator = std::reverse_iterator<const_iterator>;813 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
821814
815 using __alloc_result _LIBCPP_NODEBUG = __allocation_result<pointer, size_type>;
816
822private:817private:
823 static_assert(CHAR_BIT == 8, "This implementation assumes that one byte contains 8 bits");818 static_assert(CHAR_BIT == 8, "This implementation assumes that one byte contains 8 bits");
824819
825# ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT820# ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
826821
827 struct __long {822 struct __long {
823 __long() = default;
824
825 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __long(__alloc_result __alloc, size_type __size)
826 : __data_(__alloc.ptr), __size_(__size), __cap_(__alloc.count / __endian_factor), __is_long_(true) {
827 _LIBCPP_ASSERT_INTERNAL(!__fits_in_sso(__alloc.count), "Long capacity should always be larger than the SSO");
828 }
829
828 pointer __data_;830 pointer __data_;
829 size_type __size_;831 size_type __size_;
830 size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;832 size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;
...@@ -872,6 +874,13 @@ private:...@@ -872,6 +874,13 @@ private:
872 // some platforms bit fields have a default size rather than the actual874 // some platforms bit fields have a default size rather than the actual
873 // size used, e.g., it is 4 bytes on AIX. See D128285 for details.875 // size used, e.g., it is 4 bytes on AIX. See D128285 for details.
874 struct __long {876 struct __long {
877 __long() = default;
878
879 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __long(__alloc_result __alloc, size_type __size)
880 : __is_long_(true), __cap_(__alloc.count / __endian_factor), __size_(__size), __data_(__alloc.ptr) {
881 _LIBCPP_ASSERT_INTERNAL(!__fits_in_sso(__alloc.count), "Long capacity should always be larger than the SSO");
882 }
883
875 struct _LIBCPP_PACKED {884 struct _LIBCPP_PACKED {
876 size_type __is_long_ : 1;885 size_type __is_long_ : 1;
877 size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;886 size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;
...@@ -898,6 +907,11 @@ private:...@@ -898,6 +907,11 @@ private:
898 union __rep {907 union __rep {
899 __short __s;908 __short __s;
900 __long __l;909 __long __l;
910
911 __rep() = default;
912 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __rep(__short __r) : __s(__r) {}
913 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __rep(__long __r) : __l(__r) {}
914 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __rep(__uninitialized_tag) {}
901 };915 };
902916
903 _LIBCPP_COMPRESSED_PAIR(__rep, __rep_, allocator_type, __alloc_);917 _LIBCPP_COMPRESSED_PAIR(__rep, __rep_, allocator_type, __alloc_);
...@@ -917,20 +931,7 @@ private:...@@ -917,20 +931,7 @@ private:
917 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(931 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
918 __uninitialized_size_tag, size_type __size, const allocator_type& __a)932 __uninitialized_size_tag, size_type __size, const allocator_type& __a)
919 : __alloc_(__a) {933 : __alloc_(__a) {
920 if (__size > max_size())934 __init_internal_buffer(__size);
921 this->__throw_length_error();
922 if (__fits_in_sso(__size)) {
923 __rep_ = __rep();
924 __set_short_size(__size);
925 } else {
926 auto __capacity = __recommend(__size) + 1;
927 auto __allocation = __alloc_traits::allocate(__alloc_, __capacity);
928 __begin_lifetime(__allocation, __capacity);
929 __set_long_cap(__capacity);
930 __set_long_pointer(__allocation);
931 __set_long_size(__size);
932 }
933 __annotate_new(__size);
934 }935 }
935936
936 template <class _Iter, class _Sent>937 template <class _Iter, class _Sent>
...@@ -966,7 +967,7 @@ private:...@@ -966,7 +967,7 @@ private:
966 std::__wrap_iter<const_pointer>(__get_pointer() + size()));967 std::__wrap_iter<const_pointer>(__get_pointer() + size()));
967# else968# else
968 return const_iterator(__p);969 return const_iterator(__p);
969# endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING970# endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING
970 }971 }
971972
972public:973public:
...@@ -1057,13 +1058,13 @@ public:...@@ -1057,13 +1058,13 @@ public:
1057 }1058 }
1058# endif // _LIBCPP_CXX03_LANG1059# endif // _LIBCPP_CXX03_LANG
10591060
1060 template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>1061 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
1061 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) {1062 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) {
1062 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*) detected nullptr");1063 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*) detected nullptr");
1063 __init(__s, traits_type::length(__s));1064 __init(__s, traits_type::length(__s));
1064 }1065 }
10651066
1066 template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>1067 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
1067 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX201068 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1068 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a)1069 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a)
1069 : __alloc_(__a) {1070 : __alloc_(__a) {
...@@ -1075,13 +1076,15 @@ public:...@@ -1075,13 +1076,15 @@ public:
1075 basic_string(nullptr_t) = delete;1076 basic_string(nullptr_t) = delete;
1076# endif1077# endif
10771078
1078 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n) {1079 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n)
1080 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1079 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");1081 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
1080 __init(__s, __n);1082 __init(__s, __n);
1081 }1083 }
10821084
1083 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX201085 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1084 basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)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")
1085 : __alloc_(__a) {1088 : __alloc_(__a) {
1086 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");1089 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
1087 __init(__s, __n);1090 __init(__s, __n);
...@@ -1110,7 +1113,7 @@ public:...@@ -1110,7 +1113,7 @@ public:
1110 }1113 }
1111# endif1114# endif
11121115
1113 template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>1116 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
1114 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)1117 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)
1115 : __alloc_(__a) {1118 : __alloc_(__a) {
1116 __init(__n, __c);1119 __init(__n, __c);
...@@ -1135,7 +1138,7 @@ public:...@@ -1135,7 +1138,7 @@ public:
1135 }1138 }
11361139
1137 template <class _Tp,1140 template <class _Tp,
1138 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1141 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1139 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1142 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1140 int> = 0>1143 int> = 0>
1141 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX201144 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
...@@ -1147,7 +1150,7 @@ public:...@@ -1147,7 +1150,7 @@ public:
1147 }1150 }
11481151
1149 template <class _Tp,1152 template <class _Tp,
1150 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1153 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1151 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1154 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1152 int> = 0>1155 int> = 0>
1153 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {1156 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {
...@@ -1156,7 +1159,7 @@ public:...@@ -1156,7 +1159,7 @@ public:
1156 }1159 }
11571160
1158 template <class _Tp,1161 template <class _Tp,
1159 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1162 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1160 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1163 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1161 int> = 0>1164 int> = 0>
1162 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a)1165 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a)
...@@ -1201,11 +1204,10 @@ public:...@@ -1201,11 +1204,10 @@ public:
1201 }1204 }
1202# endif // _LIBCPP_CXX03_LANG1205# endif // _LIBCPP_CXX03_LANG
12031206
1204 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() {1207 // TODO(boomanaiden154): Once we mark this in destructors as dead on return,
1205 __annotate_delete();1208 // we can use a normal call to __reset_internal_buffer and remove the extra
1206 if (__is_long())1209 // __rep constructor.
1207 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());1210 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() { __reset_internal_buffer(__rep(__uninitialized_tag())); }
1208 }
12091211
1210 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {1212 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
1211 return __self_view(typename __self_view::__assume_valid(), data(), size());1213 return __self_view(typename __self_view::__assume_valid(), data(), size());
...@@ -1215,7 +1217,7 @@ public:...@@ -1215,7 +1217,7 @@ public:
1215 operator=(const basic_string& __str);1217 operator=(const basic_string& __str);
12161218
1217 template <class _Tp,1219 template <class _Tp,
1218 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1220 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1219 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1221 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1220 int> = 0>1222 int> = 0>
1221 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const _Tp& __t) {1223 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const _Tp& __t) {
...@@ -1243,45 +1245,55 @@ public:...@@ -1243,45 +1245,55 @@ public:
1243# endif1245# endif
1244 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c);1246 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c);
12451247
1246 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT {1248 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT {
1247 return __make_iterator(__get_pointer());1249 return __make_iterator(__get_pointer());
1248 }1250 }
1249 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT {1251 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT {
1250 return __make_const_iterator(__get_pointer());1252 return __make_const_iterator(__get_pointer());
1251 }1253 }
1252 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT {1254 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT {
1253 return __make_iterator(__get_pointer() + size());1255 return __make_iterator(__get_pointer() + size());
1254 }1256 }
1255 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {1257 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {
1256 return __make_const_iterator(__get_pointer() + size());1258 return __make_const_iterator(__get_pointer() + size());
1257 }1259 }
12581260
1259 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rbegin() _NOEXCEPT {1261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rbegin() _NOEXCEPT {
1260 return reverse_iterator(end());1262 return reverse_iterator(end());
1261 }1263 }
1262 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator rbegin() const _NOEXCEPT {1264 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator
1265 rbegin() const _NOEXCEPT {
1263 return const_reverse_iterator(end());1266 return const_reverse_iterator(end());
1264 }1267 }
1265 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rend() _NOEXCEPT {1268 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rend() _NOEXCEPT {
1266 return reverse_iterator(begin());1269 return reverse_iterator(begin());
1267 }1270 }
1268 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator rend() const _NOEXCEPT {1271 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator rend() const _NOEXCEPT {
1269 return const_reverse_iterator(begin());1272 return const_reverse_iterator(begin());
1270 }1273 }
12711274
1272 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT { return begin(); }1275 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT {
1273 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT { return end(); }1276 return begin();
1274 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crbegin() const _NOEXCEPT {1277 }
1278 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT {
1279 return end();
1280 }
1281 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator
1282 crbegin() const _NOEXCEPT {
1275 return rbegin();1283 return rbegin();
1276 }1284 }
1277 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1285 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT {
1286 return rend();
1287 }
12781288
1279 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT {1289 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT {
1280 return __is_long() ? __get_long_size() : __get_short_size();1290 return __is_long() ? __get_long_size() : __get_short_size();
1281 }1291 }
1282 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type length() const _NOEXCEPT { return size(); }1292 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type length() const _NOEXCEPT {
1293 return size();
1294 }
12831295
1284 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type max_size() const _NOEXCEPT {1296 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type max_size() const _NOEXCEPT {
1285 if (size_type __m = __alloc_traits::max_size(__alloc_); __m <= std::numeric_limits<size_type>::max() / 2) {1297 if (size_type __m = __alloc_traits::max_size(__alloc_); __m <= std::numeric_limits<size_type>::max() / 2) {
1286 size_type __res = __m - __alignment;1298 size_type __res = __m - __alignment;
12871299
...@@ -1299,7 +1311,7 @@ public:...@@ -1299,7 +1311,7 @@ public:
1299 }1311 }
1300 }1312 }
13011313
1302 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type capacity() const _NOEXCEPT {1314 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type capacity() const _NOEXCEPT {
1303 return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1;1315 return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1;
1304 }1316 }
13051317
...@@ -1311,13 +1323,19 @@ public:...@@ -1311,13 +1323,19 @@ public:
1311# if _LIBCPP_STD_VER >= 231323# if _LIBCPP_STD_VER >= 23
1312 template <class _Op>1324 template <class _Op>
1313 _LIBCPP_HIDE_FROM_ABI constexpr void resize_and_overwrite(size_type __n, _Op __op) {1325 _LIBCPP_HIDE_FROM_ABI constexpr void resize_and_overwrite(size_type __n, _Op __op) {
1314 __resize_default_init(__n);1326 using __result_type = decltype(std::move(__op)(data(), auto(__n)));
1315 __erase_to_end(std::move(__op)(data(), _LIBCPP_AUTO_CAST(__n)));1327 static_assert(__integer_like<__result_type>, "Operation return type must be integer-like");
1328 size_type __sz = size();
1329 size_type __cap = capacity();
1330 if (__n > __cap)
1331 __grow_by_without_replace(__cap, __n - __cap, __sz, __sz, 0);
1332 __annotate_delete();
1333 __set_size(__n);
1334 __annotate_new(__n);
1335 __erase_to_end(std::move(__op)(data(), auto(__n)));
1316 }1336 }
1317# endif1337# endif
13181338
1319 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __resize_default_init(size_type __n);
1320
1321# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRING_RESERVE)1339# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRING_RESERVE)
1322 _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve() _NOEXCEPT { shrink_to_fit(); }1340 _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve() _NOEXCEPT { shrink_to_fit(); }
1323# endif1341# endif
...@@ -1328,7 +1346,8 @@ public:...@@ -1328,7 +1346,8 @@ public:
1328 return size() == 0;1346 return size() == 0;
1329 }1347 }
13301348
1331 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __pos) const _NOEXCEPT {1349 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference
1350 operator[](size_type __pos) const _NOEXCEPT {
1332 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");1351 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
1333 if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {1352 if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {
1334 return *(__get_long_pointer() + __pos);1353 return *(__get_long_pointer() + __pos);
...@@ -1336,7 +1355,8 @@ public:...@@ -1336,7 +1355,8 @@ public:
1336 return *(data() + __pos);1355 return *(data() + __pos);
1337 }1356 }
13381357
1339 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT {1358 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference
1359 operator[](size_type __pos) _NOEXCEPT {
1340 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");1360 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
1341 if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {1361 if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {
1342 return *(__get_long_pointer() + __pos);1362 return *(__get_long_pointer() + __pos);
...@@ -1344,15 +1364,15 @@ public:...@@ -1344,15 +1364,15 @@ public:
1344 return *(__get_pointer() + __pos);1364 return *(__get_pointer() + __pos);
1345 }1365 }
13461366
1347 _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference at(size_type __n) const;1367 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference at(size_type __n) const;
1348 _LIBCPP_CONSTEXPR_SINCE_CXX20 reference at(size_type __n);1368 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 reference at(size_type __n);
13491369
1350 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const basic_string& __str) {1370 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const basic_string& __str) {
1351 return append(__str);1371 return append(__str);
1352 }1372 }
13531373
1354 template <class _Tp,1374 template <class _Tp,
1355 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1375 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1356 !is_same<__remove_cvref_t<_Tp>, basic_string >::value,1376 !is_same<__remove_cvref_t<_Tp>, basic_string >::value,
1357 int> = 0>1377 int> = 0>
1358 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const _Tp& __t) {1378 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const _Tp& __t) {
...@@ -1381,7 +1401,7 @@ public:...@@ -1381,7 +1401,7 @@ public:
1381 }1401 }
13821402
1383 template <class _Tp,1403 template <class _Tp,
1384 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1404 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1385 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1405 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1386 int> = 0>1406 int> = 0>
1387 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const _Tp& __t) {1407 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const _Tp& __t) {
...@@ -1392,7 +1412,7 @@ public:...@@ -1392,7 +1412,7 @@ public:
1392 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const basic_string& __str, size_type __pos, size_type __n = npos);1412 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const basic_string& __str, size_type __pos, size_type __n = npos);
13931413
1394 template <class _Tp,1414 template <class _Tp,
1395 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1415 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1396 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1416 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1397 int> = 0>1417 int> = 0>
1398 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1418 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
...@@ -1404,12 +1424,11 @@ public:...@@ -1404,12 +1424,11 @@ public:
1404 return append(__sv.data() + __pos, std::min(__n, __sz - __pos));1424 return append(__sv.data() + __pos, std::min(__n, __sz - __pos));
1405 }1425 }
14061426
1407 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n);1427 _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");
1408 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);1429 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
1409 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);1430 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);
14101431
1411 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append_default_init(size_type __n);
1412
1413 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>1432 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
1414 _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1433 _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1415 append(_InputIterator __first, _InputIterator __last) {1434 append(_InputIterator __first, _InputIterator __last) {
...@@ -1424,20 +1443,21 @@ public:...@@ -1424,20 +1443,21 @@ public:
1424 size_type __sz = size();1443 size_type __sz = size();
1425 size_type __cap = capacity();1444 size_type __cap = capacity();
1426 size_type __n = static_cast<size_type>(std::distance(__first, __last));1445 size_type __n = static_cast<size_type>(std::distance(__first, __last));
1427 if (__n) {1446 if (__n == 0)
1428 if (__string_is_trivial_iterator<_ForwardIterator>::value && !__addr_in_range(*__first)) {1447 return *this;
1429 if (__cap - __sz < __n)1448
1430 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);1449 if (__string_is_trivial_iterator_v<_ForwardIterator> && !__addr_in_range(*__first)) {
1431 __annotate_increase(__n);1450 if (__cap - __sz < __n)
1432 auto __end = __copy_non_overlapping_range(__first, __last, std::__to_address(__get_pointer() + __sz));1451 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
1433 traits_type::assign(*__end, value_type());1452 __annotate_increase(__n);
1434 __set_size(__sz + __n);1453 auto __end = __copy_non_overlapping_range(__first, __last, std::__to_address(__get_pointer() + __sz));
1435 } else {1454 traits_type::assign(*__end, value_type());
1436 const basic_string __temp(__first, __last, __alloc_);1455 __set_size(__sz + __n);
1437 append(__temp.data(), __temp.size());1456 return *this;
1438 }1457 } else {
1458 const basic_string __temp(__first, __last, __alloc_);
1459 return append(__temp.data(), __temp.size());
1439 }1460 }
1440 return *this;
1441 }1461 }
14421462
1443# if _LIBCPP_STD_VER >= 231463# if _LIBCPP_STD_VER >= 23
...@@ -1457,27 +1477,27 @@ public:...@@ -1457,27 +1477,27 @@ public:
1457 _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(value_type __c);1477 _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(value_type __c);
1458 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back();1478 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back();
14591479
1460 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _NOEXCEPT {1480 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _NOEXCEPT {
1461 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");1481 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");
1462 return *__get_pointer();1482 return *__get_pointer();
1463 }1483 }
14641484
1465 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _NOEXCEPT {1485 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _NOEXCEPT {
1466 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");1486 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");
1467 return *data();1487 return *data();
1468 }1488 }
14691489
1470 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _NOEXCEPT {1490 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _NOEXCEPT {
1471 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");1491 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");
1472 return *(__get_pointer() + size() - 1);1492 return *(__get_pointer() + size() - 1);
1473 }1493 }
14741494
1475 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _NOEXCEPT {1495 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _NOEXCEPT {
1476 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");1496 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");
1477 return *(data() + size() - 1);1497 return *(data() + size() - 1);
1478 }1498 }
14791499
1480 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1500 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1481 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const _Tp& __t) {1501 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const _Tp& __t) {
1482 __self_view __sv = __t;1502 __self_view __sv = __t;
1483 return assign(__sv.data(), __sv.size());1503 return assign(__sv.data(), __sv.size());
...@@ -1519,7 +1539,7 @@ public:...@@ -1519,7 +1539,7 @@ public:
1519 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n = npos);1539 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n = npos);
15201540
1521 template <class _Tp,1541 template <class _Tp,
1522 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1542 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1523 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1543 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1524 int> = 0>1544 int> = 0>
1525 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1545 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
...@@ -1531,8 +1551,9 @@ public:...@@ -1531,8 +1551,9 @@ public:
1531 return assign(__sv.data() + __pos, std::min(__n, __sz - __pos));1551 return assign(__sv.data() + __pos, std::min(__n, __sz - __pos));
1532 }1552 }
15331553
1534 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n);1554 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n)
1535 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s);1555 _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);
1536 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c);1557 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c);
15371558
1538 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>1559 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
...@@ -1545,7 +1566,7 @@ public:...@@ -1545,7 +1566,7 @@ public:
1545 template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>1566 template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
1546 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1567 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1547 assign(_ForwardIterator __first, _ForwardIterator __last) {1568 assign(_ForwardIterator __first, _ForwardIterator __last) {
1548 if (__string_is_trivial_iterator<_ForwardIterator>::value) {1569 if (__string_is_trivial_iterator_v<_ForwardIterator>) {
1549 size_type __n = static_cast<size_type>(std::distance(__first, __last));1570 size_type __n = static_cast<size_type>(std::distance(__first, __last));
1550 __assign_trivial(__first, __last, __n);1571 __assign_trivial(__first, __last, __n);
1551 } else {1572 } else {
...@@ -1558,7 +1579,7 @@ public:...@@ -1558,7 +1579,7 @@ public:
1558# if _LIBCPP_STD_VER >= 231579# if _LIBCPP_STD_VER >= 23
1559 template <_ContainerCompatibleRange<_CharT> _Range>1580 template <_ContainerCompatibleRange<_CharT> _Range>
1560 _LIBCPP_HIDE_FROM_ABI constexpr basic_string& assign_range(_Range&& __range) {1581 _LIBCPP_HIDE_FROM_ABI constexpr basic_string& assign_range(_Range&& __range) {
1561 if constexpr (__string_is_trivial_iterator<ranges::iterator_t<_Range>>::value &&1582 if constexpr (__string_is_trivial_iterator_v<ranges::iterator_t<_Range>> &&
1562 (ranges::forward_range<_Range> || ranges::sized_range<_Range>)) {1583 (ranges::forward_range<_Range> || ranges::sized_range<_Range>)) {
1563 size_type __n = static_cast<size_type>(ranges::distance(__range));1584 size_type __n = static_cast<size_type>(ranges::distance(__range));
1564 __assign_trivial(ranges::begin(__range), ranges::end(__range), __n);1585 __assign_trivial(ranges::begin(__range), ranges::end(__range), __n);
...@@ -1582,14 +1603,14 @@ public:...@@ -1582,14 +1603,14 @@ public:
1582 return insert(__pos1, __str.data(), __str.size());1603 return insert(__pos1, __str.data(), __str.size());
1583 }1604 }
15841605
1585 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1606 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1586 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos1, const _Tp& __t) {1607 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos1, const _Tp& __t) {
1587 __self_view __sv = __t;1608 __self_view __sv = __t;
1588 return insert(__pos1, __sv.data(), __sv.size());1609 return insert(__pos1, __sv.data(), __sv.size());
1589 }1610 }
15901611
1591 template <class _Tp,1612 template <class _Tp,
1592 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1613 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1593 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1614 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1594 int> = 0>1615 int> = 0>
1595 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1616 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
...@@ -1603,7 +1624,8 @@ public:...@@ -1603,7 +1624,8 @@ public:
16031624
1604 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1625 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1605 insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);1626 insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
1606 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);1627 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n)
1628 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");
1607 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);1629 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
1608 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);1630 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
1609 _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);1631 _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
...@@ -1659,7 +1681,7 @@ public:...@@ -1659,7 +1681,7 @@ public:
1659 return replace(__pos1, __n1, __str.data(), __str.size());1681 return replace(__pos1, __n1, __str.data(), __str.size());
1660 }1682 }
16611683
1662 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1684 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1663 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1685 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1664 replace(size_type __pos1, size_type __n1, const _Tp& __t) {1686 replace(size_type __pos1, size_type __n1, const _Tp& __t) {
1665 __self_view __sv = __t;1687 __self_view __sv = __t;
...@@ -1670,7 +1692,7 @@ public:...@@ -1670,7 +1692,7 @@ public:
1670 replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos);1692 replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos);
16711693
1672 template <class _Tp,1694 template <class _Tp,
1673 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&1695 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1674 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1696 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1675 int> = 0>1697 int> = 0>
1676 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1698 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
...@@ -1683,8 +1705,10 @@ public:...@@ -1683,8 +1705,10 @@ public:
1683 }1705 }
16841706
1685 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1707 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1686 replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);1708 replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2)
1687 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);1709 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n2 != 0 && __s == nullptr, " if n2 is not zero");
1710 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1711 replace(size_type __pos, size_type __n1, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
1688 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);1712 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
16891713
1690 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1714 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
...@@ -1693,7 +1717,7 @@ public:...@@ -1693,7 +1717,7 @@ public:
1693 static_cast<size_type>(__i1 - begin()), static_cast<size_type>(__i2 - __i1), __str.data(), __str.size());1717 static_cast<size_type>(__i1 - begin()), static_cast<size_type>(__i2 - __i1), __str.data(), __str.size());
1694 }1718 }
16951719
1696 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1720 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1697 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&1721 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1698 replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) {1722 replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) {
1699 __self_view __sv = __t;1723 __self_view __sv = __t;
...@@ -1741,19 +1765,24 @@ public:...@@ -1741,19 +1765,24 @@ public:
1741 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;1765 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
17421766
1743# if _LIBCPP_STD_VER <= 201767# if _LIBCPP_STD_VER <= 20
1744 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string1768 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
1745 substr(size_type __pos = 0, size_type __n = npos) const {1769 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string substr(size_type __pos = 0, size_type __n = npos) const {
1746 return basic_string(*this, __pos, __n);1770 return basic_string(*this, __pos, __n);
1747 }1771 }
1748# else1772# else
1749 _LIBCPP_HIDE_FROM_ABI constexpr basic_string substr(size_type __pos = 0, size_type __n = npos) const& {1773 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr basic_string substr(size_type __pos = 0, size_type __n = npos) const& {
1750 return basic_string(*this, __pos, __n);1774 return basic_string(*this, __pos, __n);
1751 }1775 }
17521776
1753 _LIBCPP_HIDE_FROM_ABI constexpr basic_string substr(size_type __pos = 0, size_type __n = npos) && {1777 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr basic_string substr(size_type __pos = 0, size_type __n = npos) && {
1754 return basic_string(std::move(*this), __pos, __n);1778 return basic_string(std::move(*this), __pos, __n);
1755 }1779 }
1756# endif1780# endif
1781# if _LIBCPP_STD_VER >= 26
1782 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __self_view subview(size_type __pos = 0, size_type __n = npos) const {
1783 return __self_view(*this).subview(__pos, __n);
1784 }
1785# endif
17571786
1758 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(basic_string& __str)1787 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(basic_string& __str)
1759# if _LIBCPP_STD_VER >= 141788# if _LIBCPP_STD_VER >= 14
...@@ -1765,225 +1794,238 @@ public:...@@ -1765,225 +1794,238 @@ public:
1765 // [string.ops]1794 // [string.ops]
1766 // ------------1795 // ------------
17671796
1768 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* c_str() const _NOEXCEPT { return data(); }1797 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* c_str() const _NOEXCEPT {
1769 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* data() const _NOEXCEPT {1798 return data();
1799 }
1800
1801 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* data() const _NOEXCEPT {
1770 return std::__to_address(__get_pointer());1802 return std::__to_address(__get_pointer());
1771 }1803 }
1772# if _LIBCPP_STD_VER >= 171804# if _LIBCPP_STD_VER >= 17
1773 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 value_type* data() _NOEXCEPT {1805 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 value_type* data() _NOEXCEPT {
1774 return std::__to_address(__get_pointer());1806 return std::__to_address(__get_pointer());
1775 }1807 }
1776# endif1808# endif
17771809
1778 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {1810 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {
1779 return __alloc_;1811 return __alloc_;
1780 }1812 }
17811813
1782 // find1814 // find
17831815
1784 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1816 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1785 find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {1817 find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {
1786 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __str.data(), __pos, __str.size());1818 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __str.data(), __pos, __str.size());
1787 }1819 }
17881820
1789 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1821 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1790 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1822 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1791 find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {1823 find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {
1792 __self_view __sv = __t;1824 __self_view __sv = __t;
1793 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __sv.data(), __pos, __sv.size());1825 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __sv.data(), __pos, __sv.size());
1794 }1826 }
17951827
1796 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT {1828 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1829 find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT
1830 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1797 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find(): received nullptr");1831 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find(): received nullptr");
1798 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);1832 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
1799 }1833 }
18001834
1801 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1835 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1802 find(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {1836 find(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
1803 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find(): received nullptr");1837 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find(): received nullptr");
1804 return std::__str_find<value_type, size_type, traits_type, npos>(1838 return std::__str_find<value_type, size_type, traits_type, npos>(
1805 data(), size(), __s, __pos, traits_type::length(__s));1839 data(), size(), __s, __pos, traits_type::length(__s));
1806 }1840 }
18071841
1808 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT {1842 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT {
1809 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);1843 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
1810 }1844 }
18111845
1812 // rfind1846 // rfind
18131847
1814 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1848 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1815 rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {1849 rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {
1816 return std::__str_rfind<value_type, size_type, traits_type, npos>(1850 return std::__str_rfind<value_type, size_type, traits_type, npos>(
1817 data(), size(), __str.data(), __pos, __str.size());1851 data(), size(), __str.data(), __pos, __str.size());
1818 }1852 }
18191853
1820 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1854 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1821 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1855 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1822 rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {1856 rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {
1823 __self_view __sv = __t;1857 __self_view __sv = __t;
1824 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __sv.data(), __pos, __sv.size());1858 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __sv.data(), __pos, __sv.size());
1825 }1859 }
18261860
1827 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT {1861 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1862 rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT
1863 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1828 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");1864 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
1829 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);1865 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
1830 }1866 }
18311867
1832 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1868 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1833 rfind(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {1869 rfind(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
1834 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::rfind(): received nullptr");1870 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::rfind(): received nullptr");
1835 return std::__str_rfind<value_type, size_type, traits_type, npos>(1871 return std::__str_rfind<value_type, size_type, traits_type, npos>(
1836 data(), size(), __s, __pos, traits_type::length(__s));1872 data(), size(), __s, __pos, traits_type::length(__s));
1837 }1873 }
18381874
1839 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT {1875 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1876 rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT {
1840 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);1877 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
1841 }1878 }
18421879
1843 // find_first_of1880 // find_first_of
18441881
1845 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1882 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1846 find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {1883 find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {
1847 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(1884 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
1848 data(), size(), __str.data(), __pos, __str.size());1885 data(), size(), __str.data(), __pos, __str.size());
1849 }1886 }
18501887
1851 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1888 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1852 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1889 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1853 find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {1890 find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {
1854 __self_view __sv = __t;1891 __self_view __sv = __t;
1855 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(1892 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
1856 data(), size(), __sv.data(), __pos, __sv.size());1893 data(), size(), __sv.data(), __pos, __sv.size());
1857 }1894 }
18581895
1859 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1896 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1860 find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT {1897 find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT
1898 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1861 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");1899 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
1862 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);1900 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
1863 }1901 }
18641902
1865 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1903 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1866 find_first_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {1904 find_first_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
1867 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_of(): received nullptr");1905 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_of(): received nullptr");
1868 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(1906 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
1869 data(), size(), __s, __pos, traits_type::length(__s));1907 data(), size(), __s, __pos, traits_type::length(__s));
1870 }1908 }
18711909
1872 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1910 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1873 find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT {1911 find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT {
1874 return find(__c, __pos);1912 return find(__c, __pos);
1875 }1913 }
18761914
1877 // find_last_of1915 // find_last_of
18781916
1879 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1917 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1880 find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {1918 find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {
1881 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(1919 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
1882 data(), size(), __str.data(), __pos, __str.size());1920 data(), size(), __str.data(), __pos, __str.size());
1883 }1921 }
18841922
1885 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1923 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1886 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1924 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1887 find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {1925 find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {
1888 __self_view __sv = __t;1926 __self_view __sv = __t;
1889 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(1927 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
1890 data(), size(), __sv.data(), __pos, __sv.size());1928 data(), size(), __sv.data(), __pos, __sv.size());
1891 }1929 }
18921930
1893 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1931 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1894 find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT {1932 find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT
1933 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1895 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");1934 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
1896 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);1935 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
1897 }1936 }
18981937
1899 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1938 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1900 find_last_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {1939 find_last_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
1901 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_of(): received nullptr");1940 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_of(): received nullptr");
1902 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(1941 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
1903 data(), size(), __s, __pos, traits_type::length(__s));1942 data(), size(), __s, __pos, traits_type::length(__s));
1904 }1943 }
19051944
1906 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1945 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1907 find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT {1946 find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT {
1908 return rfind(__c, __pos);1947 return rfind(__c, __pos);
1909 }1948 }
19101949
1911 // find_first_not_of1950 // find_first_not_of
19121951
1913 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1952 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1914 find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {1953 find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {
1915 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(1954 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
1916 data(), size(), __str.data(), __pos, __str.size());1955 data(), size(), __str.data(), __pos, __str.size());
1917 }1956 }
19181957
1919 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1958 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1920 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1959 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1921 find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {1960 find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {
1922 __self_view __sv = __t;1961 __self_view __sv = __t;
1923 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(1962 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
1924 data(), size(), __sv.data(), __pos, __sv.size());1963 data(), size(), __sv.data(), __pos, __sv.size());
1925 }1964 }
19261965
1927 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1966 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1928 find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT {1967 find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT
1968 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1929 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");1969 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
1930 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);1970 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
1931 }1971 }
19321972
1933 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1973 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1934 find_first_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {1974 find_first_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
1935 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_not_of(): received nullptr");1975 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_not_of(): received nullptr");
1936 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(1976 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
1937 data(), size(), __s, __pos, traits_type::length(__s));1977 data(), size(), __s, __pos, traits_type::length(__s));
1938 }1978 }
19391979
1940 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1980 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1941 find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT {1981 find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT {
1942 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);1982 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
1943 }1983 }
19441984
1945 // find_last_not_of1985 // find_last_not_of
19461986
1947 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1987 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1948 find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {1988 find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {
1949 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(1989 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
1950 data(), size(), __str.data(), __pos, __str.size());1990 data(), size(), __str.data(), __pos, __str.size());
1951 }1991 }
19521992
1953 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>1993 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1954 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1994 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1955 find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {1995 find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {
1956 __self_view __sv = __t;1996 __self_view __sv = __t;
1957 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(1997 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
1958 data(), size(), __sv.data(), __pos, __sv.size());1998 data(), size(), __sv.data(), __pos, __sv.size());
1959 }1999 }
19602000
1961 _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type2001 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1962 find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT {2002 find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT
2003 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
1963 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");2004 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
1964 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);2005 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
1965 }2006 }
19662007
1967 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type2008 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1968 find_last_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {2009 find_last_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
1969 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_not_of(): received nullptr");2010 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_not_of(): received nullptr");
1970 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(2011 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
1971 data(), size(), __s, __pos, traits_type::length(__s));2012 data(), size(), __s, __pos, traits_type::length(__s));
1972 }2013 }
19732014
1974 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type2015 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1975 find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT {2016 find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT {
1976 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);2017 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
1977 }2018 }
19782019
1979 // compare2020 // compare
19802021
1981 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const basic_string& __str) const _NOEXCEPT {2022 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2023 compare(const basic_string& __str) const _NOEXCEPT {
1982 return compare(__self_view(__str));2024 return compare(__self_view(__str));
1983 }2025 }
19842026
1985 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>2027 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1986 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const _Tp& __t) const _NOEXCEPT {2028 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const _Tp& __t) const _NOEXCEPT {
1987 __self_view __sv = __t;2029 __self_view __sv = __t;
1988 size_t __lhs_sz = size();2030 size_t __lhs_sz = size();
1989 size_t __rhs_sz = __sv.size();2031 size_t __rhs_sz = __sv.size();
...@@ -1997,73 +2039,77 @@ public:...@@ -1997,73 +2039,77 @@ public:
1997 return 0;2039 return 0;
1998 }2040 }
19992041
2000 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>2042 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
2001 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int2043 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2002 compare(size_type __pos1, size_type __n1, const _Tp& __t) const {2044 compare(size_type __pos1, size_type __n1, const _Tp& __t) const {
2003 __self_view __sv = __t;2045 __self_view __sv = __t;
2004 return compare(__pos1, __n1, __sv.data(), __sv.size());2046 return compare(__pos1, __n1, __sv.data(), __sv.size());
2005 }2047 }
20062048
2007 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int2049 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2008 compare(size_type __pos1, size_type __n1, const basic_string& __str) const {2050 compare(size_type __pos1, size_type __n1, const basic_string& __str) const {
2009 return compare(__pos1, __n1, __str.data(), __str.size());2051 return compare(__pos1, __n1, __str.data(), __str.size());
2010 }2052 }
20112053
2012 _LIBCPP_CONSTEXPR_SINCE_CXX20 int2054 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2013 compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos) const {2055 compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos) const {
2014 return compare(__pos1, __n1, __self_view(__str), __pos2, __n2);2056 return compare(__pos1, __n1, __self_view(__str), __pos2, __n2);
2015 }2057 }
20162058
2017 template <class _Tp,2059 template <class _Tp,
2018 __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&2060 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
2019 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,2061 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
2020 int> = 0>2062 int> = 0>
2021 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int2063 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2022 compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) const {2064 compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) const {
2023 __self_view __sv = __t;2065 __self_view __sv = __t;
2024 return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));2066 return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
2025 }2067 }
20262068
2027 _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const _NOEXCEPT {2069 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2070 compare(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const _NOEXCEPT {
2028 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::compare(): received nullptr");2071 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::compare(): received nullptr");
2029 return compare(0, npos, __s, traits_type::length(__s));2072 return compare(0, npos, __s, traits_type::length(__s));
2030 }2073 }
20312074
2032 _LIBCPP_CONSTEXPR_SINCE_CXX20 int2075 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2033 compare(size_type __pos1, size_type __n1, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {2076 compare(size_type __pos1, size_type __n1, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
2034 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::compare(): received nullptr");2077 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::compare(): received nullptr");
2035 return compare(__pos1, __n1, __s, traits_type::length(__s));2078 return compare(__pos1, __n1, __s, traits_type::length(__s));
2036 }2079 }
20372080
2038 _LIBCPP_CONSTEXPR_SINCE_CXX20 int2081 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 int
2039 compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;2082 compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const
2083 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n2 != 0 && __s == nullptr, " if n2 is not zero");
20402084
2041 // starts_with2085 // starts_with
20422086
2043# if _LIBCPP_STD_VER >= 202087# if _LIBCPP_STD_VER >= 20
2044 constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(__self_view __sv) const noexcept {2088 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(__self_view __sv) const noexcept {
2045 return __self_view(typename __self_view::__assume_valid(), data(), size()).starts_with(__sv);2089 return __self_view(typename __self_view::__assume_valid(), data(), size()).starts_with(__sv);
2046 }2090 }
20472091
2048 constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(value_type __c) const noexcept {2092 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(value_type __c) const noexcept {
2049 return !empty() && _Traits::eq(front(), __c);2093 return !empty() && _Traits::eq(front(), __c);
2050 }2094 }
20512095
2052 constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {2096 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool
2097 starts_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
2053 return starts_with(__self_view(__s));2098 return starts_with(__self_view(__s));
2054 }2099 }
20552100
2056 // ends_with2101 // ends_with
20572102
2058 constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(__self_view __sv) const noexcept {2103 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(__self_view __sv) const noexcept {
2059 return __self_view(typename __self_view::__assume_valid(), data(), size()).ends_with(__sv);2104 return __self_view(typename __self_view::__assume_valid(), data(), size()).ends_with(__sv);
2060 }2105 }
20612106
2062 constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(value_type __c) const noexcept {2107 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(value_type __c) const noexcept {
2063 return !empty() && _Traits::eq(back(), __c);2108 return !empty() && _Traits::eq(back(), __c);
2064 }2109 }
20652110
2066 constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {2111 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool
2112 ends_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
2067 return ends_with(__self_view(__s));2113 return ends_with(__self_view(__s));
2068 }2114 }
2069# endif2115# endif
...@@ -2071,15 +2117,16 @@ public:...@@ -2071,15 +2117,16 @@ public:
2071 // contains2117 // contains
20722118
2073# if _LIBCPP_STD_VER >= 232119# if _LIBCPP_STD_VER >= 23
2074 constexpr _LIBCPP_HIDE_FROM_ABI bool contains(__self_view __sv) const noexcept {2120 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool contains(__self_view __sv) const noexcept {
2075 return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__sv);2121 return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__sv);
2076 }2122 }
20772123
2078 constexpr _LIBCPP_HIDE_FROM_ABI bool contains(value_type __c) const noexcept {2124 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool contains(value_type __c) const noexcept {
2079 return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__c);2125 return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__c);
2080 }2126 }
20812127
2082 constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {2128 [[__nodiscard__]] constexpr _LIBCPP_HIDE_FROM_ABI bool
2129 contains(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
2083 return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__s);2130 return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__s);
2084 }2131 }
2085# endif2132# endif
...@@ -2095,18 +2142,6 @@ private:...@@ -2095,18 +2142,6 @@ private:
2095 return __rep_.__s.__is_long_;2142 return __rep_.__s.__is_long_;
2096 }2143 }
20972144
2098 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __begin_lifetime(pointer __begin, size_type __n) {
2099# if _LIBCPP_STD_VER >= 20
2100 if (__libcpp_is_constant_evaluated()) {
2101 for (size_type __i = 0; __i != __n; ++__i)
2102 std::construct_at(std::addressof(__begin[__i]));
2103 }
2104# else
2105 (void)__begin;
2106 (void)__n;
2107# endif // _LIBCPP_STD_VER >= 20
2108 }
2109
2110 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI static bool __fits_in_sso(size_type __sz) { return __sz < __min_cap; }2145 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI static bool __fits_in_sso(size_type __sz) { return __sz < __min_cap; }
21112146
2112 template <class _Iterator, class _Sentinel>2147 template <class _Iterator, class _Sentinel>
...@@ -2165,6 +2200,9 @@ private:...@@ -2165,6 +2200,9 @@ private:
2165 _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator2200 _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
2166 __insert_with_size(const_iterator __pos, _Iterator __first, _Sentinel __last, size_type __n);2201 __insert_with_size(const_iterator __pos, _Iterator __first, _Sentinel __last, size_type __n);
21672202
2203 // internal buffer accessors
2204 // -------------------------
2205
2168 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void2206 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void
2169 __set_short_size(size_type __s) _NOEXCEPT {2207 __set_short_size(size_type __s) _NOEXCEPT {
2170 _LIBCPP_ASSERT_INTERNAL(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");2208 _LIBCPP_ASSERT_INTERNAL(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
...@@ -2194,21 +2232,11 @@ private:...@@ -2194,21 +2232,11 @@ private:
2194 __set_short_size(__s);2232 __set_short_size(__s);
2195 }2233 }
21962234
2197 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_cap(size_type __s) _NOEXCEPT {
2198 _LIBCPP_ASSERT_INTERNAL(!__fits_in_sso(__s), "Long capacity should always be larger than the SSO");
2199 __rep_.__l.__cap_ = __s / __endian_factor;
2200 __rep_.__l.__is_long_ = true;
2201 }
2202
2203 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_long_cap() const _NOEXCEPT {2235 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_long_cap() const _NOEXCEPT {
2204 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long capacity");2236 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long capacity");
2205 return __rep_.__l.__cap_ * __endian_factor;2237 return __rep_.__l.__cap_ * __endian_factor;
2206 }2238 }
22072239
2208 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_pointer(pointer __p) _NOEXCEPT {
2209 __rep_.__l.__data_ = __p;
2210 }
2211
2212 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_long_pointer() _NOEXCEPT {2240 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_long_pointer() _NOEXCEPT {
2213 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long pointer");2241 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long pointer");
2214 return _LIBCPP_ASAN_VOLATILE_WRAPPER(__rep_.__l.__data_);2242 return _LIBCPP_ASAN_VOLATILE_WRAPPER(__rep_.__l.__data_);
...@@ -2236,6 +2264,58 @@ private:...@@ -2236,6 +2264,58 @@ private:
2236 return __is_long() ? __get_long_pointer() : __get_short_pointer();2264 return __is_long() ? __get_long_pointer() : __get_short_pointer();
2237 }2265 }
22382266
2267 // Internal buffer management
2268 // --------------------------
2269 //
2270 // These functions are only responsible for managing the buffer itself, not the value inside the buffer. As such,
2271 // none of these facilities ensure that there is a null terminator at `data()[size()]`.
2272
2273 // Allocate a buffer of __capacity size with __alloc and return it
2274 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 __long
2275 __allocate_long_buffer(_Allocator& __alloc, size_type __capacity) {
2276 _LIBCPP_ASSERT_INTERNAL(!__fits_in_sso(__capacity),
2277 "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));
2279
2280 if (__libcpp_is_constant_evaluated()) {
2281 for (size_type __i = 0; __i != __buffer.count; ++__i)
2282 std::__construct_at(std::addressof(__buffer.ptr[__i]));
2283 }
2284
2285 return __long(__buffer, __capacity);
2286 }
2287
2288 // Replace the current buffer with __new_rep. Deallocate the old long buffer if it exists.
2289 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __reset_internal_buffer(__rep __new_rep = __short()) {
2290 __annotate_delete();
2291 if (__is_long())
2292 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
2293 __rep_ = __new_rep;
2294 }
2295
2296 // Initialize the internal buffer to hold __size elements
2297 // The elements and null terminator have to be set by the caller
2298 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __init_internal_buffer(size_type __size) {
2299 if (__libcpp_is_constant_evaluated())
2300 __rep_ = __rep();
2301
2302 if (__size > max_size())
2303 __throw_length_error();
2304
2305 if (__fits_in_sso(__size)) {
2306 __set_short_size(__size);
2307 __annotate_new(__size);
2308 return __get_short_pointer();
2309 } else {
2310 __rep_.__l = __allocate_long_buffer(__alloc_, __size);
2311 __annotate_new(__size);
2312 return __get_long_pointer();
2313 }
2314 }
2315
2316 // ASan annotation helpers
2317 // -----------------------
2318
2239 // The following functions are no-ops outside of AddressSanitizer mode.2319 // The following functions are no-ops outside of AddressSanitizer mode.
2240 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void2320 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
2241 __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {2321 __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {
...@@ -2243,7 +2323,7 @@ private:...@@ -2243,7 +2323,7 @@ private:
2243 (void)__new_mid;2323 (void)__new_mid;
2244# if _LIBCPP_INSTRUMENTED_WITH_ASAN2324# if _LIBCPP_INSTRUMENTED_WITH_ASAN
2245# if defined(__APPLE__)2325# if defined(__APPLE__)
2246 // TODO: remove after addressing issue #96099 (https://github.com/llvm/llvm-project/issues/96099)2326 // TODO: remove after addressing issue #96099 (https://llvm.org/PR96099)
2247 if (!__is_long())2327 if (!__is_long())
2248 return;2328 return;
2249# endif2329# endif
...@@ -2287,19 +2367,36 @@ private:...@@ -2287,19 +2367,36 @@ private:
2287 return (__s + (__a - 1)) & ~(__a - 1);2367 return (__s + (__a - 1)) & ~(__a - 1);
2288 }2368 }
2289 enum { __alignment = 8 };2369 enum { __alignment = 8 };
2290 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __recommend(size_type __s) _NOEXCEPT {2370
2291 if (__s < __min_cap) {2371 // This makes sure that we're using a capacity with some extra alignment, since allocators almost always over-align
2292 return static_cast<size_type>(__min_cap) - 1;2372 // the allocations anyways, improving memory usage. More importantly, this ensures that the lowest bit is never set
2293 }2373 // if __endian_factor == 2, allowing us to store whether we're in the long string inside the lowest bit.
2374 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
2375 __align_allocation_size(size_type __size) _NOEXCEPT {
2376 _LIBCPP_ASSERT_INTERNAL(
2377 !__fits_in_sso(__size), "Trying to align allocation of a size which would fit into the SSO");
2294 const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : __endian_factor;2378 const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : __endian_factor;
2295 size_type __guess = __align_it<__boundary>(__s + 1) - 1;2379 size_type __guess = __align_it<__boundary>(__size + 1);
2296 if (__guess == __min_cap)2380 if (__guess == __min_cap + 1)
2297 __guess += __endian_factor;2381 __guess += __endian_factor;
22982382
2299 _LIBCPP_ASSERT_INTERNAL(__guess >= __s, "recommendation is below the requested size");2383 _LIBCPP_ASSERT_INTERNAL(__guess >= __size, "aligned allocation size is below the requested size");
2300 return __guess;2384 return __guess;
2301 }2385 }
23022386
2387 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
2388 __get_amortized_growth_capacity(size_type __required_capacity) {
2389 size_type __max_size = max_size();
2390 if (__required_capacity > __max_size)
2391 __throw_length_error();
2392 size_type __current_cap = capacity();
2393 _LIBCPP_ASSERT_INTERNAL(
2394 __current_cap < __required_capacity, "Trying to grow string even though there is enough capacity already?");
2395 if (__current_cap > __max_size / 2 - __alignment)
2396 return __max_size;
2397 return std::max(__required_capacity, 2 * __current_cap);
2398 }
2399
2303 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(const value_type* __s, size_type __sz);2400 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(const value_type* __s, size_type __sz);
2304 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(size_type __n, value_type __c);2401 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(size_type __n, value_type __c);
23052402
...@@ -2366,7 +2463,8 @@ private:...@@ -2366,7 +2463,8 @@ private:
23662463
2367 // __erase_external_with_move is invoked for erase() invocations where2464 // __erase_external_with_move is invoked for erase() invocations where
2368 // `n ~= npos`, likely requiring memory moves on the string data.2465 // `n ~= npos`, likely requiring memory moves on the string data.
2369 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE void __erase_external_with_move(size_type __pos, size_type __n);2466 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE void
2467 __erase_external_with_move(size_type __pos, size_type __n) _NOEXCEPT;
23702468
2371 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __copy_assign_alloc(const basic_string& __str) {2469 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __copy_assign_alloc(const basic_string& __str) {
2372 __copy_assign_alloc(2470 __copy_assign_alloc(
...@@ -2378,24 +2476,14 @@ private:...@@ -2378,24 +2476,14 @@ private:
2378 __alloc_ = __str.__alloc_;2476 __alloc_ = __str.__alloc_;
2379 else {2477 else {
2380 if (!__str.__is_long()) {2478 if (!__str.__is_long()) {
2381 if (__is_long()) {2479 __reset_internal_buffer();
2382 __annotate_delete();
2383 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
2384 __rep_ = __rep();
2385 }
2386 __alloc_ = __str.__alloc_;2480 __alloc_ = __str.__alloc_;
2387 } else {2481 } else {
2388 __annotate_delete();2482 __annotate_delete();
2389 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));2483 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));
2390 allocator_type __a = __str.__alloc_;2484 auto __alloc = __str.__alloc_;
2391 auto __allocation = std::__allocate_at_least(__a, __str.__get_long_cap());2485 __reset_internal_buffer(__allocate_long_buffer(__alloc, __str.size()));
2392 __begin_lifetime(__allocation.ptr, __allocation.count);2486 __alloc_ = std::move(__alloc);
2393 if (__is_long())
2394 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
2395 __alloc_ = std::move(__a);
2396 __set_long_pointer(__allocation.ptr);
2397 __set_long_cap(__allocation.count);
2398 __set_long_size(__str.__get_long_size());
2399 }2487 }
2400 }2488 }
2401 }2489 }
...@@ -2507,26 +2595,55 @@ _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, wchar_t)...@@ -2507,26 +2595,55 @@ _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, wchar_t)
2507# endif2595# endif
2508# undef _LIBCPP_DECLARE2596# undef _LIBCPP_DECLARE
25092597
2598# if _LIBCPP_STD_VER <= 17 || !__has_builtin(__builtin_lt_synthesizes_from_spaceship)
2599template <class _CharT, class _Traits, class _Alloc>
2600struct __default_three_way_comparator<basic_string<_CharT, _Traits, _Alloc>, basic_string<_CharT, _Traits, _Alloc> > {
2601 using __string_t _LIBCPP_NODEBUG = basic_string<_CharT, _Traits, _Alloc>;
2602
2603 _LIBCPP_HIDE_FROM_ABI static int operator()(const __string_t& __lhs, const __string_t& __rhs) {
2604 auto __min_len = std::min(__lhs.size(), __rhs.size());
2605 auto __ret = _Traits::compare(__lhs.data(), __rhs.data(), __min_len);
2606 if (__ret == 0)
2607 return __lhs.size() == __rhs.size() ? 0 : __lhs.size() < __rhs.size() ? -1 : 1;
2608 return __ret;
2609 }
2610};
2611# endif
2612
2613template <class _Comparator, class _CharT, class _Traits, class _Alloc>
2614inline const bool __is_transparently_comparable_v<_Comparator,
2615 basic_string<_CharT, _Traits, _Alloc>,
2616 const _CharT*,
2617 __enable_if_t<__is_generic_transparent_comparator_v<_Comparator> > > =
2618 true;
2619
2620template <class _Comparator, class _CharT, class _Traits, class _Alloc, size_t _Np>
2621inline const bool __is_transparently_comparable_v<_Comparator,
2622 basic_string<_CharT, _Traits, _Alloc>,
2623 _CharT[_Np],
2624 __enable_if_t<__is_generic_transparent_comparator_v<_Comparator> > > =
2625 true;
2626
2510# if _LIBCPP_STD_VER >= 172627# if _LIBCPP_STD_VER >= 17
2511template <class _InputIterator,2628template <class _InputIterator,
2512 class _CharT = __iter_value_type<_InputIterator>,2629 class _CharT = __iterator_value_type<_InputIterator>,
2513 class _Allocator = allocator<_CharT>,2630 class _Allocator = allocator<_CharT>,
2514 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,2631 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
2515 class = enable_if_t<__is_allocator<_Allocator>::value> >2632 class = enable_if_t<__is_allocator_v<_Allocator>>>
2516basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator())2633basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator())
2517 -> basic_string<_CharT, char_traits<_CharT>, _Allocator>;2634 -> basic_string<_CharT, char_traits<_CharT>, _Allocator>;
25182635
2519template <class _CharT,2636template <class _CharT,
2520 class _Traits,2637 class _Traits,
2521 class _Allocator = allocator<_CharT>,2638 class _Allocator = allocator<_CharT>,
2522 class = enable_if_t<__is_allocator<_Allocator>::value> >2639 class = enable_if_t<__is_allocator_v<_Allocator>>>
2523explicit basic_string(basic_string_view<_CharT, _Traits>, const _Allocator& = _Allocator())2640explicit basic_string(basic_string_view<_CharT, _Traits>, const _Allocator& = _Allocator())
2524 -> basic_string<_CharT, _Traits, _Allocator>;2641 -> basic_string<_CharT, _Traits, _Allocator>;
25252642
2526template <class _CharT,2643template <class _CharT,
2527 class _Traits,2644 class _Traits,
2528 class _Allocator = allocator<_CharT>,2645 class _Allocator = allocator<_CharT>,
2529 class = enable_if_t<__is_allocator<_Allocator>::value>,2646 class = enable_if_t<__is_allocator_v<_Allocator>>,
2530 class _Sz = typename allocator_traits<_Allocator>::size_type >2647 class _Sz = typename allocator_traits<_Allocator>::size_type >
2531basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _Allocator())2648basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _Allocator())
2532 -> basic_string<_CharT, _Traits, _Allocator>;2649 -> basic_string<_CharT, _Traits, _Allocator>;
...@@ -2535,7 +2652,7 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _...@@ -2535,7 +2652,7 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _
2535# if _LIBCPP_STD_VER >= 232652# if _LIBCPP_STD_VER >= 23
2536template <ranges::input_range _Range,2653template <ranges::input_range _Range,
2537 class _Allocator = allocator<ranges::range_value_t<_Range>>,2654 class _Allocator = allocator<ranges::range_value_t<_Range>>,
2538 class = enable_if_t<__is_allocator<_Allocator>::value> >2655 class = enable_if_t<__is_allocator_v<_Allocator>>>
2539basic_string(from_range_t, _Range&&, _Allocator = _Allocator())2656basic_string(from_range_t, _Range&&, _Allocator = _Allocator())
2540 -> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>;2657 -> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>;
2541# endif2658# endif
...@@ -2543,73 +2660,23 @@ basic_string(from_range_t, _Range&&, _Allocator = _Allocator())...@@ -2543,73 +2660,23 @@ basic_string(from_range_t, _Range&&, _Allocator = _Allocator())
2543template <class _CharT, class _Traits, class _Allocator>2660template <class _CharT, class _Traits, class _Allocator>
2544_LIBCPP_CONSTEXPR_SINCE_CXX20 void2661_LIBCPP_CONSTEXPR_SINCE_CXX20 void
2545basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz) {2662basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz) {
2546 if (__libcpp_is_constant_evaluated())2663 pointer __p = __init_internal_buffer(__sz);
2547 __rep_ = __rep();
2548 if (__sz > max_size())
2549 this->__throw_length_error();
2550 pointer __p;
2551 if (__fits_in_sso(__sz)) {
2552 __set_short_size(__sz);
2553 __p = __get_short_pointer();
2554 } else {
2555 auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__sz) + 1);
2556 __p = __allocation.ptr;
2557 __begin_lifetime(__p, __allocation.count);
2558 __set_long_pointer(__p);
2559 __set_long_cap(__allocation.count);
2560 __set_long_size(__sz);
2561 }
2562 traits_type::copy(std::__to_address(__p), __s, __sz);2664 traits_type::copy(std::__to_address(__p), __s, __sz);
2563 traits_type::assign(__p[__sz], value_type());2665 traits_type::assign(__p[__sz], value_type());
2564 __annotate_new(__sz);
2565}2666}
25662667
2567template <class _CharT, class _Traits, class _Allocator>2668template <class _CharT, class _Traits, class _Allocator>
2568_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE void2669_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE void
2569basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(const value_type* __s, size_type __sz) {2670basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(const value_type* __s, size_type __sz) {
2570 if (__libcpp_is_constant_evaluated())2671 pointer __p = __init_internal_buffer(__sz);
2571 __rep_ = __rep();
2572
2573 pointer __p;
2574 if (__fits_in_sso(__sz)) {
2575 __p = __get_short_pointer();
2576 __set_short_size(__sz);
2577 } else {
2578 if (__sz > max_size())
2579 this->__throw_length_error();
2580 auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__sz) + 1);
2581 __p = __allocation.ptr;
2582 __begin_lifetime(__p, __allocation.count);
2583 __set_long_pointer(__p);
2584 __set_long_cap(__allocation.count);
2585 __set_long_size(__sz);
2586 }
2587 traits_type::copy(std::__to_address(__p), __s, __sz + 1);2672 traits_type::copy(std::__to_address(__p), __s, __sz + 1);
2588 __annotate_new(__sz);
2589}2673}
25902674
2591template <class _CharT, class _Traits, class _Allocator>2675template <class _CharT, class _Traits, class _Allocator>
2592_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c) {2676_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c) {
2593 if (__libcpp_is_constant_evaluated())2677 pointer __p = __init_internal_buffer(__n);
2594 __rep_ = __rep();
2595
2596 if (__n > max_size())
2597 this->__throw_length_error();
2598 pointer __p;
2599 if (__fits_in_sso(__n)) {
2600 __set_short_size(__n);
2601 __p = __get_short_pointer();
2602 } else {
2603 auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__n) + 1);
2604 __p = __allocation.ptr;
2605 __begin_lifetime(__p, __allocation.count);
2606 __set_long_pointer(__p);
2607 __set_long_cap(__allocation.count);
2608 __set_long_size(__n);
2609 }
2610 traits_type::assign(std::__to_address(__p), __n, __c);2678 traits_type::assign(std::__to_address(__p), __n, __c);
2611 traits_type::assign(__p[__n], value_type());2679 traits_type::assign(__p[__n], value_type());
2612 __annotate_new(__n);
2613}2680}
26142681
2615template <class _CharT, class _Traits, class _Allocator>2682template <class _CharT, class _Traits, class _Allocator>
...@@ -2626,19 +2693,10 @@ basic_string<_CharT, _Traits, _Allocator>::__init_with_sentinel(_InputIterator _...@@ -2626,19 +2693,10 @@ basic_string<_CharT, _Traits, _Allocator>::__init_with_sentinel(_InputIterator _
2626 __rep_ = __rep();2693 __rep_ = __rep();
2627 __annotate_new(0);2694 __annotate_new(0);
26282695
2629# if _LIBCPP_HAS_EXCEPTIONS2696 auto __guard = std::__make_exception_guard([this] { __reset_internal_buffer(); });
2630 try {2697 for (; __first != __last; ++__first)
2631# endif // _LIBCPP_HAS_EXCEPTIONS2698 push_back(*__first);
2632 for (; __first != __last; ++__first)2699 __guard.__complete();
2633 push_back(*__first);
2634# if _LIBCPP_HAS_EXCEPTIONS
2635 } catch (...) {
2636 __annotate_delete();
2637 if (__is_long())
2638 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
2639 throw;
2640 }
2641# endif // _LIBCPP_HAS_EXCEPTIONS
2642}2700}
26432701
2644template <class _CharT, class _Traits, class _Allocator>2702template <class _CharT, class _Traits, class _Allocator>
...@@ -2653,39 +2711,12 @@ template <class _CharT, class _Traits, class _Allocator>...@@ -2653,39 +2711,12 @@ template <class _CharT, class _Traits, class _Allocator>
2653template <class _InputIterator, class _Sentinel>2711template <class _InputIterator, class _Sentinel>
2654_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void2712_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
2655basic_string<_CharT, _Traits, _Allocator>::__init_with_size(_InputIterator __first, _Sentinel __last, size_type __sz) {2713basic_string<_CharT, _Traits, _Allocator>::__init_with_size(_InputIterator __first, _Sentinel __last, size_type __sz) {
2656 if (__libcpp_is_constant_evaluated())2714 pointer __p = __init_internal_buffer(__sz);
2657 __rep_ = __rep();
26582715
2659 if (__sz > max_size())2716 auto __guard = std::__make_exception_guard([this] { __reset_internal_buffer(); });
2660 this->__throw_length_error();2717 auto __end = __copy_non_overlapping_range(std::move(__first), std::move(__last), std::__to_address(__p));
26612718 traits_type::assign(*__end, value_type());
2662 pointer __p;2719 __guard.__complete();
2663 if (__fits_in_sso(__sz)) {
2664 __set_short_size(__sz);
2665 __p = __get_short_pointer();
2666
2667 } else {
2668 auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__sz) + 1);
2669 __p = __allocation.ptr;
2670 __begin_lifetime(__p, __allocation.count);
2671 __set_long_pointer(__p);
2672 __set_long_cap(__allocation.count);
2673 __set_long_size(__sz);
2674 }
2675
2676# if _LIBCPP_HAS_EXCEPTIONS
2677 try {
2678# endif // _LIBCPP_HAS_EXCEPTIONS
2679 auto __end = __copy_non_overlapping_range(std::move(__first), std::move(__last), std::__to_address(__p));
2680 traits_type::assign(*__end, value_type());
2681# if _LIBCPP_HAS_EXCEPTIONS
2682 } catch (...) {
2683 if (__is_long())
2684 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
2685 throw;
2686 }
2687# endif // _LIBCPP_HAS_EXCEPTIONS
2688 __annotate_new(__sz);
2689}2720}
26902721
2691template <class _CharT, class _Traits, class _Allocator>2722template <class _CharT, class _Traits, class _Allocator>
...@@ -2697,32 +2728,22 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__...@@ -2697,32 +2728,22 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
2697 size_type __n_del,2728 size_type __n_del,
2698 size_type __n_add,2729 size_type __n_add,
2699 const value_type* __p_new_stuff) {2730 const value_type* __p_new_stuff) {
2700 size_type __ms = max_size();2731 __long __buffer = __allocate_long_buffer(__alloc_, __get_amortized_growth_capacity(__old_cap + __delta_cap));
2701 if (__delta_cap > __ms - __old_cap)
2702 __throw_length_error();
2703 pointer __old_p = __get_pointer();2732 pointer __old_p = __get_pointer();
2704 size_type __cap =
2705 __old_cap < __ms / 2 - __alignment ? __recommend(std::max(__old_cap + __delta_cap, 2 * __old_cap)) : __ms;
2706 __annotate_delete();2733 __annotate_delete();
2707 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));2734 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));
2708 auto __allocation = std::__allocate_at_least(__alloc_, __cap + 1);
2709 pointer __p = __allocation.ptr;
2710 __begin_lifetime(__p, __allocation.count);
2711 if (__n_copy != 0)2735 if (__n_copy != 0)
2712 traits_type::copy(std::__to_address(__p), std::__to_address(__old_p), __n_copy);2736 traits_type::copy(std::__to_address(__buffer.__data_), std::__to_address(__old_p), __n_copy);
2713 if (__n_add != 0)2737 if (__n_add != 0)
2714 traits_type::copy(std::__to_address(__p) + __n_copy, __p_new_stuff, __n_add);2738 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy, __p_new_stuff, __n_add);
2715 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;2739 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
2716 if (__sec_cp_sz != 0)2740 if (__sec_cp_sz != 0)
2717 traits_type::copy(2741 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy + __n_add,
2718 std::__to_address(__p) + __n_copy + __n_add, std::__to_address(__old_p) + __n_copy + __n_del, __sec_cp_sz);2742 std::__to_address(__old_p) + __n_copy + __n_del,
2719 if (__old_cap + 1 != __min_cap)2743 __sec_cp_sz);
2720 __alloc_traits::deallocate(__alloc_, __old_p, __old_cap + 1);2744 __buffer.__size_ = __n_copy + __n_add + __sec_cp_sz;
2721 __set_long_pointer(__p);2745 traits_type::assign(__buffer.__data_[__buffer.__size_], value_type());
2722 __set_long_cap(__allocation.count);2746 __reset_internal_buffer(__buffer);
2723 __old_sz = __n_copy + __n_add + __sec_cp_sz;
2724 __set_long_size(__old_sz);
2725 traits_type::assign(__p[__old_sz], value_type());
2726}2747}
27272748
2728// __grow_by is deprecated because it does not set the size. It may not update the size when the size is changed, and it2749// __grow_by is deprecated because it does not set the size. It may not update the size when the size is changed, and it
...@@ -2740,25 +2761,20 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait...@@ -2740,25 +2761,20 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait
2740 size_type __n_copy,2761 size_type __n_copy,
2741 size_type __n_del,2762 size_type __n_del,
2742 size_type __n_add) {2763 size_type __n_add) {
2743 size_type __ms = max_size();2764 __long __buffer = __allocate_long_buffer(__alloc_, __get_amortized_growth_capacity(__old_cap + __delta_cap));
2744 if (__delta_cap > __ms - __old_cap)
2745 this->__throw_length_error();
2746 pointer __old_p = __get_pointer();2765 pointer __old_p = __get_pointer();
2747 size_type __cap =
2748 __old_cap < __ms / 2 - __alignment ? __recommend(std::max(__old_cap + __delta_cap, 2 * __old_cap)) : __ms;
2749 auto __allocation = std::__allocate_at_least(__alloc_, __cap + 1);
2750 pointer __p = __allocation.ptr;
2751 __begin_lifetime(__p, __allocation.count);
2752 if (__n_copy != 0)2766 if (__n_copy != 0)
2753 traits_type::copy(std::__to_address(__p), std::__to_address(__old_p), __n_copy);2767 traits_type::copy(std::__to_address(__buffer.__data_), std::__to_address(__old_p), __n_copy);
2754 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;2768 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
2755 if (__sec_cp_sz != 0)2769 if (__sec_cp_sz != 0)
2756 traits_type::copy(2770 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy + __n_add,
2757 std::__to_address(__p) + __n_copy + __n_add, std::__to_address(__old_p) + __n_copy + __n_del, __sec_cp_sz);2771 std::__to_address(__old_p) + __n_copy + __n_del,
2758 if (__old_cap + 1 != __min_cap)2772 __sec_cp_sz);
2759 __alloc_traits::deallocate(__alloc_, __old_p, __old_cap + 1);2773
2760 __set_long_pointer(__p);2774 // This is -1 to make sure the caller sets the size properly, since old versions of this function didn't set the size
2761 __set_long_cap(__allocation.count);2775 // at all.
2776 __buffer.__size_ = -1;
2777 __reset_internal_buffer(__buffer);
2762}2778}
27632779
2764template <class _CharT, class _Traits, class _Allocator>2780template <class _CharT, class _Traits, class _Allocator>
...@@ -2775,6 +2791,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_without_replace(...@@ -2775,6 +2791,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_without_replace(
2775 _LIBCPP_SUPPRESS_DEPRECATED_PUSH2791 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
2776 __grow_by(__old_cap, __delta_cap, __old_sz, __n_copy, __n_del, __n_add);2792 __grow_by(__old_cap, __delta_cap, __old_sz, __n_copy, __n_del, __n_add);
2777 _LIBCPP_SUPPRESS_DEPRECATED_POP2793 _LIBCPP_SUPPRESS_DEPRECATED_POP
2794 // Due to the ABI of __grow_by we have to set the size after calling it.
2778 __set_long_size(__old_sz - __n_del + __n_add);2795 __set_long_size(__old_sz - __n_del + __n_add);
2779}2796}
27802797
...@@ -2786,24 +2803,23 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE basic_string<_CharT, _Traits, _Al...@@ -2786,24 +2803,23 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE basic_string<_CharT, _Traits, _Al
2786basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(const value_type* __s, size_type __n) {2803basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(const value_type* __s, size_type __n) {
2787 const auto __cap = __is_short ? static_cast<size_type>(__min_cap) : __get_long_cap();2804 const auto __cap = __is_short ? static_cast<size_type>(__min_cap) : __get_long_cap();
2788 const auto __size = __is_short ? __get_short_size() : __get_long_size();2805 const auto __size = __is_short ? __get_short_size() : __get_long_size();
2789 if (__n < __cap) {2806 if (__n >= __cap) {
2790 if (__n > __size)
2791 __annotate_increase(__n - __size);
2792 pointer __p;
2793 if (__is_short) {
2794 __p = __get_short_pointer();
2795 __set_short_size(__n);
2796 } else {
2797 __p = __get_long_pointer();
2798 __set_long_size(__n);
2799 }
2800 traits_type::copy(std::__to_address(__p), __s, __n);
2801 traits_type::assign(__p[__n], value_type());
2802 if (__size > __n)
2803 __annotate_shrink(__size);
2804 } else {
2805 __grow_by_and_replace(__cap - 1, __n - __cap + 1, __size, 0, __size, __n, __s);2807 __grow_by_and_replace(__cap - 1, __n - __cap + 1, __size, 0, __size, __n, __s);
2808 return *this;
2806 }2809 }
2810
2811 __annotate_delete();
2812 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));
2813 pointer __p;
2814 if (__is_short) {
2815 __p = __get_short_pointer();
2816 __set_short_size(__n);
2817 } else {
2818 __p = __get_long_pointer();
2819 __set_long_size(__n);
2820 }
2821 traits_type::copy(std::__to_address(__p), __s, __n);
2822 traits_type::assign(__p[__n], value_type());
2807 return *this;2823 return *this;
2808}2824}
28092825
...@@ -2910,7 +2926,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr...@@ -2910,7 +2926,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
2910{2926{
2911 __annotate_delete();2927 __annotate_delete();
2912 if (__is_long()) {2928 if (__is_long()) {
2913 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());2929 __reset_internal_buffer();
2914# if _LIBCPP_STD_VER <= 142930# if _LIBCPP_STD_VER <= 14
2915 if (!is_nothrow_move_assignable<allocator_type>::value) {2931 if (!is_nothrow_move_assignable<allocator_type>::value) {
2916 __set_short_size(0);2932 __set_short_size(0);
...@@ -2961,7 +2977,7 @@ template <class _Iterator, class _Sentinel>...@@ -2961,7 +2977,7 @@ template <class _Iterator, class _Sentinel>
2961_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void2977_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
2962basic_string<_CharT, _Traits, _Allocator>::__assign_trivial(_Iterator __first, _Sentinel __last, size_type __n) {2978basic_string<_CharT, _Traits, _Allocator>::__assign_trivial(_Iterator __first, _Sentinel __last, size_type __n) {
2963 _LIBCPP_ASSERT_INTERNAL(2979 _LIBCPP_ASSERT_INTERNAL(
2964 __string_is_trivial_iterator<_Iterator>::value, "The iterator type given to `__assign_trivial` must be trivial");2980 __string_is_trivial_iterator_v<_Iterator>, "The iterator type given to `__assign_trivial` must be trivial");
29652981
2966 size_type __old_size = size();2982 size_type __old_size = size();
2967 size_type __cap = capacity();2983 size_type __cap = capacity();
...@@ -3017,52 +3033,40 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_ty...@@ -3017,52 +3033,40 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_ty
3017 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::append received nullptr");3033 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::append received nullptr");
3018 size_type __cap = capacity();3034 size_type __cap = capacity();
3019 size_type __sz = size();3035 size_type __sz = size();
3020 if (__cap - __sz >= __n) {3036 if (__cap - __sz < __n) {
3021 if (__n) {
3022 __annotate_increase(__n);
3023 value_type* __p = std::__to_address(__get_pointer());
3024 traits_type::copy(__p + __sz, __s, __n);
3025 __sz += __n;
3026 __set_size(__sz);
3027 traits_type::assign(__p[__sz], value_type());
3028 }
3029 } else
3030 __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __sz, 0, __n, __s);3037 __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __sz, 0, __n, __s);
3038 return *this;
3039 }
3040
3041 if (__n == 0)
3042 return *this;
3043
3044 __annotate_increase(__n);
3045 value_type* __p = std::__to_address(__get_pointer());
3046 traits_type::copy(__p + __sz, __s, __n);
3047 __sz += __n;
3048 __set_size(__sz);
3049 traits_type::assign(__p[__sz], value_type());
3031 return *this;3050 return *this;
3032}3051}
30333052
3034template <class _CharT, class _Traits, class _Allocator>3053template <class _CharT, class _Traits, class _Allocator>
3035_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&3054_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
3036basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c) {3055basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c) {
3037 if (__n) {3056 if (__n == 0)
3038 size_type __cap = capacity();3057 return *this;
3039 size_type __sz = size();
3040 if (__cap - __sz < __n)
3041 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
3042 __annotate_increase(__n);
3043 pointer __p = __get_pointer();
3044 traits_type::assign(std::__to_address(__p) + __sz, __n, __c);
3045 __sz += __n;
3046 __set_size(__sz);
3047 traits_type::assign(__p[__sz], value_type());
3048 }
3049 return *this;
3050}
30513058
3052template <class _CharT, class _Traits, class _Allocator>3059 size_type __cap = capacity();
3053_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void3060 size_type __sz = size();
3054basic_string<_CharT, _Traits, _Allocator>::__append_default_init(size_type __n) {3061 if (__cap - __sz < __n)
3055 if (__n) {3062 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
3056 size_type __cap = capacity();3063 __annotate_increase(__n);
3057 size_type __sz = size();3064 pointer __p = __get_pointer();
3058 if (__cap - __sz < __n)3065 traits_type::assign(std::__to_address(__p) + __sz, __n, __c);
3059 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);3066 __sz += __n;
3060 __annotate_increase(__n);3067 __set_size(__sz);
3061 pointer __p = __get_pointer();3068 traits_type::assign(__p[__sz], value_type());
3062 __sz += __n;3069 return *this;
3063 __set_size(__sz);
3064 traits_type::assign(__p[__sz], value_type());
3065 }
3066}3070}
30673071
3068template <class _CharT, class _Traits, class _Allocator>3072template <class _CharT, class _Traits, class _Allocator>
...@@ -3120,23 +3124,27 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_t...@@ -3120,23 +3124,27 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_t
3120 if (__pos > __sz)3124 if (__pos > __sz)
3121 this->__throw_out_of_range();3125 this->__throw_out_of_range();
3122 size_type __cap = capacity();3126 size_type __cap = capacity();
3123 if (__cap - __sz >= __n) {3127
3124 if (__n) {3128 if (__cap - __sz < __n) {
3125 __annotate_increase(__n);
3126 value_type* __p = std::__to_address(__get_pointer());
3127 size_type __n_move = __sz - __pos;
3128 if (__n_move != 0) {
3129 if (std::__is_pointer_in_range(__p + __pos, __p + __sz, __s))
3130 __s += __n;
3131 traits_type::move(__p + __pos + __n, __p + __pos, __n_move);
3132 }
3133 traits_type::move(__p + __pos, __s, __n);
3134 __sz += __n;
3135 __set_size(__sz);
3136 traits_type::assign(__p[__sz], value_type());
3137 }
3138 } else
3139 __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n, __s);3129 __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n, __s);
3130 return *this;
3131 }
3132
3133 if (__n == 0)
3134 return *this;
3135
3136 __annotate_increase(__n);
3137 value_type* __p = std::__to_address(__get_pointer());
3138 size_type __n_move = __sz - __pos;
3139 if (__n_move != 0) {
3140 if (std::__is_pointer_in_range(__p + __pos, __p + __sz, __s))
3141 __s += __n;
3142 traits_type::move(__p + __pos + __n, __p + __pos, __n_move);
3143 }
3144 traits_type::move(__p + __pos, __s, __n);
3145 __sz += __n;
3146 __set_size(__sz);
3147 traits_type::assign(__p[__sz], value_type());
3140 return *this;3148 return *this;
3141}3149}
31423150
...@@ -3146,24 +3154,26 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n...@@ -3146,24 +3154,26 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n
3146 size_type __sz = size();3154 size_type __sz = size();
3147 if (__pos > __sz)3155 if (__pos > __sz)
3148 this->__throw_out_of_range();3156 this->__throw_out_of_range();
3149 if (__n) {3157
3150 size_type __cap = capacity();3158 if (__n == 0)
3151 value_type* __p;3159 return *this;
3152 if (__cap - __sz >= __n) {3160
3153 __annotate_increase(__n);3161 size_type __cap = capacity();
3154 __p = std::__to_address(__get_pointer());3162 value_type* __p;
3155 size_type __n_move = __sz - __pos;3163 if (__cap - __sz >= __n) {
3156 if (__n_move != 0)3164 __annotate_increase(__n);
3157 traits_type::move(__p + __pos + __n, __p + __pos, __n_move);3165 __p = std::__to_address(__get_pointer());
3158 } else {3166 size_type __n_move = __sz - __pos;
3159 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n);3167 if (__n_move != 0)
3160 __p = std::__to_address(__get_long_pointer());3168 traits_type::move(__p + __pos + __n, __p + __pos, __n_move);
3161 }3169 } else {
3162 traits_type::assign(__p + __pos, __n, __c);3170 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n);
3163 __sz += __n;3171 __p = std::__to_address(__get_long_pointer());
3164 __set_size(__sz);
3165 traits_type::assign(__p[__sz], value_type());
3166 }3172 }
3173 traits_type::assign(__p + __pos, __n, __c);
3174 __sz += __n;
3175 __set_size(__sz);
3176 traits_type::assign(__p[__sz], value_type());
3167 return *this;3177 return *this;
3168}3178}
31693179
...@@ -3176,7 +3186,7 @@ basic_string<_CharT, _Traits, _Allocator>::__insert_with_size(...@@ -3176,7 +3186,7 @@ basic_string<_CharT, _Traits, _Allocator>::__insert_with_size(
3176 if (__n == 0)3186 if (__n == 0)
3177 return begin() + __ip;3187 return begin() + __ip;
31783188
3179 if (__string_is_trivial_iterator<_Iterator>::value && !__addr_in_range(*__first)) {3189 if (__string_is_trivial_iterator_v<_Iterator> && !__addr_in_range(*__first)) {
3180 return __insert_from_safe_copy(__n, __ip, std::move(__first), std::move(__last));3190 return __insert_from_safe_copy(__n, __ip, std::move(__first), std::move(__last));
3181 } else {3191 } else {
3182 const basic_string __temp(__init_with_sentinel_tag(), std::move(__first), std::move(__last), __alloc_);3192 const basic_string __temp(__init_with_sentinel_tag(), std::move(__first), std::move(__last), __alloc_);
...@@ -3237,38 +3247,38 @@ basic_string<_CharT, _Traits, _Allocator>::replace(...@@ -3237,38 +3247,38 @@ basic_string<_CharT, _Traits, _Allocator>::replace(
3237 this->__throw_out_of_range();3247 this->__throw_out_of_range();
3238 __n1 = std::min(__n1, __sz - __pos);3248 __n1 = std::min(__n1, __sz - __pos);
3239 size_type __cap = capacity();3249 size_type __cap = capacity();
3240 if (__cap - __sz + __n1 >= __n2) {3250 if (__cap - __sz + __n1 < __n2) {
3241 value_type* __p = std::__to_address(__get_pointer());3251 __grow_by_and_replace(__cap, __sz - __n1 + __n2 - __cap, __sz, __pos, __n1, __n2, __s);
3242 if (__n1 != __n2) {3252 return *this;
3243 if (__n2 > __n1)3253 }
3244 __annotate_increase(__n2 - __n1);3254
3245 size_type __n_move = __sz - __pos - __n1;3255 value_type* __p = std::__to_address(__get_pointer());
3246 if (__n_move != 0) {3256 if (__n1 != __n2) {
3247 if (__n1 > __n2) {3257 if (__n2 > __n1)
3248 traits_type::move(__p + __pos, __s, __n2);3258 __annotate_increase(__n2 - __n1);
3249 traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);3259 size_type __n_move = __sz - __pos - __n1;
3250 return __null_terminate_at(__p, __sz + (__n2 - __n1));3260 if (__n_move != 0) {
3251 }3261 if (__n1 > __n2) {
3252 if (std::__is_pointer_in_range(__p + __pos + 1, __p + __sz, __s)) {3262 traits_type::move(__p + __pos, __s, __n2);
3253 if (__p + __pos + __n1 <= __s)
3254 __s += __n2 - __n1;
3255 else // __p + __pos < __s < __p + __pos + __n1
3256 {
3257 traits_type::move(__p + __pos, __s, __n1);
3258 __pos += __n1;
3259 __s += __n2;
3260 __n2 -= __n1;
3261 __n1 = 0;
3262 }
3263 }
3264 traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);3263 traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);
3264 return __null_terminate_at(__p, __sz + (__n2 - __n1));
3265 }
3266 if (std::__is_pointer_in_range(__p + __pos + 1, __p + __sz, __s)) {
3267 if (__p + __pos + __n1 <= __s) {
3268 __s += __n2 - __n1;
3269 } else { // __p + __pos < __s < __p + __pos + __n1
3270 traits_type::move(__p + __pos, __s, __n1);
3271 __pos += __n1;
3272 __s += __n2;
3273 __n2 -= __n1;
3274 __n1 = 0;
3275 }
3265 }3276 }
3277 traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);
3266 }3278 }
3267 traits_type::move(__p + __pos, __s, __n2);3279 }
3268 return __null_terminate_at(__p, __sz + (__n2 - __n1));3280 traits_type::move(__p + __pos, __s, __n2);
3269 } else3281 return __null_terminate_at(__p, __sz + (__n2 - __n1));
3270 __grow_by_and_replace(__cap, __sz - __n1 + __n2 - __cap, __sz, __pos, __n1, __n2, __s);
3271 return *this;
3272}3282}
32733283
3274template <class _CharT, class _Traits, class _Allocator>3284template <class _CharT, class _Traits, class _Allocator>
...@@ -3320,16 +3330,17 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __...@@ -3320,16 +3330,17 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
3320// Does not check __pos against size()3330// Does not check __pos against size()
3321template <class _CharT, class _Traits, class _Allocator>3331template <class _CharT, class _Traits, class _Allocator>
3322_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE void3332_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE void
3323basic_string<_CharT, _Traits, _Allocator>::__erase_external_with_move(size_type __pos, size_type __n) {3333basic_string<_CharT, _Traits, _Allocator>::__erase_external_with_move(size_type __pos, size_type __n) _NOEXCEPT {
3324 if (__n) {3334 if (__n == 0)
3325 size_type __sz = size();3335 return;
3326 value_type* __p = std::__to_address(__get_pointer());3336
3327 __n = std::min(__n, __sz - __pos);3337 size_type __sz = size();
3328 size_type __n_move = __sz - __pos - __n;3338 value_type* __p = std::__to_address(__get_pointer());
3329 if (__n_move != 0)3339 __n = std::min(__n, __sz - __pos);
3330 traits_type::move(__p + __pos, __p + __pos + __n, __n_move);3340 size_type __n_move = __sz - __pos - __n;
3331 __null_terminate_at(__p, __sz - __n);3341 if (__n_move != 0)
3332 }3342 traits_type::move(__p + __pos, __p + __pos + __n, __n_move);
3343 __null_terminate_at(__p, __sz - __n);
3333}3344}
33343345
3335template <class _CharT, class _Traits, class _Allocator>3346template <class _CharT, class _Traits, class _Allocator>
...@@ -3396,16 +3407,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::re...@@ -3396,16 +3407,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::re
3396 __erase_to_end(__n);3407 __erase_to_end(__n);
3397}3408}
33983409
3399template <class _CharT, class _Traits, class _Allocator>
3400_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void
3401basic_string<_CharT, _Traits, _Allocator>::__resize_default_init(size_type __n) {
3402 size_type __sz = size();
3403 if (__n > __sz) {
3404 __append_default_init(__n - __sz);
3405 } else
3406 __erase_to_end(__n);
3407}
3408
3409template <class _CharT, class _Traits, class _Allocator>3410template <class _CharT, class _Traits, class _Allocator>
3410_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __requested_capacity) {3411_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __requested_capacity) {
3411 if (__requested_capacity > max_size())3412 if (__requested_capacity > max_size())
...@@ -3418,31 +3419,23 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::re...@@ -3418,31 +3419,23 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::re
3418 return;3419 return;
34193420
3420 __annotation_guard __g(*this);3421 __annotation_guard __g(*this);
3421 auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__requested_capacity) + 1);3422 __long __buffer = __allocate_long_buffer(__alloc_, __requested_capacity);
3422 auto __size = size();3423 __buffer.__size_ = size();
3423 __begin_lifetime(__allocation.ptr, __allocation.count);3424 traits_type::copy(std::__to_address(__buffer.__data_), data(), __buffer.__size_ + 1);
3424 traits_type::copy(std::__to_address(__allocation.ptr), data(), __size + 1);3425 __reset_internal_buffer(__buffer);
3425 if (__is_long())
3426 __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
3427 __set_long_cap(__allocation.count);
3428 __set_long_size(__size);
3429 __set_long_pointer(__allocation.ptr);
3430}3426}
34313427
3432template <class _CharT, class _Traits, class _Allocator>3428template <class _CharT, class _Traits, class _Allocator>
3433inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::shrink_to_fit() _NOEXCEPT {3429inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::shrink_to_fit() _NOEXCEPT {
3434 size_type __target_capacity = __recommend(size());3430 if (!__is_long())
3435 if (__target_capacity == capacity())
3436 return;3431 return;
34373432
3438 _LIBCPP_ASSERT_INTERNAL(__is_long(), "Trying to shrink small string");
3439
3440 // We're a long string and we're shrinking into the small buffer.
3441 const auto __ptr = __get_long_pointer();3433 const auto __ptr = __get_long_pointer();
3442 const auto __size = __get_long_size();3434 const auto __size = __get_long_size();
3443 const auto __cap = __get_long_cap();3435 const auto __cap = __get_long_cap();
34443436
3445 if (__fits_in_sso(__target_capacity)) {3437 // We're a long string and we're shrinking into the small buffer.
3438 if (__fits_in_sso(__size)) {
3446 __annotation_guard __g(*this);3439 __annotation_guard __g(*this);
3447 __set_short_size(__size);3440 __set_short_size(__size);
3448 traits_type::copy(std::__to_address(__get_short_pointer()), std::__to_address(__ptr), __size + 1);3441 traits_type::copy(std::__to_address(__get_short_pointer()), std::__to_address(__ptr), __size + 1);
...@@ -3450,25 +3443,25 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat...@@ -3450,25 +3443,25 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat
3450 return;3443 return;
3451 }3444 }
34523445
3446 if (__align_allocation_size(__size) == __cap)
3447 return;
3448
3453# if _LIBCPP_HAS_EXCEPTIONS3449# if _LIBCPP_HAS_EXCEPTIONS
3454 try {3450 try {
3455# endif // _LIBCPP_HAS_EXCEPTIONS3451# endif // _LIBCPP_HAS_EXCEPTIONS
3456 __annotation_guard __g(*this);3452 __annotation_guard __g(*this);
3457 auto __allocation = std::__allocate_at_least(__alloc_, __target_capacity + 1);3453 __long __buffer = __allocate_long_buffer(__alloc_, __size);
34583454
3459 // The Standard mandates shrink_to_fit() does not increase the capacity.3455 // The Standard mandates shrink_to_fit() does not increase the capacity.
3460 // With equal capacity keep the existing buffer. This avoids extra work3456 // With equal capacity keep the existing buffer. This avoids extra work
3461 // due to swapping the elements.3457 // due to swapping the elements.
3462 if (__allocation.count - 1 >= capacity()) {3458 if (__buffer.__cap_ * __endian_factor - 1 >= capacity()) {
3463 __alloc_traits::deallocate(__alloc_, __allocation.ptr, __allocation.count);3459 __alloc_traits::deallocate(__alloc_, __buffer.__data_, __buffer.__cap_ * __endian_factor);
3464 return;3460 return;
3465 }3461 }
34663462
3467 __begin_lifetime(__allocation.ptr, __allocation.count);3463 traits_type::copy(std::__to_address(__buffer.__data_), std::__to_address(__get_long_pointer()), __size + 1);
3468 traits_type::copy(std::__to_address(__allocation.ptr), std::__to_address(__ptr), __size + 1);3464 __reset_internal_buffer(__buffer);
3469 __alloc_traits::deallocate(__alloc_, __ptr, __cap);
3470 __set_long_cap(__allocation.count);
3471 __set_long_pointer(__allocation.ptr);
3472# if _LIBCPP_HAS_EXCEPTIONS3465# if _LIBCPP_HAS_EXCEPTIONS
3473 } catch (...) {3466 } catch (...) {
3474 return;3467 return;
...@@ -3574,7 +3567,8 @@ operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,...@@ -3574,7 +3567,8 @@ operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
35743567
3575template <class _CharT, class _Traits, class _Allocator>3568template <class _CharT, class _Traits, class _Allocator>
3576inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool3569inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
3577operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs) _NOEXCEPT {3570operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
3571 const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __rhs) _NOEXCEPT {
3578 _LIBCPP_ASSERT_NON_NULL(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");3572 _LIBCPP_ASSERT_NON_NULL(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
35793573
3580 using _String = basic_string<_CharT, _Traits, _Allocator>;3574 using _String = basic_string<_CharT, _Traits, _Allocator>;
...@@ -3858,46 +3852,52 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Tra...@@ -3858,46 +3852,52 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Tra
3858 __lhs.swap(__rhs);3852 __lhs.swap(__rhs);
3859}3853}
38603854
3861_LIBCPP_EXPORTED_FROM_ABI int stoi(const string& __str, size_t* __idx = nullptr, int __base = 10);3855[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI int stoi(const string& __str, size_t* __idx = nullptr, int __base = 10);
3862_LIBCPP_EXPORTED_FROM_ABI long stol(const string& __str, size_t* __idx = nullptr, int __base = 10);3856[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long
3863_LIBCPP_EXPORTED_FROM_ABI unsigned long stoul(const string& __str, size_t* __idx = nullptr, int __base = 10);3857stoul(const string& __str, size_t* __idx = nullptr, int __base = 10);
3864_LIBCPP_EXPORTED_FROM_ABI long long stoll(const string& __str, size_t* __idx = nullptr, int __base = 10);3858[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long stol(const string& __str, size_t* __idx = nullptr, int __base = 10);
3865_LIBCPP_EXPORTED_FROM_ABI unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);3859[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long long
38663860stoll(const string& __str, size_t* __idx = nullptr, int __base = 10);
3867_LIBCPP_EXPORTED_FROM_ABI float stof(const string& __str, size_t* __idx = nullptr);3861[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long long
3868_LIBCPP_EXPORTED_FROM_ABI double stod(const string& __str, size_t* __idx = nullptr);3862stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
3869_LIBCPP_EXPORTED_FROM_ABI long double stold(const string& __str, size_t* __idx = nullptr);3863
38703864[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI float stof(const string& __str, size_t* __idx = nullptr);
3871_LIBCPP_EXPORTED_FROM_ABI string to_string(int __val);3865[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI double stod(const string& __str, size_t* __idx = nullptr);
3872_LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned __val);3866[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long double stold(const string& __str, size_t* __idx = nullptr);
3873_LIBCPP_EXPORTED_FROM_ABI string to_string(long __val);3867
3874_LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long __val);3868[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(int __val);
3875_LIBCPP_EXPORTED_FROM_ABI string to_string(long long __val);3869[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned __val);
3876_LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long long __val);3870[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(long __val);
3877_LIBCPP_EXPORTED_FROM_ABI string to_string(float __val);3871[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long __val);
3878_LIBCPP_EXPORTED_FROM_ABI string to_string(double __val);3872[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(long long __val);
3879_LIBCPP_EXPORTED_FROM_ABI string to_string(long double __val);3873[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long long __val);
3874[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(float __val);
3875[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(double __val);
3876[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string(long double __val);
38803877
3881# if _LIBCPP_HAS_WIDE_CHARACTERS3878# if _LIBCPP_HAS_WIDE_CHARACTERS
3882_LIBCPP_EXPORTED_FROM_ABI int stoi(const wstring& __str, size_t* __idx = nullptr, int __base = 10);3879[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI int stoi(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
3883_LIBCPP_EXPORTED_FROM_ABI long stol(const wstring& __str, size_t* __idx = nullptr, int __base = 10);3880[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long stol(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
3884_LIBCPP_EXPORTED_FROM_ABI unsigned long stoul(const wstring& __str, size_t* __idx = nullptr, int __base = 10);3881[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long
3885_LIBCPP_EXPORTED_FROM_ABI long long stoll(const wstring& __str, size_t* __idx = nullptr, int __base = 10);3882stoul(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
3886_LIBCPP_EXPORTED_FROM_ABI unsigned long long stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10);3883[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long long
38873884stoll(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
3888_LIBCPP_EXPORTED_FROM_ABI float stof(const wstring& __str, size_t* __idx = nullptr);3885[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long long
3889_LIBCPP_EXPORTED_FROM_ABI double stod(const wstring& __str, size_t* __idx = nullptr);3886stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
3890_LIBCPP_EXPORTED_FROM_ABI long double stold(const wstring& __str, size_t* __idx = nullptr);3887
38913888[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI float stof(const wstring& __str, size_t* __idx = nullptr);
3892_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(int __val);3889[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI double stod(const wstring& __str, size_t* __idx = nullptr);
3893_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned __val);3890[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long double stold(const wstring& __str, size_t* __idx = nullptr);
3894_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long __val);3891
3895_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned long __val);3892[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(int __val);
3896_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long long __val);3893[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned __val);
3897_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned long long __val);3894[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long __val);
3898_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(float __val);3895[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned long __val);
3899_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(double __val);3896[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long long __val);
3900_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long double __val);3897[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned long long __val);
3898[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(float __val);
3899[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(double __val);
3900[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long double __val);
3901# endif // _LIBCPP_HAS_WIDE_CHARACTERS3901# endif // _LIBCPP_HAS_WIDE_CHARACTERS
39023902
3903template <class _CharT, class _Traits, class _Allocator>3903template <class _CharT, class _Traits, class _Allocator>
...@@ -3906,7 +3906,7 @@ _LIBCPP_TEMPLATE_DATA_VIS const typename basic_string<_CharT, _Traits, _Allocato...@@ -3906,7 +3906,7 @@ _LIBCPP_TEMPLATE_DATA_VIS const typename basic_string<_CharT, _Traits, _Allocato
39063906
3907template <class _CharT, class _Allocator>3907template <class _CharT, class _Allocator>
3908struct __string_hash : public __unary_function<basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t> {3908struct __string_hash : public __unary_function<basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t> {
3909 _LIBCPP_HIDE_FROM_ABI size_t3909 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t
3910 operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT {3910 operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT {
3911 return std::__do_string_hash(__val.data(), __val.data() + __val.size());3911 return std::__do_string_hash(__val.data(), __val.data() + __val.size());
3912 }3912 }
...@@ -3977,30 +3977,31 @@ erase_if(basic_string<_CharT, _Traits, _Allocator>& __str, _Predicate __pred) {...@@ -3977,30 +3977,31 @@ erase_if(basic_string<_CharT, _Traits, _Allocator>& __str, _Predicate __pred) {
3977// Literal suffixes for basic_string [basic.string.literals]3977// Literal suffixes for basic_string [basic.string.literals]
3978inline namespace literals {3978inline namespace literals {
3979inline namespace string_literals {3979inline namespace string_literals {
3980inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char>3980[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char>
3981operator""s(const char* __str, size_t __len) {3981operator""s(const char* __str, size_t __len) {
3982 return basic_string<char>(__str, __len);3982 return basic_string<char>(__str, __len);
3983}3983}
39843984
3985# if _LIBCPP_HAS_WIDE_CHARACTERS3985# if _LIBCPP_HAS_WIDE_CHARACTERS
3986inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<wchar_t>3986[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3987operator""s(const wchar_t* __str, size_t __len) {3987_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<wchar_t> operator""s(const wchar_t* __str, size_t __len) {
3988 return basic_string<wchar_t>(__str, __len);3988 return basic_string<wchar_t>(__str, __len);
3989}3989}
3990# endif3990# endif
39913991
3992# if _LIBCPP_HAS_CHAR8_T3992# if _LIBCPP_HAS_CHAR8_T
3993inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string<char8_t> operator""s(const char8_t* __str, size_t __len) {3993[[__nodiscard__]] inline
3994 _LIBCPP_HIDE_FROM_ABI constexpr basic_string<char8_t> operator""s(const char8_t* __str, size_t __len) {
3994 return basic_string<char8_t>(__str, __len);3995 return basic_string<char8_t>(__str, __len);
3995}3996}
3996# endif3997# endif
39973998
3998inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char16_t>3999[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3999operator""s(const char16_t* __str, size_t __len) {4000_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char16_t> operator""s(const char16_t* __str, size_t __len) {
4000 return basic_string<char16_t>(__str, __len);4001 return basic_string<char16_t>(__str, __len);
4001}4002}
40024003
4003inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char32_t>4004[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char32_t>
4004operator""s(const char32_t* __str, size_t __len) {4005operator""s(const char32_t* __str, size_t __len) {
4005 return basic_string<char32_t>(__str, __len);4006 return basic_string<char32_t>(__str, __len);
4006}4007}
lib/libcxx/include/string_view+113-89
...@@ -130,6 +130,8 @@ namespace std {...@@ -130,6 +130,8 @@ namespace std {
130 size_type copy(charT* s, size_type n, size_type pos = 0) const; // constexpr in C++20130 size_type copy(charT* s, size_type n, size_type pos = 0) const; // constexpr in C++20
131131
132 constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;132 constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
133 constexpr basic_string_view subview(size_type pos = 0,
134 size_type n = npos) const; // freestanding-deleted, since C++26
133 constexpr int compare(basic_string_view s) const noexcept;135 constexpr int compare(basic_string_view s) const noexcept;
134 constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const;136 constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const;
135 constexpr int compare(size_type pos1, size_type n1,137 constexpr int compare(size_type pos1, size_type n1,
...@@ -318,9 +320,9 @@ public:...@@ -318,9 +320,9 @@ public:
318 _LIBCPP_HIDE_FROM_ABI basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default;320 _LIBCPP_HIDE_FROM_ABI basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default;
319321
320 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT322 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
321 : __data_(__s),323 _LIBCPP_DIAGNOSE_NULLPTR_IF(__len != 0 && __s == nullptr, " if len is not zero")
322 __size_(__len) {324 : __data_(__s), __size_(__len) {
323# if _LIBCPP_STD_VER >= 14325# if !defined(_LIBCPP_CXX03_LANG) && (!defined(_LIBCPP_COMPILER_GCC) || _LIBCPP_STD_VER >= 14)
324 // Allocations must fit in `ptrdiff_t` for pointer arithmetic to work. If `__len` exceeds it, the input326 // Allocations must fit in `ptrdiff_t` for pointer arithmetic to work. If `__len` exceeds it, the input
325 // range could not have been valid. Most likely the caller underflowed some arithmetic and inadvertently327 // range could not have been valid. Most likely the caller underflowed some arithmetic and inadvertently
326 // passed in a negative length.328 // passed in a negative length.
...@@ -352,7 +354,7 @@ public:...@@ -352,7 +354,7 @@ public:
352 : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {}354 : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {}
353# endif // _LIBCPP_STD_VER >= 23355# endif // _LIBCPP_STD_VER >= 23
354356
355 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view(const _CharT* __s)357 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s)
356 : __data_(__s), __size_(std::__char_traits_length_checked<_Traits>(__s)) {}358 : __data_(__s), __size_(std::__char_traits_length_checked<_Traits>(__s)) {}
357359
358# if _LIBCPP_STD_VER >= 23360# if _LIBCPP_STD_VER >= 23
...@@ -360,11 +362,11 @@ public:...@@ -360,11 +362,11 @@ public:
360# endif362# endif
361363
362 // [string.view.iterators], iterators364 // [string.view.iterators], iterators
363 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return cbegin(); }365 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return cbegin(); }
364366
365 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return cend(); }367 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return cend(); }
366368
367 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {369 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
368# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS370# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
369 return std::__make_bounded_iter(data(), data(), data() + size());371 return std::__make_bounded_iter(data(), data(), data() + size());
370# else372# else
...@@ -372,7 +374,7 @@ public:...@@ -372,7 +374,7 @@ public:
372# endif374# endif
373 }375 }
374376
375 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {377 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {
376# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS378# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
377 return std::__make_bounded_iter(data() + size(), data(), data() + size());379 return std::__make_bounded_iter(data() + size(), data(), data() + size());
378# else380# else
...@@ -380,51 +382,54 @@ public:...@@ -380,51 +382,54 @@ public:
380# endif382# endif
381 }383 }
382384
383 _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {385 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
386 rbegin() const _NOEXCEPT {
384 return const_reverse_iterator(cend());387 return const_reverse_iterator(cend());
385 }388 }
386389
387 _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {390 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
388 return const_reverse_iterator(cbegin());391 return const_reverse_iterator(cbegin());
389 }392 }
390393
391 _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {394 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
395 crbegin() const _NOEXCEPT {
392 return const_reverse_iterator(cend());396 return const_reverse_iterator(cend());
393 }397 }
394398
395 _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {399 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {
396 return const_reverse_iterator(cbegin());400 return const_reverse_iterator(cbegin());
397 }401 }
398402
399 // [string.view.capacity], capacity403 // [string.view.capacity], capacity
400 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }404 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }
401405
402 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI size_type length() const _NOEXCEPT { return __size_; }406 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI size_type length() const _NOEXCEPT { return __size_; }
403407
404 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {408 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
405 return numeric_limits<size_type>::max() / sizeof(value_type);409 return numeric_limits<size_type>::max() / sizeof(value_type);
406 }410 }
407411
408 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return __size_ == 0; }412 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return __size_ == 0; }
409413
410 // [string.view.access], element access414 // [string.view.access], element access
411 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __pos) const _NOEXCEPT {415 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference
416 operator[](size_type __pos) const _NOEXCEPT {
412 return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];417 return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
413 }418 }
414419
415 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __pos) const {420 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __pos) const {
416 return __pos >= size() ? (__throw_out_of_range("string_view::at"), __data_[0]) : __data_[__pos];421 return __pos >= size() ? (__throw_out_of_range("string_view::at"), __data_[0]) : __data_[__pos];
417 }422 }
418423
419 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {424 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
420 return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::front(): string is empty"), __data_[0];425 return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::front(): string is empty"), __data_[0];
421 }426 }
422427
423 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {428 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
424 return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::back(): string is empty"), __data_[__size_ - 1];429 return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::back(): string is empty"), __data_[__size_ - 1];
425 }430 }
426431
427 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_pointer data() const _NOEXCEPT { return __data_; }432 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_pointer data() const _NOEXCEPT { return __data_; }
428433
429 // [string.view.modifiers], modifiers:434 // [string.view.modifiers], modifiers:
430 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI void remove_prefix(size_type __n) _NOEXCEPT {435 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI void remove_prefix(size_type __n) _NOEXCEPT {
...@@ -457,15 +462,23 @@ public:...@@ -457,15 +462,23 @@ public:
457 return __rlen;462 return __rlen;
458 }463 }
459464
460 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view substr(size_type __pos = 0, size_type __n = npos) const {465 [[__nodiscard__]] _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view
466 substr(size_type __pos = 0, size_type __n = npos) const {
461 // Use the `__assume_valid` form of the constructor to avoid an unnecessary check. Any substring of a view is a467 // Use the `__assume_valid` form of the constructor to avoid an unnecessary check. Any substring of a view is a
462 // valid view. In particular, `size()` is known to be smaller than `numeric_limits<difference_type>::max()`, so the468 // valid view. In particular, `size()` is known to be smaller than `numeric_limits<difference_type>::max()`, so the
463 // new size is also smaller. See also https://github.com/llvm/llvm-project/issues/91634.469 // new size is also smaller. See also https://llvm.org/PR91634.
464 return __pos > size() ? (__throw_out_of_range("string_view::substr"), basic_string_view())470 return __pos > size() ? (__throw_out_of_range("string_view::substr"), basic_string_view())
465 : basic_string_view(__assume_valid(), data() + __pos, std::min(__n, size() - __pos));471 : basic_string_view(__assume_valid(), data() + __pos, std::min(__n, size() - __pos));
466 }472 }
467473
468 _LIBCPP_CONSTEXPR_SINCE_CXX14 int compare(basic_string_view __sv) const _NOEXCEPT {474# if _LIBCPP_STD_VER >= 26
475 [[nodiscard]]
476 _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view subview(size_type __pos = 0, size_type __n = npos) const {
477 return substr(__pos, __n);
478 }
479# endif
480
481 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 int compare(basic_string_view __sv) const _NOEXCEPT {
469 size_type __rlen = std::min(size(), __sv.size());482 size_type __rlen = std::min(size(), __sv.size());
470 int __retval = _Traits::compare(data(), __sv.data(), __rlen);483 int __retval = _Traits::compare(data(), __sv.data(), __rlen);
471 if (__retval == 0) // first __rlen chars matched484 if (__retval == 0) // first __rlen chars matched
...@@ -473,217 +486,226 @@ public:...@@ -473,217 +486,226 @@ public:
473 return __retval;486 return __retval;
474 }487 }
475488
476 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int489 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int
477 compare(size_type __pos1, size_type __n1, basic_string_view __sv) const {490 compare(size_type __pos1, size_type __n1, basic_string_view __sv) const {
478 return substr(__pos1, __n1).compare(__sv);491 return substr(__pos1, __n1).compare(__sv);
479 }492 }
480493
481 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int494 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int
482 compare(size_type __pos1, size_type __n1, basic_string_view __sv, size_type __pos2, size_type __n2) const {495 compare(size_type __pos1, size_type __n1, basic_string_view __sv, size_type __pos2, size_type __n2) const {
483 return substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));496 return substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
484 }497 }
485498
486 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int compare(const _CharT* __s) const _NOEXCEPT {499 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int
500 compare(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) const _NOEXCEPT {
487 return compare(basic_string_view(__s));501 return compare(basic_string_view(__s));
488 }502 }
489503
490 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int504 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int
491 compare(size_type __pos1, size_type __n1, const _CharT* __s) const {505 compare(size_type __pos1, size_type __n1, const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
492 return substr(__pos1, __n1).compare(basic_string_view(__s));506 return substr(__pos1, __n1).compare(basic_string_view(__s));
493 }507 }
494508
495 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int509 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI int
496 compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const {510 compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const
511 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n2 != 0 && __s == nullptr, " if n2 is not zero") {
497 return substr(__pos1, __n1).compare(basic_string_view(__s, __n2));512 return substr(__pos1, __n1).compare(basic_string_view(__s, __n2));
498 }513 }
499514
500 // find515 // find
501 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type516 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
502 find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT {517 find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT {
503 _LIBCPP_ASSERT_NON_NULL(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
504 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __s.data(), __pos, __s.size());518 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __s.data(), __pos, __s.size());
505 }519 }
506520
507 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type find(_CharT __c, size_type __pos = 0) const _NOEXCEPT {521 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
522 find(_CharT __c, size_type __pos = 0) const _NOEXCEPT {
508 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);523 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
509 }524 }
510525
511 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type526 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
512 find(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT {527 find(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
528 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
513 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");529 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
514 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);530 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
515 }531 }
516532
517 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type533 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
518 find(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT {534 find(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
519 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find(): received nullptr");535 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find(): received nullptr");
520 return std::__str_find<value_type, size_type, traits_type, npos>(536 return std::__str_find<value_type, size_type, traits_type, npos>(
521 data(), size(), __s, __pos, traits_type::length(__s));537 data(), size(), __s, __pos, traits_type::length(__s));
522 }538 }
523539
524 // rfind540 // rfind
525 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type541 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
526 rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT {542 rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT {
527 _LIBCPP_ASSERT_NON_NULL(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
528 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __s.data(), __pos, __s.size());543 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __s.data(), __pos, __s.size());
529 }544 }
530545
531 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type546 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
532 rfind(_CharT __c, size_type __pos = npos) const _NOEXCEPT {547 rfind(_CharT __c, size_type __pos = npos) const _NOEXCEPT {
533 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);548 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
534 }549 }
535550
536 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type551 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
537 rfind(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT {552 rfind(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
553 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
538 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");554 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
539 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);555 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
540 }556 }
541557
542 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type558 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
543 rfind(const _CharT* __s, size_type __pos = npos) const _NOEXCEPT {559 rfind(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
544 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::rfind(): received nullptr");560 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::rfind(): received nullptr");
545 return std::__str_rfind<value_type, size_type, traits_type, npos>(561 return std::__str_rfind<value_type, size_type, traits_type, npos>(
546 data(), size(), __s, __pos, traits_type::length(__s));562 data(), size(), __s, __pos, traits_type::length(__s));
547 }563 }
548564
549 // find_first_of565 // find_first_of
550 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type566 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
551 find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT {567 find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT {
552 _LIBCPP_ASSERT_NON_NULL(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr");
553 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(568 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
554 data(), size(), __s.data(), __pos, __s.size());569 data(), size(), __s.data(), __pos, __s.size());
555 }570 }
556571
557 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type572 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
558 find_first_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT {573 find_first_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT {
559 return find(__c, __pos);574 return find(__c, __pos);
560 }575 }
561576
562 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type577 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
563 find_first_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT {578 find_first_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
579 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
564 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");580 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
565 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);581 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
566 }582 }
567583
568 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type584 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
569 find_first_of(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT {585 find_first_of(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
570 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_first_of(): received nullptr");586 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_first_of(): received nullptr");
571 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(587 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
572 data(), size(), __s, __pos, traits_type::length(__s));588 data(), size(), __s, __pos, traits_type::length(__s));
573 }589 }
574590
575 // find_last_of591 // find_last_of
576 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type592 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
577 find_last_of(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT {593 find_last_of(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT {
578 _LIBCPP_ASSERT_NON_NULL(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr");
579 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(594 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
580 data(), size(), __s.data(), __pos, __s.size());595 data(), size(), __s.data(), __pos, __s.size());
581 }596 }
582597
583 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type598 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
584 find_last_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT {599 find_last_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT {
585 return rfind(__c, __pos);600 return rfind(__c, __pos);
586 }601 }
587602
588 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type603 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
589 find_last_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT {604 find_last_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
605 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
590 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");606 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
591 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);607 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
592 }608 }
593609
594 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type610 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
595 find_last_of(const _CharT* __s, size_type __pos = npos) const _NOEXCEPT {611 find_last_of(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
596 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_last_of(): received nullptr");612 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_last_of(): received nullptr");
597 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(613 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
598 data(), size(), __s, __pos, traits_type::length(__s));614 data(), size(), __s, __pos, traits_type::length(__s));
599 }615 }
600616
601 // find_first_not_of617 // find_first_not_of
602 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type618 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
603 find_first_not_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT {619 find_first_not_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT {
604 _LIBCPP_ASSERT_NON_NULL(
605 __s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr");
606 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(620 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
607 data(), size(), __s.data(), __pos, __s.size());621 data(), size(), __s.data(), __pos, __s.size());
608 }622 }
609623
610 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type624 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
611 find_first_not_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT {625 find_first_not_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT {
612 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);626 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
613 }627 }
614628
615 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type629 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
616 find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT {630 find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
631 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
617 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");632 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
618 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);633 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
619 }634 }
620635
621 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type636 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
622 find_first_not_of(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT {637 find_first_not_of(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
623 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_first_not_of(): received nullptr");638 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
624 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(639 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
625 data(), size(), __s, __pos, traits_type::length(__s));640 data(), size(), __s, __pos, traits_type::length(__s));
626 }641 }
627642
628 // find_last_not_of643 // find_last_not_of
629 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type644 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
630 find_last_not_of(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT {645 find_last_not_of(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT {
631 _LIBCPP_ASSERT_NON_NULL(
632 __s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr");
633 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(646 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
634 data(), size(), __s.data(), __pos, __s.size());647 data(), size(), __s.data(), __pos, __s.size());
635 }648 }
636649
637 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type650 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
638 find_last_not_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT {651 find_last_not_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT {
639 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);652 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
640 }653 }
641654
642 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type655 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
643 find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT {656 find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
657 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {
644 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");658 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
645 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);659 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(data(), size(), __s, __pos, __n);
646 }660 }
647661
648 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type662 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI size_type
649 find_last_not_of(const _CharT* __s, size_type __pos = npos) const _NOEXCEPT {663 find_last_not_of(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
650 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_last_not_of(): received nullptr");664 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
651 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(665 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
652 data(), size(), __s, __pos, traits_type::length(__s));666 data(), size(), __s, __pos, traits_type::length(__s));
653 }667 }
654668
655# if _LIBCPP_STD_VER >= 20669# if _LIBCPP_STD_VER >= 20
656 constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(basic_string_view __s) const noexcept {670 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(basic_string_view __s) const noexcept {
657 return size() >= __s.size() && compare(0, __s.size(), __s) == 0;671 return size() >= __s.size() && compare(0, __s.size(), __s) == 0;
658 }672 }
659673
660 constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(value_type __c) const noexcept {674 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(value_type __c) const noexcept {
661 return !empty() && _Traits::eq(front(), __c);675 return !empty() && _Traits::eq(front(), __c);
662 }676 }
663677
664 constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(const value_type* __s) const noexcept {678 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool
679 starts_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
665 return starts_with(basic_string_view(__s));680 return starts_with(basic_string_view(__s));
666 }681 }
667682
668 constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(basic_string_view __s) const noexcept {683 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(basic_string_view __s) const noexcept {
669 return size() >= __s.size() && compare(size() - __s.size(), npos, __s) == 0;684 return size() >= __s.size() && compare(size() - __s.size(), npos, __s) == 0;
670 }685 }
671686
672 constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(value_type __c) const noexcept {687 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(value_type __c) const noexcept {
673 return !empty() && _Traits::eq(back(), __c);688 return !empty() && _Traits::eq(back(), __c);
674 }689 }
675690
676 constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(const value_type* __s) const noexcept {691 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool
692 ends_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
677 return ends_with(basic_string_view(__s));693 return ends_with(basic_string_view(__s));
678 }694 }
679# endif695# endif
680696
681# if _LIBCPP_STD_VER >= 23697# if _LIBCPP_STD_VER >= 23
682 constexpr _LIBCPP_HIDE_FROM_ABI bool contains(basic_string_view __sv) const noexcept { return find(__sv) != npos; }698 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool contains(basic_string_view __sv) const noexcept {
699 return find(__sv) != npos;
700 }
683701
684 constexpr _LIBCPP_HIDE_FROM_ABI bool contains(value_type __c) const noexcept { return find(__c) != npos; }702 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool contains(value_type __c) const noexcept {
703 return find(__c) != npos;
704 }
685705
686 constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* __s) const { return find(__s) != npos; }706 [[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
707 return find(__s) != npos;
708 }
687# endif709# endif
688710
689private:711private:
...@@ -886,7 +908,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Trai...@@ -886,7 +908,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Trai
886// [string.view.hash]908// [string.view.hash]
887template <class _CharT>909template <class _CharT>
888struct __string_view_hash : public __unary_function<basic_string_view<_CharT, char_traits<_CharT> >, size_t> {910struct __string_view_hash : public __unary_function<basic_string_view<_CharT, char_traits<_CharT> >, size_t> {
889 _LIBCPP_HIDE_FROM_ABI size_t operator()(const basic_string_view<_CharT, char_traits<_CharT> > __val) const _NOEXCEPT {911 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t
912 operator()(const basic_string_view<_CharT, char_traits<_CharT> > __val) const _NOEXCEPT {
890 return std::__do_string_hash(__val.data(), __val.data() + __val.size());913 return std::__do_string_hash(__val.data(), __val.data() + __val.size());
891 }914 }
892};915};
...@@ -913,30 +936,31 @@ struct hash<basic_string_view<wchar_t, char_traits<wchar_t> > > : __string_view_...@@ -913,30 +936,31 @@ struct hash<basic_string_view<wchar_t, char_traits<wchar_t> > > : __string_view_
913# if _LIBCPP_STD_VER >= 14936# if _LIBCPP_STD_VER >= 14
914inline namespace literals {937inline namespace literals {
915inline namespace string_view_literals {938inline namespace string_view_literals {
916inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char> operator""sv(const char* __str, size_t __len) noexcept {939[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char>
940operator""sv(const char* __str, size_t __len) noexcept {
917 return basic_string_view<char>(__str, __len);941 return basic_string_view<char>(__str, __len);
918}942}
919943
920# if _LIBCPP_HAS_WIDE_CHARACTERS944# if _LIBCPP_HAS_WIDE_CHARACTERS
921inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<wchar_t>945[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<wchar_t>
922operator""sv(const wchar_t* __str, size_t __len) noexcept {946operator""sv(const wchar_t* __str, size_t __len) noexcept {
923 return basic_string_view<wchar_t>(__str, __len);947 return basic_string_view<wchar_t>(__str, __len);
924}948}
925# endif949# endif
926950
927# if _LIBCPP_HAS_CHAR8_T951# if _LIBCPP_HAS_CHAR8_T
928inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char8_t>952[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char8_t>
929operator""sv(const char8_t* __str, size_t __len) noexcept {953operator""sv(const char8_t* __str, size_t __len) noexcept {
930 return basic_string_view<char8_t>(__str, __len);954 return basic_string_view<char8_t>(__str, __len);
931}955}
932# endif956# endif
933957
934inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char16_t>958[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char16_t>
935operator""sv(const char16_t* __str, size_t __len) noexcept {959operator""sv(const char16_t* __str, size_t __len) noexcept {
936 return basic_string_view<char16_t>(__str, __len);960 return basic_string_view<char16_t>(__str, __len);
937}961}
938962
939inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char32_t>963[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char32_t>
940operator""sv(const char32_t* __str, size_t __len) noexcept {964operator""sv(const char32_t* __str, size_t __len) noexcept {
941 return basic_string_view<char32_t>(__str, __len);965 return basic_string_view<char32_t>(__str, __len);
942}966}
lib/libcxx/include/strstream+10-10
...@@ -179,8 +179,8 @@ public:...@@ -179,8 +179,8 @@ public:
179 void swap(strstreambuf& __rhs);179 void swap(strstreambuf& __rhs);
180180
181 void freeze(bool __freezefl = true);181 void freeze(bool __freezefl = true);
182 char* str();182 [[__nodiscard__]] char* str();
183 int pcount() const;183 [[__nodiscard__]] int pcount() const;
184184
185protected:185protected:
186 int_type overflow(int_type __c = EOF) override;186 int_type overflow(int_type __c = EOF) override;
...@@ -264,8 +264,8 @@ public:...@@ -264,8 +264,8 @@ public:
264 __sb_.swap(__rhs.__sb_);264 __sb_.swap(__rhs.__sb_);
265 }265 }
266266
267 _LIBCPP_HIDE_FROM_ABI strstreambuf* rdbuf() const { return const_cast<strstreambuf*>(&__sb_); }267 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI strstreambuf* rdbuf() const { return const_cast<strstreambuf*>(&__sb_); }
268 _LIBCPP_HIDE_FROM_ABI char* str() { return __sb_.str(); }268 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char* str() { return __sb_.str(); }
269269
270private:270private:
271 strstreambuf __sb_;271 strstreambuf __sb_;
...@@ -297,10 +297,10 @@ public:...@@ -297,10 +297,10 @@ public:
297 __sb_.swap(__rhs.__sb_);297 __sb_.swap(__rhs.__sb_);
298 }298 }
299299
300 _LIBCPP_HIDE_FROM_ABI strstreambuf* rdbuf() const { return const_cast<strstreambuf*>(&__sb_); }300 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI strstreambuf* rdbuf() const { return const_cast<strstreambuf*>(&__sb_); }
301 _LIBCPP_HIDE_FROM_ABI void freeze(bool __freezefl = true) { __sb_.freeze(__freezefl); }301 _LIBCPP_HIDE_FROM_ABI void freeze(bool __freezefl = true) { __sb_.freeze(__freezefl); }
302 _LIBCPP_HIDE_FROM_ABI char* str() { return __sb_.str(); }302 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char* str() { return __sb_.str(); }
303 _LIBCPP_HIDE_FROM_ABI int pcount() const { return __sb_.pcount(); }303 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int pcount() const { return __sb_.pcount(); }
304304
305private:305private:
306 strstreambuf __sb_; // exposition only306 strstreambuf __sb_; // exposition only
...@@ -340,10 +340,10 @@ public:...@@ -340,10 +340,10 @@ public:
340 }340 }
341341
342 // Members:342 // Members:
343 _LIBCPP_HIDE_FROM_ABI strstreambuf* rdbuf() const { return const_cast<strstreambuf*>(&__sb_); }343 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI strstreambuf* rdbuf() const { return const_cast<strstreambuf*>(&__sb_); }
344 _LIBCPP_HIDE_FROM_ABI void freeze(bool __freezefl = true) { __sb_.freeze(__freezefl); }344 _LIBCPP_HIDE_FROM_ABI void freeze(bool __freezefl = true) { __sb_.freeze(__freezefl); }
345 _LIBCPP_HIDE_FROM_ABI int pcount() const { return __sb_.pcount(); }345 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int pcount() const { return __sb_.pcount(); }
346 _LIBCPP_HIDE_FROM_ABI char* str() { return __sb_.str(); }346 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char* str() { return __sb_.str(); }
347347
348private:348private:
349 strstreambuf __sb_; // exposition only349 strstreambuf __sb_; // exposition only
lib/libcxx/include/syncstream+4-4
...@@ -317,9 +317,9 @@ public:...@@ -317,9 +317,9 @@ public:
317317
318 _LIBCPP_HIDE_FROM_ABI bool emit() { return emit(false); }318 _LIBCPP_HIDE_FROM_ABI bool emit() { return emit(false); }
319319
320 _LIBCPP_HIDE_FROM_ABI streambuf_type* get_wrapped() const noexcept { return __wrapped_; }320 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI streambuf_type* get_wrapped() const noexcept { return __wrapped_; }
321321
322 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const noexcept { return __str_.get_allocator(); }322 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const noexcept { return __str_.get_allocator(); }
323323
324 _LIBCPP_HIDE_FROM_ABI void set_emit_on_sync(bool __b) noexcept { __emit_on_sync_ = __b; }324 _LIBCPP_HIDE_FROM_ABI void set_emit_on_sync(bool __b) noexcept { __emit_on_sync_ = __b; }
325325
...@@ -496,9 +496,9 @@ public:...@@ -496,9 +496,9 @@ public:
496 }496 }
497 }497 }
498498
499 _LIBCPP_HIDE_FROM_ABI streambuf_type* get_wrapped() const noexcept { return __sb_.get_wrapped(); }499 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI streambuf_type* get_wrapped() const noexcept { return __sb_.get_wrapped(); }
500500
501 _LIBCPP_HIDE_FROM_ABI syncbuf_type* rdbuf() const noexcept {501 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI syncbuf_type* rdbuf() const noexcept {
502 return const_cast<syncbuf_type*>(std::addressof(__sb_));502 return const_cast<syncbuf_type*>(std::addressof(__sb_));
503 }503 }
504504
lib/libcxx/include/tgmath.h+12-12
...@@ -18,22 +18,22 @@...@@ -18,22 +18,22 @@
18*/18*/
1919
20#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)20#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
21# include <__cxx03/tgmath.h>21# include <__cxx03/__config>
22#else22#else
23# include <__config>23# include <__config>
24#endif
2425
25# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
26# pragma GCC system_header27# pragma GCC system_header
27# endif28#endif
2829
29# ifdef __cplusplus30#ifdef __cplusplus
30# include <cmath>31# include <cmath>
31# include <complex>32# include <complex>
32# else33#else
33# if __has_include_next(<tgmath.h>)34# if __has_include_next(<tgmath.h>)
34# include_next <tgmath.h>35# include_next <tgmath.h>
35# endif
36# endif36# endif
37#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)37#endif
3838
39#endif // _LIBCPP_TGMATH_H39#endif // _LIBCPP_TGMATH_H
lib/libcxx/include/tuple+242-212
...@@ -106,6 +106,11 @@ public:...@@ -106,6 +106,11 @@ public:
106106
107 void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...)); // constexpr in C++20107 void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...)); // constexpr in C++20
108 constexpr void swap(const tuple&) const noexcept(see-below); // C++23108 constexpr void swap(const tuple&) const noexcept(see-below); // C++23
109
110 template<tuple-like UTuple>
111 friend constexpr bool operator==(const tuple& t, const UTuple& u); // C++23
112 template<tuple-like UTuple>
113 friend constexpr auto operator<=>(const tuple& t, const UTuple& u); // C++23
109};114};
110115
111116
...@@ -220,19 +225,16 @@ template <class... Types>...@@ -220,19 +225,16 @@ template <class... Types>
220# include <__config>225# include <__config>
221# include <__cstddef/size_t.h>226# include <__cstddef/size_t.h>
222# include <__fwd/array.h>227# include <__fwd/array.h>
228# include <__fwd/get.h>
223# include <__fwd/pair.h>229# include <__fwd/pair.h>
224# include <__fwd/tuple.h>230# include <__fwd/tuple.h>
225# include <__memory/allocator_arg_t.h>231# include <__memory/allocator_arg_t.h>
226# include <__memory/uses_allocator.h>232# include <__memory/uses_allocator.h>
227# include <__tuple/find_index.h>233# include <__tuple/find_index.h>
228# include <__tuple/ignore.h>234# include <__tuple/ignore.h>
229# include <__tuple/make_tuple_types.h>
230# include <__tuple/sfinae_helpers.h>
231# include <__tuple/tuple_element.h>235# include <__tuple/tuple_element.h>
232# include <__tuple/tuple_indices.h>236# include <__tuple/tuple_like.h>
233# include <__tuple/tuple_like_ext.h>
234# include <__tuple/tuple_size.h>237# include <__tuple/tuple_size.h>
235# include <__tuple/tuple_types.h>
236# include <__type_traits/common_reference.h>238# include <__type_traits/common_reference.h>
237# include <__type_traits/common_type.h>239# include <__type_traits/common_type.h>
238# include <__type_traits/conditional.h>240# include <__type_traits/conditional.h>
...@@ -241,7 +243,6 @@ template <class... Types>...@@ -241,7 +243,6 @@ template <class... Types>
241# include <__type_traits/disjunction.h>243# include <__type_traits/disjunction.h>
242# include <__type_traits/enable_if.h>244# include <__type_traits/enable_if.h>
243# include <__type_traits/invoke.h>245# include <__type_traits/invoke.h>
244# include <__type_traits/is_arithmetic.h>
245# include <__type_traits/is_assignable.h>246# include <__type_traits/is_assignable.h>
246# include <__type_traits/is_constructible.h>247# include <__type_traits/is_constructible.h>
247# include <__type_traits/is_convertible.h>248# include <__type_traits/is_convertible.h>
...@@ -251,7 +252,6 @@ template <class... Types>...@@ -251,7 +252,6 @@ template <class... Types>
251# include <__type_traits/is_nothrow_assignable.h>252# include <__type_traits/is_nothrow_assignable.h>
252# include <__type_traits/is_nothrow_constructible.h>253# include <__type_traits/is_nothrow_constructible.h>
253# include <__type_traits/is_reference.h>254# include <__type_traits/is_reference.h>
254# include <__type_traits/is_replaceable.h>
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>
...@@ -263,12 +263,12 @@ template <class... Types>...@@ -263,12 +263,12 @@ template <class... Types>
263# include <__type_traits/remove_cv.h>263# include <__type_traits/remove_cv.h>
264# include <__type_traits/remove_cvref.h>264# include <__type_traits/remove_cvref.h>
265# include <__type_traits/remove_reference.h>265# include <__type_traits/remove_reference.h>
266# include <__type_traits/type_list.h>
266# include <__type_traits/unwrap_ref.h>267# include <__type_traits/unwrap_ref.h>
267# include <__utility/declval.h>268# include <__utility/declval.h>
268# include <__utility/forward.h>269# include <__utility/forward.h>
269# include <__utility/integer_sequence.h>270# include <__utility/integer_sequence.h>
270# include <__utility/move.h>271# include <__utility/move.h>
271# include <__utility/piecewise_construct.h>
272# include <__utility/swap.h>272# include <__utility/swap.h>
273# include <version>273# include <version>
274274
...@@ -288,9 +288,65 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -288,9 +288,65 @@ _LIBCPP_BEGIN_NAMESPACE_STD
288288
289# ifndef _LIBCPP_CXX03_LANG289# ifndef _LIBCPP_CXX03_LANG
290290
291template <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) {
293 if constexpr (_Ip == 0)
294 return true;
295 else
296 return std::__tuple_compare_equal<_Ip - 1>(__x, __y) && std::get<_Ip - 1>(__x) == std::get<_Ip - 1>(__y);
297}
298
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 >= 20
314template <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...>) {
316 _Ret __result = strong_ordering::equal;
317 static_cast<void>(
318 ((__result = std::__synth_three_way(std::get<_Is>(__x), std::get<_Is>(__y)), __result != 0) || ...));
319 return __result;
320}
321# endif // _LIBCPP_STD_VER >= 20
322
323# if _LIBCPP_STD_VER >= 23
324template <class _Tp>
325concept __tuple_like_no_tuple = __tuple_like<_Tp> && !__is_tuple_v<_Tp>;
326
327template <class _Tp, class _Up, class _IndexSeq>
328struct __tuple_common_comparison_category_impl {};
329
330// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
331// because the resolution of CWG2369 landed in LLVM-21.
332template <class _Tp, class _Up, size_t... _Is>
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};
341
342template <__tuple_like _Tp, __tuple_like _Up>
343using __tuple_common_comparison_category _LIBCPP_NODEBUG =
344 __tuple_common_comparison_category_impl<_Tp, _Up, make_index_sequence<tuple_size_v<_Tp>>>::type;
345# endif // _LIBCPP_STD_VER >= 23
346
291// __tuple_leaf347// __tuple_leaf
292348
293template <size_t _Ip, class _Hp, bool = is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value >349template <size_t _Ip, class _Hp, bool = is_empty<_Hp>::value && !__is_final_v<_Hp> >
294class __tuple_leaf;350class __tuple_leaf;
295351
296template <size_t _Ip, class _Hp, bool _Ep>352template <size_t _Ip, class _Hp, bool _Ep>
...@@ -444,62 +500,52 @@ public:...@@ -444,62 +500,52 @@ public:
444template <class... _Tp>500template <class... _Tp>
445_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swallow(_Tp&&...) _NOEXCEPT {}501_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swallow(_Tp&&...) _NOEXCEPT {}
446502
447template <class _Tp>
448struct __all_default_constructible;
449
450template <class... _Tp>
451struct __all_default_constructible<__tuple_types<_Tp...>> : __all<is_default_constructible<_Tp>::value...> {};
452
453// __tuple_impl503// __tuple_impl
454504
455template <class _Indx, class... _Tp>505template <class _Indx, class... _Tp>
456struct __tuple_impl;506struct __tuple_impl;
457507
508struct __forward_args {};
509struct __value_init {};
510struct __from_tuple {};
511
458template <size_t... _Indx, class... _Tp>512template <size_t... _Indx, class... _Tp>
459struct _LIBCPP_DECLSPEC_EMPTY_BASES513struct _LIBCPP_DECLSPEC_EMPTY_BASES
460 __tuple_impl<__tuple_indices<_Indx...>, _Tp...> : public __tuple_leaf<_Indx, _Tp>... {514 __tuple_impl<__index_sequence<_Indx...>, _Tp...> : public __tuple_leaf<_Indx, _Tp>... {
461 _LIBCPP_HIDE_FROM_ABI constexpr __tuple_impl() noexcept(515 _LIBCPP_HIDE_FROM_ABI constexpr __tuple_impl() noexcept(
462 __all<is_nothrow_default_constructible<_Tp>::value...>::value) {}516 __all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
463517
464 template <size_t... _Uf, class... _Tf, size_t... _Ul, class... _Tl, class... _Up>518 template <class... _Args>
465 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(519 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(__forward_args, _Args&&... __args)
466 __tuple_indices<_Uf...>,520 : __tuple_leaf<_Indx, _Tp>(std::forward<_Args>(__args))... {}
467 __tuple_types<_Tf...>,521
468 __tuple_indices<_Ul...>,522 template <class _Alloc>
469 __tuple_types<_Tl...>,523 _LIBCPP_HIDE_FROM_ABI
470 _Up&&... __u) noexcept(__all<is_nothrow_constructible<_Tf, _Up>::value...>::value &&524 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(allocator_arg_t, const _Alloc& __alloc, __value_init)
471 __all<is_nothrow_default_constructible<_Tl>::value...>::value)525 : __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc>(), __alloc)... {}
472 : __tuple_leaf<_Uf, _Tf>(std::forward<_Up>(__u))..., __tuple_leaf<_Ul, _Tl>()... {}526
473527 template <class _Alloc, class... _Args>
474 template <class _Alloc, size_t... _Uf, class... _Tf, size_t... _Ul, class... _Tl, class... _Up>
475 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(528 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(
476 allocator_arg_t,529 allocator_arg_t, const _Alloc& __alloc, __forward_args, _Args&&... __args)
477 const _Alloc& __a,530 : __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, _Args>(), __alloc, std::forward<_Args>(__args))... {}
478 __tuple_indices<_Uf...>,531
479 __tuple_types<_Tf...>,532 template <class _Tuple>
480 __tuple_indices<_Ul...>,533 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl(__from_tuple, _Tuple&& __t) noexcept(
481 __tuple_types<_Tl...>,534 (__all<is_nothrow_constructible<_Tp, __copy_cvref_t<_Tuple, __tuple_element_t<_Indx, __remove_cvref_t<_Tuple>>>>::
482 _Up&&... __u)535 value...>::value))
483 : __tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a, std::forward<_Up>(__u))...,
484 __tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)... {}
485
486 template <class _Tuple, __enable_if_t<__tuple_constructible<_Tuple, tuple<_Tp...> >::value, int> = 0>
487 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl(_Tuple&& __t) noexcept(
488 (__all<is_nothrow_constructible<
489 _Tp,
490 typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
491 : __tuple_leaf<_Indx, _Tp>(536 : __tuple_leaf<_Indx, _Tp>(
492 std::forward<typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>(537 std::forward<__copy_cvref_t<_Tuple, __tuple_element_t<_Indx, __remove_cvref_t<_Tuple>>>>(
493 std::get<_Indx>(__t)))... {}538 std::get<_Indx>(__t)))... {}
494539
495 template <class _Alloc, class _Tuple, __enable_if_t<__tuple_constructible<_Tuple, tuple<_Tp...> >::value, int> = 0>540 template <class _Alloc, class _Tuple>
496 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)541 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
542 __tuple_impl(allocator_arg_t, const _Alloc& __a, __from_tuple, _Tuple&& __t)
497 : __tuple_leaf<_Indx, _Tp>(543 : __tuple_leaf<_Indx, _Tp>(
498 __uses_alloc_ctor<_Tp,544 __uses_alloc_ctor<_Tp,
499 _Alloc,545 _Alloc,
500 typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>(),546 __copy_cvref_t<_Tuple, __tuple_element_t<_Indx, __remove_cvref_t<_Tuple>>>>(),
501 __a,547 __a,
502 std::forward<typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>(548 std::forward<__copy_cvref_t<_Tuple, __tuple_element_t<_Indx, __remove_cvref_t<_Tuple>>>>(
503 std::get<_Indx>(__t)))... {}549 std::get<_Indx>(__t)))... {}
504550
505 __tuple_impl(const __tuple_impl&) = default;551 __tuple_impl(const __tuple_impl&) = default;
...@@ -518,19 +564,19 @@ struct _LIBCPP_DECLSPEC_EMPTY_BASES...@@ -518,19 +564,19 @@ struct _LIBCPP_DECLSPEC_EMPTY_BASES
518564
519template <class _Dest, class _Source, size_t... _Np>565template <class _Dest, class _Source, size_t... _Np>
520_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void566_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
521__memberwise_copy_assign(_Dest& __dest, _Source const& __source, __tuple_indices<_Np...>) {567__memberwise_copy_assign(_Dest& __dest, _Source const& __source, __index_sequence<_Np...>) {
522 std::__swallow(((std::get<_Np>(__dest) = std::get<_Np>(__source)), void(), 0)...);568 std::__swallow(((std::get<_Np>(__dest) = std::get<_Np>(__source)), void(), 0)...);
523}569}
524570
525template <class _Dest, class _Source, class... _Up, size_t... _Np>571template <class _Dest, class _Source, class... _Up, size_t... _Np>
526_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void572_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
527__memberwise_forward_assign(_Dest& __dest, _Source&& __source, __tuple_types<_Up...>, __tuple_indices<_Np...>) {573__memberwise_forward_assign(_Dest& __dest, _Source&& __source, __type_list<_Up...>, __index_sequence<_Np...>) {
528 std::__swallow(((std::get<_Np>(__dest) = std::forward<_Up>(std::get<_Np>(__source))), void(), 0)...);574 std::__swallow(((std::get<_Np>(__dest) = std::forward<_Up>(std::get<_Np>(__source))), void(), 0)...);
529}575}
530576
531template <class... _Tp>577template <class... _Tp>
532class _LIBCPP_NO_SPECIALIZATIONS tuple {578class _LIBCPP_NO_SPECIALIZATIONS tuple {
533 typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> _BaseT;579 typedef __tuple_impl<__index_sequence_for<_Tp...>, _Tp...> _BaseT;
534580
535 _BaseT __base_;581 _BaseT __base_;
536582
...@@ -549,7 +595,6 @@ class _LIBCPP_NO_SPECIALIZATIONS tuple {...@@ -549,7 +595,6 @@ class _LIBCPP_NO_SPECIALIZATIONS tuple {
549public:595public:
550 using __trivially_relocatable _LIBCPP_NODEBUG =596 using __trivially_relocatable _LIBCPP_NODEBUG =
551 __conditional_t<_And<__libcpp_is_trivially_relocatable<_Tp>...>::value, tuple, void>;597 __conditional_t<_And<__libcpp_is_trivially_relocatable<_Tp>...>::value, tuple, void>;
552 using __replaceable _LIBCPP_NODEBUG = __conditional_t<_And<__is_replaceable<_Tp>...>::value, tuple, void>;
553598
554 // [tuple.cnstr]599 // [tuple.cnstr]
555600
...@@ -566,12 +611,7 @@ public:...@@ -566,12 +611,7 @@ public:
566 __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>611 __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>
567 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)612 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)
568 tuple(allocator_arg_t, _Alloc const& __a)613 tuple(allocator_arg_t, _Alloc const& __a)
569 : __base_(allocator_arg_t(),614 : __base_(allocator_arg_t(), __a, __value_init{}) {}
570 __a,
571 __tuple_indices<>(),
572 __tuple_types<>(),
573 typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
574 __tuple_types<_Tp...>()) {}
575615
576 // tuple(const T&...) constructors (including allocator_arg_t variants)616 // tuple(const T&...) constructors (including allocator_arg_t variants)
577 template <template <class...> class _And = _And,617 template <template <class...> class _And = _And,
...@@ -579,11 +619,7 @@ public:...@@ -579,11 +619,7 @@ public:
579 _LIBCPP_HIDE_FROM_ABI619 _LIBCPP_HIDE_FROM_ABI
580 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)620 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
581 tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value)621 tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value)
582 : __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),622 : __base_(__forward_args{}, __t...) {}
583 typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
584 typename __make_tuple_indices<0>::type(),
585 typename __make_tuple_types<tuple, 0>::type(),
586 __t...) {}
587623
588 template <class _Alloc,624 template <class _Alloc,
589 template <class...> class _And = _And,625 template <class...> class _And = _And,
...@@ -591,13 +627,7 @@ public:...@@ -591,13 +627,7 @@ public:
591 _LIBCPP_HIDE_FROM_ABI627 _LIBCPP_HIDE_FROM_ABI
592 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)628 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
593 tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t)629 tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t)
594 : __base_(allocator_arg_t(),630 : __base_(allocator_arg_t(), __a, __forward_args{}, __t...) {}
595 __a,
596 typename __make_tuple_indices<sizeof...(_Tp)>::type(),
597 typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
598 typename __make_tuple_indices<0>::type(),
599 typename __make_tuple_types<tuple, 0>::type(),
600 __t...) {}
601631
602 // tuple(U&& ...) constructors (including allocator_arg_t variants)632 // tuple(U&& ...) constructors (including allocator_arg_t variants)
603 template <class... _Up>633 template <class... _Up>
...@@ -616,11 +646,7 @@ public:...@@ -616,11 +646,7 @@ public:
616 int> = 0>646 int> = 0>
617 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)647 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
618 tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)648 tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
619 : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),649 : __base_(__forward_args{}, std::forward<_Up>(__u)...) {}
620 typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
621 typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
622 typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
623 std::forward<_Up>(__u)...) {}
624650
625 template <class _Alloc,651 template <class _Alloc,
626 class... _Up,652 class... _Up,
...@@ -628,13 +654,7 @@ public:...@@ -628,13 +654,7 @@ public:
628 int> = 0>654 int> = 0>
629 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)655 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
630 tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)656 tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
631 : __base_(allocator_arg_t(),657 : __base_(allocator_arg_t(), __a, __forward_args{}, std::forward<_Up>(__u)...) {}
632 __a,
633 typename __make_tuple_indices<sizeof...(_Up)>::type(),
634 typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
635 typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
636 typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
637 std::forward<_Up>(__u)...) {}
638658
639 // Copy and move constructors (including the allocator_arg_t variants)659 // Copy and move constructors (including the allocator_arg_t variants)
640 tuple(const tuple&) = default;660 tuple(const tuple&) = default;
...@@ -644,13 +664,13 @@ public:...@@ -644,13 +664,13 @@ public:
644 template <class...> class _And = _And,664 template <class...> class _And = _And,
645 __enable_if_t< _And<is_copy_constructible<_Tp>...>::value, int> = 0>665 __enable_if_t< _And<is_copy_constructible<_Tp>...>::value, int> = 0>
646 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple(allocator_arg_t, const _Alloc& __alloc, const tuple& __t)666 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple(allocator_arg_t, const _Alloc& __alloc, const tuple& __t)
647 : __base_(allocator_arg_t(), __alloc, __t) {}667 : __base_(allocator_arg_t(), __alloc, __from_tuple(), __t) {}
648668
649 template <class _Alloc,669 template <class _Alloc,
650 template <class...> class _And = _And,670 template <class...> class _And = _And,
651 __enable_if_t< _And<is_move_constructible<_Tp>...>::value, int> = 0>671 __enable_if_t< _And<is_move_constructible<_Tp>...>::value, int> = 0>
652 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple(allocator_arg_t, const _Alloc& __alloc, tuple&& __t)672 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple(allocator_arg_t, const _Alloc& __alloc, tuple&& __t)
653 : __base_(allocator_arg_t(), __alloc, std::move(__t)) {}673 : __base_(allocator_arg_t(), __alloc, __from_tuple(), std::move(__t)) {}
654674
655 // tuple(const tuple<U...>&) constructors (including allocator_arg_t variants)675 // tuple(const tuple<U...>&) constructors (including allocator_arg_t variants)
656676
...@@ -683,7 +703,7 @@ public:...@@ -683,7 +703,7 @@ public:
683 _LIBCPP_HIDE_FROM_ABI703 _LIBCPP_HIDE_FROM_ABI
684 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)704 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
685 tuple(const tuple<_Up...>& __t) noexcept(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value)705 tuple(const tuple<_Up...>& __t) noexcept(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value)
686 : __base_(__t) {}706 : __base_(__from_tuple(), __t) {}
687707
688 template <class... _Up,708 template <class... _Up,
689 class _Alloc,709 class _Alloc,
...@@ -691,33 +711,33 @@ public:...@@ -691,33 +711,33 @@ public:
691 _LIBCPP_HIDE_FROM_ABI711 _LIBCPP_HIDE_FROM_ABI
692 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)712 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
693 tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)713 tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)
694 : __base_(allocator_arg_t(), __a, __t) {}714 : __base_(allocator_arg_t(), __a, __from_tuple(), __t) {}
695715
696# if _LIBCPP_STD_VER >= 23716# if _LIBCPP_STD_VER >= 23
697 // tuple(tuple<U...>&) constructors (including allocator_arg_t variants)717 // tuple(tuple<U...>&) constructors (including allocator_arg_t variants)
698718
699 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>719 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>
700 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t)720 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t)
701 : __base_(__t) {}721 : __base_(__from_tuple(), __t) {}
702722
703 template <class _Alloc, class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>723 template <class _Alloc, class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>
704 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value)724 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value)
705 tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t)725 tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t)
706 : __base_(allocator_arg_t(), __alloc, __t) {}726 : __base_(allocator_arg_t(), __alloc, __from_tuple(), __t) {}
707# endif // _LIBCPP_STD_VER >= 23727# endif // _LIBCPP_STD_VER >= 23
708728
709 // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)729 // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
710 template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>730 template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>
711 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)731 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
712 tuple(tuple<_Up...>&& __t) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)732 tuple(tuple<_Up...>&& __t) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
713 : __base_(std::move(__t)) {}733 : __base_(__from_tuple(), std::move(__t)) {}
714734
715 template <class _Alloc,735 template <class _Alloc,
716 class... _Up,736 class... _Up,
717 __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>737 __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>
718 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)738 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
719 tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)739 tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)
720 : __base_(allocator_arg_t(), __a, std::move(__t)) {}740 : __base_(allocator_arg_t(), __a, __from_tuple(), std::move(__t)) {}
721741
722# if _LIBCPP_STD_VER >= 23742# if _LIBCPP_STD_VER >= 23
723 // tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)743 // tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)
...@@ -725,14 +745,14 @@ public:...@@ -725,14 +745,14 @@ public:
725 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>745 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>
726 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)746 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)
727 tuple(const tuple<_Up...>&& __t)747 tuple(const tuple<_Up...>&& __t)
728 : __base_(std::move(__t)) {}748 : __base_(__from_tuple(), std::move(__t)) {}
729749
730 template <class _Alloc,750 template <class _Alloc,
731 class... _Up,751 class... _Up,
732 enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>752 enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>
733 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)753 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)
734 tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)754 tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)
735 : __base_(allocator_arg_t(), __alloc, std::move(__t)) {}755 : __base_(allocator_arg_t(), __alloc, __from_tuple(), std::move(__t)) {}
736# endif // _LIBCPP_STD_VER >= 23756# endif // _LIBCPP_STD_VER >= 23
737757
738 // tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)758 // tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)
...@@ -767,7 +787,7 @@ public:...@@ -767,7 +787,7 @@ public:
767 _LIBCPP_HIDE_FROM_ABI787 _LIBCPP_HIDE_FROM_ABI
768 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value)788 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value)
769 tuple(const pair<_Up1, _Up2>& __p) noexcept(_NothrowConstructibleFromPair<const pair<_Up1, _Up2>&>::value)789 tuple(const pair<_Up1, _Up2>& __p) noexcept(_NothrowConstructibleFromPair<const pair<_Up1, _Up2>&>::value)
770 : __base_(__p) {}790 : __base_(__from_tuple(), __p) {}
771791
772 template <class _Alloc,792 template <class _Alloc,
773 class _Up1,793 class _Up1,
...@@ -777,7 +797,7 @@ public:...@@ -777,7 +797,7 @@ public:
777 _LIBCPP_HIDE_FROM_ABI797 _LIBCPP_HIDE_FROM_ABI
778 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value)798 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value)
779 tuple(allocator_arg_t, const _Alloc& __a, const pair<_Up1, _Up2>& __p)799 tuple(allocator_arg_t, const _Alloc& __a, const pair<_Up1, _Up2>& __p)
780 : __base_(allocator_arg_t(), __a, __p) {}800 : __base_(allocator_arg_t(), __a, __from_tuple(), __p) {}
781801
782# if _LIBCPP_STD_VER >= 23802# if _LIBCPP_STD_VER >= 23
783 // tuple(pair<U1, U2>&) constructors (including allocator_arg_t variants)803 // tuple(pair<U1, U2>&) constructors (including allocator_arg_t variants)
...@@ -785,7 +805,7 @@ public:...@@ -785,7 +805,7 @@ public:
785 template <class _U1, class _U2, enable_if_t< _EnableCtorFromPair<pair<_U1, _U2>&>::value>* = nullptr>805 template <class _U1, class _U2, enable_if_t< _EnableCtorFromPair<pair<_U1, _U2>&>::value>* = nullptr>
786 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<pair<_U1, _U2>&>::value)806 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<pair<_U1, _U2>&>::value)
787 tuple(pair<_U1, _U2>& __p)807 tuple(pair<_U1, _U2>& __p)
788 : __base_(__p) {}808 : __base_(__from_tuple(), __p) {}
789809
790 template <class _Alloc,810 template <class _Alloc,
791 class _U1,811 class _U1,
...@@ -793,7 +813,7 @@ public:...@@ -793,7 +813,7 @@ public:
793 enable_if_t< _EnableCtorFromPair<std::pair<_U1, _U2>&>::value>* = nullptr>813 enable_if_t< _EnableCtorFromPair<std::pair<_U1, _U2>&>::value>* = nullptr>
794 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<pair<_U1, _U2>&>::value)814 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<pair<_U1, _U2>&>::value)
795 tuple(allocator_arg_t, const _Alloc& __alloc, pair<_U1, _U2>& __p)815 tuple(allocator_arg_t, const _Alloc& __alloc, pair<_U1, _U2>& __p)
796 : __base_(allocator_arg_t(), __alloc, __p) {}816 : __base_(allocator_arg_t(), __alloc, __from_tuple(), __p) {}
797# endif817# endif
798818
799 // tuple(pair<U1, U2>&&) constructors (including allocator_arg_t variants)819 // tuple(pair<U1, U2>&&) constructors (including allocator_arg_t variants)
...@@ -805,7 +825,7 @@ public:...@@ -805,7 +825,7 @@ public:
805 _LIBCPP_HIDE_FROM_ABI825 _LIBCPP_HIDE_FROM_ABI
806 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value)826 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value)
807 tuple(pair<_Up1, _Up2>&& __p) noexcept(_NothrowConstructibleFromPair<pair<_Up1, _Up2>&&>::value)827 tuple(pair<_Up1, _Up2>&& __p) noexcept(_NothrowConstructibleFromPair<pair<_Up1, _Up2>&&>::value)
808 : __base_(std::move(__p)) {}828 : __base_(__from_tuple(), std::move(__p)) {}
809829
810 template <class _Alloc,830 template <class _Alloc,
811 class _Up1,831 class _Up1,
...@@ -815,7 +835,7 @@ public:...@@ -815,7 +835,7 @@ public:
815 _LIBCPP_HIDE_FROM_ABI835 _LIBCPP_HIDE_FROM_ABI
816 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value)836 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value)
817 tuple(allocator_arg_t, const _Alloc& __a, pair<_Up1, _Up2>&& __p)837 tuple(allocator_arg_t, const _Alloc& __a, pair<_Up1, _Up2>&& __p)
818 : __base_(allocator_arg_t(), __a, std::move(__p)) {}838 : __base_(allocator_arg_t(), __a, __from_tuple(), std::move(__p)) {}
819839
820# if _LIBCPP_STD_VER >= 23840# if _LIBCPP_STD_VER >= 23
821 // tuple(const pair<U1, U2>&&) constructors (including allocator_arg_t variants)841 // tuple(const pair<U1, U2>&&) constructors (including allocator_arg_t variants)
...@@ -823,7 +843,7 @@ public:...@@ -823,7 +843,7 @@ public:
823 template <class _U1, class _U2, enable_if_t< _EnableCtorFromPair<const pair<_U1, _U2>&&>::value>* = nullptr>843 template <class _U1, class _U2, enable_if_t< _EnableCtorFromPair<const pair<_U1, _U2>&&>::value>* = nullptr>
824 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)844 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)
825 tuple(const pair<_U1, _U2>&& __p)845 tuple(const pair<_U1, _U2>&& __p)
826 : __base_(std::move(__p)) {}846 : __base_(__from_tuple(), std::move(__p)) {}
827847
828 template <class _Alloc,848 template <class _Alloc,
829 class _U1,849 class _U1,
...@@ -831,14 +851,14 @@ public:...@@ -831,14 +851,14 @@ public:
831 enable_if_t< _EnableCtorFromPair<const pair<_U1, _U2>&&>::value>* = nullptr>851 enable_if_t< _EnableCtorFromPair<const pair<_U1, _U2>&&>::value>* = nullptr>
832 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)852 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)
833 tuple(allocator_arg_t, const _Alloc& __alloc, const pair<_U1, _U2>&& __p)853 tuple(allocator_arg_t, const _Alloc& __alloc, const pair<_U1, _U2>&& __p)
834 : __base_(allocator_arg_t(), __alloc, std::move(__p)) {}854 : __base_(allocator_arg_t(), __alloc, __from_tuple(), std::move(__p)) {}
835# endif // _LIBCPP_STD_VER >= 23855# endif // _LIBCPP_STD_VER >= 23
836856
837 // [tuple.assign]857 // [tuple.assign]
838 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&858 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
839 operator=(_If<_And<is_copy_assignable<_Tp>...>::value, tuple, __nat> const& __tuple) noexcept(859 operator=(_If<_And<is_copy_assignable<_Tp>...>::value, tuple, __nat> const& __tuple) noexcept(
840 _And<is_nothrow_copy_assignable<_Tp>...>::value) {860 _And<is_nothrow_copy_assignable<_Tp>...>::value) {
841 std::__memberwise_copy_assign(*this, __tuple, typename __make_tuple_indices<sizeof...(_Tp)>::type());861 std::__memberwise_copy_assign(*this, __tuple, __index_sequence_for<_Tp...>());
842 return *this;862 return *this;
843 }863 }
844864
...@@ -846,15 +866,14 @@ public:...@@ -846,15 +866,14 @@ public:
846 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple const& __tuple) const866 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple const& __tuple) const
847 requires(_And<is_copy_assignable<const _Tp>...>::value)867 requires(_And<is_copy_assignable<const _Tp>...>::value)
848 {868 {
849 std::__memberwise_copy_assign(*this, __tuple, typename __make_tuple_indices<sizeof...(_Tp)>::type());869 std::__memberwise_copy_assign(*this, __tuple, __index_sequence_for<_Tp...>());
850 return *this;870 return *this;
851 }871 }
852872
853 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple&& __tuple) const873 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple&& __tuple) const
854 requires(_And<is_assignable<const _Tp&, _Tp>...>::value)874 requires(_And<is_assignable<const _Tp&, _Tp>...>::value)
855 {875 {
856 std::__memberwise_forward_assign(876 std::__memberwise_forward_assign(*this, std::move(__tuple), __type_list<_Tp...>(), __index_sequence_for<_Tp...>());
857 *this, std::move(__tuple), __tuple_types<_Tp...>(), typename __make_tuple_indices<sizeof...(_Tp)>::type());
858 return *this;877 return *this;
859 }878 }
860# endif // _LIBCPP_STD_VER >= 23879# endif // _LIBCPP_STD_VER >= 23
...@@ -862,8 +881,7 @@ public:...@@ -862,8 +881,7 @@ public:
862 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&881 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
863 operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple) noexcept(882 operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple) noexcept(
864 _And<is_nothrow_move_assignable<_Tp>...>::value) {883 _And<is_nothrow_move_assignable<_Tp>...>::value) {
865 std::__memberwise_forward_assign(884 std::__memberwise_forward_assign(*this, std::move(__tuple), __type_list<_Tp...>(), __index_sequence_for<_Tp...>());
866 *this, std::move(__tuple), __tuple_types<_Tp...>(), typename __make_tuple_indices<sizeof...(_Tp)>::type());
867 return *this;885 return *this;
868 }886 }
869887
...@@ -873,7 +891,7 @@ public:...@@ -873,7 +891,7 @@ public:
873 int> = 0>891 int> = 0>
874 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&892 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
875 operator=(tuple<_Up...> const& __tuple) noexcept(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) {893 operator=(tuple<_Up...> const& __tuple) noexcept(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) {
876 std::__memberwise_copy_assign(*this, __tuple, typename __make_tuple_indices<sizeof...(_Tp)>::type());894 std::__memberwise_copy_assign(*this, __tuple, __index_sequence_for<_Tp...>());
877 return *this;895 return *this;
878 }896 }
879897
...@@ -882,8 +900,7 @@ public:...@@ -882,8 +900,7 @@ public:
882 int> = 0>900 int> = 0>
883 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&901 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
884 operator=(tuple<_Up...>&& __tuple) noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) {902 operator=(tuple<_Up...>&& __tuple) noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) {
885 std::__memberwise_forward_assign(903 std::__memberwise_forward_assign(*this, std::move(__tuple), __type_list<_Up...>(), __index_sequence_for<_Tp...>());
886 *this, std::move(__tuple), __tuple_types<_Up...>(), typename __make_tuple_indices<sizeof...(_Tp)>::type());
887 return *this;904 return *this;
888 }905 }
889906
...@@ -892,7 +909,7 @@ public:...@@ -892,7 +909,7 @@ public:
892 enable_if_t< _And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,909 enable_if_t< _And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,
893 is_assignable<const _Tp&, const _UTypes&>...>::value>* = nullptr>910 is_assignable<const _Tp&, const _UTypes&>...>::value>* = nullptr>
894 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(const tuple<_UTypes...>& __u) const {911 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(const tuple<_UTypes...>& __u) const {
895 std::__memberwise_copy_assign(*this, __u, typename __make_tuple_indices<sizeof...(_Tp)>::type());912 std::__memberwise_copy_assign(*this, __u, index_sequence_for<_Tp...>());
896 return *this;913 return *this;
897 }914 }
898915
...@@ -900,8 +917,7 @@ public:...@@ -900,8 +917,7 @@ public:
900 enable_if_t< _And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,917 enable_if_t< _And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,
901 is_assignable<const _Tp&, _UTypes>...>::value>* = nullptr>918 is_assignable<const _Tp&, _UTypes>...>::value>* = nullptr>
902 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple<_UTypes...>&& __u) const {919 _LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple<_UTypes...>&& __u) const {
903 std::__memberwise_forward_assign(920 std::__memberwise_forward_assign(*this, __u, __type_list<_UTypes...>(), index_sequence_for<_Tp...>());
904 *this, __u, __tuple_types<_UTypes...>(), typename __make_tuple_indices<sizeof...(_Tp)>::type());
905 return *this;921 return *this;
906 }922 }
907# endif // _LIBCPP_STD_VER >= 23923# endif // _LIBCPP_STD_VER >= 23
...@@ -967,7 +983,7 @@ public:...@@ -967,7 +983,7 @@ public:
967 __enable_if_t< _And< _BoolConstant<_Np == sizeof...(_Tp)>, is_assignable<_Tp&, _Up const&>... >::value, int> = 0>983 __enable_if_t< _And< _BoolConstant<_Np == sizeof...(_Tp)>, is_assignable<_Tp&, _Up const&>... >::value, int> = 0>
968 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&984 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
969 operator=(array<_Up, _Np> const& __array) noexcept(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) {985 operator=(array<_Up, _Np> const& __array) noexcept(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) {
970 std::__memberwise_copy_assign(*this, __array, typename __make_tuple_indices<sizeof...(_Tp)>::type());986 std::__memberwise_copy_assign(*this, __array, __index_sequence_for<_Tp...>());
971 return *this;987 return *this;
972 }988 }
973989
...@@ -979,10 +995,7 @@ public:...@@ -979,10 +995,7 @@ public:
979 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&995 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
980 operator=(array<_Up, _Np>&& __array) noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) {996 operator=(array<_Up, _Np>&& __array) noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) {
981 std::__memberwise_forward_assign(997 std::__memberwise_forward_assign(
982 *this,998 *this, std::move(__array), __type_list<_If<true, _Up, _Tp>...>(), __index_sequence_for<_Tp...>());
983 std::move(__array),
984 __tuple_types<_If<true, _Up, _Tp>...>(),
985 typename __make_tuple_indices<sizeof...(_Tp)>::type());
986 return *this;999 return *this;
987 }1000 }
9881001
...@@ -997,7 +1010,24 @@ public:...@@ -997,7 +1010,24 @@ public:
997 noexcept(__all<is_nothrow_swappable_v<const _Tp&>...>::value) {1010 noexcept(__all<is_nothrow_swappable_v<const _Tp&>...>::value) {
998 __base_.swap(__t.__base_);1011 __base_.swap(__t.__base_);
999 }1012 }
1000# endif // _LIBCPP_STD_VER >= 231013
1014 template <__tuple_like_no_tuple _UTuple>
1015# if _LIBCPP_STD_VER >= 26
1016 requires __can_tuple_compare_equal<tuple, _UTuple> && (sizeof...(_Tp) == tuple_size_v<_UTuple>)
1017# endif // _LIBCPP_STD_VER >= 26
1018 _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");
1020 return std::__tuple_compare_equal<sizeof...(_Tp)>(__x, __y);
1021 }
1022
1023 template <__tuple_like_no_tuple _UTuple>
1024 requires(sizeof...(_Tp) == tuple_size_v<_UTuple>)
1025 _LIBCPP_HIDE_FROM_ABI friend constexpr __tuple_common_comparison_category<tuple, _UTuple>
1026 operator<=>(const tuple& __x, const _UTuple& __y) {
1027 return std::__tuple_compare_three_way<__tuple_common_comparison_category<tuple, _UTuple>>(
1028 __x, __y, index_sequence_for<_Tp...>{});
1029 }
1030# endif // _LIBCPP_STD_VER >= 23
1001};1031};
10021032
1003_LIBCPP_DIAGNOSTIC_PUSH1033_LIBCPP_DIAGNOSTIC_PUSH
...@@ -1019,6 +1049,21 @@ public:...@@ -1019,6 +1049,21 @@ public:
1019 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(tuple&) _NOEXCEPT {}1049 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(tuple&) _NOEXCEPT {}
1020# if _LIBCPP_STD_VER >= 231050# if _LIBCPP_STD_VER >= 23
1021 _LIBCPP_HIDE_FROM_ABI constexpr void swap(const tuple&) const noexcept {}1051 _LIBCPP_HIDE_FROM_ABI constexpr void swap(const tuple&) const noexcept {}
1052
1053 template <__tuple_like_no_tuple _UTuple>
1054# if _LIBCPP_STD_VER >= 26
1055 requires(tuple_size_v<_UTuple> == 0)
1056# endif // _LIBCPP_STD_VER >= 26
1057 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const tuple&, const _UTuple&) {
1058 static_assert(tuple_size_v<_UTuple> == 0, "Can't compare tuple-like values of different sizes");
1059 return true;
1060 }
1061
1062 template <__tuple_like_no_tuple _UTuple>
1063 requires(tuple_size_v<_UTuple> == 0)
1064 _LIBCPP_HIDE_FROM_ABI friend constexpr strong_ordering operator<=>(const tuple&, const _UTuple&) {
1065 return strong_ordering::equal;
1066 }
1022# endif1067# endif
1023};1068};
1024_LIBCPP_DIAGNOSTIC_POP1069_LIBCPP_DIAGNOSTIC_POP
...@@ -1068,28 +1113,32 @@ swap(const tuple<_Tp...>& __lhs,...@@ -1068,28 +1113,32 @@ swap(const tuple<_Tp...>& __lhs,
1068// get1113// get
10691114
1070template <size_t _Ip, class... _Tp>1115template <size_t _Ip, class... _Tp>
1071inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&1116[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
1117typename tuple_element<_Ip, tuple<_Tp...> >::type&
1072get(tuple<_Tp...>& __t) _NOEXCEPT {1118get(tuple<_Tp...>& __t) _NOEXCEPT {
1073 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;1119 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;
1074 return static_cast<__tuple_leaf<_Ip, type>&>(__t.__base_).get();1120 return static_cast<__tuple_leaf<_Ip, type>&>(__t.__base_).get();
1075}1121}
10761122
1077template <size_t _Ip, class... _Tp>1123template <size_t _Ip, class... _Tp>
1078inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&1124[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
1125_LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&
1079get(const tuple<_Tp...>& __t) _NOEXCEPT {1126get(const tuple<_Tp...>& __t) _NOEXCEPT {
1080 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;1127 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;
1081 return static_cast<const __tuple_leaf<_Ip, type>&>(__t.__base_).get();1128 return static_cast<const __tuple_leaf<_Ip, type>&>(__t.__base_).get();
1082}1129}
10831130
1084template <size_t _Ip, class... _Tp>1131template <size_t _Ip, class... _Tp>
1085inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&&1132[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
1133typename tuple_element<_Ip, tuple<_Tp...> >::type&&
1086get(tuple<_Tp...>&& __t) _NOEXCEPT {1134get(tuple<_Tp...>&& __t) _NOEXCEPT {
1087 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;1135 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;
1088 return static_cast<type&&>(static_cast<__tuple_leaf<_Ip, type>&&>(__t.__base_).get());1136 return static_cast<type&&>(static_cast<__tuple_leaf<_Ip, type>&&>(__t.__base_).get());
1089}1137}
10901138
1091template <size_t _Ip, class... _Tp>1139template <size_t _Ip, class... _Tp>
1092inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&1140[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
1141_LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
1093get(const tuple<_Tp...>&& __t) _NOEXCEPT {1142get(const tuple<_Tp...>&& __t) _NOEXCEPT {
1094 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;1143 using type _LIBCPP_NODEBUG = typename tuple_element<_Ip, tuple<_Tp...> >::type;
1095 return static_cast<const type&&>(static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get());1144 return static_cast<const type&&>(static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get());
...@@ -1098,22 +1147,22 @@ get(const tuple<_Tp...>&& __t) _NOEXCEPT {...@@ -1098,22 +1147,22 @@ get(const tuple<_Tp...>&& __t) _NOEXCEPT {
1098# if _LIBCPP_STD_VER >= 141147# if _LIBCPP_STD_VER >= 14
10991148
1100template <class _T1, class... _Args>1149template <class _T1, class... _Args>
1101inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(tuple<_Args...>& __tup) noexcept {1150[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(tuple<_Args...>& __tup) noexcept {
1102 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup);1151 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup);
1103}1152}
11041153
1105template <class _T1, class... _Args>1154template <class _T1, class... _Args>
1106inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(tuple<_Args...> const& __tup) noexcept {1155[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(tuple<_Args...> const& __tup) noexcept {
1107 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup);1156 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup);
1108}1157}
11091158
1110template <class _T1, class... _Args>1159template <class _T1, class... _Args>
1111inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept {1160[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept {
1112 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(std::move(__tup));1161 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(std::move(__tup));
1113}1162}
11141163
1115template <class _T1, class... _Args>1164template <class _T1, class... _Args>
1116inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(tuple<_Args...> const&& __tup) noexcept {1165[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(tuple<_Args...> const&& __tup) noexcept {
1117 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(std::move(__tup));1166 return std::get<__find_exactly_one_t<_T1, _Args...>::value>(std::move(__tup));
1118}1167}
11191168
...@@ -1122,37 +1171,22 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(tuple<_Args...> const&& _...@@ -1122,37 +1171,22 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(tuple<_Args...> const&& _
1122// tie1171// tie
11231172
1124template <class... _Tp>1173template <class... _Tp>
1125inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<_Tp&...> tie(_Tp&... __t) _NOEXCEPT {1174[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<_Tp&...> tie(_Tp&... __t) _NOEXCEPT {
1126 return tuple<_Tp&...>(__t...);1175 return tuple<_Tp&...>(__t...);
1127}1176}
11281177
1129template <class... _Tp>1178template <class... _Tp>
1130inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<__unwrap_ref_decay_t<_Tp>...>1179[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<__unwrap_ref_decay_t<_Tp>...>
1131make_tuple(_Tp&&... __t) {1180make_tuple(_Tp&&... __t) {
1132 return tuple<__unwrap_ref_decay_t<_Tp>...>(std::forward<_Tp>(__t)...);1181 return tuple<__unwrap_ref_decay_t<_Tp>...>(std::forward<_Tp>(__t)...);
1133}1182}
11341183
1135template <class... _Tp>1184template <class... _Tp>
1136inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<_Tp&&...> forward_as_tuple(_Tp&&... __t) _NOEXCEPT {1185[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<_Tp&&...>
1186forward_as_tuple(_Tp&&... __t) _NOEXCEPT {
1137 return tuple<_Tp&&...>(std::forward<_Tp>(__t)...);1187 return tuple<_Tp&&...>(std::forward<_Tp>(__t)...);
1138}1188}
11391189
1140template <size_t _Ip>
1141struct __tuple_equal {
1142 template <class _Tp, class _Up>
1143 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __x, const _Up& __y) {
1144 return __tuple_equal<_Ip - 1>()(__x, __y) && std::get<_Ip - 1>(__x) == std::get<_Ip - 1>(__y);
1145 }
1146};
1147
1148template <>
1149struct __tuple_equal<0> {
1150 template <class _Tp, class _Up>
1151 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp&, const _Up&) {
1152 return true;
1153 }
1154};
1155
1156template <class... _Tp, class... _Up>1190template <class... _Tp, class... _Up>
1157# if _LIBCPP_STD_VER >= 261191# if _LIBCPP_STD_VER >= 26
1158 requires(__all<requires(const _Tp& __t, const _Up& __u) {1192 requires(__all<requires(const _Tp& __t, const _Up& __u) {
...@@ -1162,27 +1196,19 @@ template <class... _Tp, class... _Up>...@@ -1162,27 +1196,19 @@ template <class... _Tp, class... _Up>
1162inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool1196inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
1163operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {1197operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {
1164 static_assert(sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes");1198 static_assert(sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes");
1165 return __tuple_equal<sizeof...(_Tp)>()(__x, __y);1199 return std::__tuple_compare_equal<sizeof...(_Tp)>(__x, __y);
1166}1200}
11671201
1168# if _LIBCPP_STD_VER >= 201202# if _LIBCPP_STD_VER >= 20
11691203
1170// operator<=>1204// operator<=>
11711205
1172template <class... _Tp, class... _Up, size_t... _Is>
1173_LIBCPP_HIDE_FROM_ABI constexpr auto
1174__tuple_compare_three_way(const tuple<_Tp...>& __x, const tuple<_Up...>& __y, index_sequence<_Is...>) {
1175 common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...> __result = strong_ordering::equal;
1176 static_cast<void>(
1177 ((__result = std::__synth_three_way(std::get<_Is>(__x), std::get<_Is>(__y)), __result != 0) || ...));
1178 return __result;
1179}
1180
1181template <class... _Tp, class... _Up>1206template <class... _Tp, class... _Up>
1182 requires(sizeof...(_Tp) == sizeof...(_Up))1207 requires(sizeof...(_Tp) == sizeof...(_Up))
1183_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>1208_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>
1184operator<=>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {1209operator<=>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {
1185 return std::__tuple_compare_three_way(__x, __y, index_sequence_for<_Tp...>{});1210 return std::__tuple_compare_three_way<common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>>(
1211 __x, __y, index_sequence_for<_Tp...>{});
1186}1212}
11871213
1188# else // _LIBCPP_STD_VER >= 201214# else // _LIBCPP_STD_VER >= 20
...@@ -1243,65 +1269,59 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {...@@ -1243,65 +1269,59 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {
12431269
1244// tuple_cat1270// tuple_cat
12451271
1246template <class _Tp, class _Up>1272template <class... _Tuples>
1247struct __tuple_cat_type;1273struct __tuple_cat_return_impl;
12481274
1249template <class... _Ttypes, class... _Utypes>1275template <class... _Types>
1250struct __tuple_cat_type<tuple<_Ttypes...>, __tuple_types<_Utypes...> > {1276struct __tuple_cat_return_impl<tuple<_Types...>> {
1251 using type _LIBCPP_NODEBUG = tuple<_Ttypes..., _Utypes...>;1277 using type _LIBCPP_NODEBUG = tuple<_Types...>;
1252};1278};
12531279
1254template <class _ResultTuple, bool _Is_Tuple0TupleLike, class... _Tuples>1280template <class... _Types0, class... _Types1, class... _Tuples>
1255struct __tuple_cat_return_1 {};1281struct __tuple_cat_return_impl<tuple<_Types0...>, tuple<_Types1...>, _Tuples...>
1282 : __tuple_cat_return_impl<tuple<_Types0..., _Types1...>, _Tuples...> {};
12561283
1257template <class... _Types, class _Tuple0>1284template <class... _Types0, class _Tp, class _Up, class... _Tuples>
1258struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0> {1285struct __tuple_cat_return_impl<tuple<_Types0...>, pair<_Tp, _Up>, _Tuples...>
1259 using type _LIBCPP_NODEBUG =1286 : __tuple_cat_return_impl<tuple<_Types0..., _Tp, _Up>, _Tuples...> {};
1260 typename __tuple_cat_type< tuple<_Types...>,
1261 typename __make_tuple_types<__remove_cvref_t<_Tuple0> >::type >::type;
1262};
1263
1264template <class... _Types, class _Tuple0, class _Tuple1, class... _Tuples>
1265struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples...>
1266 : public __tuple_cat_return_1<
1267 typename __tuple_cat_type< tuple<_Types...>,
1268 typename __make_tuple_types<__remove_cvref_t<_Tuple0> >::type >::type,
1269 __tuple_like_ext<__libcpp_remove_reference_t<_Tuple1> >::value,
1270 _Tuple1,
1271 _Tuples...> {};
12721287
1273template <class... _Tuples>1288template <class, class, class>
1274struct __tuple_cat_return;1289struct __tuple_cat_array;
12751290
1276template <class _Tuple0, class... _Tuples>1291template <class... _Types, class _ValueT, size_t... _Indices>
1277struct __tuple_cat_return<_Tuple0, _Tuples...>1292struct __tuple_cat_array<tuple<_Types...>, _ValueT, __index_sequence<_Indices...>> {
1278 : public __tuple_cat_return_1<tuple<>,1293 template <size_t>
1279 __tuple_like_ext<__libcpp_remove_reference_t<_Tuple0> >::value,1294 using __value_type _LIBCPP_NODEBUG = _ValueT;
1280 _Tuple0,
1281 _Tuples...> {};
12821295
1283template <>1296 using type _LIBCPP_NODEBUG = tuple<_Types..., __value_type<_Indices>...>;
1284struct __tuple_cat_return<> {
1285 using type _LIBCPP_NODEBUG = tuple<>;
1286};1297};
12871298
1288inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<> tuple_cat() { return tuple<>(); }1299template <class... _Types, class _ValueT, size_t _Np, class... _Tuples>
1300struct __tuple_cat_return_impl<tuple<_Types...>, array<_ValueT, _Np>, _Tuples...>
1301 : __tuple_cat_return_impl<typename __tuple_cat_array<tuple<_Types...>, _ValueT, __make_index_sequence<_Np>>::type,
1302 _Tuples...> {};
1303
1304template <class... _Tuples>
1305using __tuple_cat_return_t _LIBCPP_NODEBUG =
1306 typename __tuple_cat_return_impl<tuple<>, __remove_cvref_t<_Tuples>...>::type;
1307
1308[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 tuple<> tuple_cat() { return tuple<>(); }
12891309
1290template <class _Rp, class _Indices, class _Tuple0, class... _Tuples>1310template <class _Rp, class _Indices, class _Tuple0, class... _Tuples>
1291struct __tuple_cat_return_ref_imp;1311struct __tuple_cat_return_ref_imp;
12921312
1293template <class... _Types, size_t... _I0, class _Tuple0>1313template <class... _Types, size_t... _I0, class _Tuple0>
1294struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0> {1314struct __tuple_cat_return_ref_imp<tuple<_Types...>, __index_sequence<_I0...>, _Tuple0> {
1295 using _T0 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple0>;1315 using _T0 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple0>;
1296 typedef tuple<_Types..., __copy_cvref_t<_Tuple0, typename tuple_element<_I0, _T0>::type>&&...> type;1316 typedef tuple<_Types..., __copy_cvref_t<_Tuple0, typename tuple_element<_I0, _T0>::type>&&...> type;
1297};1317};
12981318
1299template <class... _Types, size_t... _I0, class _Tuple0, class _Tuple1, class... _Tuples>1319template <class... _Types, size_t... _I0, class _Tuple0, class _Tuple1, class... _Tuples>
1300struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0, _Tuple1, _Tuples...>1320struct __tuple_cat_return_ref_imp<tuple<_Types...>, __index_sequence<_I0...>, _Tuple0, _Tuple1, _Tuples...>
1301 : public __tuple_cat_return_ref_imp<1321 : public __tuple_cat_return_ref_imp<
1302 tuple<_Types...,1322 tuple<_Types...,
1303 __copy_cvref_t<_Tuple0, typename tuple_element<_I0, __libcpp_remove_reference_t<_Tuple0>>::type>&&...>,1323 __copy_cvref_t<_Tuple0, typename tuple_element<_I0, __libcpp_remove_reference_t<_Tuple0>>::type>&&...>,
1304 typename __make_tuple_indices<tuple_size<__libcpp_remove_reference_t<_Tuple1> >::value>::type,1324 __make_index_sequence<tuple_size<__libcpp_remove_reference_t<_Tuple1> >::value>,
1305 _Tuple1,1325 _Tuple1,
1306 _Tuples...> {};1326 _Tuples...> {};
13071327
...@@ -1309,7 +1329,7 @@ template <class _Tuple0, class... _Tuples>...@@ -1309,7 +1329,7 @@ template <class _Tuple0, class... _Tuples>
1309struct __tuple_cat_return_ref1329struct __tuple_cat_return_ref
1310 : public __tuple_cat_return_ref_imp<1330 : public __tuple_cat_return_ref_imp<
1311 tuple<>,1331 tuple<>,
1312 typename __make_tuple_indices< tuple_size<__libcpp_remove_reference_t<_Tuple0> >::value >::type,1332 __make_index_sequence< tuple_size<__libcpp_remove_reference_t<_Tuple0> >::value >,
1313 _Tuple0,1333 _Tuple0,
1314 _Tuples...> {};1334 _Tuples...> {};
13151335
...@@ -1317,7 +1337,7 @@ template <class _Types, class _I0, class _J0>...@@ -1317,7 +1337,7 @@ template <class _Types, class _I0, class _J0>
1317struct __tuple_cat;1337struct __tuple_cat;
13181338
1319template <class... _Types, size_t... _I0, size_t... _J0>1339template <class... _Types, size_t... _I0, size_t... _J0>
1320struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...> > {1340struct __tuple_cat<tuple<_Types...>, __index_sequence<_I0...>, __index_sequence<_J0...>> {
1321 template <class _Tuple0>1341 template <class _Tuple0>
1322 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX141342 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
1323 typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type1343 typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
...@@ -1335,8 +1355,8 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J...@@ -1335,8 +1355,8 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
1335 using _T0 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple0>;1355 using _T0 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple0>;
1336 using _T1 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple1>;1356 using _T1 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple1>;
1337 return __tuple_cat<tuple<_Types..., __copy_cvref_t<_Tuple0, typename tuple_element<_J0, _T0>::type>&&...>,1357 return __tuple_cat<tuple<_Types..., __copy_cvref_t<_Tuple0, typename tuple_element<_J0, _T0>::type>&&...>,
1338 typename __make_tuple_indices<sizeof...(_Types) + tuple_size<_T0>::value>::type,1358 __make_index_sequence<sizeof...(_Types) + tuple_size<_T0>::value>,
1339 typename __make_tuple_indices<tuple_size<_T1>::value>::type>()(1359 __make_index_sequence<tuple_size<_T1>::value>>()(
1340 std::forward_as_tuple(1360 std::forward_as_tuple(
1341 std::forward<_Types>(std::get<_I0>(__t))..., std::get<_J0>(std::forward<_Tuple0>(__t0))...),1361 std::forward<_Types>(std::get<_I0>(__t))..., std::get<_J0>(std::forward<_Tuple0>(__t0))...),
1342 std::forward<_Tuple1>(__t1),1362 std::forward<_Tuple1>(__t1),
...@@ -1346,21 +1366,21 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J...@@ -1346,21 +1366,21 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
13461366
1347template <class _TupleDst, class _TupleSrc, size_t... _Indices>1367template <class _TupleDst, class _TupleSrc, size_t... _Indices>
1348inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _TupleDst1368inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _TupleDst
1349__tuple_cat_select_element_wise(_TupleSrc&& __src, __tuple_indices<_Indices...>) {1369__tuple_cat_select_element_wise(_TupleSrc&& __src, __index_sequence<_Indices...>) {
1350 static_assert(tuple_size<_TupleDst>::value == tuple_size<_TupleSrc>::value,1370 static_assert(tuple_size<_TupleDst>::value == tuple_size<_TupleSrc>::value,
1351 "misuse of __tuple_cat_select_element_wise with tuples of different sizes");1371 "misuse of __tuple_cat_select_element_wise with tuples of different sizes");
1352 return _TupleDst(std::get<_Indices>(std::forward<_TupleSrc>(__src))...);1372 return _TupleDst(std::get<_Indices>(std::forward<_TupleSrc>(__src))...);
1353}1373}
13541374
1355template <class _Tuple0, class... _Tuples>1375template <class _Tuple0, class... _Tuples>
1356inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename __tuple_cat_return<_Tuple0, _Tuples...>::type1376[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_cat_return_t<_Tuple0, _Tuples...>
1357tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls) {1377tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls) {
1358 using _T0 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple0>;1378 using _T0 _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tuple0>;
1359 using _TRet _LIBCPP_NODEBUG = typename __tuple_cat_return<_Tuple0, _Tuples...>::type;1379 using _TRet _LIBCPP_NODEBUG = __tuple_cat_return_t<_Tuple0, _Tuples...>;
1360 using _T0Indices _LIBCPP_NODEBUG = typename __make_tuple_indices<tuple_size<_T0>::value>::type;1380 using _T0Indices _LIBCPP_NODEBUG = __make_index_sequence<tuple_size<_T0>::value>;
1361 using _TRetIndices _LIBCPP_NODEBUG = typename __make_tuple_indices<tuple_size<_TRet>::value>::type;1381 using _TRetIndices _LIBCPP_NODEBUG = __make_index_sequence<tuple_size<_TRet>::value>;
1362 return std::__tuple_cat_select_element_wise<_TRet>(1382 return std::__tuple_cat_select_element_wise<_TRet>(
1363 __tuple_cat<tuple<>, __tuple_indices<>, _T0Indices>()(1383 __tuple_cat<tuple<>, __index_sequence<>, _T0Indices>()(
1364 tuple<>(), std::forward<_Tuple0>(__t0), std::forward<_Tuples>(__tpls)...),1384 tuple<>(), std::forward<_Tuple0>(__t0), std::forward<_Tuples>(__tpls)...),
1365 _TRetIndices());1385 _TRetIndices());
1366}1386}
...@@ -1376,7 +1396,7 @@ struct uses_allocator<tuple<_Tp...>, _Alloc> : true_type {};...@@ -1376,7 +1396,7 @@ struct uses_allocator<tuple<_Tp...>, _Alloc> : true_type {};
1376// clang-format off1396// clang-format off
1377template <class _Fn, class _Tuple, size_t... _Id>1397template <class _Fn, class _Tuple, size_t... _Id>
1378inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto)1398inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto)
1379__apply_tuple_impl(_Fn&& __f, _Tuple&& __t, __tuple_indices<_Id...>)1399__apply_tuple_impl(_Fn&& __f, _Tuple&& __t, index_sequence<_Id...>)
1380 _LIBCPP_NOEXCEPT_RETURN(std::__invoke(std::forward<_Fn>(__f), std::get<_Id>(std::forward<_Tuple>(__t))...))1400 _LIBCPP_NOEXCEPT_RETURN(std::__invoke(std::forward<_Fn>(__f), std::get<_Id>(std::forward<_Tuple>(__t))...))
13811401
1382template <class _Fn, class _Tuple>1402template <class _Fn, class _Tuple>
...@@ -1384,28 +1404,29 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) apply(_Fn&& __f, _Tuple&&...@@ -1384,28 +1404,29 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) apply(_Fn&& __f, _Tuple&&
1384 _LIBCPP_NOEXCEPT_RETURN(std::__apply_tuple_impl(1404 _LIBCPP_NOEXCEPT_RETURN(std::__apply_tuple_impl(
1385 std::forward<_Fn>(__f),1405 std::forward<_Fn>(__f),
1386 std::forward<_Tuple>(__t),1406 std::forward<_Tuple>(__t),
1387 typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type{}))1407 make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>()))
13881408
1389#if _LIBCPP_STD_VER >= 201409#if _LIBCPP_STD_VER >= 20
1390template <class _Tp, class _Tuple, size_t... _Idx>1410template <class _Tp, class _Tuple, size_t... _Idx>
1391inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>)1411inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, index_sequence<_Idx...>)
1392 noexcept(noexcept(_Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...)))1412 noexcept(noexcept(_Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...)))
1393 requires is_constructible_v<_Tp, decltype(std::get<_Idx>(std::forward<_Tuple>(__t)))...> {1413 requires is_constructible_v<_Tp, decltype(std::get<_Idx>(std::forward<_Tuple>(__t)))...> {
1394 return _Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...);1414 return _Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...);
1395}1415}
1396#else1416#else
1397template <class _Tp, class _Tuple, size_t... _Idx>1417template <class _Tp, class _Tuple, size_t... _Idx>
1398inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>,1418inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, index_sequence<_Idx...>,
1399 enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::forward<_Tuple>(__t)))...>> * = nullptr)1419 enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::forward<_Tuple>(__t)))...>> * = nullptr)
1400 _LIBCPP_NOEXCEPT_RETURN(_Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...))1420 _LIBCPP_NOEXCEPT_RETURN(_Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...))
1401#endif // _LIBCPP_STD_VER >= 201421#endif // _LIBCPP_STD_VER >= 20
1422#undef _LIBCPP_NOEXCEPT_RETURN
14021423
1403template <class _Tp, class _Tuple,1424template <class _Tp, class _Tuple,
1404 class _Seq = typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type, class = void>1425 class _Seq = make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>, class = void>
1405inline constexpr bool __can_make_from_tuple = false;1426inline constexpr bool __can_make_from_tuple = false;
14061427
1407template <class _Tp, class _Tuple, size_t... _Idx>1428template <class _Tp, class _Tuple, size_t... _Idx>
1408inline constexpr bool __can_make_from_tuple<_Tp, _Tuple, __tuple_indices<_Idx...>,1429inline constexpr bool __can_make_from_tuple<_Tp, _Tuple, index_sequence<_Idx...>,
1409 enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::declval<_Tuple>()))...>>> = true;1430 enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::declval<_Tuple>()))...>>> = true;
14101431
1411// Based on LWG3528(https://wg21.link/LWG3528) and http://eel.is/c++draft/description#structure.requirements-9,1432// Based on LWG3528(https://wg21.link/LWG3528) and http://eel.is/c++draft/description#structure.requirements-9,
...@@ -1418,10 +1439,19 @@ template <class _Tp, class _Tuple>...@@ -1418,10 +1439,19 @@ template <class _Tp, class _Tuple>
1418#else1439#else
1419template <class _Tp, class _Tuple, class = enable_if_t<__can_make_from_tuple<_Tp, _Tuple>>> // strengthen1440template <class _Tp, class _Tuple, class = enable_if_t<__can_make_from_tuple<_Tp, _Tuple>>> // strengthen
1420#endif // _LIBCPP_STD_VER >= 201441#endif // _LIBCPP_STD_VER >= 20
1421inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp make_from_tuple(_Tuple&& __t)1442
1422 _LIBCPP_NOEXCEPT_RETURN(std::__make_from_tuple_impl<_Tp>(1443[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp make_from_tuple(_Tuple&& __t)
1423 std::forward<_Tuple>(__t), typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type{}))1444 noexcept(noexcept(std::__make_from_tuple_impl<_Tp>(std::forward<_Tuple>(__t),
1424# undef _LIBCPP_NOEXCEPT_RETURN1445 make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>()))) {
1446#if _LIBCPP_STD_VER >= 23
1447 if constexpr (tuple_size_v<remove_reference_t<_Tuple>> == 1) {
1448 static_assert(!std::reference_constructs_from_temporary_v<_Tp, decltype(std::get<0>(std::declval<_Tuple>()))>,
1449 "Attempted construction of reference element binds to a temporary whose lifetime has ended");
1450 }
1451#endif // _LIBCPP_STD_VER >= 23
1452 return std::__make_from_tuple_impl<_Tp>(
1453 std::forward<_Tuple>(__t), make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>());
1454}
14251455
1426# endif // _LIBCPP_STD_VER >= 171456# endif // _LIBCPP_STD_VER >= 17
14271457
lib/libcxx/include/type_traits+8-2
...@@ -454,6 +454,10 @@ namespace std...@@ -454,6 +454,10 @@ namespace std
454 template<class B> inline constexpr bool negation_v454 template<class B> inline constexpr bool negation_v
455 = negation<B>::value; // since C++17455 = negation<B>::value; // since C++17
456456
457 // [meta.const.eval], constant evaluation context
458 constexpr bool is_constant_evaluated() noexcept; // C++20
459 template<class T>
460 consteval bool is_within_lifetime(const T*) noexcept; // C++26
457}461}
458462
459*/463*/
...@@ -546,9 +550,7 @@ namespace std...@@ -546,9 +550,7 @@ namespace std
546550
547# if _LIBCPP_STD_VER >= 20551# if _LIBCPP_STD_VER >= 20
548# include <__type_traits/common_reference.h>552# include <__type_traits/common_reference.h>
549# include <__type_traits/is_bounded_array.h>
550# include <__type_traits/is_constant_evaluated.h>553# include <__type_traits/is_constant_evaluated.h>
551# include <__type_traits/is_unbounded_array.h>
552# include <__type_traits/type_identity.h>554# include <__type_traits/type_identity.h>
553# include <__type_traits/unwrap_ref.h>555# include <__type_traits/unwrap_ref.h>
554# endif556# endif
...@@ -559,6 +561,10 @@ namespace std...@@ -559,6 +561,10 @@ namespace std
559# include <__type_traits/reference_converts_from_temporary.h>561# include <__type_traits/reference_converts_from_temporary.h>
560# endif562# endif
561563
564# if _LIBCPP_STD_VER >= 26
565# include <__type_traits/is_within_lifetime.h>
566# endif
567
562# include <version>568# include <version>
563569
564# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)570# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/typeindex+5-3
...@@ -86,8 +86,8 @@ public:...@@ -86,8 +86,8 @@ public:
86 }86 }
87# endif87# endif
8888
89 _LIBCPP_HIDE_FROM_ABI size_t hash_code() const _NOEXCEPT { return __t_->hash_code(); }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t hash_code() const _NOEXCEPT { return __t_->hash_code(); }
90 _LIBCPP_HIDE_FROM_ABI const char* name() const _NOEXCEPT { return __t_->name(); }90 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char* name() const _NOEXCEPT { return __t_->name(); }
91};91};
9292
93template <class _Tp>93template <class _Tp>
...@@ -95,7 +95,9 @@ struct hash;...@@ -95,7 +95,9 @@ struct hash;
9595
96template <>96template <>
97struct hash<type_index> : public __unary_function<type_index, size_t> {97struct hash<type_index> : public __unary_function<type_index, size_t> {
98 _LIBCPP_HIDE_FROM_ABI size_t operator()(type_index __index) const _NOEXCEPT { return __index.hash_code(); }98 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t operator()(type_index __index) const _NOEXCEPT {
99 return __index.hash_code();
100 }
99};101};
100102
101_LIBCPP_END_NAMESPACE_STD103_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/typeinfo+92-89
...@@ -95,11 +95,13 @@ class _LIBCPP_EXPORTED_FROM_ABI type_info {...@@ -95,11 +95,13 @@ class _LIBCPP_EXPORTED_FROM_ABI type_info {
95public:95public:
96 virtual ~type_info();96 virtual ~type_info();
9797
98 const char* name() const _NOEXCEPT;98 [[__nodiscard__]] const char* name() const _NOEXCEPT;
9999
100 _LIBCPP_HIDE_FROM_ABI bool before(const type_info& __arg) const _NOEXCEPT { return __compare(__arg) < 0; }100 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool before(const type_info& __arg) const _NOEXCEPT {
101 return __compare(__arg) < 0;
102 }
101103
102 size_t hash_code() const _NOEXCEPT;104 [[__nodiscard__]] size_t hash_code() const _NOEXCEPT;
103105
104 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT {106 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT {
105 // When evaluated in a constant expression, both type infos simply can't come107 // When evaluated in a constant expression, both type infos simply can't come
...@@ -186,99 +188,99 @@ public:...@@ -186,99 +188,99 @@ public:
186# endif188# endif
187# endif189# endif
188190
189struct __type_info_implementations {191namespace __type_info_implementations {
190 struct __string_impl_base {192struct __string_impl_base {
191 typedef const char* __type_name_t;193 typedef const char* __type_name_t;
192 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR static const char*194 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR static const char*
193 __type_name_to_string(__type_name_t __v) _NOEXCEPT {195 __type_name_to_string(__type_name_t __v) _NOEXCEPT {
194 return __v;196 return __v;
195 }197 }
196 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR static __type_name_t198 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR static __type_name_t
197 __string_to_type_name(const char* __v) _NOEXCEPT {199 __string_to_type_name(const char* __v) _NOEXCEPT {
198 return __v;200 return __v;
199 }201 }
200 };202};
201203
202 struct __unique_impl : __string_impl_base {204struct __unique_impl : __string_impl_base {
203 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __v) _NOEXCEPT {205 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __v) _NOEXCEPT {
204 return reinterpret_cast<size_t>(__v);206 return reinterpret_cast<size_t>(__v);
205 }207 }
206 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {208 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
207 return __lhs == __rhs;209 return __lhs == __rhs;
208 }210 }
209 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {211 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
210 return __lhs < __rhs;212 return __lhs < __rhs;
211 }213 }
212 };214};
213
214 struct __non_unique_impl : __string_impl_base {
215 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __ptr) _NOEXCEPT {
216 size_t __hash = 5381;
217 while (unsigned char __c = static_cast<unsigned char>(*__ptr++))
218 __hash = (__hash * 33) ^ __c;
219 return __hash;
220 }
221 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
222 return __lhs == __rhs || __builtin_strcmp(__lhs, __rhs) == 0;
223 }
224 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
225 return __builtin_strcmp(__lhs, __rhs) < 0;
226 }
227 };
228215
229 struct __non_unique_arm_rtti_bit_impl {216struct __non_unique_impl : __string_impl_base {
230 typedef uintptr_t __type_name_t;217 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __ptr) _NOEXCEPT {
218 size_t __hash = 5381;
219 while (unsigned char __c = static_cast<unsigned char>(*__ptr++))
220 __hash = (__hash * 33) ^ __c;
221 return __hash;
222 }
223 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
224 return __lhs == __rhs || __builtin_strcmp(__lhs, __rhs) == 0;
225 }
226 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
227 return __builtin_strcmp(__lhs, __rhs) < 0;
228 }
229};
231230
232 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static const char* __type_name_to_string(__type_name_t __v) _NOEXCEPT {231struct __non_unique_arm_rtti_bit_impl {
233 return reinterpret_cast<const char*>(__v & ~__non_unique_rtti_bit::value);232 typedef uintptr_t __type_name_t;
234 }
235 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static __type_name_t __string_to_type_name(const char* __v) _NOEXCEPT {
236 return reinterpret_cast<__type_name_t>(__v);
237 }
238233
239 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __v) _NOEXCEPT {234 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static const char* __type_name_to_string(__type_name_t __v) _NOEXCEPT {
240 if (__is_type_name_unique(__v))235 return reinterpret_cast<const char*>(__v & ~__non_unique_rtti_bit::value);
241 return __v;236 }
242 return __non_unique_impl::__hash(__type_name_to_string(__v));237 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static __type_name_t __string_to_type_name(const char* __v) _NOEXCEPT {
243 }238 return reinterpret_cast<__type_name_t>(__v);
244 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {239 }
245 if (__lhs == __rhs)
246 return true;
247 if (__is_type_name_unique(__lhs) || __is_type_name_unique(__rhs))
248 // Either both are unique and have a different address, or one of them
249 // is unique and the other one isn't. In both cases they are unequal.
250 return false;
251 return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) == 0;
252 }
253 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
254 if (__is_type_name_unique(__lhs) || __is_type_name_unique(__rhs))
255 return __lhs < __rhs;
256 return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) < 0;
257 }
258240
259 private:241 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __v) _NOEXCEPT {
260 // The unique bit is the top bit. It is expected that __type_name_t is 64 bits when242 if (__is_type_name_unique(__v))
261 // this implementation is actually used.243 return __v;
262 typedef integral_constant<__type_name_t, (1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))>244 return __non_unique_impl::__hash(__type_name_to_string(__v));
263 __non_unique_rtti_bit;245 }
246 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
247 if (__lhs == __rhs)
248 return true;
249 if (__is_type_name_unique(__lhs) || __is_type_name_unique(__rhs))
250 // Either both are unique and have a different address, or one of them
251 // is unique and the other one isn't. In both cases they are unequal.
252 return false;
253 return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) == 0;
254 }
255 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
256 if (__is_type_name_unique(__lhs) || __is_type_name_unique(__rhs))
257 return __lhs < __rhs;
258 return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) < 0;
259 }
264260
265 _LIBCPP_HIDE_FROM_ABI static bool __is_type_name_unique(__type_name_t __lhs) _NOEXCEPT {261private:
266 return !(__lhs & __non_unique_rtti_bit::value);262 // The unique bit is the top bit. It is expected that __type_name_t is 64 bits when
267 }263 // this implementation is actually used.
268 };264 typedef integral_constant<__type_name_t, (1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))>
265 __non_unique_rtti_bit;
266
267 _LIBCPP_HIDE_FROM_ABI static bool __is_type_name_unique(__type_name_t __lhs) _NOEXCEPT {
268 return !(__lhs & __non_unique_rtti_bit::value);
269 }
270};
269271
270 typedef272typedef
271# if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1273# if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
272 __unique_impl274 __unique_impl
273# elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 2275# elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 2
274 __non_unique_impl276 __non_unique_impl
275# elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 3277# elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 3
276 __non_unique_arm_rtti_bit_impl278 __non_unique_arm_rtti_bit_impl
277# else279# else
278# error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION280# error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
279# endif281# endif
280 __impl;282 __impl;
281};283} // namespace __type_info_implementations
282284
283# if __has_cpp_attribute(_Clang::__ptrauth_vtable_pointer__)285# if __has_cpp_attribute(_Clang::__ptrauth_vtable_pointer__)
284# if __has_feature(ptrauth_type_info_vtable_pointer_discrimination)286# if __has_feature(ptrauth_type_info_vtable_pointer_discrimination)
...@@ -306,14 +308,15 @@ protected:...@@ -306,14 +308,15 @@ protected:
306308
307public:309public:
308 virtual ~type_info();310 virtual ~type_info();
311 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char* name() const _NOEXCEPT {
312 return __impl::__type_name_to_string(__type_name);
313 }
309314
310 _LIBCPP_HIDE_FROM_ABI const char* name() const _NOEXCEPT { return __impl::__type_name_to_string(__type_name); }315 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool before(const type_info& __arg) const _NOEXCEPT {
311
312 _LIBCPP_HIDE_FROM_ABI bool before(const type_info& __arg) const _NOEXCEPT {
313 return __impl::__lt(__type_name, __arg.__type_name);316 return __impl::__lt(__type_name, __arg.__type_name);
314 }317 }
315318
316 _LIBCPP_HIDE_FROM_ABI size_t hash_code() const _NOEXCEPT { return __impl::__hash(__type_name); }319 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t hash_code() const _NOEXCEPT { return __impl::__hash(__type_name); }
317320
318 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT {321 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT {
319 // When evaluated in a constant expression, both type infos simply can't come322 // When evaluated in a constant expression, both type infos simply can't come
...@@ -336,7 +339,7 @@ public:...@@ -336,7 +339,7 @@ public:
336 _LIBCPP_HIDE_FROM_ABI bad_cast(const bad_cast&) _NOEXCEPT = default;339 _LIBCPP_HIDE_FROM_ABI bad_cast(const bad_cast&) _NOEXCEPT = default;
337 _LIBCPP_HIDE_FROM_ABI bad_cast& operator=(const bad_cast&) _NOEXCEPT = default;340 _LIBCPP_HIDE_FROM_ABI bad_cast& operator=(const bad_cast&) _NOEXCEPT = default;
338 ~bad_cast() _NOEXCEPT override;341 ~bad_cast() _NOEXCEPT override;
339 const char* what() const _NOEXCEPT override;342 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
340};343};
341344
342class _LIBCPP_EXPORTED_FROM_ABI bad_typeid : public exception {345class _LIBCPP_EXPORTED_FROM_ABI bad_typeid : public exception {
...@@ -345,7 +348,7 @@ public:...@@ -345,7 +348,7 @@ public:
345 _LIBCPP_HIDE_FROM_ABI bad_typeid(const bad_typeid&) _NOEXCEPT = default;348 _LIBCPP_HIDE_FROM_ABI bad_typeid(const bad_typeid&) _NOEXCEPT = default;
346 _LIBCPP_HIDE_FROM_ABI bad_typeid& operator=(const bad_typeid&) _NOEXCEPT = default;349 _LIBCPP_HIDE_FROM_ABI bad_typeid& operator=(const bad_typeid&) _NOEXCEPT = default;
347 ~bad_typeid() _NOEXCEPT override;350 ~bad_typeid() _NOEXCEPT override;
348 const char* what() const _NOEXCEPT override;351 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
349};352};
350353
351} // namespace std354} // namespace std
lib/libcxx/include/unordered_map+179-304
...@@ -600,6 +600,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>...@@ -600,6 +600,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
600# include <__memory/addressof.h>600# include <__memory/addressof.h>
601# include <__memory/allocator.h>601# include <__memory/allocator.h>
602# include <__memory/allocator_traits.h>602# include <__memory/allocator_traits.h>
603# include <__memory/compressed_pair.h>
603# include <__memory/pointer_traits.h>604# include <__memory/pointer_traits.h>
604# include <__memory/unique_ptr.h>605# include <__memory/unique_ptr.h>
605# include <__memory_resource/polymorphic_allocator.h>606# include <__memory_resource/polymorphic_allocator.h>
...@@ -643,34 +644,9 @@ _LIBCPP_PUSH_MACROS...@@ -643,34 +644,9 @@ _LIBCPP_PUSH_MACROS
643644
644_LIBCPP_BEGIN_NAMESPACE_STD645_LIBCPP_BEGIN_NAMESPACE_STD
645646
646template <class _Key,
647 class _Cp,
648 class _Hash,
649 class _Pred,
650 bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>
651class __unordered_map_hasher : private _Hash {
652public:
653 _LIBCPP_HIDE_FROM_ABI __unordered_map_hasher() _NOEXCEPT_(is_nothrow_default_constructible<_Hash>::value) : _Hash() {}
654 _LIBCPP_HIDE_FROM_ABI __unordered_map_hasher(const _Hash& __h) _NOEXCEPT_(is_nothrow_copy_constructible<_Hash>::value)
655 : _Hash(__h) {}
656 _LIBCPP_HIDE_FROM_ABI const _Hash& hash_function() const _NOEXCEPT { return *this; }
657 _LIBCPP_HIDE_FROM_ABI size_t operator()(const _Cp& __x) const { return static_cast<const _Hash&>(*this)(__x.first); }
658 _LIBCPP_HIDE_FROM_ABI size_t operator()(const _Key& __x) const { return static_cast<const _Hash&>(*this)(__x); }
659# if _LIBCPP_STD_VER >= 20
660 template <typename _K2>
661 _LIBCPP_HIDE_FROM_ABI size_t operator()(const _K2& __x) const {
662 return static_cast<const _Hash&>(*this)(__x);
663 }
664# endif
665 _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Hash>) {
666 using std::swap;
667 swap(static_cast<_Hash&>(*this), static_cast<_Hash&>(__y));
668 }
669};
670
671template <class _Key, class _Cp, class _Hash, class _Pred>647template <class _Key, class _Cp, class _Hash, class _Pred>
672class __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, false> {648class __unordered_map_hasher {
673 _Hash __hash_;649 _LIBCPP_COMPRESSED_ELEMENT(_Hash, __hash_);
674650
675public:651public:
676 _LIBCPP_HIDE_FROM_ABI __unordered_map_hasher() _NOEXCEPT_(is_nothrow_default_constructible<_Hash>::value)652 _LIBCPP_HIDE_FROM_ABI __unordered_map_hasher() _NOEXCEPT_(is_nothrow_default_constructible<_Hash>::value)
...@@ -692,60 +668,16 @@ public:...@@ -692,60 +668,16 @@ public:
692 }668 }
693};669};
694670
695template <class _Key, class _Cp, class _Hash, class _Pred, bool __b>671template <class _Key, class _Cp, class _Hash, class _Pred>
696inline _LIBCPP_HIDE_FROM_ABI void672inline _LIBCPP_HIDE_FROM_ABI void
697swap(__unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __x,673swap(__unordered_map_hasher<_Key, _Cp, _Hash, _Pred>& __x, __unordered_map_hasher<_Key, _Cp, _Hash, _Pred>& __y)
698 __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {674 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
699 __x.swap(__y);675 __x.swap(__y);
700}676}
701677
702template <class _Key,
703 class _Cp,
704 class _Pred,
705 class _Hash,
706 bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value>
707class __unordered_map_equal : private _Pred {
708public:
709 _LIBCPP_HIDE_FROM_ABI __unordered_map_equal() _NOEXCEPT_(is_nothrow_default_constructible<_Pred>::value) : _Pred() {}
710 _LIBCPP_HIDE_FROM_ABI __unordered_map_equal(const _Pred& __p) _NOEXCEPT_(is_nothrow_copy_constructible<_Pred>::value)
711 : _Pred(__p) {}
712 _LIBCPP_HIDE_FROM_ABI const _Pred& key_eq() const _NOEXCEPT { return *this; }
713 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Cp& __x, const _Cp& __y) const {
714 return static_cast<const _Pred&>(*this)(__x.first, __y.first);
715 }
716 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Cp& __x, const _Key& __y) const {
717 return static_cast<const _Pred&>(*this)(__x.first, __y);
718 }
719 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _Cp& __y) const {
720 return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);
721 }
722# if _LIBCPP_STD_VER >= 20
723 template <typename _K2>
724 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Cp& __x, const _K2& __y) const {
725 return static_cast<const _Pred&>(*this)(__x.first, __y);
726 }
727 template <typename _K2>
728 _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _Cp& __y) const {
729 return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);
730 }
731 template <typename _K2>
732 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _K2& __y) const {
733 return static_cast<const _Pred&>(*this)(__x, __y);
734 }
735 template <typename _K2>
736 _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _Key& __y) const {
737 return static_cast<const _Pred&>(*this)(__x, __y);
738 }
739# endif
740 _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Pred>) {
741 using std::swap;
742 swap(static_cast<_Pred&>(*this), static_cast<_Pred&>(__y));
743 }
744};
745
746template <class _Key, class _Cp, class _Pred, class _Hash>678template <class _Key, class _Cp, class _Pred, class _Hash>
747class __unordered_map_equal<_Key, _Cp, _Pred, _Hash, false> {679class __unordered_map_equal {
748 _Pred __pred_;680 _LIBCPP_COMPRESSED_ELEMENT(_Pred, __pred_);
749681
750public:682public:
751 _LIBCPP_HIDE_FROM_ABI __unordered_map_equal() _NOEXCEPT_(is_nothrow_default_constructible<_Pred>::value)683 _LIBCPP_HIDE_FROM_ABI __unordered_map_equal() _NOEXCEPT_(is_nothrow_default_constructible<_Pred>::value)
...@@ -780,9 +712,9 @@ public:...@@ -780,9 +712,9 @@ public:
780 }712 }
781};713};
782714
783template <class _Key, class _Cp, class _Pred, class _Hash, bool __b>715template <class _Key, class _Cp, class _Pred, class _Hash>
784inline _LIBCPP_HIDE_FROM_ABI void716inline _LIBCPP_HIDE_FROM_ABI void
785swap(__unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __x, __unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __y)717swap(__unordered_map_equal<_Key, _Cp, _Pred, _Hash>& __x, __unordered_map_equal<_Key, _Cp, _Pred, _Hash>& __y)
786 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {718 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
787 __x.swap(__y);719 __x.swap(__y);
788}720}
...@@ -844,10 +776,10 @@ class __hash_map_iterator {...@@ -844,10 +776,10 @@ class __hash_map_iterator {
844776
845public:777public:
846 typedef forward_iterator_tag iterator_category;778 typedef forward_iterator_tag iterator_category;
847 typedef typename _NodeTypes::__map_value_type value_type;779 using value_type = typename _HashIterator::value_type;
848 typedef typename _NodeTypes::difference_type difference_type;780 using difference_type = ptrdiff_t;
849 typedef value_type& reference;781 typedef value_type& reference;
850 typedef typename _NodeTypes::__map_value_type_pointer pointer;782 using pointer = typename _HashIterator::pointer;
851783
852 _LIBCPP_HIDE_FROM_ABI __hash_map_iterator() _NOEXCEPT {}784 _LIBCPP_HIDE_FROM_ABI __hash_map_iterator() _NOEXCEPT {}
853785
...@@ -895,10 +827,10 @@ class __hash_map_const_iterator {...@@ -895,10 +827,10 @@ class __hash_map_const_iterator {
895827
896public:828public:
897 typedef forward_iterator_tag iterator_category;829 typedef forward_iterator_tag iterator_category;
898 typedef typename _NodeTypes::__map_value_type value_type;830 using value_type = typename _HashIterator::value_type;
899 typedef typename _NodeTypes::difference_type difference_type;831 using difference_type = ptrdiff_t;
900 typedef const value_type& reference;832 typedef const value_type& reference;
901 typedef typename _NodeTypes::__const_map_value_type_pointer pointer;833 using pointer = typename _HashIterator::pointer;
902834
903 _LIBCPP_HIDE_FROM_ABI __hash_map_const_iterator() _NOEXCEPT {}835 _LIBCPP_HIDE_FROM_ABI __hash_map_const_iterator() _NOEXCEPT {}
904836
...@@ -972,9 +904,6 @@ private:...@@ -972,9 +904,6 @@ private:
972904
973 __table __table_;905 __table __table_;
974906
975 typedef typename __table::_NodeTypes _NodeTypes;
976 typedef typename __table::__node_pointer __node_pointer;
977 typedef typename __table::__node_const_pointer __node_const_pointer;
978 typedef typename __table::__node_traits __node_traits;907 typedef typename __table::__node_traits __node_traits;
979 typedef typename __table::__node_allocator __node_allocator;908 typedef typename __table::__node_allocator __node_allocator;
980 typedef typename __table::__node __node;909 typedef typename __table::__node __node;
...@@ -1046,10 +975,10 @@ public:...@@ -1046,10 +975,10 @@ public:
1046# endif975# endif
1047976
1048 _LIBCPP_HIDE_FROM_ABI explicit unordered_map(const allocator_type& __a);977 _LIBCPP_HIDE_FROM_ABI explicit unordered_map(const allocator_type& __a);
1049 _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u);978 _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u) = default;
1050 _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u, const allocator_type& __a);979 _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u, const allocator_type& __a);
1051# ifndef _LIBCPP_CXX03_LANG980# ifndef _LIBCPP_CXX03_LANG
1052 _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);981 _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u) = default;
1053 _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u, const allocator_type& __a);982 _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u, const allocator_type& __a);
1054 _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il);983 _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il);
1055 _LIBCPP_HIDE_FROM_ABI984 _LIBCPP_HIDE_FROM_ABI
...@@ -1099,41 +1028,26 @@ public:...@@ -1099,41 +1028,26 @@ public:
1099 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");1028 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");
1100 }1029 }
11011030
1102 _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(const unordered_map& __u) {1031 _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(const unordered_map& __u) = default;
1103# ifndef _LIBCPP_CXX03_LANG
1104 __table_ = __u.__table_;
1105# else
1106 if (this != std::addressof(__u)) {
1107 __table_.clear();
1108 __table_.hash_function() = __u.__table_.hash_function();
1109 __table_.key_eq() = __u.__table_.key_eq();
1110 __table_.max_load_factor() = __u.__table_.max_load_factor();
1111 __table_.__copy_assign_alloc(__u.__table_);
1112 insert(__u.begin(), __u.end());
1113 }
1114# endif
1115 return *this;
1116 }
1117# ifndef _LIBCPP_CXX03_LANG1032# ifndef _LIBCPP_CXX03_LANG
1118 _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(unordered_map&& __u)1033 _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(unordered_map&& __u) = default;
1119 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
1120 _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(initializer_list<value_type> __il);1034 _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(initializer_list<value_type> __il);
1121# endif // _LIBCPP_CXX03_LANG1035# endif // _LIBCPP_CXX03_LANG
11221036
1123 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {1037 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
1124 return allocator_type(__table_.__node_alloc());1038 return allocator_type(__table_.__node_alloc());
1125 }1039 }
11261040
1127 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }1041 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }
1128 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }1042 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
1129 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }1043 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
11301044
1131 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }1045 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
1132 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }1046 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
1133 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }1047 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
1134 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }1048 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
1135 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }1049 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
1136 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }1050 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
11371051
1138 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) { return __table_.__emplace_unique(__x); }1052 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) { return __table_.__emplace_unique(__x); }
11391053
...@@ -1187,14 +1101,13 @@ public:...@@ -1187,14 +1101,13 @@ public:
1187# if _LIBCPP_STD_VER >= 171101# if _LIBCPP_STD_VER >= 17
1188 template <class... _Args>1102 template <class... _Args>
1189 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {1103 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {
1190 return __table_.__emplace_unique_key_args(1104 return __table_.__emplace_unique(
1191 __k, piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple(std::forward<_Args>(__args)...));1105 piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple(std::forward<_Args>(__args)...));
1192 }1106 }
11931107
1194 template <class... _Args>1108 template <class... _Args>
1195 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {1109 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {
1196 return __table_.__emplace_unique_key_args(1110 return __table_.__emplace_unique(
1197 __k,
1198 piecewise_construct,1111 piecewise_construct,
1199 std::forward_as_tuple(std::move(__k)),1112 std::forward_as_tuple(std::move(__k)),
1200 std::forward_as_tuple(std::forward<_Args>(__args)...));1113 std::forward_as_tuple(std::forward<_Args>(__args)...));
...@@ -1212,7 +1125,7 @@ public:...@@ -1212,7 +1125,7 @@ public:
12121125
1213 template <class _Vp>1126 template <class _Vp>
1214 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {1127 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {
1215 pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k, __k, std::forward<_Vp>(__v));1128 pair<iterator, bool> __res = __table_.__emplace_unique(__k, std::forward<_Vp>(__v));
1216 if (!__res.second) {1129 if (!__res.second) {
1217 __res.first->second = std::forward<_Vp>(__v);1130 __res.first->second = std::forward<_Vp>(__v);
1218 }1131 }
...@@ -1221,7 +1134,7 @@ public:...@@ -1221,7 +1134,7 @@ public:
12211134
1222 template <class _Vp>1135 template <class _Vp>
1223 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {1136 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
1224 pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k, std::move(__k), std::forward<_Vp>(__v));1137 pair<iterator, bool> __res = __table_.__emplace_unique(std::move(__k), std::forward<_Vp>(__v));
1225 if (!__res.second) {1138 if (!__res.second) {
1226 __res.first->second = std::forward<_Vp>(__v);1139 __res.first->second = std::forward<_Vp>(__v);
1227 }1140 }
...@@ -1258,10 +1171,10 @@ public:...@@ -1258,10 +1171,10 @@ public:
1258 "node_type with incompatible allocator passed to unordered_map::insert()");1171 "node_type with incompatible allocator passed to unordered_map::insert()");
1259 return __table_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));1172 return __table_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
1260 }1173 }
1261 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1174 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
1262 return __table_.template __node_handle_extract<node_type>(__key);1175 return __table_.template __node_handle_extract<node_type>(__key);
1263 }1176 }
1264 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1177 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
1265 return __table_.template __node_handle_extract<node_type>(__it.__i_);1178 return __table_.template __node_handle_extract<node_type>(__it.__i_);
1266 }1179 }
12671180
...@@ -1295,52 +1208,56 @@ public:...@@ -1295,52 +1208,56 @@ public:
1295 __table_.swap(__u.__table_);1208 __table_.swap(__u.__table_);
1296 }1209 }
12971210
1298 _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function().hash_function(); }1211 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI hasher hash_function() const {
1299 _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }1212 return __table_.hash_function().hash_function();
1213 }
1214 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }
13001215
1301 _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); }
1302 _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); }
1303# if _LIBCPP_STD_VER >= 201218# if _LIBCPP_STD_VER >= 20
1304 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1219 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1305 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1220 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1306 return __table_.find(__k);1221 return __table_.find(__k);
1307 }1222 }
1308 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1223 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1309 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1224 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1310 return __table_.find(__k);1225 return __table_.find(__k);
1311 }1226 }
1312# endif // _LIBCPP_STD_VER >= 201227# endif // _LIBCPP_STD_VER >= 20
13131228
1314 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); }1229 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
1230 return __table_.__count_unique(__k);
1231 }
1315# if _LIBCPP_STD_VER >= 201232# if _LIBCPP_STD_VER >= 20
1316 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1233 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1317 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1234 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1318 return __table_.__count_unique(__k);1235 return __table_.__count_unique(__k);
1319 }1236 }
1320# endif // _LIBCPP_STD_VER >= 201237# endif // _LIBCPP_STD_VER >= 20
13211238
1322# if _LIBCPP_STD_VER >= 201239# if _LIBCPP_STD_VER >= 20
1323 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1240 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
13241241
1325 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1242 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1326 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1243 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1327 return find(__k) != end();1244 return find(__k) != end();
1328 }1245 }
1329# endif // _LIBCPP_STD_VER >= 201246# endif // _LIBCPP_STD_VER >= 20
13301247
1331 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1248 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
1332 return __table_.__equal_range_unique(__k);1249 return __table_.__equal_range_unique(__k);
1333 }1250 }
1334 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1251 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
1335 return __table_.__equal_range_unique(__k);1252 return __table_.__equal_range_unique(__k);
1336 }1253 }
1337# if _LIBCPP_STD_VER >= 201254# if _LIBCPP_STD_VER >= 20
1338 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1255 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1339 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1256 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1340 return __table_.__equal_range_unique(__k);1257 return __table_.__equal_range_unique(__k);
1341 }1258 }
1342 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1259 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1343 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1260 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1344 return __table_.__equal_range_unique(__k);1261 return __table_.__equal_range_unique(__k);
1345 }1262 }
1346# endif // _LIBCPP_STD_VER >= 201263# endif // _LIBCPP_STD_VER >= 20
...@@ -1350,24 +1267,32 @@ public:...@@ -1350,24 +1267,32 @@ public:
1350 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);1267 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
1351# endif1268# endif
13521269
1353 _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);1270 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
1354 _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;1271 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;
13551272
1356 _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }1273 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
1357 _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }1274 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT {
1275 return __table_.max_bucket_count();
1276 }
13581277
1359 _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }1278 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const {
1360 _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }1279 return __table_.bucket_size(__n);
1280 }
1281 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
13611282
1362 _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }1283 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
1363 _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }1284 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
1364 _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }1285 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const {
1365 _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }1286 return __table_.cbegin(__n);
1366 _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }1287 }
1367 _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }1288 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
1289 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const {
1290 return __table_.cbegin(__n);
1291 }
1292 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
13681293
1369 _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }1294 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
1370 _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }1295 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
1371 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }1296 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }
1372 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_unique(__n); }1297 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_unique(__n); }
1373 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_unique(__n); }1298 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_unique(__n); }
...@@ -1384,10 +1309,10 @@ template <class _InputIterator,...@@ -1384,10 +1309,10 @@ template <class _InputIterator,
1384 class _Pred = equal_to<__iter_key_type<_InputIterator>>,1309 class _Pred = equal_to<__iter_key_type<_InputIterator>>,
1385 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,1310 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
1386 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1311 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1387 class = enable_if_t<!__is_allocator<_Hash>::value>,1312 class = enable_if_t<!__is_allocator_v<_Hash>>,
1388 class = enable_if_t<!is_integral<_Hash>::value>,1313 class = enable_if_t<!is_integral<_Hash>::value>,
1389 class = enable_if_t<!__is_allocator<_Pred>::value>,1314 class = enable_if_t<!__is_allocator_v<_Pred>>,
1390 class = enable_if_t<__is_allocator<_Allocator>::value>>1315 class = enable_if_t<__is_allocator_v<_Allocator>>>
1391unordered_map(_InputIterator,1316unordered_map(_InputIterator,
1392 _InputIterator,1317 _InputIterator,
1393 typename allocator_traits<_Allocator>::size_type = 0,1318 typename allocator_traits<_Allocator>::size_type = 0,
...@@ -1401,10 +1326,10 @@ template <ranges::input_range _Range,...@@ -1401,10 +1326,10 @@ template <ranges::input_range _Range,
1401 class _Hash = hash<__range_key_type<_Range>>,1326 class _Hash = hash<__range_key_type<_Range>>,
1402 class _Pred = equal_to<__range_key_type<_Range>>,1327 class _Pred = equal_to<__range_key_type<_Range>>,
1403 class _Allocator = allocator<__range_to_alloc_type<_Range>>,1328 class _Allocator = allocator<__range_to_alloc_type<_Range>>,
1404 class = enable_if_t<!__is_allocator<_Hash>::value>,1329 class = enable_if_t<!__is_allocator_v<_Hash>>,
1405 class = enable_if_t<!is_integral<_Hash>::value>,1330 class = enable_if_t<!is_integral<_Hash>::value>,
1406 class = enable_if_t<!__is_allocator<_Pred>::value>,1331 class = enable_if_t<!__is_allocator_v<_Pred>>,
1407 class = enable_if_t<__is_allocator<_Allocator>::value>>1332 class = enable_if_t<__is_allocator_v<_Allocator>>>
1408unordered_map(from_range_t,1333unordered_map(from_range_t,
1409 _Range&&,1334 _Range&&,
1410 typename allocator_traits<_Allocator>::size_type = 0,1335 typename allocator_traits<_Allocator>::size_type = 0,
...@@ -1419,10 +1344,10 @@ template <class _Key,...@@ -1419,10 +1344,10 @@ template <class _Key,
1419 class _Hash = hash<remove_const_t<_Key>>,1344 class _Hash = hash<remove_const_t<_Key>>,
1420 class _Pred = equal_to<remove_const_t<_Key>>,1345 class _Pred = equal_to<remove_const_t<_Key>>,
1421 class _Allocator = allocator<pair<const _Key, _Tp>>,1346 class _Allocator = allocator<pair<const _Key, _Tp>>,
1422 class = enable_if_t<!__is_allocator<_Hash>::value>,1347 class = enable_if_t<!__is_allocator_v<_Hash>>,
1423 class = enable_if_t<!is_integral<_Hash>::value>,1348 class = enable_if_t<!is_integral<_Hash>::value>,
1424 class = enable_if_t<!__is_allocator<_Pred>::value>,1349 class = enable_if_t<!__is_allocator_v<_Pred>>,
1425 class = enable_if_t<__is_allocator<_Allocator>::value>>1350 class = enable_if_t<__is_allocator_v<_Allocator>>>
1426unordered_map(initializer_list<pair<_Key, _Tp>>,1351unordered_map(initializer_list<pair<_Key, _Tp>>,
1427 typename allocator_traits<_Allocator>::size_type = 0,1352 typename allocator_traits<_Allocator>::size_type = 0,
1428 _Hash = _Hash(),1353 _Hash = _Hash(),
...@@ -1432,7 +1357,7 @@ unordered_map(initializer_list<pair<_Key, _Tp>>,...@@ -1432,7 +1357,7 @@ unordered_map(initializer_list<pair<_Key, _Tp>>,
1432template <class _InputIterator,1357template <class _InputIterator,
1433 class _Allocator,1358 class _Allocator,
1434 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1359 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1435 class = enable_if_t<__is_allocator<_Allocator>::value>>1360 class = enable_if_t<__is_allocator_v<_Allocator>>>
1436unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)1361unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
1437 -> unordered_map<__iter_key_type<_InputIterator>,1362 -> unordered_map<__iter_key_type<_InputIterator>,
1438 __iter_mapped_type<_InputIterator>,1363 __iter_mapped_type<_InputIterator>,
...@@ -1443,7 +1368,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat...@@ -1443,7 +1368,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
1443template <class _InputIterator,1368template <class _InputIterator,
1444 class _Allocator,1369 class _Allocator,
1445 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1370 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1446 class = enable_if_t<__is_allocator<_Allocator>::value>>1371 class = enable_if_t<__is_allocator_v<_Allocator>>>
1447unordered_map(_InputIterator, _InputIterator, _Allocator)1372unordered_map(_InputIterator, _InputIterator, _Allocator)
1448 -> unordered_map<__iter_key_type<_InputIterator>,1373 -> unordered_map<__iter_key_type<_InputIterator>,
1449 __iter_mapped_type<_InputIterator>,1374 __iter_mapped_type<_InputIterator>,
...@@ -1455,9 +1380,9 @@ template <class _InputIterator,...@@ -1455,9 +1380,9 @@ template <class _InputIterator,
1455 class _Hash,1380 class _Hash,
1456 class _Allocator,1381 class _Allocator,
1457 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1382 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1458 class = enable_if_t<!__is_allocator<_Hash>::value>,1383 class = enable_if_t<!__is_allocator_v<_Hash>>,
1459 class = enable_if_t<!is_integral<_Hash>::value>,1384 class = enable_if_t<!is_integral<_Hash>::value>,
1460 class = enable_if_t<__is_allocator<_Allocator>::value>>1385 class = enable_if_t<__is_allocator_v<_Allocator>>>
1461unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1386unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1462 -> unordered_map<__iter_key_type<_InputIterator>,1387 -> unordered_map<__iter_key_type<_InputIterator>,
1463 __iter_mapped_type<_InputIterator>,1388 __iter_mapped_type<_InputIterator>,
...@@ -1467,7 +1392,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat...@@ -1467,7 +1392,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
14671392
1468# if _LIBCPP_STD_VER >= 231393# if _LIBCPP_STD_VER >= 23
14691394
1470template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1395template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1471unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)1396unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
1472 -> unordered_map<__range_key_type<_Range>,1397 -> unordered_map<__range_key_type<_Range>,
1473 __range_mapped_type<_Range>,1398 __range_mapped_type<_Range>,
...@@ -1475,7 +1400,7 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz...@@ -1475,7 +1400,7 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz
1475 equal_to<__range_key_type<_Range>>,1400 equal_to<__range_key_type<_Range>>,
1476 _Allocator>;1401 _Allocator>;
14771402
1478template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1403template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1479unordered_map(from_range_t, _Range&&, _Allocator)1404unordered_map(from_range_t, _Range&&, _Allocator)
1480 -> unordered_map<__range_key_type<_Range>,1405 -> unordered_map<__range_key_type<_Range>,
1481 __range_mapped_type<_Range>,1406 __range_mapped_type<_Range>,
...@@ -1486,9 +1411,9 @@ unordered_map(from_range_t, _Range&&, _Allocator)...@@ -1486,9 +1411,9 @@ unordered_map(from_range_t, _Range&&, _Allocator)
1486template <ranges::input_range _Range,1411template <ranges::input_range _Range,
1487 class _Hash,1412 class _Hash,
1488 class _Allocator,1413 class _Allocator,
1489 class = enable_if_t<!__is_allocator<_Hash>::value>,1414 class = enable_if_t<!__is_allocator_v<_Hash>>,
1490 class = enable_if_t<!is_integral<_Hash>::value>,1415 class = enable_if_t<!is_integral<_Hash>::value>,
1491 class = enable_if_t<__is_allocator<_Allocator>::value>>1416 class = enable_if_t<__is_allocator_v<_Allocator>>>
1492unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1417unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1493 -> unordered_map<__range_key_type<_Range>,1418 -> unordered_map<__range_key_type<_Range>,
1494 __range_mapped_type<_Range>,1419 __range_mapped_type<_Range>,
...@@ -1498,11 +1423,11 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz...@@ -1498,11 +1423,11 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz
14981423
1499# endif1424# endif
15001425
1501template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1426template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1502unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)1427unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
1503 -> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;1428 -> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;
15041429
1505template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1430template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1506unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)1431unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1507 -> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;1432 -> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;
15081433
...@@ -1510,9 +1435,9 @@ template <class _Key,...@@ -1510,9 +1435,9 @@ template <class _Key,
1510 class _Tp,1435 class _Tp,
1511 class _Hash,1436 class _Hash,
1512 class _Allocator,1437 class _Allocator,
1513 class = enable_if_t<!__is_allocator<_Hash>::value>,1438 class = enable_if_t<!__is_allocator_v<_Hash>>,
1514 class = enable_if_t<!is_integral<_Hash>::value>,1439 class = enable_if_t<!is_integral<_Hash>::value>,
1515 class = enable_if_t<__is_allocator<_Allocator>::value>>1440 class = enable_if_t<__is_allocator_v<_Allocator>>>
1516unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1441unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1517 -> unordered_map<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;1442 -> unordered_map<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;
1518# endif1443# endif
...@@ -1563,12 +1488,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1563,12 +1488,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1563 insert(__first, __last);1488 insert(__first, __last);
1564}1489}
15651490
1566template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1567unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const unordered_map& __u) : __table_(__u.__table_) {
1568 __table_.__rehash_unique(__u.bucket_count());
1569 insert(__u.begin(), __u.end());
1570}
1571
1572template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1491template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1573unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const unordered_map& __u, const allocator_type& __a)1492unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const unordered_map& __u, const allocator_type& __a)
1574 : __table_(__u.__table_, typename __table::allocator_type(__a)) {1493 : __table_(__u.__table_, typename __table::allocator_type(__a)) {
...@@ -1578,11 +1497,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const unordered_ma...@@ -1578,11 +1497,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const unordered_ma
15781497
1579# ifndef _LIBCPP_CXX03_LANG1498# ifndef _LIBCPP_CXX03_LANG
15801499
1581template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1582inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(unordered_map&& __u)
1583 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1584 : __table_(std::move(__u.__table_)) {}
1585
1586template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1500template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1587unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(unordered_map&& __u, const allocator_type& __a)1501unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(unordered_map&& __u, const allocator_type& __a)
1588 : __table_(std::move(__u.__table_), typename __table::allocator_type(__a)) {1502 : __table_(std::move(__u.__table_), typename __table::allocator_type(__a)) {
...@@ -1618,14 +1532,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1618,14 +1532,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1618 insert(__il.begin(), __il.end());1532 insert(__il.begin(), __il.end());
1619}1533}
16201534
1621template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1622inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
1623unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
1624 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
1625 __table_ = std::move(__u.__table_);
1626 return *this;
1627}
1628
1629template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1535template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1630inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&1536inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
1631unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {1537unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
...@@ -1646,16 +1552,13 @@ inline void unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterato...@@ -1646,16 +1552,13 @@ inline void unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterato
16461552
1647template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1553template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1648_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) {1554_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) {
1649 return __table_1555 return __table_.__emplace_unique(piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
1650 .__emplace_unique_key_args(__k, piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
1651 .first->second;1556 .first->second;
1652}1557}
16531558
1654template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1559template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1655_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k) {1560_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k) {
1656 return __table_1561 return __table_.__emplace_unique(piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
1657 .__emplace_unique_key_args(
1658 __k, piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
1659 .first->second;1562 .first->second;
1660}1563}
1661# else // _LIBCPP_CXX03_LANG1564# else // _LIBCPP_CXX03_LANG
...@@ -1781,12 +1684,8 @@ private:...@@ -1781,12 +1684,8 @@ private:
17811684
1782 __table __table_;1685 __table __table_;
17831686
1784 typedef typename __table::_NodeTypes _NodeTypes;
1785 typedef typename __table::__node_traits __node_traits;1687 typedef typename __table::__node_traits __node_traits;
1786 typedef typename __table::__node_allocator __node_allocator;
1787 typedef typename __table::__node __node;1688 typedef typename __table::__node __node;
1788 typedef __hash_map_node_destructor<__node_allocator> _Dp;
1789 typedef unique_ptr<__node, _Dp> __node_holder;
1790 typedef allocator_traits<allocator_type> __alloc_traits;1689 typedef allocator_traits<allocator_type> __alloc_traits;
1791 static_assert(is_same<typename __node_traits::size_type, typename __alloc_traits::size_type>::value,1690 static_assert(is_same<typename __node_traits::size_type, typename __alloc_traits::size_type>::value,
1792 "Allocator uses different size_type for different types");1691 "Allocator uses different size_type for different types");
...@@ -1852,11 +1751,10 @@ public:...@@ -1852,11 +1751,10 @@ public:
1852# endif1751# endif
18531752
1854 _LIBCPP_HIDE_FROM_ABI explicit unordered_multimap(const allocator_type& __a);1753 _LIBCPP_HIDE_FROM_ABI explicit unordered_multimap(const allocator_type& __a);
1855 _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u);1754 _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u) = default;
1856 _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);1755 _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
1857# ifndef _LIBCPP_CXX03_LANG1756# ifndef _LIBCPP_CXX03_LANG
1858 _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u)1757 _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u) = default;
1859 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
1860 _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);1758 _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
1861 _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il);1759 _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il);
1862 _LIBCPP_HIDE_FROM_ABI unordered_multimap(1760 _LIBCPP_HIDE_FROM_ABI unordered_multimap(
...@@ -1906,41 +1804,26 @@ public:...@@ -1906,41 +1804,26 @@ public:
1906 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");1804 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");
1907 }1805 }
19081806
1909 _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(const unordered_multimap& __u) {1807 _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(const unordered_multimap& __u) = default;
1910# ifndef _LIBCPP_CXX03_LANG
1911 __table_ = __u.__table_;
1912# else
1913 if (this != std::addressof(__u)) {
1914 __table_.clear();
1915 __table_.hash_function() = __u.__table_.hash_function();
1916 __table_.key_eq() = __u.__table_.key_eq();
1917 __table_.max_load_factor() = __u.__table_.max_load_factor();
1918 __table_.__copy_assign_alloc(__u.__table_);
1919 insert(__u.begin(), __u.end());
1920 }
1921# endif
1922 return *this;
1923 }
1924# ifndef _LIBCPP_CXX03_LANG1808# ifndef _LIBCPP_CXX03_LANG
1925 _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(unordered_multimap&& __u)1809 _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(unordered_multimap&& __u) = default;
1926 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
1927 _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(initializer_list<value_type> __il);1810 _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(initializer_list<value_type> __il);
1928# endif // _LIBCPP_CXX03_LANG1811# endif // _LIBCPP_CXX03_LANG
19291812
1930 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {1813 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
1931 return allocator_type(__table_.__node_alloc());1814 return allocator_type(__table_.__node_alloc());
1932 }1815 }
19331816
1934 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }1817 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }
1935 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }1818 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
1936 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }1819 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
19371820
1938 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }1821 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
1939 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }1822 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
1940 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }1823 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
1941 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }1824 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
1942 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }1825 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
1943 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }1826 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
19441827
1945 _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__emplace_multi(__x); }1828 _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__emplace_multi(__x); }
19461829
...@@ -2008,10 +1891,10 @@ public:...@@ -2008,10 +1891,10 @@ public:
2008 "node_type with incompatible allocator passed to unordered_multimap::insert()");1891 "node_type with incompatible allocator passed to unordered_multimap::insert()");
2009 return __table_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));1892 return __table_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
2010 }1893 }
2011 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1894 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
2012 return __table_.template __node_handle_extract<node_type>(__key);1895 return __table_.template __node_handle_extract<node_type>(__key);
2013 }1896 }
2014 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1897 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
2015 return __table_.template __node_handle_extract<node_type>(__it.__i_);1898 return __table_.template __node_handle_extract<node_type>(__it.__i_);
2016 }1899 }
20171900
...@@ -2045,71 +1928,83 @@ public:...@@ -2045,71 +1928,83 @@ public:
2045 __table_.swap(__u.__table_);1928 __table_.swap(__u.__table_);
2046 }1929 }
20471930
2048 _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function().hash_function(); }1931 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI hasher hash_function() const {
2049 _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }1932 return __table_.hash_function().hash_function();
1933 }
1934 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }
20501935
2051 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }1936 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
2052 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }1937 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
2053# if _LIBCPP_STD_VER >= 201938# if _LIBCPP_STD_VER >= 20
2054 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1939 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
2055 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1940 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
2056 return __table_.find(__k);1941 return __table_.find(__k);
2057 }1942 }
2058 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1943 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
2059 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1944 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
2060 return __table_.find(__k);1945 return __table_.find(__k);
2061 }1946 }
2062# endif // _LIBCPP_STD_VER >= 201947# endif // _LIBCPP_STD_VER >= 20
20631948
2064 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); }1949 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
1950 return __table_.__count_multi(__k);
1951 }
2065# if _LIBCPP_STD_VER >= 201952# if _LIBCPP_STD_VER >= 20
2066 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1953 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
2067 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1954 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
2068 return __table_.__count_multi(__k);1955 return __table_.__count_multi(__k);
2069 }1956 }
2070# endif // _LIBCPP_STD_VER >= 201957# endif // _LIBCPP_STD_VER >= 20
20711958
2072# if _LIBCPP_STD_VER >= 201959# if _LIBCPP_STD_VER >= 20
2073 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1960 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
20741961
2075 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1962 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
2076 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1963 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
2077 return find(__k) != end();1964 return find(__k) != end();
2078 }1965 }
2079# endif // _LIBCPP_STD_VER >= 201966# endif // _LIBCPP_STD_VER >= 20
20801967
2081 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1968 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
2082 return __table_.__equal_range_multi(__k);1969 return __table_.__equal_range_multi(__k);
2083 }1970 }
2084 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1971 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
2085 return __table_.__equal_range_multi(__k);1972 return __table_.__equal_range_multi(__k);
2086 }1973 }
2087# if _LIBCPP_STD_VER >= 201974# if _LIBCPP_STD_VER >= 20
2088 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1975 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
2089 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1976 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
2090 return __table_.__equal_range_multi(__k);1977 return __table_.__equal_range_multi(__k);
2091 }1978 }
2092 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1979 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
2093 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1980 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
2094 return __table_.__equal_range_multi(__k);1981 return __table_.__equal_range_multi(__k);
2095 }1982 }
2096# endif // _LIBCPP_STD_VER >= 201983# endif // _LIBCPP_STD_VER >= 20
20971984
2098 _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }1985 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
2099 _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }1986 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT {
1987 return __table_.max_bucket_count();
1988 }
21001989
2101 _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }1990 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const {
2102 _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }1991 return __table_.bucket_size(__n);
1992 }
1993 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
21031994
2104 _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }1995 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
2105 _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }1996 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
2106 _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }1997 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const {
2107 _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }1998 return __table_.cbegin(__n);
2108 _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }1999 }
2109 _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }2000 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
2001 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const {
2002 return __table_.cbegin(__n);
2003 }
2004 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
21102005
2111 _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }2006 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
2112 _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }2007 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
2113 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }2008 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }
2114 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_multi(__n); }2009 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_multi(__n); }
2115 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_multi(__n); }2010 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_multi(__n); }
...@@ -2121,10 +2016,10 @@ template <class _InputIterator,...@@ -2121,10 +2016,10 @@ template <class _InputIterator,
2121 class _Pred = equal_to<__iter_key_type<_InputIterator>>,2016 class _Pred = equal_to<__iter_key_type<_InputIterator>>,
2122 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,2017 class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
2123 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,2018 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
2124 class = enable_if_t<!__is_allocator<_Hash>::value>,2019 class = enable_if_t<!__is_allocator_v<_Hash>>,
2125 class = enable_if_t<!is_integral<_Hash>::value>,2020 class = enable_if_t<!is_integral<_Hash>::value>,
2126 class = enable_if_t<!__is_allocator<_Pred>::value>,2021 class = enable_if_t<!__is_allocator_v<_Pred>>,
2127 class = enable_if_t<__is_allocator<_Allocator>::value>>2022 class = enable_if_t<__is_allocator_v<_Allocator>>>
2128unordered_multimap(_InputIterator,2023unordered_multimap(_InputIterator,
2129 _InputIterator,2024 _InputIterator,
2130 typename allocator_traits<_Allocator>::size_type = 0,2025 typename allocator_traits<_Allocator>::size_type = 0,
...@@ -2142,10 +2037,10 @@ template <ranges::input_range _Range,...@@ -2142,10 +2037,10 @@ template <ranges::input_range _Range,
2142 class _Hash = hash<__range_key_type<_Range>>,2037 class _Hash = hash<__range_key_type<_Range>>,
2143 class _Pred = equal_to<__range_key_type<_Range>>,2038 class _Pred = equal_to<__range_key_type<_Range>>,
2144 class _Allocator = allocator<__range_to_alloc_type<_Range>>,2039 class _Allocator = allocator<__range_to_alloc_type<_Range>>,
2145 class = enable_if_t<!__is_allocator<_Hash>::value>,2040 class = enable_if_t<!__is_allocator_v<_Hash>>,
2146 class = enable_if_t<!is_integral<_Hash>::value>,2041 class = enable_if_t<!is_integral<_Hash>::value>,
2147 class = enable_if_t<!__is_allocator<_Pred>::value>,2042 class = enable_if_t<!__is_allocator_v<_Pred>>,
2148 class = enable_if_t<__is_allocator<_Allocator>::value>>2043 class = enable_if_t<__is_allocator_v<_Allocator>>>
2149unordered_multimap(from_range_t,2044unordered_multimap(from_range_t,
2150 _Range&&,2045 _Range&&,
2151 typename allocator_traits<_Allocator>::size_type = 0,2046 typename allocator_traits<_Allocator>::size_type = 0,
...@@ -2160,21 +2055,21 @@ template <class _Key,...@@ -2160,21 +2055,21 @@ template <class _Key,
2160 class _Hash = hash<remove_const_t<_Key>>,2055 class _Hash = hash<remove_const_t<_Key>>,
2161 class _Pred = equal_to<remove_const_t<_Key>>,2056 class _Pred = equal_to<remove_const_t<_Key>>,
2162 class _Allocator = allocator<pair<const _Key, _Tp>>,2057 class _Allocator = allocator<pair<const _Key, _Tp>>,
2163 class = enable_if_t<!__is_allocator<_Hash>::value>,2058 class = enable_if_t<!__is_allocator_v<_Hash>>,
2164 class = enable_if_t<!is_integral<_Hash>::value>,2059 class = enable_if_t<!is_integral<_Hash>::value>,
2165 class = enable_if_t<!__is_allocator<_Pred>::value>,2060 class = enable_if_t<!__is_allocator_v<_Pred>>,
2166 class = enable_if_t<__is_allocator<_Allocator>::value>>2061 class = enable_if_t<__is_allocator_v<_Allocator>>>
2167unordered_multimap(2062unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2168 initializer_list<pair<_Key, _Tp>>,2063 typename allocator_traits<_Allocator>::size_type = 0,
2169 typename allocator_traits<_Allocator>::size_type = 0,2064 _Hash = _Hash(),
2170 _Hash = _Hash(),2065 _Pred = _Pred(),
2171 _Pred = _Pred(),2066 _Allocator = _Allocator())
2172 _Allocator = _Allocator()) -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;2067 -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
21732068
2174template <class _InputIterator,2069template <class _InputIterator,
2175 class _Allocator,2070 class _Allocator,
2176 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,2071 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
2177 class = enable_if_t<__is_allocator<_Allocator>::value>>2072 class = enable_if_t<__is_allocator_v<_Allocator>>>
2178unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)2073unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
2179 -> unordered_multimap<__iter_key_type<_InputIterator>,2074 -> unordered_multimap<__iter_key_type<_InputIterator>,
2180 __iter_mapped_type<_InputIterator>,2075 __iter_mapped_type<_InputIterator>,
...@@ -2185,7 +2080,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al...@@ -2185,7 +2080,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al
2185template <class _InputIterator,2080template <class _InputIterator,
2186 class _Allocator,2081 class _Allocator,
2187 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,2082 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
2188 class = enable_if_t<__is_allocator<_Allocator>::value>>2083 class = enable_if_t<__is_allocator_v<_Allocator>>>
2189unordered_multimap(_InputIterator, _InputIterator, _Allocator)2084unordered_multimap(_InputIterator, _InputIterator, _Allocator)
2190 -> unordered_multimap<__iter_key_type<_InputIterator>,2085 -> unordered_multimap<__iter_key_type<_InputIterator>,
2191 __iter_mapped_type<_InputIterator>,2086 __iter_mapped_type<_InputIterator>,
...@@ -2197,9 +2092,9 @@ template <class _InputIterator,...@@ -2197,9 +2092,9 @@ template <class _InputIterator,
2197 class _Hash,2092 class _Hash,
2198 class _Allocator,2093 class _Allocator,
2199 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,2094 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
2200 class = enable_if_t<!__is_allocator<_Hash>::value>,2095 class = enable_if_t<!__is_allocator_v<_Hash>>,
2201 class = enable_if_t<!is_integral<_Hash>::value>,2096 class = enable_if_t<!is_integral<_Hash>::value>,
2202 class = enable_if_t<__is_allocator<_Allocator>::value>>2097 class = enable_if_t<__is_allocator_v<_Allocator>>>
2203unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)2098unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
2204 -> unordered_multimap<__iter_key_type<_InputIterator>,2099 -> unordered_multimap<__iter_key_type<_InputIterator>,
2205 __iter_mapped_type<_InputIterator>,2100 __iter_mapped_type<_InputIterator>,
...@@ -2209,7 +2104,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al...@@ -2209,7 +2104,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al
22092104
2210# if _LIBCPP_STD_VER >= 232105# if _LIBCPP_STD_VER >= 23
22112106
2212template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>2107template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
2213unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)2108unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
2214 -> unordered_multimap<__range_key_type<_Range>,2109 -> unordered_multimap<__range_key_type<_Range>,
2215 __range_mapped_type<_Range>,2110 __range_mapped_type<_Range>,
...@@ -2217,7 +2112,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>...@@ -2217,7 +2112,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>
2217 equal_to<__range_key_type<_Range>>,2112 equal_to<__range_key_type<_Range>>,
2218 _Allocator>;2113 _Allocator>;
22192114
2220template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>2115template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
2221unordered_multimap(from_range_t, _Range&&, _Allocator)2116unordered_multimap(from_range_t, _Range&&, _Allocator)
2222 -> unordered_multimap<__range_key_type<_Range>,2117 -> unordered_multimap<__range_key_type<_Range>,
2223 __range_mapped_type<_Range>,2118 __range_mapped_type<_Range>,
...@@ -2228,9 +2123,9 @@ unordered_multimap(from_range_t, _Range&&, _Allocator)...@@ -2228,9 +2123,9 @@ unordered_multimap(from_range_t, _Range&&, _Allocator)
2228template <ranges::input_range _Range,2123template <ranges::input_range _Range,
2229 class _Hash,2124 class _Hash,
2230 class _Allocator,2125 class _Allocator,
2231 class = enable_if_t<!__is_allocator<_Hash>::value>,2126 class = enable_if_t<!__is_allocator_v<_Hash>>,
2232 class = enable_if_t<!is_integral<_Hash>::value>,2127 class = enable_if_t<!is_integral<_Hash>::value>,
2233 class = enable_if_t<__is_allocator<_Allocator>::value>>2128 class = enable_if_t<__is_allocator_v<_Allocator>>>
2234unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)2129unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
2235 -> unordered_multimap<__range_key_type<_Range>,2130 -> unordered_multimap<__range_key_type<_Range>,
2236 __range_mapped_type<_Range>,2131 __range_mapped_type<_Range>,
...@@ -2240,7 +2135,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>...@@ -2240,7 +2135,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>
22402135
2241# endif2136# endif
22422137
2243template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>2138template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
2244unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)2139unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
2245 -> unordered_multimap<remove_const_t<_Key>,2140 -> unordered_multimap<remove_const_t<_Key>,
2246 _Tp,2141 _Tp,
...@@ -2248,7 +2143,7 @@ unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<...@@ -2248,7 +2143,7 @@ unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<
2248 equal_to<remove_const_t<_Key>>,2143 equal_to<remove_const_t<_Key>>,
2249 _Allocator>;2144 _Allocator>;
22502145
2251template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>2146template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
2252unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)2147unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2253 -> unordered_multimap<remove_const_t<_Key>,2148 -> unordered_multimap<remove_const_t<_Key>,
2254 _Tp,2149 _Tp,
...@@ -2260,9 +2155,9 @@ template <class _Key,...@@ -2260,9 +2155,9 @@ template <class _Key,
2260 class _Tp,2155 class _Tp,
2261 class _Hash,2156 class _Hash,
2262 class _Allocator,2157 class _Allocator,
2263 class = enable_if_t<!__is_allocator<_Hash>::value>,2158 class = enable_if_t<!__is_allocator_v<_Hash>>,
2264 class = enable_if_t<!is_integral<_Hash>::value>,2159 class = enable_if_t<!is_integral<_Hash>::value>,
2265 class = enable_if_t<__is_allocator<_Allocator>::value>>2160 class = enable_if_t<__is_allocator_v<_Allocator>>>
2266unordered_multimap(2161unordered_multimap(
2267 initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)2162 initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
2268 -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;2163 -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;
...@@ -2315,13 +2210,6 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>...@@ -2315,13 +2210,6 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2315inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(const allocator_type& __a)2210inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(const allocator_type& __a)
2316 : __table_(typename __table::allocator_type(__a)) {}2211 : __table_(typename __table::allocator_type(__a)) {}
23172212
2318template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2319unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(const unordered_multimap& __u)
2320 : __table_(__u.__table_) {
2321 __table_.__rehash_multi(__u.bucket_count());
2322 insert(__u.begin(), __u.end());
2323}
2324
2325template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>2213template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2326unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(2214unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2327 const unordered_multimap& __u, const allocator_type& __a)2215 const unordered_multimap& __u, const allocator_type& __a)
...@@ -2332,11 +2220,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2332,11 +2220,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
23322220
2333# ifndef _LIBCPP_CXX03_LANG2221# ifndef _LIBCPP_CXX03_LANG
23342222
2335template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2336inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(unordered_multimap&& __u)
2337 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
2338 : __table_(std::move(__u.__table_)) {}
2339
2340template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>2223template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2341unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(2224unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2342 unordered_multimap&& __u, const allocator_type& __a)2225 unordered_multimap&& __u, const allocator_type& __a)
...@@ -2373,14 +2256,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2373,14 +2256,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2373 insert(__il.begin(), __il.end());2256 insert(__il.begin(), __il.end());
2374}2257}
23752258
2376template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2377inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
2378unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
2379 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
2380 __table_ = std::move(__u.__table_);
2381 return *this;
2382}
2383
2384template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>2259template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2385inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&2260inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
2386unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {2261unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
lib/libcxx/include/unordered_set+168-195
...@@ -544,8 +544,6 @@ template <class Value, class Hash, class Pred, class Alloc>...@@ -544,8 +544,6 @@ template <class Value, class Hash, class Pred, class Alloc>
544# include <__iterator/distance.h>544# include <__iterator/distance.h>
545# include <__iterator/erase_if_container.h>545# include <__iterator/erase_if_container.h>
546# include <__iterator/iterator_traits.h>546# include <__iterator/iterator_traits.h>
547# include <__iterator/ranges_iterator_traits.h>
548# include <__memory/addressof.h>
549# include <__memory/allocator.h>547# include <__memory/allocator.h>
550# include <__memory/allocator_traits.h>548# include <__memory/allocator_traits.h>
551# include <__memory_resource/polymorphic_allocator.h>549# include <__memory_resource/polymorphic_allocator.h>
...@@ -558,7 +556,6 @@ template <class Value, class Hash, class Pred, class Alloc>...@@ -558,7 +556,6 @@ template <class Value, class Hash, class Pred, class Alloc>
558# include <__type_traits/invoke.h>556# include <__type_traits/invoke.h>
559# include <__type_traits/is_allocator.h>557# include <__type_traits/is_allocator.h>
560# include <__type_traits/is_integral.h>558# include <__type_traits/is_integral.h>
561# include <__type_traits/is_nothrow_assignable.h>
562# include <__type_traits/is_nothrow_constructible.h>559# include <__type_traits/is_nothrow_constructible.h>
563# include <__type_traits/is_same.h>560# include <__type_traits/is_same.h>
564# include <__type_traits/is_swappable.h>561# include <__type_traits/is_swappable.h>
...@@ -703,10 +700,10 @@ public:...@@ -703,10 +700,10 @@ public:
703# endif700# endif
704701
705 _LIBCPP_HIDE_FROM_ABI explicit unordered_set(const allocator_type& __a);702 _LIBCPP_HIDE_FROM_ABI explicit unordered_set(const allocator_type& __a);
706 _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u);703 _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u) = default;
707 _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u, const allocator_type& __a);704 _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u, const allocator_type& __a);
708# ifndef _LIBCPP_CXX03_LANG705# ifndef _LIBCPP_CXX03_LANG
709 _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);706 _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u) = default;
710 _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u, const allocator_type& __a);707 _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u, const allocator_type& __a);
711 _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list<value_type> __il);708 _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list<value_type> __il);
712 _LIBCPP_HIDE_FROM_ABI709 _LIBCPP_HIDE_FROM_ABI
...@@ -733,30 +730,26 @@ public:...@@ -733,30 +730,26 @@ public:
733 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");730 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
734 }731 }
735732
736 _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(const unordered_set& __u) {733 _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(const unordered_set& __u) = default;
737 __table_ = __u.__table_;
738 return *this;
739 }
740# ifndef _LIBCPP_CXX03_LANG734# ifndef _LIBCPP_CXX03_LANG
741 _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(unordered_set&& __u)735 _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(unordered_set&& __u) = default;
742 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
743 _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(initializer_list<value_type> __il);736 _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(initializer_list<value_type> __il);
744# endif // _LIBCPP_CXX03_LANG737# endif // _LIBCPP_CXX03_LANG
745738
746 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {739 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
747 return allocator_type(__table_.__node_alloc());740 return allocator_type(__table_.__node_alloc());
748 }741 }
749742
750 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }743 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }
751 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }744 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
752 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }745 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
753746
754 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }747 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
755 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }748 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
756 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }749 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
757 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }750 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
758 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }751 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
759 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }752 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
760753
761# ifndef _LIBCPP_CXX03_LANG754# ifndef _LIBCPP_CXX03_LANG
762 template <class... _Args>755 template <class... _Args>
...@@ -808,10 +801,10 @@ public:...@@ -808,10 +801,10 @@ public:
808 "node_type with incompatible allocator passed to unordered_set::insert()");801 "node_type with incompatible allocator passed to unordered_set::insert()");
809 return __table_.template __node_handle_insert_unique<node_type>(__h, std::move(__nh));802 return __table_.template __node_handle_insert_unique<node_type>(__h, std::move(__nh));
810 }803 }
811 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {804 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
812 return __table_.template __node_handle_extract<node_type>(__key);805 return __table_.template __node_handle_extract<node_type>(__key);
813 }806 }
814 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {807 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
815 return __table_.template __node_handle_extract<node_type>(__it);808 return __table_.template __node_handle_extract<node_type>(__it);
816 }809 }
817810
...@@ -845,71 +838,81 @@ public:...@@ -845,71 +838,81 @@ public:
845 __table_.swap(__u.__table_);838 __table_.swap(__u.__table_);
846 }839 }
847840
848 _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function(); }841 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function(); }
849 _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }842 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }
850843
851 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }844 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
852 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }845 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
853# if _LIBCPP_STD_VER >= 20846# if _LIBCPP_STD_VER >= 20
854 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>847 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
855 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {848 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
856 return __table_.find(__k);849 return __table_.find(__k);
857 }850 }
858 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>851 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
859 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {852 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
860 return __table_.find(__k);853 return __table_.find(__k);
861 }854 }
862# endif // _LIBCPP_STD_VER >= 20855# endif // _LIBCPP_STD_VER >= 20
863856
864 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); }857 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
858 return __table_.__count_unique(__k);
859 }
865# if _LIBCPP_STD_VER >= 20860# if _LIBCPP_STD_VER >= 20
866 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>861 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
867 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {862 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
868 return __table_.__count_unique(__k);863 return __table_.__count_unique(__k);
869 }864 }
870# endif // _LIBCPP_STD_VER >= 20865# endif // _LIBCPP_STD_VER >= 20
871866
872# if _LIBCPP_STD_VER >= 20867# if _LIBCPP_STD_VER >= 20
873 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }868 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
874869
875 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>870 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
876 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {871 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
877 return find(__k) != end();872 return find(__k) != end();
878 }873 }
879# endif // _LIBCPP_STD_VER >= 20874# endif // _LIBCPP_STD_VER >= 20
880875
881 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {876 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
882 return __table_.__equal_range_unique(__k);877 return __table_.__equal_range_unique(__k);
883 }878 }
884 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {879 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
885 return __table_.__equal_range_unique(__k);880 return __table_.__equal_range_unique(__k);
886 }881 }
887# if _LIBCPP_STD_VER >= 20882# if _LIBCPP_STD_VER >= 20
888 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>883 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
889 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {884 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
890 return __table_.__equal_range_unique(__k);885 return __table_.__equal_range_unique(__k);
891 }886 }
892 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>887 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
893 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {888 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
894 return __table_.__equal_range_unique(__k);889 return __table_.__equal_range_unique(__k);
895 }890 }
896# endif // _LIBCPP_STD_VER >= 20891# endif // _LIBCPP_STD_VER >= 20
897892
898 _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }893 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
899 _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }894 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT {
895 return __table_.max_bucket_count();
896 }
900897
901 _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }898 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const {
902 _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }899 return __table_.bucket_size(__n);
900 }
901 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
903902
904 _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }903 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
905 _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }904 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
906 _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }905 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const {
907 _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }906 return __table_.cbegin(__n);
908 _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }907 }
909 _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }908 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
909 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const {
910 return __table_.cbegin(__n);
911 }
912 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
910913
911 _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }914 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
912 _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }915 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
913 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }916 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }
914 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_unique(__n); }917 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_unique(__n); }
915 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_unique(__n); }918 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_unique(__n); }
...@@ -917,47 +920,48 @@ public:...@@ -917,47 +920,48 @@ public:
917920
918# if _LIBCPP_STD_VER >= 17921# if _LIBCPP_STD_VER >= 17
919template <class _InputIterator,922template <class _InputIterator,
920 class _Hash = hash<__iter_value_type<_InputIterator>>,923 class _Hash = hash<__iterator_value_type<_InputIterator>>,
921 class _Pred = equal_to<__iter_value_type<_InputIterator>>,924 class _Pred = equal_to<__iterator_value_type<_InputIterator>>,
922 class _Allocator = allocator<__iter_value_type<_InputIterator>>,925 class _Allocator = allocator<__iterator_value_type<_InputIterator>>,
923 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,926 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
924 class = enable_if_t<!__is_allocator<_Hash>::value>,927 class = enable_if_t<!__is_allocator_v<_Hash>>,
925 class = enable_if_t<!is_integral<_Hash>::value>,928 class = enable_if_t<!is_integral<_Hash>::value>,
926 class = enable_if_t<!__is_allocator<_Pred>::value>,929 class = enable_if_t<!__is_allocator_v<_Pred>>,
927 class = enable_if_t<__is_allocator<_Allocator>::value>>930 class = enable_if_t<__is_allocator_v<_Allocator>>>
928unordered_set(_InputIterator,931unordered_set(_InputIterator,
929 _InputIterator,932 _InputIterator,
930 typename allocator_traits<_Allocator>::size_type = 0,933 typename allocator_traits<_Allocator>::size_type = 0,
931 _Hash = _Hash(),934 _Hash = _Hash(),
932 _Pred = _Pred(),935 _Pred = _Pred(),
933 _Allocator = _Allocator()) -> unordered_set<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;936 _Allocator = _Allocator())
937 -> unordered_set<__iterator_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;
934938
935# if _LIBCPP_STD_VER >= 23939# if _LIBCPP_STD_VER >= 23
936template <ranges::input_range _Range,940template <ranges::input_range _Range,
937 class _Hash = hash<ranges::range_value_t<_Range>>,941 class _Hash = hash<ranges::range_value_t<_Range>>,
938 class _Pred = equal_to<ranges::range_value_t<_Range>>,942 class _Pred = equal_to<ranges::range_value_t<_Range>>,
939 class _Allocator = allocator<ranges::range_value_t<_Range>>,943 class _Allocator = allocator<ranges::range_value_t<_Range>>,
940 class = enable_if_t<!__is_allocator<_Hash>::value>,944 class = enable_if_t<!__is_allocator_v<_Hash>>,
941 class = enable_if_t<!is_integral<_Hash>::value>,945 class = enable_if_t<!is_integral<_Hash>::value>,
942 class = enable_if_t<!__is_allocator<_Pred>::value>,946 class = enable_if_t<!__is_allocator_v<_Pred>>,
943 class = enable_if_t<__is_allocator<_Allocator>::value>>947 class = enable_if_t<__is_allocator_v<_Allocator>>>
944unordered_set(948unordered_set(from_range_t,
945 from_range_t,949 _Range&&,
946 _Range&&,950 typename allocator_traits<_Allocator>::size_type = 0,
947 typename allocator_traits<_Allocator>::size_type = 0,951 _Hash = _Hash(),
948 _Hash = _Hash(),952 _Pred = _Pred(),
949 _Pred = _Pred(),953 _Allocator = _Allocator())
950 _Allocator = _Allocator()) -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23954 -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
951# endif955# endif
952956
953template <class _Tp,957template <class _Tp,
954 class _Hash = hash<_Tp>,958 class _Hash = hash<_Tp>,
955 class _Pred = equal_to<_Tp>,959 class _Pred = equal_to<_Tp>,
956 class _Allocator = allocator<_Tp>,960 class _Allocator = allocator<_Tp>,
957 class = enable_if_t<!__is_allocator<_Hash>::value>,961 class = enable_if_t<!__is_allocator_v<_Hash>>,
958 class = enable_if_t<!is_integral<_Hash>::value>,962 class = enable_if_t<!is_integral<_Hash>::value>,
959 class = enable_if_t<!__is_allocator<_Pred>::value>,963 class = enable_if_t<!__is_allocator_v<_Pred>>,
960 class = enable_if_t<__is_allocator<_Allocator>::value>>964 class = enable_if_t<__is_allocator_v<_Allocator>>>
961unordered_set(initializer_list<_Tp>,965unordered_set(initializer_list<_Tp>,
962 typename allocator_traits<_Allocator>::size_type = 0,966 typename allocator_traits<_Allocator>::size_type = 0,
963 _Hash = _Hash(),967 _Hash = _Hash(),
...@@ -967,33 +971,36 @@ unordered_set(initializer_list<_Tp>,...@@ -967,33 +971,36 @@ unordered_set(initializer_list<_Tp>,
967template <class _InputIterator,971template <class _InputIterator,
968 class _Allocator,972 class _Allocator,
969 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,973 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
970 class = enable_if_t<__is_allocator<_Allocator>::value>>974 class = enable_if_t<__is_allocator_v<_Allocator>>>
971unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)975unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
972 -> unordered_set<__iter_value_type<_InputIterator>,976 -> unordered_set<__iterator_value_type<_InputIterator>,
973 hash<__iter_value_type<_InputIterator>>,977 hash<__iterator_value_type<_InputIterator>>,
974 equal_to<__iter_value_type<_InputIterator>>,978 equal_to<__iterator_value_type<_InputIterator>>,
975 _Allocator>;979 _Allocator>;
976980
977template <class _InputIterator,981template <class _InputIterator,
978 class _Hash,982 class _Hash,
979 class _Allocator,983 class _Allocator,
980 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,984 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
981 class = enable_if_t<!__is_allocator<_Hash>::value>,985 class = enable_if_t<!__is_allocator_v<_Hash>>,
982 class = enable_if_t<!is_integral<_Hash>::value>,986 class = enable_if_t<!is_integral<_Hash>::value>,
983 class = enable_if_t<__is_allocator<_Allocator>::value>>987 class = enable_if_t<__is_allocator_v<_Allocator>>>
984unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)988unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
985 -> unordered_set<__iter_value_type<_InputIterator>, _Hash, equal_to<__iter_value_type<_InputIterator>>, _Allocator>;989 -> unordered_set<__iterator_value_type<_InputIterator>,
990 _Hash,
991 equal_to<__iterator_value_type<_InputIterator>>,
992 _Allocator>;
986993
987# if _LIBCPP_STD_VER >= 23994# if _LIBCPP_STD_VER >= 23
988995
989template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>996template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
990unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)997unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
991 -> unordered_set<ranges::range_value_t<_Range>,998 -> unordered_set<ranges::range_value_t<_Range>,
992 hash<ranges::range_value_t<_Range>>,999 hash<ranges::range_value_t<_Range>>,
993 equal_to<ranges::range_value_t<_Range>>,1000 equal_to<ranges::range_value_t<_Range>>,
994 _Allocator>;1001 _Allocator>;
9951002
996template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1003template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
997unordered_set(from_range_t, _Range&&, _Allocator)1004unordered_set(from_range_t, _Range&&, _Allocator)
998 -> unordered_set<ranges::range_value_t<_Range>,1005 -> unordered_set<ranges::range_value_t<_Range>,
999 hash<ranges::range_value_t<_Range>>,1006 hash<ranges::range_value_t<_Range>>,
...@@ -1003,24 +1010,24 @@ unordered_set(from_range_t, _Range&&, _Allocator)...@@ -1003,24 +1010,24 @@ unordered_set(from_range_t, _Range&&, _Allocator)
1003template <ranges::input_range _Range,1010template <ranges::input_range _Range,
1004 class _Hash,1011 class _Hash,
1005 class _Allocator,1012 class _Allocator,
1006 class = enable_if_t<!__is_allocator<_Hash>::value>,1013 class = enable_if_t<!__is_allocator_v<_Hash>>,
1007 class = enable_if_t<!is_integral<_Hash>::value>,1014 class = enable_if_t<!is_integral<_Hash>::value>,
1008 class = enable_if_t<__is_allocator<_Allocator>::value>>1015 class = enable_if_t<__is_allocator_v<_Allocator>>>
1009unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1016unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1010 -> unordered_set<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;1017 -> unordered_set<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
10111018
1012# endif1019# endif
10131020
1014template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1021template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1015unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)1022unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
1016 -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;1023 -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
10171024
1018template <class _Tp,1025template <class _Tp,
1019 class _Hash,1026 class _Hash,
1020 class _Allocator,1027 class _Allocator,
1021 class = enable_if_t<!__is_allocator<_Hash>::value>,1028 class = enable_if_t<!__is_allocator_v<_Hash>>,
1022 class = enable_if_t<!is_integral<_Hash>::value>,1029 class = enable_if_t<!is_integral<_Hash>::value>,
1023 class = enable_if_t<__is_allocator<_Allocator>::value>>1030 class = enable_if_t<__is_allocator_v<_Allocator>>>
1024unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1031unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1025 -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;1032 -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
1026# endif1033# endif
...@@ -1070,12 +1077,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -1070,12 +1077,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
1070template <class _Value, class _Hash, class _Pred, class _Alloc>1077template <class _Value, class _Hash, class _Pred, class _Alloc>
1071inline unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const allocator_type& __a) : __table_(__a) {}1078inline unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const allocator_type& __a) : __table_(__a) {}
10721079
1073template <class _Value, class _Hash, class _Pred, class _Alloc>
1074unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const unordered_set& __u) : __table_(__u.__table_) {
1075 __table_.__rehash_unique(__u.bucket_count());
1076 insert(__u.begin(), __u.end());
1077}
1078
1079template <class _Value, class _Hash, class _Pred, class _Alloc>1080template <class _Value, class _Hash, class _Pred, class _Alloc>
1080unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const unordered_set& __u, const allocator_type& __a)1081unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const unordered_set& __u, const allocator_type& __a)
1081 : __table_(__u.__table_, __a) {1082 : __table_(__u.__table_, __a) {
...@@ -1085,11 +1086,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const unordered_set&...@@ -1085,11 +1086,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const unordered_set&
10851086
1086# ifndef _LIBCPP_CXX03_LANG1087# ifndef _LIBCPP_CXX03_LANG
10871088
1088template <class _Value, class _Hash, class _Pred, class _Alloc>
1089inline unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(unordered_set&& __u)
1090 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1091 : __table_(std::move(__u.__table_)) {}
1092
1093template <class _Value, class _Hash, class _Pred, class _Alloc>1089template <class _Value, class _Hash, class _Pred, class _Alloc>
1094unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(unordered_set&& __u, const allocator_type& __a)1090unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(unordered_set&& __u, const allocator_type& __a)
1095 : __table_(std::move(__u.__table_), __a) {1091 : __table_(std::move(__u.__table_), __a) {
...@@ -1125,14 +1121,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -1125,14 +1121,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
1125 insert(__il.begin(), __il.end());1121 insert(__il.begin(), __il.end());
1126}1122}
11271123
1128template <class _Value, class _Hash, class _Pred, class _Alloc>
1129inline unordered_set<_Value, _Hash, _Pred, _Alloc>&
1130unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
1131 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
1132 __table_ = std::move(__u.__table_);
1133 return *this;
1134}
1135
1136template <class _Value, class _Hash, class _Pred, class _Alloc>1124template <class _Value, class _Hash, class _Pred, class _Alloc>
1137inline unordered_set<_Value, _Hash, _Pred, _Alloc>&1125inline unordered_set<_Value, _Hash, _Pred, _Alloc>&
1138unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {1126unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
...@@ -1308,11 +1296,10 @@ public:...@@ -1308,11 +1296,10 @@ public:
1308# endif1296# endif
13091297
1310 _LIBCPP_HIDE_FROM_ABI explicit unordered_multiset(const allocator_type& __a);1298 _LIBCPP_HIDE_FROM_ABI explicit unordered_multiset(const allocator_type& __a);
1311 _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u);1299 _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u) = default;
1312 _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);1300 _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
1313# ifndef _LIBCPP_CXX03_LANG1301# ifndef _LIBCPP_CXX03_LANG
1314 _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u)1302 _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u) = default;
1315 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
1316 _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);1303 _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
1317 _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list<value_type> __il);1304 _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list<value_type> __il);
1318 _LIBCPP_HIDE_FROM_ABI unordered_multiset(1305 _LIBCPP_HIDE_FROM_ABI unordered_multiset(
...@@ -1339,30 +1326,26 @@ public:...@@ -1339,30 +1326,26 @@ public:
1339 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");1326 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
1340 }1327 }
13411328
1342 _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(const unordered_multiset& __u) {1329 _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(const unordered_multiset& __u) = default;
1343 __table_ = __u.__table_;
1344 return *this;
1345 }
1346# ifndef _LIBCPP_CXX03_LANG1330# ifndef _LIBCPP_CXX03_LANG
1347 _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(unordered_multiset&& __u)1331 _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(unordered_multiset&& __u) = default;
1348 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
1349 _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(initializer_list<value_type> __il);1332 _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(initializer_list<value_type> __il);
1350# endif // _LIBCPP_CXX03_LANG1333# endif // _LIBCPP_CXX03_LANG
13511334
1352 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {1335 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
1353 return allocator_type(__table_.__node_alloc());1336 return allocator_type(__table_.__node_alloc());
1354 }1337 }
13551338
1356 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }1339 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; }
1357 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }1340 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
1358 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }1341 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
13591342
1360 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }1343 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
1361 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }1344 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
1362 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }1345 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
1363 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }1346 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
1364 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }1347 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
1365 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }1348 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
13661349
1367# ifndef _LIBCPP_CXX03_LANG1350# ifndef _LIBCPP_CXX03_LANG
1368 template <class... _Args>1351 template <class... _Args>
...@@ -1410,10 +1393,10 @@ public:...@@ -1410,10 +1393,10 @@ public:
1410 "node_type with incompatible allocator passed to unordered_multiset::insert()");1393 "node_type with incompatible allocator passed to unordered_multiset::insert()");
1411 return __table_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));1394 return __table_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
1412 }1395 }
1413 _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __position) {1396 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __position) {
1414 return __table_.template __node_handle_extract<node_type>(__position);1397 return __table_.template __node_handle_extract<node_type>(__position);
1415 }1398 }
1416 _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1399 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
1417 return __table_.template __node_handle_extract<node_type>(__key);1400 return __table_.template __node_handle_extract<node_type>(__key);
1418 }1401 }
14191402
...@@ -1454,71 +1437,81 @@ public:...@@ -1454,71 +1437,81 @@ public:
1454 __table_.swap(__u.__table_);1437 __table_.swap(__u.__table_);
1455 }1438 }
14561439
1457 _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function(); }1440 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function(); }
1458 _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }1441 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }
14591442
1460 _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }1443 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
1461 _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }1444 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
1462# if _LIBCPP_STD_VER >= 201445# if _LIBCPP_STD_VER >= 20
1463 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1446 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1464 _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1447 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1465 return __table_.find(__k);1448 return __table_.find(__k);
1466 }1449 }
1467 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1450 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1468 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1451 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1469 return __table_.find(__k);1452 return __table_.find(__k);
1470 }1453 }
1471# endif // _LIBCPP_STD_VER >= 201454# endif // _LIBCPP_STD_VER >= 20
14721455
1473 _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); }1456 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {
1457 return __table_.__count_multi(__k);
1458 }
1474# if _LIBCPP_STD_VER >= 201459# if _LIBCPP_STD_VER >= 20
1475 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1460 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1476 _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1461 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1477 return __table_.__count_multi(__k);1462 return __table_.__count_multi(__k);
1478 }1463 }
1479# endif // _LIBCPP_STD_VER >= 201464# endif // _LIBCPP_STD_VER >= 20
14801465
1481# if _LIBCPP_STD_VER >= 201466# if _LIBCPP_STD_VER >= 20
1482 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1467 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
14831468
1484 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1469 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1485 _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1470 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1486 return find(__k) != end();1471 return find(__k) != end();
1487 }1472 }
1488# endif // _LIBCPP_STD_VER >= 201473# endif // _LIBCPP_STD_VER >= 20
14891474
1490 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1475 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
1491 return __table_.__equal_range_multi(__k);1476 return __table_.__equal_range_multi(__k);
1492 }1477 }
1493 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1478 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
1494 return __table_.__equal_range_multi(__k);1479 return __table_.__equal_range_multi(__k);
1495 }1480 }
1496# if _LIBCPP_STD_VER >= 201481# if _LIBCPP_STD_VER >= 20
1497 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1482 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1498 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1483 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1499 return __table_.__equal_range_multi(__k);1484 return __table_.__equal_range_multi(__k);
1500 }1485 }
1501 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1486 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
1502 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1487 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1503 return __table_.__equal_range_multi(__k);1488 return __table_.__equal_range_multi(__k);
1504 }1489 }
1505# endif // _LIBCPP_STD_VER >= 201490# endif // _LIBCPP_STD_VER >= 20
15061491
1507 _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }1492 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
1508 _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }1493 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT {
1494 return __table_.max_bucket_count();
1495 }
15091496
1510 _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }1497 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const {
1511 _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }1498 return __table_.bucket_size(__n);
1499 }
1500 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
15121501
1513 _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }1502 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
1514 _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }1503 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
1515 _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }1504 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const {
1516 _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }1505 return __table_.cbegin(__n);
1517 _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }1506 }
1518 _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }1507 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
1508 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const {
1509 return __table_.cbegin(__n);
1510 }
1511 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
15191512
1520 _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }1513 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
1521 _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }1514 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
1522 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }1515 _LIBCPP_HIDE_FROM_ABI void max_load_factor(float __mlf) { __table_.max_load_factor(__mlf); }
1523 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_multi(__n); }1516 _LIBCPP_HIDE_FROM_ABI void rehash(size_type __n) { __table_.__rehash_multi(__n); }
1524 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_multi(__n); }1517 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_multi(__n); }
...@@ -1526,31 +1519,31 @@ public:...@@ -1526,31 +1519,31 @@ public:
15261519
1527# if _LIBCPP_STD_VER >= 171520# if _LIBCPP_STD_VER >= 17
1528template <class _InputIterator,1521template <class _InputIterator,
1529 class _Hash = hash<__iter_value_type<_InputIterator>>,1522 class _Hash = hash<__iterator_value_type<_InputIterator>>,
1530 class _Pred = equal_to<__iter_value_type<_InputIterator>>,1523 class _Pred = equal_to<__iterator_value_type<_InputIterator>>,
1531 class _Allocator = allocator<__iter_value_type<_InputIterator>>,1524 class _Allocator = allocator<__iterator_value_type<_InputIterator>>,
1532 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1525 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1533 class = enable_if_t<!__is_allocator<_Hash>::value>,1526 class = enable_if_t<!__is_allocator_v<_Hash>>,
1534 class = enable_if_t<!is_integral<_Hash>::value>,1527 class = enable_if_t<!is_integral<_Hash>::value>,
1535 class = enable_if_t<!__is_allocator<_Pred>::value>,1528 class = enable_if_t<!__is_allocator_v<_Pred>>,
1536 class = enable_if_t<__is_allocator<_Allocator>::value>>1529 class = enable_if_t<__is_allocator_v<_Allocator>>>
1537unordered_multiset(1530unordered_multiset(
1538 _InputIterator,1531 _InputIterator,
1539 _InputIterator,1532 _InputIterator,
1540 typename allocator_traits<_Allocator>::size_type = 0,1533 typename allocator_traits<_Allocator>::size_type = 0,
1541 _Hash = _Hash(),1534 _Hash = _Hash(),
1542 _Pred = _Pred(),1535 _Pred = _Pred(),
1543 _Allocator = _Allocator()) -> unordered_multiset<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;1536 _Allocator = _Allocator()) -> unordered_multiset<__iterator_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;
15441537
1545# if _LIBCPP_STD_VER >= 231538# if _LIBCPP_STD_VER >= 23
1546template <ranges::input_range _Range,1539template <ranges::input_range _Range,
1547 class _Hash = hash<ranges::range_value_t<_Range>>,1540 class _Hash = hash<ranges::range_value_t<_Range>>,
1548 class _Pred = equal_to<ranges::range_value_t<_Range>>,1541 class _Pred = equal_to<ranges::range_value_t<_Range>>,
1549 class _Allocator = allocator<ranges::range_value_t<_Range>>,1542 class _Allocator = allocator<ranges::range_value_t<_Range>>,
1550 class = enable_if_t<!__is_allocator<_Hash>::value>,1543 class = enable_if_t<!__is_allocator_v<_Hash>>,
1551 class = enable_if_t<!is_integral<_Hash>::value>,1544 class = enable_if_t<!is_integral<_Hash>::value>,
1552 class = enable_if_t<!__is_allocator<_Pred>::value>,1545 class = enable_if_t<!__is_allocator_v<_Pred>>,
1553 class = enable_if_t<__is_allocator<_Allocator>::value>>1546 class = enable_if_t<__is_allocator_v<_Allocator>>>
1554unordered_multiset(1547unordered_multiset(
1555 from_range_t,1548 from_range_t,
1556 _Range&&,1549 _Range&&,
...@@ -1564,10 +1557,10 @@ template <class _Tp,...@@ -1564,10 +1557,10 @@ template <class _Tp,
1564 class _Hash = hash<_Tp>,1557 class _Hash = hash<_Tp>,
1565 class _Pred = equal_to<_Tp>,1558 class _Pred = equal_to<_Tp>,
1566 class _Allocator = allocator<_Tp>,1559 class _Allocator = allocator<_Tp>,
1567 class = enable_if_t<!__is_allocator<_Hash>::value>,1560 class = enable_if_t<!__is_allocator_v<_Hash>>,
1568 class = enable_if_t<!is_integral<_Hash>::value>,1561 class = enable_if_t<!is_integral<_Hash>::value>,
1569 class = enable_if_t<!__is_allocator<_Pred>::value>,1562 class = enable_if_t<!__is_allocator_v<_Pred>>,
1570 class = enable_if_t<__is_allocator<_Allocator>::value>>1563 class = enable_if_t<__is_allocator_v<_Allocator>>>
1571unordered_multiset(initializer_list<_Tp>,1564unordered_multiset(initializer_list<_Tp>,
1572 typename allocator_traits<_Allocator>::size_type = 0,1565 typename allocator_traits<_Allocator>::size_type = 0,
1573 _Hash = _Hash(),1566 _Hash = _Hash(),
...@@ -1577,36 +1570,36 @@ unordered_multiset(initializer_list<_Tp>,...@@ -1577,36 +1570,36 @@ unordered_multiset(initializer_list<_Tp>,
1577template <class _InputIterator,1570template <class _InputIterator,
1578 class _Allocator,1571 class _Allocator,
1579 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1572 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1580 class = enable_if_t<__is_allocator<_Allocator>::value>>1573 class = enable_if_t<__is_allocator_v<_Allocator>>>
1581unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)1574unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
1582 -> unordered_multiset<__iter_value_type<_InputIterator>,1575 -> unordered_multiset<__iterator_value_type<_InputIterator>,
1583 hash<__iter_value_type<_InputIterator>>,1576 hash<__iterator_value_type<_InputIterator>>,
1584 equal_to<__iter_value_type<_InputIterator>>,1577 equal_to<__iterator_value_type<_InputIterator>>,
1585 _Allocator>;1578 _Allocator>;
15861579
1587template <class _InputIterator,1580template <class _InputIterator,
1588 class _Hash,1581 class _Hash,
1589 class _Allocator,1582 class _Allocator,
1590 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,1583 class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
1591 class = enable_if_t<!__is_allocator<_Hash>::value>,1584 class = enable_if_t<!__is_allocator_v<_Hash>>,
1592 class = enable_if_t<!is_integral<_Hash>::value>,1585 class = enable_if_t<!is_integral<_Hash>::value>,
1593 class = enable_if_t<__is_allocator<_Allocator>::value>>1586 class = enable_if_t<__is_allocator_v<_Allocator>>>
1594unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1587unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1595 -> unordered_multiset<__iter_value_type<_InputIterator>,1588 -> unordered_multiset<__iterator_value_type<_InputIterator>,
1596 _Hash,1589 _Hash,
1597 equal_to<__iter_value_type<_InputIterator>>,1590 equal_to<__iterator_value_type<_InputIterator>>,
1598 _Allocator>;1591 _Allocator>;
15991592
1600# if _LIBCPP_STD_VER >= 231593# if _LIBCPP_STD_VER >= 23
16011594
1602template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1595template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1603unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)1596unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
1604 -> unordered_multiset<ranges::range_value_t<_Range>,1597 -> unordered_multiset<ranges::range_value_t<_Range>,
1605 hash<ranges::range_value_t<_Range>>,1598 hash<ranges::range_value_t<_Range>>,
1606 equal_to<ranges::range_value_t<_Range>>,1599 equal_to<ranges::range_value_t<_Range>>,
1607 _Allocator>;1600 _Allocator>;
16081601
1609template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1602template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1610unordered_multiset(from_range_t, _Range&&, _Allocator)1603unordered_multiset(from_range_t, _Range&&, _Allocator)
1611 -> unordered_multiset<ranges::range_value_t<_Range>,1604 -> unordered_multiset<ranges::range_value_t<_Range>,
1612 hash<ranges::range_value_t<_Range>>,1605 hash<ranges::range_value_t<_Range>>,
...@@ -1616,24 +1609,24 @@ unordered_multiset(from_range_t, _Range&&, _Allocator)...@@ -1616,24 +1609,24 @@ unordered_multiset(from_range_t, _Range&&, _Allocator)
1616template <ranges::input_range _Range,1609template <ranges::input_range _Range,
1617 class _Hash,1610 class _Hash,
1618 class _Allocator,1611 class _Allocator,
1619 class = enable_if_t<!__is_allocator<_Hash>::value>,1612 class = enable_if_t<!__is_allocator_v<_Hash>>,
1620 class = enable_if_t<!is_integral<_Hash>::value>,1613 class = enable_if_t<!is_integral<_Hash>::value>,
1621 class = enable_if_t<__is_allocator<_Allocator>::value>>1614 class = enable_if_t<__is_allocator_v<_Allocator>>>
1622unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1615unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1623 -> unordered_multiset<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;1616 -> unordered_multiset<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
16241617
1625# endif1618# endif
16261619
1627template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>1620template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1628unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)1621unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
1629 -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;1622 -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
16301623
1631template <class _Tp,1624template <class _Tp,
1632 class _Hash,1625 class _Hash,
1633 class _Allocator,1626 class _Allocator,
1634 class = enable_if_t<!__is_allocator<_Hash>::value>,1627 class = enable_if_t<!__is_allocator_v<_Hash>>,
1635 class = enable_if_t<!is_integral<_Hash>::value>,1628 class = enable_if_t<!is_integral<_Hash>::value>,
1636 class = enable_if_t<__is_allocator<_Allocator>::value>>1629 class = enable_if_t<__is_allocator_v<_Allocator>>>
1637unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)1630unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
1638 -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;1631 -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
1639# endif1632# endif
...@@ -1685,13 +1678,6 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>...@@ -1685,13 +1678,6 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
1685inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(const allocator_type& __a)1678inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(const allocator_type& __a)
1686 : __table_(__a) {}1679 : __table_(__a) {}
16871680
1688template <class _Value, class _Hash, class _Pred, class _Alloc>
1689unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(const unordered_multiset& __u)
1690 : __table_(__u.__table_) {
1691 __table_.__rehash_multi(__u.bucket_count());
1692 insert(__u.begin(), __u.end());
1693}
1694
1695template <class _Value, class _Hash, class _Pred, class _Alloc>1681template <class _Value, class _Hash, class _Pred, class _Alloc>
1696unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(1682unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1697 const unordered_multiset& __u, const allocator_type& __a)1683 const unordered_multiset& __u, const allocator_type& __a)
...@@ -1702,11 +1688,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1702,11 +1688,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
17021688
1703# ifndef _LIBCPP_CXX03_LANG1689# ifndef _LIBCPP_CXX03_LANG
17041690
1705template <class _Value, class _Hash, class _Pred, class _Alloc>
1706inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(unordered_multiset&& __u)
1707 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1708 : __table_(std::move(__u.__table_)) {}
1709
1710template <class _Value, class _Hash, class _Pred, class _Alloc>1691template <class _Value, class _Hash, class _Pred, class _Alloc>
1711unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(1692unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1712 unordered_multiset&& __u, const allocator_type& __a)1693 unordered_multiset&& __u, const allocator_type& __a)
...@@ -1743,14 +1724,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1743,14 +1724,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1743 insert(__il.begin(), __il.end());1724 insert(__il.begin(), __il.end());
1744}1725}
17451726
1746template <class _Value, class _Hash, class _Pred, class _Alloc>
1747inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
1748unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_multiset&& __u)
1749 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
1750 __table_ = std::move(__u.__table_);
1751 return *this;
1752}
1753
1754template <class _Value, class _Hash, class _Pred, class _Alloc>1727template <class _Value, class _Hash, class _Pred, class _Alloc>
1755inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>&1728inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
1756unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {1729unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
lib/libcxx/include/utility+12
...@@ -216,6 +216,18 @@ template<size_t N>...@@ -216,6 +216,18 @@ template<size_t N>
216template<class... T>216template<class... T>
217 using index_sequence_for = make_index_sequence<sizeof...(T)>;217 using index_sequence_for = make_index_sequence<sizeof...(T)>;
218218
219template<class T, T... Values> // C++26
220 struct tuple_size<integer_sequence<T, Values...>>;
221
222template<size_t I, class T, T... Values> // C++26
223 struct tuple_element<I, integer_sequence<T, Values...>>;
224
225template<size_t I, class T, T... Values> // C++26
226 struct tuple_element<I, const integer_sequence<T, Values...>>;
227
228template<size_t I, class T, T... Values> // C++26
229 constexpr T get(integer_sequence<T, Values...>) noexcept;
230
219template<class T, class U=T>231template<class T, class U=T>
220 constexpr T exchange(T& obj, U&& new_value) // constexpr in C++17, noexcept in C++23232 constexpr T exchange(T& obj, U&& new_value) // constexpr in C++17, noexcept in C++23
221 noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value);233 noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value);
lib/libcxx/include/valarray+106-161
...@@ -362,6 +362,7 @@ template <class T> unspecified2 end(const valarray<T>& v);...@@ -362,6 +362,7 @@ template <class T> unspecified2 end(const valarray<T>& v);
362# include <__memory/uninitialized_algorithms.h>362# include <__memory/uninitialized_algorithms.h>
363# include <__type_traits/decay.h>363# include <__type_traits/decay.h>
364# include <__type_traits/remove_reference.h>364# include <__type_traits/remove_reference.h>
365# include <__utility/exception_guard.h>
365# include <__utility/move.h>366# include <__utility/move.h>
366# include <__utility/swap.h>367# include <__utility/swap.h>
367# include <cmath>368# include <cmath>
...@@ -395,9 +396,9 @@ public:...@@ -395,9 +396,9 @@ public:
395 _LIBCPP_HIDE_FROM_ABI slice(size_t __start, size_t __size, size_t __stride)396 _LIBCPP_HIDE_FROM_ABI slice(size_t __start, size_t __size, size_t __stride)
396 : __start_(__start), __size_(__size), __stride_(__stride) {}397 : __start_(__start), __size_(__size), __stride_(__stride) {}
397398
398 _LIBCPP_HIDE_FROM_ABI size_t start() const { return __start_; }399 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t start() const { return __start_; }
399 _LIBCPP_HIDE_FROM_ABI size_t size() const { return __size_; }400 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t size() const { return __size_; }
400 _LIBCPP_HIDE_FROM_ABI size_t stride() const { return __stride_; }401 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t stride() const { return __stride_; }
401402
402# if _LIBCPP_STD_VER >= 20403# if _LIBCPP_STD_VER >= 20
403404
...@@ -792,7 +793,7 @@ private:...@@ -792,7 +793,7 @@ private:
792public:793public:
793 // construct/destroy:794 // construct/destroy:
794 _LIBCPP_HIDE_FROM_ABI valarray() : __begin_(nullptr), __end_(nullptr) {}795 _LIBCPP_HIDE_FROM_ABI valarray() : __begin_(nullptr), __end_(nullptr) {}
795 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit valarray(size_t __n);796 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 explicit valarray(size_t __n);
796 _LIBCPP_HIDE_FROM_ABI valarray(const value_type& __x, size_t __n);797 _LIBCPP_HIDE_FROM_ABI valarray(const value_type& __x, size_t __n);
797 valarray(const value_type* __p, size_t __n);798 valarray(const value_type* __p, size_t __n);
798 valarray(const valarray& __v);799 valarray(const valarray& __v);
...@@ -804,7 +805,7 @@ public:...@@ -804,7 +805,7 @@ public:
804 valarray(const gslice_array<value_type>& __ga);805 valarray(const gslice_array<value_type>& __ga);
805 valarray(const mask_array<value_type>& __ma);806 valarray(const mask_array<value_type>& __ma);
806 valarray(const indirect_array<value_type>& __ia);807 valarray(const indirect_array<value_type>& __ia);
807 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 ~valarray();808 inline _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8 ~valarray();
808809
809 // assignment:810 // assignment:
810 valarray& operator=(const valarray& __v);811 valarray& operator=(const valarray& __v);
...@@ -821,36 +822,41 @@ public:...@@ -821,36 +822,41 @@ public:
821 _LIBCPP_HIDE_FROM_ABI valarray& operator=(const __val_expr<_ValExpr>& __v);822 _LIBCPP_HIDE_FROM_ABI valarray& operator=(const __val_expr<_ValExpr>& __v);
822823
823 // element access:824 // element access:
824 _LIBCPP_HIDE_FROM_ABI const value_type& operator[](size_t __i) const {825 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const value_type& operator[](size_t __i) const {
825 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < size(), "valarray::operator[] index out of bounds");826 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < size(), "valarray::operator[] index out of bounds");
826 return __begin_[__i];827 return __begin_[__i];
827 }828 }
828829
829 _LIBCPP_HIDE_FROM_ABI value_type& operator[](size_t __i) {830 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_type& operator[](size_t __i) {
830 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < size(), "valarray::operator[] index out of bounds");831 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < size(), "valarray::operator[] index out of bounds");
831 return __begin_[__i];832 return __begin_[__i];
832 }833 }
833834
834 // subset operations:835 // subset operations:
835 _LIBCPP_HIDE_FROM_ABI __val_expr<__slice_expr<const valarray&> > operator[](slice __s) const;836 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI __val_expr<__slice_expr<const valarray&> > operator[](slice __s) const;
836 _LIBCPP_HIDE_FROM_ABI slice_array<value_type> operator[](slice __s);837 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI slice_array<value_type> operator[](slice __s);
837 _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const;838 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> >
838 _LIBCPP_HIDE_FROM_ABI gslice_array<value_type> operator[](const gslice& __gs);839 operator[](const gslice& __gs) const;
840 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI gslice_array<value_type> operator[](const gslice& __gs);
839# ifndef _LIBCPP_CXX03_LANG841# ifndef _LIBCPP_CXX03_LANG
840 _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;842 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
841 _LIBCPP_HIDE_FROM_ABI gslice_array<value_type> operator[](gslice&& __gs);843 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI gslice_array<value_type> operator[](gslice&& __gs);
842# endif // _LIBCPP_CXX03_LANG844# endif // _LIBCPP_CXX03_LANG
845 [[__nodiscard__]]
843 _LIBCPP_HIDE_FROM_ABI __val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;846 _LIBCPP_HIDE_FROM_ABI __val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;
844 _LIBCPP_HIDE_FROM_ABI mask_array<value_type> operator[](const valarray<bool>& __vb);847 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mask_array<value_type> operator[](const valarray<bool>& __vb);
845# ifndef _LIBCPP_CXX03_LANG848# ifndef _LIBCPP_CXX03_LANG
849 [[__nodiscard__]]
846 _LIBCPP_HIDE_FROM_ABI __val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;850 _LIBCPP_HIDE_FROM_ABI __val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;
847 _LIBCPP_HIDE_FROM_ABI mask_array<value_type> operator[](valarray<bool>&& __vb);851 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mask_array<value_type> operator[](valarray<bool>&& __vb);
848# endif // _LIBCPP_CXX03_LANG852# endif // _LIBCPP_CXX03_LANG
853 [[__nodiscard__]]
849 _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;854 _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
850 _LIBCPP_HIDE_FROM_ABI indirect_array<value_type> operator[](const valarray<size_t>& __vs);855 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI indirect_array<value_type> operator[](const valarray<size_t>& __vs);
851# ifndef _LIBCPP_CXX03_LANG856# ifndef _LIBCPP_CXX03_LANG
857 [[__nodiscard__]]
852 _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;858 _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
853 _LIBCPP_HIDE_FROM_ABI indirect_array<value_type> operator[](valarray<size_t>&& __vs);859 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI indirect_array<value_type> operator[](valarray<size_t>&& __vs);
854# endif // _LIBCPP_CXX03_LANG860# endif // _LIBCPP_CXX03_LANG
855861
856 // unary operators:862 // unary operators:
...@@ -904,16 +910,16 @@ public:...@@ -904,16 +910,16 @@ public:
904 // member functions:910 // member functions:
905 _LIBCPP_HIDE_FROM_ABI void swap(valarray& __v) _NOEXCEPT;911 _LIBCPP_HIDE_FROM_ABI void swap(valarray& __v) _NOEXCEPT;
906912
907 _LIBCPP_HIDE_FROM_ABI size_t size() const { return static_cast<size_t>(__end_ - __begin_); }913 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t size() const { return static_cast<size_t>(__end_ - __begin_); }
908914
909 _LIBCPP_HIDE_FROM_ABI value_type sum() const;915 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_type sum() const;
910 _LIBCPP_HIDE_FROM_ABI value_type min() const;916 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_type min() const;
911 _LIBCPP_HIDE_FROM_ABI value_type max() const;917 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_type max() const;
912918
913 valarray shift(int __i) const;919 [[__nodiscard__]] valarray shift(int __i) const;
914 valarray cshift(int __i) const;920 [[__nodiscard__]] valarray cshift(int __i) const;
915 valarray apply(value_type __f(value_type)) const;921 [[__nodiscard__]] valarray apply(value_type __f(value_type)) const;
916 valarray apply(value_type __f(const value_type&)) const;922 [[__nodiscard__]] valarray apply(value_type __f(const value_type&)) const;
917 void resize(size_t __n, value_type __x = value_type());923 void resize(size_t __n, value_type __x = value_type());
918924
919private:925private:
...@@ -1248,11 +1254,11 @@ public:...@@ -1248,11 +1254,11 @@ public:
12481254
1249# endif // _LIBCPP_CXX03_LANG1255# endif // _LIBCPP_CXX03_LANG
12501256
1251 _LIBCPP_HIDE_FROM_ABI size_t start() const { return __1d_.size() ? __1d_[0] : 0; }1257 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t start() const { return __1d_.size() ? __1d_[0] : 0; }
12521258
1253 _LIBCPP_HIDE_FROM_ABI valarray<size_t> size() const { return __size_; }1259 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI valarray<size_t> size() const { return __size_; }
12541260
1255 _LIBCPP_HIDE_FROM_ABI valarray<size_t> stride() const { return __stride_; }1261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI valarray<size_t> stride() const { return __stride_; }
12561262
1257private:1263private:
1258 void __init(size_t __start);1264 void __init(size_t __start);
...@@ -1992,17 +1998,10 @@ template <class _Tp>...@@ -1992,17 +1998,10 @@ template <class _Tp>
1992inline valarray<_Tp>::valarray(size_t __n) : __begin_(nullptr), __end_(nullptr) {1998inline valarray<_Tp>::valarray(size_t __n) : __begin_(nullptr), __end_(nullptr) {
1993 if (__n) {1999 if (__n) {
1994 __begin_ = __end_ = allocator<value_type>().allocate(__n);2000 __begin_ = __end_ = allocator<value_type>().allocate(__n);
1995# if _LIBCPP_HAS_EXCEPTIONS2001 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
1996 try {2002 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
1997# endif // _LIBCPP_HAS_EXCEPTIONS2003 ::new ((void*)__end_) value_type();
1998 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)2004 __guard.__complete();
1999 ::new ((void*)__end_) value_type();
2000# if _LIBCPP_HAS_EXCEPTIONS
2001 } catch (...) {
2002 __clear(__n);
2003 throw;
2004 }
2005# endif // _LIBCPP_HAS_EXCEPTIONS
2006 }2005 }
2007}2006}
20082007
...@@ -2015,17 +2014,10 @@ template <class _Tp>...@@ -2015,17 +2014,10 @@ template <class _Tp>
2015valarray<_Tp>::valarray(const value_type* __p, size_t __n) : __begin_(nullptr), __end_(nullptr) {2014valarray<_Tp>::valarray(const value_type* __p, size_t __n) : __begin_(nullptr), __end_(nullptr) {
2016 if (__n) {2015 if (__n) {
2017 __begin_ = __end_ = allocator<value_type>().allocate(__n);2016 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2018# if _LIBCPP_HAS_EXCEPTIONS2017 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2019 try {2018 for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)
2020# endif // _LIBCPP_HAS_EXCEPTIONS2019 ::new ((void*)__end_) value_type(*__p);
2021 for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)2020 __guard.__complete();
2022 ::new ((void*)__end_) value_type(*__p);
2023# if _LIBCPP_HAS_EXCEPTIONS
2024 } catch (...) {
2025 __clear(__n);
2026 throw;
2027 }
2028# endif // _LIBCPP_HAS_EXCEPTIONS
2029 }2021 }
2030}2022}
20312023
...@@ -2033,17 +2025,10 @@ template <class _Tp>...@@ -2033,17 +2025,10 @@ template <class _Tp>
2033valarray<_Tp>::valarray(const valarray& __v) : __begin_(nullptr), __end_(nullptr) {2025valarray<_Tp>::valarray(const valarray& __v) : __begin_(nullptr), __end_(nullptr) {
2034 if (__v.size()) {2026 if (__v.size()) {
2035 __begin_ = __end_ = allocator<value_type>().allocate(__v.size());2027 __begin_ = __end_ = allocator<value_type>().allocate(__v.size());
2036# if _LIBCPP_HAS_EXCEPTIONS2028 auto __guard = std::__make_exception_guard([&] { __clear(__v.size()); });
2037 try {2029 for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
2038# endif // _LIBCPP_HAS_EXCEPTIONS2030 ::new ((void*)__end_) value_type(*__p);
2039 for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)2031 __guard.__complete();
2040 ::new ((void*)__end_) value_type(*__p);
2041# if _LIBCPP_HAS_EXCEPTIONS
2042 } catch (...) {
2043 __clear(__v.size());
2044 throw;
2045 }
2046# endif // _LIBCPP_HAS_EXCEPTIONS
2047 }2032 }
2048}2033}
20492034
...@@ -2059,18 +2044,11 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il) : __begin_(nullptr),...@@ -2059,18 +2044,11 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il) : __begin_(nullptr),
2059 const size_t __n = __il.size();2044 const size_t __n = __il.size();
2060 if (__n) {2045 if (__n) {
2061 __begin_ = __end_ = allocator<value_type>().allocate(__n);2046 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2062# if _LIBCPP_HAS_EXCEPTIONS2047 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2063 try {2048 size_t __n_left = __n;
2064# endif // _LIBCPP_HAS_EXCEPTIONS2049 for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
2065 size_t __n_left = __n;2050 ::new ((void*)__end_) value_type(*__p);
2066 for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)2051 __guard.__complete();
2067 ::new ((void*)__end_) value_type(*__p);
2068# if _LIBCPP_HAS_EXCEPTIONS
2069 } catch (...) {
2070 __clear(__n);
2071 throw;
2072 }
2073# endif // _LIBCPP_HAS_EXCEPTIONS
2074 }2052 }
2075}2053}
20762054
...@@ -2081,18 +2059,11 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa) : __begin_(nullptr)...@@ -2081,18 +2059,11 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa) : __begin_(nullptr)
2081 const size_t __n = __sa.__size_;2059 const size_t __n = __sa.__size_;
2082 if (__n) {2060 if (__n) {
2083 __begin_ = __end_ = allocator<value_type>().allocate(__n);2061 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2084# if _LIBCPP_HAS_EXCEPTIONS2062 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2085 try {2063 size_t __n_left = __n;
2086# endif // _LIBCPP_HAS_EXCEPTIONS2064 for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)
2087 size_t __n_left = __n;2065 ::new ((void*)__end_) value_type(*__p);
2088 for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)2066 __guard.__complete();
2089 ::new ((void*)__end_) value_type(*__p);
2090# if _LIBCPP_HAS_EXCEPTIONS
2091 } catch (...) {
2092 __clear(__n);
2093 throw;
2094 }
2095# endif // _LIBCPP_HAS_EXCEPTIONS
2096 }2067 }
2097}2068}
20982069
...@@ -2101,19 +2072,12 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga) : __begin_(nullptr...@@ -2101,19 +2072,12 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga) : __begin_(nullptr
2101 const size_t __n = __ga.__1d_.size();2072 const size_t __n = __ga.__1d_.size();
2102 if (__n) {2073 if (__n) {
2103 __begin_ = __end_ = allocator<value_type>().allocate(__n);2074 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2104# if _LIBCPP_HAS_EXCEPTIONS2075 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2105 try {2076 typedef const size_t* _Ip;
2106# endif // _LIBCPP_HAS_EXCEPTIONS2077 const value_type* __s = __ga.__vp_;
2107 typedef const size_t* _Ip;2078 for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_; __i != __e; ++__i, ++__end_)
2108 const value_type* __s = __ga.__vp_;2079 ::new ((void*)__end_) value_type(__s[*__i]);
2109 for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_; __i != __e; ++__i, ++__end_)2080 __guard.__complete();
2110 ::new ((void*)__end_) value_type(__s[*__i]);
2111# if _LIBCPP_HAS_EXCEPTIONS
2112 } catch (...) {
2113 __clear(__n);
2114 throw;
2115 }
2116# endif // _LIBCPP_HAS_EXCEPTIONS
2117 }2081 }
2118}2082}
21192083
...@@ -2122,19 +2086,12 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma) : __begin_(nullptr),...@@ -2122,19 +2086,12 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma) : __begin_(nullptr),
2122 const size_t __n = __ma.__1d_.size();2086 const size_t __n = __ma.__1d_.size();
2123 if (__n) {2087 if (__n) {
2124 __begin_ = __end_ = allocator<value_type>().allocate(__n);2088 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2125# if _LIBCPP_HAS_EXCEPTIONS2089 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2126 try {2090 typedef const size_t* _Ip;
2127# endif // _LIBCPP_HAS_EXCEPTIONS2091 const value_type* __s = __ma.__vp_;
2128 typedef const size_t* _Ip;2092 for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_; __i != __e; ++__i, ++__end_)
2129 const value_type* __s = __ma.__vp_;2093 ::new ((void*)__end_) value_type(__s[*__i]);
2130 for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_; __i != __e; ++__i, ++__end_)2094 __guard.__complete();
2131 ::new ((void*)__end_) value_type(__s[*__i]);
2132# if _LIBCPP_HAS_EXCEPTIONS
2133 } catch (...) {
2134 __clear(__n);
2135 throw;
2136 }
2137# endif // _LIBCPP_HAS_EXCEPTIONS
2138 }2095 }
2139}2096}
21402097
...@@ -2143,19 +2100,12 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia) : __begin_(nullp...@@ -2143,19 +2100,12 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia) : __begin_(nullp
2143 const size_t __n = __ia.__1d_.size();2100 const size_t __n = __ia.__1d_.size();
2144 if (__n) {2101 if (__n) {
2145 __begin_ = __end_ = allocator<value_type>().allocate(__n);2102 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2146# if _LIBCPP_HAS_EXCEPTIONS2103 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2147 try {2104 typedef const size_t* _Ip;
2148# endif // _LIBCPP_HAS_EXCEPTIONS2105 const value_type* __s = __ia.__vp_;
2149 typedef const size_t* _Ip;2106 for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_; __i != __e; ++__i, ++__end_)
2150 const value_type* __s = __ia.__vp_;2107 ::new ((void*)__end_) value_type(__s[*__i]);
2151 for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_; __i != __e; ++__i, ++__end_)2108 __guard.__complete();
2152 ::new ((void*)__end_) value_type(__s[*__i]);
2153# if _LIBCPP_HAS_EXCEPTIONS
2154 } catch (...) {
2155 __clear(__n);
2156 throw;
2157 }
2158# endif // _LIBCPP_HAS_EXCEPTIONS
2159 }2109 }
2160}2110}
21612111
...@@ -2644,17 +2594,10 @@ void valarray<_Tp>::resize(size_t __n, value_type __x) {...@@ -2644,17 +2594,10 @@ void valarray<_Tp>::resize(size_t __n, value_type __x) {
2644 __clear(size());2594 __clear(size());
2645 if (__n) {2595 if (__n) {
2646 __begin_ = __end_ = allocator<value_type>().allocate(__n);2596 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2647# if _LIBCPP_HAS_EXCEPTIONS2597 auto __guard = std::__make_exception_guard([&] { __clear(__n); });
2648 try {2598 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
2649# endif // _LIBCPP_HAS_EXCEPTIONS2599 ::new ((void*)__end_) value_type(__x);
2650 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)2600 __guard.__complete();
2651 ::new ((void*)__end_) value_type(__x);
2652# if _LIBCPP_HAS_EXCEPTIONS
2653 } catch (...) {
2654 __clear(__n);
2655 throw;
2656 }
2657# endif // _LIBCPP_HAS_EXCEPTIONS
2658 }2601 }
2659}2602}
26602603
...@@ -3168,7 +3111,7 @@ operator>=(const typename _Expr::value_type& __x, const _Expr& __y) {...@@ -3168,7 +3111,7 @@ operator>=(const typename _Expr::value_type& __x, const _Expr& __y) {
3168}3111}
31693112
3170template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3113template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3171inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__abs_expr<typename _Expr::value_type>, _Expr> >3114[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__abs_expr<typename _Expr::value_type>, _Expr> >
3172abs(const _Expr& __x) {3115abs(const _Expr& __x) {
3173 typedef typename _Expr::value_type value_type;3116 typedef typename _Expr::value_type value_type;
3174 typedef _UnaryOp<__abs_expr<value_type>, _Expr> _Op;3117 typedef _UnaryOp<__abs_expr<value_type>, _Expr> _Op;
...@@ -3176,7 +3119,7 @@ abs(const _Expr& __x) {...@@ -3176,7 +3119,7 @@ abs(const _Expr& __x) {
3176}3119}
31773120
3178template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3121template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3179inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__acos_expr<typename _Expr::value_type>, _Expr> >3122[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__acos_expr<typename _Expr::value_type>, _Expr> >
3180acos(const _Expr& __x) {3123acos(const _Expr& __x) {
3181 typedef typename _Expr::value_type value_type;3124 typedef typename _Expr::value_type value_type;
3182 typedef _UnaryOp<__acos_expr<value_type>, _Expr> _Op;3125 typedef _UnaryOp<__acos_expr<value_type>, _Expr> _Op;
...@@ -3184,7 +3127,7 @@ acos(const _Expr& __x) {...@@ -3184,7 +3127,7 @@ acos(const _Expr& __x) {
3184}3127}
31853128
3186template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3129template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3187inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__asin_expr<typename _Expr::value_type>, _Expr> >3130[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__asin_expr<typename _Expr::value_type>, _Expr> >
3188asin(const _Expr& __x) {3131asin(const _Expr& __x) {
3189 typedef typename _Expr::value_type value_type;3132 typedef typename _Expr::value_type value_type;
3190 typedef _UnaryOp<__asin_expr<value_type>, _Expr> _Op;3133 typedef _UnaryOp<__asin_expr<value_type>, _Expr> _Op;
...@@ -3192,7 +3135,7 @@ asin(const _Expr& __x) {...@@ -3192,7 +3135,7 @@ asin(const _Expr& __x) {
3192}3135}
31933136
3194template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3137template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3195inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__atan_expr<typename _Expr::value_type>, _Expr> >3138[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__atan_expr<typename _Expr::value_type>, _Expr> >
3196atan(const _Expr& __x) {3139atan(const _Expr& __x) {
3197 typedef typename _Expr::value_type value_type;3140 typedef typename _Expr::value_type value_type;
3198 typedef _UnaryOp<__atan_expr<value_type>, _Expr> _Op;3141 typedef _UnaryOp<__atan_expr<value_type>, _Expr> _Op;
...@@ -3202,15 +3145,16 @@ atan(const _Expr& __x) {...@@ -3202,15 +3145,16 @@ atan(const _Expr& __x) {
3202template <class _Expr1,3145template <class _Expr1,
3203 class _Expr2,3146 class _Expr2,
3204 __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>3147 __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
3205inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__atan2_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >3148[[__nodiscard__]] inline
3206atan2(const _Expr1& __x, const _Expr2& __y) {3149 _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__atan2_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
3150 atan2(const _Expr1& __x, const _Expr2& __y) {
3207 typedef typename _Expr1::value_type value_type;3151 typedef typename _Expr1::value_type value_type;
3208 typedef _BinaryOp<__atan2_expr<value_type>, _Expr1, _Expr2> _Op;3152 typedef _BinaryOp<__atan2_expr<value_type>, _Expr1, _Expr2> _Op;
3209 return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __y));3153 return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __y));
3210}3154}
32113155
3212template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3156template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3213inline _LIBCPP_HIDE_FROM_ABI3157[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3214__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >3158__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
3215atan2(const _Expr& __x, const typename _Expr::value_type& __y) {3159atan2(const _Expr& __x, const typename _Expr::value_type& __y) {
3216 typedef typename _Expr::value_type value_type;3160 typedef typename _Expr::value_type value_type;
...@@ -3219,7 +3163,7 @@ atan2(const _Expr& __x, const typename _Expr::value_type& __y) {...@@ -3219,7 +3163,7 @@ atan2(const _Expr& __x, const typename _Expr::value_type& __y) {
3219}3163}
32203164
3221template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3165template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3222inline _LIBCPP_HIDE_FROM_ABI3166[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3223__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >3167__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
3224atan2(const typename _Expr::value_type& __x, const _Expr& __y) {3168atan2(const typename _Expr::value_type& __x, const _Expr& __y) {
3225 typedef typename _Expr::value_type value_type;3169 typedef typename _Expr::value_type value_type;
...@@ -3228,7 +3172,7 @@ atan2(const typename _Expr::value_type& __x, const _Expr& __y) {...@@ -3228,7 +3172,7 @@ atan2(const typename _Expr::value_type& __x, const _Expr& __y) {
3228}3172}
32293173
3230template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3174template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3231inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__cos_expr<typename _Expr::value_type>, _Expr> >3175[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__cos_expr<typename _Expr::value_type>, _Expr> >
3232cos(const _Expr& __x) {3176cos(const _Expr& __x) {
3233 typedef typename _Expr::value_type value_type;3177 typedef typename _Expr::value_type value_type;
3234 typedef _UnaryOp<__cos_expr<value_type>, _Expr> _Op;3178 typedef _UnaryOp<__cos_expr<value_type>, _Expr> _Op;
...@@ -3236,7 +3180,7 @@ cos(const _Expr& __x) {...@@ -3236,7 +3180,7 @@ cos(const _Expr& __x) {
3236}3180}
32373181
3238template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3182template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3239inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__cosh_expr<typename _Expr::value_type>, _Expr> >3183[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__cosh_expr<typename _Expr::value_type>, _Expr> >
3240cosh(const _Expr& __x) {3184cosh(const _Expr& __x) {
3241 typedef typename _Expr::value_type value_type;3185 typedef typename _Expr::value_type value_type;
3242 typedef _UnaryOp<__cosh_expr<value_type>, _Expr> _Op;3186 typedef _UnaryOp<__cosh_expr<value_type>, _Expr> _Op;
...@@ -3244,7 +3188,7 @@ cosh(const _Expr& __x) {...@@ -3244,7 +3188,7 @@ cosh(const _Expr& __x) {
3244}3188}
32453189
3246template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3190template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3247inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__exp_expr<typename _Expr::value_type>, _Expr> >3191[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__exp_expr<typename _Expr::value_type>, _Expr> >
3248exp(const _Expr& __x) {3192exp(const _Expr& __x) {
3249 typedef typename _Expr::value_type value_type;3193 typedef typename _Expr::value_type value_type;
3250 typedef _UnaryOp<__exp_expr<value_type>, _Expr> _Op;3194 typedef _UnaryOp<__exp_expr<value_type>, _Expr> _Op;
...@@ -3252,7 +3196,7 @@ exp(const _Expr& __x) {...@@ -3252,7 +3196,7 @@ exp(const _Expr& __x) {
3252}3196}
32533197
3254template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3198template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3255inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__log_expr<typename _Expr::value_type>, _Expr> >3199[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__log_expr<typename _Expr::value_type>, _Expr> >
3256log(const _Expr& __x) {3200log(const _Expr& __x) {
3257 typedef typename _Expr::value_type value_type;3201 typedef typename _Expr::value_type value_type;
3258 typedef _UnaryOp<__log_expr<value_type>, _Expr> _Op;3202 typedef _UnaryOp<__log_expr<value_type>, _Expr> _Op;
...@@ -3260,7 +3204,7 @@ log(const _Expr& __x) {...@@ -3260,7 +3204,7 @@ log(const _Expr& __x) {
3260}3204}
32613205
3262template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3206template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3263inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__log10_expr<typename _Expr::value_type>, _Expr> >3207[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__log10_expr<typename _Expr::value_type>, _Expr> >
3264log10(const _Expr& __x) {3208log10(const _Expr& __x) {
3265 typedef typename _Expr::value_type value_type;3209 typedef typename _Expr::value_type value_type;
3266 typedef _UnaryOp<__log10_expr<value_type>, _Expr> _Op;3210 typedef _UnaryOp<__log10_expr<value_type>, _Expr> _Op;
...@@ -3270,15 +3214,16 @@ log10(const _Expr& __x) {...@@ -3270,15 +3214,16 @@ log10(const _Expr& __x) {
3270template <class _Expr1,3214template <class _Expr1,
3271 class _Expr2,3215 class _Expr2,
3272 __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>3216 __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
3273inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__pow_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >3217[[__nodiscard__]] inline
3274pow(const _Expr1& __x, const _Expr2& __y) {3218 _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__pow_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
3219 pow(const _Expr1& __x, const _Expr2& __y) {
3275 typedef typename _Expr1::value_type value_type;3220 typedef typename _Expr1::value_type value_type;
3276 typedef _BinaryOp<__pow_expr<value_type>, _Expr1, _Expr2> _Op;3221 typedef _BinaryOp<__pow_expr<value_type>, _Expr1, _Expr2> _Op;
3277 return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __y));3222 return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __y));
3278}3223}
32793224
3280template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3225template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3281inline _LIBCPP_HIDE_FROM_ABI3226[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3282__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >3227__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
3283pow(const _Expr& __x, const typename _Expr::value_type& __y) {3228pow(const _Expr& __x, const typename _Expr::value_type& __y) {
3284 typedef typename _Expr::value_type value_type;3229 typedef typename _Expr::value_type value_type;
...@@ -3287,7 +3232,7 @@ pow(const _Expr& __x, const typename _Expr::value_type& __y) {...@@ -3287,7 +3232,7 @@ pow(const _Expr& __x, const typename _Expr::value_type& __y) {
3287}3232}
32883233
3289template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3234template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3290inline _LIBCPP_HIDE_FROM_ABI3235[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3291__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >3236__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
3292pow(const typename _Expr::value_type& __x, const _Expr& __y) {3237pow(const typename _Expr::value_type& __x, const _Expr& __y) {
3293 typedef typename _Expr::value_type value_type;3238 typedef typename _Expr::value_type value_type;
...@@ -3296,7 +3241,7 @@ pow(const typename _Expr::value_type& __x, const _Expr& __y) {...@@ -3296,7 +3241,7 @@ pow(const typename _Expr::value_type& __x, const _Expr& __y) {
3296}3241}
32973242
3298template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3243template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3299inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sin_expr<typename _Expr::value_type>, _Expr> >3244[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sin_expr<typename _Expr::value_type>, _Expr> >
3300sin(const _Expr& __x) {3245sin(const _Expr& __x) {
3301 typedef typename _Expr::value_type value_type;3246 typedef typename _Expr::value_type value_type;
3302 typedef _UnaryOp<__sin_expr<value_type>, _Expr> _Op;3247 typedef _UnaryOp<__sin_expr<value_type>, _Expr> _Op;
...@@ -3304,7 +3249,7 @@ sin(const _Expr& __x) {...@@ -3304,7 +3249,7 @@ sin(const _Expr& __x) {
3304}3249}
33053250
3306template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3251template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3307inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sinh_expr<typename _Expr::value_type>, _Expr> >3252[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sinh_expr<typename _Expr::value_type>, _Expr> >
3308sinh(const _Expr& __x) {3253sinh(const _Expr& __x) {
3309 typedef typename _Expr::value_type value_type;3254 typedef typename _Expr::value_type value_type;
3310 typedef _UnaryOp<__sinh_expr<value_type>, _Expr> _Op;3255 typedef _UnaryOp<__sinh_expr<value_type>, _Expr> _Op;
...@@ -3312,7 +3257,7 @@ sinh(const _Expr& __x) {...@@ -3312,7 +3257,7 @@ sinh(const _Expr& __x) {
3312}3257}
33133258
3314template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3259template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3315inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sqrt_expr<typename _Expr::value_type>, _Expr> >3260[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sqrt_expr<typename _Expr::value_type>, _Expr> >
3316sqrt(const _Expr& __x) {3261sqrt(const _Expr& __x) {
3317 typedef typename _Expr::value_type value_type;3262 typedef typename _Expr::value_type value_type;
3318 typedef _UnaryOp<__sqrt_expr<value_type>, _Expr> _Op;3263 typedef _UnaryOp<__sqrt_expr<value_type>, _Expr> _Op;
...@@ -3320,7 +3265,7 @@ sqrt(const _Expr& __x) {...@@ -3320,7 +3265,7 @@ sqrt(const _Expr& __x) {
3320}3265}
33213266
3322template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3267template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3323inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__tan_expr<typename _Expr::value_type>, _Expr> >3268[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__tan_expr<typename _Expr::value_type>, _Expr> >
3324tan(const _Expr& __x) {3269tan(const _Expr& __x) {
3325 typedef typename _Expr::value_type value_type;3270 typedef typename _Expr::value_type value_type;
3326 typedef _UnaryOp<__tan_expr<value_type>, _Expr> _Op;3271 typedef _UnaryOp<__tan_expr<value_type>, _Expr> _Op;
...@@ -3328,7 +3273,7 @@ tan(const _Expr& __x) {...@@ -3328,7 +3273,7 @@ tan(const _Expr& __x) {
3328}3273}
33293274
3330template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>3275template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
3331inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__tanh_expr<typename _Expr::value_type>, _Expr> >3276[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__tanh_expr<typename _Expr::value_type>, _Expr> >
3332tanh(const _Expr& __x) {3277tanh(const _Expr& __x) {
3333 typedef typename _Expr::value_type value_type;3278 typedef typename _Expr::value_type value_type;
3334 typedef _UnaryOp<__tanh_expr<value_type>, _Expr> _Op;3279 typedef _UnaryOp<__tanh_expr<value_type>, _Expr> _Op;
...@@ -3336,22 +3281,22 @@ tanh(const _Expr& __x) {...@@ -3336,22 +3281,22 @@ tanh(const _Expr& __x) {
3336}3281}
33373282
3338template <class _Tp>3283template <class _Tp>
3339inline _LIBCPP_HIDE_FROM_ABI _Tp* begin(valarray<_Tp>& __v) {3284[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _Tp* begin(valarray<_Tp>& __v) {
3340 return __v.__begin_;3285 return __v.__begin_;
3341}3286}
33423287
3343template <class _Tp>3288template <class _Tp>
3344inline _LIBCPP_HIDE_FROM_ABI const _Tp* begin(const valarray<_Tp>& __v) {3289[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI const _Tp* begin(const valarray<_Tp>& __v) {
3345 return __v.__begin_;3290 return __v.__begin_;
3346}3291}
33473292
3348template <class _Tp>3293template <class _Tp>
3349inline _LIBCPP_HIDE_FROM_ABI _Tp* end(valarray<_Tp>& __v) {3294[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _Tp* end(valarray<_Tp>& __v) {
3350 return __v.__end_;3295 return __v.__end_;
3351}3296}
33523297
3353template <class _Tp>3298template <class _Tp>
3354inline _LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v) {3299[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v) {
3355 return __v.__end_;3300 return __v.__end_;
3356}3301}
33573302
lib/libcxx/include/variant+25-33
...@@ -247,7 +247,6 @@ namespace std {...@@ -247,7 +247,6 @@ namespace std {
247# include <__type_traits/is_nothrow_assignable.h>247# include <__type_traits/is_nothrow_assignable.h>
248# include <__type_traits/is_nothrow_constructible.h>248# include <__type_traits/is_nothrow_constructible.h>
249# include <__type_traits/is_reference.h>249# include <__type_traits/is_reference.h>
250# include <__type_traits/is_replaceable.h>
251# include <__type_traits/is_same.h>250# include <__type_traits/is_same.h>
252# include <__type_traits/is_swappable.h>251# include <__type_traits/is_swappable.h>
253# include <__type_traits/is_trivially_assignable.h>252# include <__type_traits/is_trivially_assignable.h>
...@@ -289,7 +288,7 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD...@@ -289,7 +288,7 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
289288
290class _LIBCPP_EXPORTED_FROM_ABI bad_variant_access : public exception {289class _LIBCPP_EXPORTED_FROM_ABI bad_variant_access : public exception {
291public:290public:
292 const char* what() const _NOEXCEPT override;291 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
293};292};
294293
295_LIBCPP_END_UNVERSIONED_NAMESPACE_STD294_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
...@@ -918,18 +917,10 @@ protected:...@@ -918,18 +917,10 @@ protected:
918 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __assign_alt(__alt<_Ip, _Tp>& __a, _Arg&& __arg) {917 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __assign_alt(__alt<_Ip, _Tp>& __a, _Arg&& __arg) {
919 if (this->index() == _Ip) {918 if (this->index() == _Ip) {
920 __a.__value = std::forward<_Arg>(__arg);919 __a.__value = std::forward<_Arg>(__arg);
920 } else if constexpr (is_nothrow_constructible_v<_Tp, _Arg> || !is_nothrow_move_constructible_v<_Tp>) {
921 this->__emplace<_Ip>(std::forward<_Arg>(__arg));
921 } else {922 } else {
922 struct {923 this->__emplace<_Ip>(_Tp(std::forward<_Arg>(__arg)));
923 _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()(true_type) const {
924 __this->__emplace<_Ip>(std::forward<_Arg>(__arg));
925 }
926 _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()(false_type) const {
927 __this->__emplace<_Ip>(_Tp(std::forward<_Arg>(__arg)));
928 }
929 __assignment* __this;
930 _Arg&& __arg;
931 } __impl{this, std::forward<_Arg>(__arg)};
932 __impl(bool_constant < is_nothrow_constructible_v<_Tp, _Arg> || !is_nothrow_move_constructible_v < _Tp >> {});
933 }924 }
934 }925 }
935926
...@@ -1127,14 +1118,14 @@ template <class _IdxSeq>...@@ -1127,14 +1118,14 @@ template <class _IdxSeq>
1127struct __make_overloads_imp;1118struct __make_overloads_imp;
11281119
1129template <size_t... _Idx>1120template <size_t... _Idx>
1130struct __make_overloads_imp<__tuple_indices<_Idx...> > {1121struct __make_overloads_imp<index_sequence<_Idx...> > {
1131 template <class... _Types>1122 template <class... _Types>
1132 using _Apply _LIBCPP_NODEBUG = __all_overloads<__overload<_Types, _Idx>...>;1123 using _Apply _LIBCPP_NODEBUG = __all_overloads<__overload<_Types, _Idx>...>;
1133};1124};
11341125
1135template <class... _Types>1126template <class... _Types>
1136using _MakeOverloads _LIBCPP_NODEBUG =1127using _MakeOverloads _LIBCPP_NODEBUG =
1137 typename __make_overloads_imp< __make_indices_imp<sizeof...(_Types), 0> >::template _Apply<_Types...>;1128 typename __make_overloads_imp<make_index_sequence<sizeof...(_Types)>>::template _Apply<_Types...>;
11381129
1139template <class _Tp, class... _Types>1130template <class _Tp, class... _Types>
1140using __best_match_t _LIBCPP_NODEBUG = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, _Tp>::type;1131using __best_match_t _LIBCPP_NODEBUG = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, _Tp>::type;
...@@ -1172,7 +1163,6 @@ class _LIBCPP_DECLSPEC_EMPTY_BASES _LIBCPP_NO_SPECIALIZATIONS variant...@@ -1172,7 +1163,6 @@ class _LIBCPP_DECLSPEC_EMPTY_BASES _LIBCPP_NO_SPECIALIZATIONS variant
1172public:1163public:
1173 using __trivially_relocatable _LIBCPP_NODEBUG =1164 using __trivially_relocatable _LIBCPP_NODEBUG =
1174 conditional_t<_And<__libcpp_is_trivially_relocatable<_Types>...>::value, variant, void>;1165 conditional_t<_And<__libcpp_is_trivially_relocatable<_Types>...>::value, variant, void>;
1175 using __replaceable _LIBCPP_NODEBUG = conditional_t<_And<__is_replaceable<_Types>...>::value, variant, void>;
11761166
1177 template <bool _Dummy = true,1167 template <bool _Dummy = true,
1178 enable_if_t<__dependent_type<is_default_constructible<__first_type>, _Dummy>::value, int> = 0>1168 enable_if_t<__dependent_type<is_default_constructible<__first_type>, _Dummy>::value, int> = 0>
...@@ -1284,11 +1274,11 @@ public:...@@ -1284,11 +1274,11 @@ public:
1284 return __impl_.template __emplace<_Ip>(__il, std::forward<_Args>(__args)...);1274 return __impl_.template __emplace<_Ip>(__il, std::forward<_Args>(__args)...);
1285 }1275 }
12861276
1287 _LIBCPP_HIDE_FROM_ABI constexpr bool valueless_by_exception() const noexcept {1277 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool valueless_by_exception() const noexcept {
1288 return __impl_.valueless_by_exception();1278 return __impl_.valueless_by_exception();
1289 }1279 }
12901280
1291 _LIBCPP_HIDE_FROM_ABI constexpr size_t index() const noexcept { return __impl_.index(); }1281 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t index() const noexcept { return __impl_.index(); }
12921282
1293 template < bool _Dummy = true,1283 template < bool _Dummy = true,
1294 enable_if_t< __all<(__dependent_type<is_move_constructible<_Types>, _Dummy>::value &&1284 enable_if_t< __all<(__dependent_type<is_move_constructible<_Types>, _Dummy>::value &&
...@@ -1299,7 +1289,7 @@ public:...@@ -1299,7 +1289,7 @@ public:
1299 __impl_.__swap(__that.__impl_);1289 __impl_.__swap(__that.__impl_);
1300 }1290 }
13011291
1302# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER1292# if _LIBCPP_STD_VER >= 26
1303 // Helper class to implement [variant.visit]/101293 // Helper class to implement [variant.visit]/10
1304 // Constraints: The call to visit does not use an explicit template-argument-list1294 // Constraints: The call to visit does not use an explicit template-argument-list
1305 // that begins with a type template-argument.1295 // that begins with a type template-argument.
...@@ -1331,7 +1321,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __holds_alternative(const variant<_Types......@@ -1331,7 +1321,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __holds_alternative(const variant<_Types...
1331}1321}
13321322
1333template <class _Tp, class... _Types>1323template <class _Tp, class... _Types>
1334_LIBCPP_HIDE_FROM_ABI constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {1324[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
1335 return std::__holds_alternative<__find_exactly_one_t<_Tp, _Types...>::value>(__v);1325 return std::__holds_alternative<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
1336}1326}
13371327
...@@ -1345,21 +1335,23 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto&& __generic_get(_Vp&& __v) {...@@ -1345,21 +1335,23 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto&& __generic_get(_Vp&& __v) {
1345}1335}
13461336
1347template <size_t _Ip, class... _Types>1337template <size_t _Ip, class... _Types>
1348_LIBCPP_HIDE_FROM_ABI constexpr variant_alternative_t<_Ip, variant<_Types...>>& get(variant<_Types...>& __v) {1338[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr variant_alternative_t<_Ip, variant<_Types...>>&
1339get(variant<_Types...>& __v) {
1349 static_assert(_Ip < sizeof...(_Types));1340 static_assert(_Ip < sizeof...(_Types));
1350 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);1341 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
1351 return std::__generic_get<_Ip>(__v);1342 return std::__generic_get<_Ip>(__v);
1352}1343}
13531344
1354template <size_t _Ip, class... _Types>1345template <size_t _Ip, class... _Types>
1355_LIBCPP_HIDE_FROM_ABI constexpr variant_alternative_t<_Ip, variant<_Types...>>&& get(variant<_Types...>&& __v) {1346[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr variant_alternative_t<_Ip, variant<_Types...>>&&
1347get(variant<_Types...>&& __v) {
1356 static_assert(_Ip < sizeof...(_Types));1348 static_assert(_Ip < sizeof...(_Types));
1357 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);1349 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
1358 return std::__generic_get<_Ip>(std::move(__v));1350 return std::__generic_get<_Ip>(std::move(__v));
1359}1351}
13601352
1361template <size_t _Ip, class... _Types>1353template <size_t _Ip, class... _Types>
1362_LIBCPP_HIDE_FROM_ABI constexpr const variant_alternative_t<_Ip, variant<_Types...>>&1354[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const variant_alternative_t<_Ip, variant<_Types...>>&
1363get(const variant<_Types...>& __v) {1355get(const variant<_Types...>& __v) {
1364 static_assert(_Ip < sizeof...(_Types));1356 static_assert(_Ip < sizeof...(_Types));
1365 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);1357 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
...@@ -1367,7 +1359,7 @@ get(const variant<_Types...>& __v) {...@@ -1367,7 +1359,7 @@ get(const variant<_Types...>& __v) {
1367}1359}
13681360
1369template <size_t _Ip, class... _Types>1361template <size_t _Ip, class... _Types>
1370_LIBCPP_HIDE_FROM_ABI constexpr const variant_alternative_t<_Ip, variant<_Types...>>&&1362[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const variant_alternative_t<_Ip, variant<_Types...>>&&
1371get(const variant<_Types...>&& __v) {1363get(const variant<_Types...>&& __v) {
1372 static_assert(_Ip < sizeof...(_Types));1364 static_assert(_Ip < sizeof...(_Types));
1373 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);1365 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
...@@ -1375,25 +1367,25 @@ get(const variant<_Types...>&& __v) {...@@ -1375,25 +1367,25 @@ get(const variant<_Types...>&& __v) {
1375}1367}
13761368
1377template <class _Tp, class... _Types>1369template <class _Tp, class... _Types>
1378_LIBCPP_HIDE_FROM_ABI constexpr _Tp& get(variant<_Types...>& __v) {1370[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& get(variant<_Types...>& __v) {
1379 static_assert(!is_void_v<_Tp>);1371 static_assert(!is_void_v<_Tp>);
1380 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);1372 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
1381}1373}
13821374
1383template <class _Tp, class... _Types>1375template <class _Tp, class... _Types>
1384_LIBCPP_HIDE_FROM_ABI constexpr _Tp&& get(variant<_Types...>&& __v) {1376[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& get(variant<_Types...>&& __v) {
1385 static_assert(!is_void_v<_Tp>);1377 static_assert(!is_void_v<_Tp>);
1386 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(std::move(__v));1378 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(std::move(__v));
1387}1379}
13881380
1389template <class _Tp, class... _Types>1381template <class _Tp, class... _Types>
1390_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& get(const variant<_Types...>& __v) {1382[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& get(const variant<_Types...>& __v) {
1391 static_assert(!is_void_v<_Tp>);1383 static_assert(!is_void_v<_Tp>);
1392 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);1384 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
1393}1385}
13941386
1395template <class _Tp, class... _Types>1387template <class _Tp, class... _Types>
1396_LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& get(const variant<_Types...>&& __v) {1388[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& get(const variant<_Types...>&& __v) {
1397 static_assert(!is_void_v<_Tp>);1389 static_assert(!is_void_v<_Tp>);
1398 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(std::move(__v));1390 return std::get<__find_exactly_one_t<_Tp, _Types...>::value>(std::move(__v));
1399}1391}
...@@ -1405,7 +1397,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto* __generic_get_if(_Vp* __v) noexcept {...@@ -1405,7 +1397,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto* __generic_get_if(_Vp* __v) noexcept {
1405}1397}
14061398
1407template <size_t _Ip, class... _Types>1399template <size_t _Ip, class... _Types>
1408_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<variant_alternative_t<_Ip, variant<_Types...>>>1400[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<variant_alternative_t<_Ip, variant<_Types...>>>
1409get_if(variant<_Types...>* __v) noexcept {1401get_if(variant<_Types...>* __v) noexcept {
1410 static_assert(_Ip < sizeof...(_Types));1402 static_assert(_Ip < sizeof...(_Types));
1411 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);1403 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
...@@ -1413,7 +1405,7 @@ get_if(variant<_Types...>* __v) noexcept {...@@ -1413,7 +1405,7 @@ get_if(variant<_Types...>* __v) noexcept {
1413}1405}
14141406
1415template <size_t _Ip, class... _Types>1407template <size_t _Ip, class... _Types>
1416_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<const variant_alternative_t<_Ip, variant<_Types...>>>1408[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<const variant_alternative_t<_Ip, variant<_Types...>>>
1417get_if(const variant<_Types...>* __v) noexcept {1409get_if(const variant<_Types...>* __v) noexcept {
1418 static_assert(_Ip < sizeof...(_Types));1410 static_assert(_Ip < sizeof...(_Types));
1419 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);1411 static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
...@@ -1421,13 +1413,13 @@ get_if(const variant<_Types...>* __v) noexcept {...@@ -1421,13 +1413,13 @@ get_if(const variant<_Types...>* __v) noexcept {
1421}1413}
14221414
1423template <class _Tp, class... _Types>1415template <class _Tp, class... _Types>
1424_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> get_if(variant<_Types...>* __v) noexcept {1416[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> get_if(variant<_Types...>* __v) noexcept {
1425 static_assert(!is_void_v<_Tp>);1417 static_assert(!is_void_v<_Tp>);
1426 return std::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);1418 return std::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
1427}1419}
14281420
1429template <class _Tp, class... _Types>1421template <class _Tp, class... _Types>
1430_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<const _Tp> get_if(const variant<_Types...>* __v) noexcept {1422[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<const _Tp> get_if(const variant<_Types...>* __v) noexcept {
1431 static_assert(!is_void_v<_Tp>);1423 static_assert(!is_void_v<_Tp>);
1432 return std::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);1424 return std::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
1433}1425}
...@@ -1608,7 +1600,7 @@ struct hash< __enable_hash_helper<variant<_Types...>, remove_const_t<_Types>...>...@@ -1608,7 +1600,7 @@ struct hash< __enable_hash_helper<variant<_Types...>, remove_const_t<_Types>...>
1608 using result_type _LIBCPP_DEPRECATED_IN_CXX17 = size_t;1600 using result_type _LIBCPP_DEPRECATED_IN_CXX17 = size_t;
1609# endif1601# endif
16101602
1611 _LIBCPP_HIDE_FROM_ABI size_t operator()(const variant<_Types...>& __v) const {1603 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const variant<_Types...>& __v) const {
1612 using __variant_detail::__visitation::__variant;1604 using __variant_detail::__visitation::__variant;
1613 size_t __res =1605 size_t __res =
1614 __v.valueless_by_exception()1606 __v.valueless_by_exception()
lib/libcxx/include/version+41-24
...@@ -37,7 +37,8 @@ __cpp_lib_atomic_float 201711L <atomic>...@@ -37,7 +37,8 @@ __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 201806L <atomic>40__cpp_lib_atomic_ref 202411L <atomic>
41 201806L // C++20
41__cpp_lib_atomic_shared_ptr 201711L <atomic>42__cpp_lib_atomic_shared_ptr 201711L <atomic>
42__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>43__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>
43__cpp_lib_atomic_wait 201907L <atomic>44__cpp_lib_atomic_wait 201907L <atomic>
...@@ -62,7 +63,7 @@ __cpp_lib_clamp 201603L <algorithm>...@@ -62,7 +63,7 @@ __cpp_lib_clamp 201603L <algorithm>
62__cpp_lib_common_reference 202302L <type_traits>63__cpp_lib_common_reference 202302L <type_traits>
63__cpp_lib_common_reference_wrapper 202302L <functional>64__cpp_lib_common_reference_wrapper 202302L <functional>
64__cpp_lib_complex_udls 201309L <complex>65__cpp_lib_complex_udls 201309L <complex>
65__cpp_lib_concepts 202002L <concepts>66__cpp_lib_concepts 202207L <concepts>
66__cpp_lib_constexpr_algorithms 202306L <algorithm> <utility>67__cpp_lib_constexpr_algorithms 202306L <algorithm> <utility>
67 201806L // C++2068 201806L // C++20
68__cpp_lib_constexpr_bitset 202207L <bitset>69__cpp_lib_constexpr_bitset 202207L <bitset>
...@@ -70,6 +71,8 @@ __cpp_lib_constexpr_charconv 202207L <charconv>...@@ -70,6 +71,8 @@ __cpp_lib_constexpr_charconv 202207L <charconv>
70__cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib>71__cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib>
71__cpp_lib_constexpr_complex 201711L <complex>72__cpp_lib_constexpr_complex 201711L <complex>
72__cpp_lib_constexpr_dynamic_alloc 201907L <memory>73__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
74__cpp_lib_constexpr_flat_map 202502L <flat_map>
75__cpp_lib_constexpr_flat_set 202502L <flat_set>
73__cpp_lib_constexpr_forward_list 202502L <forward_list>76__cpp_lib_constexpr_forward_list 202502L <forward_list>
74__cpp_lib_constexpr_functional 201907L <functional>77__cpp_lib_constexpr_functional 201907L <functional>
75__cpp_lib_constexpr_iterator 201811L <iterator>78__cpp_lib_constexpr_iterator 201811L <iterator>
...@@ -108,8 +111,8 @@ __cpp_lib_execution 201902L <execution>...@@ -108,8 +111,8 @@ __cpp_lib_execution 201902L <execution>
108 201603L // C++17111 201603L // C++17
109__cpp_lib_expected 202211L <expected>112__cpp_lib_expected 202211L <expected>
110__cpp_lib_filesystem 201703L <filesystem>113__cpp_lib_filesystem 201703L <filesystem>
111__cpp_lib_flat_map 202207L <flat_map>114__cpp_lib_flat_map 202511L <flat_map>
112__cpp_lib_flat_set 202207L <flat_set>115__cpp_lib_flat_set 202511L <flat_set>
113__cpp_lib_format 202110L <format>116__cpp_lib_format 202110L <format>
114__cpp_lib_format_path 202403L <filesystem>117__cpp_lib_format_path 202403L <filesystem>
115__cpp_lib_format_ranges 202207L <format>118__cpp_lib_format_ranges 202207L <format>
...@@ -138,7 +141,8 @@ __cpp_lib_incomplete_container_elements 201505L <forward_list> <...@@ -138,7 +141,8 @@ __cpp_lib_incomplete_container_elements 201505L <forward_list> <
138__cpp_lib_inplace_vector 202406L <inplace_vector>141__cpp_lib_inplace_vector 202406L <inplace_vector>
139__cpp_lib_int_pow2 202002L <bit>142__cpp_lib_int_pow2 202002L <bit>
140__cpp_lib_integer_comparison_functions 202002L <utility>143__cpp_lib_integer_comparison_functions 202002L <utility>
141__cpp_lib_integer_sequence 201304L <utility>144__cpp_lib_integer_sequence 202511L <utility>
145 201304L // C++14
142__cpp_lib_integral_constant_callable 201304L <type_traits>146__cpp_lib_integral_constant_callable 201304L <type_traits>
143__cpp_lib_interpolate 201902L <cmath> <numeric>147__cpp_lib_interpolate 201902L <cmath> <numeric>
144__cpp_lib_invoke 201411L <functional>148__cpp_lib_invoke 201411L <functional>
...@@ -184,7 +188,8 @@ __cpp_lib_nonmember_container_access 201411L <array> <deque>...@@ -184,7 +188,8 @@ __cpp_lib_nonmember_container_access 201411L <array> <deque>
184__cpp_lib_not_fn 202306L <functional>188__cpp_lib_not_fn 202306L <functional>
185 201603L // C++17189 201603L // C++17
186__cpp_lib_null_iterators 201304L <iterator>190__cpp_lib_null_iterators 201304L <iterator>
187__cpp_lib_optional 202110L <optional>191__cpp_lib_optional 202506L <optional>
192 202110L // C++23
188 202106L // C++20193 202106L // C++20
189 201606L // C++17194 201606L // C++17
190__cpp_lib_optional_range_support 202406L <optional>195__cpp_lib_optional_range_support 202406L <optional>
...@@ -205,6 +210,7 @@ __cpp_lib_ranges_chunk_by 202202L <ranges>...@@ -205,6 +210,7 @@ __cpp_lib_ranges_chunk_by 202202L <ranges>
205__cpp_lib_ranges_concat 202403L <ranges>210__cpp_lib_ranges_concat 202403L <ranges>
206__cpp_lib_ranges_contains 202207L <algorithm>211__cpp_lib_ranges_contains 202207L <algorithm>
207__cpp_lib_ranges_find_last 202207L <algorithm>212__cpp_lib_ranges_find_last 202207L <algorithm>
213__cpp_lib_ranges_indices 202506L <ranges>
208__cpp_lib_ranges_iota 202202L <numeric>214__cpp_lib_ranges_iota 202202L <numeric>
209__cpp_lib_ranges_join_with 202202L <ranges>215__cpp_lib_ranges_join_with 202202L <ranges>
210__cpp_lib_ranges_repeat 202207L <ranges>216__cpp_lib_ranges_repeat 202207L <ranges>
...@@ -245,6 +251,7 @@ __cpp_lib_starts_ends_with 201711L <string> <string...@@ -245,6 +251,7 @@ __cpp_lib_starts_ends_with 201711L <string> <string
245__cpp_lib_stdatomic_h 202011L <stdatomic.h>251__cpp_lib_stdatomic_h 202011L <stdatomic.h>
246__cpp_lib_string_contains 202011L <string> <string_view>252__cpp_lib_string_contains 202011L <string> <string_view>
247__cpp_lib_string_resize_and_overwrite 202110L <string>253__cpp_lib_string_resize_and_overwrite 202110L <string>
254__cpp_lib_string_subview 202506L <string> <string_view>
248__cpp_lib_string_udls 201304L <string>255__cpp_lib_string_udls 201304L <string>
249__cpp_lib_string_view 202403L <string> <string_view>256__cpp_lib_string_view 202403L <string> <string_view>
250 201803L // C++20257 201803L // C++20
...@@ -333,13 +340,11 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -333,13 +340,11 @@ __cpp_lib_void_t 201411L <type_traits>
333# define __cpp_lib_clamp 201603L340# define __cpp_lib_clamp 201603L
334# define __cpp_lib_enable_shared_from_this 201603L341# define __cpp_lib_enable_shared_from_this 201603L
335// # define __cpp_lib_execution 201603L342// # define __cpp_lib_execution 201603L
336# if _LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY343# if _LIBCPP_HAS_FILESYSTEM
337# define __cpp_lib_filesystem 201703L344# define __cpp_lib_filesystem 201703L
338# endif345# endif
339# define __cpp_lib_gcd_lcm 201606L346# define __cpp_lib_gcd_lcm 201606L
340# if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)347# define __cpp_lib_hardware_interference_size 201703L
341# define __cpp_lib_hardware_interference_size 201703L
342# endif
343# define __cpp_lib_has_unique_object_representations 201606L348# define __cpp_lib_has_unique_object_representations 201606L
344# define __cpp_lib_hypot 201603L349# define __cpp_lib_hypot 201603L
345# define __cpp_lib_incomplete_container_elements 201505L350# define __cpp_lib_incomplete_container_elements 201505L
...@@ -391,10 +396,8 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -391,10 +396,8 @@ __cpp_lib_void_t 201411L <type_traits>
391# define __cpp_lib_atomic_ref 201806L396# define __cpp_lib_atomic_ref 201806L
392// # define __cpp_lib_atomic_shared_ptr 201711L397// # define __cpp_lib_atomic_shared_ptr 201711L
393# define __cpp_lib_atomic_value_initialization 201911L398# define __cpp_lib_atomic_value_initialization 201911L
394# if _LIBCPP_AVAILABILITY_HAS_SYNC399# define __cpp_lib_atomic_wait 201907L
395# define __cpp_lib_atomic_wait 201907L400# if _LIBCPP_HAS_THREADS
396# endif
397# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC
398# define __cpp_lib_barrier 201907L401# define __cpp_lib_barrier 201907L
399# endif402# endif
400# define __cpp_lib_bind_front 201907L403# define __cpp_lib_bind_front 201907L
...@@ -406,7 +409,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -406,7 +409,7 @@ __cpp_lib_void_t 201411L <type_traits>
406# endif409# endif
407# define __cpp_lib_common_reference 202302L410# define __cpp_lib_common_reference 202302L
408# define __cpp_lib_common_reference_wrapper 202302L411# define __cpp_lib_common_reference_wrapper 202302L
409# define __cpp_lib_concepts 202002L412# define __cpp_lib_concepts 202207L
410# define __cpp_lib_constexpr_algorithms 201806L413# define __cpp_lib_constexpr_algorithms 201806L
411# define __cpp_lib_constexpr_complex 201711L414# define __cpp_lib_constexpr_complex 201711L
412# define __cpp_lib_constexpr_dynamic_alloc 201907L415# define __cpp_lib_constexpr_dynamic_alloc 201907L
...@@ -439,10 +442,10 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -439,10 +442,10 @@ __cpp_lib_void_t 201411L <type_traits>
439// # define __cpp_lib_is_layout_compatible 201907L442// # define __cpp_lib_is_layout_compatible 201907L
440# define __cpp_lib_is_nothrow_convertible 201806L443# define __cpp_lib_is_nothrow_convertible 201806L
441// # define __cpp_lib_is_pointer_interconvertible 201907L444// # define __cpp_lib_is_pointer_interconvertible 201907L
442# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC445# if _LIBCPP_HAS_THREADS
443# define __cpp_lib_jthread 201911L446# define __cpp_lib_jthread 201911L
444# endif447# endif
445# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC448# if _LIBCPP_HAS_THREADS
446# define __cpp_lib_latch 201907L449# define __cpp_lib_latch 201907L
447# endif450# endif
448# define __cpp_lib_list_remove_return_type 201806L451# define __cpp_lib_list_remove_return_type 201806L
...@@ -455,7 +458,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -455,7 +458,7 @@ __cpp_lib_void_t 201411L <type_traits>
455# endif458# endif
456# define __cpp_lib_ranges 202110L459# define __cpp_lib_ranges 202110L
457# define __cpp_lib_remove_cvref 201711L460# define __cpp_lib_remove_cvref 201711L
458# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC461# if _LIBCPP_HAS_THREADS
459# define __cpp_lib_semaphore 201907L462# define __cpp_lib_semaphore 201907L
460# endif463# endif
461# undef __cpp_lib_shared_ptr_arrays464# undef __cpp_lib_shared_ptr_arrays
...@@ -494,8 +497,8 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -494,8 +497,8 @@ __cpp_lib_void_t 201411L <type_traits>
494# define __cpp_lib_constexpr_typeinfo 202106L497# define __cpp_lib_constexpr_typeinfo 202106L
495# define __cpp_lib_containers_ranges 202202L498# define __cpp_lib_containers_ranges 202202L
496# define __cpp_lib_expected 202211L499# define __cpp_lib_expected 202211L
497# define __cpp_lib_flat_map 202207L500# define __cpp_lib_flat_map 202511L
498# define __cpp_lib_flat_set 202207L501# define __cpp_lib_flat_set 202511L
499# define __cpp_lib_format_ranges 202207L502# define __cpp_lib_format_ranges 202207L
500// # define __cpp_lib_formatters 202302L503// # define __cpp_lib_formatters 202302L
501# define __cpp_lib_forward_like 202207L504# define __cpp_lib_forward_like 202207L
...@@ -528,7 +531,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -528,7 +531,7 @@ __cpp_lib_void_t 201411L <type_traits>
528// # define __cpp_lib_ranges_slide 202202L531// # define __cpp_lib_ranges_slide 202202L
529# define __cpp_lib_ranges_starts_ends_with 202106L532# define __cpp_lib_ranges_starts_ends_with 202106L
530# define __cpp_lib_ranges_to_container 202202L533# define __cpp_lib_ranges_to_container 202202L
531// # define __cpp_lib_ranges_zip 202110L534# define __cpp_lib_ranges_zip 202110L
532// # define __cpp_lib_reference_from_temporary 202202L535// # define __cpp_lib_reference_from_temporary 202202L
533// # define __cpp_lib_spanstream 202106L536// # define __cpp_lib_spanstream 202106L
534// # define __cpp_lib_stacktrace 202011L537// # define __cpp_lib_stacktrace 202011L
...@@ -544,18 +547,22 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -544,18 +547,22 @@ __cpp_lib_void_t 201411L <type_traits>
544# define __cpp_lib_aligned_accessor 202411L547# define __cpp_lib_aligned_accessor 202411L
545// # define __cpp_lib_associative_heterogeneous_insertion 202306L548// # define __cpp_lib_associative_heterogeneous_insertion 202306L
546// # define __cpp_lib_atomic_min_max 202403L549// # define __cpp_lib_atomic_min_max 202403L
550# undef __cpp_lib_atomic_ref
551# define __cpp_lib_atomic_ref 202411L
547# undef __cpp_lib_bind_front552# undef __cpp_lib_bind_front
548# define __cpp_lib_bind_front 202306L553# define __cpp_lib_bind_front 202306L
549# define __cpp_lib_bitset 202306L554# define __cpp_lib_bitset 202306L
550# undef __cpp_lib_constexpr_algorithms555# undef __cpp_lib_constexpr_algorithms
551# define __cpp_lib_constexpr_algorithms 202306L556# define __cpp_lib_constexpr_algorithms 202306L
557# define __cpp_lib_constexpr_flat_map 202502L
558# define __cpp_lib_constexpr_flat_set 202502L
552# define __cpp_lib_constexpr_forward_list 202502L559# define __cpp_lib_constexpr_forward_list 202502L
553# define __cpp_lib_constexpr_list 202502L560# define __cpp_lib_constexpr_list 202502L
554# if !defined(_LIBCPP_ABI_VCRUNTIME)561# if !defined(_LIBCPP_ABI_VCRUNTIME)
555# define __cpp_lib_constexpr_new 202406L562# define __cpp_lib_constexpr_new 202406L
556# endif563# endif
557# define __cpp_lib_constexpr_queue 202502L564# define __cpp_lib_constexpr_queue 202502L
558// # define __cpp_lib_constrained_equality 202411L565# define __cpp_lib_constrained_equality 202411L
559// # define __cpp_lib_copyable_function 202306L566// # define __cpp_lib_copyable_function 202306L
560// # define __cpp_lib_debugging 202311L567// # define __cpp_lib_debugging 202311L
561// # define __cpp_lib_default_template_type_for_algorithm_values 202403L568// # define __cpp_lib_default_template_type_for_algorithm_values 202403L
...@@ -575,21 +582,30 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -575,21 +582,30 @@ __cpp_lib_void_t 201411L <type_traits>
575// # define __cpp_lib_generate_random 202403L582// # define __cpp_lib_generate_random 202403L
576// # define __cpp_lib_hazard_pointer 202306L583// # define __cpp_lib_hazard_pointer 202306L
577// # define __cpp_lib_inplace_vector 202406L584// # define __cpp_lib_inplace_vector 202406L
585# undef __cpp_lib_integer_sequence
586# define __cpp_lib_integer_sequence 202511L
578# define __cpp_lib_is_sufficiently_aligned 202411L587# define __cpp_lib_is_sufficiently_aligned 202411L
579# if __has_builtin(__builtin_is_virtual_base_of)588# if __has_builtin(__builtin_is_virtual_base_of)
580# define __cpp_lib_is_virtual_base_of 202406L589# define __cpp_lib_is_virtual_base_of 202406L
581# endif590# endif
582// # define __cpp_lib_is_within_lifetime 202306L591# if __has_builtin(__builtin_is_within_lifetime)
592# define __cpp_lib_is_within_lifetime 202306L
593# endif
583// # define __cpp_lib_linalg 202311L594// # define __cpp_lib_linalg 202311L
584# undef __cpp_lib_mdspan595# undef __cpp_lib_mdspan
585# define __cpp_lib_mdspan 202406L596# define __cpp_lib_mdspan 202406L
586# undef __cpp_lib_not_fn597# undef __cpp_lib_not_fn
587# define __cpp_lib_not_fn 202306L598# define __cpp_lib_not_fn 202306L
588// # define __cpp_lib_optional_range_support 202406L599# undef __cpp_lib_optional
600# define __cpp_lib_optional 202506L
601# if _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
602# define __cpp_lib_optional_range_support 202406L
603# endif
589# undef __cpp_lib_out_ptr604# undef __cpp_lib_out_ptr
590# define __cpp_lib_out_ptr 202311L605# define __cpp_lib_out_ptr 202311L
591// # define __cpp_lib_philox_engine 202406L606// # define __cpp_lib_philox_engine 202406L
592// # define __cpp_lib_ranges_concat 202403L607// # define __cpp_lib_ranges_concat 202403L
608# define __cpp_lib_ranges_indices 202506L
593# define __cpp_lib_ratio 202306L609# define __cpp_lib_ratio 202306L
594// # define __cpp_lib_rcu 202306L610// # define __cpp_lib_rcu 202306L
595# define __cpp_lib_reference_wrapper 202403L611# define __cpp_lib_reference_wrapper 202403L
...@@ -599,6 +615,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -599,6 +615,7 @@ __cpp_lib_void_t 201411L <type_traits>
599# define __cpp_lib_span_at 202311L615# define __cpp_lib_span_at 202311L
600# define __cpp_lib_span_initializer_list 202311L616# define __cpp_lib_span_initializer_list 202311L
601# define __cpp_lib_sstream_from_string_view 202306L617# define __cpp_lib_sstream_from_string_view 202306L
618# define __cpp_lib_string_subview 202506L
602# undef __cpp_lib_string_view619# undef __cpp_lib_string_view
603# define __cpp_lib_string_view 202403L620# define __cpp_lib_string_view 202403L
604// # define __cpp_lib_submdspan 202306L621// # define __cpp_lib_submdspan 202306L
lib/libcxx/include/wctype.h+29-29
...@@ -45,13 +45,14 @@ wctrans_t wctrans(const char* property);...@@ -45,13 +45,14 @@ wctrans_t wctrans(const char* property);
45*/45*/
4646
47#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)47#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
48# include <__cxx03/wctype.h>48# include <__cxx03/__config>
49#else49#else
50# include <__config>50# include <__config>
51#endif
5152
52# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)53#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
53# pragma GCC system_header54# pragma GCC system_header
54# endif55#endif
5556
56// TODO:57// TODO:
57// In the future, we should unconditionally include_next <wctype.h> here and instead58// In the future, we should unconditionally include_next <wctype.h> here and instead
...@@ -62,33 +63,32 @@ wctrans_t wctrans(const char* property);...@@ -62,33 +63,32 @@ wctrans_t wctrans(const char* property);
62// nothing (with using_if_exists), and if we include another header that defines one63// nothing (with using_if_exists), and if we include another header that defines one
63// of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists64// of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists
64// will fail because it does not refer to the same declaration.65// will fail because it does not refer to the same declaration.
65# if __has_include_next(<wctype.h>)66#if __has_include_next(<wctype.h>)
66# include_next <wctype.h>67# include_next <wctype.h>
67# define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H68# define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
68# endif69#endif
6970
70# ifdef __cplusplus71#ifdef __cplusplus
7172
72# undef iswalnum73# undef iswalnum
73# undef iswalpha74# undef iswalpha
74# undef iswblank75# undef iswblank
75# undef iswcntrl76# undef iswcntrl
76# undef iswdigit77# undef iswdigit
77# undef iswgraph78# undef iswgraph
78# undef iswlower79# undef iswlower
79# undef iswprint80# undef iswprint
80# undef iswpunct81# undef iswpunct
81# undef iswspace82# undef iswspace
82# undef iswupper83# undef iswupper
83# undef iswxdigit84# undef iswxdigit
84# undef iswctype85# undef iswctype
85# undef wctype86# undef wctype
86# undef towlower87# undef towlower
87# undef towupper88# undef towupper
88# undef towctrans89# undef towctrans
89# undef wctrans90# undef wctrans
9091
91# endif // __cplusplus92#endif // __cplusplus
92#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
9393
94#endif // _LIBCPP_WCTYPE_H94#endif // _LIBCPP_WCTYPE_H
lib/libcxx/src/any.cpp+4
...@@ -14,6 +14,8 @@ const char* bad_any_cast::what() const noexcept { return "bad any cast"; }...@@ -14,6 +14,8 @@ const char* bad_any_cast::what() const noexcept { return "bad any cast"; }
1414
15#include <__config>15#include <__config>
1616
17#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 7
18
17// Preserve std::experimental::any_bad_cast for ABI compatibility19// Preserve std::experimental::any_bad_cast for ABI compatibility
18// Even though it no longer exists in a header file20// Even though it no longer exists in a header file
19_LIBCPP_BEGIN_NAMESPACE_LFTS21_LIBCPP_BEGIN_NAMESPACE_LFTS
...@@ -25,4 +27,6 @@ public:...@@ -25,4 +27,6 @@ public:
2527
26const char* bad_any_cast::what() const noexcept { return "bad any cast"; }28const char* bad_any_cast::what() const noexcept { return "bad any cast"; }
2729
30#endif
31
28_LIBCPP_END_NAMESPACE_LFTS32_LIBCPP_END_NAMESPACE_LFTS
lib/libcxx/src/atomic.cpp+365-80
...@@ -9,8 +9,13 @@...@@ -9,8 +9,13 @@
9#include <__thread/timed_backoff_policy.h>9#include <__thread/timed_backoff_policy.h>
10#include <atomic>10#include <atomic>
11#include <climits>11#include <climits>
12#include <cstddef>
13#include <cstdint>
14#include <cstring>
12#include <functional>15#include <functional>
16#include <new>
13#include <thread>17#include <thread>
18#include <type_traits>
1419
15#include "include/apple_availability.h"20#include "include/apple_availability.h"
1621
...@@ -41,6 +46,11 @@...@@ -41,6 +46,11 @@
41// OpenBSD has no indirect syscalls46// OpenBSD has no indirect syscalls
42# define _LIBCPP_FUTEX(...) futex(__VA_ARGS__)47# define _LIBCPP_FUTEX(...) futex(__VA_ARGS__)
4348
49#elif defined(_WIN32)
50
51# include <memory>
52# include <windows.h>
53
44#else // <- Add other operating systems here54#else // <- Add other operating systems here
4555
46// Baseline needs no new headers56// Baseline needs no new headers
...@@ -49,17 +59,34 @@...@@ -49,17 +59,34 @@
4959
50#endif60#endif
5161
62_LIBCPP_PUSH_MACROS
63#include <__undef_macros>
64
52_LIBCPP_BEGIN_NAMESPACE_STD65_LIBCPP_BEGIN_NAMESPACE_STD
5366
67struct NoTimeout {};
68
54#ifdef __linux__69#ifdef __linux__
5570
56static void71template <std::size_t _Size, class MaybeTimeout>
57__libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) {72static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
58 static constexpr timespec __timeout = {2, 0};73 static_assert(_Size == 4, "Can only wait on 4 bytes value");
59 _LIBCPP_FUTEX(__ptr, FUTEX_WAIT_PRIVATE, __val, &__timeout, 0, 0);74 alignas(__cxx_contention_t) char buffer[_Size];
75 std::memcpy(&buffer, const_cast<const void*>(__val), _Size);
76 static constexpr timespec __default_timeout = {2, 0};
77 timespec __timeout;
78 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
79 __timeout = __default_timeout;
80 } else {
81 __timeout.tv_sec = maybe_timeout_ns / 1'000'000'000;
82 __timeout.tv_nsec = maybe_timeout_ns % 1'000'000'000;
83 }
84 _LIBCPP_FUTEX(__ptr, FUTEX_WAIT_PRIVATE, *reinterpret_cast<__cxx_contention_t const*>(&buffer), &__timeout, 0, 0);
60}85}
6186
62static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr, bool __notify_one) {87template <std::size_t _Size>
88static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
89 static_assert(_Size == 4, "Can only wake up on 4 bytes value");
63 _LIBCPP_FUTEX(__ptr, FUTEX_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, 0, 0, 0);90 _LIBCPP_FUTEX(__ptr, FUTEX_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, 0, 0, 0);
64}91}
6592
...@@ -70,19 +97,41 @@ extern "C" int __ulock_wait(...@@ -70,19 +97,41 @@ extern "C" int __ulock_wait(
70extern "C" int __ulock_wake(uint32_t operation, void* addr, uint64_t wake_value);97extern "C" int __ulock_wake(uint32_t operation, void* addr, uint64_t wake_value);
7198
72// https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/ulock.h#L8299// https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/ulock.h#L82
100# define UL_COMPARE_AND_WAIT 1
73# define UL_COMPARE_AND_WAIT64 5101# define UL_COMPARE_AND_WAIT64 5
74# define ULF_WAKE_ALL 0x00000100102# define ULF_WAKE_ALL 0x00000100
75103
76static void104template <std::size_t _Size, class MaybeTimeout>
77__libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) {105static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
78 static_assert(sizeof(__cxx_atomic_contention_t) == 8, "Waiting on 8 bytes value");106 static_assert(_Size == 8 || _Size == 4, "Can only wait on 8 bytes or 4 bytes value");
79 __ulock_wait(UL_COMPARE_AND_WAIT64, const_cast<__cxx_atomic_contention_t*>(__ptr), __val, 0);107 auto __timeout_us = [&] {
108 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
109 return uint32_t(0);
110 } else {
111 return std::max(static_cast<uint32_t>(maybe_timeout_ns / 1000), uint32_t(1));
112 }
113 }();
114 if constexpr (_Size == 4) {
115 alignas(uint32_t) char buffer[_Size];
116 std::memcpy(&buffer, const_cast<const void*>(__val), _Size);
117 __ulock_wait(
118 UL_COMPARE_AND_WAIT, const_cast<void*>(__ptr), *reinterpret_cast<uint32_t const*>(&buffer), __timeout_us);
119 } else {
120 alignas(uint64_t) char buffer[_Size];
121 std::memcpy(&buffer, const_cast<const void*>(__val), _Size);
122 __ulock_wait(
123 UL_COMPARE_AND_WAIT64, const_cast<void*>(__ptr), *reinterpret_cast<uint64_t const*>(&buffer), __timeout_us);
124 }
80}125}
81126
82static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr, bool __notify_one) {127template <std::size_t _Size>
83 static_assert(sizeof(__cxx_atomic_contention_t) == 8, "Waking up on 8 bytes value");128static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
84 __ulock_wake(129 static_assert(_Size == 8 || _Size == 4, "Can only wake up on 8 bytes or 4 bytes value");
85 UL_COMPARE_AND_WAIT64 | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<__cxx_atomic_contention_t*>(__ptr), 0);130
131 if constexpr (_Size == 4)
132 __ulock_wake(UL_COMPARE_AND_WAIT | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<void*>(__ptr), 0);
133 else
134 __ulock_wake(UL_COMPARE_AND_WAIT64 | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<void*>(__ptr), 0);
86}135}
87136
88#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8137#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
...@@ -92,119 +141,355 @@ static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const vo...@@ -92,119 +141,355 @@ static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const vo
92 * limit its use to architectures where long and int64_t are synonyms.141 * limit its use to architectures where long and int64_t are synonyms.
93 */142 */
94143
95static void144template <std::size_t _Size, class MaybeTimeout>
96__libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) {145static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
97 _umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr), UMTX_OP_WAIT, __val, nullptr, nullptr);146 static_assert(_Size == 8, "Can only wait on 8 bytes value");
147 // At the moment, FreeBSD is stuck on stable ABI, which only supports platform wait with __cxx_contention_t
148 // It is safe to reinterpret_cast the val as it is ever going to be passed a __cxx_contention_t under this ABI
149 // If in the future FreeBSD decides to experiment unstable ABI to support more types, this cast will no longer be
150 // safe.
151 __cxx_contention_t value = *reinterpret_cast<const __cxx_contention_t*>(__val);
152 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
153 _umtx_op(const_cast<void*>(__ptr), UMTX_OP_WAIT, value, nullptr, nullptr);
154 } else {
155 timespec timeout{};
156 timeout.tv_sec = maybe_timeout_ns / 1'000'000'000;
157 timeout.tv_nsec = maybe_timeout_ns % 1'000'000'000;
158
159 _umtx_op(const_cast<void*>(__ptr),
160 UMTX_OP_WAIT,
161 value,
162 reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(timeout))),
163 &timeout);
164 }
165}
166
167template <std::size_t _Size>
168static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
169 static_assert(_Size == 8, "Can only wake up on 8 bytes value");
170 _umtx_op(const_cast<void*>(__ptr), UMTX_OP_WAKE, __notify_one ? 1 : INT_MAX, nullptr, nullptr);
171}
172
173#elif defined(_WIN32)
174
175static void* win32_get_synch_api_function(const char* function_name) {
176 // Attempt to load the API set. Note that as per the Microsoft STL implementation, we assume this API is already
177 // loaded and accessible. While this isn't explicitly guaranteed by publicly available Win32 API documentation, it is
178 // true in practice, and may be guaranteed by internal documentation not released publicly. In any case the fact that
179 // the Microsoft STL made this assumption is reasonable basis to say that we can too. The alternative to this would be
180 // to use LoadLibrary, but then leak the module handle. We can't call FreeLibrary, as this would have to be triggered
181 // by a global static destructor, which would hang off DllMain, and calling FreeLibrary from DllMain is explicitly
182 // mentioned as not being allowed:
183 // https://learn.microsoft.com/en-us/windows/win32/dlls/dllmain
184 // Given the range of bad options here, we have chosen to mirror what Microsoft did, as it seems fair to assume that
185 // Microsoft will guarantee compatibility for us, as we are exposed to the same conditions as all existing Windows
186 // apps using the Microsoft STL VS2015/2017/2019/2022 runtimes, where Windows 7 support has not been excluded at
187 // compile time.
188 static auto module_handle = GetModuleHandleW(L"api-ms-win-core-synch-l1-2-0.dll");
189 if (module_handle == nullptr) {
190 return nullptr;
191 }
192
193 // Attempt to locate the function in the API and return the result to the caller. Note that the NULL return from this
194 // method is documented as being interchangeable with nullptr.
195 // https://devblogs.microsoft.com/oldnewthing/20180307-00/?p=98175
196 return reinterpret_cast<void*>(GetProcAddress(module_handle, function_name));
98}197}
99198
100static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr, bool __notify_one) {199template <std::size_t _Size, class MaybeTimeout>
101 _umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr), UMTX_OP_WAKE, __notify_one ? 1 : INT_MAX, nullptr, nullptr);200static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
201 static_assert(_Size == 8, "Can only wait on 8 bytes value");
202 // WaitOnAddress was added in Windows 8 (build 9200)
203 static auto wait_on_address =
204 reinterpret_cast<BOOL(WINAPI*)(void*, PVOID, SIZE_T, DWORD)>(win32_get_synch_api_function("WaitOnAddress"));
205 if (wait_on_address != nullptr) {
206 auto timeout_ms = [&]() -> DWORD {
207 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
208 return INFINITE;
209 } else {
210 uint64_t ms = maybe_timeout_ns / 1'000'000;
211 if (ms == 0 && maybe_timeout_ns > 100'000)
212 // Round up to 1ms if requested between 100us - 1ms
213 return 1;
214
215 return static_cast<DWORD>(std::min(static_cast<uint64_t>(INFINITE), ms));
216 }
217 }();
218 wait_on_address(const_cast<void*>(__ptr), const_cast<void*>(__val), _Size, timeout_ms);
219 } else {
220 std::chrono::nanoseconds timeout = std::chrono::nanoseconds(0);
221 if constexpr (!is_same_v<MaybeTimeout, NoTimeout>) {
222 timeout = std::chrono::nanoseconds(maybe_timeout_ns);
223 }
224 __libcpp_thread_poll_with_backoff(
225 [=]() -> bool { return std::memcmp(const_cast<const void*>(__ptr), __val, _Size) != 0; },
226 __libcpp_timed_backoff_policy(),
227 timeout);
228 }
229}
230
231template <std::size_t _Size>
232static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
233 static_assert(_Size == 8, "Can only wake up on 8 bytes value");
234 if (__notify_one) {
235 // WakeByAddressSingle was added in Windows 8 (build 9200)
236 static auto wake_by_address_single =
237 reinterpret_cast<void(WINAPI*)(PVOID)>(win32_get_synch_api_function("WakeByAddressSingle"));
238 if (wake_by_address_single != nullptr) {
239 wake_by_address_single(const_cast<void*>(__ptr));
240 } else {
241 // The fallback implementation of waking does nothing, as the fallback wait implementation just does polling, so
242 // there's nothing to do here.
243 }
244 } else {
245 // WakeByAddressAll was added in Windows 8 (build 9200)
246 static auto wake_by_address_all =
247 reinterpret_cast<void(WINAPI*)(PVOID)>(win32_get_synch_api_function("WakeByAddressAll"));
248 if (wake_by_address_all != nullptr) {
249 wake_by_address_all(const_cast<void*>(__ptr));
250 } else {
251 // The fallback implementation of waking does nothing, as the fallback wait implementation just does polling, so
252 // there's nothing to do here.
253 }
254 }
102}255}
103256
104#else // <- Add other operating systems here257#else // <- Add other operating systems here
105258
106// Baseline is just a timed backoff259// Baseline is just a timed backoff
107260
108static void261template <std::size_t _Size, class MaybeTimeout>
109__libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) {262static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
263 std::chrono::nanoseconds timeout = std::chrono::nanoseconds(0);
264 if constexpr (!is_same_v<MaybeTimeout, NoTimeout>) {
265 timeout = std::chrono::nanoseconds(maybe_timeout_ns);
266 }
110 __libcpp_thread_poll_with_backoff(267 __libcpp_thread_poll_with_backoff(
111 [=]() -> bool { return !__cxx_nonatomic_compare_equal(__cxx_atomic_load(__ptr, memory_order_relaxed), __val); },268 [=]() -> bool { return std::memcmp(const_cast<const void*>(__ptr), __val, _Size) != 0; },
112 __libcpp_timed_backoff_policy());269 __libcpp_timed_backoff_policy(),
270 timeout);
113}271}
114272
115static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile*, bool) {}273template <std::size_t _Size>
274static void __platform_wake_by_address(void const*, bool) {}
116275
117#endif // __linux__276#endif // __linux__
118277
119static constexpr size_t __libcpp_contention_table_size = (1 << 8); /* < there's no magic in this number */278// =============================
120279// Local hidden helper functions
121struct alignas(64) /* aim to avoid false sharing */ __libcpp_contention_table_entry {280// =============================
122 __cxx_atomic_contention_t __contention_state;
123 __cxx_atomic_contention_t __platform_state;
124 inline constexpr __libcpp_contention_table_entry() : __contention_state(0), __platform_state(0) {}
125};
126
127static __libcpp_contention_table_entry __libcpp_contention_table[__libcpp_contention_table_size];
128
129static hash<void const volatile*> __libcpp_contention_hasher;
130
131static __libcpp_contention_table_entry* __libcpp_contention_state(void const volatile* p) {
132 return &__libcpp_contention_table[__libcpp_contention_hasher(p) & (__libcpp_contention_table_size - 1)];
133}
134281
135/* Given an atomic to track contention and an atomic to actually wait on, which may be282/* Given an atomic to track contention and an atomic to actually wait on, which may be
136 the same atomic, we try to detect contention to avoid spuriously calling the platform. */283 the same atomic, we try to detect contention to avoid spuriously calling the platform. */
137284
138static void __libcpp_contention_notify(__cxx_atomic_contention_t volatile* __contention_state,285template <std::size_t _Size>
139 __cxx_atomic_contention_t const volatile* __platform_state,286static void
140 bool __notify_one) {287__contention_notify(__cxx_atomic_contention_t* __waiter_count, void const* __address_to_notify, bool __notify_one) {
141 if (0 != __cxx_atomic_load(__contention_state, memory_order_seq_cst))288 if (0 != __cxx_atomic_load(__waiter_count, memory_order_seq_cst))
142 // We only call 'wake' if we consumed a contention bit here.289 // We only call 'wake' if we consumed a contention bit here.
143 __libcpp_platform_wake_by_address(__platform_state, __notify_one);290 __platform_wake_by_address<_Size>(__address_to_notify, __notify_one);
144}291}
145static __cxx_contention_t292
146__libcpp_contention_monitor_for_wait(__cxx_atomic_contention_t volatile* /*__contention_state*/,293template <std::size_t _Size, class MaybeTimeout>
147 __cxx_atomic_contention_t const volatile* __platform_state) {294static void __contention_wait(__cxx_atomic_contention_t* __waiter_count,
148 // We will monitor this value.295 void const* __address_to_wait,
149 return __cxx_atomic_load(__platform_state, memory_order_acquire);296 void const* __old_value,
150}297 MaybeTimeout maybe_timeout_ns) {
151static void __libcpp_contention_wait(__cxx_atomic_contention_t volatile* __contention_state,298 __cxx_atomic_fetch_add(__waiter_count, __cxx_contention_t(1), memory_order_relaxed);
152 __cxx_atomic_contention_t const volatile* __platform_state,299 // https://llvm.org/PR109290
153 __cxx_contention_t __old_value) {
154 __cxx_atomic_fetch_add(__contention_state, __cxx_contention_t(1), memory_order_relaxed);
155 // https://github.com/llvm/llvm-project/issues/109290
156 // There are no platform guarantees of a memory barrier in the platform wait implementation300 // There are no platform guarantees of a memory barrier in the platform wait implementation
157 __cxx_atomic_thread_fence(memory_order_seq_cst);301 __cxx_atomic_thread_fence(memory_order_seq_cst);
158 // We sleep as long as the monitored value hasn't changed.302 // We sleep as long as the monitored value hasn't changed.
159 __libcpp_platform_wait_on_address(__platform_state, __old_value);303 __platform_wait_on_address<_Size>(__address_to_wait, __old_value, maybe_timeout_ns);
160 __cxx_atomic_fetch_sub(__contention_state, __cxx_contention_t(1), memory_order_release);304 __cxx_atomic_fetch_sub(__waiter_count, __cxx_contention_t(1), memory_order_release);
305}
306
307static constexpr size_t __contention_table_size = (1 << 8); /* < there's no magic in this number */
308
309static constexpr hash<void const*> __contention_hasher;
310
311// Waiter count table for all atomics with the correct size that use itself as the wait/notify address.
312
313struct alignas(
314 std::hardware_constructive_interference_size) /* aim to avoid false sharing */ __contention_state_native {
315 __cxx_atomic_contention_t __waiter_count;
316 constexpr __contention_state_native() : __waiter_count(0) {}
317};
318
319static __contention_state_native __contention_table_native[__contention_table_size];
320
321static __cxx_atomic_contention_t* __get_native_waiter_count(void const* p) {
322 return &__contention_table_native[__contention_hasher(p) & (__contention_table_size - 1)].__waiter_count;
323}
324
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;
332 constexpr __contention_state_global() : __waiter_count(0), __platform_state(0) {}
333};
334
335static __contention_state_global __contention_table_global[__contention_table_size];
336
337static __contention_state_global* __get_global_contention_state(void const* p) {
338 return &__contention_table_global[__contention_hasher(p) & (__contention_table_size - 1)];
161}339}
162340
163/* When the incoming atomic is the wrong size for the platform wait size, need to341/* When the incoming atomic is the wrong size for the platform wait size, need to
164 launder the value sequence through an atomic from our table. */342 launder the value sequence through an atomic from our table. */
165343
166static void __libcpp_atomic_notify(void const volatile* __location) {344static void __atomic_notify_global_table(void const* __location) {
167 auto const __entry = __libcpp_contention_state(__location);345 auto const __entry = __get_global_contention_state(__location);
168 // The value sequence laundering happens on the next line below.346 // The value sequence laundering happens on the next line below.
169 __cxx_atomic_fetch_add(&__entry->__platform_state, __cxx_contention_t(1), memory_order_seq_cst);347 __cxx_atomic_fetch_add(&__entry->__platform_state, __cxx_contention_t(1), memory_order_seq_cst);
170 __libcpp_contention_notify(348 __contention_notify<sizeof(__cxx_atomic_contention_t)>(
171 &__entry->__contention_state,349 &__entry->__waiter_count, &__entry->__platform_state, false /* when laundering, we can't handle notify_one */);
172 &__entry->__platform_state,350}
173 false /* when laundering, we can't handle notify_one */);351
352// =============================
353// New dylib exported symbols
354// =============================
355
356// global
357_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __location) noexcept {
358 auto const __entry = __get_global_contention_state(__location);
359 return __cxx_atomic_load(&__entry->__platform_state, memory_order_acquire);
360}
361
362_LIBCPP_EXPORTED_FROM_ABI void
363__atomic_wait_global_table(void const* __location, __cxx_contention_t __old_value) noexcept {
364 auto const __entry = __get_global_contention_state(__location);
365 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
366 &__entry->__waiter_count, &__entry->__platform_state, &__old_value, NoTimeout{});
367}
368
369_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 {
371 auto const __entry = __get_global_contention_state(__location);
372 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
373 &__entry->__waiter_count, &__entry->__platform_state, &__old_value, __timeout_ns);
374}
375
376_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_global_table(void const* __location) noexcept {
377 __atomic_notify_global_table(__location);
378}
379
380_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_global_table(void const* __location) noexcept {
381 __atomic_notify_global_table(__location);
382}
383
384// native
385
386template <std::size_t _Size>
387_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{});
174}389}
390
391template <std::size_t _Size>
392_LIBCPP_EXPORTED_FROM_ABI void
393__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);
395}
396
397template <std::size_t _Size>
398_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_native(void const* __location) noexcept {
399 __contention_notify<_Size>(__get_native_waiter_count(__location), __location, true);
400}
401
402template <std::size_t _Size>
403_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native(void const* __location) noexcept {
404 __contention_notify<_Size>(__get_native_waiter_count(__location), __location, false);
405}
406
407// ==================================================
408// Instantiation of the templates with supported size
409// ==================================================
410
411#if defined(_LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE)
412
413# define _INSTANTIATE(_SIZE) \
414 template _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_native<_SIZE>(void const*, void const*) noexcept; \
415 template _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_native_with_timeout<_SIZE>( \
416 void const*, void const*, uint64_t) noexcept; \
417 template _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_native<_SIZE>(void const*) noexcept; \
418 template _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native<_SIZE>(void const*) noexcept;
419
420_LIBCPP_NATIVE_PLATFORM_WAIT_SIZES(_INSTANTIATE)
421
422# undef _INSTANTIATE
423
424#else // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
425
426template _LIBCPP_EXPORTED_FROM_ABI void
427__atomic_wait_native<sizeof(__cxx_contention_t)>(void const* __address, void const* __old_value) noexcept;
428
429template _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_native_with_timeout<sizeof(__cxx_contention_t)>(
430 void const* __address, void const* __old_value, uint64_t) noexcept;
431
432template _LIBCPP_EXPORTED_FROM_ABI void
433__atomic_notify_one_native<sizeof(__cxx_contention_t)>(void const* __location) noexcept;
434
435template _LIBCPP_EXPORTED_FROM_ABI void
436__atomic_notify_all_native<sizeof(__cxx_contention_t)>(void const* __location) noexcept;
437
438#endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
439
440// =============================================================
441// Old dylib exported symbols, for backwards compatibility
442// =============================================================
443_LIBCPP_DIAGNOSTIC_PUSH
444_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
445
175_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile* __location) noexcept {446_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile* __location) noexcept {
176 __libcpp_atomic_notify(__location);447 __atomic_notify_global_table(const_cast<void const*>(__location));
177}448}
449
178_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile* __location) noexcept {450_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile* __location) noexcept {
179 __libcpp_atomic_notify(__location);451 __atomic_notify_global_table(const_cast<void const*>(__location));
180}452}
453
181_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile* __location) noexcept {454_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile* __location) noexcept {
182 auto const __entry = __libcpp_contention_state(__location);455 auto const __entry = __get_global_contention_state(const_cast<void const*>(__location));
183 return __libcpp_contention_monitor_for_wait(&__entry->__contention_state, &__entry->__platform_state);456 return __cxx_atomic_load(&__entry->__platform_state, memory_order_acquire);
184}457}
458
185_LIBCPP_EXPORTED_FROM_ABI void459_LIBCPP_EXPORTED_FROM_ABI void
186__libcpp_atomic_wait(void const volatile* __location, __cxx_contention_t __old_value) noexcept {460__libcpp_atomic_wait(void const volatile* __location, __cxx_contention_t __old_value) noexcept {
187 auto const __entry = __libcpp_contention_state(__location);461 auto const __entry = __get_global_contention_state(const_cast<void const*>(__location));
188 __libcpp_contention_wait(&__entry->__contention_state, &__entry->__platform_state, __old_value);462 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
463 &__entry->__waiter_count, &__entry->__platform_state, &__old_value, NoTimeout{});
189}464}
190465
191/* When the incoming atomic happens to be the platform wait size, we still need to use the
192 table for the contention detection, but we can use the atomic directly for the wait. */
193
194_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile* __location) noexcept {466_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile* __location) noexcept {
195 __libcpp_contention_notify(&__libcpp_contention_state(__location)->__contention_state, __location, true);467 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));
468 __contention_notify<sizeof(__cxx_atomic_contention_t)>(
469 __get_native_waiter_count(__location_cast), __location_cast, true);
196}470}
471
197_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile* __location) noexcept {472_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile* __location) noexcept {
198 __libcpp_contention_notify(&__libcpp_contention_state(__location)->__contention_state, __location, false);473 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));
199}474 __contention_notify<sizeof(__cxx_atomic_contention_t)>(
200// This function is never used, but still exported for ABI compatibility.475 __get_native_waiter_count(__location_cast), __location_cast, false);
201_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
202__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile* __location) noexcept {
203 return __libcpp_contention_monitor_for_wait(&__libcpp_contention_state(__location)->__contention_state, __location);
204}476}
477
205_LIBCPP_EXPORTED_FROM_ABI void478_LIBCPP_EXPORTED_FROM_ABI void
206__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx_contention_t __old_value) noexcept {479__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx_contention_t __old_value) noexcept {
207 __libcpp_contention_wait(&__libcpp_contention_state(__location)->__contention_state, __location, __old_value);480 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));
481 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
482 __get_native_waiter_count(__location_cast), __location_cast, &__old_value, NoTimeout{});
208}483}
209484
485// this function is even unused in the old ABI
486_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
487__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile* __location) noexcept {
488 return __cxx_atomic_load(__location, memory_order_acquire);
489}
490
491_LIBCPP_DIAGNOSTIC_POP
492
210_LIBCPP_END_NAMESPACE_STD493_LIBCPP_END_NAMESPACE_STD
494
495_LIBCPP_POP_MACROS
lib/libcxx/src/barrier.cpp+4-3
...@@ -60,11 +60,12 @@ public:...@@ -60,11 +60,12 @@ public:
60_LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorithm_base(ptrdiff_t& __expected) {60_LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorithm_base(ptrdiff_t& __expected) {
61 return new __barrier_algorithm_base(__expected);61 return new __barrier_algorithm_base(__expected);
62}62}
63_LIBCPP_EXPORTED_FROM_ABI bool63_LIBCPP_EXPORTED_FROM_ABI bool __arrive_barrier_algorithm_base(
64__arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase) noexcept {64 _LIBCPP_NOESCAPE __barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase) noexcept {
65 return __barrier->__arrive(__old_phase);65 return __barrier->__arrive(__old_phase);
66}66}
67_LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier) noexcept {67_LIBCPP_EXPORTED_FROM_ABI void
68__destroy_barrier_algorithm_base(_LIBCPP_NOESCAPE __barrier_algorithm_base* __barrier) noexcept {
68 delete __barrier;69 delete __barrier;
69}70}
7071
lib/libcxx/src/charconv.cpp+6-3
...@@ -14,17 +14,20 @@...@@ -14,17 +14,20 @@
1414
15_LIBCPP_BEGIN_NAMESPACE_STD15_LIBCPP_BEGIN_NAMESPACE_STD
1616
17#ifndef _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_1017#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
1818
19namespace __itoa {19namespace __itoa {
2020
21_LIBCPP_DIAGNOSTIC_PUSH
22_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
23// These functions exist for ABI compatibility, so we don't ever want a declaration prior to the definition.
21_LIBCPP_EXPORTED_FROM_ABI char* __u32toa(uint32_t value, char* buffer) noexcept { return __base_10_u32(buffer, value); }24_LIBCPP_EXPORTED_FROM_ABI char* __u32toa(uint32_t value, char* buffer) noexcept { return __base_10_u32(buffer, value); }
22
23_LIBCPP_EXPORTED_FROM_ABI char* __u64toa(uint64_t value, char* buffer) noexcept { return __base_10_u64(buffer, value); }25_LIBCPP_EXPORTED_FROM_ABI char* __u64toa(uint64_t value, char* buffer) noexcept { return __base_10_u64(buffer, value); }
26_LIBCPP_DIAGNOSTIC_POP
2427
25} // namespace __itoa28} // namespace __itoa
2629
27#endif // _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_1030#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
2831
29// The original version of floating-point to_chars was written by Microsoft and32// The original version of floating-point to_chars was written by Microsoft and
30// contributed with the following license.33// contributed with the following license.
lib/libcxx/src/condition_variable_destructor.cpp+1-1
...@@ -14,7 +14,7 @@...@@ -14,7 +14,7 @@
14#include <__config>14#include <__config>
15#include <__thread/support.h>15#include <__thread/support.h>
1616
17#if _LIBCPP_ABI_VERSION == 1 || !_LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION17#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 9 || !_LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
18# define NEEDS_CONDVAR_DESTRUCTOR18# define NEEDS_CONDVAR_DESTRUCTOR
19#endif19#endif
2020
lib/libcxx/src/error_category.cpp+3-1
...@@ -8,7 +8,9 @@...@@ -8,7 +8,9 @@
88
9#include <__config>9#include <__config>
1010
11#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS11// This has technically been removed in LLVM 3.4
12#if !defined(_LIBCPP_OBJECT_FORMAT_COFF) && !defined(_LIBCPP_OBJECT_FORMAT_XCOFF) && \
13 _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 4
12# define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS14# define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS
13#endif15#endif
1416
lib/libcxx/src/exception.cpp+2-10
...@@ -9,20 +9,12 @@...@@ -9,20 +9,12 @@
9#define _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION9#define _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION
10#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS10#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
1111
12#include <exception>12#include <__config>
13#include <new>
14#include <typeinfo>
15
16#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
17# include <cxxabi.h>
18using namespace __cxxabiv1;
19# define HAVE_DEPENDENT_EH_ABI 1
20#endif
2113
22#if defined(_LIBCPP_ABI_MICROSOFT)14#if defined(_LIBCPP_ABI_MICROSOFT)
23# include "support/runtime/exception_msvc.ipp"15# include "support/runtime/exception_msvc.ipp"
24# include "support/runtime/exception_pointer_msvc.ipp"16# include "support/runtime/exception_pointer_msvc.ipp"
25#elif defined(_LIBCPPABI_VERSION)17#elif defined(LIBCXX_BUILDING_LIBCXXABI)
26# include "support/runtime/exception_libcxxabi.ipp"18# include "support/runtime/exception_libcxxabi.ipp"
27# include "support/runtime/exception_pointer_cxxabi.ipp"19# include "support/runtime/exception_pointer_cxxabi.ipp"
28#elif defined(LIBCXXRT)20#elif defined(LIBCXXRT)
lib/libcxx/src/experimental/time_zone.cpp+1-1
...@@ -720,7 +720,7 @@ __get_sys_info(sys_seconds __time,...@@ -720,7 +720,7 @@ __get_sys_info(sys_seconds __time,
720// Iff the "offsets" are the same '__current.__end' is replaced with720// Iff the "offsets" are the same '__current.__end' is replaced with
721// '__next.__end', which effectively merges the two objects in one object. The721// '__next.__end', which effectively merges the two objects in one object. The
722// function returns true if a merge occurred.722// function returns true if a merge occurred.
723[[nodiscard]] bool __merge_continuation(sys_info& __current, const sys_info& __next) {723[[nodiscard]] static bool __merge_continuation(sys_info& __current, const sys_info& __next) {
724 if (__current.end != __next.begin)724 if (__current.end != __next.begin)
725 return false;725 return false;
726726
lib/libcxx/src/experimental/tzdb.cpp+4-1
...@@ -49,6 +49,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -49,6 +49,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4949
50namespace chrono {50namespace chrono {
5151
52_LIBCPP_DIAGNOSTIC_PUSH
53_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
52// This function is weak so it can be overriden in the tests. The54// This function is weak so it can be overriden in the tests. The
53// declaration is in the test header test/support/test_tzdb.h55// declaration is in the test header test/support/test_tzdb.h
54_LIBCPP_WEAK string_view __libcpp_tzdb_directory() {56_LIBCPP_WEAK string_view __libcpp_tzdb_directory() {
...@@ -59,6 +61,7 @@ _LIBCPP_WEAK string_view __libcpp_tzdb_directory() {...@@ -59,6 +61,7 @@ _LIBCPP_WEAK string_view __libcpp_tzdb_directory() {
59 abort();61 abort();
60#endif62#endif
61}63}
64_LIBCPP_DIAGNOSTIC_POP
6265
63//===----------------------------------------------------------------------===//66//===----------------------------------------------------------------------===//
64// Details67// Details
...@@ -767,7 +770,7 @@ void __init_tzdb(tzdb& __tzdb, __tz::__rules_storage_type& __rules) {...@@ -767,7 +770,7 @@ void __init_tzdb(tzdb& __tzdb, __tz::__rules_storage_type& __rules) {
767 // On Linux systems it seems /etc/timezone is deprecated and being phased out.770 // On Linux systems it seems /etc/timezone is deprecated and being phased out.
768 // This file is used when /etc/localtime does not exist, or when it exists but771 // This file is used when /etc/localtime does not exist, or when it exists but
769 // is not a symlink. For more information and links see772 // is not a symlink. For more information and links see
770 // https://github.com/llvm/llvm-project/issues/105634773 // https://llvm.org/PR105634
771774
772 string __name = chrono::__current_zone_environment();775 string __name = chrono::__current_zone_environment();
773776
lib/libcxx/src/filesystem/error.h+4-22
...@@ -128,17 +128,8 @@ struct ErrorHandler {...@@ -128,17 +128,8 @@ struct ErrorHandler {
128 T report(const error_code& ec, const char* msg, ...) const {128 T report(const error_code& ec, const char* msg, ...) const {
129 va_list ap;129 va_list ap;
130 va_start(ap, msg);130 va_start(ap, msg);
131#if _LIBCPP_HAS_EXCEPTIONS131 __scope_guard guard([&] { va_end(ap); });
132 try {132 report_impl(ec, msg, ap);
133#endif // _LIBCPP_HAS_EXCEPTIONS
134 report_impl(ec, msg, ap);
135#if _LIBCPP_HAS_EXCEPTIONS
136 } catch (...) {
137 va_end(ap);
138 throw;
139 }
140#endif // _LIBCPP_HAS_EXCEPTIONS
141 va_end(ap);
142 return error_value<T>();133 return error_value<T>();
143 }134 }
144135
...@@ -148,17 +139,8 @@ struct ErrorHandler {...@@ -148,17 +139,8 @@ struct ErrorHandler {
148 T report(errc const& err, const char* msg, ...) const {139 T report(errc const& err, const char* msg, ...) const {
149 va_list ap;140 va_list ap;
150 va_start(ap, msg);141 va_start(ap, msg);
151#if _LIBCPP_HAS_EXCEPTIONS142 __scope_guard guard([&] { va_end(ap); });
152 try {143 report_impl(make_error_code(err), msg, ap);
153#endif // _LIBCPP_HAS_EXCEPTIONS
154 report_impl(make_error_code(err), msg, ap);
155#if _LIBCPP_HAS_EXCEPTIONS
156 } catch (...) {
157 va_end(ap);
158 throw;
159 }
160#endif // _LIBCPP_HAS_EXCEPTIONS
161 va_end(ap);
162 return error_value<T>();144 return error_value<T>();
163 }145 }
164146
lib/libcxx/src/filesystem/format_string.h+9-18
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__assert>12#include <__assert>
13#include <__config>13#include <__config>
14#include <__utility/scope_guard.h>
14#include <array>15#include <array>
15#include <cstdarg>16#include <cstdarg>
16#include <cstddef>17#include <cstddef>
...@@ -34,20 +35,19 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 0) string vformat_string(const ch...@@ -34,20 +35,19 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 0) string vformat_string(const ch
3435
35 va_list apcopy;36 va_list apcopy;
36 va_copy(apcopy, ap);37 va_copy(apcopy, ap);
37 int ret = ::vsnprintf(buf.data(), buf.size(), msg, apcopy);38 int size = ::vsnprintf(buf.data(), buf.size(), msg, apcopy);
38 va_end(apcopy);39 va_end(apcopy);
3940
40 string result;41 string result;
41 if (static_cast<size_t>(ret) < buf.size()) {42 if (static_cast<size_t>(size) < buf.size()) {
42 result.assign(buf.data(), static_cast<size_t>(ret));43 result.assign(buf.data(), static_cast<size_t>(size));
43 } else {44 } else {
44 // we did not provide a long enough buffer on our first attempt. The45 // we did not provide a long enough buffer on our first attempt. The
45 // return value is the number of bytes (excluding the null byte) that are46 // return value is the number of bytes (excluding the null byte) that are
46 // needed for formatting.47 // needed for formatting.
47 size_t size_with_null = static_cast<size_t>(ret) + 1;48 result.resize_and_overwrite(size, [&](char* res, size_t n) { return ::vsnprintf(res, n, msg, ap); });
48 result.__resize_default_init(size_with_null - 1);49 _LIBCPP_ASSERT_INTERNAL(static_cast<size_t>(size) == result.size(),
49 ret = ::vsnprintf(&result[0], size_with_null, msg, ap);50 "vsnprintf did not result in the same number of characters as the first attempt?");
50 _LIBCPP_ASSERT_INTERNAL(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
51 }51 }
52 return result;52 return result;
53}53}
...@@ -56,17 +56,8 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) string format_string(const cha...@@ -56,17 +56,8 @@ inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) string format_string(const cha
56 string ret;56 string ret;
57 va_list ap;57 va_list ap;
58 va_start(ap, msg);58 va_start(ap, msg);
59#if _LIBCPP_HAS_EXCEPTIONS59 __scope_guard guard([&] { va_end(ap); });
60 try {60 ret = detail::vformat_string(msg, ap);
61#endif // _LIBCPP_HAS_EXCEPTIONS
62 ret = detail::vformat_string(msg, ap);
63#if _LIBCPP_HAS_EXCEPTIONS
64 } catch (...) {
65 va_end(ap);
66 throw;
67 }
68#endif // _LIBCPP_HAS_EXCEPTIONS
69 va_end(ap);
70 return ret;61 return ret;
71}62}
7263
lib/libcxx/src/filesystem/int128_builtins.cpp+2
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16#include <__config>16#include <__config>
17#include <climits>17#include <climits>
1818
19_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes") // See the FIXME above
20
19#if _LIBCPP_HAS_INT12821#if _LIBCPP_HAS_INT128
2022
21extern "C" __attribute__((no_sanitize("undefined"))) _LIBCPP_EXPORTED_FROM_ABI __int128_t23extern "C" __attribute__((no_sanitize("undefined"))) _LIBCPP_EXPORTED_FROM_ABI __int128_t
lib/libcxx/src/filesystem/operations.cpp+2-9
...@@ -41,17 +41,10 @@...@@ -41,17 +41,10 @@
41#include <time.h>41#include <time.h>
4242
43// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc >= 2.27 and musl43// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc >= 2.27 and musl
44#if defined(__linux__)44#if _LIBCPP_GLIBC_PREREQ(2, 27) || _LIBCPP_HAS_MUSL_LIBC || defined(__FreeBSD__)
45# if defined(_LIBCPP_GLIBC_PREREQ)
46# if _LIBCPP_GLIBC_PREREQ(2, 27)
47# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
48# endif
49# elif _LIBCPP_HAS_MUSL_LIBC
50# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
51# endif
52#elif defined(__FreeBSD__)
53# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE45# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
54#endif46#endif
47
55#if __has_include(<sys/sendfile.h>)48#if __has_include(<sys/sendfile.h>)
56# include <sys/sendfile.h>49# include <sys/sendfile.h>
57# define _LIBCPP_FILESYSTEM_USE_SENDFILE50# define _LIBCPP_FILESYSTEM_USE_SENDFILE
lib/libcxx/src/filesystem/path.cpp+3-1
...@@ -292,7 +292,9 @@ path path::lexically_relative(const path& base) const {...@@ -292,7 +292,9 @@ path path::lexically_relative(const path& base) const {
292 // return a path constructed with 'n' dot-dot elements, followed by the292 // return a path constructed with 'n' dot-dot elements, followed by the
293 // elements of '*this' after the mismatch.293 // elements of '*this' after the mismatch.
294 path Result;294 path Result;
295 // FIXME: Reserve enough room in Result that it won't have to re-allocate.295 constexpr size_t ElemSize = 2; // ".."
296 constexpr size_t SeparatorSize = 1; // separator is always a single char
297 Result.__reserve(ElemCount * (ElemSize + SeparatorSize) + SeparatorSize + PP.Path.size());
296 while (ElemCount--)298 while (ElemCount--)
297 Result /= PATHSTR("..");299 Result /= PATHSTR("..");
298 for (; PP; ++PP)300 for (; PP; ++PP)
lib/libcxx/src/include/aligned_alloc.h created+65
...@@ -0,0 +1,65 @@
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_ALIGNED_ALLOC_H
10#define _LIBCPP_SRC_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
33// Android only provides aligned_alloc when targeting API 28 or higher.
34# elif !defined(__ANDROID__) || __ANDROID_API__ >= 28
35 // aligned_alloc() requires that __size is a multiple of __alignment,
36 // but for C++ [new.delete.general], only states "if the value of an
37 // alignment argument passed to any of these functions is not a valid
38 // alignment value, the behavior is undefined".
39 // To handle calls such as ::operator new(1, std::align_val_t(128)), we
40 // round __size up to the next multiple of __alignment.
41 size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
42 // Rounding up could have wrapped around to zero, so we have to add another
43 // max() ternary to the actual call site to avoid succeeded in that case.
44 return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
45# else
46 void* __result = nullptr;
47 (void)::posix_memalign(&__result, __alignment, __size);
48 // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
49 return __result;
50# endif
51}
52
53inline _LIBCPP_HIDE_FROM_ABI void __libcpp_aligned_free(void* __ptr) {
54# if defined(_LIBCPP_MSVCRT_LIKE)
55 ::_aligned_free(__ptr);
56# else
57 ::free(__ptr);
58# endif
59}
60
61#endif // _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
62
63_LIBCPP_END_NAMESPACE_STD
64
65#endif // _LIBCPP_SRC_ALIGNED_ALLOC_H
lib/libcxx/src/include/config_elast.h+1-1
...@@ -23,7 +23,7 @@...@@ -23,7 +23,7 @@
23# define _LIBCPP_ELAST ELAST23# define _LIBCPP_ELAST ELAST
24#elif defined(__LLVM_LIBC__)24#elif defined(__LLVM_LIBC__)
25// No _LIBCPP_ELAST needed for LLVM libc25// No _LIBCPP_ELAST needed for LLVM libc
26#elif defined(_NEWLIB_VERSION)26#elif _LIBCPP_LIBC_NEWLIB
27# define _LIBCPP_ELAST __ELASTERROR27# define _LIBCPP_ELAST __ELASTERROR
28#elif defined(__NuttX__)28#elif defined(__NuttX__)
29// No _LIBCPP_ELAST needed on NuttX29// No _LIBCPP_ELAST needed on NuttX
lib/libcxx/src/include/from_chars_floating_point.h+11-7
...@@ -9,11 +9,6 @@...@@ -9,11 +9,6 @@
9#ifndef _LIBCPP_SRC_INCLUDE_FROM_CHARS_FLOATING_POINT_H9#ifndef _LIBCPP_SRC_INCLUDE_FROM_CHARS_FLOATING_POINT_H
10#define _LIBCPP_SRC_INCLUDE_FROM_CHARS_FLOATING_POINT_H10#define _LIBCPP_SRC_INCLUDE_FROM_CHARS_FLOATING_POINT_H
1111
12// These headers are in the shared LLVM-libc header library.
13#include "shared/fp_bits.h"
14#include "shared/str_to_float.h"
15#include "shared/str_to_integer.h"
16
17#include <__assert>12#include <__assert>
18#include <__config>13#include <__config>
19#include <cctype>14#include <cctype>
...@@ -21,6 +16,15 @@...@@ -21,6 +16,15 @@
21#include <concepts>16#include <concepts>
22#include <limits>17#include <limits>
2318
19// Make sure we use libc++'s assertion machinery within the shared code we use
20// from LLVM libc.
21#define LIBC_ASSERT(cond) _LIBCPP_ASSERT((cond), _LIBCPP_TOSTRING(cond))
22
23// These headers are in the shared LLVM-libc header library.
24#include "shared/fp_bits.h"
25#include "shared/str_to_float.h"
26#include "shared/str_to_integer.h"
27
24// Included for the _Floating_type_traits class28// Included for the _Floating_type_traits class
25#include "to_chars_floating_point.h"29#include "to_chars_floating_point.h"
2630
...@@ -193,7 +197,7 @@ struct __exponent_result {...@@ -193,7 +197,7 @@ struct __exponent_result {
193// __offset, 0, false. This allows using the results unconditionally, the197// __offset, 0, false. This allows using the results unconditionally, the
194// __present is important for the scientific notation, where the value is198// __present is important for the scientific notation, where the value is
195// mandatory.199// mandatory.
196__exponent_result __parse_exponent(const char* __input, size_t __n, size_t __offset, char __marker) {200static __exponent_result __parse_exponent(const char* __input, size_t __n, size_t __offset, char __marker) {
197 if (__offset + 1 < __n && // an exponent always needs at least one digit.201 if (__offset + 1 < __n && // an exponent always needs at least one digit.
198 std::tolower(__input[__offset]) == __marker && //202 std::tolower(__input[__offset]) == __marker && //
199 !std::isspace(__input[__offset + 1]) // leading whitespace is not allowed.203 !std::isspace(__input[__offset + 1]) // leading whitespace is not allowed.
...@@ -213,7 +217,7 @@ __exponent_result __parse_exponent(const char* __input, size_t __n, size_t __off...@@ -213,7 +217,7 @@ __exponent_result __parse_exponent(const char* __input, size_t __n, size_t __off
213}217}
214218
215// Here we do this operation as int64 to avoid overflow.219// Here we do this operation as int64 to avoid overflow.
216int32_t __merge_exponents(int64_t __fractional, int64_t __exponent, int __max_biased_exponent) {220static int32_t __merge_exponents(int64_t __fractional, int64_t __exponent, int __max_biased_exponent) {
217 int64_t __sum = __fractional + __exponent;221 int64_t __sum = __fractional + __exponent;
218222
219 if (__sum > __max_biased_exponent)223 if (__sum > __max_biased_exponent)
lib/libcxx/src/include/overridable_function.h+8-10
...@@ -29,12 +29,12 @@...@@ -29,12 +29,12 @@
29// This is a low-level utility which does not work on all platforms, since it needs29// This is a low-level utility which does not work on all platforms, since it needs
30// to make assumptions about the object file format in use. Furthermore, it requires30// to make assumptions about the object file format in use. Furthermore, it requires
31// the "base definition" of the function (the one we want to check whether it has been31// the "base definition" of the function (the one we want to check whether it has been
32// overridden) to be defined using the _LIBCPP_OVERRIDABLE_FUNCTION macro.32// overridden) to be defined using the OVERRIDABLE_FUNCTION macro.
33//33//
34// This currently works with Mach-O files (used on Darwin) and with ELF files (used on Linux34// This currently works with Mach-O files (used on Darwin) and with ELF files (used on Linux
35// and others). On platforms where we know how to implement this detection, the macro35// and others). On platforms where we know how to implement this detection, the macro
36// _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION is defined to 1, and it is defined to 0 on36// _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION is defined to 1, and it is defined to 0 on
37// other platforms. The _LIBCPP_OVERRIDABLE_FUNCTION macro is defined to perform a normal37// other platforms. The OVERRIDABLE_FUNCTION macro is defined to perform a normal
38// function definition on unsupported platforms so that it can be used to define functions38// function definition on unsupported platforms so that it can be used to define functions
39// regardless of whether detection is actually supported.39// regardless of whether detection is actually supported.
40//40//
...@@ -44,7 +44,7 @@...@@ -44,7 +44,7 @@
44// Let's say we want to check whether a weak function `f` has been overridden by the user.44// 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)45// The general mechanism works by placing `f`'s definition (in the libc++ built library)
46// inside a special section, which we do using the `__section__` attribute via the46// inside a special section, which we do using the `__section__` attribute via the
47// _LIBCPP_OVERRIDABLE_FUNCTION macro.47// OVERRIDABLE_FUNCTION macro.
48//48//
49// Then, when comes the time to check whether the function has been overridden, we take49// Then, when comes the time to check whether the function has been overridden, we take
50// the address of the function and we check whether it falls inside the special function50// the address of the function and we check whether it falls inside the special function
...@@ -66,11 +66,10 @@...@@ -66,11 +66,10 @@
66#if defined(_LIBCPP_OBJECT_FORMAT_MACHO)66#if defined(_LIBCPP_OBJECT_FORMAT_MACHO)
6767
68# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 168# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
69# define _LIBCPP_OVERRIDABLE_FUNCTION(type, name, arglist) \69# define OVERRIDABLE_FUNCTION \
70 __attribute__((__section__("__TEXT,__lcxx_override,regular,pure_instructions"))) _LIBCPP_WEAK type name arglist70 __attribute__((__section__("__TEXT,__lcxx_override,regular,pure_instructions"))) _LIBCPP_WEAK
7171
72_LIBCPP_BEGIN_NAMESPACE_STD72_LIBCPP_BEGIN_NAMESPACE_STD template <typename T, T* _Func>
73template <typename T, T* _Func>
74_LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {73_LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {
75 // Declare two dummy bytes and give them these special `__asm` values. These values are74 // Declare two dummy bytes and give them these special `__asm` values. These values are
76 // defined by the linker, which means that referring to `&__lcxx_override_start` will75 // defined by the linker, which means that referring to `&__lcxx_override_start` will
...@@ -100,8 +99,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -100,8 +99,7 @@ _LIBCPP_END_NAMESPACE_STD
100#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__)99#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__)
101100
102# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1101# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
103# define _LIBCPP_OVERRIDABLE_FUNCTION(type, name, arglist) \102# define OVERRIDABLE_FUNCTION __attribute__((__section__("__lcxx_override"))) _LIBCPP_WEAK
104 __attribute__((__section__("__lcxx_override"))) _LIBCPP_WEAK type name arglist
105103
106// This is very similar to what we do for Mach-O above. The ELF linker will implicitly define104// This is very similar to what we do for Mach-O above. The ELF linker will implicitly define
107// variables with those names corresponding to the start and the end of the section.105// variables with those names corresponding to the start and the end of the section.
...@@ -129,7 +127,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -129,7 +127,7 @@ _LIBCPP_END_NAMESPACE_STD
129#else127#else
130128
131# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 0129# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 0
132# define _LIBCPP_OVERRIDABLE_FUNCTION(type, name, arglist) _LIBCPP_WEAK type name arglist130# define OVERRIDABLE_FUNCTION _LIBCPP_WEAK
133131
134#endif132#endif
135133
lib/libcxx/src/iostream.cpp+56-37
...@@ -16,24 +16,40 @@...@@ -16,24 +16,40 @@
1616
17_LIBCPP_BEGIN_NAMESPACE_STD17_LIBCPP_BEGIN_NAMESPACE_STD
1818
19// 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// For that reason, we have `stream` and `stream_data` separated into two objects. The public `stream` objects only
22// contain the actual stream, while the private `stream_data` objects contains the `basic_streambuf` we're using as well
23// as the mbstate_t. `stream_data` objects are only accessible within the library, so they aren't ABI sensitive and we
24// can change them as we want.
25
26template <class StreamT>
27union stream {
28 constexpr stream() {}
29 stream(const stream&) = delete;
30 stream& operator=(const stream&) = delete;
31 constexpr ~stream() {}
32
33 StreamT value;
34};
35
19template <class StreamT, class BufferT>36template <class StreamT, class BufferT>
20union stream_data {37union stream_data {
21 constexpr stream_data() {}38 constexpr stream_data() {}
22 constexpr ~stream_data() {}39 constexpr ~stream_data() {}
23 struct {40 struct {
24 // The stream has to be the first element, since that's referenced by the stream declarations in <iostream>
25 StreamT stream;
26 BufferT buffer;41 BufferT buffer;
27 mbstate_t mb;42 mbstate_t mb;
28 };43 };
29
30 void init(FILE* stdstream) {
31 mb = {};
32 std::construct_at(&buffer, stdstream, &mb);
33 std::construct_at(&stream, &buffer);
34 }
35};44};
3645
46template <class StreamT, class BufferT>
47void init_stream(FILE* stdstream, stream<StreamT>& stream, stream_data<StreamT, BufferT>& data) {
48 data.mb = {};
49 std::construct_at(&data.buffer, stdstream, &data.mb);
50 std::construct_at(&stream.value, &data.buffer);
51}
52
37#define CHAR_MANGLING_char "D"53#define CHAR_MANGLING_char "D"
38#define CHAR_MANGLING_wchar_t "_W"54#define CHAR_MANGLING_wchar_t "_W"
39#define CHAR_MANGLING(CharT) CHAR_MANGLING_##CharT55#define CHAR_MANGLING(CharT) CHAR_MANGLING_##CharT
...@@ -46,25 +62,28 @@ union stream_data {...@@ -46,25 +62,28 @@ union stream_data {
4662
47#ifdef _LIBCPP_ABI_MICROSOFT63#ifdef _LIBCPP_ABI_MICROSOFT
48# define STREAM(StreamT, BufferT, CharT, var) \64# define STREAM(StreamT, BufferT, CharT, var) \
49 STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var __asm__( \65 STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var##_data; \
66 _LIBCPP_EXPORTED_FROM_ABI STRING_DATA_CONSTINIT stream<StreamT<CharT>> var __asm__( \
50 "?" #var "@" ABI_NAMESPACE_STR "@std@@3V?$" #StreamT \67 "?" #var "@" ABI_NAMESPACE_STR "@std@@3V?$" #StreamT \
51 "@" CHAR_MANGLING(CharT) "U?$char_traits@" CHAR_MANGLING(CharT) "@" ABI_NAMESPACE_STR "@std@@@12@A")68 "@" CHAR_MANGLING(CharT) "U?$char_traits@" CHAR_MANGLING(CharT) "@" ABI_NAMESPACE_STR "@std@@@12@A")
52#else69#else
53# define STREAM(StreamT, BufferT, CharT, var) STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var70# define STREAM(StreamT, BufferT, CharT, var) \
71 STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var##_data; \
72 _LIBCPP_EXPORTED_FROM_ABI STRING_DATA_CONSTINIT stream<StreamT<CharT>> var
54#endif73#endif
5574
56// These definitions and the declarations in <iostream> technically cause ODR violations, since they have different75// These definitions and the declarations in <iostream> technically cause ODR violations, since they have different
57// types (stream_data and {i,o}stream respectively). This means that <iostream> should never be included in this TU.76// types (stream_data and {i,o}stream respectively). This means that <iostream> should never be included in this TU.
5877
59_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_istream, __stdinbuf, char, cin);78STREAM(basic_istream, __stdinbuf, char, cin);
60_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_ostream, __stdoutbuf, char, cout);79STREAM(basic_ostream, __stdoutbuf, char, cout);
61_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_ostream, __stdoutbuf, char, cerr);80STREAM(basic_ostream, __stdoutbuf, char, cerr);
62_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_ostream, __stdoutbuf, char, clog);81STREAM(basic_ostream, __stdoutbuf, char, clog);
63#if _LIBCPP_HAS_WIDE_CHARACTERS82#if _LIBCPP_HAS_WIDE_CHARACTERS
64_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_istream, __stdinbuf, wchar_t, wcin);83STREAM(basic_istream, __stdinbuf, wchar_t, wcin);
65_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_ostream, __stdoutbuf, wchar_t, wcout);84STREAM(basic_ostream, __stdoutbuf, wchar_t, wcout);
66_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_ostream, __stdoutbuf, wchar_t, wcerr);85STREAM(basic_ostream, __stdoutbuf, wchar_t, wcerr);
67_LIBCPP_EXPORTED_FROM_ABI STREAM(basic_ostream, __stdoutbuf, wchar_t, wclog);86STREAM(basic_ostream, __stdoutbuf, wchar_t, wclog);
68#endif // _LIBCPP_HAS_WIDE_CHARACTERS87#endif // _LIBCPP_HAS_WIDE_CHARACTERS
6988
70// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority89// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority
...@@ -98,34 +117,34 @@ public:...@@ -98,34 +117,34 @@ public:
98DoIOSInit::DoIOSInit() {117DoIOSInit::DoIOSInit() {
99 force_locale_initialization();118 force_locale_initialization();
100119
101 cin.init(stdin);120 init_stream(stdin, cin, cin_data);
102 cout.init(stdout);121 init_stream(stdout, cout, cout_data);
103 cerr.init(stderr);122 init_stream(stderr, cerr, cerr_data);
104 clog.init(stderr);123 init_stream(stderr, clog, clog_data);
105124
106 cin.stream.tie(&cout.stream);125 cin.value.tie(&cout.value);
107 std::unitbuf(cerr.stream);126 std::unitbuf(cerr.value);
108 cerr.stream.tie(&cout.stream);127 cerr.value.tie(&cout.value);
109128
110#if _LIBCPP_HAS_WIDE_CHARACTERS129#if _LIBCPP_HAS_WIDE_CHARACTERS
111 wcin.init(stdin);130 init_stream(stdin, wcin, wcin_data);
112 wcout.init(stdout);131 init_stream(stdout, wcout, wcout_data);
113 wcerr.init(stderr);132 init_stream(stderr, wcerr, wcerr_data);
114 wclog.init(stderr);133 init_stream(stderr, wclog, wclog_data);
115134
116 wcin.stream.tie(&wcout.stream);135 wcin.value.tie(&wcout.value);
117 std::unitbuf(wcerr.stream);136 std::unitbuf(wcerr.value);
118 wcerr.stream.tie(&wcout.stream);137 wcerr.value.tie(&wcout.value);
119#endif138#endif
120}139}
121140
122DoIOSInit::~DoIOSInit() {141DoIOSInit::~DoIOSInit() {
123 cout.stream.flush();142 cout.value.flush();
124 clog.stream.flush();143 clog.value.flush();
125144
126#if _LIBCPP_HAS_WIDE_CHARACTERS145#if _LIBCPP_HAS_WIDE_CHARACTERS
127 wcout.stream.flush();146 wcout.value.flush();
128 wclog.stream.flush();147 wclog.value.flush();
129#endif148#endif
130}149}
131150
lib/libcxx/src/locale.cpp+213-196
...@@ -60,9 +60,8 @@ struct __libcpp_unique_locale {...@@ -60,9 +60,8 @@ struct __libcpp_unique_locale {
6060
61 __locale::__locale_t __loc_;61 __locale::__locale_t __loc_;
6262
63private:63 __libcpp_unique_locale(__libcpp_unique_locale const&) = delete;
64 __libcpp_unique_locale(__libcpp_unique_locale const&);64 __libcpp_unique_locale& operator=(__libcpp_unique_locale const&) = delete;
65 __libcpp_unique_locale& operator=(__libcpp_unique_locale const&);
66};65};
6766
68#ifdef __cloc_defined67#ifdef __cloc_defined
...@@ -88,16 +87,6 @@ T& make(Args... args) {...@@ -88,16 +87,6 @@ T& make(Args... args) {
88 return *obj;87 return *obj;
89}88}
9089
91template <typename T, size_t N>
92inline constexpr size_t countof(const T (&)[N]) {
93 return N;
94}
95
96template <typename T>
97inline constexpr size_t countof(const T* const begin, const T* const end) {
98 return static_cast<size_t>(end - begin);
99}
100
101string build_name(const string& other, const string& one, locale::category c) {90string build_name(const string& other, const string& one, locale::category c) {
102 if (other == "*" || one == "*")91 if (other == "*" || one == "*")
103 return "*";92 return "*";
...@@ -215,63 +204,58 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {...@@ -215,63 +204,58 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
215}204}
216205
217locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N), name_(name) {206locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N), name_(name) {
218#if _LIBCPP_HAS_EXCEPTIONS207 __exception_guard guard([&] {
219 try {
220#endif // _LIBCPP_HAS_EXCEPTIONS
221 facets_ = locale::classic().__locale_->facets_;
222 for (unsigned i = 0; i < facets_.size(); ++i)208 for (unsigned i = 0; i < facets_.size(); ++i)
223 if (facets_[i])209 if (facets_[i])
224 facets_[i]->__add_shared();210 facets_[i]->__release_shared();
225 install(new collate_byname<char>(name_));211 });
212 facets_ = locale::classic().__locale_->facets_;
213 for (unsigned i = 0; i < facets_.size(); ++i)
214 if (facets_[i])
215 facets_[i]->__add_shared();
216 install(new collate_byname<char>(name_));
226#if _LIBCPP_HAS_WIDE_CHARACTERS217#if _LIBCPP_HAS_WIDE_CHARACTERS
227 install(new collate_byname<wchar_t>(name_));218 install(new collate_byname<wchar_t>(name_));
228#endif219#endif
229 install(new ctype_byname<char>(name_));220 install(new ctype_byname<char>(name_));
230#if _LIBCPP_HAS_WIDE_CHARACTERS221#if _LIBCPP_HAS_WIDE_CHARACTERS
231 install(new ctype_byname<wchar_t>(name_));222 install(new ctype_byname<wchar_t>(name_));
232#endif223#endif
233 install(new codecvt_byname<char, char, mbstate_t>(name_));224 install(new codecvt_byname<char, char, mbstate_t>(name_));
234#if _LIBCPP_HAS_WIDE_CHARACTERS225#if _LIBCPP_HAS_WIDE_CHARACTERS
235 install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));226 install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));
236#endif227#endif
237 _LIBCPP_SUPPRESS_DEPRECATED_PUSH228 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
238 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));229 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
239 install(new codecvt_byname<char32_t, char, mbstate_t>(name_));230 install(new codecvt_byname<char32_t, char, mbstate_t>(name_));
240 _LIBCPP_SUPPRESS_DEPRECATED_POP231 _LIBCPP_SUPPRESS_DEPRECATED_POP
241#if _LIBCPP_HAS_CHAR8_T232#if _LIBCPP_HAS_CHAR8_T
242 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name_));233 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name_));
243 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));234 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));
244#endif235#endif
245 install(new numpunct_byname<char>(name_));236 install(new numpunct_byname<char>(name_));
246#if _LIBCPP_HAS_WIDE_CHARACTERS237#if _LIBCPP_HAS_WIDE_CHARACTERS
247 install(new numpunct_byname<wchar_t>(name_));238 install(new numpunct_byname<wchar_t>(name_));
248#endif239#endif
249 install(new moneypunct_byname<char, false>(name_));240 install(new moneypunct_byname<char, false>(name_));
250 install(new moneypunct_byname<char, true>(name_));241 install(new moneypunct_byname<char, true>(name_));
251#if _LIBCPP_HAS_WIDE_CHARACTERS242#if _LIBCPP_HAS_WIDE_CHARACTERS
252 install(new moneypunct_byname<wchar_t, false>(name_));243 install(new moneypunct_byname<wchar_t, false>(name_));
253 install(new moneypunct_byname<wchar_t, true>(name_));244 install(new moneypunct_byname<wchar_t, true>(name_));
254#endif245#endif
255 install(new time_get_byname<char>(name_));246 install(new time_get_byname<char>(name_));
256#if _LIBCPP_HAS_WIDE_CHARACTERS247#if _LIBCPP_HAS_WIDE_CHARACTERS
257 install(new time_get_byname<wchar_t>(name_));248 install(new time_get_byname<wchar_t>(name_));
258#endif249#endif
259 install(new time_put_byname<char>(name_));250 install(new time_put_byname<char>(name_));
260#if _LIBCPP_HAS_WIDE_CHARACTERS251#if _LIBCPP_HAS_WIDE_CHARACTERS
261 install(new time_put_byname<wchar_t>(name_));252 install(new time_put_byname<wchar_t>(name_));
262#endif253#endif
263 install(new messages_byname<char>(name_));254 install(new messages_byname<char>(name_));
264#if _LIBCPP_HAS_WIDE_CHARACTERS255#if _LIBCPP_HAS_WIDE_CHARACTERS
265 install(new messages_byname<wchar_t>(name_));256 install(new messages_byname<wchar_t>(name_));
266#endif257#endif
267#if _LIBCPP_HAS_EXCEPTIONS258 guard.__complete();
268 } catch (...) {
269 for (unsigned i = 0; i < facets_.size(); ++i)
270 if (facets_[i])
271 facets_[i]->__release_shared();
272 throw;
273 }
274#endif // _LIBCPP_HAS_EXCEPTIONS
275}259}
276260
277locale::__imp::__imp(const __imp& other) : facets_(max<size_t>(N, other.facets_.size())), name_(other.name_) {261locale::__imp::__imp(const __imp& other) : facets_(max<size_t>(N, other.facets_.size())), name_(other.name_) {
...@@ -287,71 +271,66 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)...@@ -287,71 +271,66 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
287 for (unsigned i = 0; i < facets_.size(); ++i)271 for (unsigned i = 0; i < facets_.size(); ++i)
288 if (facets_[i])272 if (facets_[i])
289 facets_[i]->__add_shared();273 facets_[i]->__add_shared();
290#if _LIBCPP_HAS_EXCEPTIONS274 __exception_guard guard([&] {
291 try {275 for (unsigned i = 0; i < facets_.size(); ++i)
292#endif // _LIBCPP_HAS_EXCEPTIONS276 if (facets_[i])
293 if (c & locale::collate) {277 facets_[i]->__release_shared();
294 install(new collate_byname<char>(name));278 });
279 if (c & locale::collate) {
280 install(new collate_byname<char>(name));
295#if _LIBCPP_HAS_WIDE_CHARACTERS281#if _LIBCPP_HAS_WIDE_CHARACTERS
296 install(new collate_byname<wchar_t>(name));282 install(new collate_byname<wchar_t>(name));
297#endif283#endif
298 }284 }
299 if (c & locale::ctype) {285 if (c & locale::ctype) {
300 install(new ctype_byname<char>(name));286 install(new ctype_byname<char>(name));
301#if _LIBCPP_HAS_WIDE_CHARACTERS287#if _LIBCPP_HAS_WIDE_CHARACTERS
302 install(new ctype_byname<wchar_t>(name));288 install(new ctype_byname<wchar_t>(name));
303#endif289#endif
304 install(new codecvt_byname<char, char, mbstate_t>(name));290 install(new codecvt_byname<char, char, mbstate_t>(name));
305#if _LIBCPP_HAS_WIDE_CHARACTERS291#if _LIBCPP_HAS_WIDE_CHARACTERS
306 install(new codecvt_byname<wchar_t, char, mbstate_t>(name));292 install(new codecvt_byname<wchar_t, char, mbstate_t>(name));
307#endif293#endif
308 _LIBCPP_SUPPRESS_DEPRECATED_PUSH294 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
309 install(new codecvt_byname<char16_t, char, mbstate_t>(name));295 install(new codecvt_byname<char16_t, char, mbstate_t>(name));
310 install(new codecvt_byname<char32_t, char, mbstate_t>(name));296 install(new codecvt_byname<char32_t, char, mbstate_t>(name));
311 _LIBCPP_SUPPRESS_DEPRECATED_POP297 _LIBCPP_SUPPRESS_DEPRECATED_POP
312#if _LIBCPP_HAS_CHAR8_T298#if _LIBCPP_HAS_CHAR8_T
313 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name));299 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name));
314 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name));300 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name));
315#endif301#endif
316 }302 }
317 if (c & locale::monetary) {303 if (c & locale::monetary) {
318 install(new moneypunct_byname<char, false>(name));304 install(new moneypunct_byname<char, false>(name));
319 install(new moneypunct_byname<char, true>(name));305 install(new moneypunct_byname<char, true>(name));
320#if _LIBCPP_HAS_WIDE_CHARACTERS306#if _LIBCPP_HAS_WIDE_CHARACTERS
321 install(new moneypunct_byname<wchar_t, false>(name));307 install(new moneypunct_byname<wchar_t, false>(name));
322 install(new moneypunct_byname<wchar_t, true>(name));308 install(new moneypunct_byname<wchar_t, true>(name));
323#endif309#endif
324 }310 }
325 if (c & locale::numeric) {311 if (c & locale::numeric) {
326 install(new numpunct_byname<char>(name));312 install(new numpunct_byname<char>(name));
327#if _LIBCPP_HAS_WIDE_CHARACTERS313#if _LIBCPP_HAS_WIDE_CHARACTERS
328 install(new numpunct_byname<wchar_t>(name));314 install(new numpunct_byname<wchar_t>(name));
329#endif315#endif
330 }316 }
331 if (c & locale::time) {317 if (c & locale::time) {
332 install(new time_get_byname<char>(name));318 install(new time_get_byname<char>(name));
333#if _LIBCPP_HAS_WIDE_CHARACTERS319#if _LIBCPP_HAS_WIDE_CHARACTERS
334 install(new time_get_byname<wchar_t>(name));320 install(new time_get_byname<wchar_t>(name));
335#endif321#endif
336 install(new time_put_byname<char>(name));322 install(new time_put_byname<char>(name));
337#if _LIBCPP_HAS_WIDE_CHARACTERS323#if _LIBCPP_HAS_WIDE_CHARACTERS
338 install(new time_put_byname<wchar_t>(name));324 install(new time_put_byname<wchar_t>(name));
339#endif325#endif
340 }326 }
341 if (c & locale::messages) {327 if (c & locale::messages) {
342 install(new messages_byname<char>(name));328 install(new messages_byname<char>(name));
343#if _LIBCPP_HAS_WIDE_CHARACTERS329#if _LIBCPP_HAS_WIDE_CHARACTERS
344 install(new messages_byname<wchar_t>(name));330 install(new messages_byname<wchar_t>(name));
345#endif331#endif
346 }
347#if _LIBCPP_HAS_EXCEPTIONS
348 } catch (...) {
349 for (unsigned i = 0; i < facets_.size(); ++i)
350 if (facets_[i])
351 facets_[i]->__release_shared();
352 throw;
353 }332 }
354#endif // _LIBCPP_HAS_EXCEPTIONS333 guard.__complete();
355}334}
356335
357template <class F>336template <class F>
...@@ -366,87 +345,83 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)...@@ -366,87 +345,83 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
366 for (unsigned i = 0; i < facets_.size(); ++i)345 for (unsigned i = 0; i < facets_.size(); ++i)
367 if (facets_[i])346 if (facets_[i])
368 facets_[i]->__add_shared();347 facets_[i]->__add_shared();
369#if _LIBCPP_HAS_EXCEPTIONS348 __exception_guard guard([&] {
370 try {349 for (unsigned i = 0; i < facets_.size(); ++i)
371#endif // _LIBCPP_HAS_EXCEPTIONS350 if (facets_[i])
372 if (c & locale::collate) {351 facets_[i]->__release_shared();
373 install_from<std::collate<char> >(one);352 });
353
354 if (c & locale::collate) {
355 install_from<std::collate<char> >(one);
374#if _LIBCPP_HAS_WIDE_CHARACTERS356#if _LIBCPP_HAS_WIDE_CHARACTERS
375 install_from<std::collate<wchar_t> >(one);357 install_from<std::collate<wchar_t> >(one);
376#endif358#endif
377 }359 }
378 if (c & locale::ctype) {360 if (c & locale::ctype) {
379 install_from<std::ctype<char> >(one);361 install_from<std::ctype<char> >(one);
380#if _LIBCPP_HAS_WIDE_CHARACTERS362#if _LIBCPP_HAS_WIDE_CHARACTERS
381 install_from<std::ctype<wchar_t> >(one);363 install_from<std::ctype<wchar_t> >(one);
382#endif364#endif
383 install_from<std::codecvt<char, char, mbstate_t> >(one);365 install_from<std::codecvt<char, char, mbstate_t> >(one);
384 _LIBCPP_SUPPRESS_DEPRECATED_PUSH366 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
385 install_from<std::codecvt<char16_t, char, mbstate_t> >(one);367 install_from<std::codecvt<char16_t, char, mbstate_t> >(one);
386 install_from<std::codecvt<char32_t, char, mbstate_t> >(one);368 install_from<std::codecvt<char32_t, char, mbstate_t> >(one);
387 _LIBCPP_SUPPRESS_DEPRECATED_POP369 _LIBCPP_SUPPRESS_DEPRECATED_POP
388#if _LIBCPP_HAS_CHAR8_T370#if _LIBCPP_HAS_CHAR8_T
389 install_from<std::codecvt<char16_t, char8_t, mbstate_t> >(one);371 install_from<std::codecvt<char16_t, char8_t, mbstate_t> >(one);
390 install_from<std::codecvt<char32_t, char8_t, mbstate_t> >(one);372 install_from<std::codecvt<char32_t, char8_t, mbstate_t> >(one);
391#endif373#endif
392#if _LIBCPP_HAS_WIDE_CHARACTERS374#if _LIBCPP_HAS_WIDE_CHARACTERS
393 install_from<std::codecvt<wchar_t, char, mbstate_t> >(one);375 install_from<std::codecvt<wchar_t, char, mbstate_t> >(one);
394#endif376#endif
395 }377 }
396 if (c & locale::monetary) {378 if (c & locale::monetary) {
397 install_from<moneypunct<char, false> >(one);379 install_from<moneypunct<char, false> >(one);
398 install_from<moneypunct<char, true> >(one);380 install_from<moneypunct<char, true> >(one);
399#if _LIBCPP_HAS_WIDE_CHARACTERS381#if _LIBCPP_HAS_WIDE_CHARACTERS
400 install_from<moneypunct<wchar_t, false> >(one);382 install_from<moneypunct<wchar_t, false> >(one);
401 install_from<moneypunct<wchar_t, true> >(one);383 install_from<moneypunct<wchar_t, true> >(one);
402#endif384#endif
403 install_from<money_get<char> >(one);385 install_from<money_get<char> >(one);
404#if _LIBCPP_HAS_WIDE_CHARACTERS386#if _LIBCPP_HAS_WIDE_CHARACTERS
405 install_from<money_get<wchar_t> >(one);387 install_from<money_get<wchar_t> >(one);
406#endif388#endif
407 install_from<money_put<char> >(one);389 install_from<money_put<char> >(one);
408#if _LIBCPP_HAS_WIDE_CHARACTERS390#if _LIBCPP_HAS_WIDE_CHARACTERS
409 install_from<money_put<wchar_t> >(one);391 install_from<money_put<wchar_t> >(one);
410#endif392#endif
411 }393 }
412 if (c & locale::numeric) {394 if (c & locale::numeric) {
413 install_from<numpunct<char> >(one);395 install_from<numpunct<char> >(one);
414#if _LIBCPP_HAS_WIDE_CHARACTERS396#if _LIBCPP_HAS_WIDE_CHARACTERS
415 install_from<numpunct<wchar_t> >(one);397 install_from<numpunct<wchar_t> >(one);
416#endif398#endif
417 install_from<num_get<char> >(one);399 install_from<num_get<char> >(one);
418#if _LIBCPP_HAS_WIDE_CHARACTERS400#if _LIBCPP_HAS_WIDE_CHARACTERS
419 install_from<num_get<wchar_t> >(one);401 install_from<num_get<wchar_t> >(one);
420#endif402#endif
421 install_from<num_put<char> >(one);403 install_from<num_put<char> >(one);
422#if _LIBCPP_HAS_WIDE_CHARACTERS404#if _LIBCPP_HAS_WIDE_CHARACTERS
423 install_from<num_put<wchar_t> >(one);405 install_from<num_put<wchar_t> >(one);
424#endif406#endif
425 }407 }
426 if (c & locale::time) {408 if (c & locale::time) {
427 install_from<time_get<char> >(one);409 install_from<time_get<char> >(one);
428#if _LIBCPP_HAS_WIDE_CHARACTERS410#if _LIBCPP_HAS_WIDE_CHARACTERS
429 install_from<time_get<wchar_t> >(one);411 install_from<time_get<wchar_t> >(one);
430#endif412#endif
431 install_from<time_put<char> >(one);413 install_from<time_put<char> >(one);
432#if _LIBCPP_HAS_WIDE_CHARACTERS414#if _LIBCPP_HAS_WIDE_CHARACTERS
433 install_from<time_put<wchar_t> >(one);415 install_from<time_put<wchar_t> >(one);
434#endif416#endif
435 }417 }
436 if (c & locale::messages) {418 if (c & locale::messages) {
437 install_from<std::messages<char> >(one);419 install_from<std::messages<char> >(one);
438#if _LIBCPP_HAS_WIDE_CHARACTERS420#if _LIBCPP_HAS_WIDE_CHARACTERS
439 install_from<std::messages<wchar_t> >(one);421 install_from<std::messages<wchar_t> >(one);
440#endif422#endif
441 }
442#if _LIBCPP_HAS_EXCEPTIONS
443 } catch (...) {
444 for (unsigned i = 0; i < facets_.size(); ++i)
445 if (facets_[i])
446 facets_[i]->__release_shared();
447 throw;
448 }423 }
449#endif // _LIBCPP_HAS_EXCEPTIONS424 guard.__complete();
450}425}
451426
452locale::__imp::__imp(const __imp& other, facet* f, long id)427locale::__imp::__imp(const __imp& other, facet* f, long id)
...@@ -933,7 +908,7 @@ const ctype<char>::mask* ctype<char>::classic_table() noexcept {...@@ -933,7 +908,7 @@ const ctype<char>::mask* ctype<char>::classic_table() noexcept {
933 return __pctype_func();908 return __pctype_func();
934# elif defined(__EMSCRIPTEN__)909# elif defined(__EMSCRIPTEN__)
935 return *__ctype_b_loc();910 return *__ctype_b_loc();
936# elif defined(_NEWLIB_VERSION)911# elif _LIBCPP_LIBC_NEWLIB
937 // Newlib has a 257-entry table in ctype_.c, where (char)0 starts at [1].912 // Newlib has a 257-entry table in ctype_.c, where (char)0 starts at [1].
938 return _ctype_ + 1;913 return _ctype_ + 1;
939# elif defined(_AIX)914# elif defined(_AIX)
...@@ -3961,13 +3936,7 @@ wstring numpunct<wchar_t>::do_falsename() const { return L"false"; }...@@ -3961,13 +3936,7 @@ wstring numpunct<wchar_t>::do_falsename() const { return L"false"; }
39613936
3962// numpunct_byname<char>3937// numpunct_byname<char>
39633938
3964numpunct_byname<char>::numpunct_byname(const char* nm, size_t refs) : numpunct<char>(refs) { __init(nm); }3939numpunct_byname<char>::numpunct_byname(const char* nm, size_t refs) : numpunct<char>(refs) {
3965
3966numpunct_byname<char>::numpunct_byname(const string& nm, size_t refs) : numpunct<char>(refs) { __init(nm.c_str()); }
3967
3968numpunct_byname<char>::~numpunct_byname() {}
3969
3970void numpunct_byname<char>::__init(const char* nm) {
3971 typedef numpunct<char> base;3940 typedef numpunct<char> base;
3972 if (strcmp(nm, "C") != 0) {3941 if (strcmp(nm, "C") != 0) {
3973 __libcpp_unique_locale loc(nm);3942 __libcpp_unique_locale loc(nm);
...@@ -3988,18 +3957,14 @@ void numpunct_byname<char>::__init(const char* nm) {...@@ -3988,18 +3957,14 @@ void numpunct_byname<char>::__init(const char* nm) {
3988 }3957 }
3989}3958}
39903959
3991// numpunct_byname<wchar_t>3960numpunct_byname<char>::numpunct_byname(const string& nm, size_t refs) : numpunct_byname<char>(nm.c_str(), refs) {}
3992
3993#if _LIBCPP_HAS_WIDE_CHARACTERS
3994numpunct_byname<wchar_t>::numpunct_byname(const char* nm, size_t refs) : numpunct<wchar_t>(refs) { __init(nm); }
39953961
3996numpunct_byname<wchar_t>::numpunct_byname(const string& nm, size_t refs) : numpunct<wchar_t>(refs) {3962numpunct_byname<char>::~numpunct_byname() {}
3997 __init(nm.c_str());
3998}
39993963
4000numpunct_byname<wchar_t>::~numpunct_byname() {}3964// numpunct_byname<wchar_t>
40013965
4002void numpunct_byname<wchar_t>::__init(const char* nm) {3966#if _LIBCPP_HAS_WIDE_CHARACTERS
3967numpunct_byname<wchar_t>::numpunct_byname(const char* nm, size_t refs) : numpunct<wchar_t>(refs) {
4003 if (strcmp(nm, "C") != 0) {3968 if (strcmp(nm, "C") != 0) {
4004 __libcpp_unique_locale loc(nm);3969 __libcpp_unique_locale loc(nm);
4005 if (!loc)3970 if (!loc)
...@@ -4016,6 +3981,10 @@ void numpunct_byname<wchar_t>::__init(const char* nm) {...@@ -4016,6 +3981,10 @@ void numpunct_byname<wchar_t>::__init(const char* nm) {
4016 // localization for truename and falsename is not available3981 // localization for truename and falsename is not available
4017 }3982 }
4018}3983}
3984
3985numpunct_byname<wchar_t>::numpunct_byname(const string& nm, size_t refs) : numpunct_byname<wchar_t>(nm.c_str(), refs) {}
3986
3987numpunct_byname<wchar_t>::~numpunct_byname() {}
4019#endif // _LIBCPP_HAS_WIDE_CHARACTERS3988#endif // _LIBCPP_HAS_WIDE_CHARACTERS
40203989
4021// num_get helpers3990// num_get helpers
...@@ -4383,7 +4352,7 @@ string __time_get_storage<char>::__analyze(char fmt, const ctype<char>& ct) {...@@ -4383,7 +4352,7 @@ string __time_get_storage<char>::__analyze(char fmt, const ctype<char>& ct) {
4383 char f[3] = {0};4352 char f[3] = {0};
4384 f[0] = '%';4353 f[0] = '%';
4385 f[1] = fmt;4354 f[1] = fmt;
4386 size_t n = __locale::__strftime(buf, countof(buf), f, &t, __loc_);4355 size_t n = __locale::__strftime(buf, std::size(buf), f, &t, __loc_);
4387 char* bb = buf;4356 char* bb = buf;
4388 char* be = buf + n;4357 char* be = buf + n;
4389 string result;4358 string result;
...@@ -4514,12 +4483,12 @@ wstring __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& c...@@ -4514,12 +4483,12 @@ wstring __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& c
4514 char f[3] = {0};4483 char f[3] = {0};
4515 f[0] = '%';4484 f[0] = '%';
4516 f[1] = fmt;4485 f[1] = fmt;
4517 __locale::__strftime(buf, countof(buf), f, &t, __loc_);4486 __locale::__strftime(buf, std::size(buf), f, &t, __loc_);
4518 wchar_t wbuf[100];4487 wchar_t wbuf[100];
4519 wchar_t* wbb = wbuf;4488 wchar_t* wbb = wbuf;
4520 mbstate_t mb = {0};4489 mbstate_t mb = {0};
4521 const char* bb = buf;4490 const char* bb = buf;
4522 size_t j = __locale::__mbsrtowcs(wbb, &bb, countof(wbuf), &mb, __loc_);4491 size_t j = __locale::__mbsrtowcs(wbb, &bb, std::size(wbuf), &mb, __loc_);
4523 if (j == size_t(-1))4492 if (j == size_t(-1))
4524 std::__throw_runtime_error("locale not supported");4493 std::__throw_runtime_error("locale not supported");
4525 wchar_t* wbe = wbb + j;4494 wchar_t* wbe = wbb + j;
...@@ -4640,25 +4609,25 @@ void __time_get_storage<char>::init(const ctype<char>& ct) {...@@ -4640,25 +4609,25 @@ void __time_get_storage<char>::init(const ctype<char>& ct) {
4640 // __weeks_4609 // __weeks_
4641 for (int i = 0; i < 7; ++i) {4610 for (int i = 0; i < 7; ++i) {
4642 t.tm_wday = i;4611 t.tm_wday = i;
4643 __locale::__strftime(buf, countof(buf), "%A", &t, __loc_);4612 __locale::__strftime(buf, std::size(buf), "%A", &t, __loc_);
4644 __weeks_[i] = buf;4613 __weeks_[i] = buf;
4645 __locale::__strftime(buf, countof(buf), "%a", &t, __loc_);4614 __locale::__strftime(buf, std::size(buf), "%a", &t, __loc_);
4646 __weeks_[i + 7] = buf;4615 __weeks_[i + 7] = buf;
4647 }4616 }
4648 // __months_4617 // __months_
4649 for (int i = 0; i < 12; ++i) {4618 for (int i = 0; i < 12; ++i) {
4650 t.tm_mon = i;4619 t.tm_mon = i;
4651 __locale::__strftime(buf, countof(buf), "%B", &t, __loc_);4620 __locale::__strftime(buf, std::size(buf), "%B", &t, __loc_);
4652 __months_[i] = buf;4621 __months_[i] = buf;
4653 __locale::__strftime(buf, countof(buf), "%b", &t, __loc_);4622 __locale::__strftime(buf, std::size(buf), "%b", &t, __loc_);
4654 __months_[i + 12] = buf;4623 __months_[i + 12] = buf;
4655 }4624 }
4656 // __am_pm_4625 // __am_pm_
4657 t.tm_hour = 1;4626 t.tm_hour = 1;
4658 __locale::__strftime(buf, countof(buf), "%p", &t, __loc_);4627 __locale::__strftime(buf, std::size(buf), "%p", &t, __loc_);
4659 __am_pm_[0] = buf;4628 __am_pm_[0] = buf;
4660 t.tm_hour = 13;4629 t.tm_hour = 13;
4661 __locale::__strftime(buf, countof(buf), "%p", &t, __loc_);4630 __locale::__strftime(buf, std::size(buf), "%p", &t, __loc_);
4662 __am_pm_[1] = buf;4631 __am_pm_[1] = buf;
4663 __c_ = __analyze('c', ct);4632 __c_ = __analyze('c', ct);
4664 __r_ = __analyze('r', ct);4633 __r_ = __analyze('r', ct);
...@@ -4677,18 +4646,18 @@ void __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct) {...@@ -4677,18 +4646,18 @@ void __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct) {
4677 // __weeks_4646 // __weeks_
4678 for (int i = 0; i < 7; ++i) {4647 for (int i = 0; i < 7; ++i) {
4679 t.tm_wday = i;4648 t.tm_wday = i;
4680 __locale::__strftime(buf, countof(buf), "%A", &t, __loc_);4649 __locale::__strftime(buf, std::size(buf), "%A", &t, __loc_);
4681 mb = mbstate_t();4650 mb = mbstate_t();
4682 const char* bb = buf;4651 const char* bb = buf;
4683 size_t j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, __loc_);4652 size_t j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, __loc_);
4684 if (j == size_t(-1) || j == 0)4653 if (j == size_t(-1) || j == 0)
4685 std::__throw_runtime_error("locale not supported");4654 std::__throw_runtime_error("locale not supported");
4686 wbe = wbuf + j;4655 wbe = wbuf + j;
4687 __weeks_[i].assign(wbuf, wbe);4656 __weeks_[i].assign(wbuf, wbe);
4688 __locale::__strftime(buf, countof(buf), "%a", &t, __loc_);4657 __locale::__strftime(buf, std::size(buf), "%a", &t, __loc_);
4689 mb = mbstate_t();4658 mb = mbstate_t();
4690 bb = buf;4659 bb = buf;
4691 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, __loc_);4660 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, __loc_);
4692 if (j == size_t(-1) || j == 0)4661 if (j == size_t(-1) || j == 0)
4693 std::__throw_runtime_error("locale not supported");4662 std::__throw_runtime_error("locale not supported");
4694 wbe = wbuf + j;4663 wbe = wbuf + j;
...@@ -4697,18 +4666,18 @@ void __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct) {...@@ -4697,18 +4666,18 @@ void __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct) {
4697 // __months_4666 // __months_
4698 for (int i = 0; i < 12; ++i) {4667 for (int i = 0; i < 12; ++i) {
4699 t.tm_mon = i;4668 t.tm_mon = i;
4700 __locale::__strftime(buf, countof(buf), "%B", &t, __loc_);4669 __locale::__strftime(buf, std::size(buf), "%B", &t, __loc_);
4701 mb = mbstate_t();4670 mb = mbstate_t();
4702 const char* bb = buf;4671 const char* bb = buf;
4703 size_t j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, __loc_);4672 size_t j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, __loc_);
4704 if (j == size_t(-1) || j == 0)4673 if (j == size_t(-1) || j == 0)
4705 std::__throw_runtime_error("locale not supported");4674 std::__throw_runtime_error("locale not supported");
4706 wbe = wbuf + j;4675 wbe = wbuf + j;
4707 __months_[i].assign(wbuf, wbe);4676 __months_[i].assign(wbuf, wbe);
4708 __locale::__strftime(buf, countof(buf), "%b", &t, __loc_);4677 __locale::__strftime(buf, std::size(buf), "%b", &t, __loc_);
4709 mb = mbstate_t();4678 mb = mbstate_t();
4710 bb = buf;4679 bb = buf;
4711 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, __loc_);4680 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, __loc_);
4712 if (j == size_t(-1) || j == 0)4681 if (j == size_t(-1) || j == 0)
4713 std::__throw_runtime_error("locale not supported");4682 std::__throw_runtime_error("locale not supported");
4714 wbe = wbuf + j;4683 wbe = wbuf + j;
...@@ -4716,19 +4685,19 @@ void __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct) {...@@ -4716,19 +4685,19 @@ void __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct) {
4716 }4685 }
4717 // __am_pm_4686 // __am_pm_
4718 t.tm_hour = 1;4687 t.tm_hour = 1;
4719 __locale::__strftime(buf, countof(buf), "%p", &t, __loc_);4688 __locale::__strftime(buf, std::size(buf), "%p", &t, __loc_);
4720 mb = mbstate_t();4689 mb = mbstate_t();
4721 const char* bb = buf;4690 const char* bb = buf;
4722 size_t j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, __loc_);4691 size_t j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, __loc_);
4723 if (j == size_t(-1))4692 if (j == size_t(-1))
4724 std::__throw_runtime_error("locale not supported");4693 std::__throw_runtime_error("locale not supported");
4725 wbe = wbuf + j;4694 wbe = wbuf + j;
4726 __am_pm_[0].assign(wbuf, wbe);4695 __am_pm_[0].assign(wbuf, wbe);
4727 t.tm_hour = 13;4696 t.tm_hour = 13;
4728 __locale::__strftime(buf, countof(buf), "%p", &t, __loc_);4697 __locale::__strftime(buf, std::size(buf), "%p", &t, __loc_);
4729 mb = mbstate_t();4698 mb = mbstate_t();
4730 bb = buf;4699 bb = buf;
4731 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, __loc_);4700 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, __loc_);
4732 if (j == size_t(-1))4701 if (j == size_t(-1))
4733 std::__throw_runtime_error("locale not supported");4702 std::__throw_runtime_error("locale not supported");
4734 wbe = wbuf + j;4703 wbe = wbuf + j;
...@@ -4957,7 +4926,7 @@ void __time_put::__do_put(char* __nb, char*& __ne, const tm* __tm, char __fmt, c...@@ -4957,7 +4926,7 @@ void __time_put::__do_put(char* __nb, char*& __ne, const tm* __tm, char __fmt, c
4957 char fmt[] = {'%', __fmt, __mod, 0};4926 char fmt[] = {'%', __fmt, __mod, 0};
4958 if (__mod != 0)4927 if (__mod != 0)
4959 swap(fmt[1], fmt[2]);4928 swap(fmt[1], fmt[2]);
4960 size_t n = __locale::__strftime(__nb, countof(__nb, __ne), fmt, __tm, __loc_);4929 size_t n = __locale::__strftime(__nb, std::distance(__nb, __ne), fmt, __tm, __loc_);
4961 __ne = __nb + n;4930 __ne = __nb + n;
4962}4931}
49634932
...@@ -4968,7 +4937,7 @@ void __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm, char __...@@ -4968,7 +4937,7 @@ void __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm, char __
4968 __do_put(__nar, __ne, __tm, __fmt, __mod);4937 __do_put(__nar, __ne, __tm, __fmt, __mod);
4969 mbstate_t mb = {0};4938 mbstate_t mb = {0};
4970 const char* __nb = __nar;4939 const char* __nb = __nar;
4971 size_t j = __locale::__mbsrtowcs(__wb, &__nb, countof(__wb, __we), &mb, __loc_);4940 size_t j = __locale::__mbsrtowcs(__wb, &__nb, std::distance(__wb, __we), &mb, __loc_);
4972 if (j == size_t(-1))4941 if (j == size_t(-1))
4973 std::__throw_runtime_error("locale not supported");4942 std::__throw_runtime_error("locale not supported");
4974 __we = __wb + j;4943 __we = __wb + j;
...@@ -5443,7 +5412,7 @@ void moneypunct_byname<wchar_t, false>::init(const char* nm) {...@@ -5443,7 +5412,7 @@ void moneypunct_byname<wchar_t, false>::init(const char* nm) {
5443 wchar_t wbuf[100];5412 wchar_t wbuf[100];
5444 mbstate_t mb = {0};5413 mbstate_t mb = {0};
5445 const char* bb = lc->currency_symbol;5414 const char* bb = lc->currency_symbol;
5446 size_t j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, loc.get());5415 size_t j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, loc.get());
5447 if (j == size_t(-1))5416 if (j == size_t(-1))
5448 std::__throw_runtime_error("locale not supported");5417 std::__throw_runtime_error("locale not supported");
5449 wchar_t* wbe = wbuf + j;5418 wchar_t* wbe = wbuf + j;
...@@ -5457,7 +5426,7 @@ void moneypunct_byname<wchar_t, false>::init(const char* nm) {...@@ -5457,7 +5426,7 @@ void moneypunct_byname<wchar_t, false>::init(const char* nm) {
5457 else {5426 else {
5458 mb = mbstate_t();5427 mb = mbstate_t();
5459 bb = lc->positive_sign;5428 bb = lc->positive_sign;
5460 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, loc.get());5429 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, loc.get());
5461 if (j == size_t(-1))5430 if (j == size_t(-1))
5462 std::__throw_runtime_error("locale not supported");5431 std::__throw_runtime_error("locale not supported");
5463 wbe = wbuf + j;5432 wbe = wbuf + j;
...@@ -5468,7 +5437,7 @@ void moneypunct_byname<wchar_t, false>::init(const char* nm) {...@@ -5468,7 +5437,7 @@ void moneypunct_byname<wchar_t, false>::init(const char* nm) {
5468 else {5437 else {
5469 mb = mbstate_t();5438 mb = mbstate_t();
5470 bb = lc->negative_sign;5439 bb = lc->negative_sign;
5471 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, loc.get());5440 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, loc.get());
5472 if (j == size_t(-1))5441 if (j == size_t(-1))
5473 std::__throw_runtime_error("locale not supported");5442 std::__throw_runtime_error("locale not supported");
5474 wbe = wbuf + j;5443 wbe = wbuf + j;
...@@ -5498,7 +5467,7 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {...@@ -5498,7 +5467,7 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {
5498 wchar_t wbuf[100];5467 wchar_t wbuf[100];
5499 mbstate_t mb = {0};5468 mbstate_t mb = {0};
5500 const char* bb = lc->int_curr_symbol;5469 const char* bb = lc->int_curr_symbol;
5501 size_t j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, loc.get());5470 size_t j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, loc.get());
5502 if (j == size_t(-1))5471 if (j == size_t(-1))
5503 std::__throw_runtime_error("locale not supported");5472 std::__throw_runtime_error("locale not supported");
5504 wchar_t* wbe = wbuf + j;5473 wchar_t* wbe = wbuf + j;
...@@ -5516,7 +5485,7 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {...@@ -5516,7 +5485,7 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {
5516 else {5485 else {
5517 mb = mbstate_t();5486 mb = mbstate_t();
5518 bb = lc->positive_sign;5487 bb = lc->positive_sign;
5519 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, loc.get());5488 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, loc.get());
5520 if (j == size_t(-1))5489 if (j == size_t(-1))
5521 std::__throw_runtime_error("locale not supported");5490 std::__throw_runtime_error("locale not supported");
5522 wbe = wbuf + j;5491 wbe = wbuf + j;
...@@ -5531,7 +5500,7 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {...@@ -5531,7 +5500,7 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {
5531 else {5500 else {
5532 mb = mbstate_t();5501 mb = mbstate_t();
5533 bb = lc->negative_sign;5502 bb = lc->negative_sign;
5534 j = __locale::__mbsrtowcs(wbuf, &bb, countof(wbuf), &mb, loc.get());5503 j = __locale::__mbsrtowcs(wbuf, &bb, std::size(wbuf), &mb, loc.get());
5535 if (j == size_t(-1))5504 if (j == size_t(-1))
5536 std::__throw_runtime_error("locale not supported");5505 std::__throw_runtime_error("locale not supported");
5537 wbe = wbuf + j;5506 wbe = wbuf + j;
...@@ -5571,6 +5540,54 @@ string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _C...@@ -5571,6 +5540,54 @@ string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _C
5571 return __np.grouping();5540 return __np.grouping();
5572}5541}
55735542
5543template <class _CharT>
5544int __num_get<_CharT>::__stage2_int_loop(
5545 _CharT __ct,
5546 int __base,
5547 char* __a,
5548 char*& __a_end,
5549 unsigned& __dc,
5550 _CharT __thousands_sep,
5551 const string& __grouping,
5552 unsigned* __g,
5553 unsigned*& __g_end,
5554 _CharT* __atoms) {
5555 if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25])) {
5556 *__a_end++ = __ct == __atoms[24] ? '+' : '-';
5557 __dc = 0;
5558 return 0;
5559 }
5560 if (__grouping.size() != 0 && __ct == __thousands_sep) {
5561 if (__g_end - __g < __num_get_buf_sz) {
5562 *__g_end++ = __dc;
5563 __dc = 0;
5564 }
5565 return 0;
5566 }
5567 ptrdiff_t __f = __atoms_offset(__atoms, __ct);
5568 if (__f >= 24)
5569 return -1;
5570 switch (__base) {
5571 case 8:
5572 case 10:
5573 if (__f >= __base)
5574 return -1;
5575 break;
5576 case 16:
5577 if (__f < 22)
5578 break;
5579 if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0') {
5580 __dc = 0;
5581 *__a_end++ = __src[__f];
5582 return 0;
5583 }
5584 return -1;
5585 }
5586 *__a_end++ = __src[__f];
5587 ++__dc;
5588 return 0;
5589}
5590
5574template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;5591template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
5575_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;)5592_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;)
55765593
lib/libcxx/src/memory.cpp+12-14
...@@ -7,7 +7,8 @@...@@ -7,7 +7,8 @@
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include <__config>9#include <__config>
10#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS10#if !defined(_LIBCPP_OBJECT_FORMAT_COFF) && !defined(_LIBCPP_OBJECT_FORMAT_XCOFF) && \
11 _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 5
11# define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS12# define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS
12#endif13#endif
1314
...@@ -132,19 +133,16 @@ __sp_mut& __get_sp_mut(const void* p) {...@@ -132,19 +133,16 @@ __sp_mut& __get_sp_mut(const void* p) {
132133
133#endif // _LIBCPP_HAS_THREADS134#endif // _LIBCPP_HAS_THREADS
134135
135void* align(size_t alignment, size_t size, void*& ptr, size_t& space) {136#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 21
136 void* r = nullptr;137
137 if (size <= space) {138_LIBCPP_DIAGNOSTIC_PUSH
138 char* p1 = static_cast<char*>(ptr);139_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
139 char* p2 = reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(p1 + (alignment - 1)) & -alignment);140// This function only exists for ABI compatibility and we therefore don't provide a declaration in the headers
140 size_t d = static_cast<size_t>(p2 - p1);141_LIBCPP_EXPORTED_FROM_ABI void* align(size_t alignment, size_t size, void*& ptr, size_t& space) {
141 if (d <= space - size) {142 return __align_inline::align(alignment, size, ptr, space);
142 r = p2;
143 ptr = r;
144 space -= d;
145 }
146 }
147 return r;
148}143}
144_LIBCPP_DIAGNOSTIC_POP
145
146#endif
149147
150_LIBCPP_END_NAMESPACE_STD148_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/mutex_destructor.cpp+1-1
...@@ -19,7 +19,7 @@...@@ -19,7 +19,7 @@
19#include <__config>19#include <__config>
20#include <__thread/support.h>20#include <__thread/support.h>
2121
22#if _LIBCPP_ABI_VERSION == 1 || !_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION22#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 9 || !_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
23# define NEEDS_MUTEX_DESTRUCTOR23# define NEEDS_MUTEX_DESTRUCTOR
24#endif24#endif
2525
lib/libcxx/src/new.cpp+5-5
...@@ -6,9 +6,9 @@...@@ -6,9 +6,9 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include "include/aligned_alloc.h"
9#include "include/overridable_function.h"10#include "include/overridable_function.h"
10#include <__assert>11#include <__assert>
11#include <__memory/aligned_alloc.h>
12#include <cstddef>12#include <cstddef>
13#include <cstdlib>13#include <cstdlib>
14#include <new>14#include <new>
...@@ -43,7 +43,7 @@ static void* operator_new_impl(std::size_t size) {...@@ -43,7 +43,7 @@ static void* operator_new_impl(std::size_t size) {
43 return p;43 return p;
44}44}
4545
46_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new, (std::size_t size)) _THROW_BAD_ALLOC {46OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {
47 void* p = operator_new_impl(size);47 void* p = operator_new_impl(size);
48 if (p == nullptr)48 if (p == nullptr)
49 __throw_bad_alloc_shim();49 __throw_bad_alloc_shim();
...@@ -74,7 +74,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {...@@ -74,7 +74,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
74# endif74# endif
75}75}
7676
77_LIBCPP_OVERRIDABLE_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_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
80# if !_LIBCPP_HAS_EXCEPTIONS80# if !_LIBCPP_HAS_EXCEPTIONS
...@@ -134,7 +134,7 @@ static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignm...@@ -134,7 +134,7 @@ static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignm
134 return p;134 return p;
135}135}
136136
137_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new, (std::size_t size, std::align_val_t alignment)) _THROW_BAD_ALLOC {137OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
138 void* p = operator_new_aligned_impl(size, alignment);138 void* p = operator_new_aligned_impl(size, alignment);
139 if (p == nullptr)139 if (p == nullptr)
140 __throw_bad_alloc_shim();140 __throw_bad_alloc_shim();
...@@ -165,7 +165,7 @@ _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const s...@@ -165,7 +165,7 @@ _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const s
165# endif165# endif
166}166}
167167
168_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new[], (size_t size, std::align_val_t alignment)) _THROW_BAD_ALLOC {168OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
169 return ::operator new(size, alignment);169 return ::operator new(size, alignment);
170}170}
171171
lib/libcxx/src/optional.cpp+4
...@@ -19,6 +19,8 @@ const char* bad_optional_access::what() const noexcept { return "bad_optional_ac...@@ -19,6 +19,8 @@ const char* bad_optional_access::what() const noexcept { return "bad_optional_ac
1919
20#include <__config>20#include <__config>
2121
22#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 7
23
22// Preserve std::experimental::bad_optional_access for ABI compatibility24// Preserve std::experimental::bad_optional_access for ABI compatibility
23// Even though it no longer exists in a header file25// Even though it no longer exists in a header file
24_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL26_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
...@@ -34,3 +36,5 @@ public:...@@ -34,3 +36,5 @@ public:
34bad_optional_access::~bad_optional_access() noexcept = default;36bad_optional_access::~bad_optional_access() noexcept = default;
3537
36_LIBCPP_END_NAMESPACE_EXPERIMENTAL38_LIBCPP_END_NAMESPACE_EXPERIMENTAL
39
40#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 7
lib/libcxx/src/print.cpp+9-1
...@@ -22,6 +22,14 @@...@@ -22,6 +22,14 @@
22# include <windows.h>22# include <windows.h>
23#elif __has_include(<unistd.h>)23#elif __has_include(<unistd.h>)
24# include <unistd.h>24# include <unistd.h>
25# if defined(_NEWLIB_VERSION)
26# if defined(_POSIX_C_SOURCE) && __has_include(<stdio.h>)
27# include <stdio.h>
28# define HAS_FILENO_AND_ISATTY
29# endif
30# else
31# define HAS_FILENO_AND_ISATTY
32# endif
25#endif33#endif
2634
27_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
...@@ -56,7 +64,7 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst...@@ -56,7 +64,7 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst
56}64}
57# endif // _LIBCPP_HAS_WIDE_CHARACTERS65# endif // _LIBCPP_HAS_WIDE_CHARACTERS
5866
59#elif __has_include(<unistd.h>) // !_LIBCPP_WIN32API67#elif defined(HAS_FILENO_AND_ISATTY) // !_LIBCPP_WIN32API
6068
61_LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream) { return isatty(fileno(__stream)); }69_LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream) { return isatty(fileno(__stream)); }
62#endif70#endif
lib/libcxx/src/random.cpp-26
...@@ -31,8 +31,6 @@...@@ -31,8 +31,6 @@
31# include <linux/random.h>31# include <linux/random.h>
32# include <sys/ioctl.h>32# include <sys/ioctl.h>
33# endif33# endif
34#elif defined(_LIBCPP_USING_NACL_RANDOM)
35# include <nacl/nacl_random.h>
36#elif defined(_LIBCPP_USING_FUCHSIA_CPRNG)34#elif defined(_LIBCPP_USING_FUCHSIA_CPRNG)
37# include <zircon/syscalls.h>35# include <zircon/syscalls.h>
38#endif36#endif
...@@ -93,30 +91,6 @@ unsigned random_device::operator()() {...@@ -93,30 +91,6 @@ unsigned random_device::operator()() {
93 return r;91 return r;
94}92}
9593
96#elif defined(_LIBCPP_USING_NACL_RANDOM)
97
98random_device::random_device(const string& __token) {
99 if (__token != "/dev/urandom")
100 std::__throw_system_error(ENOENT, ("random device not supported " + __token).c_str());
101 int error = nacl_secure_random_init();
102 if (error)
103 std::__throw_system_error(error, ("random device failed to open " + __token).c_str());
104}
105
106random_device::~random_device() {}
107
108unsigned random_device::operator()() {
109 unsigned r;
110 size_t n = sizeof(r);
111 size_t bytes_written;
112 int error = nacl_secure_random(&r, n, &bytes_written);
113 if (error != 0)
114 std::__throw_system_error(error, "random_device failed getting bytes");
115 else if (bytes_written != n)
116 std::__throw_runtime_error("random_device failed to obtain enough bytes");
117 return r;
118}
119
120#elif defined(_LIBCPP_USING_WIN32_RANDOM)94#elif defined(_LIBCPP_USING_WIN32_RANDOM)
12195
122random_device::random_device(const string& __token) {96random_device::random_device(const string& __token) {
lib/libcxx/src/string.cpp+10-25
...@@ -20,7 +20,7 @@...@@ -20,7 +20,7 @@
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2222
23#ifndef _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON23#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 14
2424
25template <bool>25template <bool>
26struct __basic_string_common;26struct __basic_string_common;
...@@ -35,45 +35,30 @@ struct __basic_string_common<true> {...@@ -35,45 +35,30 @@ struct __basic_string_common<true> {
35void __basic_string_common<true>::__throw_length_error() const { std::__throw_length_error("basic_string"); }35void __basic_string_common<true>::__throw_length_error() const { std::__throw_length_error("basic_string"); }
36void __basic_string_common<true>::__throw_out_of_range() const { std::__throw_out_of_range("basic_string"); }36void __basic_string_common<true>::__throw_out_of_range() const { std::__throw_out_of_range("basic_string"); }
3737
38#endif // _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON38#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 14
3939
40// Define legacy ABI functions40// Define legacy ABI functions
41// ---------------------------41// ---------------------------
4242
43#ifndef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION43#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 21
4444
45// This initializes the string with [__s, __s + __sz), but capacity() == __reserve. Assumes that __reserve >= __sz.
45template <class _CharT, class _Traits, class _Allocator>46template <class _CharT, class _Traits, class _Allocator>
46void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) {47void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) {
47 if (__libcpp_is_constant_evaluated())48 pointer __p = __init_internal_buffer(__reserve);
48 __rep_ = __rep();49 __annotate_delete();
49 if (__reserve > max_size())50 __set_size(__sz);
50 __throw_length_error();
51 pointer __p;
52 if (__fits_in_sso(__reserve)) {
53 __set_short_size(__sz);
54 __p = __get_short_pointer();
55 } else {
56 auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__reserve) + 1);
57 __p = __allocation.ptr;
58 __begin_lifetime(__p, __allocation.count);
59 __set_long_pointer(__p);
60 __set_long_cap(__allocation.count);
61 __set_long_size(__sz);
62 }
63 traits_type::copy(std::__to_address(__p), __s, __sz);51 traits_type::copy(std::__to_address(__p), __s, __sz);
64 traits_type::assign(__p[__sz], value_type());52 traits_type::assign(__p[__sz], value_type());
65 __annotate_new(__sz);53 __annotate_new(__sz);
66}54}
6755
68# define STRING_LEGACY_API(CharT) \56template _LIBCPP_EXPORTED_FROM_ABI void basic_string<char>::__init(const value_type*, size_type, size_type);
69 template _LIBCPP_EXPORTED_FROM_ABI void basic_string<CharT>::__init(const value_type*, size_type, size_type)
70
71STRING_LEGACY_API(char);
72# if _LIBCPP_HAS_WIDE_CHARACTERS57# if _LIBCPP_HAS_WIDE_CHARACTERS
73STRING_LEGACY_API(wchar_t);58template _LIBCPP_EXPORTED_FROM_ABI void basic_string<wchar_t>::__init(const value_type*, size_type, size_type);
74# endif59# endif
7560
76#endif // _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION61#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 21
7762
78#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template _LIBCPP_EXPORTED_FROM_ABI __VA_ARGS__;63#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template _LIBCPP_EXPORTED_FROM_ABI __VA_ARGS__;
79#ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION64#ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
lib/libcxx/src/support/runtime/exception_fallback.ipp+2
...@@ -8,6 +8,8 @@...@@ -8,6 +8,8 @@
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#include <__verbose_abort>10#include <__verbose_abort>
11#include <exception>
12#include "include/atomic_support.h"
1113
12namespace std {14namespace std {
1315
lib/libcxx/src/support/runtime/exception_glibcxx.ipp+3
...@@ -11,6 +11,9 @@...@@ -11,6 +11,9 @@
11# error header can only be used when targeting libstdc++ or libsupc++11# error header can only be used when targeting libstdc++ or libsupc++
12#endif12#endif
1313
14#include <exception>
15#include <new>
16
14namespace std {17namespace std {
1518
16bad_alloc::bad_alloc() noexcept {}19bad_alloc::bad_alloc() noexcept {}
lib/libcxx/src/support/runtime/exception_libcxxabi.ipp+6-2
...@@ -7,6 +7,10 @@...@@ -7,6 +7,10 @@
7//7//
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#include <exception>
11
12#include <cxxabi.h>
13
10#ifndef _LIBCPPABI_VERSION14#ifndef _LIBCPPABI_VERSION
11# error this header can only be used with libc++abi15# error this header can only be used with libc++abi
12#endif16#endif
...@@ -17,9 +21,9 @@ bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }...@@ -17,9 +21,9 @@ bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
1721
18int uncaught_exceptions() noexcept {22int uncaught_exceptions() noexcept {
19#if _LIBCPPABI_VERSION > 100123#if _LIBCPPABI_VERSION > 1001
20 return __cxa_uncaught_exceptions();24 return abi::__cxa_uncaught_exceptions();
21#else25#else
22 return __cxa_uncaught_exception() ? 1 : 0;26 return abi::__cxa_uncaught_exception() ? 1 : 0;
23#endif27#endif
24}28}
2529
lib/libcxx/src/support/runtime/exception_libcxxrt.ipp+2
...@@ -11,6 +11,8 @@...@@ -11,6 +11,8 @@
11# error this header may only be used when targeting libcxxrt11# error this header may only be used when targeting libcxxrt
12#endif12#endif
1313
14#include <exception>
15
14namespace std {16namespace std {
1517
16bad_exception::~bad_exception() noexcept {}18bad_exception::~bad_exception() noexcept {}
lib/libcxx/src/support/runtime/exception_msvc.ipp+2
...@@ -12,6 +12,8 @@...@@ -12,6 +12,8 @@
12#endif12#endif
1313
14#include <__verbose_abort>14#include <__verbose_abort>
15#include <exception>
16#include <new>
1517
16extern "C" {18extern "C" {
17typedef void(__cdecl* terminate_handler)();19typedef void(__cdecl* terminate_handler)();
lib/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp+9-10
...@@ -7,22 +7,21 @@...@@ -7,22 +7,21 @@
7//7//
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#ifndef HAVE_DEPENDENT_EH_ABI10#include <cxxabi.h>
11# error this header may only be used with libc++abi or libcxxrt11#include <exception>
12#endif
1312
14namespace std {13namespace std {
1514
16exception_ptr::~exception_ptr() noexcept { __cxa_decrement_exception_refcount(__ptr_); }15exception_ptr::~exception_ptr() noexcept { abi::__cxa_decrement_exception_refcount(__ptr_); }
1716
18exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) {17exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) {
19 __cxa_increment_exception_refcount(__ptr_);18 abi::__cxa_increment_exception_refcount(__ptr_);
20}19}
2120
22exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept {21exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept {
23 if (__ptr_ != other.__ptr_) {22 if (__ptr_ != other.__ptr_) {
24 __cxa_increment_exception_refcount(other.__ptr_);23 abi::__cxa_increment_exception_refcount(other.__ptr_);
25 __cxa_decrement_exception_refcount(__ptr_);24 abi::__cxa_decrement_exception_refcount(__ptr_);
26 __ptr_ = other.__ptr_;25 __ptr_ = other.__ptr_;
27 }26 }
28 return *this;27 return *this;
...@@ -31,7 +30,7 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept {...@@ -31,7 +30,7 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept {
31exception_ptr exception_ptr::__from_native_exception_pointer(void* __e) noexcept {30exception_ptr exception_ptr::__from_native_exception_pointer(void* __e) noexcept {
32 exception_ptr ptr;31 exception_ptr ptr;
33 ptr.__ptr_ = __e;32 ptr.__ptr_ = __e;
34 __cxa_increment_exception_refcount(ptr.__ptr_);33 abi::__cxa_increment_exception_refcount(ptr.__ptr_);
3534
36 return ptr;35 return ptr;
37}36}
...@@ -51,12 +50,12 @@ exception_ptr current_exception() noexcept {...@@ -51,12 +50,12 @@ exception_ptr current_exception() noexcept {
51 // this whole function would be just:50 // this whole function would be just:
52 // return exception_ptr(__cxa_current_primary_exception());51 // return exception_ptr(__cxa_current_primary_exception());
53 exception_ptr ptr;52 exception_ptr ptr;
54 ptr.__ptr_ = __cxa_current_primary_exception();53 ptr.__ptr_ = abi::__cxa_current_primary_exception();
55 return ptr;54 return ptr;
56}55}
5756
58void rethrow_exception(exception_ptr p) {57void rethrow_exception(exception_ptr p) {
59 __cxa_rethrow_primary_exception(p.__ptr_);58 abi::__cxa_rethrow_primary_exception(p.__ptr_);
60 // if p.__ptr_ is NULL, above returns so we terminate59 // if p.__ptr_ is NULL, above returns so we terminate
61 terminate();60 terminate();
62}61}
lib/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp+2
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16// stable ABI), and its rethrow_exception(std::__exception_ptr::exception_ptr)16// stable ABI), and its rethrow_exception(std::__exception_ptr::exception_ptr)
17// function.17// function.
1818
19#include <exception>
20
19namespace std {21namespace std {
2022
21namespace __exception_ptr {23namespace __exception_ptr {
lib/libcxx/src/support/runtime/exception_pointer_msvc.ipp+1
...@@ -7,6 +7,7 @@...@@ -7,6 +7,7 @@
7//7//
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#include <exception>
10#include <stdio.h>11#include <stdio.h>
11#include <stdlib.h>12#include <stdlib.h>
1213
lib/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp+1
...@@ -8,6 +8,7 @@...@@ -8,6 +8,7 @@
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#include <__verbose_abort>10#include <__verbose_abort>
11#include <exception>
1112
12namespace std {13namespace std {
1314
lib/libcxx/src/support/win32/locale_win32.cpp+1-1
...@@ -144,7 +144,7 @@ int __snprintf(char* ret, size_t n, __locale_t loc, const char* format, ...) {...@@ -144,7 +144,7 @@ int __snprintf(char* ret, size_t n, __locale_t loc, const char* format, ...) {
144// Like sprintf, but when return value >= 0 it returns144// Like sprintf, but when return value >= 0 it returns
145// a pointer to a malloc'd string in *sptr.145// a pointer to a malloc'd string in *sptr.
146// If return >= 0, use free to delete *sptr.146// If return >= 0, use free to delete *sptr.
147int __libcpp_vasprintf(char** sptr, const char* __restrict format, va_list ap) {147static int __libcpp_vasprintf(char** sptr, const char* __restrict format, va_list ap) {
148 *sptr = nullptr;148 *sptr = nullptr;
149 // Query the count required.149 // Query the count required.
150 va_list ap_copy;150 va_list ap_copy;
lib/libcxx/src/system_error.cpp+2
...@@ -95,6 +95,8 @@ std::optional<errc> __win_err_to_errc(int err) {...@@ -95,6 +95,8 @@ std::optional<errc> __win_err_to_errc(int err) {
95 return errc::no_lock_available;95 return errc::no_lock_available;
96 case ERROR_NEGATIVE_SEEK:96 case ERROR_NEGATIVE_SEEK:
97 return errc::invalid_argument;97 return errc::invalid_argument;
98 case ERROR_NETNAME_DELETED:
99 return errc::no_such_file_or_directory;
98 case ERROR_NOACCESS:100 case ERROR_NOACCESS:
99 return errc::permission_denied;101 return errc::permission_denied;
100 case ERROR_NOT_ENOUGH_MEMORY:102 case ERROR_NOT_ENOUGH_MEMORY:
lib/libcxx/src/thread.cpp+1-3
...@@ -74,9 +74,7 @@ unsigned thread::hardware_concurrency() noexcept {...@@ -74,9 +74,7 @@ unsigned thread::hardware_concurrency() noexcept {
74 return 0;74 return 0;
75 return static_cast<unsigned>(result);75 return static_cast<unsigned>(result);
76#elif defined(_LIBCPP_WIN32API)76#elif defined(_LIBCPP_WIN32API)
77 SYSTEM_INFO info;77 return static_cast<unsigned>(GetActiveProcessorCount(ALL_PROCESSOR_GROUPS));
78 GetSystemInfo(&info);
79 return info.dwNumberOfProcessors;
80#else // defined(CTL_HW) && defined(HW_NCPU)78#else // defined(CTL_HW) && defined(HW_NCPU)
81 // TODO: grovel through /proc or check cpuid on x86 and similar79 // TODO: grovel through /proc or check cpuid on x86 and similar
82 // instructions on other architectures.80 // instructions on other architectures.
lib/libcxx/src/valarray.cpp+1-2
...@@ -10,8 +10,7 @@...@@ -10,8 +10,7 @@
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
1212
13// These two symbols are part of the v1 ABI but not part of the >=v2 ABI.13#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 9
14#if _LIBCPP_ABI_VERSION == 1
15template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::valarray(size_t);14template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::valarray(size_t);
16template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::~valarray();15template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::~valarray();
17#endif16#endif
lib/libcxx/src/vector.cpp+2-2
...@@ -10,7 +10,7 @@...@@ -10,7 +10,7 @@
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
1212
13#ifndef _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON13#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
1414
15template <bool>15template <bool>
16struct __vector_base_common;16struct __vector_base_common;
...@@ -25,6 +25,6 @@ void __vector_base_common<true>::__throw_length_error() const { std::__throw_len...@@ -25,6 +25,6 @@ void __vector_base_common<true>::__throw_length_error() const { std::__throw_len
2525
26void __vector_base_common<true>::__throw_out_of_range() const { std::__throw_out_of_range("vector"); }26void __vector_base_common<true>::__throw_out_of_range() const { std::__throw_out_of_range("vector"); }
2727
28#endif // _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON28#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
2929
30_LIBCPP_END_NAMESPACE_STD30_LIBCPP_END_NAMESPACE_STD
lib/libcxxabi/include/__cxxabi_config.h+42-23
...@@ -14,10 +14,6 @@...@@ -14,10 +14,6 @@
14#define _LIBCXXABI_ARM_EHABI14#define _LIBCXXABI_ARM_EHABI
15#endif15#endif
1616
17#if !defined(__has_attribute)
18#define __has_attribute(_attribute_) 0
19#endif
20
21#if defined(__clang__)17#if defined(__clang__)
22# define _LIBCXXABI_COMPILER_CLANG18# define _LIBCXXABI_COMPILER_CLANG
23# ifndef __apple_build_version__19# ifndef __apple_build_version__
...@@ -25,10 +21,6 @@...@@ -25,10 +21,6 @@
25# endif21# endif
26#elif defined(__GNUC__)22#elif defined(__GNUC__)
27# define _LIBCXXABI_COMPILER_GCC23# define _LIBCXXABI_COMPILER_GCC
28#elif defined(_MSC_VER)
29# define _LIBCXXABI_COMPILER_MSVC
30#elif defined(__IBMCPP__)
31# define _LIBCXXABI_COMPILER_IBM
32#endif24#endif
3325
34#if defined(_WIN32)26#if defined(_WIN32)
...@@ -66,17 +58,7 @@...@@ -66,17 +58,7 @@
66 #endif58 #endif
67#endif59#endif
6860
69#if defined(_LIBCXXABI_COMPILER_MSVC)
70#define _LIBCXXABI_WEAK
71#else
72#define _LIBCXXABI_WEAK __attribute__((__weak__))61#define _LIBCXXABI_WEAK __attribute__((__weak__))
73#endif
74
75#if defined(__clang__)
76#define _LIBCXXABI_COMPILER_CLANG
77#elif defined(__GNUC__)
78#define _LIBCXXABI_COMPILER_GCC
79#endif
8062
81#if __has_attribute(__no_sanitize__) && defined(_LIBCXXABI_COMPILER_CLANG)63#if __has_attribute(__no_sanitize__) && defined(_LIBCXXABI_COMPILER_CLANG)
82#define _LIBCXXABI_NO_CFI __attribute__((__no_sanitize__("cfi")))64#define _LIBCXXABI_NO_CFI __attribute__((__no_sanitize__("cfi")))
...@@ -89,11 +71,7 @@...@@ -89,11 +71,7 @@
89# define _LIBCXXABI_GUARD_ABI_ARM71# define _LIBCXXABI_GUARD_ABI_ARM
90#endif72#endif
9173
92#if defined(_LIBCXXABI_COMPILER_CLANG)74#if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L
93# if !__has_feature(cxx_exceptions)
94# define _LIBCXXABI_NO_EXCEPTIONS
95# endif
96#elif defined(_LIBCXXABI_COMPILER_GCC) && !defined(__EXCEPTIONS)
97# define _LIBCXXABI_NO_EXCEPTIONS75# define _LIBCXXABI_NO_EXCEPTIONS
98#endif76#endif
9977
...@@ -103,6 +81,47 @@...@@ -103,6 +81,47 @@
103#define _LIBCXXABI_DTOR_FUNC81#define _LIBCXXABI_DTOR_FUNC
104#endif82#endif
10583
84#if __has_include(<ptrauth.h>)
85# include <ptrauth.h>
86#endif
87
88#if __has_feature(ptrauth_calls)
89
90// ptrauth_string_discriminator("__cxa_exception::actionRecord") == 0xFC91
91# define __ptrauth_cxxabi_action_record __ptrauth(ptrauth_key_process_dependent_data, 1, 0xFC91)
92
93// ptrauth_string_discriminator("__cxa_exception::languageSpecificData") == 0xE8EE
94# define __ptrauth_cxxabi_lsd __ptrauth(ptrauth_key_process_dependent_data, 1, 0xE8EE)
95
96// ptrauth_string_discriminator("__cxa_exception::catchTemp") == 0xFA58
97# define __ptrauth_cxxabi_catch_temp_disc 0xFA58
98# define __ptrauth_cxxabi_catch_temp_key ptrauth_key_process_dependent_data
99# define __ptrauth_cxxabi_catch_temp __ptrauth(__ptrauth_cxxabi_catch_temp_key, 1, __ptrauth_cxxabi_catch_temp_disc)
100
101// ptrauth_string_discriminator("__cxa_exception::adjustedPtr") == 0x99E4
102# define __ptrauth_cxxabi_adjusted_ptr __ptrauth(ptrauth_key_process_dependent_data, 1, 0x99E4)
103
104// ptrauth_string_discriminator("__cxa_exception::unexpectedHandler") == 0x99A9
105# define __ptrauth_cxxabi_unexpected_handler __ptrauth(ptrauth_key_function_pointer, 1, 0x99A9)
106
107// ptrauth_string_discriminator("__cxa_exception::terminateHandler") == 0x0886)
108# define __ptrauth_cxxabi_terminate_handler __ptrauth(ptrauth_key_function_pointer, 1, 0x886)
109
110// ptrauth_string_discriminator("__cxa_exception::exceptionDestructor") == 0xC088
111# define __ptrauth_cxxabi_exception_destructor __ptrauth(ptrauth_key_function_pointer, 1, 0xC088)
112
113#else
114
115# define __ptrauth_cxxabi_action_record
116# define __ptrauth_cxxabi_lsd
117# define __ptrauth_cxxabi_catch_temp
118# define __ptrauth_cxxabi_adjusted_ptr
119# define __ptrauth_cxxabi_unexpected_handler
120# define __ptrauth_cxxabi_terminate_handler
121# define __ptrauth_cxxabi_exception_destructor
122
123#endif
124
106#if __cplusplus < 201103L125#if __cplusplus < 201103L
107# define _LIBCXXABI_NOEXCEPT throw()126# define _LIBCXXABI_NOEXCEPT throw()
108#else127#else
lib/libcxxabi/src/cxa_exception.cpp+4-2
...@@ -192,7 +192,9 @@ void *__cxa_allocate_exception(size_t thrown_size) throw() {...@@ -192,7 +192,9 @@ void *__cxa_allocate_exception(size_t thrown_size) throw() {
192 std::terminate();192 std::terminate();
193 __cxa_exception *exception_header =193 __cxa_exception *exception_header =
194 static_cast<__cxa_exception *>((void *)(raw_buffer + header_offset));194 static_cast<__cxa_exception *>((void *)(raw_buffer + header_offset));
195 ::memset(exception_header, 0, actual_size);195 // We warn on memset to a non-trivially castable type. We might want to
196 // change that diagnostic to not fire on a trivially obvious zero fill.
197 ::memset(static_cast<void*>(exception_header), 0, actual_size);
196 return thrown_object_from_cxa_exception(exception_header);198 return thrown_object_from_cxa_exception(exception_header);
197}199}
198200
...@@ -226,7 +228,7 @@ __cxa_exception* __cxa_init_primary_exception(void* object, std::type_info* tinf...@@ -226,7 +228,7 @@ __cxa_exception* __cxa_init_primary_exception(void* object, std::type_info* tinf
226}228}
227229
228// This function shall allocate a __cxa_dependent_exception and230// This function shall allocate a __cxa_dependent_exception and
229// return a pointer to it. (Really to the object, not past its' end).231// return a pointer to it. (Really to the object, not past its end).
230// Otherwise, it will work like __cxa_allocate_exception.232// Otherwise, it will work like __cxa_allocate_exception.
231void * __cxa_allocate_dependent_exception () {233void * __cxa_allocate_dependent_exception () {
232 size_t actual_size = sizeof(__cxa_dependent_exception);234 size_t actual_size = sizeof(__cxa_dependent_exception);
lib/libcxxabi/src/cxa_exception.h+16-14
...@@ -47,10 +47,10 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {...@@ -47,10 +47,10 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
47 // In Wasm, a destructor returns its argument47 // In Wasm, a destructor returns its argument
48 void *(_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);48 void *(_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);
49#else49#else
50 void (_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);50 void (_LIBCXXABI_DTOR_FUNC *__ptrauth_cxxabi_exception_destructor exceptionDestructor)(void *);
51#endif51#endif
52 std::unexpected_handler unexpectedHandler;52 std::unexpected_handler __ptrauth_cxxabi_unexpected_handler unexpectedHandler;
53 std::terminate_handler terminateHandler;53 std::terminate_handler __ptrauth_cxxabi_terminate_handler terminateHandler;
5454
55 __cxa_exception *nextException;55 __cxa_exception *nextException;
5656
...@@ -61,10 +61,10 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {...@@ -61,10 +61,10 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
61 int propagationCount;61 int propagationCount;
62#else62#else
63 int handlerSwitchValue;63 int handlerSwitchValue;
64 const unsigned char *actionRecord;64 const unsigned char *__ptrauth_cxxabi_action_record actionRecord;
65 const unsigned char *languageSpecificData;65 const unsigned char *__ptrauth_cxxabi_lsd languageSpecificData;
66 void *catchTemp;66 void *__ptrauth_cxxabi_catch_temp catchTemp;
67 void *adjustedPtr;67 void *__ptrauth_cxxabi_adjusted_ptr adjustedPtr;
68#endif68#endif
6969
70#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)70#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)
...@@ -79,6 +79,8 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {...@@ -79,6 +79,8 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
79// http://sourcery.mentor.com/archives/cxx-abi-dev/msg01924.html79// http://sourcery.mentor.com/archives/cxx-abi-dev/msg01924.html
80// The layout of this structure MUST match the layout of __cxa_exception, with80// The layout of this structure MUST match the layout of __cxa_exception, with
81// primaryException instead of referenceCount.81// primaryException instead of referenceCount.
82// The pointer authentication schemas specified here must also match those of
83// the corresponding members in __cxa_exception.
82struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {84struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
83#if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)85#if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)
84 void* reserve; // padding.86 void* reserve; // padding.
...@@ -86,9 +88,9 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {...@@ -86,9 +88,9 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
86#endif88#endif
8789
88 std::type_info *exceptionType;90 std::type_info *exceptionType;
89 void (_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);91 void (_LIBCXXABI_DTOR_FUNC *__ptrauth_cxxabi_exception_destructor exceptionDestructor)(void *);
90 std::unexpected_handler unexpectedHandler;92 std::unexpected_handler __ptrauth_cxxabi_unexpected_handler unexpectedHandler;
91 std::terminate_handler terminateHandler;93 std::terminate_handler __ptrauth_cxxabi_terminate_handler terminateHandler;
9294
93 __cxa_exception *nextException;95 __cxa_exception *nextException;
9496
...@@ -99,10 +101,10 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {...@@ -99,10 +101,10 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
99 int propagationCount;101 int propagationCount;
100#else102#else
101 int handlerSwitchValue;103 int handlerSwitchValue;
102 const unsigned char *actionRecord;104 const unsigned char *__ptrauth_cxxabi_action_record actionRecord;
103 const unsigned char *languageSpecificData;105 const unsigned char *__ptrauth_cxxabi_lsd languageSpecificData;
104 void * catchTemp;106 void *__ptrauth_cxxabi_catch_temp catchTemp;
105 void *adjustedPtr;107 void *__ptrauth_cxxabi_adjusted_ptr adjustedPtr;
106#endif108#endif
107109
108#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)110#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)
lib/libcxxabi/src/cxa_personality.cpp+125-12
...@@ -20,7 +20,52 @@...@@ -20,7 +20,52 @@
20#include "cxa_exception.h"20#include "cxa_exception.h"
21#include "cxa_handlers.h"21#include "cxa_handlers.h"
22#include "private_typeinfo.h"22#include "private_typeinfo.h"
23#include "unwind.h"23
24#if __has_feature(ptrauth_calls)
25
26// CXXABI depends on defintions in libunwind as pointer auth couples the
27// definitions
28# include "libunwind.h"
29
30// The actual value of the discriminators listed below is not important.
31// The derivation of the constants is only being included for the purpose
32// of maintaining a record of how they were originally produced.
33
34// ptrauth_string_discriminator("scan_results::languageSpecificData") == 0xE50D)
35# define __ptrauth_scan_results_lsd __ptrauth(ptrauth_key_process_dependent_code, 1, 0xE50D)
36
37// ptrauth_string_discriminator("scan_results::actionRecord") == 0x9823
38# define __ptrauth_scan_results_action_record __ptrauth(ptrauth_key_process_dependent_code, 1, 0x9823)
39
40// scan result is broken up as we have a manual re-sign that requires each component
41# define __ptrauth_scan_results_landingpad_key ptrauth_key_process_dependent_code
42// ptrauth_string_discriminator("scan_results::landingPad") == 0xD27C
43# define __ptrauth_scan_results_landingpad_disc 0xD27C
44# define __ptrauth_scan_results_landingpad \
45 __ptrauth(__ptrauth_scan_results_landingpad_key, 1, __ptrauth_scan_results_landingpad_disc)
46
47// `__ptrauth_restricted_intptr` is a feature of apple clang that predates
48// support for direct application of `__ptrauth` to integer types. This
49// guard is necessary to support compilation with those compiler.
50# if __has_extension(ptrauth_restricted_intptr_qualifier)
51# define __ptrauth_scan_results_landingpad_intptr \
52 __ptrauth_restricted_intptr(__ptrauth_scan_results_landingpad_key, 1, __ptrauth_scan_results_landingpad_disc)
53# else
54# define __ptrauth_scan_results_landingpad_intptr \
55 __ptrauth(__ptrauth_scan_results_landingpad_key, 1, __ptrauth_scan_results_landingpad_disc)
56# endif
57
58#else
59# define __ptrauth_scan_results_lsd
60# define __ptrauth_scan_results_action_record
61# define __ptrauth_scan_results_landingpad
62# define __ptrauth_scan_results_landingpad_intptr
63#endif
64
65// The functions defined in this file are magic functions called only by the compiler.
66#ifdef __clang__
67# pragma clang diagnostic ignored "-Wmissing-prototypes"
68#endif
2469
25// TODO: This is a temporary workaround for libc++abi to recognize that it's being70// TODO: This is a temporary workaround for libc++abi to recognize that it's being
26// built against LLVM's libunwind. LLVM's libunwind started reporting _LIBUNWIND_VERSION71// built against LLVM's libunwind. LLVM's libunwind started reporting _LIBUNWIND_VERSION
...@@ -527,12 +572,17 @@ get_thrown_object_ptr(_Unwind_Exception* unwind_exception)...@@ -527,12 +572,17 @@ get_thrown_object_ptr(_Unwind_Exception* unwind_exception)
527namespace572namespace
528{573{
529574
575typedef const uint8_t *__ptrauth_scan_results_lsd lsd_ptr_t;
576typedef const uint8_t *__ptrauth_scan_results_action_record action_ptr_t;
577typedef uintptr_t __ptrauth_scan_results_landingpad_intptr landing_pad_t;
578typedef void *__ptrauth_scan_results_landingpad landing_pad_ptr_t;
579
530struct scan_results580struct scan_results
531{581{
532 int64_t ttypeIndex; // > 0 catch handler, < 0 exception spec handler, == 0 a cleanup582 int64_t ttypeIndex; // > 0 catch handler, < 0 exception spec handler, == 0 a cleanup
533 const uint8_t* actionRecord; // Currently unused. Retained to ease future maintenance.583 action_ptr_t actionRecord; // Currently unused. Retained to ease future maintenance.
534 const uint8_t* languageSpecificData; // Needed only for __cxa_call_unexpected584 lsd_ptr_t languageSpecificData; // Needed only for __cxa_call_unexpected
535 uintptr_t landingPad; // null -> nothing found, else something found585 landing_pad_t landingPad; // null -> nothing found, else something found
536 void* adjustedPtr; // Used in cxa_exception.cpp586 void* adjustedPtr; // Used in cxa_exception.cpp
537 _Unwind_Reason_Code reason; // One of _URC_FATAL_PHASE1_ERROR,587 _Unwind_Reason_Code reason; // One of _URC_FATAL_PHASE1_ERROR,
538 // _URC_FATAL_PHASE2_ERROR,588 // _URC_FATAL_PHASE2_ERROR,
...@@ -557,7 +607,23 @@ set_registers(_Unwind_Exception* unwind_exception, _Unwind_Context* context,...@@ -557,7 +607,23 @@ set_registers(_Unwind_Exception* unwind_exception, _Unwind_Context* context,
557 reinterpret_cast<uintptr_t>(unwind_exception));607 reinterpret_cast<uintptr_t>(unwind_exception));
558 _Unwind_SetGR(context, __builtin_eh_return_data_regno(1),608 _Unwind_SetGR(context, __builtin_eh_return_data_regno(1),
559 static_cast<uintptr_t>(results.ttypeIndex));609 static_cast<uintptr_t>(results.ttypeIndex));
610#if __has_feature(ptrauth_calls)
611 auto stackPointer = _Unwind_GetGR(context, UNW_REG_SP);
612 // We manually re-sign the IP as the __ptrauth qualifiers cannot
613 // express the required relationship with the destination address
614 const auto existingDiscriminator =
615 ptrauth_blend_discriminator(&results.landingPad,
616 __ptrauth_scan_results_landingpad_disc);
617 unw_word_t newIP /* opaque __ptrauth(ptrauth_key_return_address, stackPointer, 0) */ =
618 (unw_word_t)ptrauth_auth_and_resign(*(void* const*)&results.landingPad,
619 __ptrauth_scan_results_landingpad_key,
620 existingDiscriminator,
621 ptrauth_key_return_address,
622 stackPointer);
623 _Unwind_SetIP(context, newIP);
624#else
560 _Unwind_SetIP(context, results.landingPad);625 _Unwind_SetIP(context, results.landingPad);
626#endif
561}627}
562628
563/*629/*
...@@ -691,12 +757,12 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,...@@ -691,12 +757,12 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
691 // The call sites are ordered in increasing value of start757 // The call sites are ordered in increasing value of start
692 uintptr_t start = readEncodedPointer(&callSitePtr, callSiteEncoding);758 uintptr_t start = readEncodedPointer(&callSitePtr, callSiteEncoding);
693 uintptr_t length = readEncodedPointer(&callSitePtr, callSiteEncoding);759 uintptr_t length = readEncodedPointer(&callSitePtr, callSiteEncoding);
694 uintptr_t landingPad = readEncodedPointer(&callSitePtr, callSiteEncoding);760 landing_pad_t landingPad = readEncodedPointer(&callSitePtr, callSiteEncoding);
695 uintptr_t actionEntry = readULEB128(&callSitePtr);761 uintptr_t actionEntry = readULEB128(&callSitePtr);
696 if ((start <= ipOffset) && (ipOffset < (start + length)))762 if ((start <= ipOffset) && (ipOffset < (start + length)))
697#else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__763#else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
698 // ip is 1-based index into this table764 // ip is 1-based index into this table
699 uintptr_t landingPad = readULEB128(&callSitePtr);765 landing_pad_t landingPad = readULEB128(&callSitePtr);
700 uintptr_t actionEntry = readULEB128(&callSitePtr);766 uintptr_t actionEntry = readULEB128(&callSitePtr);
701 if (--ip == 0)767 if (--ip == 0)
702#endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__768#endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
...@@ -903,6 +969,57 @@ _UA_CLEANUP_PHASE...@@ -903,6 +969,57 @@ _UA_CLEANUP_PHASE
903*/969*/
904970
905#if !defined(_LIBCXXABI_ARM_EHABI)971#if !defined(_LIBCXXABI_ARM_EHABI)
972
973// We use these helper functions to work around the behavior of casting between
974// integers (even those that are authenticated) and authenticated pointers.
975// Because the schemas being used are address discriminated we cannot use a
976// trivial value union to coerce the types so instead we perform the re-signing
977// manually.
978using __cxa_catch_temp_type = decltype(__cxa_exception::catchTemp);
979static inline void set_landing_pad(scan_results& results,
980 const __cxa_catch_temp_type& source) {
981#if __has_feature(ptrauth_calls)
982 const uintptr_t sourceDiscriminator =
983 ptrauth_blend_discriminator(&source, __ptrauth_cxxabi_catch_temp_disc);
984 const uintptr_t targetDiscriminator =
985 ptrauth_blend_discriminator(&results.landingPad,
986 __ptrauth_scan_results_landingpad_disc);
987 uintptr_t reauthenticatedLandingPad =
988 (uintptr_t)ptrauth_auth_and_resign(*reinterpret_cast<void* const*>(&source),
989 __ptrauth_cxxabi_catch_temp_key,
990 sourceDiscriminator,
991 __ptrauth_scan_results_landingpad_key,
992 targetDiscriminator);
993 memmove(reinterpret_cast<void *>(&results.landingPad),
994 reinterpret_cast<void *>(&reauthenticatedLandingPad),
995 sizeof(reauthenticatedLandingPad));
996#else
997 results.landingPad = reinterpret_cast<landing_pad_t>(source);
998#endif
999}
1000
1001static inline void get_landing_pad(__cxa_catch_temp_type &dest,
1002 const scan_results &results) {
1003#if __has_feature(ptrauth_calls)
1004 const uintptr_t sourceDiscriminator =
1005 ptrauth_blend_discriminator(&results.landingPad,
1006 __ptrauth_scan_results_landingpad_disc);
1007 const uintptr_t targetDiscriminator =
1008 ptrauth_blend_discriminator(&dest, __ptrauth_cxxabi_catch_temp_disc);
1009 uintptr_t reauthenticatedPointer =
1010 (uintptr_t)ptrauth_auth_and_resign(*reinterpret_cast<void* const*>(&results.landingPad),
1011 __ptrauth_scan_results_landingpad_key,
1012 sourceDiscriminator,
1013 __ptrauth_cxxabi_catch_temp_key,
1014 targetDiscriminator);
1015 memmove(reinterpret_cast<void *>(&dest),
1016 reinterpret_cast<void *>(&reauthenticatedPointer),
1017 sizeof(reauthenticatedPointer));
1018#else
1019 dest = reinterpret_cast<__cxa_catch_temp_type>(results.landingPad);
1020#endif
1021}
1022
906#ifdef __WASM_EXCEPTIONS__1023#ifdef __WASM_EXCEPTIONS__
907_Unwind_Reason_Code __gxx_personality_wasm01024_Unwind_Reason_Code __gxx_personality_wasm0
908#elif defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)1025#elif defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
...@@ -935,8 +1052,7 @@ __gxx_personality_v0...@@ -935,8 +1052,7 @@ __gxx_personality_v0
935 results.ttypeIndex = exception_header->handlerSwitchValue;1052 results.ttypeIndex = exception_header->handlerSwitchValue;
936 results.actionRecord = exception_header->actionRecord;1053 results.actionRecord = exception_header->actionRecord;
937 results.languageSpecificData = exception_header->languageSpecificData;1054 results.languageSpecificData = exception_header->languageSpecificData;
938 results.landingPad =1055 set_landing_pad(results, exception_header->catchTemp);
939 reinterpret_cast<uintptr_t>(exception_header->catchTemp);
940 results.adjustedPtr = exception_header->adjustedPtr;1056 results.adjustedPtr = exception_header->adjustedPtr;
9411057
942 // Jump to the handler.1058 // Jump to the handler.
...@@ -970,7 +1086,7 @@ __gxx_personality_v0...@@ -970,7 +1086,7 @@ __gxx_personality_v0
970 exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);1086 exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
971 exc->actionRecord = results.actionRecord;1087 exc->actionRecord = results.actionRecord;
972 exc->languageSpecificData = results.languageSpecificData;1088 exc->languageSpecificData = results.languageSpecificData;
973 exc->catchTemp = reinterpret_cast<void*>(results.landingPad);1089 get_landing_pad(exc->catchTemp, results);
974 exc->adjustedPtr = results.adjustedPtr;1090 exc->adjustedPtr = results.adjustedPtr;
975#ifdef __WASM_EXCEPTIONS__1091#ifdef __WASM_EXCEPTIONS__
976 // Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the1092 // Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the
...@@ -1009,9 +1125,6 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,...@@ -1009,9 +1125,6 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
10091125
1010#else1126#else
10111127
1012extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*,
1013 _Unwind_Context*);
1014
1015// Helper function to unwind one frame.1128// Helper function to unwind one frame.
1016// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the1129// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the
1017// personality routine should update the virtual register set (VRS) according to the1130// personality routine should update the virtual register set (VRS) according to the
lib/libcxxabi/src/cxa_thread_atexit.cpp+2-1
...@@ -106,6 +106,7 @@ namespace {...@@ -106,6 +106,7 @@ namespace {
106106
107#endif // HAVE___CXA_THREAD_ATEXIT_IMPL107#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
108108
109#if defined(__linux__) || defined(__Fuchsia__)
109extern "C" {110extern "C" {
110111
111 _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {112 _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {
...@@ -140,6 +141,6 @@ extern "C" {...@@ -140,6 +141,6 @@ extern "C" {
140 }141 }
141#endif // HAVE___CXA_THREAD_ATEXIT_IMPL142#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
142 }143 }
143
144} // extern "C"144} // extern "C"
145#endif // defined(__linux__) || defined(__Fuchsia__)
145} // namespace __cxxabiv1146} // namespace __cxxabiv1
lib/libcxxabi/src/demangle/DemangleConfig.h+4
...@@ -115,4 +115,8 @@...@@ -115,4 +115,8 @@
115#define DEMANGLE_NAMESPACE_BEGIN namespace { namespace itanium_demangle {115#define DEMANGLE_NAMESPACE_BEGIN namespace { namespace itanium_demangle {
116#define DEMANGLE_NAMESPACE_END } }116#define DEMANGLE_NAMESPACE_END } }
117117
118// The DEMANGLE_ABI macro resolves to nothing when building libc++abi. Only
119// the llvm copy defines DEMANGLE_ABI as a visibility attribute.
120#define DEMANGLE_ABI
121
118#endif // LIBCXXABI_DEMANGLE_DEMANGLE_CONFIG_H122#endif // LIBCXXABI_DEMANGLE_DEMANGLE_CONFIG_H
lib/libcxxabi/src/demangle/ItaniumDemangle.h+9-6
...@@ -1366,7 +1366,7 @@ public:...@@ -1366,7 +1366,7 @@ public:
1366 template <typename Fn> void match(Fn F) const { F(Name, Params, Requires); }1366 template <typename Fn> void match(Fn F) const { F(Name, Params, Requires); }
13671367
1368 void printLeft(OutputBuffer &OB) const override {1368 void printLeft(OutputBuffer &OB) const override {
1369 ScopedOverride<unsigned> LT(OB.GtIsGt, 0);1369 ScopedOverride<bool> LT(OB.TemplateTracker.InsideTemplate, true);
1370 OB += "template<";1370 OB += "template<";
1371 Params.printWithComma(OB);1371 Params.printWithComma(OB);
1372 OB += "> typename ";1372 OB += "> typename ";
...@@ -1550,7 +1550,7 @@ public:...@@ -1550,7 +1550,7 @@ public:
1550 NodeArray getParams() { return Params; }1550 NodeArray getParams() { return Params; }
15511551
1552 void printLeft(OutputBuffer &OB) const override {1552 void printLeft(OutputBuffer &OB) const override {
1553 ScopedOverride<unsigned> LT(OB.GtIsGt, 0);1553 ScopedOverride<bool> LT(OB.TemplateTracker.InsideTemplate, true);
1554 OB += "<";1554 OB += "<";
1555 Params.printWithComma(OB);1555 Params.printWithComma(OB);
1556 OB += ">";1556 OB += ">";
...@@ -1824,7 +1824,7 @@ public:...@@ -1824,7 +1824,7 @@ public:
18241824
1825 void printDeclarator(OutputBuffer &OB) const {1825 void printDeclarator(OutputBuffer &OB) const {
1826 if (!TemplateParams.empty()) {1826 if (!TemplateParams.empty()) {
1827 ScopedOverride<unsigned> LT(OB.GtIsGt, 0);1827 ScopedOverride<bool> LT(OB.TemplateTracker.InsideTemplate, true);
1828 OB += "<";1828 OB += "<";
1829 TemplateParams.printWithComma(OB);1829 TemplateParams.printWithComma(OB);
1830 OB += ">";1830 OB += ">";
...@@ -1885,7 +1885,9 @@ public:...@@ -1885,7 +1885,9 @@ public:
1885 }1885 }
18861886
1887 void printLeft(OutputBuffer &OB) const override {1887 void printLeft(OutputBuffer &OB) const override {
1888 bool ParenAll = OB.isGtInsideTemplateArgs() &&1888 // If we're printing a '<' inside of a template argument, and we haven't
1889 // yet parenthesized the expression, do so now.
1890 bool ParenAll = !OB.isInParensInTemplateArgs() &&
1889 (InfixOperator == ">" || InfixOperator == ">>");1891 (InfixOperator == ">" || InfixOperator == ">>");
1890 if (ParenAll)1892 if (ParenAll)
1891 OB.printOpen();1893 OB.printOpen();
...@@ -2061,7 +2063,7 @@ public:...@@ -2061,7 +2063,7 @@ public:
2061 void printLeft(OutputBuffer &OB) const override {2063 void printLeft(OutputBuffer &OB) const override {
2062 OB += CastKind;2064 OB += CastKind;
2063 {2065 {
2064 ScopedOverride<unsigned> LT(OB.GtIsGt, 0);2066 ScopedOverride<bool> LT(OB.TemplateTracker.InsideTemplate, true);
2065 OB += "<";2067 OB += "<";
2066 OB.printLeft(*To);2068 OB.printLeft(*To);
2067 OB += ">";2069 OB += ">";
...@@ -3049,7 +3051,8 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {...@@ -3049,7 +3051,8 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
3049 Node *parse(bool ParseParams = true);3051 Node *parse(bool ParseParams = true);
3050};3052};
30513053
3052const char* parse_discriminator(const char* first, const char* last);3054DEMANGLE_ABI const char *parse_discriminator(const char *first,
3055 const char *last);
30533056
3054// <name> ::= <nested-name> // N3057// <name> ::= <nested-name> // N
3055// ::= <local-name> # See Scope Encoding below // Z3058// ::= <local-name> # See Scope Encoding below // Z
lib/libcxxabi/src/demangle/Utility.h+21-7
...@@ -81,7 +81,7 @@ public:...@@ -81,7 +81,7 @@ public:
81 OutputBuffer(const OutputBuffer &) = delete;81 OutputBuffer(const OutputBuffer &) = delete;
82 OutputBuffer &operator=(const OutputBuffer &) = delete;82 OutputBuffer &operator=(const OutputBuffer &) = delete;
8383
84 virtual ~OutputBuffer() {}84 virtual ~OutputBuffer() = default;
8585
86 operator std::string_view() const {86 operator std::string_view() const {
87 return std::string_view(Buffer, CurrentPosition);87 return std::string_view(Buffer, CurrentPosition);
...@@ -104,18 +104,32 @@ public:...@@ -104,18 +104,32 @@ public:
104 unsigned CurrentPackIndex = std::numeric_limits<unsigned>::max();104 unsigned CurrentPackIndex = std::numeric_limits<unsigned>::max();
105 unsigned CurrentPackMax = std::numeric_limits<unsigned>::max();105 unsigned CurrentPackMax = std::numeric_limits<unsigned>::max();
106106
107 /// When zero, we're printing template args and '>' needs to be parenthesized.107 struct {
108 /// Use a counter so we can simply increment inside parentheses.108 /// The depth of '(' and ')' inside the currently printed template
109 unsigned GtIsGt = 1;109 /// arguments.
110 unsigned ParenDepth = 0;
110111
111 bool isGtInsideTemplateArgs() const { return GtIsGt == 0; }112 /// True if we're currently printing a template argument.
113 bool InsideTemplate = false;
114 } TemplateTracker;
115
116 /// Returns true if we're currently between a '(' and ')' when printing
117 /// template args.
118 bool isInParensInTemplateArgs() const {
119 return TemplateTracker.ParenDepth > 0;
120 }
121
122 /// Returns true if we're printing template args.
123 bool isInsideTemplateArgs() const { return TemplateTracker.InsideTemplate; }
112124
113 void printOpen(char Open = '(') {125 void printOpen(char Open = '(') {
114 GtIsGt++;126 if (isInsideTemplateArgs())
127 TemplateTracker.ParenDepth++;
115 *this += Open;128 *this += Open;
116 }129 }
117 void printClose(char Close = ')') {130 void printClose(char Close = ')') {
118 GtIsGt--;131 if (isInsideTemplateArgs())
132 TemplateTracker.ParenDepth--;
119 *this += Close;133 *this += Close;
120 }134 }
121135
lib/libcxxabi/src/fallback_malloc.cpp+1-1
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
16#endif16#endif
17#endif17#endif
1818
19#include <__memory/aligned_alloc.h>19#include "include/aligned_alloc.h" // from libc++
20#include <__assert>20#include <__assert>
21#include <stdlib.h> // for malloc, calloc, free21#include <stdlib.h> // for malloc, calloc, free
22#include <string.h> // for memset22#include <string.h> // for memset
lib/libcxxabi/src/private_typeinfo.cpp+6
...@@ -831,6 +831,10 @@ bool __pointer_to_member_type_info::can_catch_nested(...@@ -831,6 +831,10 @@ bool __pointer_to_member_type_info::can_catch_nested(
831#pragma clang diagnostic ignored "-Wmissing-field-initializers"831#pragma clang diagnostic ignored "-Wmissing-field-initializers"
832#endif832#endif
833833
834#pragma GCC diagnostic push
835// __dynamic_cast is called by the compiler, so there is no prototype
836#pragma GCC diagnostic ignored "-Wmissing-prototypes"
837
834// __dynamic_cast838// __dynamic_cast
835839
836// static_ptr: pointer to an object of type static_type; nonnull, and since the840// static_ptr: pointer to an object of type static_type; nonnull, and since the
...@@ -953,6 +957,8 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,...@@ -953,6 +957,8 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
953 return const_cast<void*>(dst_ptr);957 return const_cast<void*>(dst_ptr);
954}958}
955959
960#pragma GCC diagnostic pop
961
956#ifdef __clang__962#ifdef __clang__
957#pragma clang diagnostic pop963#pragma clang diagnostic pop
958#endif964#endif
lib/libcxxabi/src/stdlib_new_delete.cpp+5-5
...@@ -8,8 +8,8 @@...@@ -8,8 +8,8 @@
88
9#include "__cxxabi_config.h"9#include "__cxxabi_config.h"
10#include "abort_message.h"10#include "abort_message.h"
11#include "include/aligned_alloc.h" // from libc++
11#include "include/overridable_function.h" // from libc++12#include "include/overridable_function.h" // from libc++
12#include <__memory/aligned_alloc.h>
13#include <cstddef>13#include <cstddef>
14#include <cstdlib>14#include <cstdlib>
15#include <new>15#include <new>
...@@ -63,7 +63,7 @@ static void* operator_new_impl(std::size_t size) {...@@ -63,7 +63,7 @@ static void* operator_new_impl(std::size_t size) {
63 return p;63 return p;
64}64}
6565
66_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new, (std::size_t size)) _THROW_BAD_ALLOC {66OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {
67 void* p = operator_new_impl(size);67 void* p = operator_new_impl(size);
68 if (p == nullptr)68 if (p == nullptr)
69 __throw_bad_alloc_shim();69 __throw_bad_alloc_shim();
...@@ -94,7 +94,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {...@@ -94,7 +94,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
94#endif94#endif
95}95}
9696
97_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new[], (size_t size)) _THROW_BAD_ALLOC { return ::operator new(size); }97OVERRIDABLE_FUNCTION void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }
9898
99_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {99_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
100#if !_LIBCPP_HAS_EXCEPTIONS100#if !_LIBCPP_HAS_EXCEPTIONS
...@@ -154,7 +154,7 @@ static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignm...@@ -154,7 +154,7 @@ static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignm
154 return p;154 return p;
155}155}
156156
157_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new, (std::size_t size, std::align_val_t alignment)) _THROW_BAD_ALLOC {157OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
158 void* p = operator_new_aligned_impl(size, alignment);158 void* p = operator_new_aligned_impl(size, alignment);
159 if (p == nullptr)159 if (p == nullptr)
160 __throw_bad_alloc_shim();160 __throw_bad_alloc_shim();
...@@ -185,7 +185,7 @@ _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const s...@@ -185,7 +185,7 @@ _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const s
185# endif185# endif
186}186}
187187
188_LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new[], (size_t size, std::align_val_t alignment)) _THROW_BAD_ALLOC {188OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
189 return ::operator new(size, alignment);189 return ::operator new(size, alignment);
190}190}
191191
lib/libtsan/LICENSE.TXT created+311
...@@ -0,0 +1,311 @@
1==============================================================================
2The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
3==============================================================================
4
5 Apache License
6 Version 2.0, January 2004
7 http://www.apache.org/licenses/
8
9 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10
11 1. Definitions.
12
13 "License" shall mean the terms and conditions for use, reproduction,
14 and distribution as defined by Sections 1 through 9 of this document.
15
16 "Licensor" shall mean the copyright owner or entity authorized by
17 the copyright owner that is granting the License.
18
19 "Legal Entity" shall mean the union of the acting entity and all
20 other entities that control, are controlled by, or are under common
21 control with that entity. For the purposes of this definition,
22 "control" means (i) the power, direct or indirect, to cause the
23 direction or management of such entity, whether by contract or
24 otherwise, or (ii) ownership of fifty percent (50%) or more of the
25 outstanding shares, or (iii) beneficial ownership of such entity.
26
27 "You" (or "Your") shall mean an individual or Legal Entity
28 exercising permissions granted by this License.
29
30 "Source" form shall mean the preferred form for making modifications,
31 including but not limited to software source code, documentation
32 source, and configuration files.
33
34 "Object" form shall mean any form resulting from mechanical
35 transformation or translation of a Source form, including but
36 not limited to compiled object code, generated documentation,
37 and conversions to other media types.
38
39 "Work" shall mean the work of authorship, whether in Source or
40 Object form, made available under the License, as indicated by a
41 copyright notice that is included in or attached to the work
42 (an example is provided in the Appendix below).
43
44 "Derivative Works" shall mean any work, whether in Source or Object
45 form, that is based on (or derived from) the Work and for which the
46 editorial revisions, annotations, elaborations, or other modifications
47 represent, as a whole, an original work of authorship. For the purposes
48 of this License, Derivative Works shall not include works that remain
49 separable from, or merely link (or bind by name) to the interfaces of,
50 the Work and Derivative Works thereof.
51
52 "Contribution" shall mean any work of authorship, including
53 the original version of the Work and any modifications or additions
54 to that Work or Derivative Works thereof, that is intentionally
55 submitted to Licensor for inclusion in the Work by the copyright owner
56 or by an individual or Legal Entity authorized to submit on behalf of
57 the copyright owner. For the purposes of this definition, "submitted"
58 means any form of electronic, verbal, or written communication sent
59 to the Licensor or its representatives, including but not limited to
60 communication on electronic mailing lists, source code control systems,
61 and issue tracking systems that are managed by, or on behalf of, the
62 Licensor for the purpose of discussing and improving the Work, but
63 excluding communication that is conspicuously marked or otherwise
64 designated in writing by the copyright owner as "Not a Contribution."
65
66 "Contributor" shall mean Licensor and any individual or Legal Entity
67 on behalf of whom a Contribution has been received by Licensor and
68 subsequently incorporated within the Work.
69
70 2. Grant of Copyright License. Subject to the terms and conditions of
71 this License, each Contributor hereby grants to You a perpetual,
72 worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73 copyright license to reproduce, prepare Derivative Works of,
74 publicly display, publicly perform, sublicense, and distribute the
75 Work and such Derivative Works in Source or Object form.
76
77 3. Grant of Patent License. Subject to the terms and conditions of
78 this License, each Contributor hereby grants to You a perpetual,
79 worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80 (except as stated in this section) patent license to make, have made,
81 use, offer to sell, sell, import, and otherwise transfer the Work,
82 where such license applies only to those patent claims licensable
83 by such Contributor that are necessarily infringed by their
84 Contribution(s) alone or by combination of their Contribution(s)
85 with the Work to which such Contribution(s) was submitted. If You
86 institute patent litigation against any entity (including a
87 cross-claim or counterclaim in a lawsuit) alleging that the Work
88 or a Contribution incorporated within the Work constitutes direct
89 or contributory patent infringement, then any patent licenses
90 granted to You under this License for that Work shall terminate
91 as of the date such litigation is filed.
92
93 4. Redistribution. You may reproduce and distribute copies of the
94 Work or Derivative Works thereof in any medium, with or without
95 modifications, and in Source or Object form, provided that You
96 meet the following conditions:
97
98 (a) You must give any other recipients of the Work or
99 Derivative Works a copy of this License; and
100
101 (b) You must cause any modified files to carry prominent notices
102 stating that You changed the files; and
103
104 (c) You must retain, in the Source form of any Derivative Works
105 that You distribute, all copyright, patent, trademark, and
106 attribution notices from the Source form of the Work,
107 excluding those notices that do not pertain to any part of
108 the Derivative Works; and
109
110 (d) If the Work includes a "NOTICE" text file as part of its
111 distribution, then any Derivative Works that You distribute must
112 include a readable copy of the attribution notices contained
113 within such NOTICE file, excluding those notices that do not
114 pertain to any part of the Derivative Works, in at least one
115 of the following places: within a NOTICE text file distributed
116 as part of the Derivative Works; within the Source form or
117 documentation, if provided along with the Derivative Works; or,
118 within a display generated by the Derivative Works, if and
119 wherever such third-party notices normally appear. The contents
120 of the NOTICE file are for informational purposes only and
121 do not modify the License. You may add Your own attribution
122 notices within Derivative Works that You distribute, alongside
123 or as an addendum to the NOTICE text from the Work, provided
124 that such additional attribution notices cannot be construed
125 as modifying the License.
126
127 You may add Your own copyright statement to Your modifications and
128 may provide additional or different license terms and conditions
129 for use, reproduction, or distribution of Your modifications, or
130 for any such Derivative Works as a whole, provided Your use,
131 reproduction, and distribution of the Work otherwise complies with
132 the conditions stated in this License.
133
134 5. Submission of Contributions. Unless You explicitly state otherwise,
135 any Contribution intentionally submitted for inclusion in the Work
136 by You to the Licensor shall be under the terms and conditions of
137 this License, without any additional terms or conditions.
138 Notwithstanding the above, nothing herein shall supersede or modify
139 the terms of any separate license agreement you may have executed
140 with Licensor regarding such Contributions.
141
142 6. Trademarks. This License does not grant permission to use the trade
143 names, trademarks, service marks, or product names of the Licensor,
144 except as required for reasonable and customary use in describing the
145 origin of the Work and reproducing the content of the NOTICE file.
146
147 7. Disclaimer of Warranty. Unless required by applicable law or
148 agreed to in writing, Licensor provides the Work (and each
149 Contributor provides its Contributions) on an "AS IS" BASIS,
150 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
151 implied, including, without limitation, any warranties or conditions
152 of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
153 PARTICULAR PURPOSE. You are solely responsible for determining the
154 appropriateness of using or redistributing the Work and assume any
155 risks associated with Your exercise of permissions under this License.
156
157 8. Limitation of Liability. In no event and under no legal theory,
158 whether in tort (including negligence), contract, or otherwise,
159 unless required by applicable law (such as deliberate and grossly
160 negligent acts) or agreed to in writing, shall any Contributor be
161 liable to You for damages, including any direct, indirect, special,
162 incidental, or consequential damages of any character arising as a
163 result of this License or out of the use or inability to use the
164 Work (including but not limited to damages for loss of goodwill,
165 work stoppage, computer failure or malfunction, or any and all
166 other commercial damages or losses), even if such Contributor
167 has been advised of the possibility of such damages.
168
169 9. Accepting Warranty or Additional Liability. While redistributing
170 the Work or Derivative Works thereof, You may choose to offer,
171 and charge a fee for, acceptance of support, warranty, indemnity,
172 or other liability obligations and/or rights consistent with this
173 License. However, in accepting such obligations, You may act only
174 on Your own behalf and on Your sole responsibility, not on behalf
175 of any other Contributor, and only if You agree to indemnify,
176 defend, and hold each Contributor harmless for any liability
177 incurred by, or claims asserted against, such Contributor by reason
178 of your accepting any such warranty or additional liability.
179
180 END OF TERMS AND CONDITIONS
181
182 APPENDIX: How to apply the Apache License to your work.
183
184 To apply the Apache License to your work, attach the following
185 boilerplate notice, with the fields enclosed by brackets "[]"
186 replaced with your own identifying information. (Don't include
187 the brackets!) The text should be enclosed in the appropriate
188 comment syntax for the file format. We also recommend that a
189 file or class name and description of purpose be included on the
190 same "printed page" as the copyright notice for easier
191 identification within third-party archives.
192
193 Copyright [yyyy] [name of copyright owner]
194
195 Licensed under the Apache License, Version 2.0 (the "License");
196 you may not use this file except in compliance with the License.
197 You may obtain a copy of the License at
198
199 http://www.apache.org/licenses/LICENSE-2.0
200
201 Unless required by applicable law or agreed to in writing, software
202 distributed under the License is distributed on an "AS IS" BASIS,
203 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204 See the License for the specific language governing permissions and
205 limitations under the License.
206
207
208---- LLVM Exceptions to the Apache 2.0 License ----
209
210As an exception, if, as a result of your compiling your source code, portions
211of this Software are embedded into an Object form of such source code, you
212may redistribute such embedded portions in such Object form without complying
213with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
214
215In addition, if you combine or link compiled forms of this Software with
216software that is licensed under the GPLv2 ("Combined Software") and if a
217court of competent jurisdiction determines that the patent provision (Section
2183), the indemnity provision (Section 9) or other Section of the License
219conflicts with the conditions of the GPLv2, you may retroactively and
220prospectively choose to deem waived or otherwise exclude such Section(s) of
221the License, but only in their entirety and only with respect to the Combined
222Software.
223
224==============================================================================
225Software from third parties included in the LLVM Project:
226==============================================================================
227The LLVM Project contains third party software which is under different license
228terms. All such code will be identified clearly using at least one of two
229mechanisms:
2301) It will be in a separate directory tree with its own `LICENSE.txt` or
231 `LICENSE` file at the top containing the specific license and restrictions
232 which apply to that software, or
2332) It will contain specific license and restriction terms at the top of every
234 file.
235
236==============================================================================
237Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
238==============================================================================
239
240The compiler_rt library is dual licensed under both the University of Illinois
241"BSD-Like" license and the MIT license. As a user of this code you may choose
242to use it under either license. As a contributor, you agree to allow your code
243to be used under both.
244
245Full text of the relevant licenses is included below.
246
247==============================================================================
248
249University of Illinois/NCSA
250Open Source License
251
252Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT
253
254All rights reserved.
255
256Developed by:
257
258 LLVM Team
259
260 University of Illinois at Urbana-Champaign
261
262 http://llvm.org
263
264Permission is hereby granted, free of charge, to any person obtaining a copy of
265this software and associated documentation files (the "Software"), to deal with
266the Software without restriction, including without limitation the rights to
267use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
268of the Software, and to permit persons to whom the Software is furnished to do
269so, subject to the following conditions:
270
271 * Redistributions of source code must retain the above copyright notice,
272 this list of conditions and the following disclaimers.
273
274 * Redistributions in binary form must reproduce the above copyright notice,
275 this list of conditions and the following disclaimers in the
276 documentation and/or other materials provided with the distribution.
277
278 * Neither the names of the LLVM Team, University of Illinois at
279 Urbana-Champaign, nor the names of its contributors may be used to
280 endorse or promote products derived from this Software without specific
281 prior written permission.
282
283THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
284IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
285FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
286CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
287LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
288OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
289SOFTWARE.
290
291==============================================================================
292
293Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
294
295Permission is hereby granted, free of charge, to any person obtaining a copy
296of this software and associated documentation files (the "Software"), to deal
297in the Software without restriction, including without limitation the rights
298to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
299copies of the Software, and to permit persons to whom the Software is
300furnished to do so, subject to the following conditions:
301
302The above copyright notice and this permission notice shall be included in
303all copies or substantial portions of the Software.
304
305THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
306IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
307FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
308AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
309LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
310OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
311THE SOFTWARE.
lib/libtsan/builtins/assembly.h+41-8
...@@ -14,7 +14,7 @@...@@ -14,7 +14,7 @@
14#ifndef COMPILERRT_ASSEMBLY_H14#ifndef COMPILERRT_ASSEMBLY_H
15#define COMPILERRT_ASSEMBLY_H15#define COMPILERRT_ASSEMBLY_H
1616
17#if defined(__linux__) && defined(__CET__)17#ifdef __CET__
18#if __has_include(<cet.h>)18#if __has_include(<cet.h>)
19#include <cet.h>19#include <cet.h>
20#endif20#endif
...@@ -71,19 +71,35 @@...@@ -71,19 +71,35 @@
7171
72#endif72#endif
7373
74#if defined(__aarch64__) && defined(__ELF__) && \
75 defined(COMPILER_RT_EXECUTE_ONLY_CODE)
76// The assembler always creates an implicit '.text' section with default flags
77// (SHF_ALLOC | SHF_EXECINSTR), which is incompatible with the execute-only
78// '.text' section we want to create here because of the missing
79// SHF_AARCH64_PURECODE section flag. To solve this, we use 'unique,0' to
80// differentiate the two sections. The output will therefore have two separate
81// sections named '.text', where code will be placed into the execute-only
82// '.text' section, and the implicitly-created one will be empty.
83#define TEXT_SECTION \
84 .section .text,"axy",@progbits,unique,0
85#else
86#define TEXT_SECTION \
87 .text
88#endif
89
74#if defined(__arm__) || defined(__aarch64__) || defined(__arm64ec__)90#if defined(__arm__) || defined(__aarch64__) || defined(__arm64ec__)
75#define FUNC_ALIGN \91#define FUNC_ALIGN \
76 .text SEPARATOR \
77 .balign 16 SEPARATOR92 .balign 16 SEPARATOR
78#else93#else
79#define FUNC_ALIGN94#define FUNC_ALIGN
80#endif95#endif
8196
82// BTI and PAC gnu property note97// BTI, PAC, and GCS gnu property note
83#define NT_GNU_PROPERTY_TYPE_0 598#define NT_GNU_PROPERTY_TYPE_0 5
84#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc000000099#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000
85#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI 1100#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI 1
86#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC 2101#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC 2
102#define GNU_PROPERTY_AARCH64_FEATURE_1_GCS 4
87103
88#if defined(__ARM_FEATURE_BTI_DEFAULT)104#if defined(__ARM_FEATURE_BTI_DEFAULT)
89#define BTI_FLAG GNU_PROPERTY_AARCH64_FEATURE_1_BTI105#define BTI_FLAG GNU_PROPERTY_AARCH64_FEATURE_1_BTI
...@@ -97,6 +113,12 @@...@@ -97,6 +113,12 @@
97#define PAC_FLAG 0113#define PAC_FLAG 0
98#endif114#endif
99115
116#if defined(__ARM_FEATURE_GCS_DEFAULT)
117#define GCS_FLAG GNU_PROPERTY_AARCH64_FEATURE_1_GCS
118#else
119#define GCS_FLAG 0
120#endif
121
100#define GNU_PROPERTY(type, value) \122#define GNU_PROPERTY(type, value) \
101 .pushsection .note.gnu.property, "a" SEPARATOR \123 .pushsection .note.gnu.property, "a" SEPARATOR \
102 .p2align 3 SEPARATOR \124 .p2align 3 SEPARATOR \
...@@ -118,11 +140,12 @@...@@ -118,11 +140,12 @@
118#define BTI_J140#define BTI_J
119#endif141#endif
120142
121#if (BTI_FLAG | PAC_FLAG) != 0143#if (BTI_FLAG | PAC_FLAG | GCS_FLAG) != 0
122#define GNU_PROPERTY_BTI_PAC \144#define GNU_PROPERTY_BTI_PAC_GCS \
123 GNU_PROPERTY(GNU_PROPERTY_AARCH64_FEATURE_1_AND, BTI_FLAG | PAC_FLAG)145 GNU_PROPERTY(GNU_PROPERTY_AARCH64_FEATURE_1_AND, \
146 BTI_FLAG | PAC_FLAG | GCS_FLAG)
124#else147#else
125#define GNU_PROPERTY_BTI_PAC148#define GNU_PROPERTY_BTI_PAC_GCS
126#endif149#endif
127150
128#if defined(__clang__) || defined(__GCC_HAVE_DWARF2_CFI_ASM)151#if defined(__clang__) || defined(__GCC_HAVE_DWARF2_CFI_ASM)
...@@ -247,6 +270,7 @@...@@ -247,6 +270,7 @@
247#endif270#endif
248271
249#define DEFINE_COMPILERRT_FUNCTION(name) \272#define DEFINE_COMPILERRT_FUNCTION(name) \
273 TEXT_SECTION SEPARATOR \
250 DEFINE_CODE_STATE \274 DEFINE_CODE_STATE \
251 FILE_LEVEL_DIRECTIVE SEPARATOR \275 FILE_LEVEL_DIRECTIVE SEPARATOR \
252 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \276 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \
...@@ -256,6 +280,7 @@...@@ -256,6 +280,7 @@
256 FUNC_SYMBOL(SYMBOL_NAME(name)):280 FUNC_SYMBOL(SYMBOL_NAME(name)):
257281
258#define DEFINE_COMPILERRT_THUMB_FUNCTION(name) \282#define DEFINE_COMPILERRT_THUMB_FUNCTION(name) \
283 TEXT_SECTION SEPARATOR \
259 DEFINE_CODE_STATE \284 DEFINE_CODE_STATE \
260 FILE_LEVEL_DIRECTIVE SEPARATOR \285 FILE_LEVEL_DIRECTIVE SEPARATOR \
261 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \286 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \
...@@ -265,6 +290,7 @@...@@ -265,6 +290,7 @@
265 FUNC_SYMBOL(SYMBOL_NAME(name)):290 FUNC_SYMBOL(SYMBOL_NAME(name)):
266291
267#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \292#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
293 TEXT_SECTION SEPARATOR \
268 DEFINE_CODE_STATE \294 DEFINE_CODE_STATE \
269 FILE_LEVEL_DIRECTIVE SEPARATOR \295 FILE_LEVEL_DIRECTIVE SEPARATOR \
270 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \296 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \
...@@ -274,6 +300,7 @@...@@ -274,6 +300,7 @@
274 FUNC_SYMBOL(SYMBOL_NAME(name)):300 FUNC_SYMBOL(SYMBOL_NAME(name)):
275301
276#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \302#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
303 TEXT_SECTION SEPARATOR \
277 DEFINE_CODE_STATE \304 DEFINE_CODE_STATE \
278 .globl FUNC_SYMBOL(name) SEPARATOR \305 .globl FUNC_SYMBOL(name) SEPARATOR \
279 SYMBOL_IS_FUNC(name) SEPARATOR \306 SYMBOL_IS_FUNC(name) SEPARATOR \
...@@ -282,6 +309,7 @@...@@ -282,6 +309,7 @@
282 FUNC_SYMBOL(name):309 FUNC_SYMBOL(name):
283310
284#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(name) \311#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(name) \
312 TEXT_SECTION SEPARATOR \
285 DEFINE_CODE_STATE \313 DEFINE_CODE_STATE \
286 FUNC_ALIGN \314 FUNC_ALIGN \
287 .globl FUNC_SYMBOL(name) SEPARATOR \315 .globl FUNC_SYMBOL(name) SEPARATOR \
...@@ -296,7 +324,7 @@...@@ -296,7 +324,7 @@
296 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \324 .globl FUNC_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \
297 SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \325 SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
298 DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \326 DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \
299 .set FUNC_SYMBOL(SYMBOL_NAME(name)), FUNC_SYMBOL(target) SEPARATOR327 .set FUNC_SYMBOL(SYMBOL_NAME(name)), FUNC_SYMBOL(SYMBOL_NAME(target)) SEPARATOR
300328
301#if defined(__ARM_EABI__)329#if defined(__ARM_EABI__)
302#define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \330#define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \
...@@ -329,4 +357,9 @@...@@ -329,4 +357,9 @@
329#endif357#endif
330#endif358#endif
331359
360#if defined(__ASSEMBLER__) && (defined(__i386__) || defined(__amd64__)) && \
361 !defined(__arm64ec__)
362.att_syntax
363#endif
364
332#endif // COMPILERRT_ASSEMBLY_H365#endif // COMPILERRT_ASSEMBLY_H
lib/libtsan/interception/interception_win.cpp+4
...@@ -646,6 +646,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {...@@ -646,6 +646,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
646 case 0xC033: // 33 C0 : xor eax, eax646 case 0xC033: // 33 C0 : xor eax, eax
647 case 0xC933: // 33 C9 : xor ecx, ecx647 case 0xC933: // 33 C9 : xor ecx, ecx
648 case 0xD233: // 33 D2 : xor edx, edx648 case 0xD233: // 33 D2 : xor edx, edx
649 case 0xFF33: // 33 FF : xor edi, edi
649 case 0x9066: // 66 90 : xchg %ax,%ax (Two-byte NOP)650 case 0x9066: // 66 90 : xchg %ax,%ax (Two-byte NOP)
650 case 0xDB84: // 84 DB : test bl,bl651 case 0xDB84: // 84 DB : test bl,bl
651 case 0xC084: // 84 C0 : test al,al652 case 0xC084: // 84 C0 : test al,al
...@@ -764,6 +765,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {...@@ -764,6 +765,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
764765
765 switch (0x00FFFFFF & *(u32 *)address) {766 switch (0x00FFFFFF & *(u32 *)address) {
766 case 0x10b70f: // 0f b7 10 : movzx edx, WORD PTR [rax]767 case 0x10b70f: // 0f b7 10 : movzx edx, WORD PTR [rax]
768 case 0x02b70f: // 0f b7 02 : movzx eax, WORD PTR [rdx]
767 case 0xc00b4d: // 4d 0b c0 : or r8, r8769 case 0xc00b4d: // 4d 0b c0 : or r8, r8
768 case 0xc03345: // 45 33 c0 : xor r8d, r8d770 case 0xc03345: // 45 33 c0 : xor r8d, r8d
769 case 0xc08548: // 48 85 c0 : test rax, rax771 case 0xc08548: // 48 85 c0 : test rax, rax
...@@ -799,6 +801,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {...@@ -799,6 +801,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
799 case 0xc9854d: // 4d 85 c9 : test r9, r9801 case 0xc9854d: // 4d 85 c9 : test r9, r9
800 case 0xc98b4c: // 4c 8b c9 : mov r9, rcx802 case 0xc98b4c: // 4c 8b c9 : mov r9, rcx
801 case 0xd12948: // 48 29 d1 : sub rcx, rdx803 case 0xd12948: // 48 29 d1 : sub rcx, rdx
804 case 0xc22b4c: // 4c 2b c2 : sub r8, rdx
802 case 0xca2b48: // 48 2b ca : sub rcx, rdx805 case 0xca2b48: // 48 2b ca : sub rcx, rdx
803 case 0xca3b48: // 48 3b ca : cmp rcx, rdx806 case 0xca3b48: // 48 3b ca : cmp rcx, rdx
804 case 0xd12b48: // 48 2b d1 : sub rdx, rcx807 case 0xd12b48: // 48 2b d1 : sub rdx, rcx
...@@ -813,6 +816,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {...@@ -813,6 +816,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
813 case 0xd9f748: // 48 f7 d9 : neg rcx816 case 0xd9f748: // 48 f7 d9 : neg rcx
814 case 0xc03145: // 45 31 c0 : xor r8d,r8d817 case 0xc03145: // 45 31 c0 : xor r8d,r8d
815 case 0xc93145: // 45 31 c9 : xor r9d,r9d818 case 0xc93145: // 45 31 c9 : xor r9d,r9d
819 case 0xd23345: // 45 33 d2 : xor r10d, r10d
816 case 0xdb3345: // 45 33 db : xor r11d, r11d820 case 0xdb3345: // 45 33 db : xor r11d, r11d
817 case 0xc08445: // 45 84 c0 : test r8b,r8b821 case 0xc08445: // 45 84 c0 : test r8b,r8b
818 case 0xd28445: // 45 84 d2 : test r10b,r10b822 case 0xd28445: // 45 84 d2 : test r10b,r10b
lib/libtsan/sanitizer_common/sanitizer_allocator_primary32.h+1
...@@ -288,6 +288,7 @@ class SizeClassAllocator32 {...@@ -288,6 +288,7 @@ class SizeClassAllocator32 {
288 uptr ComputeRegionId(uptr mem) const {288 uptr ComputeRegionId(uptr mem) const {
289 if (SANITIZER_SIGN_EXTENDED_ADDRESSES)289 if (SANITIZER_SIGN_EXTENDED_ADDRESSES)
290 mem &= (kSpaceSize - 1);290 mem &= (kSpaceSize - 1);
291 mem -= kSpaceBeg;
291 const uptr res = mem >> kRegionSizeLog;292 const uptr res = mem >> kRegionSizeLog;
292 CHECK_LT(res, kNumPossibleRegions);293 CHECK_LT(res, kNumPossibleRegions);
293 return res;294 return res;
lib/libtsan/sanitizer_common/sanitizer_allocator_primary64.h+18
...@@ -113,6 +113,24 @@ class SizeClassAllocator64 {...@@ -113,6 +113,24 @@ class SizeClassAllocator64 {
113 // ~(uptr)0.113 // ~(uptr)0.
114 void Init(s32 release_to_os_interval_ms, uptr heap_start = 0) {114 void Init(s32 release_to_os_interval_ms, uptr heap_start = 0) {
115 uptr TotalSpaceSize = kSpaceSize + AdditionalSize();115 uptr TotalSpaceSize = kSpaceSize + AdditionalSize();
116
117 uptr MaxAddr = GetMaxUserVirtualAddress();
118 // VReport does not call the sanitizer allocator.
119 VReport(3, "Max user virtual address: 0x%zx\n", MaxAddr);
120 VReport(3, "Total space size for primary allocator: 0x%zx\n",
121 TotalSpaceSize);
122 // TODO: revise the check if we ever configure sanitizers to deliberately
123 // map beyond the 2**48 barrier (note that Linux pretends the VMA is
124 // limited to 48-bit for backwards compatibility, but allows apps to
125 // explicitly specify an address beyond that).
126 if (heap_start + TotalSpaceSize >= MaxAddr) {
127 // We can't easily adjust the requested heap size, because kSpaceSize is
128 // const (for optimization) and used throughout the code.
129 VReport(0, "Error: heap size %zx exceeds max user virtual address %zx\n",
130 TotalSpaceSize, MaxAddr);
131 VReport(
132 0, "Try using a kernel that allows a larger virtual address space\n");
133 }
116 PremappedHeap = heap_start != 0;134 PremappedHeap = heap_start != 0;
117 if (PremappedHeap) {135 if (PremappedHeap) {
118 CHECK(!kUsingConstantSpaceBeg);136 CHECK(!kUsingConstantSpaceBeg);
lib/libtsan/sanitizer_common/sanitizer_common.h+15-2
...@@ -78,8 +78,8 @@ uptr GetMmapGranularity();...@@ -78,8 +78,8 @@ uptr GetMmapGranularity();
78uptr GetMaxVirtualAddress();78uptr GetMaxVirtualAddress();
79uptr GetMaxUserVirtualAddress();79uptr GetMaxUserVirtualAddress();
80// Threads80// Threads
81tid_t GetTid();81ThreadID GetTid();
82int TgKill(pid_t pid, tid_t tid, int sig);82int TgKill(pid_t pid, ThreadID tid, int sig);
83uptr GetThreadSelf();83uptr GetThreadSelf();
84void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,84void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,
85 uptr *stack_bottom);85 uptr *stack_bottom);
...@@ -390,6 +390,9 @@ void ReportDeadlySignal(const SignalContext &sig, u32 tid,...@@ -390,6 +390,9 @@ void ReportDeadlySignal(const SignalContext &sig, u32 tid,
390void SetAlternateSignalStack();390void SetAlternateSignalStack();
391void UnsetAlternateSignalStack();391void UnsetAlternateSignalStack();
392392
393bool IsSignalHandlerFromSanitizer(int signum);
394bool SetSignalHandlerFromSanitizer(int signum, bool new_state);
395
393// Construct a one-line string:396// Construct a one-line string:
394// SUMMARY: SanitizerToolName: error_message397// SUMMARY: SanitizerToolName: error_message
395// and pass it to __sanitizer_report_error_summary.398// and pass it to __sanitizer_report_error_summary.
...@@ -484,6 +487,13 @@ inline uptr Log2(uptr x) {...@@ -484,6 +487,13 @@ inline uptr Log2(uptr x) {
484 return LeastSignificantSetBitIndex(x);487 return LeastSignificantSetBitIndex(x);
485}488}
486489
490inline bool IntervalsAreSeparate(uptr start1, uptr end1, uptr start2,
491 uptr end2) {
492 CHECK_LE(start1, end1);
493 CHECK_LE(start2, end2);
494 return (end1 < start2) || (end2 < start1);
495}
496
487// Don't use std::min, std::max or std::swap, to minimize dependency497// Don't use std::min, std::max or std::swap, to minimize dependency
488// on libstdc++.498// on libstdc++.
489template <class T>499template <class T>
...@@ -734,6 +744,7 @@ enum ModuleArch {...@@ -734,6 +744,7 @@ enum ModuleArch {
734 kModuleArchARMV7S,744 kModuleArchARMV7S,
735 kModuleArchARMV7K,745 kModuleArchARMV7K,
736 kModuleArchARM64,746 kModuleArchARM64,
747 kModuleArchARM64E,
737 kModuleArchLoongArch64,748 kModuleArchLoongArch64,
738 kModuleArchRISCV64,749 kModuleArchRISCV64,
739 kModuleArchHexagon750 kModuleArchHexagon
...@@ -807,6 +818,8 @@ inline const char *ModuleArchToString(ModuleArch arch) {...@@ -807,6 +818,8 @@ inline const char *ModuleArchToString(ModuleArch arch) {
807 return "armv7k";818 return "armv7k";
808 case kModuleArchARM64:819 case kModuleArchARM64:
809 return "arm64";820 return "arm64";
821 case kModuleArchARM64E:
822 return "arm64e";
810 case kModuleArchLoongArch64:823 case kModuleArchLoongArch64:
811 return "loongarch64";824 return "loongarch64";
812 case kModuleArchRISCV64:825 case kModuleArchRISCV64:
lib/libtsan/sanitizer_common/sanitizer_common_interceptors.inc+30-4
...@@ -1285,8 +1285,34 @@ INTERCEPTOR(int, puts, char *s) {...@@ -1285,8 +1285,34 @@ INTERCEPTOR(int, puts, char *s) {
1285#endif1285#endif
12861286
1287#if SANITIZER_INTERCEPT_PRCTL1287#if SANITIZER_INTERCEPT_PRCTL
1288INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,1288
1289 unsigned long arg4, unsigned long arg5) {1289# if defined(__aarch64__)
1290// https://llvm.org/docs/PointerAuth.html
1291// AArch64 is currently the only architecture with full PAC support.
1292// Avoid adding PAC instructions to prevent crashes caused by
1293// prctl(PR_PAC_RESET_KEYS, ...). Since PR_PAC_RESET_KEYS resets the
1294// authentication key, using the old key afterward will lead to a crash.
1295
1296# if defined(__ARM_FEATURE_BTI_DEFAULT)
1297# define BRANCH_PROTECTION_ATTRIBUTE \
1298 __attribute__((target("branch-protection=bti")))
1299# else
1300# define BRANCH_PROTECTION_ATTRIBUTE \
1301 __attribute__((target("branch-protection=none")))
1302# endif
1303
1304# define PRCTL_INTERCEPTOR(ret_type, func, ...) \
1305 DEFINE_REAL(ret_type, func, __VA_ARGS__) \
1306 DECLARE_WRAPPER(ret_type, func, __VA_ARGS__) \
1307 extern "C" INTERCEPTOR_ATTRIBUTE BRANCH_PROTECTION_ATTRIBUTE ret_type \
1308 WRAP(func)(__VA_ARGS__)
1309
1310# else
1311# define PRCTL_INTERCEPTOR INTERCEPTOR
1312# endif
1313
1314PRCTL_INTERCEPTOR(int, prctl, int option, unsigned long arg2,
1315 unsigned long arg3, unsigned long arg4, unsigned long arg5) {
1290 void *ctx;1316 void *ctx;
1291 COMMON_INTERCEPTOR_ENTER(ctx, prctl, option, arg2, arg3, arg4, arg5);1317 COMMON_INTERCEPTOR_ENTER(ctx, prctl, option, arg2, arg3, arg4, arg5);
1292 static const int PR_SET_NAME = 15;1318 static const int PR_SET_NAME = 15;
...@@ -1300,7 +1326,7 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,...@@ -1300,7 +1326,7 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,
1300 static const int PR_SET_SECCOMP = 22;1326 static const int PR_SET_SECCOMP = 22;
1301 static const int SECCOMP_MODE_FILTER = 2;1327 static const int SECCOMP_MODE_FILTER = 2;
1302# endif1328# endif
1303 if (option == PR_SET_VMA && arg2 == 0UL) {1329 if (option == PR_SET_VMA && arg2 == 0UL && arg5 != 0UL) {
1304 char *name = (char *)arg5;1330 char *name = (char *)arg5;
1305 COMMON_INTERCEPTOR_READ_RANGE(ctx, name, internal_strlen(name) + 1);1331 COMMON_INTERCEPTOR_READ_RANGE(ctx, name, internal_strlen(name) + 1);
1306 }1332 }
...@@ -1326,7 +1352,7 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,...@@ -1326,7 +1352,7 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,
1326 }1352 }
1327 return res;1353 return res;
1328}1354}
1329#define INIT_PRCTL COMMON_INTERCEPT_FUNCTION(prctl)1355# define INIT_PRCTL COMMON_INTERCEPT_FUNCTION(prctl)
1330#else1356#else
1331#define INIT_PRCTL1357#define INIT_PRCTL
1332#endif // SANITIZER_INTERCEPT_PRCTL1358#endif // SANITIZER_INTERCEPT_PRCTL
lib/libtsan/sanitizer_common/sanitizer_common_interceptors_ioctl.inc+4
...@@ -344,12 +344,16 @@ static void ioctl_table_fill() {...@@ -344,12 +344,16 @@ static void ioctl_table_fill() {
344 _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));344 _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
345 _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));345 _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
346 _(TCFLSH, NONE, 0);346 _(TCFLSH, NONE, 0);
347# if SANITIZER_TERMIOS_IOCTL_CONSTANTS
347 _(TCGETS, WRITE, struct_termios_sz);348 _(TCGETS, WRITE, struct_termios_sz);
349# endif
348 _(TCSBRK, NONE, 0);350 _(TCSBRK, NONE, 0);
349 _(TCSBRKP, NONE, 0);351 _(TCSBRKP, NONE, 0);
352# if SANITIZER_TERMIOS_IOCTL_CONSTANTS
350 _(TCSETS, READ, struct_termios_sz);353 _(TCSETS, READ, struct_termios_sz);
351 _(TCSETSF, READ, struct_termios_sz);354 _(TCSETSF, READ, struct_termios_sz);
352 _(TCSETSW, READ, struct_termios_sz);355 _(TCSETSW, READ, struct_termios_sz);
356# endif
353 _(TCXONC, NONE, 0);357 _(TCXONC, NONE, 0);
354 _(TIOCGLCKTRMIOS, WRITE, struct_termios_sz);358 _(TIOCGLCKTRMIOS, WRITE, struct_termios_sz);
355 _(TIOCGSOFTCAR, WRITE, sizeof(int));359 _(TIOCGSOFTCAR, WRITE, sizeof(int));
lib/libtsan/sanitizer_common/sanitizer_common_interceptors_vfork_aarch64.inc.S+2-1
...@@ -5,6 +5,7 @@...@@ -5,6 +5,7 @@
55
6ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)6ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)
77
8TEXT_SECTION
8.comm _ZN14__interception10real_vforkE,8,89.comm _ZN14__interception10real_vforkE,8,8
9.globl ASM_WRAPPER_NAME(vfork)10.globl ASM_WRAPPER_NAME(vfork)
10ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))11ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
...@@ -43,6 +44,6 @@ ASM_SIZE(vfork)...@@ -43,6 +44,6 @@ ASM_SIZE(vfork)
43ASM_INTERCEPTOR_TRAMPOLINE(vfork)44ASM_INTERCEPTOR_TRAMPOLINE(vfork)
44ASM_TRAMPOLINE_ALIAS(vfork, vfork)45ASM_TRAMPOLINE_ALIAS(vfork, vfork)
4546
46GNU_PROPERTY_BTI_PAC47GNU_PROPERTY_BTI_PAC_GCS
4748
48#endif49#endif
lib/libtsan/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S+2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
22
3#include "sanitizer_common/sanitizer_asm.h"3#include "sanitizer_common/sanitizer_asm.h"
44
5.att_syntax
6
5.comm _ZN14__interception10real_vforkE,4,47.comm _ZN14__interception10real_vforkE,4,4
6.globl ASM_WRAPPER_NAME(vfork)8.globl ASM_WRAPPER_NAME(vfork)
7ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))9ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
lib/libtsan/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S+2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
22
3#include "sanitizer_common/sanitizer_asm.h"3#include "sanitizer_common/sanitizer_asm.h"
44
5.att_syntax
6
5.comm _ZN14__interception10real_vforkE,8,87.comm _ZN14__interception10real_vforkE,8,8
6.globl ASM_WRAPPER_NAME(vfork)8.globl ASM_WRAPPER_NAME(vfork)
7ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))9ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
lib/libtsan/sanitizer_common/sanitizer_common_syscalls.inc+18
...@@ -143,6 +143,12 @@ struct sanitizer_kernel_sockaddr {...@@ -143,6 +143,12 @@ struct sanitizer_kernel_sockaddr {
143 char sa_data[14];143 char sa_data[14];
144};144};
145145
146struct sanitizer_kernel_open_how {
147 u64 flags;
148 u64 mode;
149 u64 resolve;
150};
151
146// Real sigset size is always passed as a syscall argument.152// Real sigset size is always passed as a syscall argument.
147// Declare it "void" to catch sizeof(kernel_sigset_t).153// Declare it "void" to catch sizeof(kernel_sigset_t).
148typedef void kernel_sigset_t;154typedef void kernel_sigset_t;
...@@ -2843,6 +2849,18 @@ PRE_SYSCALL(openat)(long dfd, const void *filename, long flags, long mode) {...@@ -2843,6 +2849,18 @@ PRE_SYSCALL(openat)(long dfd, const void *filename, long flags, long mode) {
2843POST_SYSCALL(openat)2849POST_SYSCALL(openat)
2844(long res, long dfd, const void *filename, long flags, long mode) {}2850(long res, long dfd, const void *filename, long flags, long mode) {}
28452851
2852PRE_SYSCALL(openat2)(long dfd, const void* filename,
2853 const sanitizer_kernel_open_how* how, uptr howlen) {
2854 if (filename)
2855 PRE_READ(filename, __sanitizer::internal_strlen((const char*)filename) + 1);
2856
2857 if (how)
2858 PRE_READ(how, howlen);
2859}
2860
2861POST_SYSCALL(openat2)(long res, long dfd, const void* filename,
2862 const sanitizer_kernel_open_how* how, uptr howlen) {}
2863
2846PRE_SYSCALL(newfstatat)2864PRE_SYSCALL(newfstatat)
2847(long dfd, const void *filename, void *statbuf, long flag) {2865(long dfd, const void *filename, void *statbuf, long flag) {
2848 if (filename)2866 if (filename)
lib/libtsan/sanitizer_common/sanitizer_coverage_interface.inc deleted-43
...@@ -1,43 +0,0 @@
1//===-- sanitizer_coverage_interface.inc ----------------------------------===//
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// Sanitizer Coverage interface list.
9//===----------------------------------------------------------------------===//
10INTERFACE_FUNCTION(__sanitizer_cov_dump)
11INTERFACE_FUNCTION(__sanitizer_cov_reset)
12INTERFACE_FUNCTION(__sanitizer_dump_coverage)
13INTERFACE_FUNCTION(__sanitizer_dump_trace_pc_guard_coverage)
14INTERFACE_WEAK_FUNCTION(__sancov_default_options)
15INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp)
16INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp1)
17INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp2)
18INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp4)
19INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp8)
20INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_const_cmp1)
21INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_const_cmp2)
22INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_const_cmp4)
23INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_const_cmp8)
24INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_div4)
25INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_div8)
26INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_gep)
27INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_pc_guard)
28INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_pc_guard_init)
29INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_pc_indir)
30INTERFACE_WEAK_FUNCTION(__sanitizer_cov_load1)
31INTERFACE_WEAK_FUNCTION(__sanitizer_cov_load2)
32INTERFACE_WEAK_FUNCTION(__sanitizer_cov_load4)
33INTERFACE_WEAK_FUNCTION(__sanitizer_cov_load8)
34INTERFACE_WEAK_FUNCTION(__sanitizer_cov_load16)
35INTERFACE_WEAK_FUNCTION(__sanitizer_cov_store1)
36INTERFACE_WEAK_FUNCTION(__sanitizer_cov_store2)
37INTERFACE_WEAK_FUNCTION(__sanitizer_cov_store4)
38INTERFACE_WEAK_FUNCTION(__sanitizer_cov_store8)
39INTERFACE_WEAK_FUNCTION(__sanitizer_cov_store16)
40INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_switch)
41INTERFACE_WEAK_FUNCTION(__sanitizer_cov_8bit_counters_init)
42INTERFACE_WEAK_FUNCTION(__sanitizer_cov_bool_flag_init)
43INTERFACE_WEAK_FUNCTION(__sanitizer_cov_pcs_init)
lib/libtsan/sanitizer_common/sanitizer_file.cpp+40-12
...@@ -36,9 +36,17 @@ void RawWrite(const char *buffer) {...@@ -36,9 +36,17 @@ void RawWrite(const char *buffer) {
3636
37void ReportFile::ReopenIfNecessary() {37void ReportFile::ReopenIfNecessary() {
38 mu->CheckLocked();38 mu->CheckLocked();
39 if (fd == kStdoutFd || fd == kStderrFd) return;
40
41 uptr pid = internal_getpid();39 uptr pid = internal_getpid();
40 if (fallbackToStderrActive && fd_pid != pid) {
41 // If fallbackToStderrActive is set then we fellback to stderr. If this is a
42 // new process, mark fd as invalid so we attempt to open again.
43 CHECK_EQ(fd, kStderrFd);
44 fd = kInvalidFd;
45 fallbackToStderrActive = false;
46 }
47 if (fd == kStdoutFd || fd == kStderrFd)
48 return;
49
42 // If in tracer, use the parent's file.50 // If in tracer, use the parent's file.
43 if (pid == stoptheworld_tracer_pid)51 if (pid == stoptheworld_tracer_pid)
44 pid = stoptheworld_tracer_ppid;52 pid = stoptheworld_tracer_ppid;
...@@ -48,8 +56,7 @@ void ReportFile::ReopenIfNecessary() {...@@ -48,8 +56,7 @@ void ReportFile::ReopenIfNecessary() {
48 // process, close it now.56 // process, close it now.
49 if (fd_pid == pid)57 if (fd_pid == pid)
50 return;58 return;
51 else59 CloseFile(fd);
52 CloseFile(fd);
53 }60 }
5461
55 const char *exe_name = GetProcessName();62 const char *exe_name = GetProcessName();
...@@ -65,18 +72,24 @@ void ReportFile::ReopenIfNecessary() {...@@ -65,18 +72,24 @@ void ReportFile::ReopenIfNecessary() {
65 error_t err;72 error_t err;
66 fd = OpenFile(full_path, WrOnly, &err);73 fd = OpenFile(full_path, WrOnly, &err);
67 if (fd == kInvalidFd) {74 if (fd == kInvalidFd) {
68 const char *ErrorMsgPrefix = "ERROR: Can't open file: ";75 bool fallback = common_flags()->log_fallback_to_stderr;
76 const char *ErrorMsgPrefix =
77 fallback ? "WARNING: Can't open file, falling back to stderr: "
78 : "ERROR: Can't open file: ";
69 WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));79 WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));
70 WriteToFile(kStderrFd, full_path, internal_strlen(full_path));80 WriteToFile(kStderrFd, full_path, internal_strlen(full_path));
71 char errmsg[100];81 char errmsg[100];
72 internal_snprintf(errmsg, sizeof(errmsg), " (reason: %d)\n", err);82 internal_snprintf(errmsg, sizeof(errmsg), " (reason: %d)\n", err);
73 WriteToFile(kStderrFd, errmsg, internal_strlen(errmsg));83 WriteToFile(kStderrFd, errmsg, internal_strlen(errmsg));
74 Die();84 if (!fallback)
85 Die();
86 fallbackToStderrActive = true;
87 fd = kStderrFd;
75 }88 }
76 fd_pid = pid;89 fd_pid = pid;
77}90}
7891
79static void RecursiveCreateParentDirs(char *path) {92static void RecursiveCreateParentDirs(char *path, fd_t &fd) {
80 if (path[0] == '\0')93 if (path[0] == '\0')
81 return;94 return;
82 for (int i = 1; path[i] != '\0'; ++i) {95 for (int i = 1; path[i] != '\0'; ++i) {
...@@ -85,12 +98,19 @@ static void RecursiveCreateParentDirs(char *path) {...@@ -85,12 +98,19 @@ static void RecursiveCreateParentDirs(char *path) {
85 continue;98 continue;
86 path[i] = '\0';99 path[i] = '\0';
87 if (!DirExists(path) && !CreateDir(path)) {100 if (!DirExists(path) && !CreateDir(path)) {
88 const char *ErrorMsgPrefix = "ERROR: Can't create directory: ";101 bool fallback = common_flags()->log_fallback_to_stderr;
102 const char *ErrorMsgPrefix =
103 fallback ? "WARNING: Can't create directory, falling back to stderr: "
104 : "ERROR: Can't create directory: ";
89 WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));105 WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));
90 WriteToFile(kStderrFd, path, internal_strlen(path));106 WriteToFile(kStderrFd, path, internal_strlen(path));
91 const char *ErrorMsgSuffix = "\n";107 const char *ErrorMsgSuffix = "\n";
92 WriteToFile(kStderrFd, ErrorMsgSuffix, internal_strlen(ErrorMsgSuffix));108 WriteToFile(kStderrFd, ErrorMsgSuffix, internal_strlen(ErrorMsgSuffix));
93 Die();109 if (!fallback)
110 Die();
111 path[i] = save;
112 fd = kStderrFd;
113 return;
94 }114 }
95 path[i] = save;115 path[i] = save;
96 }116 }
...@@ -108,6 +128,9 @@ static void ParseAndSetPath(const char *pattern, char *dest,...@@ -108,6 +128,9 @@ static void ParseAndSetPath(const char *pattern, char *dest,
108 CHECK(dest);128 CHECK(dest);
109 CHECK_GE(dest_size, 1);129 CHECK_GE(dest_size, 1);
110 dest[0] = '\0';130 dest[0] = '\0';
131 // Return empty string if empty string was passed
132 if (internal_strlen(pattern) == 0)
133 return;
111 uptr next_substr_start_idx = 0;134 uptr next_substr_start_idx = 0;
112 for (uptr i = 0; i < internal_strlen(pattern) - 1; i++) {135 for (uptr i = 0; i < internal_strlen(pattern) - 1; i++) {
113 if (pattern[i] != '%')136 if (pattern[i] != '%')
...@@ -161,12 +184,17 @@ void ReportFile::SetReportPath(const char *path) {...@@ -161,12 +184,17 @@ void ReportFile::SetReportPath(const char *path) {
161 if (path) {184 if (path) {
162 uptr len = internal_strlen(path);185 uptr len = internal_strlen(path);
163 if (len > sizeof(path_prefix) - 100) {186 if (len > sizeof(path_prefix) - 100) {
164 const char *message = "ERROR: Path is too long: ";187 bool fallback = common_flags()->log_fallback_to_stderr;
188 const char *message =
189 fallback ? "WARNING: Path is too long, falling back to stderr: "
190 : "ERROR: Path is too long: ";
165 WriteToFile(kStderrFd, message, internal_strlen(message));191 WriteToFile(kStderrFd, message, internal_strlen(message));
166 WriteToFile(kStderrFd, path, 8);192 WriteToFile(kStderrFd, path, 8);
167 message = "...\n";193 message = "...\n";
168 WriteToFile(kStderrFd, message, internal_strlen(message));194 WriteToFile(kStderrFd, message, internal_strlen(message));
169 Die();195 if (!fallback)
196 Die();
197 path = "stderr";
170 }198 }
171 }199 }
172200
...@@ -180,7 +208,7 @@ void ReportFile::SetReportPath(const char *path) {...@@ -180,7 +208,7 @@ void ReportFile::SetReportPath(const char *path) {
180 fd = kStdoutFd;208 fd = kStdoutFd;
181 } else {209 } else {
182 ParseAndSetPath(path, path_prefix, kMaxPathLength);210 ParseAndSetPath(path, path_prefix, kMaxPathLength);
183 RecursiveCreateParentDirs(path_prefix);211 RecursiveCreateParentDirs(path_prefix, fd);
184 }212 }
185}213}
186214
lib/libtsan/sanitizer_common/sanitizer_file.h+3
...@@ -43,6 +43,9 @@ struct ReportFile {...@@ -43,6 +43,9 @@ struct ReportFile {
43 // PID of the process that opened fd. If a fork() occurs,43 // PID of the process that opened fd. If a fork() occurs,
44 // the PID of child will be different from fd_pid.44 // the PID of child will be different from fd_pid.
45 uptr fd_pid;45 uptr fd_pid;
46 // Set to true if the last attempt to open the logfile failed, perhaps due to
47 // permission errors
48 bool fallbackToStderrActive = false;
4649
47 private:50 private:
48 void ReopenIfNecessary();51 void ReopenIfNecessary();
lib/libtsan/sanitizer_common/sanitizer_flags.inc+7
...@@ -65,6 +65,8 @@ COMMON_FLAG(...@@ -65,6 +65,8 @@ COMMON_FLAG(
65 bool, log_to_syslog, (bool)SANITIZER_ANDROID || (bool)SANITIZER_APPLE,65 bool, log_to_syslog, (bool)SANITIZER_ANDROID || (bool)SANITIZER_APPLE,
66 "Write all sanitizer output to syslog in addition to other means of "66 "Write all sanitizer output to syslog in addition to other means of "
67 "logging.")67 "logging.")
68COMMON_FLAG(bool, log_fallback_to_stderr, false,
69 "When set, fallback to stderr if we are unable to open log path.")
68COMMON_FLAG(70COMMON_FLAG(
69 int, verbosity, 0,71 int, verbosity, 0,
70 "Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).")72 "Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).")
...@@ -111,6 +113,11 @@ COMMON_FLAG(HandleSignalMode, handle_sigfpe, kHandleSignalYes,...@@ -111,6 +113,11 @@ COMMON_FLAG(HandleSignalMode, handle_sigfpe, kHandleSignalYes,
111COMMON_FLAG(bool, allow_user_segv_handler, true,113COMMON_FLAG(bool, allow_user_segv_handler, true,
112 "Deprecated. True has no effect, use handle_sigbus=1. If false, "114 "Deprecated. True has no effect, use handle_sigbus=1. If false, "
113 "handle_*=1 will be upgraded to handle_*=2.")115 "handle_*=1 will be upgraded to handle_*=2.")
116COMMON_FLAG(bool, cloak_sanitizer_signal_handlers, false,
117 "If set, signal/sigaction will pretend that sanitizers did not "
118 "preinstall any signal handlers. If the user subsequently installs "
119 "a signal handler, this will disable cloaking for the respective "
120 "signal.")
114COMMON_FLAG(bool, use_sigaltstack, true,121COMMON_FLAG(bool, use_sigaltstack, true,
115 "If set, uses alternate stack for signal handling.")122 "If set, uses alternate stack for signal handling.")
116COMMON_FLAG(bool, detect_deadlocks, true,123COMMON_FLAG(bool, detect_deadlocks, true,
lib/libtsan/sanitizer_common/sanitizer_fuchsia.cpp+30-3
...@@ -14,6 +14,7 @@...@@ -14,6 +14,7 @@
14#include "sanitizer_fuchsia.h"14#include "sanitizer_fuchsia.h"
15#if SANITIZER_FUCHSIA15#if SANITIZER_FUCHSIA
1616
17# include <limits.h>
17# include <pthread.h>18# include <pthread.h>
18# include <stdlib.h>19# include <stdlib.h>
19# include <unistd.h>20# include <unistd.h>
...@@ -68,7 +69,7 @@ int internal_dlinfo(void *handle, int request, void *p) { UNIMPLEMENTED(); }...@@ -68,7 +69,7 @@ int internal_dlinfo(void *handle, int request, void *p) { UNIMPLEMENTED(); }
6869
69uptr GetThreadSelf() { return reinterpret_cast<uptr>(thrd_current()); }70uptr GetThreadSelf() { return reinterpret_cast<uptr>(thrd_current()); }
7071
71tid_t GetTid() { return GetThreadSelf(); }72ThreadID GetTid() { return GetThreadSelf(); }
7273
73void Abort() { abort(); }74void Abort() { abort(); }
7475
...@@ -117,11 +118,37 @@ uptr GetMmapGranularity() { return _zx_system_get_page_size(); }...@@ -117,11 +118,37 @@ uptr GetMmapGranularity() { return _zx_system_get_page_size(); }
117118
118sanitizer_shadow_bounds_t ShadowBounds;119sanitizer_shadow_bounds_t ShadowBounds;
119120
121// Any sanitizer that utilizes shadow should explicitly call whenever it's
122// appropriate for that sanitizer to reference shadow bounds. For ASan, this is
123// done in `InitializeShadowMemory` and for HWASan, this is done in
124// `InitShadow`.
120void InitShadowBounds() { ShadowBounds = __sanitizer_shadow_bounds(); }125void InitShadowBounds() { ShadowBounds = __sanitizer_shadow_bounds(); }
121126
127// TODO(leonardchan): It's not immediately clear from a user perspective if
128// `GetMaxUserVirtualAddress` should be called exatly once on runtime startup
129// or can be called multiple times. Currently it looks like most instances of
130// `GetMaxUserVirtualAddress` are meant to be called once, but if someone
131// decides to call this multiple times in the future, we should have a separate
132// function that's ok to call multiple times. Ideally we would just invoke this
133// syscall once. Also for Fuchsia, this syscall technically gets invoked twice
134// since `__sanitizer_shadow_bounds` also invokes this syscall under the hood.
122uptr GetMaxUserVirtualAddress() {135uptr GetMaxUserVirtualAddress() {
123 InitShadowBounds();136 zx_info_vmar_t info;
124 return ShadowBounds.memory_limit - 1;137 zx_status_t status = _zx_object_get_info(_zx_vmar_root_self(), ZX_INFO_VMAR,
138 &info, sizeof(info), NULL, NULL);
139 CHECK_EQ(status, ZX_OK);
140
141 // Find the top of the accessible address space.
142 uintptr_t top = info.base + info.len;
143
144 // Round it up to a power-of-two size. There may be some pages at
145 // the top that can't actually be mapped, but for purposes of the
146 // the shadow, we'll pretend they could be.
147 int bit = (sizeof(uintptr_t) * CHAR_BIT) - __builtin_clzl(top);
148 if (top != (uintptr_t)1 << bit)
149 top = (uintptr_t)1 << (bit + 1);
150
151 return top - 1;
125}152}
126153
127uptr GetMaxVirtualAddress() { return GetMaxUserVirtualAddress(); }154uptr GetMaxVirtualAddress() { return GetMaxUserVirtualAddress(); }
lib/libtsan/sanitizer_common/sanitizer_haiku.cpp+2-2
...@@ -231,12 +231,12 @@ uptr internal_execve(const char *filename, char *const argv[],...@@ -231,12 +231,12 @@ uptr internal_execve(const char *filename, char *const argv[],
231}231}
232232
233# if 0233# if 0
234tid_t GetTid() {234ThreadID GetTid() {
235 DEFINE__REAL(int, _lwp_self);235 DEFINE__REAL(int, _lwp_self);
236 return _REAL(_lwp_self);236 return _REAL(_lwp_self);
237}237}
238238
239int TgKill(pid_t pid, tid_t tid, int sig) {239int TgKill(pid_t pid, ThreadID tid, int sig) {
240 DEFINE__REAL(int, _lwp_kill, int a, int b);240 DEFINE__REAL(int, _lwp_kill, int a, int b);
241 (void)pid;241 (void)pid;
242 return _REAL(_lwp_kill, tid, sig);242 return _REAL(_lwp_kill, tid, sig);
lib/libtsan/sanitizer_common/sanitizer_internal_defs.h+1-1
...@@ -209,7 +209,7 @@ typedef long ssize;...@@ -209,7 +209,7 @@ typedef long ssize;
209typedef sptr ssize;209typedef sptr ssize;
210#endif210#endif
211211
212typedef u64 tid_t;212typedef u64 ThreadID;
213213
214// ----------- ATTENTION -------------214// ----------- ATTENTION -------------
215// This header should NOT include any other headers to avoid portability issues.215// This header should NOT include any other headers to avoid portability issues.
lib/libtsan/sanitizer_common/sanitizer_libc.cpp+8
...@@ -190,6 +190,14 @@ uptr internal_strlcat(char *dst, const char *src, uptr maxlen) {...@@ -190,6 +190,14 @@ uptr internal_strlcat(char *dst, const char *src, uptr maxlen) {
190 return dstlen + srclen;190 return dstlen + srclen;
191}191}
192192
193char* internal_strcat(char* dst, const char* src) {
194 uptr len = internal_strlen(dst);
195 uptr i;
196 for (i = 0; src[i]; i++) dst[len + i] = src[i];
197 dst[len + i] = 0;
198 return dst;
199}
200
193char *internal_strncat(char *dst, const char *src, uptr n) {201char *internal_strncat(char *dst, const char *src, uptr n) {
194 uptr len = internal_strlen(dst);202 uptr len = internal_strlen(dst);
195 uptr i;203 uptr i;
lib/libtsan/sanitizer_common/sanitizer_libc.h+1
...@@ -59,6 +59,7 @@ char *internal_strdup(const char *s);...@@ -59,6 +59,7 @@ char *internal_strdup(const char *s);
59uptr internal_strlen(const char *s);59uptr internal_strlen(const char *s);
60uptr internal_strlcat(char *dst, const char *src, uptr maxlen);60uptr internal_strlcat(char *dst, const char *src, uptr maxlen);
61char *internal_strncat(char *dst, const char *src, uptr n);61char *internal_strncat(char *dst, const char *src, uptr n);
62char* internal_strcat(char* dst, const char* src);
62int internal_strncmp(const char *s1, const char *s2, uptr n);63int internal_strncmp(const char *s1, const char *s2, uptr n);
63uptr internal_strlcpy(char *dst, const char *src, uptr maxlen);64uptr internal_strlcpy(char *dst, const char *src, uptr maxlen);
64char *internal_strncpy(char *dst, const char *src, uptr n);65char *internal_strncpy(char *dst, const char *src, uptr n);
lib/libtsan/sanitizer_common/sanitizer_linux.cpp+15-7
...@@ -635,7 +635,7 @@ bool DirExists(const char *path) {...@@ -635,7 +635,7 @@ bool DirExists(const char *path) {
635}635}
636636
637# if !SANITIZER_NETBSD637# if !SANITIZER_NETBSD
638tid_t GetTid() {638ThreadID GetTid() {
639# if SANITIZER_FREEBSD639# if SANITIZER_FREEBSD
640 long Tid;640 long Tid;
641 thr_self(&Tid);641 thr_self(&Tid);
...@@ -649,7 +649,7 @@ tid_t GetTid() {...@@ -649,7 +649,7 @@ tid_t GetTid() {
649# endif649# endif
650}650}
651651
652int TgKill(pid_t pid, tid_t tid, int sig) {652int TgKill(pid_t pid, ThreadID tid, int sig) {
653# if SANITIZER_LINUX653# if SANITIZER_LINUX
654 return internal_syscall(SYSCALL(tgkill), pid, tid, sig);654 return internal_syscall(SYSCALL(tgkill), pid, tid, sig);
655# elif SANITIZER_FREEBSD655# elif SANITIZER_FREEBSD
...@@ -1091,7 +1091,7 @@ ThreadLister::ThreadLister(pid_t pid) : buffer_(4096) {...@@ -1091,7 +1091,7 @@ ThreadLister::ThreadLister(pid_t pid) : buffer_(4096) {
1091}1091}
10921092
1093ThreadLister::Result ThreadLister::ListThreads(1093ThreadLister::Result ThreadLister::ListThreads(
1094 InternalMmapVector<tid_t> *threads) {1094 InternalMmapVector<ThreadID> *threads) {
1095 int descriptor = internal_open(task_path_.data(), O_RDONLY | O_DIRECTORY);1095 int descriptor = internal_open(task_path_.data(), O_RDONLY | O_DIRECTORY);
1096 if (internal_iserror(descriptor)) {1096 if (internal_iserror(descriptor)) {
1097 Report("Can't open %s for reading.\n", task_path_.data());1097 Report("Can't open %s for reading.\n", task_path_.data());
...@@ -1146,7 +1146,7 @@ ThreadLister::Result ThreadLister::ListThreads(...@@ -1146,7 +1146,7 @@ ThreadLister::Result ThreadLister::ListThreads(
1146 }1146 }
1147}1147}
11481148
1149const char *ThreadLister::LoadStatus(tid_t tid) {1149const char *ThreadLister::LoadStatus(ThreadID tid) {
1150 status_path_.clear();1150 status_path_.clear();
1151 status_path_.AppendF("%s/%llu/status", task_path_.data(), tid);1151 status_path_.AppendF("%s/%llu/status", task_path_.data(), tid);
1152 auto cleanup = at_scope_exit([&] {1152 auto cleanup = at_scope_exit([&] {
...@@ -1159,7 +1159,7 @@ const char *ThreadLister::LoadStatus(tid_t tid) {...@@ -1159,7 +1159,7 @@ const char *ThreadLister::LoadStatus(tid_t tid) {
1159 return buffer_.data();1159 return buffer_.data();
1160}1160}
11611161
1162bool ThreadLister::IsAlive(tid_t tid) {1162bool ThreadLister::IsAlive(ThreadID tid) {
1163 // /proc/%d/task/%d/status uses same call to detect alive threads as1163 // /proc/%d/task/%d/status uses same call to detect alive threads as
1164 // proc_task_readdir. See task_state implementation in Linux.1164 // proc_task_readdir. See task_state implementation in Linux.
1165 static const char kPrefix[] = "\nPPid:";1165 static const char kPrefix[] = "\nPPid:";
...@@ -1289,7 +1289,7 @@ uptr GetPageSize() {...@@ -1289,7 +1289,7 @@ uptr GetPageSize() {
12891289
1290uptr ReadBinaryName(/*out*/ char *buf, uptr buf_len) {1290uptr ReadBinaryName(/*out*/ char *buf, uptr buf_len) {
1291# if SANITIZER_HAIKU1291# if SANITIZER_HAIKU
1292 int cookie = 0;1292 int32 cookie = 0;
1293 image_info info;1293 image_info info;
1294 const char *argv0 = "<UNKNOWN>";1294 const char *argv0 = "<UNKNOWN>";
1295 while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {1295 while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
...@@ -1989,7 +1989,10 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {...@@ -1989,7 +1989,10 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1989# elif SANITIZER_NETBSD1989# elif SANITIZER_NETBSD
1990 uptr err = ucontext->uc_mcontext.__gregs[_REG_ERR];1990 uptr err = ucontext->uc_mcontext.__gregs[_REG_ERR];
1991# elif SANITIZER_HAIKU1991# elif SANITIZER_HAIKU
1992 uptr err = ucontext->uc_mcontext.r13;1992 uptr err = 0; // FIXME: ucontext->uc_mcontext.r13;
1993 // The err register was added on the main branch and not
1994 // available with the current release. To be reverted later.
1995 // https://github.com/haiku/haiku/commit/11adda21aa4e6b24f71a496868a44d7607bc3764
1993# elif SANITIZER_SOLARIS && defined(__i386__)1996# elif SANITIZER_SOLARIS && defined(__i386__)
1994 const int Err = 13;1997 const int Err = 13;
1995 uptr err = ucontext->uc_mcontext.gregs[Err];1998 uptr err = ucontext->uc_mcontext.gregs[Err];
...@@ -2619,6 +2622,11 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {...@@ -2619,6 +2622,11 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
2619 *pc = ucontext->uc_mcontext.mc_eip;2622 *pc = ucontext->uc_mcontext.mc_eip;
2620 *bp = ucontext->uc_mcontext.mc_ebp;2623 *bp = ucontext->uc_mcontext.mc_ebp;
2621 *sp = ucontext->uc_mcontext.mc_esp;2624 *sp = ucontext->uc_mcontext.mc_esp;
2625# elif SANITIZER_HAIKU
2626 ucontext_t *ucontext = (ucontext_t *)context;
2627 *pc = ucontext->uc_mcontext.eip;
2628 *bp = ucontext->uc_mcontext.ebp;
2629 *sp = ucontext->uc_mcontext.esp;
2622# else2630# else
2623 ucontext_t *ucontext = (ucontext_t *)context;2631 ucontext_t *ucontext = (ucontext_t *)context;
2624# if SANITIZER_SOLARIS2632# if SANITIZER_SOLARIS
lib/libtsan/sanitizer_common/sanitizer_linux.h+3-3
...@@ -108,11 +108,11 @@ class ThreadLister {...@@ -108,11 +108,11 @@ class ThreadLister {
108 Incomplete,108 Incomplete,
109 Ok,109 Ok,
110 };110 };
111 Result ListThreads(InternalMmapVector<tid_t> *threads);111 Result ListThreads(InternalMmapVector<ThreadID> *threads);
112 const char *LoadStatus(tid_t tid);112 const char *LoadStatus(ThreadID tid);
113113
114 private:114 private:
115 bool IsAlive(tid_t tid);115 bool IsAlive(ThreadID tid);
116116
117 InternalScopedString task_path_;117 InternalScopedString task_path_;
118 InternalScopedString status_path_;118 InternalScopedString status_path_;
lib/libtsan/sanitizer_common/sanitizer_linux_libcdep.cpp+1
...@@ -29,6 +29,7 @@...@@ -29,6 +29,7 @@
29# include "sanitizer_solaris.h"29# include "sanitizer_solaris.h"
3030
31# if SANITIZER_HAIKU31# if SANITIZER_HAIKU
32# define _GNU_SOURCE
32# define _DEFAULT_SOURCE33# define _DEFAULT_SOURCE
33# endif34# endif
3435
lib/libtsan/sanitizer_common/sanitizer_mac.cpp+255-104
...@@ -22,6 +22,11 @@...@@ -22,6 +22,11 @@
22# endif22# endif
23# include <stdio.h>23# include <stdio.h>
2424
25// Start searching for available memory region past PAGEZERO, which is
26// 4KB on 32-bit and 4GB on 64-bit.
27# define GAP_SEARCH_START_ADDRESS \
28 ((SANITIZER_WORDSIZE == 32) ? 0x000000001000 : 0x000100000000)
29
25# include "sanitizer_common.h"30# include "sanitizer_common.h"
26# include "sanitizer_file.h"31# include "sanitizer_file.h"
27# include "sanitizer_flags.h"32# include "sanitizer_flags.h"
...@@ -58,9 +63,11 @@ extern char ***_NSGetArgv(void);...@@ -58,9 +63,11 @@ extern char ***_NSGetArgv(void);
58# include <dlfcn.h> // for dladdr()63# include <dlfcn.h> // for dladdr()
59# include <errno.h>64# include <errno.h>
60# include <fcntl.h>65# include <fcntl.h>
66# include <inttypes.h>
61# include <libkern/OSAtomic.h>67# include <libkern/OSAtomic.h>
62# include <mach-o/dyld.h>68# include <mach-o/dyld.h>
63# include <mach/mach.h>69# include <mach/mach.h>
70# include <mach/mach_error.h>
64# include <mach/mach_time.h>71# include <mach/mach_time.h>
65# include <mach/vm_statistics.h>72# include <mach/vm_statistics.h>
66# include <malloc/malloc.h>73# include <malloc/malloc.h>
...@@ -96,8 +103,16 @@ extern "C" {...@@ -96,8 +103,16 @@ extern "C" {
96 natural_t *nesting_depth,103 natural_t *nesting_depth,
97 vm_region_recurse_info_t info,104 vm_region_recurse_info_t info,
98 mach_msg_type_number_t *infoCnt);105 mach_msg_type_number_t *infoCnt);
106
107 extern const void* _dyld_get_shared_cache_range(size_t* length);
99}108}
100109
110# if !SANITIZER_GO
111// Weak symbol no-op when TSan is not linked
112SANITIZER_WEAK_ATTRIBUTE extern void __tsan_set_in_internal_write_call(
113 bool value) {}
114# endif
115
101namespace __sanitizer {116namespace __sanitizer {
102117
103#include "sanitizer_syscall_generic.inc"118#include "sanitizer_syscall_generic.inc"
...@@ -168,7 +183,15 @@ uptr internal_read(fd_t fd, void *buf, uptr count) {...@@ -168,7 +183,15 @@ uptr internal_read(fd_t fd, void *buf, uptr count) {
168}183}
169184
170uptr internal_write(fd_t fd, const void *buf, uptr count) {185uptr internal_write(fd_t fd, const void *buf, uptr count) {
186# if SANITIZER_GO
171 return write(fd, buf, count);187 return write(fd, buf, count);
188# else
189 // We need to disable interceptors when writing in TSan
190 __tsan_set_in_internal_write_call(true);
191 uptr res = write(fd, buf, count);
192 __tsan_set_in_internal_write_call(false);
193 return res;
194# endif
172}195}
173196
174uptr internal_stat(const char *path, void *buf) {197uptr internal_stat(const char *path, void *buf) {
...@@ -258,53 +281,43 @@ int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,...@@ -258,53 +281,43 @@ int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
258 (size_t)newlen);281 (size_t)newlen);
259}282}
260283
261static fd_t internal_spawn_impl(const char *argv[], const char *envp[],284bool internal_spawn(const char* argv[], const char* envp[], pid_t* pid,
262 pid_t *pid) {285 fd_t fd_stdin, fd_t fd_stdout) {
263 fd_t primary_fd = kInvalidFd;286 // NOTE: Caller ensures that fd_stdin and fd_stdout are not 0, 1, or 2, since
264 fd_t secondary_fd = kInvalidFd;287 // this can break communication.
288 //
289 // NOTE: Caller is responsible for closing fd_stdin after the process has
290 // died.
265291
292 int res;
266 auto fd_closer = at_scope_exit([&] {293 auto fd_closer = at_scope_exit([&] {
267 internal_close(primary_fd);294 // NOTE: We intentionally do not close fd_stdin since this can
268 internal_close(secondary_fd);295 // cause us to receive a fatal SIGPIPE if the process dies.
296 internal_close(fd_stdout);
269 });297 });
270298
271 // We need a new pseudoterminal to avoid buffering problems. The 'atos' tool
272 // in particular detects when it's talking to a pipe and forgets to flush the
273 // output stream after sending a response.
274 primary_fd = posix_openpt(O_RDWR);
275 if (primary_fd == kInvalidFd)
276 return kInvalidFd;
277
278 int res = grantpt(primary_fd) || unlockpt(primary_fd);
279 if (res != 0) return kInvalidFd;
280
281 // Use TIOCPTYGNAME instead of ptsname() to avoid threading problems.
282 char secondary_pty_name[128];
283 res = ioctl(primary_fd, TIOCPTYGNAME, secondary_pty_name);
284 if (res == -1) return kInvalidFd;
285
286 secondary_fd = internal_open(secondary_pty_name, O_RDWR);
287 if (secondary_fd == kInvalidFd)
288 return kInvalidFd;
289
290 // File descriptor actions299 // File descriptor actions
291 posix_spawn_file_actions_t acts;300 posix_spawn_file_actions_t acts;
292 res = posix_spawn_file_actions_init(&acts);301 res = posix_spawn_file_actions_init(&acts);
293 if (res != 0) return kInvalidFd;302 if (res != 0)
303 return false;
294304
295 auto acts_cleanup = at_scope_exit([&] {305 auto acts_cleanup = at_scope_exit([&] {
296 posix_spawn_file_actions_destroy(&acts);306 posix_spawn_file_actions_destroy(&acts);
297 });307 });
298308
299 res = posix_spawn_file_actions_adddup2(&acts, secondary_fd, STDIN_FILENO) ||309 res = posix_spawn_file_actions_adddup2(&acts, fd_stdin, STDIN_FILENO) ||
300 posix_spawn_file_actions_adddup2(&acts, secondary_fd, STDOUT_FILENO) ||310 posix_spawn_file_actions_adddup2(&acts, fd_stdout, STDOUT_FILENO) ||
301 posix_spawn_file_actions_addclose(&acts, secondary_fd);311 posix_spawn_file_actions_addclose(&acts, fd_stdin) ||
302 if (res != 0) return kInvalidFd;312 posix_spawn_file_actions_addclose(&acts, fd_stdout);
313 if (res != 0)
314 return false;
303315
304 // Spawn attributes316 // Spawn attributes
305 posix_spawnattr_t attrs;317 posix_spawnattr_t attrs;
306 res = posix_spawnattr_init(&attrs);318 res = posix_spawnattr_init(&attrs);
307 if (res != 0) return kInvalidFd;319 if (res != 0)
320 return false;
308321
309 auto attrs_cleanup = at_scope_exit([&] {322 auto attrs_cleanup = at_scope_exit([&] {
310 posix_spawnattr_destroy(&attrs);323 posix_spawnattr_destroy(&attrs);
...@@ -313,50 +326,17 @@ static fd_t internal_spawn_impl(const char *argv[], const char *envp[],...@@ -313,50 +326,17 @@ static fd_t internal_spawn_impl(const char *argv[], const char *envp[],
313 // In the spawned process, close all file descriptors that are not explicitly326 // In the spawned process, close all file descriptors that are not explicitly
314 // described by the file actions object. This is Darwin-specific extension.327 // described by the file actions object. This is Darwin-specific extension.
315 res = posix_spawnattr_setflags(&attrs, POSIX_SPAWN_CLOEXEC_DEFAULT);328 res = posix_spawnattr_setflags(&attrs, POSIX_SPAWN_CLOEXEC_DEFAULT);
316 if (res != 0) return kInvalidFd;329 if (res != 0)
330 return false;
317331
318 // posix_spawn332 // posix_spawn
319 char **argv_casted = const_cast<char **>(argv);333 char **argv_casted = const_cast<char **>(argv);
320 char **envp_casted = const_cast<char **>(envp);334 char **envp_casted = const_cast<char **>(envp);
321 res = posix_spawn(pid, argv[0], &acts, &attrs, argv_casted, envp_casted);335 res = posix_spawn(pid, argv[0], &acts, &attrs, argv_casted, envp_casted);
322 if (res != 0) return kInvalidFd;336 if (res != 0)
323337 return false;
324 // Disable echo in the new terminal, disable CR.
325 struct termios termflags;
326 tcgetattr(primary_fd, &termflags);
327 termflags.c_oflag &= ~ONLCR;
328 termflags.c_lflag &= ~ECHO;
329 tcsetattr(primary_fd, TCSANOW, &termflags);
330
331 // On success, do not close primary_fd on scope exit.
332 fd_t fd = primary_fd;
333 primary_fd = kInvalidFd;
334
335 return fd;
336}
337
338fd_t internal_spawn(const char *argv[], const char *envp[], pid_t *pid) {
339 // The client program may close its stdin and/or stdout and/or stderr thus
340 // allowing open/posix_openpt to reuse file descriptors 0, 1 or 2. In this
341 // case the communication is broken if either the parent or the child tries to
342 // close or duplicate these descriptors. We temporarily reserve these
343 // descriptors here to prevent this.
344 fd_t low_fds[3];
345 size_t count = 0;
346
347 for (; count < 3; count++) {
348 low_fds[count] = posix_openpt(O_RDWR);
349 if (low_fds[count] >= STDERR_FILENO)
350 break;
351 }
352
353 fd_t fd = internal_spawn_impl(argv, envp, pid);
354
355 for (; count > 0; count--) {
356 internal_close(low_fds[count]);
357 }
358338
359 return fd;339 return true;
360}340}
361341
362uptr internal_rename(const char *oldpath, const char *newpath) {342uptr internal_rename(const char *oldpath, const char *newpath) {
...@@ -394,8 +374,8 @@ bool DirExists(const char *path) {...@@ -394,8 +374,8 @@ bool DirExists(const char *path) {
394 return S_ISDIR(st.st_mode);374 return S_ISDIR(st.st_mode);
395}375}
396376
397tid_t GetTid() {377ThreadID GetTid() {
398 tid_t tid;378 ThreadID tid;
399 pthread_threadid_np(nullptr, &tid);379 pthread_threadid_np(nullptr, &tid);
400 return tid;380 return tid;
401}381}
...@@ -769,11 +749,17 @@ void internal_join_thread(void *th) { pthread_join((pthread_t)th, 0); }...@@ -769,11 +749,17 @@ void internal_join_thread(void *th) { pthread_join((pthread_t)th, 0); }
769static Mutex syslog_lock;749static Mutex syslog_lock;
770# endif750# endif
771751
752# if SANITIZER_DRIVERKIT
753# define SANITIZER_OS_LOG os_log
754# else
755# define SANITIZER_OS_LOG os_log_error
756# endif
757
772void WriteOneLineToSyslog(const char *s) {758void WriteOneLineToSyslog(const char *s) {
773#if !SANITIZER_GO759#if !SANITIZER_GO
774 syslog_lock.CheckLocked();760 syslog_lock.CheckLocked();
775 if (GetMacosAlignedVersion() >= MacosVersion(10, 12)) {761 if (GetMacosAlignedVersion() >= MacosVersion(10, 12)) {
776 os_log_error(OS_LOG_DEFAULT, "%{public}s", s);762 SANITIZER_OS_LOG(OS_LOG_DEFAULT, "%{public}s", s);
777 } else {763 } else {
778#pragma clang diagnostic push764#pragma clang diagnostic push
779// as_log is deprecated.765// as_log is deprecated.
...@@ -837,22 +823,22 @@ void LogMessageOnPrintf(const char *str) {...@@ -837,22 +823,22 @@ void LogMessageOnPrintf(const char *str) {
837823
838void LogFullErrorReport(const char *buffer) {824void LogFullErrorReport(const char *buffer) {
839# if !SANITIZER_GO825# if !SANITIZER_GO
840 // Log with os_log_error. This will make it into the crash log.826 // When logging with os_log_error this will make it into the crash log.
841 if (internal_strncmp(SanitizerToolName, "AddressSanitizer",827 if (internal_strncmp(SanitizerToolName, "AddressSanitizer",
842 sizeof("AddressSanitizer") - 1) == 0)828 sizeof("AddressSanitizer") - 1) == 0)
843 os_log_error(OS_LOG_DEFAULT, "Address Sanitizer reported a failure.");829 SANITIZER_OS_LOG(OS_LOG_DEFAULT, "Address Sanitizer reported a failure.");
844 else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer",830 else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer",
845 sizeof("UndefinedBehaviorSanitizer") - 1) == 0)831 sizeof("UndefinedBehaviorSanitizer") - 1) == 0)
846 os_log_error(OS_LOG_DEFAULT,832 SANITIZER_OS_LOG(OS_LOG_DEFAULT,
847 "Undefined Behavior Sanitizer reported a failure.");833 "Undefined Behavior Sanitizer reported a failure.");
848 else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer",834 else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer",
849 sizeof("ThreadSanitizer") - 1) == 0)835 sizeof("ThreadSanitizer") - 1) == 0)
850 os_log_error(OS_LOG_DEFAULT, "Thread Sanitizer reported a failure.");836 SANITIZER_OS_LOG(OS_LOG_DEFAULT, "Thread Sanitizer reported a failure.");
851 else837 else
852 os_log_error(OS_LOG_DEFAULT, "Sanitizer tool reported a failure.");838 SANITIZER_OS_LOG(OS_LOG_DEFAULT, "Sanitizer tool reported a failure.");
853839
854 if (common_flags()->log_to_syslog)840 if (common_flags()->log_to_syslog)
855 os_log_error(OS_LOG_DEFAULT, "Consult syslog for more information.");841 SANITIZER_OS_LOG(OS_LOG_DEFAULT, "Consult syslog for more information.");
856842
857 // Log to syslog.843 // Log to syslog.
858 // The logging on OS X may call pthread_create so we need the threading844 // The logging on OS X may call pthread_create so we need the threading
...@@ -933,7 +919,17 @@ static void DisableMmapExcGuardExceptions() {...@@ -933,7 +919,17 @@ static void DisableMmapExcGuardExceptions() {
933 RTLD_DEFAULT, "task_set_exc_guard_behavior");919 RTLD_DEFAULT, "task_set_exc_guard_behavior");
934 if (set_behavior == nullptr) return;920 if (set_behavior == nullptr) return;
935 const task_exc_guard_behavior_t task_exc_guard_none = 0;921 const task_exc_guard_behavior_t task_exc_guard_none = 0;
936 set_behavior(mach_task_self(), task_exc_guard_none);922 kern_return_t res = set_behavior(mach_task_self(), task_exc_guard_none);
923 if (res != KERN_SUCCESS) {
924 Report(
925 "WARN: task_set_exc_guard_behavior returned %d (%s), "
926 "mmap may fail unexpectedly.\n",
927 res, mach_error_string(res));
928 if (res == KERN_DENIED)
929 Report(
930 "HINT: Check that task_set_exc_guard_behavior is allowed by "
931 "sandbox.\n");
932 }
937}933}
938934
939static void VerifyInterceptorsWorking();935static void VerifyInterceptorsWorking();
...@@ -1100,6 +1096,67 @@ static void StripEnv() {...@@ -1100,6 +1096,67 @@ static void StripEnv() {
1100}1096}
1101#endif // SANITIZER_GO1097#endif // SANITIZER_GO
11021098
1099// Prints out a consolidated memory map: contiguous regions
1100// are merged together.
1101static void PrintVmmap() {
1102 const mach_vm_address_t max_vm_address = GetMaxVirtualAddress() + 1;
1103 mach_vm_address_t address = GAP_SEARCH_START_ADDRESS;
1104 kern_return_t kr = KERN_SUCCESS;
1105
1106 Report("Memory map:\n");
1107 mach_vm_address_t last = 0;
1108 mach_vm_address_t lastsz = 0;
1109
1110 while (1) {
1111 mach_vm_size_t vmsize = 0;
1112 natural_t depth = 0;
1113 vm_region_submap_short_info_data_64_t vminfo;
1114 mach_msg_type_number_t count = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
1115 kr = mach_vm_region_recurse(mach_task_self(), &address, &vmsize, &depth,
1116 (vm_region_info_t)&vminfo, &count);
1117
1118 if (kr == KERN_DENIED) {
1119 Report(
1120 "ERROR: mach_vm_region_recurse got KERN_DENIED when printing memory "
1121 "map.\n");
1122 Report(
1123 "HINT: Check whether mach_vm_region_recurse is allowed by "
1124 "sandbox.\n");
1125 }
1126
1127 if (kr == KERN_SUCCESS && address < max_vm_address) {
1128 if (last + lastsz == address) {
1129 // This region is contiguous with the last; merge together.
1130 lastsz += vmsize;
1131 } else {
1132 if (lastsz)
1133 Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", (void*)last,
1134 (void*)(last + lastsz), lastsz);
1135
1136 last = address;
1137 lastsz = vmsize;
1138 }
1139 address += vmsize;
1140 } else {
1141 // We've reached the end of the memory map. Print the last remaining
1142 // region, if there is one.
1143 if (lastsz)
1144 Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", (void*)last,
1145 (void*)(last + lastsz), lastsz);
1146
1147 break;
1148 }
1149 }
1150}
1151
1152static void ReportShadowAllocFail(uptr shadow_size_bytes, uptr alignment) {
1153 Report(
1154 "FATAL: Failed to allocate shadow memory. Tried to allocate %p bytes "
1155 "(alignment=%p).\n",
1156 (void*)shadow_size_bytes, (void*)alignment);
1157 PrintVmmap();
1158}
1159
1103char **GetArgv() {1160char **GetArgv() {
1104 return *_NSGetArgv();1161 return *_NSGetArgv();
1105}1162}
...@@ -1207,10 +1264,11 @@ uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,...@@ -1207,10 +1264,11 @@ uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,
1207 if (new_max_vm < max_occupied_addr) {1264 if (new_max_vm < max_occupied_addr) {
1208 Report("Unable to find a memory range for dynamic shadow.\n");1265 Report("Unable to find a memory range for dynamic shadow.\n");
1209 Report(1266 Report(
1210 "space_size = %p, largest_gap_found = %p, max_occupied_addr = %p, "1267 "\tspace_size = %p\n\tlargest_gap_found = %p\n\tmax_occupied_addr "
1211 "new_max_vm = %p\n",1268 "= %p\n\tnew_max_vm = %p\n",
1212 (void *)space_size, (void *)largest_gap_found,1269 (void*)space_size, (void*)largest_gap_found, (void*)max_occupied_addr,
1213 (void *)max_occupied_addr, (void *)new_max_vm);1270 (void*)new_max_vm);
1271 ReportShadowAllocFail(shadow_size_bytes, alignment);
1214 CHECK(0 && "cannot place shadow");1272 CHECK(0 && "cannot place shadow");
1215 }1273 }
1216 RestrictMemoryToMaxAddress(new_max_vm);1274 RestrictMemoryToMaxAddress(new_max_vm);
...@@ -1221,6 +1279,7 @@ uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,...@@ -1221,6 +1279,7 @@ uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,
1221 nullptr, nullptr);1279 nullptr, nullptr);
1222 if (shadow_start == 0) {1280 if (shadow_start == 0) {
1223 Report("Unable to find a memory range after restricting VM.\n");1281 Report("Unable to find a memory range after restricting VM.\n");
1282 ReportShadowAllocFail(shadow_size_bytes, alignment);
1224 CHECK(0 && "cannot place shadow after restricting vm");1283 CHECK(0 && "cannot place shadow after restricting vm");
1225 }1284 }
1226 }1285 }
...@@ -1229,6 +1288,25 @@ uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,...@@ -1229,6 +1288,25 @@ uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,
1229 return shadow_start;1288 return shadow_start;
1230}1289}
12311290
1291// Returns a list of ranges which must be covered by shadow memory,
1292// and cannot overlap with any fixed mappings made by a sanitizer.
1293// This can ensure that the sanitizer runtime does not map over
1294// platform-reserved regions.
1295void GetAppReservedRanges(InternalMmapVector<ReservedRange>& ranges) {
1296 ranges.clear();
1297
1298# if SANITIZER_OSX
1299 // On macOS, the first 512GB are platform-reserved (some of which
1300 // may also be available to applications).
1301 ranges.push_back({0x1000UL, 0x8000000000UL});
1302# endif
1303
1304 VReport(2, "App ranges:\n");
1305 for (auto& [range_start, range_end] : ranges) {
1306 VReport(2, " [%p, %p]\n", range_start, range_end);
1307 }
1308}
1309
1232uptr MapDynamicShadowAndAliases(uptr shadow_size, uptr alias_size,1310uptr MapDynamicShadowAndAliases(uptr shadow_size, uptr alias_size,
1233 uptr num_aliases, uptr ring_buffer_size) {1311 uptr num_aliases, uptr ring_buffer_size) {
1234 CHECK(false && "HWASan aliasing is unimplemented on Mac");1312 CHECK(false && "HWASan aliasing is unimplemented on Mac");
...@@ -1236,40 +1314,61 @@ uptr MapDynamicShadowAndAliases(uptr shadow_size, uptr alias_size,...@@ -1236,40 +1314,61 @@ uptr MapDynamicShadowAndAliases(uptr shadow_size, uptr alias_size,
1236}1314}
12371315
1238uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding,1316uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding,
1239 uptr *largest_gap_found,1317 uptr* largest_gap_found,
1240 uptr *max_occupied_addr) {1318 uptr* max_occupied_addr) {
1241 typedef vm_region_submap_short_info_data_64_t RegionInfo;
1242 enum { kRegionInfoSize = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 };
1243 // Start searching for available memory region past PAGEZERO, which is
1244 // 4KB on 32-bit and 4GB on 64-bit.
1245 mach_vm_address_t start_address =
1246 (SANITIZER_WORDSIZE == 32) ? 0x000000001000 : 0x000100000000;
1247
1248 const mach_vm_address_t max_vm_address = GetMaxVirtualAddress() + 1;1319 const mach_vm_address_t max_vm_address = GetMaxVirtualAddress() + 1;
1249 mach_vm_address_t address = start_address;1320 mach_vm_address_t address = GAP_SEARCH_START_ADDRESS;
1250 mach_vm_address_t free_begin = start_address;1321 mach_vm_address_t free_begin = GAP_SEARCH_START_ADDRESS;
1322
1323 // Restrict the search to be after any reserved ranges
1324 InternalMmapVector<ReservedRange> app_ranges;
1325 GetAppReservedRanges(app_ranges);
1326
1327 for (auto& [range_start, range_end] : app_ranges) {
1328 address = Max(address, (mach_vm_address_t)range_end);
1329 free_begin = Max(free_begin, (mach_vm_address_t)range_end);
1330 }
1331
1251 kern_return_t kr = KERN_SUCCESS;1332 kern_return_t kr = KERN_SUCCESS;
1252 if (largest_gap_found) *largest_gap_found = 0;1333 if (largest_gap_found) *largest_gap_found = 0;
1253 if (max_occupied_addr) *max_occupied_addr = 0;1334 if (max_occupied_addr) *max_occupied_addr = 0;
1254 while (kr == KERN_SUCCESS) {1335 while (kr == KERN_SUCCESS) {
1255 mach_vm_size_t vmsize = 0;1336 mach_vm_size_t vmsize = 0;
1256 natural_t depth = 0;1337 natural_t depth = 0;
1257 RegionInfo vminfo;1338 vm_region_submap_short_info_data_64_t vminfo;
1258 mach_msg_type_number_t count = kRegionInfoSize;1339 mach_msg_type_number_t count = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
1259 kr = mach_vm_region_recurse(mach_task_self(), &address, &vmsize, &depth,1340 kr = mach_vm_region_recurse(mach_task_self(), &address, &vmsize, &depth,
1260 (vm_region_info_t)&vminfo, &count);1341 (vm_region_info_t)&vminfo, &count);
12611342
1262 // There are cases where going beyond the processes' max vm does1343 if (kr == KERN_SUCCESS) {
1263 // not return KERN_INVALID_ADDRESS so we check for going beyond that1344 // There are cases where going beyond the processes' max vm does
1264 // max address as well.1345 // not return KERN_INVALID_ADDRESS so we check for going beyond that
1265 if (kr == KERN_INVALID_ADDRESS || address > max_vm_address) {1346 // max address as well.
1347 if (address > max_vm_address) {
1348 address = max_vm_address;
1349 kr = -1; // break after this iteration.
1350 }
1351
1352 if (max_occupied_addr)
1353 *max_occupied_addr = address + vmsize;
1354 } else if (kr == KERN_INVALID_ADDRESS) {
1266 // No more regions beyond "address", consider the gap at the end of VM.1355 // No more regions beyond "address", consider the gap at the end of VM.
1267 address = max_vm_address;1356 address = max_vm_address;
1268 vmsize = 0;1357
1269 kr = -1; // break after this iteration.1358 // We will break after this iteration anyway since kr != KERN_SUCCESS
1359 } else if (kr == KERN_DENIED) {
1360 Report("ERROR: Unable to find a memory range for dynamic shadow.\n");
1361 Report("HINT: Ensure mach_vm_region_recurse is allowed under sandbox.\n");
1362 Die();
1270 } else {1363 } else {
1271 if (max_occupied_addr) *max_occupied_addr = address + vmsize;1364 Report(
1365 "WARNING: mach_vm_region_recurse returned unexpected code %d (%s)\n",
1366 kr, mach_error_string(kr));
1367 DCHECK(false && "mach_vm_region_recurse returned unexpected code");
1368 break; // address is not valid unless KERN_SUCCESS, therefore we must not
1369 // use it.
1272 }1370 }
1371
1273 if (free_begin != address) {1372 if (free_begin != address) {
1274 // We found a free region [free_begin..address-1].1373 // We found a free region [free_begin..address-1].
1275 uptr gap_start = RoundUpTo((uptr)free_begin + left_padding, alignment);1374 uptr gap_start = RoundUpTo((uptr)free_begin + left_padding, alignment);
...@@ -1292,6 +1391,58 @@ uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding,...@@ -1292,6 +1391,58 @@ uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding,
1292 return 0;1391 return 0;
1293}1392}
12941393
1394// This function (when used during initialization when there is
1395// only a single thread), can be used to verify that a range
1396// of memory hasn't already been mapped, and won't be mapped
1397// later in the shared cache.
1398//
1399// If the syscall mach_vm_region_recurse fails (due to sandbox),
1400// we assume that the memory is not mapped so that execution can continue.
1401//
1402// NOTE: range_end is inclusive
1403//
1404// WARNING: This function must NOT allocate memory, since it is
1405// used in InitializeShadowMemory between where we search for
1406// space for shadow and where we actually allocate it.
1407bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) {
1408 mach_vm_size_t vmsize = 0;
1409 natural_t depth = 0;
1410 vm_region_submap_short_info_data_64_t vminfo;
1411 mach_msg_type_number_t count = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
1412 mach_vm_address_t address = range_start;
1413
1414 // First, check if the range is already mapped.
1415 kern_return_t kr =
1416 mach_vm_region_recurse(mach_task_self(), &address, &vmsize, &depth,
1417 (vm_region_info_t)&vminfo, &count);
1418
1419 if (kr == KERN_DENIED) {
1420 Report(
1421 "WARN: mach_vm_region_recurse returned KERN_DENIED when checking "
1422 "whether an address is mapped.\n");
1423 Report("HINT: Is mach_vm_region_recurse allowed by sandbox?\n");
1424 }
1425
1426 if (kr == KERN_SUCCESS && !IntervalsAreSeparate(address, address + vmsize - 1,
1427 range_start, range_end)) {
1428 // Overlaps with already-mapped memory
1429 return false;
1430 }
1431
1432 size_t cacheLength;
1433 uptr cacheStart = (uptr)_dyld_get_shared_cache_range(&cacheLength);
1434
1435 if (cacheStart &&
1436 !IntervalsAreSeparate(cacheStart, cacheStart + cacheLength - 1,
1437 range_start, range_end)) {
1438 // Overlaps with shared cache region
1439 return false;
1440 }
1441
1442 // We believe this address is available.
1443 return true;
1444}
1445
1295// FIXME implement on this platform.1446// FIXME implement on this platform.
1296void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}1447void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}
12971448
lib/libtsan/sanitizer_common/sanitizer_mac.h+5
...@@ -58,8 +58,13 @@ struct DarwinKernelVersion : VersionBase<DarwinKernelVersion> {...@@ -58,8 +58,13 @@ struct DarwinKernelVersion : VersionBase<DarwinKernelVersion> {
58 DarwinKernelVersion(u16 major, u16 minor) : VersionBase(major, minor) {}58 DarwinKernelVersion(u16 major, u16 minor) : VersionBase(major, minor) {}
59};59};
6060
61struct ReservedRange {
62 uptr beg, end;
63};
64
61MacosVersion GetMacosAlignedVersion();65MacosVersion GetMacosAlignedVersion();
62DarwinKernelVersion GetDarwinKernelVersion();66DarwinKernelVersion GetDarwinKernelVersion();
67void GetAppReservedRanges(InternalMmapVector<ReservedRange>& ranges);
6368
64char **GetEnviron();69char **GetEnviron();
6570
lib/libtsan/sanitizer_common/sanitizer_netbsd.cpp+2-2
...@@ -229,12 +229,12 @@ uptr internal_execve(const char *filename, char *const argv[],...@@ -229,12 +229,12 @@ uptr internal_execve(const char *filename, char *const argv[],
229 return _sys_execve(filename, argv, envp);229 return _sys_execve(filename, argv, envp);
230}230}
231231
232tid_t GetTid() {232ThreadID GetTid() {
233 DEFINE__REAL(int, _lwp_self);233 DEFINE__REAL(int, _lwp_self);
234 return _REAL(_lwp_self);234 return _REAL(_lwp_self);
235}235}
236236
237int TgKill(pid_t pid, tid_t tid, int sig) {237int TgKill(pid_t pid, ThreadID tid, int sig) {
238 DEFINE__REAL(int, _lwp_kill, int a, int b);238 DEFINE__REAL(int, _lwp_kill, int a, int b);
239 (void)pid;239 (void)pid;
240 return _REAL(_lwp_kill, tid, sig);240 return _REAL(_lwp_kill, tid, sig);
lib/libtsan/sanitizer_common/sanitizer_platform.h+27-1
...@@ -319,7 +319,11 @@...@@ -319,7 +319,11 @@
319#endif319#endif
320320
321// The first address that can be returned by mmap.321// The first address that can be returned by mmap.
322#define SANITIZER_MMAP_BEGIN 0322#if SANITIZER_AIX && SANITIZER_WORDSIZE == 64
323# define SANITIZER_MMAP_BEGIN 0x0a00'0000'0000'0000ULL
324#else
325# define SANITIZER_MMAP_BEGIN 0
326#endif
323327
324// The range of addresses which can be returned my mmap.328// The range of addresses which can be returned my mmap.
325// FIXME: this value should be different on different platforms. Larger values329// FIXME: this value should be different on different platforms. Larger values
...@@ -482,4 +486,26 @@...@@ -482,4 +486,26 @@
482# define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL 0486# define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL 0
483#endif487#endif
484488
489#if SANITIZER_LINUX
490# if SANITIZER_GLIBC
491// Workaround for
492// glibc/commit/3d3572f59059e2b19b8541ea648a6172136ec42e
493// Linux: Keep termios ioctl constants strictly internal
494# if __GLIBC_PREREQ(2, 41)
495# define SANITIZER_TERMIOS_IOCTL_CONSTANTS 0
496# else
497# define SANITIZER_TERMIOS_IOCTL_CONSTANTS 1
498# endif
499# else
500# define SANITIZER_TERMIOS_IOCTL_CONSTANTS 1
501# endif
502#endif
503
504#if SANITIZER_APPLE && SANITIZER_WORDSIZE == 64
505// MTE uses the lower half of the top byte.
506# define STRIP_MTE_TAG(addr) ((addr) & ~((uptr)0x0f << 56))
507#else
508# define STRIP_MTE_TAG(addr) (addr)
509#endif
510
485#endif // SANITIZER_PLATFORM_H511#endif // SANITIZER_PLATFORM_H
lib/libtsan/sanitizer_common/sanitizer_platform_interceptors.h+5-4
...@@ -167,7 +167,7 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,...@@ -167,7 +167,7 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
167167
168#define SANITIZER_INTERCEPT_STRLEN SI_NOT_FUCHSIA168#define SANITIZER_INTERCEPT_STRLEN SI_NOT_FUCHSIA
169#define SANITIZER_INTERCEPT_STRNLEN (SI_NOT_MAC && SI_NOT_FUCHSIA)169#define SANITIZER_INTERCEPT_STRNLEN (SI_NOT_MAC && SI_NOT_FUCHSIA)
170#define SANITIZER_INTERCEPT_STRCMP (SI_NOT_FUCHSIA && SI_NOT_AIX)170#define SANITIZER_INTERCEPT_STRCMP SI_NOT_FUCHSIA
171#define SANITIZER_INTERCEPT_STRSTR SI_NOT_FUCHSIA171#define SANITIZER_INTERCEPT_STRSTR SI_NOT_FUCHSIA
172#define SANITIZER_INTERCEPT_STRCASESTR (SI_POSIX && SI_NOT_AIX)172#define SANITIZER_INTERCEPT_STRCASESTR (SI_POSIX && SI_NOT_AIX)
173#define SANITIZER_INTERCEPT_STRTOK SI_NOT_FUCHSIA173#define SANITIZER_INTERCEPT_STRTOK SI_NOT_FUCHSIA
...@@ -179,8 +179,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,...@@ -179,8 +179,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
179#define SANITIZER_INTERCEPT_TEXTDOMAIN SI_LINUX_NOT_ANDROID || SI_SOLARIS179#define SANITIZER_INTERCEPT_TEXTDOMAIN SI_LINUX_NOT_ANDROID || SI_SOLARIS
180#define SANITIZER_INTERCEPT_STRCASECMP SI_POSIX180#define SANITIZER_INTERCEPT_STRCASECMP SI_POSIX
181#define SANITIZER_INTERCEPT_MEMSET 1181#define SANITIZER_INTERCEPT_MEMSET 1
182#define SANITIZER_INTERCEPT_MEMMOVE SI_NOT_AIX182#define SANITIZER_INTERCEPT_MEMMOVE 1
183#define SANITIZER_INTERCEPT_MEMCPY SI_NOT_AIX183#define SANITIZER_INTERCEPT_MEMCPY 1
184#define SANITIZER_INTERCEPT_MEMCMP SI_NOT_FUCHSIA184#define SANITIZER_INTERCEPT_MEMCMP SI_NOT_FUCHSIA
185#define SANITIZER_INTERCEPT_BCMP \185#define SANITIZER_INTERCEPT_BCMP \
186 SANITIZER_INTERCEPT_MEMCMP && \186 SANITIZER_INTERCEPT_MEMCMP && \
...@@ -551,7 +551,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,...@@ -551,7 +551,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
551#define SANITIZER_INTERCEPT_MALLOC_USABLE_SIZE (!SI_MAC && !SI_NETBSD)551#define SANITIZER_INTERCEPT_MALLOC_USABLE_SIZE (!SI_MAC && !SI_NETBSD)
552#define SANITIZER_INTERCEPT_MCHECK_MPROBE SI_LINUX_NOT_ANDROID552#define SANITIZER_INTERCEPT_MCHECK_MPROBE SI_LINUX_NOT_ANDROID
553#define SANITIZER_INTERCEPT_WCSLEN 1553#define SANITIZER_INTERCEPT_WCSLEN 1
554#define SANITIZER_INTERCEPT_WCSCAT SI_POSIX554#define SANITIZER_INTERCEPT_WCSNLEN 1
555#define SANITIZER_INTERCEPT_WCSCAT (SI_POSIX || SI_WINDOWS)
555#define SANITIZER_INTERCEPT_WCSDUP SI_POSIX556#define SANITIZER_INTERCEPT_WCSDUP SI_POSIX
556#define SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION (!SI_WINDOWS && SI_NOT_FUCHSIA)557#define SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION (!SI_WINDOWS && SI_NOT_FUCHSIA)
557#define SANITIZER_INTERCEPT_BSD_SIGNAL SI_ANDROID558#define SANITIZER_INTERCEPT_BSD_SIGNAL SI_ANDROID
lib/libtsan/sanitizer_common/sanitizer_platform_limits_posix.cpp+15-17
...@@ -76,6 +76,7 @@...@@ -76,6 +76,7 @@
76#include <sys/vt.h>76#include <sys/vt.h>
77#include <linux/cdrom.h>77#include <linux/cdrom.h>
78#include <linux/fd.h>78#include <linux/fd.h>
79#include <linux/filter.h>
79#if SANITIZER_ANDROID80#if SANITIZER_ANDROID
80#include <linux/fs.h>81#include <linux/fs.h>
81#endif82#endif
...@@ -151,16 +152,15 @@ typedef struct user_fpregs elf_fpregset_t;...@@ -151,16 +152,15 @@ typedef struct user_fpregs elf_fpregset_t;
151#if defined(__mips64)152#if defined(__mips64)
152# include <sys/procfs.h>153# include <sys/procfs.h>
153#endif154#endif
154#include <sys/user.h>155# include <linux/if_eql.h>
155#include <linux/if_eql.h>156# include <linux/if_plip.h>
156#include <linux/if_plip.h>157# include <linux/lp.h>
157#include <linux/lp.h>158# include <linux/mroute.h>
158#include <linux/mroute.h>159# include <linux/mroute6.h>
159#include <linux/mroute6.h>160# include <linux/serial.h>
160#include <linux/scc.h>161# include <sys/ipc.h>
161#include <linux/serial.h>162# include <sys/msg.h>
162#include <sys/msg.h>163# include <sys/user.h>
163#include <sys/ipc.h>
164#endif // SANITIZER_ANDROID164#endif // SANITIZER_ANDROID
165165
166#include <link.h>166#include <link.h>
...@@ -516,6 +516,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -516,6 +516,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
516 unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);516 unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
517 unsigned struct_synth_info_sz = sizeof(struct synth_info);517 unsigned struct_synth_info_sz = sizeof(struct synth_info);
518 unsigned struct_vt_mode_sz = sizeof(struct vt_mode);518 unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
519 unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
519#endif // SANITIZER_LINUX520#endif // SANITIZER_LINUX
520521
521#if SANITIZER_GLIBC522#if SANITIZER_GLIBC
...@@ -532,8 +533,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -532,8 +533,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
532 unsigned struct_kbsentry_sz = sizeof(struct kbsentry);533 unsigned struct_kbsentry_sz = sizeof(struct kbsentry);
533 unsigned struct_mtconfiginfo_sz = sizeof(struct mtconfiginfo);534 unsigned struct_mtconfiginfo_sz = sizeof(struct mtconfiginfo);
534 unsigned struct_nr_parms_struct_sz = sizeof(struct nr_parms_struct);535 unsigned struct_nr_parms_struct_sz = sizeof(struct nr_parms_struct);
535 unsigned struct_scc_modem_sz = sizeof(struct scc_modem);
536 unsigned struct_scc_stat_sz = sizeof(struct scc_stat);
537 unsigned struct_serial_multiport_struct_sz536 unsigned struct_serial_multiport_struct_sz
538 = sizeof(struct serial_multiport_struct);537 = sizeof(struct serial_multiport_struct);
539 unsigned struct_serial_struct_sz = sizeof(struct serial_struct);538 unsigned struct_serial_struct_sz = sizeof(struct serial_struct);
...@@ -543,7 +542,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -543,7 +542,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
543542
544 unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);543 unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
545 unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);544 unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
546 unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
547# endif // SANITIZER_GLIBC545# endif // SANITIZER_GLIBC
548546
549# if !SANITIZER_ANDROID && !SANITIZER_APPLE && !SANITIZER_HAIKU547# if !SANITIZER_ANDROID && !SANITIZER_APPLE && !SANITIZER_HAIKU
...@@ -779,16 +777,16 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -779,16 +777,16 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
779 unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER;777 unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER;
780#endif // SOUND_VERSION778#endif // SOUND_VERSION
781 unsigned IOCTL_TCFLSH = TCFLSH;779 unsigned IOCTL_TCFLSH = TCFLSH;
782 unsigned IOCTL_TCGETA = TCGETA;780# if SANITIZER_TERMIOS_IOCTL_CONSTANTS
783 unsigned IOCTL_TCGETS = TCGETS;781 unsigned IOCTL_TCGETS = TCGETS;
782# endif
784 unsigned IOCTL_TCSBRK = TCSBRK;783 unsigned IOCTL_TCSBRK = TCSBRK;
785 unsigned IOCTL_TCSBRKP = TCSBRKP;784 unsigned IOCTL_TCSBRKP = TCSBRKP;
786 unsigned IOCTL_TCSETA = TCSETA;785# if SANITIZER_TERMIOS_IOCTL_CONSTANTS
787 unsigned IOCTL_TCSETAF = TCSETAF;
788 unsigned IOCTL_TCSETAW = TCSETAW;
789 unsigned IOCTL_TCSETS = TCSETS;786 unsigned IOCTL_TCSETS = TCSETS;
790 unsigned IOCTL_TCSETSF = TCSETSF;787 unsigned IOCTL_TCSETSF = TCSETSF;
791 unsigned IOCTL_TCSETSW = TCSETSW;788 unsigned IOCTL_TCSETSW = TCSETSW;
789# endif
792 unsigned IOCTL_TCXONC = TCXONC;790 unsigned IOCTL_TCXONC = TCXONC;
793 unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS;791 unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS;
794 unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR;792 unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR;
lib/libtsan/sanitizer_common/sanitizer_platform_limits_posix.h+32-6
...@@ -32,6 +32,8 @@...@@ -32,6 +32,8 @@
32# elif SANITIZER_GLIBC || SANITIZER_ANDROID32# elif SANITIZER_GLIBC || SANITIZER_ANDROID
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_HAIKU
36# include <stdint.h>
35# endif37# endif
3638
37# if defined(__sparc__)39# if defined(__sparc__)
...@@ -102,6 +104,8 @@ const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID...@@ -102,6 +104,8 @@ const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
102 ? FIRST_32_SECOND_64(104, 128)104 ? FIRST_32_SECOND_64(104, 128)
103# if defined(_ABIN32) && _MIPS_SIM == _ABIN32105# if defined(_ABIN32) && _MIPS_SIM == _ABIN32
104 : FIRST_32_SECOND_64(176, 216);106 : FIRST_32_SECOND_64(176, 216);
107# elif SANITIZER_MUSL
108 : FIRST_32_SECOND_64(160, 208);
105# else109# else
106 : FIRST_32_SECOND_64(160, 216);110 : FIRST_32_SECOND_64(160, 216);
107# endif111# endif
...@@ -476,6 +480,30 @@ struct __sanitizer_cmsghdr {...@@ -476,6 +480,30 @@ struct __sanitizer_cmsghdr {
476 int cmsg_level;480 int cmsg_level;
477 int cmsg_type;481 int cmsg_type;
478};482};
483# elif SANITIZER_MUSL
484struct __sanitizer_msghdr {
485 void *msg_name;
486 unsigned msg_namelen;
487 struct __sanitizer_iovec *msg_iov;
488 int msg_iovlen;
489# if SANITIZER_WORDSIZE == 64
490 int __pad1;
491# endif
492 void *msg_control;
493 unsigned msg_controllen;
494# if SANITIZER_WORDSIZE == 64
495 int __pad2;
496# endif
497 int msg_flags;
498};
499struct __sanitizer_cmsghdr {
500 unsigned cmsg_len;
501# if SANITIZER_WORDSIZE == 64
502 int __pad1;
503# endif
504 int cmsg_level;
505 int cmsg_type;
506};
479# else507# else
480// In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but508// In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but
481// many implementations don't conform to the standard.509// many implementations don't conform to the standard.
...@@ -603,7 +631,7 @@ typedef unsigned long __sanitizer_sigset_t;...@@ -603,7 +631,7 @@ typedef unsigned long __sanitizer_sigset_t;
603# elif SANITIZER_APPLE631# elif SANITIZER_APPLE
604typedef unsigned __sanitizer_sigset_t;632typedef unsigned __sanitizer_sigset_t;
605# elif SANITIZER_HAIKU633# elif SANITIZER_HAIKU
606typedef unsigned long __sanitizer_sigset_t;634typedef uint64_t __sanitizer_sigset_t;
607# elif SANITIZER_LINUX635# elif SANITIZER_LINUX
608struct __sanitizer_sigset_t {636struct __sanitizer_sigset_t {
609 // The size is determined by looking at sizeof of real sigset_t on linux.637 // The size is determined by looking at sizeof of real sigset_t on linux.
...@@ -1312,16 +1340,14 @@ extern unsigned IOCTL_SNDCTL_COPR_SENDMSG;...@@ -1312,16 +1340,14 @@ extern unsigned IOCTL_SNDCTL_COPR_SENDMSG;
1312extern unsigned IOCTL_SNDCTL_COPR_WCODE;1340extern unsigned IOCTL_SNDCTL_COPR_WCODE;
1313extern unsigned IOCTL_SNDCTL_COPR_WDATA;1341extern unsigned IOCTL_SNDCTL_COPR_WDATA;
1314extern unsigned IOCTL_TCFLSH;1342extern unsigned IOCTL_TCFLSH;
1315extern unsigned IOCTL_TCGETA;
1316extern unsigned IOCTL_TCGETS;
1317extern unsigned IOCTL_TCSBRK;1343extern unsigned IOCTL_TCSBRK;
1318extern unsigned IOCTL_TCSBRKP;1344extern unsigned IOCTL_TCSBRKP;
1319extern unsigned IOCTL_TCSETA;1345# if SANITIZER_TERMIOS_IOCTL_CONSTANTS
1320extern unsigned IOCTL_TCSETAF;1346extern unsigned IOCTL_TCGETS;
1321extern unsigned IOCTL_TCSETAW;
1322extern unsigned IOCTL_TCSETS;1347extern unsigned IOCTL_TCSETS;
1323extern unsigned IOCTL_TCSETSF;1348extern unsigned IOCTL_TCSETSF;
1324extern unsigned IOCTL_TCSETSW;1349extern unsigned IOCTL_TCSETSW;
1350# endif
1325extern unsigned IOCTL_TCXONC;1351extern unsigned IOCTL_TCXONC;
1326extern unsigned IOCTL_TIOCGLCKTRMIOS;1352extern unsigned IOCTL_TIOCGLCKTRMIOS;
1327extern unsigned IOCTL_TIOCGSOFTCAR;1353extern unsigned IOCTL_TIOCGSOFTCAR;
lib/libtsan/sanitizer_common/sanitizer_posix.cpp+3-12
...@@ -225,17 +225,9 @@ void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) {...@@ -225,17 +225,9 @@ void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) {
225 return (void *)p;225 return (void *)p;
226}226}
227227
228static inline bool IntervalsAreSeparate(uptr start1, uptr end1,228# if !SANITIZER_APPLE
229 uptr start2, uptr end2) {
230 CHECK(start1 <= end1);
231 CHECK(start2 <= end2);
232 return (end1 < start2) || (end2 < start1);
233}
234
235// FIXME: this is thread-unsafe, but should not cause problems most of the time.229// FIXME: this is thread-unsafe, but should not cause problems most of the time.
236// When the shadow is mapped only a single thread usually exists (plus maybe230// When the shadow is mapped only a single thread usually exists
237// several worker threads on Mac, which aren't expected to map big chunks of
238// memory).
239bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) {231bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) {
240 MemoryMappingLayout proc_maps(/*cache_enabled*/true);232 MemoryMappingLayout proc_maps(/*cache_enabled*/true);
241 if (proc_maps.Error())233 if (proc_maps.Error())
...@@ -251,7 +243,6 @@ bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) {...@@ -251,7 +243,6 @@ bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) {
251 return true;243 return true;
252}244}
253245
254#if !SANITIZER_APPLE
255void DumpProcessMap() {246void DumpProcessMap() {
256 MemoryMappingLayout proc_maps(/*cache_enabled*/true);247 MemoryMappingLayout proc_maps(/*cache_enabled*/true);
257 const sptr kBufSize = 4095;248 const sptr kBufSize = 4095;
...@@ -265,7 +256,7 @@ void DumpProcessMap() {...@@ -265,7 +256,7 @@ void DumpProcessMap() {
265 Report("End of process memory map.\n");256 Report("End of process memory map.\n");
266 UnmapOrDie(filename, kBufSize);257 UnmapOrDie(filename, kBufSize);
267}258}
268#endif259# endif
269260
270const char *GetPwd() {261const char *GetPwd() {
271 return GetEnv("PWD");262 return GetEnv("PWD");
lib/libtsan/sanitizer_common/sanitizer_posix.h+2-1
...@@ -67,7 +67,8 @@ uptr internal_ptrace(int request, int pid, void *addr, void *data);...@@ -67,7 +67,8 @@ uptr internal_ptrace(int request, int pid, void *addr, void *data);
67uptr internal_waitpid(int pid, int *status, int options);67uptr internal_waitpid(int pid, int *status, int options);
6868
69int internal_fork();69int internal_fork();
70fd_t internal_spawn(const char *argv[], const char *envp[], pid_t *pid);70bool internal_spawn(const char* argv[], const char* envp[], pid_t* pid,
71 fd_t fd_stdin, fd_t fd_stdout);
7172
72int internal_sysctl(const int *name, unsigned int namelen, void *oldp,73int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
73 uptr *oldlenp, const void *newp, uptr newlen);74 uptr *oldlenp, const void *newp, uptr newlen);
lib/libtsan/sanitizer_common/sanitizer_posix_libcdep.cpp+19
...@@ -47,6 +47,8 @@ typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);...@@ -47,6 +47,8 @@ typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
4747
48namespace __sanitizer {48namespace __sanitizer {
4949
50[[maybe_unused]] static atomic_uint8_t signal_handler_is_from_sanitizer[64];
51
50u32 GetUid() {52u32 GetUid() {
51 return getuid();53 return getuid();
52}54}
...@@ -210,6 +212,20 @@ void UnsetAlternateSignalStack() {...@@ -210,6 +212,20 @@ void UnsetAlternateSignalStack() {
210 UnmapOrDie(oldstack.ss_sp, oldstack.ss_size);212 UnmapOrDie(oldstack.ss_sp, oldstack.ss_size);
211}213}
212214
215bool IsSignalHandlerFromSanitizer(int signum) {
216 return atomic_load(&signal_handler_is_from_sanitizer[signum],
217 memory_order_relaxed);
218}
219
220bool SetSignalHandlerFromSanitizer(int signum, bool new_state) {
221 if (signum < 0 || static_cast<unsigned>(signum) >=
222 ARRAY_SIZE(signal_handler_is_from_sanitizer))
223 return false;
224
225 return atomic_exchange(&signal_handler_is_from_sanitizer[signum], new_state,
226 memory_order_relaxed);
227}
228
213static void MaybeInstallSigaction(int signum,229static void MaybeInstallSigaction(int signum,
214 SignalHandlerType handler) {230 SignalHandlerType handler) {
215 if (GetHandleSignalMode(signum) == kHandleSignalNo) return;231 if (GetHandleSignalMode(signum) == kHandleSignalNo) return;
...@@ -223,6 +239,9 @@ static void MaybeInstallSigaction(int signum,...@@ -223,6 +239,9 @@ static void MaybeInstallSigaction(int signum,
223 if (common_flags()->use_sigaltstack) sigact.sa_flags |= SA_ONSTACK;239 if (common_flags()->use_sigaltstack) sigact.sa_flags |= SA_ONSTACK;
224 CHECK_EQ(0, internal_sigaction(signum, &sigact, nullptr));240 CHECK_EQ(0, internal_sigaction(signum, &sigact, nullptr));
225 VReport(1, "Installed the sigaction for signal %d\n", signum);241 VReport(1, "Installed the sigaction for signal %d\n", signum);
242
243 if (common_flags()->cloak_sanitizer_signal_handlers)
244 SetSignalHandlerFromSanitizer(signum, true);
226}245}
227246
228void InstallDeadlySignalHandlers(SignalHandlerType handler) {247void InstallDeadlySignalHandlers(SignalHandlerType handler) {
lib/libtsan/sanitizer_common/sanitizer_procmaps_mac.cpp+102-37
...@@ -20,18 +20,21 @@...@@ -20,18 +20,21 @@
20#include <mach/mach.h>20#include <mach/mach.h>
2121
22// These are not available in older macOS SDKs.22// These are not available in older macOS SDKs.
23#ifndef CPU_SUBTYPE_X86_64_H23# ifndef CPU_SUBTYPE_X86_64_H
24#define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell */24# define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell */
25#endif25# endif
26#ifndef CPU_SUBTYPE_ARM_V7S26# ifndef CPU_SUBTYPE_ARM_V7S
27#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t)11) /* Swift */27# define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t)11) /* Swift */
28#endif28# endif
29#ifndef CPU_SUBTYPE_ARM_V7K29# ifndef CPU_SUBTYPE_ARM_V7K
30#define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t)12)30# define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t)12)
31#endif31# endif
32#ifndef CPU_TYPE_ARM6432# ifndef CPU_TYPE_ARM64
33#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)33# define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
34#endif34# endif
35# ifndef CPU_SUBTYPE_ARM64E
36# define CPU_SUBTYPE_ARM64E ((cpu_subtype_t)2)
37# endif
3538
36namespace __sanitizer {39namespace __sanitizer {
3740
...@@ -42,7 +45,6 @@ struct MemoryMappedSegmentData {...@@ -42,7 +45,6 @@ struct MemoryMappedSegmentData {
42 const char *current_load_cmd_addr;45 const char *current_load_cmd_addr;
43 u32 lc_type;46 u32 lc_type;
44 uptr base_virt_addr;47 uptr base_virt_addr;
45 uptr addr_mask;
46};48};
4749
48template <typename Section>50template <typename Section>
...@@ -51,12 +53,62 @@ static void NextSectionLoad(LoadedModule *module, MemoryMappedSegmentData *data,...@@ -51,12 +53,62 @@ static void NextSectionLoad(LoadedModule *module, MemoryMappedSegmentData *data,
51 const Section *sc = (const Section *)data->current_load_cmd_addr;53 const Section *sc = (const Section *)data->current_load_cmd_addr;
52 data->current_load_cmd_addr += sizeof(Section);54 data->current_load_cmd_addr += sizeof(Section);
5355
54 uptr sec_start = (sc->addr & data->addr_mask) + data->base_virt_addr;56 uptr sec_start = sc->addr + data->base_virt_addr;
55 uptr sec_end = sec_start + sc->size;57 uptr sec_end = sec_start + sc->size;
56 module->addAddressRange(sec_start, sec_end, /*executable=*/false, isWritable,58 module->addAddressRange(sec_start, sec_end, /*executable=*/false, isWritable,
57 sc->sectname);59 sc->sectname);
58}60}
5961
62static bool VerifyMemoryMapping(MemoryMappingLayout* mapping) {
63 InternalMmapVector<LoadedModule> modules;
64 modules.reserve(128); // matches DumpProcessMap
65 mapping->DumpListOfModules(&modules);
66
67 InternalMmapVector<LoadedModule::AddressRange> segments;
68 for (uptr i = 0; i < modules.size(); ++i) {
69 for (auto& range : modules[i].ranges()) {
70 if (range.beg == range.end)
71 continue;
72 segments.push_back(range);
73 }
74 }
75
76 // Verify that none of the segments overlap:
77 // 1. Sort the segments by the start address
78 // 2. Check that every segment starts after the previous one ends.
79 Sort(segments.data(), segments.size(),
80 [](LoadedModule::AddressRange& a, LoadedModule::AddressRange& b) {
81 return a.beg < b.beg;
82 });
83
84 // To avoid spam, we only print the report message once-per-process.
85 static bool invalid_module_map_reported = false;
86 bool well_formed = true;
87
88 for (size_t i = 1; i < segments.size(); i++) {
89 uptr cur_start = segments[i].beg;
90 uptr prev_end = segments[i - 1].end;
91 if (cur_start < prev_end) {
92 well_formed = false;
93 VReport(2, "Overlapping mappings: %s start = %p, %s end = %p\n",
94 segments[i].name, (void*)cur_start, segments[i - 1].name,
95 (void*)prev_end);
96 if (!invalid_module_map_reported) {
97 Report(
98 "WARN: Invalid dyld module map detected. This is most likely a bug "
99 "in the sanitizer.\n");
100 Report("WARN: Backtraces may be unreliable.\n");
101 invalid_module_map_reported = true;
102 }
103 }
104 }
105
106 for (auto& m : modules) m.clear();
107
108 mapping->Reset();
109 return well_formed;
110}
111
60void MemoryMappedSegment::AddAddressRanges(LoadedModule *module) {112void MemoryMappedSegment::AddAddressRanges(LoadedModule *module) {
61 // Don't iterate over sections when the caller hasn't set up the113 // Don't iterate over sections when the caller hasn't set up the
62 // data pointer, when there are no sections, or when the segment114 // data pointer, when there are no sections, or when the segment
...@@ -82,6 +134,7 @@ void MemoryMappedSegment::AddAddressRanges(LoadedModule *module) {...@@ -82,6 +134,7 @@ void MemoryMappedSegment::AddAddressRanges(LoadedModule *module) {
82134
83MemoryMappingLayout::MemoryMappingLayout(bool cache_enabled) {135MemoryMappingLayout::MemoryMappingLayout(bool cache_enabled) {
84 Reset();136 Reset();
137 VerifyMemoryMapping(this);
85}138}
86139
87MemoryMappingLayout::~MemoryMappingLayout() {140MemoryMappingLayout::~MemoryMappingLayout() {
...@@ -123,7 +176,7 @@ void MemoryMappingLayout::Reset() {...@@ -123,7 +176,7 @@ void MemoryMappingLayout::Reset() {
123// The dyld load address should be unchanged throughout process execution,176// The dyld load address should be unchanged throughout process execution,
124// and it is expensive to compute once many libraries have been loaded,177// and it is expensive to compute once many libraries have been loaded,
125// so cache it here and do not reset.178// so cache it here and do not reset.
126static mach_header *dyld_hdr = 0;179static const mach_header* dyld_hdr = 0;
127static const char kDyldPath[] = "/usr/lib/dyld";180static const char kDyldPath[] = "/usr/lib/dyld";
128static const int kDyldImageIdx = -1;181static const int kDyldImageIdx = -1;
129182
...@@ -187,17 +240,22 @@ typedef struct dyld_shared_cache_dylib_text_info...@@ -187,17 +240,22 @@ typedef struct dyld_shared_cache_dylib_text_info
187240
188extern bool _dyld_get_shared_cache_uuid(uuid_t uuid);241extern bool _dyld_get_shared_cache_uuid(uuid_t uuid);
189extern const void *_dyld_get_shared_cache_range(size_t *length);242extern const void *_dyld_get_shared_cache_range(size_t *length);
243extern intptr_t _dyld_get_image_slide(const struct mach_header* mh);
190extern int dyld_shared_cache_iterate_text(244extern int dyld_shared_cache_iterate_text(
191 const uuid_t cacheUuid,245 const uuid_t cacheUuid,
192 void (^callback)(const dyld_shared_cache_dylib_text_info *info));246 void (^callback)(const dyld_shared_cache_dylib_text_info *info));
247SANITIZER_WEAK_IMPORT const struct mach_header* _dyld_get_dyld_header(void);
193} // extern "C"248} // extern "C"
194249
195static mach_header *GetDyldImageHeaderViaSharedCache() {250static const mach_header* GetDyldImageHeaderViaSharedCache() {
196 uuid_t uuid;251 uuid_t uuid;
197 bool hasCache = _dyld_get_shared_cache_uuid(uuid);252 bool hasCache = _dyld_get_shared_cache_uuid(uuid);
198 if (!hasCache)253 if (!hasCache)
199 return nullptr;254 return nullptr;
200255
256 if (&_dyld_get_dyld_header != nullptr)
257 return _dyld_get_dyld_header();
258
201 size_t cacheLength;259 size_t cacheLength;
202 __block uptr cacheStart = (uptr)_dyld_get_shared_cache_range(&cacheLength);260 __block uptr cacheStart = (uptr)_dyld_get_shared_cache_range(&cacheLength);
203 CHECK(cacheStart && cacheLength);261 CHECK(cacheStart && cacheLength);
...@@ -255,23 +313,21 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,...@@ -255,23 +313,21 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,
255 layout_data->current_load_cmd_count--;313 layout_data->current_load_cmd_count--;
256 if (((const load_command *)lc)->cmd == kLCSegment) {314 if (((const load_command *)lc)->cmd == kLCSegment) {
257 const SegmentCommand* sc = (const SegmentCommand *)lc;315 const SegmentCommand* sc = (const SegmentCommand *)lc;
258 uptr base_virt_addr, addr_mask;316 if (internal_strcmp(sc->segname, "__LINKEDIT") == 0) {
259 if (layout_data->current_image == kDyldImageIdx) {317 // The LINKEDIT sections are for internal linker use, and may alias
260 base_virt_addr = (uptr)get_dyld_hdr();318 // with the LINKEDIT section for other modules. (If we included them,
261 // vmaddr is masked with 0xfffff because on macOS versions < 10.12,319 // our memory map would contain overlappping sections.)
262 // it contains an absolute address rather than an offset for dyld.320 return false;
263 // To make matters even more complicated, this absolute address321 }
264 // isn't actually the absolute segment address, but the offset portion322
265 // of the address is accurate when combined with the dyld base address,323 uptr base_virt_addr;
266 // and the mask will give just this offset.324 if (layout_data->current_image == kDyldImageIdx)
267 addr_mask = 0xfffff;325 base_virt_addr = (uptr)_dyld_get_image_slide(get_dyld_hdr());
268 } else {326 else
269 base_virt_addr =327 base_virt_addr =
270 (uptr)_dyld_get_image_vmaddr_slide(layout_data->current_image);328 (uptr)_dyld_get_image_vmaddr_slide(layout_data->current_image);
271 addr_mask = ~0;
272 }
273329
274 segment->start = (sc->vmaddr & addr_mask) + base_virt_addr;330 segment->start = sc->vmaddr + base_virt_addr;
275 segment->end = segment->start + sc->vmsize;331 segment->end = segment->start + sc->vmsize;
276 // Most callers don't need section information, so only fill this struct332 // Most callers don't need section information, so only fill this struct
277 // when required.333 // when required.
...@@ -281,9 +337,9 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,...@@ -281,9 +337,9 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,
281 (const char *)lc + sizeof(SegmentCommand);337 (const char *)lc + sizeof(SegmentCommand);
282 seg_data->lc_type = kLCSegment;338 seg_data->lc_type = kLCSegment;
283 seg_data->base_virt_addr = base_virt_addr;339 seg_data->base_virt_addr = base_virt_addr;
284 seg_data->addr_mask = addr_mask;
285 internal_strncpy(seg_data->name, sc->segname,340 internal_strncpy(seg_data->name, sc->segname,
286 ARRAY_SIZE(seg_data->name));341 ARRAY_SIZE(seg_data->name));
342 seg_data->name[ARRAY_SIZE(seg_data->name) - 1] = 0;
287 }343 }
288344
289 // Return the initial protection.345 // Return the initial protection.
...@@ -297,6 +353,7 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,...@@ -297,6 +353,7 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,
297 ? kDyldPath353 ? kDyldPath
298 : _dyld_get_image_name(layout_data->current_image);354 : _dyld_get_image_name(layout_data->current_image);
299 internal_strncpy(segment->filename, src, segment->filename_size);355 internal_strncpy(segment->filename, src, segment->filename_size);
356 segment->filename[segment->filename_size - 1] = 0;
300 }357 }
301 segment->arch = layout_data->current_arch;358 segment->arch = layout_data->current_arch;
302 internal_memcpy(segment->uuid, layout_data->current_uuid, kModuleUUIDSize);359 internal_memcpy(segment->uuid, layout_data->current_uuid, kModuleUUIDSize);
...@@ -311,18 +368,26 @@ ModuleArch ModuleArchFromCpuType(cpu_type_t cputype, cpu_subtype_t cpusubtype) {...@@ -311,18 +368,26 @@ ModuleArch ModuleArchFromCpuType(cpu_type_t cputype, cpu_subtype_t cpusubtype) {
311 case CPU_TYPE_I386:368 case CPU_TYPE_I386:
312 return kModuleArchI386;369 return kModuleArchI386;
313 case CPU_TYPE_X86_64:370 case CPU_TYPE_X86_64:
314 if (cpusubtype == CPU_SUBTYPE_X86_64_ALL) return kModuleArchX86_64;371 if (cpusubtype == CPU_SUBTYPE_X86_64_ALL)
315 if (cpusubtype == CPU_SUBTYPE_X86_64_H) return kModuleArchX86_64H;372 return kModuleArchX86_64;
373 if (cpusubtype == CPU_SUBTYPE_X86_64_H)
374 return kModuleArchX86_64H;
316 CHECK(0 && "Invalid subtype of x86_64");375 CHECK(0 && "Invalid subtype of x86_64");
317 return kModuleArchUnknown;376 return kModuleArchUnknown;
318 case CPU_TYPE_ARM:377 case CPU_TYPE_ARM:
319 if (cpusubtype == CPU_SUBTYPE_ARM_V6) return kModuleArchARMV6;378 if (cpusubtype == CPU_SUBTYPE_ARM_V6)
320 if (cpusubtype == CPU_SUBTYPE_ARM_V7) return kModuleArchARMV7;379 return kModuleArchARMV6;
321 if (cpusubtype == CPU_SUBTYPE_ARM_V7S) return kModuleArchARMV7S;380 if (cpusubtype == CPU_SUBTYPE_ARM_V7)
322 if (cpusubtype == CPU_SUBTYPE_ARM_V7K) return kModuleArchARMV7K;381 return kModuleArchARMV7;
382 if (cpusubtype == CPU_SUBTYPE_ARM_V7S)
383 return kModuleArchARMV7S;
384 if (cpusubtype == CPU_SUBTYPE_ARM_V7K)
385 return kModuleArchARMV7K;
323 CHECK(0 && "Invalid subtype of ARM");386 CHECK(0 && "Invalid subtype of ARM");
324 return kModuleArchUnknown;387 return kModuleArchUnknown;
325 case CPU_TYPE_ARM64:388 case CPU_TYPE_ARM64:
389 if (cpusubtype == CPU_SUBTYPE_ARM64E)
390 return kModuleArchARM64E;
326 return kModuleArchARM64;391 return kModuleArchARM64;
327 default:392 default:
328 CHECK(0 && "Invalid CPU type");393 CHECK(0 && "Invalid CPU type");
lib/libtsan/sanitizer_common/sanitizer_redefine_builtins.h+1-1
...@@ -15,7 +15,7 @@...@@ -15,7 +15,7 @@
15# define SANITIZER_REDEFINE_BUILTINS_H15# define SANITIZER_REDEFINE_BUILTINS_H
1616
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)18# if !defined(_WIN32) && !defined(_AIX) && !defined(__APPLE__)
1919
20asm(R"(20asm(R"(
21 .set memcpy, __sanitizer_internal_memcpy21 .set memcpy, __sanitizer_internal_memcpy
lib/libtsan/sanitizer_common/sanitizer_signal_interceptors.inc+40-2
...@@ -45,6 +45,8 @@ using namespace __sanitizer;...@@ -45,6 +45,8 @@ using namespace __sanitizer;
45INTERCEPTOR(uptr, bsd_signal, int signum, uptr handler) {45INTERCEPTOR(uptr, bsd_signal, int signum, uptr handler) {
46 SIGNAL_INTERCEPTOR_ENTER();46 SIGNAL_INTERCEPTOR_ENTER();
47 if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return 0;47 if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return 0;
48
49 // TODO: support cloak_sanitizer_signal_handlers
48 SIGNAL_INTERCEPTOR_SIGNAL_IMPL(bsd_signal, signum, handler);50 SIGNAL_INTERCEPTOR_SIGNAL_IMPL(bsd_signal, signum, handler);
49}51}
50#define INIT_BSD_SIGNAL COMMON_INTERCEPT_FUNCTION(bsd_signal)52#define INIT_BSD_SIGNAL COMMON_INTERCEPT_FUNCTION(bsd_signal)
...@@ -56,19 +58,55 @@ INTERCEPTOR(uptr, bsd_signal, int signum, uptr handler) {...@@ -56,19 +58,55 @@ INTERCEPTOR(uptr, bsd_signal, int signum, uptr handler) {
56INTERCEPTOR(uptr, signal, int signum, uptr handler) {58INTERCEPTOR(uptr, signal, int signum, uptr handler) {
57 SIGNAL_INTERCEPTOR_ENTER();59 SIGNAL_INTERCEPTOR_ENTER();
58 if (GetHandleSignalMode(signum) == kHandleSignalExclusive)60 if (GetHandleSignalMode(signum) == kHandleSignalExclusive)
61 // The user can neither view nor change the signal handler, regardless of
62 // the cloak_sanitizer_signal_handlers setting. This differs from
63 // sigaction().
59 return (uptr) nullptr;64 return (uptr) nullptr;
60 SIGNAL_INTERCEPTOR_SIGNAL_IMPL(signal, signum, handler);65
66 uptr ret = +[](auto signal, int signum, uptr handler) {
67 SIGNAL_INTERCEPTOR_SIGNAL_IMPL(signal, signum, handler);
68 }(signal, signum, handler);
69
70 if (ret != sig_err && SetSignalHandlerFromSanitizer(signum, false))
71 // If the user sets a signal handler, it becomes uncloaked, even if they
72 // reuse a sanitizer's signal handler.
73 ret = sig_dfl;
74
75 return ret;
61}76}
62#define INIT_SIGNAL COMMON_INTERCEPT_FUNCTION(signal)77#define INIT_SIGNAL COMMON_INTERCEPT_FUNCTION(signal)
6378
64INTERCEPTOR(int, sigaction_symname, int signum,79INTERCEPTOR(int, sigaction_symname, int signum,
65 const __sanitizer_sigaction *act, __sanitizer_sigaction *oldact) {80 const __sanitizer_sigaction *act, __sanitizer_sigaction *oldact) {
66 SIGNAL_INTERCEPTOR_ENTER();81 SIGNAL_INTERCEPTOR_ENTER();
82
67 if (GetHandleSignalMode(signum) == kHandleSignalExclusive) {83 if (GetHandleSignalMode(signum) == kHandleSignalExclusive) {
68 if (!oldact) return 0;84 if (!oldact) return 0;
69 act = nullptr;85 act = nullptr;
86 // If cloak_sanitizer_signal_handlers=true, the user can neither view nor
87 // change the signal handle.
88 // If false, the user can view but not change the signal handler. This
89 // differs from signal().
70 }90 }
71 SIGNAL_INTERCEPTOR_SIGACTION_IMPL(signum, act, oldact);91
92 int ret = +[](int signum, const __sanitizer_sigaction* act,
93 __sanitizer_sigaction* oldact) {
94 SIGNAL_INTERCEPTOR_SIGACTION_IMPL(signum, act, oldact);
95 }(signum, act, oldact);
96
97 if (act) {
98 if (ret == 0 && SetSignalHandlerFromSanitizer(signum, false)) {
99 // If the user sets a signal handler, it becomes uncloaked, even if they
100 // reuse a sanitizer's signal handler.
101
102 if (oldact)
103 oldact->handler = reinterpret_cast<__sanitizer_sighandler_ptr>(sig_dfl);
104 }
105 } else if (ret == 0 && oldact && IsSignalHandlerFromSanitizer(signum)) {
106 oldact->handler = reinterpret_cast<__sanitizer_sighandler_ptr>(sig_dfl);
107 }
108
109 return ret;
72}110}
73#define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction_symname)111#define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction_symname)
74112
lib/libtsan/sanitizer_common/sanitizer_stoptheworld.h+1-1
...@@ -38,7 +38,7 @@ class SuspendedThreadsList {...@@ -38,7 +38,7 @@ class SuspendedThreadsList {
38 }38 }
3939
40 virtual uptr ThreadCount() const { UNIMPLEMENTED(); }40 virtual uptr ThreadCount() const { UNIMPLEMENTED(); }
41 virtual tid_t GetThreadID(uptr index) const { UNIMPLEMENTED(); }41 virtual ThreadID GetThreadID(uptr index) const { UNIMPLEMENTED(); }
4242
43 protected:43 protected:
44 ~SuspendedThreadsList() {}44 ~SuspendedThreadsList() {}
lib/libtsan/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp+83-12
...@@ -94,17 +94,17 @@ class SuspendedThreadsListLinux final : public SuspendedThreadsList {...@@ -94,17 +94,17 @@ class SuspendedThreadsListLinux final : public SuspendedThreadsList {
94 public:94 public:
95 SuspendedThreadsListLinux() { thread_ids_.reserve(1024); }95 SuspendedThreadsListLinux() { thread_ids_.reserve(1024); }
9696
97 tid_t GetThreadID(uptr index) const override;97 ThreadID GetThreadID(uptr index) const override;
98 uptr ThreadCount() const override;98 uptr ThreadCount() const override;
99 bool ContainsTid(tid_t thread_id) const;99 bool ContainsTid(ThreadID thread_id) const;
100 void Append(tid_t tid);100 void Append(ThreadID tid);
101101
102 PtraceRegistersStatus GetRegistersAndSP(uptr index,102 PtraceRegistersStatus GetRegistersAndSP(uptr index,
103 InternalMmapVector<uptr> *buffer,103 InternalMmapVector<uptr> *buffer,
104 uptr *sp) const override;104 uptr *sp) const override;
105105
106 private:106 private:
107 InternalMmapVector<tid_t> thread_ids_;107 InternalMmapVector<ThreadID> thread_ids_;
108};108};
109109
110// Structure for passing arguments into the tracer thread.110// Structure for passing arguments into the tracer thread.
...@@ -137,10 +137,10 @@ class ThreadSuspender {...@@ -137,10 +137,10 @@ class ThreadSuspender {
137 private:137 private:
138 SuspendedThreadsListLinux suspended_threads_list_;138 SuspendedThreadsListLinux suspended_threads_list_;
139 pid_t pid_;139 pid_t pid_;
140 bool SuspendThread(tid_t thread_id);140 bool SuspendThread(ThreadID thread_id);
141};141};
142142
143bool ThreadSuspender::SuspendThread(tid_t tid) {143bool ThreadSuspender::SuspendThread(ThreadID tid) {
144 int pterrno;144 int pterrno;
145 if (internal_iserror(internal_ptrace(PTRACE_ATTACH, tid, nullptr, nullptr),145 if (internal_iserror(internal_ptrace(PTRACE_ATTACH, tid, nullptr, nullptr),
146 &pterrno)) {146 &pterrno)) {
...@@ -210,7 +210,7 @@ void ThreadSuspender::KillAllThreads() {...@@ -210,7 +210,7 @@ void ThreadSuspender::KillAllThreads() {
210bool ThreadSuspender::SuspendAllThreads() {210bool ThreadSuspender::SuspendAllThreads() {
211 ThreadLister thread_lister(pid_);211 ThreadLister thread_lister(pid_);
212 bool retry = true;212 bool retry = true;
213 InternalMmapVector<tid_t> threads;213 InternalMmapVector<ThreadID> threads;
214 threads.reserve(128);214 threads.reserve(128);
215 for (int i = 0; i < 30 && retry; ++i) {215 for (int i = 0; i < 30 && retry; ++i) {
216 retry = false;216 retry = false;
...@@ -226,7 +226,7 @@ bool ThreadSuspender::SuspendAllThreads() {...@@ -226,7 +226,7 @@ bool ThreadSuspender::SuspendAllThreads() {
226 case ThreadLister::Ok:226 case ThreadLister::Ok:
227 break;227 break;
228 }228 }
229 for (tid_t tid : threads) {229 for (ThreadID tid : threads) {
230 // Are we already attached to this thread?230 // Are we already attached to this thread?
231 // Currently this check takes linear time, however the number of threads231 // Currently this check takes linear time, however the number of threads
232 // is usually small.232 // is usually small.
...@@ -403,7 +403,77 @@ struct ScopedSetTracerPID {...@@ -403,7 +403,77 @@ struct ScopedSetTracerPID {
403 }403 }
404};404};
405405
406// This detects whether ptrace is blocked (e.g., by seccomp), by forking and
407// then attempting ptrace.
408// This separate check is necessary because StopTheWorld() creates a thread
409// with a shared virtual address space and shared TLS, and therefore
410// cannot use waitpid() due to the shared errno.
411static void TestPTrace() {
412# if SANITIZER_SPARC
413 // internal_fork() on SPARC actually calls __fork(). We can't safely fork,
414 // because it's possible seccomp has been configured to disallow fork() but
415 // allow clone().
416 VReport(1, "WARNING: skipping TestPTrace() because this is SPARC\n");
417 VReport(1,
418 "If seccomp blocks ptrace, LeakSanitizer may hang without further "
419 "notice\n");
420 VReport(
421 1,
422 "If seccomp does not block ptrace, you can safely ignore this warning\n");
423# else
424 // Heuristic: only check the first time this is called. This is not always
425 // correct (e.g., user manually triggers leak detection, then updates
426 // seccomp, then leak detection is triggered again).
427 static bool checked = false;
428 if (checked)
429 return;
430 checked = true;
431
432 // Hopefully internal_fork() is not too expensive, thanks to copy-on-write.
433 // Besides, this is only called the first time.
434 // Note that internal_fork() on non-SPARC Linux actually calls
435 // SYSCALL(clone); thus, it is reasonable to use it because if seccomp kills
436 // TestPTrace(), it would have killed StopTheWorld() anyway.
437 int pid = internal_fork();
438
439 if (pid < 0) {
440 int rverrno;
441 if (internal_iserror(pid, &rverrno))
442 VReport(0, "WARNING: TestPTrace() failed to fork (errno %d)\n", rverrno);
443
444 // We don't abort the sanitizer - it's still worth letting the sanitizer
445 // try.
446 return;
447 }
448
449 if (pid == 0) {
450 // Child subprocess
451
452 // TODO: consider checking return value of internal_ptrace, to handle
453 // SCMP_ACT_ERRNO. However, be careful not to consume too many
454 // resources performing a proper ptrace.
455 internal_ptrace(PTRACE_ATTACH, 0, nullptr, nullptr);
456 internal__exit(0);
457 } else {
458 int wstatus;
459 internal_waitpid(pid, &wstatus, 0);
460
461 // Handle SCMP_ACT_KILL
462 if (WIFSIGNALED(wstatus)) {
463 VReport(0,
464 "WARNING: ptrace appears to be blocked (is seccomp enabled?). "
465 "LeakSanitizer may hang.\n");
466 VReport(0, "Child exited with signal %d.\n", WTERMSIG(wstatus));
467 // We don't abort the sanitizer - it's still worth letting the sanitizer
468 // try.
469 }
470 }
471# endif
472}
473
406void StopTheWorld(StopTheWorldCallback callback, void *argument) {474void StopTheWorld(StopTheWorldCallback callback, void *argument) {
475 TestPTrace();
476
407 StopTheWorldScope in_stoptheworld;477 StopTheWorldScope in_stoptheworld;
408 // Prepare the arguments for TracerThread.478 // Prepare the arguments for TracerThread.
409 struct TracerThreadArgument tracer_thread_argument;479 struct TracerThreadArgument tracer_thread_argument;
...@@ -457,7 +527,8 @@ void StopTheWorld(StopTheWorldCallback callback, void *argument) {...@@ -457,7 +527,8 @@ void StopTheWorld(StopTheWorldCallback callback, void *argument) {
457 internal_prctl(PR_SET_PTRACER, tracer_pid, 0, 0, 0);527 internal_prctl(PR_SET_PTRACER, tracer_pid, 0, 0, 0);
458 // Allow the tracer thread to start.528 // Allow the tracer thread to start.
459 tracer_thread_argument.mutex.Unlock();529 tracer_thread_argument.mutex.Unlock();
460 // NOTE: errno is shared between this thread and the tracer thread.530 // NOTE: errno is shared between this thread and the tracer thread
531 // (clone was called without CLONE_SETTLS / newtls).
461 // internal_waitpid() may call syscall() which can access/spoil errno,532 // internal_waitpid() may call syscall() which can access/spoil errno,
462 // so we can't call it now. Instead we for the tracer thread to finish using533 // so we can't call it now. Instead we for the tracer thread to finish using
463 // the spin loop below. Man page for sched_yield() says "In the Linux534 // the spin loop below. Man page for sched_yield() says "In the Linux
...@@ -546,7 +617,7 @@ static constexpr uptr kExtraRegs[] = {0};...@@ -546,7 +617,7 @@ static constexpr uptr kExtraRegs[] = {0};
546#error "Unsupported architecture"617#error "Unsupported architecture"
547#endif // SANITIZER_ANDROID && defined(__arm__)618#endif // SANITIZER_ANDROID && defined(__arm__)
548619
549tid_t SuspendedThreadsListLinux::GetThreadID(uptr index) const {620ThreadID SuspendedThreadsListLinux::GetThreadID(uptr index) const {
550 CHECK_LT(index, thread_ids_.size());621 CHECK_LT(index, thread_ids_.size());
551 return thread_ids_[index];622 return thread_ids_[index];
552}623}
...@@ -555,14 +626,14 @@ uptr SuspendedThreadsListLinux::ThreadCount() const {...@@ -555,14 +626,14 @@ uptr SuspendedThreadsListLinux::ThreadCount() const {
555 return thread_ids_.size();626 return thread_ids_.size();
556}627}
557628
558bool SuspendedThreadsListLinux::ContainsTid(tid_t thread_id) const {629bool SuspendedThreadsListLinux::ContainsTid(ThreadID thread_id) const {
559 for (uptr i = 0; i < thread_ids_.size(); i++) {630 for (uptr i = 0; i < thread_ids_.size(); i++) {
560 if (thread_ids_[i] == thread_id) return true;631 if (thread_ids_[i] == thread_id) return true;
561 }632 }
562 return false;633 return false;
563}634}
564635
565void SuspendedThreadsListLinux::Append(tid_t tid) {636void SuspendedThreadsListLinux::Append(ThreadID tid) {
566 thread_ids_.push_back(tid);637 thread_ids_.push_back(tid);
567}638}
568639
lib/libtsan/sanitizer_common/sanitizer_stoptheworld_mac.cpp+3-3
...@@ -23,7 +23,7 @@...@@ -23,7 +23,7 @@
2323
24namespace __sanitizer {24namespace __sanitizer {
25typedef struct {25typedef struct {
26 tid_t tid;26 ThreadID tid;
27 thread_t thread;27 thread_t thread;
28} SuspendedThreadInfo;28} SuspendedThreadInfo;
2929
...@@ -31,7 +31,7 @@ class SuspendedThreadsListMac final : public SuspendedThreadsList {...@@ -31,7 +31,7 @@ class SuspendedThreadsListMac final : public SuspendedThreadsList {
31 public:31 public:
32 SuspendedThreadsListMac() = default;32 SuspendedThreadsListMac() = default;
3333
34 tid_t GetThreadID(uptr index) const override;34 ThreadID GetThreadID(uptr index) const override;
35 thread_t GetThread(uptr index) const;35 thread_t GetThread(uptr index) const;
36 uptr ThreadCount() const override;36 uptr ThreadCount() const override;
37 bool ContainsThread(thread_t thread) const;37 bool ContainsThread(thread_t thread) const;
...@@ -111,7 +111,7 @@ typedef x86_thread_state32_t regs_struct;...@@ -111,7 +111,7 @@ typedef x86_thread_state32_t regs_struct;
111#error "Unsupported architecture"111#error "Unsupported architecture"
112#endif112#endif
113113
114tid_t SuspendedThreadsListMac::GetThreadID(uptr index) const {114ThreadID SuspendedThreadsListMac::GetThreadID(uptr index) const {
115 CHECK_LT(index, threads_.size());115 CHECK_LT(index, threads_.size());
116 return threads_[index].tid;116 return threads_[index].tid;
117}117}
lib/libtsan/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp+7-7
...@@ -52,17 +52,17 @@ class SuspendedThreadsListNetBSD final : public SuspendedThreadsList {...@@ -52,17 +52,17 @@ class SuspendedThreadsListNetBSD final : public SuspendedThreadsList {
52 public:52 public:
53 SuspendedThreadsListNetBSD() { thread_ids_.reserve(1024); }53 SuspendedThreadsListNetBSD() { thread_ids_.reserve(1024); }
5454
55 tid_t GetThreadID(uptr index) const;55 ThreadID GetThreadID(uptr index) const;
56 uptr ThreadCount() const;56 uptr ThreadCount() const;
57 bool ContainsTid(tid_t thread_id) const;57 bool ContainsTid(ThreadID thread_id) const;
58 void Append(tid_t tid);58 void Append(ThreadID tid);
5959
60 PtraceRegistersStatus GetRegistersAndSP(uptr index,60 PtraceRegistersStatus GetRegistersAndSP(uptr index,
61 InternalMmapVector<uptr> *buffer,61 InternalMmapVector<uptr> *buffer,
62 uptr *sp) const;62 uptr *sp) const;
6363
64 private:64 private:
65 InternalMmapVector<tid_t> thread_ids_;65 InternalMmapVector<ThreadID> thread_ids_;
66};66};
6767
68struct TracerThreadArgument {68struct TracerThreadArgument {
...@@ -313,7 +313,7 @@ void StopTheWorld(StopTheWorldCallback callback, void *argument) {...@@ -313,7 +313,7 @@ void StopTheWorld(StopTheWorldCallback callback, void *argument) {
313 }313 }
314}314}
315315
316tid_t SuspendedThreadsListNetBSD::GetThreadID(uptr index) const {316ThreadID SuspendedThreadsListNetBSD::GetThreadID(uptr index) const {
317 CHECK_LT(index, thread_ids_.size());317 CHECK_LT(index, thread_ids_.size());
318 return thread_ids_[index];318 return thread_ids_[index];
319}319}
...@@ -322,7 +322,7 @@ uptr SuspendedThreadsListNetBSD::ThreadCount() const {...@@ -322,7 +322,7 @@ uptr SuspendedThreadsListNetBSD::ThreadCount() const {
322 return thread_ids_.size();322 return thread_ids_.size();
323}323}
324324
325bool SuspendedThreadsListNetBSD::ContainsTid(tid_t thread_id) const {325bool SuspendedThreadsListNetBSD::ContainsTid(ThreadID thread_id) const {
326 for (uptr i = 0; i < thread_ids_.size(); i++) {326 for (uptr i = 0; i < thread_ids_.size(); i++) {
327 if (thread_ids_[i] == thread_id)327 if (thread_ids_[i] == thread_id)
328 return true;328 return true;
...@@ -330,7 +330,7 @@ bool SuspendedThreadsListNetBSD::ContainsTid(tid_t thread_id) const {...@@ -330,7 +330,7 @@ bool SuspendedThreadsListNetBSD::ContainsTid(tid_t thread_id) const {
330 return false;330 return false;
331}331}
332332
333void SuspendedThreadsListNetBSD::Append(tid_t tid) {333void SuspendedThreadsListNetBSD::Append(ThreadID tid) {
334 thread_ids_.push_back(tid);334 thread_ids_.push_back(tid);
335}335}
336336
lib/libtsan/sanitizer_common/sanitizer_stoptheworld_win.cpp+2-2
...@@ -38,7 +38,7 @@ struct SuspendedThreadsListWindows final : public SuspendedThreadsList {...@@ -38,7 +38,7 @@ struct SuspendedThreadsListWindows final : public SuspendedThreadsList {
38 InternalMmapVector<uptr> *buffer,38 InternalMmapVector<uptr> *buffer,
39 uptr *sp) const override;39 uptr *sp) const override;
4040
41 tid_t GetThreadID(uptr index) const override;41 ThreadID GetThreadID(uptr index) const override;
42 uptr ThreadCount() const override;42 uptr ThreadCount() const override;
43};43};
4444
...@@ -68,7 +68,7 @@ PtraceRegistersStatus SuspendedThreadsListWindows::GetRegistersAndSP(...@@ -68,7 +68,7 @@ PtraceRegistersStatus SuspendedThreadsListWindows::GetRegistersAndSP(
68 return REGISTERS_AVAILABLE;68 return REGISTERS_AVAILABLE;
69}69}
7070
71tid_t SuspendedThreadsListWindows::GetThreadID(uptr index) const {71ThreadID SuspendedThreadsListWindows::GetThreadID(uptr index) const {
72 CHECK_LT(index, threadIds.size());72 CHECK_LT(index, threadIds.size());
73 return threadIds[index];73 return threadIds[index];
74}74}
lib/libtsan/sanitizer_common/sanitizer_symbolizer_internal.h+5-1
...@@ -83,7 +83,7 @@ class SymbolizerProcess {...@@ -83,7 +83,7 @@ class SymbolizerProcess {
83 const char *SendCommand(const char *command);83 const char *SendCommand(const char *command);
8484
85 protected:85 protected:
86 ~SymbolizerProcess() {}86 ~SymbolizerProcess();
8787
88 /// The maximum number of arguments required to invoke a tool process.88 /// The maximum number of arguments required to invoke a tool process.
89 static const unsigned kArgVMax = 16;89 static const unsigned kArgVMax = 16;
...@@ -114,6 +114,10 @@ class SymbolizerProcess {...@@ -114,6 +114,10 @@ class SymbolizerProcess {
114 fd_t input_fd_;114 fd_t input_fd_;
115 fd_t output_fd_;115 fd_t output_fd_;
116116
117 // We hold on to the child's stdin fd (the read end of the pipe)
118 // so that when we write to it, we don't get a SIGPIPE
119 fd_t child_stdin_fd_;
120
117 InternalMmapVector<char> buffer_;121 InternalMmapVector<char> buffer_;
118122
119 static const uptr kMaxTimesRestarted = 5;123 static const uptr kMaxTimesRestarted = 5;
lib/libtsan/sanitizer_common/sanitizer_symbolizer_libcdep.cpp+11-1
...@@ -476,10 +476,11 @@ const char *LLVMSymbolizer::FormatAndSendCommand(const char *command_prefix,...@@ -476,10 +476,11 @@ const char *LLVMSymbolizer::FormatAndSendCommand(const char *command_prefix,
476 return symbolizer_process_->SendCommand(buffer_);476 return symbolizer_process_->SendCommand(buffer_);
477}477}
478478
479SymbolizerProcess::SymbolizerProcess(const char *path, bool use_posix_spawn)479SymbolizerProcess::SymbolizerProcess(const char* path, bool use_posix_spawn)
480 : path_(path),480 : path_(path),
481 input_fd_(kInvalidFd),481 input_fd_(kInvalidFd),
482 output_fd_(kInvalidFd),482 output_fd_(kInvalidFd),
483 child_stdin_fd_(kInvalidFd),
483 times_restarted_(0),484 times_restarted_(0),
484 failed_to_start_(false),485 failed_to_start_(false),
485 reported_invalid_path_(false),486 reported_invalid_path_(false),
...@@ -488,6 +489,11 @@ SymbolizerProcess::SymbolizerProcess(const char *path, bool use_posix_spawn)...@@ -488,6 +489,11 @@ SymbolizerProcess::SymbolizerProcess(const char *path, bool use_posix_spawn)
488 CHECK_NE(path_[0], '\0');489 CHECK_NE(path_[0], '\0');
489}490}
490491
492SymbolizerProcess::~SymbolizerProcess() {
493 if (child_stdin_fd_ != kInvalidFd)
494 CloseFile(child_stdin_fd_);
495}
496
491static bool IsSameModule(const char *path) {497static bool IsSameModule(const char *path) {
492 if (const char *ProcessName = GetProcessName()) {498 if (const char *ProcessName = GetProcessName()) {
493 if (const char *SymbolizerName = StripModuleName(path)) {499 if (const char *SymbolizerName = StripModuleName(path)) {
...@@ -533,6 +539,10 @@ bool SymbolizerProcess::Restart() {...@@ -533,6 +539,10 @@ bool SymbolizerProcess::Restart() {
533 CloseFile(input_fd_);539 CloseFile(input_fd_);
534 if (output_fd_ != kInvalidFd)540 if (output_fd_ != kInvalidFd)
535 CloseFile(output_fd_);541 CloseFile(output_fd_);
542 if (child_stdin_fd_ != kInvalidFd) {
543 CloseFile(child_stdin_fd_);
544 child_stdin_fd_ = kInvalidFd; // Don't free in destructor
545 }
536 return StartSymbolizerSubprocess();546 return StartSymbolizerSubprocess();
537}547}
538548
lib/libtsan/sanitizer_common/sanitizer_symbolizer_mac.cpp+86-29
...@@ -78,13 +78,25 @@ class AtosSymbolizerProcess final : public SymbolizerProcess {...@@ -78,13 +78,25 @@ class AtosSymbolizerProcess final : public SymbolizerProcess {
78 }78 }
7979
80 bool ReachedEndOfOutput(const char *buffer, uptr length) const override {80 bool ReachedEndOfOutput(const char *buffer, uptr length) const override {
81 return (length >= 1 && buffer[length - 1] == '\n');81 if (common_flags()->symbolize_inline_frames) {
82 // When running with -i, atos sends two newlines at the end of each
83 // address it symbolizes. This indicates the end of the set of frames
84 // for a particular address.
85 return length >= 2 && buffer[length - 1] == '\n' &&
86 buffer[length - 2] == '\n';
87 } else {
88 // When running without -i, atos only sends a single newline at
89 // the end of each address it symbolizes.
90 return length >= 1 && buffer[length - 1] == '\n';
91 }
82 }92 }
8393
84 void GetArgV(const char *path_to_binary,94 void GetArgV(const char *path_to_binary,
85 const char *(&argv)[kArgVMax]) const override {95 const char *(&argv)[kArgVMax]) const override {
86 int i = 0;96 int i = 0;
87 argv[i++] = path_to_binary;97 argv[i++] = path_to_binary;
98 if (common_flags()->symbolize_inline_frames)
99 argv[i++] = "-i";
88 argv[i++] = "-p";100 argv[i++] = "-p";
89 argv[i++] = &pid_str_[0];101 argv[i++] = &pid_str_[0];
90 if (GetMacosAlignedVersion() == MacosVersion(10, 9)) {102 if (GetMacosAlignedVersion() == MacosVersion(10, 9)) {
...@@ -102,12 +114,16 @@ class AtosSymbolizerProcess final : public SymbolizerProcess {...@@ -102,12 +114,16 @@ class AtosSymbolizerProcess final : public SymbolizerProcess {
102114
103#undef K_ATOS_ENV_VAR115#undef K_ATOS_ENV_VAR
104116
105static bool ParseCommandOutput(const char *str, uptr addr, char **out_name,117// Parses a single frame (one line) from str, and returns the pointer to the
106 char **out_module, char **out_file, uptr *line,118// next character to parse (i.e. after the newline) if successful. If
107 uptr *start_address) {119// it fails, returns NULL.
120static const char* ParseCommandOutput(const char* str, uptr addr,
121 char** out_name, char** out_module,
122 char** out_file, uptr* line,
123 uptr* start_address) {
108 // Trim ending newlines.124 // Trim ending newlines.
109 char *trim;125 char *trim;
110 ExtractTokenUpToDelimiter(str, "\n", &trim);126 str = ExtractTokenUpToDelimiter(str, "\n", &trim);
111127
112 // The line from `atos` is in one of these formats:128 // The line from `atos` is in one of these formats:
113 // myfunction (in library.dylib) (sourcefile.c:17)129 // myfunction (in library.dylib) (sourcefile.c:17)
...@@ -124,7 +140,7 @@ static bool ParseCommandOutput(const char *str, uptr addr, char **out_name,...@@ -124,7 +140,7 @@ static bool ParseCommandOutput(const char *str, uptr addr, char **out_name,
124 if (rest[0] == '\0') {140 if (rest[0] == '\0') {
125 InternalFree(symbol_name);141 InternalFree(symbol_name);
126 InternalFree(trim);142 InternalFree(trim);
127 return false;143 return NULL;
128 }144 }
129145
130 if (internal_strncmp(symbol_name, "0x", 2) != 0)146 if (internal_strncmp(symbol_name, "0x", 2) != 0)
...@@ -149,7 +165,7 @@ static bool ParseCommandOutput(const char *str, uptr addr, char **out_name,...@@ -149,7 +165,7 @@ static bool ParseCommandOutput(const char *str, uptr addr, char **out_name,
149 }165 }
150166
151 InternalFree(trim);167 InternalFree(trim);
152 return true;168 return str;
153}169}
154170
155AtosSymbolizer::AtosSymbolizer(const char *path, LowLevelAllocator *allocator)171AtosSymbolizer::AtosSymbolizer(const char *path, LowLevelAllocator *allocator)
...@@ -161,31 +177,72 @@ bool AtosSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) {...@@ -161,31 +177,72 @@ bool AtosSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) {
161 char command[32];177 char command[32];
162 internal_snprintf(command, sizeof(command), "0x%zx\n", addr);178 internal_snprintf(command, sizeof(command), "0x%zx\n", addr);
163 const char *buf = process_->SendCommand(command);179 const char *buf = process_->SendCommand(command);
164 if (!buf) return false;180 if (!buf)
165 uptr line;
166 uptr start_address = AddressInfo::kUnknown;
167 if (!ParseCommandOutput(buf, addr, &stack->info.function, &stack->info.module,
168 &stack->info.file, &line, &start_address)) {
169 Report("WARNING: atos failed to symbolize address \"0x%zx\"\n", addr);
170 return false;181 return false;
171 }
172 stack->info.line = (int)line;
173
174 if (start_address == AddressInfo::kUnknown) {
175 // Fallback to dladdr() to get function start address if atos doesn't report
176 // it.
177 Dl_info info;
178 int result = dladdr((const void *)addr, &info);
179 if (result)
180 start_address = reinterpret_cast<uptr>(info.dli_saddr);
181 }
182182
183 // Only assign to `function_offset` if we were able to get the function's183 SymbolizedStack* last = stack;
184 // start address and we got a sensible `start_address` (dladdr doesn't always184 bool top_frame = true;
185 // ensure that `addr >= sym_addr`).185
186 if (start_address != AddressInfo::kUnknown && addr >= start_address) {186 // Parse one line of input (i.e. one frame).
187 stack->info.function_offset = addr - start_address;187 //
188 // When symbolize_inline_frames=true, an empty line
189 // (i.e. \n at the beginning of a line) indicates that the last
190 // frame has been sent.
191 //
192 // When symbolize_inline_frames=false, the symbolizer will send only
193 // one frame (without a empty line), so loop runs exactly once
194 // and hits an early `break`.
195 while (*buf != '\n') {
196 uptr line;
197 uptr start_address = AddressInfo::kUnknown;
198
199 SymbolizedStack* cur;
200 if (top_frame) {
201 cur = stack;
202 } else {
203 cur = SymbolizedStack::New(stack->info.address);
204 cur->info.FillModuleInfo(stack->info.module, stack->info.module_offset,
205 stack->info.module_arch);
206 last->next = cur;
207 last = cur;
208 }
209
210 // Parse one line of input (i.e. one frame)
211 // If this succeeds, buf will be updated to point to the first character
212 // after the newline.
213 buf = ParseCommandOutput(buf, addr, &cur->info.function, &cur->info.module,
214 &cur->info.file, &line, &start_address);
215
216 // Upon failure, ParseCommandOutput returns NULL.
217 if (!buf) {
218 Report("WARNING: atos failed to symbolize address \"0x%zx\"\n", addr);
219 return false;
220 }
221 cur->info.line = (int)line;
222
223 if (top_frame && start_address == AddressInfo::kUnknown) {
224 // Fallback to dladdr() to get function start address if atos doesn't
225 // report it.
226 Dl_info info;
227 int result = dladdr((const void*)addr, &info);
228 if (result)
229 start_address = reinterpret_cast<uptr>(info.dli_saddr);
230 }
231
232 // Only assign to `function_offset` if we were able to get the function's
233 // start address and we got a sensible `start_address` (dladdr doesn't
234 // always ensure that `addr >= sym_addr`).
235 if (start_address != AddressInfo::kUnknown && addr >= start_address) {
236 cur->info.function_offset = addr - start_address;
237 }
238
239 // atos only sends one line when inline frames are off
240 if (!common_flags()->symbolize_inline_frames)
241 break;
242
243 top_frame = false;
188 }244 }
245
189 return true;246 return true;
190}247}
191248
lib/libtsan/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp+27-16
...@@ -156,30 +156,34 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {...@@ -156,30 +156,34 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {
156 Printf("\n");156 Printf("\n");
157 }157 }
158158
159 fd_t infd[2] = {}, outfd[2] = {};
160 if (!CreateTwoHighNumberedPipes(infd, outfd)) {
161 Report(
162 "WARNING: Can't create a socket pair to start "
163 "external symbolizer (errno: %d)\n",
164 errno);
165 return false;
166 }
167
159 if (use_posix_spawn_) {168 if (use_posix_spawn_) {
160# if SANITIZER_APPLE169# if SANITIZER_APPLE
161 fd_t fd = internal_spawn(argv, const_cast<const char **>(GetEnvP()), &pid);170 bool success = internal_spawn(argv, const_cast<const char**>(GetEnvP()),
162 if (fd == kInvalidFd) {171 &pid, outfd[0], infd[1]);
172 if (!success) {
163 Report("WARNING: failed to spawn external symbolizer (errno: %d)\n",173 Report("WARNING: failed to spawn external symbolizer (errno: %d)\n",
164 errno);174 errno);
175 internal_close(infd[0]);
176 internal_close(outfd[1]);
165 return false;177 return false;
166 }178 }
167179
168 input_fd_ = fd;180 // We intentionally hold on to the read-end so that we don't get a SIGPIPE
169 output_fd_ = fd;181 child_stdin_fd_ = outfd[0];
182
170# else // SANITIZER_APPLE183# else // SANITIZER_APPLE
171 UNIMPLEMENTED();184 UNIMPLEMENTED();
172# endif // SANITIZER_APPLE185# endif // SANITIZER_APPLE
173 } else {186 } else {
174 fd_t infd[2] = {}, outfd[2] = {};
175 if (!CreateTwoHighNumberedPipes(infd, outfd)) {
176 Report(
177 "WARNING: Can't create a socket pair to start "
178 "external symbolizer (errno: %d)\n",
179 errno);
180 return false;
181 }
182
183 pid = StartSubprocess(path_, argv, GetEnvP(), /* stdin */ outfd[0],187 pid = StartSubprocess(path_, argv, GetEnvP(), /* stdin */ outfd[0],
184 /* stdout */ infd[1]);188 /* stdout */ infd[1]);
185 if (pid < 0) {189 if (pid < 0) {
...@@ -187,11 +191,11 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {...@@ -187,11 +191,11 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {
187 internal_close(outfd[1]);191 internal_close(outfd[1]);
188 return false;192 return false;
189 }193 }
190
191 input_fd_ = infd[0];
192 output_fd_ = outfd[1];
193 }194 }
194195
196 input_fd_ = infd[0];
197 output_fd_ = outfd[1];
198
195 CHECK_GT(pid, 0);199 CHECK_GT(pid, 0);
196200
197 // Check that symbolizer subprocess started successfully.201 // Check that symbolizer subprocess started successfully.
...@@ -505,6 +509,13 @@ static void ChooseSymbolizerTools(IntrusiveList<SymbolizerTool> *list,...@@ -505,6 +509,13 @@ static void ChooseSymbolizerTools(IntrusiveList<SymbolizerTool> *list,
505 }509 }
506510
507# if SANITIZER_APPLE511# 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 }
508 VReport(2, "Using dladdr symbolizer.\n");519 VReport(2, "Using dladdr symbolizer.\n");
509 list->push_back(new (*allocator) DlAddrSymbolizer());520 list->push_back(new (*allocator) DlAddrSymbolizer());
510# endif // SANITIZER_APPLE521# endif // SANITIZER_APPLE
lib/libtsan/sanitizer_common/sanitizer_thread_registry.cpp+5-4
...@@ -80,7 +80,7 @@ void ThreadContextBase::SetFinished() {...@@ -80,7 +80,7 @@ void ThreadContextBase::SetFinished() {
80 OnFinished();80 OnFinished();
81}81}
8282
83void ThreadContextBase::SetStarted(tid_t _os_id, ThreadType _thread_type,83void ThreadContextBase::SetStarted(ThreadID _os_id, ThreadType _thread_type,
84 void *arg) {84 void *arg) {
85 status = ThreadStatusRunning;85 status = ThreadStatusRunning;
86 os_id = _os_id;86 os_id = _os_id;
...@@ -228,7 +228,8 @@ static bool FindThreadContextByOsIdCallback(ThreadContextBase *tctx,...@@ -228,7 +228,8 @@ static bool FindThreadContextByOsIdCallback(ThreadContextBase *tctx,
228 tctx->status != ThreadStatusDead);228 tctx->status != ThreadStatusDead);
229}229}
230230
231ThreadContextBase *ThreadRegistry::FindThreadContextByOsIDLocked(tid_t os_id) {231ThreadContextBase *ThreadRegistry::FindThreadContextByOsIDLocked(
232 ThreadID os_id) {
232 return FindThreadContextLocked(FindThreadContextByOsIdCallback,233 return FindThreadContextLocked(FindThreadContextByOsIdCallback,
233 (void *)os_id);234 (void *)os_id);
234}235}
...@@ -322,8 +323,8 @@ ThreadStatus ThreadRegistry::FinishThread(u32 tid) {...@@ -322,8 +323,8 @@ ThreadStatus ThreadRegistry::FinishThread(u32 tid) {
322 return prev_status;323 return prev_status;
323}324}
324325
325void ThreadRegistry::StartThread(u32 tid, tid_t os_id, ThreadType thread_type,326void ThreadRegistry::StartThread(u32 tid, ThreadID os_id,
326 void *arg) {327 ThreadType thread_type, void *arg) {
327 ThreadRegistryLock l(this);328 ThreadRegistryLock l(this);
328 running_threads_++;329 running_threads_++;
329 ThreadContextBase *tctx = threads_[tid];330 ThreadContextBase *tctx = threads_[tid];
lib/libtsan/sanitizer_common/sanitizer_thread_registry.h+4-4
...@@ -43,7 +43,7 @@ class ThreadContextBase {...@@ -43,7 +43,7 @@ class ThreadContextBase {
43 const u32 tid; // Thread ID. Main thread should have tid = 0.43 const u32 tid; // Thread ID. Main thread should have tid = 0.
44 u64 unique_id; // Unique thread ID.44 u64 unique_id; // Unique thread ID.
45 u32 reuse_count; // Number of times this tid was reused.45 u32 reuse_count; // Number of times this tid was reused.
46 tid_t os_id; // PID (used for reporting).46 ThreadID os_id; // PID (used for reporting).
47 uptr user_id; // Some opaque user thread id (e.g. pthread_t).47 uptr user_id; // Some opaque user thread id (e.g. pthread_t).
48 char name[64]; // As annotated by user.48 char name[64]; // As annotated by user.
4949
...@@ -62,7 +62,7 @@ class ThreadContextBase {...@@ -62,7 +62,7 @@ class ThreadContextBase {
62 void SetDead();62 void SetDead();
63 void SetJoined(void *arg);63 void SetJoined(void *arg);
64 void SetFinished();64 void SetFinished();
65 void SetStarted(tid_t _os_id, ThreadType _thread_type, void *arg);65 void SetStarted(ThreadID _os_id, ThreadType _thread_type, void *arg);
66 void SetCreated(uptr _user_id, u64 _unique_id, bool _detached,66 void SetCreated(uptr _user_id, u64 _unique_id, bool _detached,
67 u32 _parent_tid, u32 _stack_tid, void *arg);67 u32 _parent_tid, u32 _stack_tid, void *arg);
68 void Reset();68 void Reset();
...@@ -126,7 +126,7 @@ class SANITIZER_MUTEX ThreadRegistry {...@@ -126,7 +126,7 @@ class SANITIZER_MUTEX ThreadRegistry {
126 // is found.126 // is found.
127 ThreadContextBase *FindThreadContextLocked(FindThreadCallback cb,127 ThreadContextBase *FindThreadContextLocked(FindThreadCallback cb,
128 void *arg);128 void *arg);
129 ThreadContextBase *FindThreadContextByOsIDLocked(tid_t os_id);129 ThreadContextBase *FindThreadContextByOsIDLocked(ThreadID os_id);
130130
131 void SetThreadName(u32 tid, const char *name);131 void SetThreadName(u32 tid, const char *name);
132 void SetThreadNameByUserId(uptr user_id, const char *name);132 void SetThreadNameByUserId(uptr user_id, const char *name);
...@@ -134,7 +134,7 @@ class SANITIZER_MUTEX ThreadRegistry {...@@ -134,7 +134,7 @@ class SANITIZER_MUTEX ThreadRegistry {
134 void JoinThread(u32 tid, void *arg);134 void JoinThread(u32 tid, void *arg);
135 // Finishes thread and returns previous status.135 // Finishes thread and returns previous status.
136 ThreadStatus FinishThread(u32 tid);136 ThreadStatus FinishThread(u32 tid);
137 void StartThread(u32 tid, tid_t os_id, ThreadType thread_type, void *arg);137 void StartThread(u32 tid, ThreadID os_id, ThreadType thread_type, void *arg);
138 u32 ConsumeThreadUserId(uptr user_id);138 u32 ConsumeThreadUserId(uptr user_id);
139 void SetThreadUserId(u32 tid, uptr user_id);139 void SetThreadUserId(u32 tid, uptr user_id);
140140
lib/libtsan/sanitizer_common/sanitizer_win.cpp+1-3
...@@ -108,9 +108,7 @@ int internal_dlinfo(void *handle, int request, void *p) {...@@ -108,9 +108,7 @@ int internal_dlinfo(void *handle, int request, void *p) {
108108
109// In contrast to POSIX, on Windows GetCurrentThreadId()109// In contrast to POSIX, on Windows GetCurrentThreadId()
110// returns a system-unique identifier.110// returns a system-unique identifier.
111tid_t GetTid() {111ThreadID GetTid() { return GetCurrentThreadId(); }
112 return GetCurrentThreadId();
113}
114112
115uptr GetThreadSelf() {113uptr GetThreadSelf() {
116 return GetTid();114 return GetTid();
lib/libtsan/tsan_debugging.cpp+2-2
...@@ -165,7 +165,7 @@ int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,...@@ -165,7 +165,7 @@ int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,
165}165}
166166
167SANITIZER_INTERFACE_ATTRIBUTE167SANITIZER_INTERFACE_ATTRIBUTE
168int __tsan_get_report_thread(void *report, uptr idx, int *tid, tid_t *os_id,168int __tsan_get_report_thread(void *report, uptr idx, int *tid, ThreadID *os_id,
169 int *running, const char **name, int *parent_tid,169 int *running, const char **name, int *parent_tid,
170 void **trace, uptr trace_size) {170 void **trace, uptr trace_size) {
171 const ReportDesc *rep = (ReportDesc *)report;171 const ReportDesc *rep = (ReportDesc *)report;
...@@ -242,7 +242,7 @@ const char *__tsan_locate_address(uptr addr, char *name, uptr name_size,...@@ -242,7 +242,7 @@ const char *__tsan_locate_address(uptr addr, char *name, uptr name_size,
242242
243SANITIZER_INTERFACE_ATTRIBUTE243SANITIZER_INTERFACE_ATTRIBUTE
244int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id,244int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id,
245 tid_t *os_id) {245 ThreadID *os_id) {
246 MBlock *b = 0;246 MBlock *b = 0;
247 Allocator *a = allocator();247 Allocator *a = allocator();
248 if (a->PointerIsMine((void *)addr)) {248 if (a->PointerIsMine((void *)addr)) {
lib/libtsan/tsan_flags.cpp+37
...@@ -20,6 +20,43 @@...@@ -20,6 +20,43 @@
20#include "tsan_rtl.h"20#include "tsan_rtl.h"
21#include "ubsan/ubsan_flags.h"21#include "ubsan/ubsan_flags.h"
2222
23#if SANITIZER_APPLE && !SANITIZER_GO
24namespace __sanitizer {
25
26template <>
27inline bool FlagHandler<LockDuringWriteSetting>::Parse(const char *value) {
28 if (internal_strcmp(value, "on") == 0) {
29 *t_ = kLockDuringAllWrites;
30 return true;
31 }
32 if (internal_strcmp(value, "disable_for_current_process") == 0) {
33 *t_ = kNoLockDuringWritesCurrentProcess;
34 return true;
35 }
36 if (internal_strcmp(value, "disable_for_all_processes") == 0) {
37 *t_ = kNoLockDuringWritesAllProcesses;
38 return true;
39 }
40 Printf("ERROR: Invalid value for signal handler option: '%s'\n", value);
41 return false;
42}
43
44template <>
45inline bool FlagHandler<LockDuringWriteSetting>::Format(char *buffer,
46 uptr size) {
47 switch (*t_) {
48 case kLockDuringAllWrites:
49 return FormatString(buffer, size, "on");
50 case kNoLockDuringWritesCurrentProcess:
51 return FormatString(buffer, size, "disable_for_current_process");
52 case kNoLockDuringWritesAllProcesses:
53 return FormatString(buffer, size, "disable_for_all_processes");
54 }
55}
56
57} // namespace __sanitizer
58#endif // SANITIZER_APPLE && !SANITIZER_GO
59
23namespace __tsan {60namespace __tsan {
2461
25// Can be overriden in frontend.62// Can be overriden in frontend.
lib/libtsan/tsan_flags.h+8
...@@ -16,6 +16,14 @@...@@ -16,6 +16,14 @@
16#include "sanitizer_common/sanitizer_flags.h"16#include "sanitizer_common/sanitizer_flags.h"
17#include "sanitizer_common/sanitizer_deadlock_detector_interface.h"17#include "sanitizer_common/sanitizer_deadlock_detector_interface.h"
1818
19#if SANITIZER_APPLE && !SANITIZER_GO
20enum LockDuringWriteSetting {
21 kLockDuringAllWrites,
22 kNoLockDuringWritesCurrentProcess,
23 kNoLockDuringWritesAllProcesses,
24};
25#endif
26
19namespace __tsan {27namespace __tsan {
2028
21struct Flags : DDFlags {29struct Flags : DDFlags {
lib/libtsan/tsan_flags.inc+12
...@@ -80,3 +80,15 @@ TSAN_FLAG(bool, shared_ptr_interceptor, true,...@@ -80,3 +80,15 @@ TSAN_FLAG(bool, shared_ptr_interceptor, true,
80TSAN_FLAG(bool, print_full_thread_history, false,80TSAN_FLAG(bool, print_full_thread_history, false,
81 "If set, prints thread creation stacks for the threads involved in "81 "If set, prints thread creation stacks for the threads involved in "
82 "the report and their ancestors up to the main thread.")82 "the report and their ancestors up to the main thread.")
83
84#if SANITIZER_APPLE && !SANITIZER_GO
85TSAN_FLAG(LockDuringWriteSetting, lock_during_write, kLockDuringAllWrites,
86 "Determines whether to obtain a lock while writing logs or error "
87 "reports. "
88 "\"on\" - [default] lock during all writes. "
89 "\"disable_for_current_process\" - don't lock during all writes in "
90 "the current process, but do lock for all writes in child "
91 "processes."
92 "\"disable_for_all_processes\" - don't lock during all writes in "
93 "the current process and it's children processes.")
94#endif
lib/libtsan/tsan_interceptors.h+9-1
...@@ -1,6 +1,9 @@...@@ -1,6 +1,9 @@
1#ifndef TSAN_INTERCEPTORS_H1#ifndef TSAN_INTERCEPTORS_H
2#define TSAN_INTERCEPTORS_H2#define TSAN_INTERCEPTORS_H
33
4#if SANITIZER_APPLE && !SANITIZER_GO
5# include "sanitizer_common/sanitizer_mac.h"
6#endif
4#include "sanitizer_common/sanitizer_stacktrace.h"7#include "sanitizer_common/sanitizer_stacktrace.h"
5#include "tsan_rtl.h"8#include "tsan_rtl.h"
69
...@@ -43,7 +46,12 @@ inline bool in_symbolizer() {...@@ -43,7 +46,12 @@ inline bool in_symbolizer() {
43#endif46#endif
4447
45inline bool MustIgnoreInterceptor(ThreadState *thr) {48inline bool MustIgnoreInterceptor(ThreadState *thr) {
46 return !thr->is_inited || thr->ignore_interceptors || thr->in_ignored_lib;49 return !thr->is_inited || thr->ignore_interceptors || thr->in_ignored_lib
50#if SANITIZER_APPLE && !SANITIZER_GO
51 || (flags()->lock_during_write != kLockDuringAllWrites &&
52 thr->in_internal_write_call)
53#endif
54 ;
47}55}
4856
49} // namespace __tsan57} // namespace __tsan
lib/libtsan/tsan_interceptors_mac.cpp+19
...@@ -281,6 +281,25 @@ TSAN_INTERCEPTOR(void, os_unfair_lock_lock, os_unfair_lock_t lock) {...@@ -281,6 +281,25 @@ TSAN_INTERCEPTOR(void, os_unfair_lock_lock, os_unfair_lock_t lock) {
281 Acquire(thr, pc, (uptr)lock);281 Acquire(thr, pc, (uptr)lock);
282}282}
283283
284// os_unfair_lock_lock_with_flags was introduced in macOS 15
285# if defined(__MAC_15_0) || defined(__IPHONE_18_0) || defined(__TVOS_18_0) || \
286 defined(__VISIONOS_2_0) || defined(__WATCHOS_11_0)
287# pragma clang diagnostic push
288# pragma clang diagnostic ignored "-Wunguarded-availability-new"
289// We're just intercepting this - if it doesn't exist on the platform, then the
290// process shouldn't have called it in the first place.
291TSAN_INTERCEPTOR(void, os_unfair_lock_lock_with_flags, os_unfair_lock_t lock,
292 os_unfair_lock_flags_t flags) {
293 if (!cur_thread()->is_inited || cur_thread()->is_dead) {
294 return REAL(os_unfair_lock_lock_with_flags)(lock, flags);
295 }
296 SCOPED_TSAN_INTERCEPTOR(os_unfair_lock_lock_with_flags, lock, flags);
297 REAL(os_unfair_lock_lock_with_flags)(lock, flags);
298 Acquire(thr, pc, (uptr)lock);
299}
300# pragma clang diagnostic pop
301# endif
302
284TSAN_INTERCEPTOR(void, os_unfair_lock_lock_with_options, os_unfair_lock_t lock,303TSAN_INTERCEPTOR(void, os_unfair_lock_lock_with_options, os_unfair_lock_t lock,
285 u32 options) {304 u32 options) {
286 if (!cur_thread()->is_inited || cur_thread()->is_dead) {305 if (!cur_thread()->is_inited || cur_thread()->is_dead) {
lib/libtsan/tsan_interceptors_posix.cpp+78-32
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22#include "sanitizer_common/sanitizer_internal_defs.h"22#include "sanitizer_common/sanitizer_internal_defs.h"
23#include "sanitizer_common/sanitizer_libc.h"23#include "sanitizer_common/sanitizer_libc.h"
24#include "sanitizer_common/sanitizer_linux.h"24#include "sanitizer_common/sanitizer_linux.h"
25#include "sanitizer_common/sanitizer_placement_new.h"
25#include "sanitizer_common/sanitizer_platform_interceptors.h"26#include "sanitizer_common/sanitizer_platform_interceptors.h"
26#include "sanitizer_common/sanitizer_platform_limits_netbsd.h"27#include "sanitizer_common/sanitizer_platform_limits_netbsd.h"
27#include "sanitizer_common/sanitizer_platform_limits_posix.h"28#include "sanitizer_common/sanitizer_platform_limits_posix.h"
...@@ -30,6 +31,9 @@...@@ -30,6 +31,9 @@
30#include "sanitizer_common/sanitizer_tls_get_addr.h"31#include "sanitizer_common/sanitizer_tls_get_addr.h"
31#include "sanitizer_common/sanitizer_vector.h"32#include "sanitizer_common/sanitizer_vector.h"
32#include "tsan_fd.h"33#include "tsan_fd.h"
34#if SANITIZER_APPLE && !SANITIZER_GO
35# include "tsan_flags.h"
36#endif
33#include "tsan_interceptors.h"37#include "tsan_interceptors.h"
34#include "tsan_interface.h"38#include "tsan_interface.h"
35#include "tsan_mman.h"39#include "tsan_mman.h"
...@@ -78,17 +82,6 @@ struct ucontext_t {...@@ -78,17 +82,6 @@ struct ucontext_t {
78};82};
79#endif83#endif
8084
81#if defined(__x86_64__) || defined(__mips__) || SANITIZER_PPC64V1 || \
82 defined(__s390x__)
83#define PTHREAD_ABI_BASE "GLIBC_2.3.2"
84#elif defined(__aarch64__) || SANITIZER_PPC64V2
85#define PTHREAD_ABI_BASE "GLIBC_2.17"
86#elif SANITIZER_LOONGARCH64
87#define PTHREAD_ABI_BASE "GLIBC_2.36"
88#elif SANITIZER_RISCV64
89# define PTHREAD_ABI_BASE "GLIBC_2.27"
90#endif
91
92extern "C" int pthread_attr_init(void *attr);85extern "C" int pthread_attr_init(void *attr);
93extern "C" int pthread_attr_destroy(void *attr);86extern "C" int pthread_attr_destroy(void *attr);
94DECLARE_REAL(int, pthread_attr_getdetachstate, void *, void *)87DECLARE_REAL(int, pthread_attr_getdetachstate, void *, void *)
...@@ -340,11 +333,6 @@ void ScopedInterceptor::DisableIgnoresImpl() {...@@ -340,11 +333,6 @@ void ScopedInterceptor::DisableIgnoresImpl() {
340}333}
341334
342#define TSAN_INTERCEPT(func) INTERCEPT_FUNCTION(func)335#define TSAN_INTERCEPT(func) INTERCEPT_FUNCTION(func)
343#if SANITIZER_FREEBSD || SANITIZER_NETBSD
344# define TSAN_INTERCEPT_VER(func, ver) INTERCEPT_FUNCTION(func)
345#else
346# define TSAN_INTERCEPT_VER(func, ver) INTERCEPT_FUNCTION_VER(func, ver)
347#endif
348#if SANITIZER_FREEBSD336#if SANITIZER_FREEBSD
349# define TSAN_MAYBE_INTERCEPT_FREEBSD_ALIAS(func) \337# define TSAN_MAYBE_INTERCEPT_FREEBSD_ALIAS(func) \
350 INTERCEPT_FUNCTION(_pthread_##func)338 INTERCEPT_FUNCTION(_pthread_##func)
...@@ -1145,6 +1133,22 @@ TSAN_INTERCEPTOR(int, pthread_create,...@@ -1145,6 +1133,22 @@ TSAN_INTERCEPTOR(int, pthread_create,
11451133
1146TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) {1134TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) {
1147 SCOPED_INTERCEPTOR_RAW(pthread_join, th, ret);1135 SCOPED_INTERCEPTOR_RAW(pthread_join, th, ret);
1136#if SANITIZER_ANDROID
1137 {
1138 // In Bionic, if the target thread has already exited when pthread_detach is
1139 // called, pthread_detach will call pthread_join internally to clean it up.
1140 // In that case, the thread has already been consumed by the pthread_detach
1141 // interceptor.
1142 Tid tid = ctx->thread_registry.FindThread(
1143 [](ThreadContextBase* tctx, void* arg) {
1144 return tctx->user_id == (uptr)arg;
1145 },
1146 th);
1147 if (tid == kInvalidTid) {
1148 return REAL(pthread_join)(th, ret);
1149 }
1150 }
1151#endif
1148 Tid tid = ThreadConsumeTid(thr, pc, (uptr)th);1152 Tid tid = ThreadConsumeTid(thr, pc, (uptr)th);
1149 ThreadIgnoreBegin(thr, pc);1153 ThreadIgnoreBegin(thr, pc);
1150 int res = BLOCK_REAL(pthread_join)(th, ret);1154 int res = BLOCK_REAL(pthread_join)(th, ret);
...@@ -1664,6 +1668,14 @@ TSAN_INTERCEPTOR(int, pthread_barrier_wait, void *b) {...@@ -1664,6 +1668,14 @@ TSAN_INTERCEPTOR(int, pthread_barrier_wait, void *b) {
16641668
1665TSAN_INTERCEPTOR(int, pthread_once, void *o, void (*f)()) {1669TSAN_INTERCEPTOR(int, pthread_once, void *o, void (*f)()) {
1666 SCOPED_INTERCEPTOR_RAW(pthread_once, o, f);1670 SCOPED_INTERCEPTOR_RAW(pthread_once, o, f);
1671#if SANITIZER_APPLE && !SANITIZER_GO
1672 if (flags()->lock_during_write != kLockDuringAllWrites &&
1673 cur_thread_init()->in_internal_write_call) {
1674 // This is needed to make it through process launch without hanging
1675 f();
1676 return 0;
1677 }
1678#endif
1667 if (o == 0 || f == 0)1679 if (o == 0 || f == 0)
1668 return errno_EINVAL;1680 return errno_EINVAL;
1669 atomic_uint32_t *a;1681 atomic_uint32_t *a;
...@@ -2141,13 +2153,29 @@ static void ReportErrnoSpoiling(ThreadState *thr, uptr pc, int sig) {...@@ -2141,13 +2153,29 @@ static void ReportErrnoSpoiling(ThreadState *thr, uptr pc, int sig) {
2141 // StackTrace::GetNestInstructionPc(pc) is used because return address is2153 // StackTrace::GetNestInstructionPc(pc) is used because return address is
2142 // expected, OutputReport() will undo this.2154 // expected, OutputReport() will undo this.
2143 ObtainCurrentStack(thr, StackTrace::GetNextInstructionPc(pc), &stack);2155 ObtainCurrentStack(thr, StackTrace::GetNextInstructionPc(pc), &stack);
2144 ThreadRegistryLock l(&ctx->thread_registry);2156 // Use alloca, because malloc during signal handling deadlocks
2145 ScopedReport rep(ReportTypeErrnoInSignal);2157 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
2146 rep.SetSigNum(sig);2158 bool suppressed;
2147 if (!IsFiredSuppression(ctx, ReportTypeErrnoInSignal, stack)) {2159 // Take a new scope as Apple platforms require the below locks released
2148 rep.AddStack(stack, true);2160 // before symbolizing in order to avoid a deadlock
2149 OutputReport(thr, rep);2161 {
2162 ThreadRegistryLock l(&ctx->thread_registry);
2163 new (rep) ScopedReport(ReportTypeErrnoInSignal);
2164 rep->SetSigNum(sig);
2165 suppressed = IsFiredSuppression(ctx, ReportTypeErrnoInSignal, stack);
2166 if (!suppressed)
2167 rep->AddStack(stack, true);
2168#if SANITIZER_APPLE
2169 } // Close this scope to release the locks before writing report
2170#endif
2171 if (!suppressed)
2172 OutputReport(thr, *rep);
2173
2174 // Need to manually destroy this because we used placement new to allocate
2175 rep->~ScopedReport();
2176#if !SANITIZER_APPLE
2150 }2177 }
2178#endif
2151}2179}
21522180
2153static void CallUserSignalHandler(ThreadState *thr, bool sync, bool acquire,2181static void CallUserSignalHandler(ThreadState *thr, bool sync, bool acquire,
...@@ -2411,7 +2439,11 @@ TSAN_INTERCEPTOR(int, vfork, int fake) {...@@ -2411,7 +2439,11 @@ TSAN_INTERCEPTOR(int, vfork, int fake) {
2411}2439}
2412#endif2440#endif
24132441
2414#if SANITIZER_LINUX2442#if SANITIZER_LINUX && !SANITIZER_ANDROID
2443// Bionic's pthread_create internally calls clone. When the CLONE_THREAD flag is
2444// set, clone does not create a new process but a new thread. This is a
2445// workaround for Android. Disabling the interception of clone solves the
2446// problem in most scenarios.
2415TSAN_INTERCEPTOR(int, clone, int (*fn)(void *), void *stack, int flags,2447TSAN_INTERCEPTOR(int, clone, int (*fn)(void *), void *stack, int flags,
2416 void *arg, int *parent_tid, void *tls, pid_t *child_tid) {2448 void *arg, int *parent_tid, void *tls, pid_t *child_tid) {
2417 SCOPED_INTERCEPTOR_RAW(clone, fn, stack, flags, arg, parent_tid, tls,2449 SCOPED_INTERCEPTOR_RAW(clone, fn, stack, flags, arg, parent_tid, tls,
...@@ -2888,12 +2920,12 @@ TSAN_INTERCEPTOR(void, _lwp_exit) {...@@ -2888,12 +2920,12 @@ TSAN_INTERCEPTOR(void, _lwp_exit) {
2888#endif2920#endif
28892921
2890#if SANITIZER_FREEBSD2922#if SANITIZER_FREEBSD
2891TSAN_INTERCEPTOR(void, thr_exit, tid_t *state) {2923TSAN_INTERCEPTOR(void, thr_exit, ThreadID *state) {
2892 SCOPED_TSAN_INTERCEPTOR(thr_exit, state);2924 SCOPED_TSAN_INTERCEPTOR(thr_exit, state);
2893 DestroyThreadState();2925 DestroyThreadState();
2894 REAL(thr_exit(state));2926 REAL(thr_exit(state));
2895}2927}
2896#define TSAN_MAYBE_INTERCEPT_THR_EXIT TSAN_INTERCEPT(thr_exit)2928# define TSAN_MAYBE_INTERCEPT_THR_EXIT TSAN_INTERCEPT(thr_exit)
2897#else2929#else
2898#define TSAN_MAYBE_INTERCEPT_THR_EXIT2930#define TSAN_MAYBE_INTERCEPT_THR_EXIT
2899#endif2931#endif
...@@ -3024,12 +3056,26 @@ void InitializeInterceptors() {...@@ -3024,12 +3056,26 @@ void InitializeInterceptors() {
3024 TSAN_INTERCEPT(pthread_timedjoin_np);3056 TSAN_INTERCEPT(pthread_timedjoin_np);
3025 #endif3057 #endif
30263058
3027 TSAN_INTERCEPT_VER(pthread_cond_init, PTHREAD_ABI_BASE);3059 // In glibc versions older than 2.36, dlsym(RTLD_NEXT, "pthread_cond_init")
3028 TSAN_INTERCEPT_VER(pthread_cond_signal, PTHREAD_ABI_BASE);3060 // may return an outdated symbol (max(2.2,base_version)) if the port was
3029 TSAN_INTERCEPT_VER(pthread_cond_broadcast, PTHREAD_ABI_BASE);3061 // introduced before 2.3.2 (when the new pthread_cond_t was introduced).
3030 TSAN_INTERCEPT_VER(pthread_cond_wait, PTHREAD_ABI_BASE);3062#if SANITIZER_GLIBC && !__GLIBC_PREREQ(2, 36) && \
3031 TSAN_INTERCEPT_VER(pthread_cond_timedwait, PTHREAD_ABI_BASE);3063 (defined(__x86_64__) || defined(__mips__) || SANITIZER_PPC64V1 || \
3032 TSAN_INTERCEPT_VER(pthread_cond_destroy, PTHREAD_ABI_BASE);3064 defined(__s390x__))
3065 INTERCEPT_FUNCTION_VER(pthread_cond_init, "GLIBC_2.3.2");
3066 INTERCEPT_FUNCTION_VER(pthread_cond_signal, "GLIBC_2.3.2");
3067 INTERCEPT_FUNCTION_VER(pthread_cond_broadcast, "GLIBC_2.3.2");
3068 INTERCEPT_FUNCTION_VER(pthread_cond_wait, "GLIBC_2.3.2");
3069 INTERCEPT_FUNCTION_VER(pthread_cond_timedwait, "GLIBC_2.3.2");
3070 INTERCEPT_FUNCTION_VER(pthread_cond_destroy, "GLIBC_2.3.2");
3071#else
3072 INTERCEPT_FUNCTION(pthread_cond_init);
3073 INTERCEPT_FUNCTION(pthread_cond_signal);
3074 INTERCEPT_FUNCTION(pthread_cond_broadcast);
3075 INTERCEPT_FUNCTION(pthread_cond_wait);
3076 INTERCEPT_FUNCTION(pthread_cond_timedwait);
3077 INTERCEPT_FUNCTION(pthread_cond_destroy);
3078#endif
30333079
3034 TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT;3080 TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT;
30353081
...@@ -3120,7 +3166,7 @@ void InitializeInterceptors() {...@@ -3120,7 +3166,7 @@ void InitializeInterceptors() {
31203166
3121 TSAN_INTERCEPT(fork);3167 TSAN_INTERCEPT(fork);
3122 TSAN_INTERCEPT(vfork);3168 TSAN_INTERCEPT(vfork);
3123#if SANITIZER_LINUX3169#if SANITIZER_LINUX && !SANITIZER_ANDROID
3124 TSAN_INTERCEPT(clone);3170 TSAN_INTERCEPT(clone);
3125#endif3171#endif
3126#if !SANITIZER_ANDROID3172#if !SANITIZER_ANDROID
lib/libtsan/tsan_interface.h+3-3
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
16#define TSAN_INTERFACE_H16#define TSAN_INTERFACE_H
1717
18#include <sanitizer_common/sanitizer_internal_defs.h>18#include <sanitizer_common/sanitizer_internal_defs.h>
19using __sanitizer::tid_t;19using __sanitizer::ThreadID;
20using __sanitizer::uptr;20using __sanitizer::uptr;
2121
22// This header should NOT include any other headers.22// This header should NOT include any other headers.
...@@ -175,7 +175,7 @@ int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,...@@ -175,7 +175,7 @@ int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,
175175
176// Returns information about threads included in the report.176// Returns information about threads included in the report.
177SANITIZER_INTERFACE_ATTRIBUTE177SANITIZER_INTERFACE_ATTRIBUTE
178int __tsan_get_report_thread(void *report, uptr idx, int *tid, tid_t *os_id,178int __tsan_get_report_thread(void *report, uptr idx, int *tid, ThreadID *os_id,
179 int *running, const char **name, int *parent_tid,179 int *running, const char **name, int *parent_tid,
180 void **trace, uptr trace_size);180 void **trace, uptr trace_size);
181181
...@@ -192,7 +192,7 @@ const char *__tsan_locate_address(uptr addr, char *name, uptr name_size,...@@ -192,7 +192,7 @@ const char *__tsan_locate_address(uptr addr, char *name, uptr name_size,
192// Returns the allocation stack for a heap pointer.192// Returns the allocation stack for a heap pointer.
193SANITIZER_INTERFACE_ATTRIBUTE193SANITIZER_INTERFACE_ATTRIBUTE
194int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id,194int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id,
195 tid_t *os_id);195 ThreadID *os_id);
196196
197#endif // SANITIZER_GO197#endif // SANITIZER_GO
198198
lib/libtsan/tsan_interface_ann.cpp+23-9
...@@ -437,16 +437,30 @@ void __tsan_mutex_post_divert(void *addr, unsigned flagz) {...@@ -437,16 +437,30 @@ void __tsan_mutex_post_divert(void *addr, unsigned flagz) {
437}437}
438438
439static void ReportMutexHeldWrongContext(ThreadState *thr, uptr pc) {439static void ReportMutexHeldWrongContext(ThreadState *thr, uptr pc) {
440 ThreadRegistryLock l(&ctx->thread_registry);440 // Use alloca, because malloc during signal handling deadlocks
441 ScopedReport rep(ReportTypeMutexHeldWrongContext);441 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
442 for (uptr i = 0; i < thr->mset.Size(); ++i) {442 // Take a new scope as Apple platforms require the below locks released
443 MutexSet::Desc desc = thr->mset.Get(i);443 // before symbolizing in order to avoid a deadlock
444 rep.AddMutex(desc.addr, desc.stack_id);444 {
445 ThreadRegistryLock l(&ctx->thread_registry);
446 new (rep) ScopedReport(ReportTypeMutexHeldWrongContext);
447 for (uptr i = 0; i < thr->mset.Size(); ++i) {
448 MutexSet::Desc desc = thr->mset.Get(i);
449 rep->AddMutex(desc.addr, desc.stack_id);
450 }
451 VarSizeStackTrace trace;
452 ObtainCurrentStack(thr, pc, &trace);
453 rep->AddStack(trace, true);
454#if SANITIZER_APPLE
455 } // Close this scope to release the locks
456#endif
457 OutputReport(thr, *rep);
458
459 // Need to manually destroy this because we used placement new to allocate
460 rep->~ScopedReport();
461#if !SANITIZER_APPLE
445 }462 }
446 VarSizeStackTrace trace;463#endif
447 ObtainCurrentStack(thr, pc, &trace);
448 rep.AddStack(trace, true);
449 OutputReport(thr, rep);
450}464}
451465
452INTERFACE_ATTRIBUTE466INTERFACE_ATTRIBUTE
lib/libtsan/tsan_mman.cpp+18-4
...@@ -182,10 +182,24 @@ static void SignalUnsafeCall(ThreadState *thr, uptr pc) {...@@ -182,10 +182,24 @@ static void SignalUnsafeCall(ThreadState *thr, uptr pc) {
182 ObtainCurrentStack(thr, pc, &stack);182 ObtainCurrentStack(thr, pc, &stack);
183 if (IsFiredSuppression(ctx, ReportTypeSignalUnsafe, stack))183 if (IsFiredSuppression(ctx, ReportTypeSignalUnsafe, stack))
184 return;184 return;
185 ThreadRegistryLock l(&ctx->thread_registry);185 // Use alloca, because malloc during signal handling deadlocks
186 ScopedReport rep(ReportTypeSignalUnsafe);186 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
187 rep.AddStack(stack, true);187 // Take a new scope as Apple platforms require the below locks released
188 OutputReport(thr, rep);188 // before symbolizing in order to avoid a deadlock
189 {
190 ThreadRegistryLock l(&ctx->thread_registry);
191 new (rep) ScopedReport(ReportTypeSignalUnsafe);
192 rep->AddStack(stack, true);
193#if SANITIZER_APPLE
194 } // Close this scope to release the locks
195#endif
196 OutputReport(thr, *rep);
197
198 // Need to manually destroy this because we used placement new to allocate
199 rep->~ScopedReport();
200#if !SANITIZER_APPLE
201 }
202#endif
189}203}
190204
191205
lib/libtsan/tsan_platform.h+44-7
...@@ -681,6 +681,32 @@ struct MappingGoMips64_47 {...@@ -681,6 +681,32 @@ struct MappingGoMips64_47 {
681 static const uptr kShadowAdd = 0x200000000000ull;681 static const uptr kShadowAdd = 0x200000000000ull;
682};682};
683683
684/* Go on linux/riscv64 (39-bit VMA)
6850000 0001 0000 - 000f 0000 0000: executable and heap (60 GiB)
686000f 0000 0000 - 0010 0000 0000: -
6870010 0000 0000 - 0030 0000 0000: shadow - 128 GiB ( ~ 2 * app)
6880030 0000 0000 - 0038 0000 0000: metainfo - 32 GiB ( ~ 0.5 * app)
6890038 0000 0000 - 0040 0000 0000: -
690*/
691struct MappingGoRiscv64_39 {
692 static const uptr kMetaShadowBeg = 0x003000000000ull;
693 static const uptr kMetaShadowEnd = 0x003800000000ull;
694 static const uptr kShadowBeg = 0x001000000000ull;
695 static const uptr kShadowEnd = 0x003000000000ull;
696 static const uptr kLoAppMemBeg = 0x000000010000ull;
697 static const uptr kLoAppMemEnd = 0x000f00000000ull;
698 static const uptr kMidAppMemBeg = 0;
699 static const uptr kMidAppMemEnd = 0;
700 static const uptr kHiAppMemBeg = 0;
701 static const uptr kHiAppMemEnd = 0;
702 static const uptr kHeapMemBeg = 0;
703 static const uptr kHeapMemEnd = 0;
704 static const uptr kVdsoBeg = 0;
705 static const uptr kShadowMsk = 0;
706 static const uptr kShadowXor = 0;
707 static const uptr kShadowAdd = 0x001000000000ull;
708};
709
684/* Go on linux/riscv64 (48-bit VMA)710/* Go on linux/riscv64 (48-bit VMA)
6850000 0001 0000 - 00e0 0000 0000: executable and heap (896 GiB)7110000 0001 0000 - 00e0 0000 0000: executable and heap (896 GiB)
68600e0 0000 0000 - 2000 0000 0000: -71200e0 0000 0000 - 2000 0000 0000: -
...@@ -689,13 +715,13 @@ struct MappingGoMips64_47 {...@@ -689,13 +715,13 @@ struct MappingGoMips64_47 {
6893000 0000 0000 - 3100 0000 0000: metainfo - 1 TiB ( ~ 1 * app)7153000 0000 0000 - 3100 0000 0000: metainfo - 1 TiB ( ~ 1 * app)
6903100 0000 0000 - 8000 0000 0000: -7163100 0000 0000 - 8000 0000 0000: -
691*/717*/
692struct MappingGoRiscv64 {718struct MappingGoRiscv64_48 {
693 static const uptr kMetaShadowBeg = 0x300000000000ull;719 static const uptr kMetaShadowBeg = 0x300000000000ull;
694 static const uptr kMetaShadowEnd = 0x310000000000ull;720 static const uptr kMetaShadowEnd = 0x310000000000ull;
695 static const uptr kShadowBeg = 0x200000000000ull;721 static const uptr kShadowBeg = 0x200000000000ull;
696 static const uptr kShadowEnd = 0x240000000000ull;722 static const uptr kShadowEnd = 0x240000000000ull;
697 static const uptr kLoAppMemBeg = 0x000000010000ull;723 static const uptr kLoAppMemBeg = 0x000000010000ull;
698 static const uptr kLoAppMemEnd = 0x000e00000000ull;724 static const uptr kLoAppMemEnd = 0x00e000000000ull;
699 static const uptr kMidAppMemBeg = 0;725 static const uptr kMidAppMemBeg = 0;
700 static const uptr kMidAppMemEnd = 0;726 static const uptr kMidAppMemEnd = 0;
701 static const uptr kHiAppMemBeg = 0;727 static const uptr kHiAppMemBeg = 0;
...@@ -756,7 +782,12 @@ ALWAYS_INLINE auto SelectMapping(Arg arg) {...@@ -756,7 +782,12 @@ ALWAYS_INLINE auto SelectMapping(Arg arg) {
756# elif defined(__loongarch_lp64)782# elif defined(__loongarch_lp64)
757 return Func::template Apply<MappingGoLoongArch64_47>(arg);783 return Func::template Apply<MappingGoLoongArch64_47>(arg);
758# elif SANITIZER_RISCV64784# elif SANITIZER_RISCV64
759 return Func::template Apply<MappingGoRiscv64>(arg);785 switch (vmaSize) {
786 case 39:
787 return Func::template Apply<MappingGoRiscv64_39>(arg);
788 case 48:
789 return Func::template Apply<MappingGoRiscv64_48>(arg);
790 }
760# elif SANITIZER_WINDOWS791# elif SANITIZER_WINDOWS
761 return Func::template Apply<MappingGoWindows>(arg);792 return Func::template Apply<MappingGoWindows>(arg);
762# else793# else
...@@ -827,7 +858,8 @@ void ForEachMapping() {...@@ -827,7 +858,8 @@ void ForEachMapping() {
827 Func::template Apply<MappingGoAarch64>();858 Func::template Apply<MappingGoAarch64>();
828 Func::template Apply<MappingGoLoongArch64_47>();859 Func::template Apply<MappingGoLoongArch64_47>();
829 Func::template Apply<MappingGoMips64_47>();860 Func::template Apply<MappingGoMips64_47>();
830 Func::template Apply<MappingGoRiscv64>();861 Func::template Apply<MappingGoRiscv64_39>();
862 Func::template Apply<MappingGoRiscv64_48>();
831 Func::template Apply<MappingGoS390x>();863 Func::template Apply<MappingGoS390x>();
832}864}
833865
...@@ -926,7 +958,9 @@ struct IsAppMemImpl {...@@ -926,7 +958,9 @@ struct IsAppMemImpl {
926};958};
927959
928ALWAYS_INLINE960ALWAYS_INLINE
929bool IsAppMem(uptr mem) { return SelectMapping<IsAppMemImpl>(mem); }961bool IsAppMem(uptr mem) {
962 return SelectMapping<IsAppMemImpl>(STRIP_MTE_TAG(mem));
963}
930964
931struct IsShadowMemImpl {965struct IsShadowMemImpl {
932 template <typename Mapping>966 template <typename Mapping>
...@@ -965,7 +999,8 @@ struct MemToShadowImpl {...@@ -965,7 +999,8 @@ struct MemToShadowImpl {
965999
966ALWAYS_INLINE1000ALWAYS_INLINE
967RawShadow *MemToShadow(uptr x) {1001RawShadow *MemToShadow(uptr x) {
968 return reinterpret_cast<RawShadow *>(SelectMapping<MemToShadowImpl>(x));1002 return reinterpret_cast<RawShadow*>(
1003 SelectMapping<MemToShadowImpl>(STRIP_MTE_TAG(x)));
969}1004}
9701005
971struct MemToMetaImpl {1006struct MemToMetaImpl {
...@@ -979,7 +1014,9 @@ struct MemToMetaImpl {...@@ -979,7 +1014,9 @@ struct MemToMetaImpl {
979};1014};
9801015
981ALWAYS_INLINE1016ALWAYS_INLINE
982u32 *MemToMeta(uptr x) { return SelectMapping<MemToMetaImpl>(x); }1017u32* MemToMeta(uptr x) {
1018 return SelectMapping<MemToMetaImpl>(STRIP_MTE_TAG(x));
1019}
9831020
984struct ShadowToMemImpl {1021struct ShadowToMemImpl {
985 template <typename Mapping>1022 template <typename Mapping>
lib/libtsan/tsan_platform_linux.cpp+42-14
...@@ -393,9 +393,9 @@ void InitializePlatformEarly() {...@@ -393,9 +393,9 @@ void InitializePlatformEarly() {
393 Die();393 Die();
394 }394 }
395# else395# else
396 if (vmaSize != 48) {396 if (vmaSize != 39 && vmaSize != 48) {
397 Printf("FATAL: ThreadSanitizer: unsupported VMA range\n");397 Printf("FATAL: ThreadSanitizer: unsupported VMA range\n");
398 Printf("FATAL: Found %zd - Supported 48\n", vmaSize);398 Printf("FATAL: Found %zd - Supported 39 and 48\n", vmaSize);
399 Die();399 Die();
400 }400 }
401# endif401# endif
...@@ -415,7 +415,7 @@ void InitializePlatform() {...@@ -415,7 +415,7 @@ void InitializePlatform() {
415 // is not compiled with -pie.415 // is not compiled with -pie.
416#if !SANITIZER_GO416#if !SANITIZER_GO
417 {417 {
418# if SANITIZER_LINUX && (defined(__aarch64__) || defined(__loongarch_lp64))418# if INIT_LONGJMP_XOR_KEY
419 // Initialize the xor key used in {sig}{set,long}jump.419 // Initialize the xor key used in {sig}{set,long}jump.
420 InitializeLongjmpXorKey();420 InitializeLongjmpXorKey();
421# endif421# endif
...@@ -486,8 +486,20 @@ int ExtractRecvmsgFDs(void *msgp, int *fds, int nfd) {...@@ -486,8 +486,20 @@ int ExtractRecvmsgFDs(void *msgp, int *fds, int nfd) {
486486
487// Reverse operation of libc stack pointer mangling487// Reverse operation of libc stack pointer mangling
488static uptr UnmangleLongJmpSp(uptr mangled_sp) {488static uptr UnmangleLongJmpSp(uptr mangled_sp) {
489#if defined(__x86_64__)489# if SANITIZER_ANDROID && INIT_LONGJMP_XOR_KEY
490# if SANITIZER_LINUX490 if (longjmp_xor_key == 0) {
491 // bionic libc initialization process: __libc_init_globals ->
492 // __libc_init_vdso (calls strcmp) -> __libc_init_setjmp_cookie. strcmp is
493 // intercepted by TSan, so during TSan initialization the setjmp_cookie
494 // remains uninitialized. On Android, longjmp_xor_key must be set on first
495 // use.
496 InitializeLongjmpXorKey();
497 CHECK_NE(longjmp_xor_key, 0);
498 }
499# endif
500
501# if defined(__x86_64__)
502# if SANITIZER_LINUX
491 // Reverse of:503 // Reverse of:
492 // xor %fs:0x30, %rsi504 // xor %fs:0x30, %rsi
493 // rol $0x11, %rsi505 // rol $0x11, %rsi
...@@ -542,13 +554,23 @@ static uptr UnmangleLongJmpSp(uptr mangled_sp) {...@@ -542,13 +554,23 @@ static uptr UnmangleLongJmpSp(uptr mangled_sp) {
542# else554# else
543# define LONG_JMP_SP_ENV_SLOT 2555# define LONG_JMP_SP_ENV_SLOT 2
544# endif556# endif
545#elif SANITIZER_LINUX557# elif SANITIZER_ANDROID
546# ifdef __aarch64__558# ifdef __aarch64__
547# define LONG_JMP_SP_ENV_SLOT 13559# define LONG_JMP_SP_ENV_SLOT 3
548# elif defined(__loongarch__)560# elif SANITIZER_RISCV64
549# define LONG_JMP_SP_ENV_SLOT 1561# define LONG_JMP_SP_ENV_SLOT 3
550# elif defined(__mips64)562# elif defined(__x86_64__)
551# define LONG_JMP_SP_ENV_SLOT 1563# define LONG_JMP_SP_ENV_SLOT 6
564# else
565# error unsupported
566# endif
567# elif SANITIZER_LINUX
568# ifdef __aarch64__
569# define LONG_JMP_SP_ENV_SLOT 13
570# elif defined(__loongarch__)
571# define LONG_JMP_SP_ENV_SLOT 1
572# elif defined(__mips64)
573# define LONG_JMP_SP_ENV_SLOT 1
552# elif SANITIZER_RISCV64574# elif SANITIZER_RISCV64
553# define LONG_JMP_SP_ENV_SLOT 13575# define LONG_JMP_SP_ENV_SLOT 13
554# elif defined(__s390x__)576# elif defined(__s390x__)
...@@ -556,7 +578,7 @@ static uptr UnmangleLongJmpSp(uptr mangled_sp) {...@@ -556,7 +578,7 @@ static uptr UnmangleLongJmpSp(uptr mangled_sp) {
556# else578# else
557# define LONG_JMP_SP_ENV_SLOT 6579# define LONG_JMP_SP_ENV_SLOT 6
558# endif580# endif
559#endif581# endif
560582
561uptr ExtractLongJmpSp(uptr *env) {583uptr ExtractLongJmpSp(uptr *env) {
562 uptr mangled_sp = env[LONG_JMP_SP_ENV_SLOT];584 uptr mangled_sp = env[LONG_JMP_SP_ENV_SLOT];
...@@ -653,7 +675,13 @@ ThreadState *cur_thread() {...@@ -653,7 +675,13 @@ ThreadState *cur_thread() {
653 }675 }
654 CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, &oldset, nullptr));676 CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, &oldset, nullptr));
655 }677 }
656 return thr;678
679 // Skia calls mallopt(M_THREAD_DISABLE_MEM_INIT, 1), which sets the least
680 // significant bit of TLS_SLOT_SANITIZER to 1. Scudo allocator uses this bit
681 // as a flag to disable memory initialization. This is a workaround to get the
682 // correct ThreadState pointer.
683 uptr addr = reinterpret_cast<uptr>(thr);
684 return reinterpret_cast<ThreadState*>(addr & ~1ULL);
657}685}
658686
659void set_cur_thread(ThreadState *thr) {687void set_cur_thread(ThreadState *thr) {
lib/libtsan/tsan_platform_mac.cpp+16-3
...@@ -226,9 +226,20 @@ static void ThreadTerminateCallback(uptr thread) {...@@ -226,9 +226,20 @@ static void ThreadTerminateCallback(uptr thread) {
226void InitializePlatformEarly() {226void InitializePlatformEarly() {
227# if !SANITIZER_GO && SANITIZER_IOS227# if !SANITIZER_GO && SANITIZER_IOS
228 uptr max_vm = GetMaxUserVirtualAddress() + 1;228 uptr max_vm = GetMaxUserVirtualAddress() + 1;
229 if (max_vm != HiAppMemEnd()) {229 if (max_vm < HiAppMemEnd()) {
230 Printf("ThreadSanitizer: unsupported vm address limit %p, expected %p.\n",230 Report(
231 (void *)max_vm, (void *)HiAppMemEnd());231 "ThreadSanitizer: Unsupported virtual memory layout:\n\tVM address "
232 "limit = %p\n\tExpected %p.\n",
233 (void*)max_vm, (void*)HiAppMemEnd());
234 Die();
235 }
236 // In some configurations, the max_vm is expanded, but much of this space is
237 // already mapped. TSAN will not work in this configuration.
238 if (!MemoryRangeIsAvailable(HiAppMemEnd() - 1, HiAppMemEnd() - 1)) {
239 Report(
240 "ThreadSanitizer: Unsupported virtual memory layout: Address %p is "
241 "already mapped.\n",
242 (void*)(HiAppMemEnd() - 1));
232 Die();243 Die();
233 }244 }
234#endif245#endif
...@@ -248,7 +259,9 @@ void InitializePlatform() {...@@ -248,7 +259,9 @@ void InitializePlatform() {
248259
249 ThreadEventCallbacks callbacks = {260 ThreadEventCallbacks callbacks = {
250 .create = ThreadCreateCallback,261 .create = ThreadCreateCallback,
262 .start = nullptr,
251 .terminate = ThreadTerminateCallback,263 .terminate = ThreadTerminateCallback,
264 .destroy = nullptr,
252 };265 };
253 InstallPthreadIntrospectionHook(callbacks);266 InstallPthreadIntrospectionHook(callbacks);
254#endif267#endif
lib/libtsan/tsan_report.h+14-1
...@@ -12,6 +12,8 @@...@@ -12,6 +12,8 @@
12#ifndef TSAN_REPORT_H12#ifndef TSAN_REPORT_H
13#define TSAN_REPORT_H13#define TSAN_REPORT_H
1414
15#include "sanitizer_common/sanitizer_internal_defs.h"
16#include "sanitizer_common/sanitizer_stacktrace.h"
15#include "sanitizer_common/sanitizer_symbolizer.h"17#include "sanitizer_common/sanitizer_symbolizer.h"
16#include "sanitizer_common/sanitizer_thread_registry.h"18#include "sanitizer_common/sanitizer_thread_registry.h"
17#include "sanitizer_common/sanitizer_vector.h"19#include "sanitizer_common/sanitizer_vector.h"
...@@ -56,6 +58,7 @@ struct ReportMop {...@@ -56,6 +58,7 @@ struct ReportMop {
56 bool atomic;58 bool atomic;
57 uptr external_tag;59 uptr external_tag;
58 Vector<ReportMopMutex> mset;60 Vector<ReportMopMutex> mset;
61 StackTrace stack_trace;
59 ReportStack *stack;62 ReportStack *stack;
6063
61 ReportMop();64 ReportMop();
...@@ -79,25 +82,34 @@ struct ReportLocation {...@@ -79,25 +82,34 @@ struct ReportLocation {
79 int fd = 0;82 int fd = 0;
80 bool fd_closed = false;83 bool fd_closed = false;
81 bool suppressable = false;84 bool suppressable = false;
85 StackID stack_id = 0;
82 ReportStack *stack = nullptr;86 ReportStack *stack = nullptr;
83};87};
8488
85struct ReportThread {89struct ReportThread {
86 Tid id;90 Tid id;
87 tid_t os_id;91 ThreadID os_id;
88 bool running;92 bool running;
89 ThreadType thread_type;93 ThreadType thread_type;
90 char *name;94 char *name;
91 Tid parent_tid;95 Tid parent_tid;
96 StackID stack_id;
92 ReportStack *stack;97 ReportStack *stack;
98 bool suppressable;
93};99};
94100
95struct ReportMutex {101struct ReportMutex {
96 int id;102 int id;
97 uptr addr;103 uptr addr;
104 StackID stack_id;
98 ReportStack *stack;105 ReportStack *stack;
99};106};
100107
108struct AddedLocationAddr {
109 uptr addr;
110 usize locs_idx;
111};
112
101class ReportDesc {113class ReportDesc {
102 public:114 public:
103 ReportType typ;115 ReportType typ;
...@@ -105,6 +117,7 @@ class ReportDesc {...@@ -105,6 +117,7 @@ class ReportDesc {
105 Vector<ReportStack*> stacks;117 Vector<ReportStack*> stacks;
106 Vector<ReportMop*> mops;118 Vector<ReportMop*> mops;
107 Vector<ReportLocation*> locs;119 Vector<ReportLocation*> locs;
120 Vector<AddedLocationAddr> added_location_addrs;
108 Vector<ReportMutex*> mutexes;121 Vector<ReportMutex*> mutexes;
109 Vector<ReportThread*> threads;122 Vector<ReportThread*> threads;
110 Vector<Tid> unique_tids;123 Vector<Tid> unique_tids;
lib/libtsan/tsan_rtl.cpp+14
...@@ -40,6 +40,13 @@ SANITIZER_WEAK_DEFAULT_IMPL...@@ -40,6 +40,13 @@ SANITIZER_WEAK_DEFAULT_IMPL
40void __tsan_test_only_on_fork() {}40void __tsan_test_only_on_fork() {}
41#endif41#endif
4242
43#if SANITIZER_APPLE && !SANITIZER_GO
44// Override weak symbol from sanitizer_common
45extern void __tsan_set_in_internal_write_call(bool value) {
46 __tsan::cur_thread_init()->in_internal_write_call = value;
47}
48#endif
49
43namespace __tsan {50namespace __tsan {
4451
45#if !SANITIZER_GO52#if !SANITIZER_GO
...@@ -893,6 +900,13 @@ void ForkChildAfter(ThreadState* thr, uptr pc, bool start_thread) {...@@ -893,6 +900,13 @@ void ForkChildAfter(ThreadState* thr, uptr pc, bool start_thread) {
893 ThreadIgnoreBegin(thr, pc);900 ThreadIgnoreBegin(thr, pc);
894 ThreadIgnoreSyncBegin(thr, pc);901 ThreadIgnoreSyncBegin(thr, pc);
895 }902 }
903
904# if SANITIZER_APPLE && !SANITIZER_GO
905 // This flag can have inheritance disabled - we are the child so act
906 // accordingly
907 if (flags()->lock_during_write == kNoLockDuringWritesCurrentProcess)
908 flags()->lock_during_write = kLockDuringAllWrites;
909# endif
896}910}
897#endif911#endif
898912
lib/libtsan/tsan_rtl.h+7-2
...@@ -236,6 +236,10 @@ struct alignas(SANITIZER_CACHE_LINE_SIZE) ThreadState {...@@ -236,6 +236,10 @@ struct alignas(SANITIZER_CACHE_LINE_SIZE) ThreadState {
236236
237 const ReportDesc *current_report;237 const ReportDesc *current_report;
238238
239#if SANITIZER_APPLE && !SANITIZER_GO
240 bool in_internal_write_call;
241#endif
242
239 explicit ThreadState(Tid tid);243 explicit ThreadState(Tid tid);
240};244};
241245
...@@ -420,6 +424,7 @@ class ScopedReportBase {...@@ -420,6 +424,7 @@ class ScopedReportBase {
420 void AddSleep(StackID stack_id);424 void AddSleep(StackID stack_id);
421 void SetCount(int count);425 void SetCount(int count);
422 void SetSigNum(int sig);426 void SetSigNum(int sig);
427 void SymbolizeStackElems(void);
423428
424 const ReportDesc *GetReport() const;429 const ReportDesc *GetReport() const;
425430
...@@ -498,7 +503,7 @@ void ForkChildAfter(ThreadState *thr, uptr pc, bool start_thread);...@@ -498,7 +503,7 @@ void ForkChildAfter(ThreadState *thr, uptr pc, bool start_thread);
498503
499void ReportRace(ThreadState *thr, RawShadow *shadow_mem, Shadow cur, Shadow old,504void ReportRace(ThreadState *thr, RawShadow *shadow_mem, Shadow cur, Shadow old,
500 AccessType typ);505 AccessType typ);
501bool OutputReport(ThreadState *thr, const ScopedReport &srep);506bool OutputReport(ThreadState *thr, ScopedReport &srep);
502bool IsFiredSuppression(Context *ctx, ReportType type, StackTrace trace);507bool IsFiredSuppression(Context *ctx, ReportType type, StackTrace trace);
503bool IsExpectedReport(uptr addr, uptr size);508bool IsExpectedReport(uptr addr, uptr size);
504509
...@@ -559,7 +564,7 @@ void ThreadIgnoreSyncBegin(ThreadState *thr, uptr pc);...@@ -559,7 +564,7 @@ void ThreadIgnoreSyncBegin(ThreadState *thr, uptr pc);
559void ThreadIgnoreSyncEnd(ThreadState *thr);564void ThreadIgnoreSyncEnd(ThreadState *thr);
560565
561Tid ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached);566Tid ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached);
562void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,567void ThreadStart(ThreadState *thr, Tid tid, ThreadID os_id,
563 ThreadType thread_type);568 ThreadType thread_type);
564void ThreadFinish(ThreadState *thr);569void ThreadFinish(ThreadState *thr);
565Tid ThreadConsumeTid(ThreadState *thr, uptr pc, uptr uid);570Tid ThreadConsumeTid(ThreadState *thr, uptr pc, uptr uid);
lib/libtsan/tsan_rtl_aarch64.S+3-5
...@@ -4,10 +4,8 @@...@@ -4,10 +4,8 @@
4#include "sanitizer_common/sanitizer_asm.h"4#include "sanitizer_common/sanitizer_asm.h"
5#include "builtins/assembly.h"5#include "builtins/assembly.h"
66
7#if !defined(__APPLE__)7TEXT_SECTION
8.section .text8#if defined(__APPLE__)
9#else
10.section __TEXT,__text
11.align 39.align 3
12#endif10#endif
1311
...@@ -222,6 +220,6 @@ ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp))...@@ -222,6 +220,6 @@ ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp))
222220
223NO_EXEC_STACK_DIRECTIVE221NO_EXEC_STACK_DIRECTIVE
224222
225GNU_PROPERTY_BTI_PAC223GNU_PROPERTY_BTI_PAC_GCS
226224
227#endif225#endif
lib/libtsan/tsan_rtl_access.cpp+8-3
...@@ -419,6 +419,11 @@ NOINLINE void TraceRestartMemoryAccess(ThreadState* thr, uptr pc, uptr addr,...@@ -419,6 +419,11 @@ NOINLINE void TraceRestartMemoryAccess(ThreadState* thr, uptr pc, uptr addr,
419419
420ALWAYS_INLINE USED void MemoryAccess(ThreadState* thr, uptr pc, uptr addr,420ALWAYS_INLINE USED void MemoryAccess(ThreadState* thr, uptr pc, uptr addr,
421 uptr size, AccessType typ) {421 uptr size, AccessType typ) {
422#if SANITIZER_APPLE && !SANITIZER_GO
423 // Swift symbolizer can be intercepted and deadlock without this
424 if (thr->in_symbolizer)
425 return;
426#endif
422 RawShadow* shadow_mem = MemToShadow(addr);427 RawShadow* shadow_mem = MemToShadow(addr);
423 UNUSED char memBuf[4][64];428 UNUSED char memBuf[4][64];
424 DPrintf2("#%d: Access: %d@%d %p/%zd typ=0x%x {%s, %s, %s, %s}\n", thr->tid,429 DPrintf2("#%d: Access: %d@%d %p/%zd typ=0x%x {%s, %s, %s, %s}\n", thr->tid,
...@@ -684,7 +689,7 @@ void MemoryAccessRangeT(ThreadState* thr, uptr pc, uptr addr, uptr size) {...@@ -684,7 +689,7 @@ void MemoryAccessRangeT(ThreadState* thr, uptr pc, uptr addr, uptr size) {
684 DCHECK(IsAppMem(addr + size - 1));689 DCHECK(IsAppMem(addr + size - 1));
685 }690 }
686 if (!IsShadowMem(shadow_mem)) {691 if (!IsShadowMem(shadow_mem)) {
687 Printf("Bad shadow start addr: %p (%p)\n", shadow_mem, (void*)addr);692 Printf("Bad shadow start addr: %p (%p)\n", (void*)shadow_mem, (void*)addr);
688 DCHECK(IsShadowMem(shadow_mem));693 DCHECK(IsShadowMem(shadow_mem));
689 }694 }
690695
...@@ -693,12 +698,12 @@ void MemoryAccessRangeT(ThreadState* thr, uptr pc, uptr addr, uptr size) {...@@ -693,12 +698,12 @@ void MemoryAccessRangeT(ThreadState* thr, uptr pc, uptr addr, uptr size) {
693 RawShadow* shadow_mem_end =698 RawShadow* shadow_mem_end =
694 shadow_mem + rounded_size / kShadowCell * kShadowCnt;699 shadow_mem + rounded_size / kShadowCell * kShadowCnt;
695 if (!IsShadowMem(shadow_mem_end - 1)) {700 if (!IsShadowMem(shadow_mem_end - 1)) {
696 Printf("Bad shadow end addr: %p (%p)\n", shadow_mem_end - 1,701 Printf("Bad shadow end addr: %p (%p)\n", (void*)(shadow_mem_end - 1),
697 (void*)(addr + size - 1));702 (void*)(addr + size - 1));
698 Printf(703 Printf(
699 "Shadow start addr (ok): %p (%p); size: 0x%zx; rounded_size: 0x%zx; "704 "Shadow start addr (ok): %p (%p); size: 0x%zx; rounded_size: 0x%zx; "
700 "kShadowMultiplier: %zx\n",705 "kShadowMultiplier: %zx\n",
701 shadow_mem, (void*)addr, size, rounded_size, kShadowMultiplier);706 (void*)shadow_mem, (void*)addr, size, rounded_size, kShadowMultiplier);
702 DCHECK(IsShadowMem(shadow_mem_end - 1));707 DCHECK(IsShadowMem(shadow_mem_end - 1));
703 }708 }
704#endif709#endif
lib/libtsan/tsan_rtl_amd64.S+2
...@@ -3,6 +3,8 @@...@@ -3,6 +3,8 @@
33
4#include "sanitizer_common/sanitizer_asm.h"4#include "sanitizer_common/sanitizer_asm.h"
55
6.att_syntax
7
6#if !defined(__APPLE__)8#if !defined(__APPLE__)
7.section .text9.section .text
8#else10#else
lib/libtsan/tsan_rtl_mutex.cpp+94-49
...@@ -11,14 +11,15 @@...@@ -11,14 +11,15 @@
11//===----------------------------------------------------------------------===//11//===----------------------------------------------------------------------===//
1212
13#include <sanitizer_common/sanitizer_deadlock_detector_interface.h>13#include <sanitizer_common/sanitizer_deadlock_detector_interface.h>
14#include <sanitizer_common/sanitizer_placement_new.h>
14#include <sanitizer_common/sanitizer_stackdepot.h>15#include <sanitizer_common/sanitizer_stackdepot.h>
1516
16#include "tsan_rtl.h"
17#include "tsan_flags.h"17#include "tsan_flags.h"
18#include "tsan_sync.h"18#include "tsan_platform.h"
19#include "tsan_report.h"19#include "tsan_report.h"
20#include "tsan_rtl.h"
20#include "tsan_symbolize.h"21#include "tsan_symbolize.h"
21#include "tsan_platform.h"22#include "tsan_sync.h"
2223
23namespace __tsan {24namespace __tsan {
2425
...@@ -55,14 +56,28 @@ static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ,...@@ -55,14 +56,28 @@ static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ,
55 return;56 return;
56 if (!ShouldReport(thr, typ))57 if (!ShouldReport(thr, typ))
57 return;58 return;
58 ThreadRegistryLock l(&ctx->thread_registry);59 // Use alloca, because malloc during signal handling deadlocks
59 ScopedReport rep(typ);60 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
60 rep.AddMutex(addr, creation_stack_id);61 // Take a new scope as Apple platforms require the below locks released
61 VarSizeStackTrace trace;62 // before symbolizing in order to avoid a deadlock
62 ObtainCurrentStack(thr, pc, &trace);63 {
63 rep.AddStack(trace, true);64 ThreadRegistryLock l(&ctx->thread_registry);
64 rep.AddLocation(addr, 1);65 new (rep) ScopedReport(typ);
65 OutputReport(thr, rep);66 rep->AddMutex(addr, creation_stack_id);
67 VarSizeStackTrace trace;
68 ObtainCurrentStack(thr, pc, &trace);
69 rep->AddStack(trace, true);
70 rep->AddLocation(addr, 1);
71#if SANITIZER_APPLE
72 } // Close this scope to release the locks
73#endif
74 OutputReport(thr, *rep);
75
76 // Need to manually destroy this because we used placement new to allocate
77 rep->~ScopedReport();
78#if !SANITIZER_APPLE
79 }
80#endif
66}81}
6782
68static void RecordMutexLock(ThreadState *thr, uptr pc, uptr addr,83static void RecordMutexLock(ThreadState *thr, uptr pc, uptr addr,
...@@ -528,51 +543,81 @@ void AfterSleep(ThreadState *thr, uptr pc) {...@@ -528,51 +543,81 @@ void AfterSleep(ThreadState *thr, uptr pc) {
528void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r) {543void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r) {
529 if (r == 0 || !ShouldReport(thr, ReportTypeDeadlock))544 if (r == 0 || !ShouldReport(thr, ReportTypeDeadlock))
530 return;545 return;
531 ThreadRegistryLock l(&ctx->thread_registry);546 // Use alloca, because malloc during signal handling deadlocks
532 ScopedReport rep(ReportTypeDeadlock);547 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
533 for (int i = 0; i < r->n; i++) {548 // Take a new scope as Apple platforms require the below locks released
534 rep.AddMutex(r->loop[i].mtx_ctx0, r->loop[i].stk[0]);549 // before symbolizing in order to avoid a deadlock
535 rep.AddUniqueTid((int)r->loop[i].thr_ctx);550 {
536 rep.AddThread((int)r->loop[i].thr_ctx);551 ThreadRegistryLock l(&ctx->thread_registry);
537 }552 new (rep) ScopedReport(ReportTypeDeadlock);
538 uptr dummy_pc = 0x42;553 for (int i = 0; i < r->n; i++) {
539 for (int i = 0; i < r->n; i++) {554 rep->AddMutex(r->loop[i].mtx_ctx0, r->loop[i].stk[0]);
540 for (int j = 0; j < (flags()->second_deadlock_stack ? 2 : 1); j++) {555 rep->AddUniqueTid((int)r->loop[i].thr_ctx);
541 u32 stk = r->loop[i].stk[j];556 rep->AddThread((int)r->loop[i].thr_ctx);
542 if (stk && stk != kInvalidStackID) {557 }
543 rep.AddStack(StackDepotGet(stk), true);558 uptr dummy_pc = 0x42;
544 } else {559 for (int i = 0; i < r->n; i++) {
545 // Sometimes we fail to extract the stack trace (FIXME: investigate),560 for (int j = 0; j < (flags()->second_deadlock_stack ? 2 : 1); j++) {
546 // but we should still produce some stack trace in the report.561 u32 stk = r->loop[i].stk[j];
547 rep.AddStack(StackTrace(&dummy_pc, 1), true);562 StackTrace stack;
563 if (stk && stk != kInvalidStackID) {
564 stack = StackDepotGet(stk);
565 } else {
566 // Sometimes we fail to extract the stack trace (FIXME: investigate),
567 // but we should still produce some stack trace in the report.
568 stack = StackTrace(&dummy_pc, 1);
569 }
570 rep->AddStack(stack, true);
548 }571 }
549 }572 }
573#if SANITIZER_APPLE
574 } // Close this scope to release the locks
575#endif
576 OutputReport(thr, *rep);
577
578 // Need to manually destroy this because we used placement new to allocate
579 rep->~ScopedReport();
580#if !SANITIZER_APPLE
550 }581 }
551 OutputReport(thr, rep);582#endif
552}583}
553584
554void ReportDestroyLocked(ThreadState *thr, uptr pc, uptr addr,585void ReportDestroyLocked(ThreadState *thr, uptr pc, uptr addr,
555 FastState last_lock, StackID creation_stack_id) {586 FastState last_lock, StackID creation_stack_id) {
556 // We need to lock the slot during RestoreStack because it protects587 // Use alloca, because malloc during signal handling deadlocks
557 // the slot journal.588 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
558 Lock slot_lock(&ctx->slots[static_cast<uptr>(last_lock.sid())].mtx);589 // Take a new scope as Apple platforms require the below locks released
559 ThreadRegistryLock l0(&ctx->thread_registry);590 // before symbolizing in order to avoid a deadlock
560 Lock slots_lock(&ctx->slot_mtx);591 {
561 ScopedReport rep(ReportTypeMutexDestroyLocked);592 // We need to lock the slot during RestoreStack because it protects
562 rep.AddMutex(addr, creation_stack_id);593 // the slot journal.
563 VarSizeStackTrace trace;594 Lock slot_lock(&ctx->slots[static_cast<uptr>(last_lock.sid())].mtx);
564 ObtainCurrentStack(thr, pc, &trace);595 ThreadRegistryLock l0(&ctx->thread_registry);
565 rep.AddStack(trace, true);596 Lock slots_lock(&ctx->slot_mtx);
566597 new (rep) ScopedReport(ReportTypeMutexDestroyLocked);
567 Tid tid;598 rep->AddMutex(addr, creation_stack_id);
568 DynamicMutexSet mset;599 VarSizeStackTrace trace;
569 uptr tag;600 ObtainCurrentStack(thr, pc, &trace);
570 if (!RestoreStack(EventType::kLock, last_lock.sid(), last_lock.epoch(), addr,601 rep->AddStack(trace, true);
571 0, kAccessWrite, &tid, &trace, mset, &tag))602
572 return;603 Tid tid;
573 rep.AddStack(trace, true);604 DynamicMutexSet mset;
574 rep.AddLocation(addr, 1);605 uptr tag;
575 OutputReport(thr, rep);606 if (!RestoreStack(EventType::kLock, last_lock.sid(), last_lock.epoch(),
607 addr, 0, kAccessWrite, &tid, &trace, mset, &tag))
608 return;
609 rep->AddStack(trace, true);
610 rep->AddLocation(addr, 1);
611#if SANITIZER_APPLE
612 } // Close this scope to release the locks
613#endif
614 OutputReport(thr, *rep);
615
616 // Need to manually destroy this because we used placement new to allocate
617 rep->~ScopedReport();
618#if !SANITIZER_APPLE
619 }
620#endif
576}621}
577622
578} // namespace __tsan623} // namespace __tsan
lib/libtsan/tsan_rtl_report.cpp+132-65
...@@ -11,10 +11,12 @@...@@ -11,10 +11,12 @@
11//===----------------------------------------------------------------------===//11//===----------------------------------------------------------------------===//
1212
13#include "sanitizer_common/sanitizer_common.h"13#include "sanitizer_common/sanitizer_common.h"
14#include "sanitizer_common/sanitizer_internal_defs.h"
14#include "sanitizer_common/sanitizer_libc.h"15#include "sanitizer_common/sanitizer_libc.h"
15#include "sanitizer_common/sanitizer_placement_new.h"16#include "sanitizer_common/sanitizer_placement_new.h"
16#include "sanitizer_common/sanitizer_stackdepot.h"17#include "sanitizer_common/sanitizer_stackdepot.h"
17#include "sanitizer_common/sanitizer_stacktrace.h"18#include "sanitizer_common/sanitizer_stacktrace.h"
19#include "tsan_defs.h"
18#include "tsan_fd.h"20#include "tsan_fd.h"
19#include "tsan_flags.h"21#include "tsan_flags.h"
20#include "tsan_mman.h"22#include "tsan_mman.h"
...@@ -109,7 +111,13 @@ static ReportStack *SymbolizeStack(StackTrace trace) {...@@ -109,7 +111,13 @@ static ReportStack *SymbolizeStack(StackTrace trace) {
109 // instruction.111 // instruction.
110 if ((pc & kExternalPCBit) == 0)112 if ((pc & kExternalPCBit) == 0)
111 pc1 = StackTrace::GetPreviousInstructionPc(pc);113 pc1 = StackTrace::GetPreviousInstructionPc(pc);
112 SymbolizedStack *ent = SymbolizeCode(pc1);114 SymbolizedStack* ent = SymbolizeCode(pc1, si == trace.size - 1);
115#if SANITIZER_GO
116 if (ent == nullptr) {
117 // Go might have 0 frames for this PC (wrapper frames aren't reported).
118 continue;
119 }
120#endif
113 CHECK_NE(ent, 0);121 CHECK_NE(ent, 0);
114 SymbolizedStack *last = ent;122 SymbolizedStack *last = ent;
115 while (last->next) {123 while (last->next) {
...@@ -187,10 +195,8 @@ void ScopedReportBase::AddMemoryAccess(uptr addr, uptr external_tag, Shadow s,...@@ -187,10 +195,8 @@ void ScopedReportBase::AddMemoryAccess(uptr addr, uptr external_tag, Shadow s,
187 mop->size = size;195 mop->size = size;
188 mop->write = !(typ & kAccessRead);196 mop->write = !(typ & kAccessRead);
189 mop->atomic = typ & kAccessAtomic;197 mop->atomic = typ & kAccessAtomic;
190 mop->stack = SymbolizeStack(stack);
191 mop->external_tag = external_tag;198 mop->external_tag = external_tag;
192 if (mop->stack)199 mop->stack_trace = stack;
193 mop->stack->suppressable = true;
194 for (uptr i = 0; i < mset->Size(); i++) {200 for (uptr i = 0; i < mset->Size(); i++) {
195 MutexSet::Desc d = mset->Get(i);201 MutexSet::Desc d = mset->Get(i);
196 int id = this->AddMutex(d.addr, d.stack_id);202 int id = this->AddMutex(d.addr, d.stack_id);
...@@ -199,6 +205,56 @@ void ScopedReportBase::AddMemoryAccess(uptr addr, uptr external_tag, Shadow s,...@@ -199,6 +205,56 @@ void ScopedReportBase::AddMemoryAccess(uptr addr, uptr external_tag, Shadow s,
199 }205 }
200}206}
201207
208void ScopedReportBase::SymbolizeStackElems() {
209 // symbolize memory ops
210 for (usize i = 0, size = rep_->mops.Size(); i < size; i++) {
211 ReportMop *mop = rep_->mops[i];
212 mop->stack = SymbolizeStack(mop->stack_trace);
213 if (mop->stack)
214 mop->stack->suppressable = true;
215 }
216
217 // symbolize locations
218 for (usize i = 0, size = rep_->locs.Size(); i < size; i++) {
219 // added locations have a NULL placeholder - don't dereference them
220 if (ReportLocation *loc = rep_->locs[i])
221 loc->stack = SymbolizeStackId(loc->stack_id);
222 }
223
224 // symbolize any added locations
225 for (usize i = 0, size = rep_->added_location_addrs.Size(); i < size; i++) {
226 AddedLocationAddr *added_loc = &rep_->added_location_addrs[i];
227 if (ReportLocation *loc = SymbolizeData(added_loc->addr)) {
228 loc->suppressable = true;
229 rep_->locs[added_loc->locs_idx] = loc;
230 }
231 }
232
233 // Filter out any added location placeholders that could not be symbolized
234 usize j = 0;
235 for (usize i = 0, size = rep_->locs.Size(); i < size; i++) {
236 if (rep_->locs[i] != nullptr) {
237 rep_->locs[j] = rep_->locs[i];
238 j++;
239 }
240 }
241 rep_->locs.Resize(j);
242
243 // symbolize threads
244 for (usize i = 0, size = rep_->threads.Size(); i < size; i++) {
245 ReportThread *rt = rep_->threads[i];
246 rt->stack = SymbolizeStackId(rt->stack_id);
247 if (rt->stack)
248 rt->stack->suppressable = rt->suppressable;
249 }
250
251 // symbolize mutexes
252 for (usize i = 0, size = rep_->mutexes.Size(); i < size; i++) {
253 ReportMutex *rm = rep_->mutexes[i];
254 rm->stack = SymbolizeStackId(rm->stack_id);
255 }
256}
257
202void ScopedReportBase::AddUniqueTid(Tid unique_tid) {258void ScopedReportBase::AddUniqueTid(Tid unique_tid) {
203 rep_->unique_tids.PushBack(unique_tid);259 rep_->unique_tids.PushBack(unique_tid);
204}260}
...@@ -216,10 +272,8 @@ void ScopedReportBase::AddThread(const ThreadContext *tctx, bool suppressable) {...@@ -216,10 +272,8 @@ void ScopedReportBase::AddThread(const ThreadContext *tctx, bool suppressable) {
216 rt->name = internal_strdup(tctx->name);272 rt->name = internal_strdup(tctx->name);
217 rt->parent_tid = tctx->parent_tid;273 rt->parent_tid = tctx->parent_tid;
218 rt->thread_type = tctx->thread_type;274 rt->thread_type = tctx->thread_type;
219 rt->stack = 0;275 rt->stack_id = tctx->creation_stack_id;
220 rt->stack = SymbolizeStackId(tctx->creation_stack_id);276 rt->suppressable = suppressable;
221 if (rt->stack)
222 rt->stack->suppressable = suppressable;
223}277}
224278
225#if !SANITIZER_GO279#if !SANITIZER_GO
...@@ -270,7 +324,7 @@ int ScopedReportBase::AddMutex(uptr addr, StackID creation_stack_id) {...@@ -270,7 +324,7 @@ int ScopedReportBase::AddMutex(uptr addr, StackID creation_stack_id) {
270 rep_->mutexes.PushBack(rm);324 rep_->mutexes.PushBack(rm);
271 rm->id = rep_->mutexes.Size() - 1;325 rm->id = rep_->mutexes.Size() - 1;
272 rm->addr = addr;326 rm->addr = addr;
273 rm->stack = SymbolizeStackId(creation_stack_id);327 rm->stack_id = creation_stack_id;
274 return rm->id;328 return rm->id;
275}329}
276330
...@@ -288,7 +342,7 @@ void ScopedReportBase::AddLocation(uptr addr, uptr size) {...@@ -288,7 +342,7 @@ void ScopedReportBase::AddLocation(uptr addr, uptr size) {
288 loc->fd_closed = closed;342 loc->fd_closed = closed;
289 loc->fd = fd;343 loc->fd = fd;
290 loc->tid = creat_tid;344 loc->tid = creat_tid;
291 loc->stack = SymbolizeStackId(creat_stack);345 loc->stack_id = creat_stack;
292 rep_->locs.PushBack(loc);346 rep_->locs.PushBack(loc);
293 AddThread(creat_tid);347 AddThread(creat_tid);
294 return;348 return;
...@@ -310,7 +364,7 @@ void ScopedReportBase::AddLocation(uptr addr, uptr size) {...@@ -310,7 +364,7 @@ void ScopedReportBase::AddLocation(uptr addr, uptr size) {
310 loc->heap_chunk_size = b->siz;364 loc->heap_chunk_size = b->siz;
311 loc->external_tag = b->tag;365 loc->external_tag = b->tag;
312 loc->tid = b->tid;366 loc->tid = b->tid;
313 loc->stack = SymbolizeStackId(b->stk);367 loc->stack_id = b->stk;
314 rep_->locs.PushBack(loc);368 rep_->locs.PushBack(loc);
315 AddThread(b->tid);369 AddThread(b->tid);
316 return;370 return;
...@@ -324,11 +378,8 @@ void ScopedReportBase::AddLocation(uptr addr, uptr size) {...@@ -324,11 +378,8 @@ void ScopedReportBase::AddLocation(uptr addr, uptr size) {
324 AddThread(tctx);378 AddThread(tctx);
325 }379 }
326#endif380#endif
327 if (ReportLocation *loc = SymbolizeData(addr)) {381 rep_->added_location_addrs.PushBack({addr, rep_->locs.Size()});
328 loc->suppressable = true;382 rep_->locs.PushBack(nullptr);
329 rep_->locs.PushBack(loc);
330 return;
331 }
332}383}
333384
334#if !SANITIZER_GO385#if !SANITIZER_GO
...@@ -628,11 +679,12 @@ static bool HandleRacyStacks(ThreadState *thr, VarSizeStackTrace traces[2]) {...@@ -628,11 +679,12 @@ static bool HandleRacyStacks(ThreadState *thr, VarSizeStackTrace traces[2]) {
628 return false;679 return false;
629}680}
630681
631bool OutputReport(ThreadState *thr, const ScopedReport &srep) {682bool OutputReport(ThreadState *thr, ScopedReport &srep) {
632 // These should have been checked in ShouldReport.683 // These should have been checked in ShouldReport.
633 // It's too late to check them here, we have already taken locks.684 // It's too late to check them here, we have already taken locks.
634 CHECK(flags()->report_bugs);685 CHECK(flags()->report_bugs);
635 CHECK(!thr->suppress_reports);686 CHECK(!thr->suppress_reports);
687 srep.SymbolizeStackElems();
636 atomic_store_relaxed(&ctx->last_symbolize_time_ns, NanoTime());688 atomic_store_relaxed(&ctx->last_symbolize_time_ns, NanoTime());
637 const ReportDesc *rep = srep.GetReport();689 const ReportDesc *rep = srep.GetReport();
638 CHECK_EQ(thr->current_report, nullptr);690 CHECK_EQ(thr->current_report, nullptr);
...@@ -761,65 +813,80 @@ void ReportRace(ThreadState *thr, RawShadow *shadow_mem, Shadow cur, Shadow old,...@@ -761,65 +813,80 @@ void ReportRace(ThreadState *thr, RawShadow *shadow_mem, Shadow cur, Shadow old,
761 DynamicMutexSet mset1;813 DynamicMutexSet mset1;
762 MutexSet *mset[kMop] = {&thr->mset, mset1};814 MutexSet *mset[kMop] = {&thr->mset, mset1};
763815
764 // We need to lock the slot during RestoreStack because it protects816 // Use alloca, because malloc during signal handling deadlocks
765 // the slot journal.817 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
766 Lock slot_lock(&ctx->slots[static_cast<uptr>(s[1].sid())].mtx);818 // Take a new scope as Apple platforms require the below locks released
767 ThreadRegistryLock l0(&ctx->thread_registry);819 // before symbolizing in order to avoid a deadlock
768 Lock slots_lock(&ctx->slot_mtx);820 {
769 if (SpuriousRace(old))821 // We need to lock the slot during RestoreStack because it protects
770 return;822 // the slot journal.
771 if (!RestoreStack(EventType::kAccessExt, s[1].sid(), s[1].epoch(), addr1,823 Lock slot_lock(&ctx->slots[static_cast<uptr>(s[1].sid())].mtx);
772 size1, typ1, &tids[1], &traces[1], mset[1], &tags[1])) {824 ThreadRegistryLock l0(&ctx->thread_registry);
773 StoreShadow(&ctx->last_spurious_race, old.raw());825 Lock slots_lock(&ctx->slot_mtx);
774 return;826 if (SpuriousRace(old))
775 }827 return;
828 if (!RestoreStack(EventType::kAccessExt, s[1].sid(), s[1].epoch(), addr1,
829 size1, typ1, &tids[1], &traces[1], mset[1], &tags[1])) {
830 StoreShadow(&ctx->last_spurious_race, old.raw());
831 return;
832 }
776833
777 if (IsFiredSuppression(ctx, rep_typ, traces[1]))834 if (IsFiredSuppression(ctx, rep_typ, traces[1]))
778 return;835 return;
779836
780 if (HandleRacyStacks(thr, traces))837 if (HandleRacyStacks(thr, traces))
781 return;838 return;
782839
783 // If any of the accesses has a tag, treat this as an "external" race.840 // If any of the accesses has a tag, treat this as an "external" race.
784 uptr tag = kExternalTagNone;841 uptr tag = kExternalTagNone;
785 for (uptr i = 0; i < kMop; i++) {842 for (uptr i = 0; i < kMop; i++) {
786 if (tags[i] != kExternalTagNone) {843 if (tags[i] != kExternalTagNone) {
787 rep_typ = ReportTypeExternalRace;844 rep_typ = ReportTypeExternalRace;
788 tag = tags[i];845 tag = tags[i];
789 break;846 break;
847 }
790 }848 }
791 }
792849
793 ScopedReport rep(rep_typ, tag);850 new (rep) ScopedReport(rep_typ, tag);
794 for (uptr i = 0; i < kMop; i++)851 for (uptr i = 0; i < kMop; i++)
795 rep.AddMemoryAccess(addr, tags[i], s[i], tids[i], traces[i], mset[i]);852 rep->AddMemoryAccess(addr, tags[i], s[i], tids[i], traces[i], mset[i]);
796853
797 for (uptr i = 0; i < kMop; i++) {854 for (uptr i = 0; i < kMop; i++) {
798 ThreadContext *tctx = static_cast<ThreadContext *>(855 ThreadContext *tctx = static_cast<ThreadContext *>(
799 ctx->thread_registry.GetThreadLocked(tids[i]));856 ctx->thread_registry.GetThreadLocked(tids[i]));
800 rep.AddThread(tctx);857 rep->AddThread(tctx);
801 }858 }
802859
803 rep.AddLocation(addr_min, addr_max - addr_min);860 rep->AddLocation(addr_min, addr_max - addr_min);
804861
805 if (flags()->print_full_thread_history) {862 if (flags()->print_full_thread_history) {
806 const ReportDesc *rep_desc = rep.GetReport();863 const ReportDesc *rep_desc = rep->GetReport();
807 for (uptr i = 0; i < rep_desc->threads.Size(); i++) {864 for (uptr i = 0; i < rep_desc->threads.Size(); i++) {
808 Tid parent_tid = rep_desc->threads[i]->parent_tid;865 Tid parent_tid = rep_desc->threads[i]->parent_tid;
809 if (parent_tid == kMainTid || parent_tid == kInvalidTid)866 if (parent_tid == kMainTid || parent_tid == kInvalidTid)
810 continue;867 continue;
811 ThreadContext *parent_tctx = static_cast<ThreadContext *>(868 ThreadContext *parent_tctx = static_cast<ThreadContext *>(
812 ctx->thread_registry.GetThreadLocked(parent_tid));869 ctx->thread_registry.GetThreadLocked(parent_tid));
813 rep.AddThread(parent_tctx);870 rep->AddThread(parent_tctx);
871 }
814 }872 }
815 }
816873
817#if !SANITIZER_GO874#if !SANITIZER_GO
818 if (!((typ0 | typ1) & kAccessFree) &&875 if (!((typ0 | typ1) & kAccessFree) &&
819 s[1].epoch() <= thr->last_sleep_clock.Get(s[1].sid()))876 s[1].epoch() <= thr->last_sleep_clock.Get(s[1].sid()))
820 rep.AddSleep(thr->last_sleep_stack_id);877 rep->AddSleep(thr->last_sleep_stack_id);
878#endif
879
880#if SANITIZER_APPLE
881 } // Close this scope to release the locks
882#endif
883 OutputReport(thr, *rep);
884
885 // Need to manually destroy this because we used placement new to allocate
886 rep->~ScopedReport();
887#if !SANITIZER_APPLE
888 }
821#endif889#endif
822 OutputReport(thr, rep);
823}890}
824891
825void PrintCurrentStack(ThreadState *thr, uptr pc) {892void PrintCurrentStack(ThreadState *thr, uptr pc) {
lib/libtsan/tsan_rtl_thread.cpp+31-9
...@@ -88,15 +88,33 @@ void ThreadFinalize(ThreadState *thr) {...@@ -88,15 +88,33 @@ void ThreadFinalize(ThreadState *thr) {
88#if !SANITIZER_GO88#if !SANITIZER_GO
89 if (!ShouldReport(thr, ReportTypeThreadLeak))89 if (!ShouldReport(thr, ReportTypeThreadLeak))
90 return;90 return;
91 ThreadRegistryLock l(&ctx->thread_registry);
92 Vector<ThreadLeak> leaks;91 Vector<ThreadLeak> leaks;
93 ctx->thread_registry.RunCallbackForEachThreadLocked(CollectThreadLeaks,92 {
94 &leaks);93 ThreadRegistryLock l(&ctx->thread_registry);
94 ctx->thread_registry.RunCallbackForEachThreadLocked(CollectThreadLeaks,
95 &leaks);
96 }
97
95 for (uptr i = 0; i < leaks.Size(); i++) {98 for (uptr i = 0; i < leaks.Size(); i++) {
96 ScopedReport rep(ReportTypeThreadLeak);99 // Use alloca, because malloc during signal handling deadlocks
97 rep.AddThread(leaks[i].tctx, true);100 ScopedReport *rep = (ScopedReport *)__builtin_alloca(sizeof(ScopedReport));
98 rep.SetCount(leaks[i].count);101 // Take a new scope as Apple platforms require the below locks released
99 OutputReport(thr, rep);102 // before symbolizing in order to avoid a deadlock
103 {
104 ThreadRegistryLock l(&ctx->thread_registry);
105 new (rep) ScopedReport(ReportTypeThreadLeak);
106 rep->AddThread(leaks[i].tctx, true);
107 rep->SetCount(leaks[i].count);
108# if SANITIZER_APPLE
109 } // Close this scope to release the locks
110# endif
111 OutputReport(thr, *rep);
112
113 // Need to manually destroy this because we used placement new to allocate
114 rep->~ScopedReport();
115# if !SANITIZER_APPLE
116 }
117# endif
100 }118 }
101#endif119#endif
102}120}
...@@ -149,7 +167,7 @@ struct OnStartedArgs {...@@ -149,7 +167,7 @@ struct OnStartedArgs {
149 uptr tls_size;167 uptr tls_size;
150};168};
151169
152void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,170void ThreadStart(ThreadState *thr, Tid tid, ThreadID os_id,
153 ThreadType thread_type) {171 ThreadType thread_type) {
154 ctx->thread_registry.StartThread(tid, os_id, thread_type, thr);172 ctx->thread_registry.StartThread(tid, os_id, thread_type, thr);
155 if (!thr->ignore_sync) {173 if (!thr->ignore_sync) {
...@@ -188,10 +206,14 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,...@@ -188,10 +206,14 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
188 }206 }
189#endif207#endif
190208
191#if !SANITIZER_GO209#if !SANITIZER_GO && !SANITIZER_ANDROID
192 // Don't imitate stack/TLS writes for the main thread,210 // Don't imitate stack/TLS writes for the main thread,
193 // because its initialization is synchronized with all211 // because its initialization is synchronized with all
194 // subsequent threads anyway.212 // subsequent threads anyway.
213 // Because thr is created by MmapOrDie, the thr object
214 // is not in tls, the pointer to the thr object is in
215 // TLS_SLOT_SANITIZER slot. So skip this check on
216 // Android platform.
195 if (tid != kMainTid) {217 if (tid != kMainTid) {
196 if (stk_addr && stk_size) {218 if (stk_addr && stk_size) {
197 const uptr pc = StackTrace::GetNextInstructionPc(219 const uptr pc = StackTrace::GetNextInstructionPc(
lib/libtsan/tsan_symbolize.cpp+1-1
...@@ -79,7 +79,7 @@ static void AddFrame(void *ctx, const char *function_name, const char *file,...@@ -79,7 +79,7 @@ static void AddFrame(void *ctx, const char *function_name, const char *file,
79 info->column = column;79 info->column = column;
80}80}
8181
82SymbolizedStack *SymbolizeCode(uptr addr) {82SymbolizedStack* SymbolizeCode(uptr addr, bool leaf) {
83 // Check if PC comes from non-native land.83 // Check if PC comes from non-native land.
84 if (addr & kExternalPCBit) {84 if (addr & kExternalPCBit) {
85 SymbolizedStackBuilder ssb = {nullptr, nullptr, addr};85 SymbolizedStackBuilder ssb = {nullptr, nullptr, addr};
lib/libtsan/tsan_symbolize.h+1-1
...@@ -19,7 +19,7 @@ namespace __tsan {...@@ -19,7 +19,7 @@ namespace __tsan {
1919
20void EnterSymbolizer();20void EnterSymbolizer();
21void ExitSymbolizer();21void ExitSymbolizer();
22SymbolizedStack *SymbolizeCode(uptr addr);22SymbolizedStack* SymbolizeCode(uptr addr, bool leaf);
23ReportLocation *SymbolizeData(uptr addr);23ReportLocation *SymbolizeData(uptr addr);
24void SymbolizeFlush();24void SymbolizeFlush();
2525
lib/libtsan/tsan_trace.h+1-1
...@@ -190,7 +190,7 @@ struct Trace {...@@ -190,7 +190,7 @@ struct Trace {
190 Mutex mtx;190 Mutex mtx;
191 IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;191 IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
192 // First node non-queued into ctx->trace_part_recycle.192 // First node non-queued into ctx->trace_part_recycle.
193 TracePart* local_head;193 TracePart* local_head = nullptr;
194 // Final position in the last part for finished threads.194 // Final position in the last part for finished threads.
195 Event* final_pos = nullptr;195 Event* final_pos = nullptr;
196 // Number of trace parts allocated on behalf of this trace specifically.196 // Number of trace parts allocated on behalf of this trace specifically.
lib/libunwind/include/__libunwind_config.h+11-2
...@@ -73,11 +73,11 @@...@@ -73,11 +73,11 @@
73# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC73# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC
74# elif defined(__aarch64__)74# elif defined(__aarch64__)
75# define _LIBUNWIND_TARGET_AARCH64 175# define _LIBUNWIND_TARGET_AARCH64 1
76# define _LIBUNWIND_CONTEXT_SIZE 6676#define _LIBUNWIND_CONTEXT_SIZE 67
77# if defined(__SEH__)77# if defined(__SEH__)
78# define _LIBUNWIND_CURSOR_SIZE 16478# define _LIBUNWIND_CURSOR_SIZE 164
79# else79# else
80# define _LIBUNWIND_CURSOR_SIZE 7880#define _LIBUNWIND_CURSOR_SIZE 79
81# endif81# endif
82# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM6482# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64
83# elif defined(__arm__)83# elif defined(__arm__)
...@@ -212,4 +212,13 @@...@@ -212,4 +212,13 @@
212# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287212# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
213#endif // _LIBUNWIND_IS_NATIVE_ONLY213#endif // _LIBUNWIND_IS_NATIVE_ONLY
214214
215#if defined(__has_feature)
216# if __has_feature(ptrauth_calls) && __has_feature(ptrauth_returns)
217# define _LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING 1
218# elif __has_feature(ptrauth_calls) != __has_feature(ptrauth_returns)
219# error "Either both or none of ptrauth_calls and ptrauth_returns "\
220 "is allowed to be enabled"
221# endif
222#endif
223
215#endif // ____LIBUNWIND_CONFIG_H__224#endif // ____LIBUNWIND_CONFIG_H__
lib/libunwind/include/libunwind.h+117-11
...@@ -43,6 +43,109 @@...@@ -43,6 +43,109 @@
43 #define LIBUNWIND_AVAIL43 #define LIBUNWIND_AVAIL
44#endif44#endif
4545
46#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
47
48 #include <ptrauth.h>
49
50 // `__ptrauth_restricted_intptr` is a feature of apple clang that predates
51 // support for direct application of `__ptrauth` to integer types. This
52 // guard is necessary to support compilation with those compiler.
53 #if __has_extension(ptrauth_restricted_intptr_qualifier)
54 #define __unwind_ptrauth_restricted_intptr(...) \
55 __ptrauth_restricted_intptr(__VA_ARGS__)
56 #else
57 #define __unwind_ptrauth_restricted_intptr(...) \
58 __ptrauth(__VA_ARGS__)
59 #endif
60
61 // ptrauth_string_discriminator("unw_proc_info_t::handler") == 0x7405
62 #define __ptrauth_unwind_upi_handler_disc 0x7405
63
64 #define __ptrauth_unwind_upi_handler \
65 __ptrauth(ptrauth_key_function_pointer, 1, __ptrauth_unwind_upi_handler_disc)
66
67 #define __ptrauth_unwind_upi_handler_intptr \
68 __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer, 1,\
69 __ptrauth_unwind_upi_handler_disc)
70
71 // ptrauth_string_discriminator("unw_proc_info_t::start_ip") == 0xCA2C
72 #define __ptrauth_unwind_upi_startip \
73 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_independent_code, 1, 0xCA2C)
74
75 // ptrauth_string_discriminator("unw_proc_info_t::end_ip") == 0xE183
76 #define __ptrauth_unwind_upi_endip \
77 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_independent_code, 1, 0xE183)
78
79 // ptrauth_string_discriminator("unw_proc_info_t::lsda") == 0x83DE
80 #define __ptrauth_unwind_upi_lsda \
81 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x83DE)
82
83 // ptrauth_string_discriminator("unw_proc_info_t::flags") == 0x79A1
84 #define __ptrauth_unwind_upi_flags \
85 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x79A1)
86
87 // ptrauth_string_discriminator("unw_proc_info_t::unwind_info") == 0xC20C
88 #define __ptrauth_unwind_upi_info \
89 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0xC20C)
90
91 // ptrauth_string_discriminator("unw_proc_info_t::extra") == 0x03DF
92 #define __ptrauth_unwind_upi_extra \
93 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x03DF)
94
95 // ptrauth_string_discriminator("Registers_arm64::link_reg_t") == 0x8301
96 #define __ptrauth_unwind_registers_arm64_link_reg \
97 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_code, 1, 0x8301)
98
99 // ptrauth_string_discriminator("UnwindInfoSections::dso_base") == 0x4FF5
100 #define __ptrauth_unwind_uis_dso_base \
101 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x4FF5)
102
103 // ptrauth_string_discriminator("UnwindInfoSections::dwarf_section") == 0x4974
104 #define __ptrauth_unwind_uis_dwarf_section \
105 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x4974)
106
107 // ptrauth_string_discriminator("UnwindInfoSections::dwarf_section_length") == 0x2A9A
108 #define __ptrauth_unwind_uis_dwarf_section_length \
109 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x2A9A)
110
111 // ptrauth_string_discriminator("UnwindInfoSections::compact_unwind_section") == 0xA27B
112 #define __ptrauth_unwind_uis_compact_unwind_section \
113 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0xA27B)
114
115 // ptrauth_string_discriminator("UnwindInfoSections::compact_unwind_section_length") == 0x5D0A
116 #define __ptrauth_unwind_uis_compact_unwind_section_length \
117 __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x5D0A)
118
119 // ptrauth_string_discriminator("CIE_Info::personality") == 0x6A40
120 #define __ptrauth_unwind_cie_info_personality_disc 0x6A40
121 #define __ptrauth_unwind_cie_info_personality \
122 __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer, 1, \
123 __ptrauth_unwind_cie_info_personality_disc)
124
125 // ptrauth_string_discriminator("personality") == 0x7EAD)
126 #define __ptrauth_unwind_pauthtest_personality_disc 0x7EAD
127
128#else
129
130 #define __unwind_ptrauth_restricted_intptr(...)
131 #define __ptrauth_unwind_upi_handler
132 #define __ptrauth_unwind_upi_handler_intptr
133 #define __ptrauth_unwind_upi_startip
134 #define __ptrauth_unwind_upi_endip
135 #define __ptrauth_unwind_upi_lsda
136 #define __ptrauth_unwind_upi_flags
137 #define __ptrauth_unwind_upi_info
138 #define __ptrauth_unwind_upi_extra
139 #define __ptrauth_unwind_registers_arm64_link_reg
140 #define __ptrauth_unwind_uis_dso_base
141 #define __ptrauth_unwind_uis_dwarf_section
142 #define __ptrauth_unwind_uis_dwarf_section_length
143 #define __ptrauth_unwind_uis_compact_unwind_section
144 #define __ptrauth_unwind_uis_compact_unwind_section_length
145 #define __ptrauth_unwind_cie_info_personality
146
147#endif
148
46#if defined(_WIN32) && defined(__SEH__)149#if defined(_WIN32) && defined(__SEH__)
47 #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16)))150 #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16)))
48#else151#else
...@@ -88,17 +191,18 @@ typedef double unw_fpreg_t;...@@ -88,17 +191,18 @@ typedef double unw_fpreg_t;
88#endif191#endif
89192
90struct unw_proc_info_t {193struct unw_proc_info_t {
91 unw_word_t start_ip; /* start address of function */194 unw_word_t __ptrauth_unwind_upi_startip start_ip; /* start address of function */
92 unw_word_t end_ip; /* address after end of function */195 unw_word_t __ptrauth_unwind_upi_endip end_ip; /* address after end of function */
93 unw_word_t lsda; /* address of language specific data area, */196 unw_word_t __ptrauth_unwind_upi_lsda lsda; /* address of language specific data area, */
94 /* or zero if not used */197 /* or zero if not used */
95 unw_word_t handler; /* personality routine, or zero if not used */198
96 unw_word_t gp; /* not used */199 unw_word_t __ptrauth_unwind_upi_handler_intptr handler;
97 unw_word_t flags; /* not used */200 unw_word_t gp; /* not used */
98 uint32_t format; /* compact unwind encoding, or zero if none */201 unw_word_t __ptrauth_unwind_upi_flags flags; /* not used */
99 uint32_t unwind_info_size; /* size of DWARF unwind info, or zero if none */202 uint32_t format; /* compact unwind encoding, or zero if none */
100 unw_word_t unwind_info; /* address of DWARF unwind info, or zero */203 uint32_t unwind_info_size; /* size of DWARF unwind info, or zero if none */
101 unw_word_t extra; /* mach_header of mach-o image containing func */204 unw_word_t __ptrauth_unwind_upi_info unwind_info; /* address of DWARF unwind info, or zero */
205 unw_word_t __ptrauth_unwind_upi_extra extra; /* mach_header of mach-o image containing func */
102};206};
103typedef struct unw_proc_info_t unw_proc_info_t;207typedef struct unw_proc_info_t unw_proc_info_t;
104208
...@@ -130,6 +234,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;...@@ -130,6 +234,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
130extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL;234extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL;
131extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;235extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;
132//extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);236//extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);
237extern const char *unw_strerror(int) LIBUNWIND_AVAIL;
133238
134extern unw_addr_space_t unw_local_addr_space;239extern unw_addr_space_t unw_local_addr_space;
135240
...@@ -532,6 +637,7 @@ enum {...@@ -532,6 +637,7 @@ enum {
532 UNW_AARCH64_X31 = 31,637 UNW_AARCH64_X31 = 31,
533 UNW_AARCH64_SP = 31,638 UNW_AARCH64_SP = 31,
534 UNW_AARCH64_PC = 32,639 UNW_AARCH64_PC = 32,
640 UNW_AARCH64_VG = 46,
535641
536 // reserved block642 // reserved block
537 UNW_AARCH64_RA_SIGN_STATE = 34,643 UNW_AARCH64_RA_SIGN_STATE = 34,
lib/libunwind/include/unwind_arm_ehabi.h+4-1
...@@ -125,8 +125,11 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,...@@ -125,8 +125,11 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
125 uint32_t discriminator,125 uint32_t discriminator,
126 _Unwind_VRS_DataRepresentation representation);126 _Unwind_VRS_DataRepresentation representation);
127127
128extern _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception *,
129 _Unwind_Context *);
130
128#if defined(_LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE)131#if defined(_LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE)
129#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 extern132#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 extern __inline__
130#else133#else
131#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 static __inline__134#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 static __inline__
132#endif135#endif
lib/libunwind/src/AddressSpace.hpp+40-19
...@@ -129,22 +129,27 @@ struct UnwindInfoSections {...@@ -129,22 +129,27 @@ struct UnwindInfoSections {
129 defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) || \129 defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) || \
130 defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)130 defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
131 // No dso_base for SEH.131 // No dso_base for SEH.
132 uintptr_t dso_base;132 uintptr_t __ptrauth_unwind_uis_dso_base
133 dso_base = 0;
133#endif134#endif
134#if defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)135#if defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
135 size_t text_segment_length;136 size_t text_segment_length;
136#endif137#endif
137#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)138#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
138 uintptr_t dwarf_section;139 uintptr_t __ptrauth_unwind_uis_dwarf_section
139 size_t dwarf_section_length;140 dwarf_section = 0;
141 size_t __ptrauth_unwind_uis_dwarf_section_length
142 dwarf_section_length = 0;
140#endif143#endif
141#if defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)144#if defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)
142 uintptr_t dwarf_index_section;145 uintptr_t dwarf_index_section;
143 size_t dwarf_index_section_length;146 size_t dwarf_index_section_length;
144#endif147#endif
145#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)148#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
146 uintptr_t compact_unwind_section;149 uintptr_t __ptrauth_unwind_uis_compact_unwind_section
147 size_t compact_unwind_section_length;150 compact_unwind_section = 0;
151 size_t __ptrauth_unwind_uis_compact_unwind_section_length
152 compact_unwind_section_length = 0;
148#endif153#endif
149#if defined(_LIBUNWIND_ARM_EHABI)154#if defined(_LIBUNWIND_ARM_EHABI)
150 uintptr_t arm_section;155 uintptr_t arm_section;
...@@ -196,11 +201,16 @@ public:...@@ -196,11 +201,16 @@ public:
196 static int64_t getSLEB128(pint_t &addr, pint_t end);201 static int64_t getSLEB128(pint_t &addr, pint_t end);
197202
198 pint_t getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,203 pint_t getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,
199 pint_t datarelBase = 0);204 pint_t datarelBase = 0, pint_t *resultAddr = nullptr);
200 bool findFunctionName(pint_t addr, char *buf, size_t bufLen,205 template <typename R>
201 unw_word_t *offset);206 bool findFunctionName(typename R::link_hardened_reg_arg_t addr, char *buf,
202 bool findUnwindSections(pint_t targetAddr, UnwindInfoSections &info);207 size_t bufLen, unw_word_t *offset);
203 bool findOtherFDE(pint_t targetAddr, pint_t &fde);208 template <typename R>
209 bool findUnwindSections(typename R::link_hardened_reg_arg_t targetAddr,
210 UnwindInfoSections &info);
211 template <typename R>
212 bool findOtherFDE(typename R::link_hardened_reg_arg_t targetAddr,
213 pint_t &fde);
204214
205 static LocalAddressSpace sThisAddressSpace;215 static LocalAddressSpace sThisAddressSpace;
206};216};
...@@ -269,7 +279,7 @@ inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {...@@ -269,7 +279,7 @@ inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {
269279
270inline LocalAddressSpace::pint_t280inline LocalAddressSpace::pint_t
271LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,281LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,
272 pint_t datarelBase) {282 pint_t datarelBase, pint_t *resultAddr) {
273 pint_t startAddr = addr;283 pint_t startAddr = addr;
274 const uint8_t *p = (uint8_t *)addr;284 const uint8_t *p = (uint8_t *)addr;
275 pint_t result;285 pint_t result;
...@@ -353,8 +363,14 @@ LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,...@@ -353,8 +363,14 @@ LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,
353 break;363 break;
354 }364 }
355365
356 if (encoding & DW_EH_PE_indirect)366 if (encoding & DW_EH_PE_indirect) {
367 if (resultAddr)
368 *resultAddr = result;
357 result = getP(result);369 result = getP(result);
370 } else {
371 if (resultAddr)
372 *resultAddr = startAddr;
373 }
358374
359 return result;375 return result;
360}376}
...@@ -486,9 +502,9 @@ static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo,...@@ -486,9 +502,9 @@ static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo,
486502
487#endif // defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)503#endif // defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
488504
489505template <typename R>
490inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,506inline bool LocalAddressSpace::findUnwindSections(
491 UnwindInfoSections &info) {507 typename R::link_hardened_reg_arg_t targetAddr, UnwindInfoSections &info) {
492#ifdef __APPLE__508#ifdef __APPLE__
493 dyld_unwind_sections dyldInfo;509 dyld_unwind_sections dyldInfo;
494 if (_dyld_find_unwind_sections((void *)targetAddr, &dyldInfo)) {510 if (_dyld_find_unwind_sections((void *)targetAddr, &dyldInfo)) {
...@@ -658,16 +674,21 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,...@@ -658,16 +674,21 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
658 return false;674 return false;
659}675}
660676
661inline bool LocalAddressSpace::findOtherFDE(pint_t targetAddr, pint_t &fde) {677template <typename R>
678inline bool
679LocalAddressSpace::findOtherFDE(typename R::link_hardened_reg_arg_t targetAddr,
680 pint_t &fde) {
662 // TO DO: if OS has way to dynamically register FDEs, check that.681 // TO DO: if OS has way to dynamically register FDEs, check that.
663 (void)targetAddr;682 (void)targetAddr;
664 (void)fde;683 (void)fde;
665 return false;684 return false;
666}685}
667686
668inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf,687template <typename R>
669 size_t bufLen,688inline bool
670 unw_word_t *offset) {689LocalAddressSpace::findFunctionName(typename R::link_hardened_reg_arg_t addr,
690 char *buf, size_t bufLen,
691 unw_word_t *offset) {
671#if _LIBUNWIND_USE_DLADDR692#if _LIBUNWIND_USE_DLADDR
672 Dl_info dyldInfo;693 Dl_info dyldInfo;
673 if (dladdr((void *)addr, &dyldInfo)) {694 if (dladdr((void *)addr, &dyldInfo)) {
lib/libunwind/src/CompactUnwinder.hpp+16-5
...@@ -601,11 +601,17 @@ int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrameless(...@@ -601,11 +601,17 @@ int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrameless(
601 savedRegisterLoc -= 8;601 savedRegisterLoc -= 8;
602 }602 }
603603
604 // We load the link register prior to setting the new SP as the authentication
605 // schema for LR entangles the SP of the old frame into the diversifier.
606 Registers_arm64::reg_t linkRegister = registers.getRegister(UNW_AARCH64_LR);
607
604 // subtract stack size off of sp608 // subtract stack size off of sp
605 registers.setSP(savedRegisterLoc);609 registers.setSP(savedRegisterLoc);
606610
607 // set pc to be value in lr611 // Set pc to be value in lr. This needs to be performed after the new SP has
608 registers.setIP(registers.getRegister(UNW_AARCH64_LR));612 // been set, as the PC authentication schema entangles the SP of the new
613 // frame.
614 registers.setIP(linkRegister);
609615
610 return UNW_STEP_SUCCESS;616 return UNW_STEP_SUCCESS;
611}617}
...@@ -614,7 +620,7 @@ template <typename A>...@@ -614,7 +620,7 @@ template <typename A>
614int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrame(620int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrame(
615 compact_unwind_encoding_t encoding, uint64_t, A &addressSpace,621 compact_unwind_encoding_t encoding, uint64_t, A &addressSpace,
616 Registers_arm64 &registers) {622 Registers_arm64 &registers) {
617 uint64_t savedRegisterLoc = registers.getFP() - 8;623 Registers_arm64::reg_t savedRegisterLoc = registers.getFP() - 8;
618624
619 if (encoding & UNWIND_ARM64_FRAME_X19_X20_PAIR) {625 if (encoding & UNWIND_ARM64_FRAME_X19_X20_PAIR) {
620 registers.setRegister(UNW_AARCH64_X19, addressSpace.get64(savedRegisterLoc));626 registers.setRegister(UNW_AARCH64_X19, addressSpace.get64(savedRegisterLoc));
...@@ -680,11 +686,16 @@ int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrame(...@@ -680,11 +686,16 @@ int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrame(
680 savedRegisterLoc -= 8;686 savedRegisterLoc -= 8;
681 }687 }
682688
683 uint64_t fp = registers.getFP();689 Registers_arm64::reg_t fp = registers.getFP();
690
684 // fp points to old fp691 // fp points to old fp
685 registers.setFP(addressSpace.get64(fp));692 registers.setFP(addressSpace.get64(fp));
686 // old sp is fp less saved fp and lr693
694 // Old sp is fp less saved fp and lr. We need to set this prior to setting
695 // the lr as the pointer authentication schema for the lr incorporates the
696 // sp as part of the diversifier.
687 registers.setSP(fp + 16);697 registers.setSP(fp + 16);
698
688 // pop return address into pc699 // pop return address into pc
689 registers.setIP(addressSpace.get64(fp + 8));700 registers.setIP(addressSpace.get64(fp + 8));
690701
lib/libunwind/src/DwarfInstructions.hpp+24-13
...@@ -22,7 +22,6 @@...@@ -22,7 +22,6 @@
22#include "dwarf2.h"22#include "dwarf2.h"
23#include "libunwind_ext.h"23#include "libunwind_ext.h"
2424
25
26namespace libunwind {25namespace libunwind {
2726
2827
...@@ -34,8 +33,10 @@ public:...@@ -34,8 +33,10 @@ public:
34 typedef typename A::pint_t pint_t;33 typedef typename A::pint_t pint_t;
35 typedef typename A::sint_t sint_t;34 typedef typename A::sint_t sint_t;
3635
37 static int stepWithDwarf(A &addressSpace, pint_t pc, pint_t fdeStart,36 static int stepWithDwarf(A &addressSpace,
38 R &registers, bool &isSignalFrame, bool stage2);37 typename R::link_hardened_reg_arg_t pc,
38 pint_t fdeStart, R &registers, bool &isSignalFrame,
39 bool stage2);
3940
40private:41private:
4142
...@@ -64,9 +65,10 @@ private:...@@ -64,9 +65,10 @@ private:
6465
65 static pint_t getCFA(A &addressSpace, const PrologInfo &prolog,66 static pint_t getCFA(A &addressSpace, const PrologInfo &prolog,
66 const R &registers) {67 const R &registers) {
67 if (prolog.cfaRegister != 0)68 if (prolog.cfaRegister != 0) {
68 return (pint_t)((sint_t)registers.getRegister((int)prolog.cfaRegister) +69 uintptr_t cfaRegister = registers.getRegister((int)prolog.cfaRegister);
69 prolog.cfaRegisterOffset);70 return (pint_t)(cfaRegister + prolog.cfaRegisterOffset);
71 }
70 if (prolog.cfaExpression != 0)72 if (prolog.cfaExpression != 0)
71 return evaluateExpression((pint_t)prolog.cfaExpression, addressSpace,73 return evaluateExpression((pint_t)prolog.cfaExpression, addressSpace,
72 registers, 0);74 registers, 0);
...@@ -207,16 +209,16 @@ bool DwarfInstructions<A, R>::isReturnAddressSignedWithPC(A &addressSpace,...@@ -207,16 +209,16 @@ bool DwarfInstructions<A, R>::isReturnAddressSignedWithPC(A &addressSpace,
207#endif209#endif
208210
209template <typename A, typename R>211template <typename A, typename R>
210int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,212int DwarfInstructions<A, R>::stepWithDwarf(
211 pint_t fdeStart, R &registers,213 A &addressSpace, typename R::link_hardened_reg_arg_t pc, pint_t fdeStart,
212 bool &isSignalFrame, bool stage2) {214 R &registers, bool &isSignalFrame, bool stage2) {
213 FDE_Info fdeInfo;215 FDE_Info fdeInfo;
214 CIE_Info cieInfo;216 CIE_Info cieInfo;
215 if (CFI_Parser<A>::decodeFDE(addressSpace, fdeStart, &fdeInfo,217 if (CFI_Parser<A>::decodeFDE(addressSpace, fdeStart, &fdeInfo,
216 &cieInfo) == NULL) {218 &cieInfo) == NULL) {
217 PrologInfo prolog;219 PrologInfo prolog;
218 if (CFI_Parser<A>::parseFDEInstructions(addressSpace, fdeInfo, cieInfo, pc,220 if (CFI_Parser<A>::template parseFDEInstructions<R>(
219 R::getArch(), &prolog)) {221 addressSpace, fdeInfo, cieInfo, pc, R::getArch(), &prolog)) {
220 // get pointer to cfa (architecture specific)222 // get pointer to cfa (architecture specific)
221 pint_t cfa = getCFA(addressSpace, prolog, registers);223 pint_t cfa = getCFA(addressSpace, prolog, registers);
222224
...@@ -264,7 +266,7 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,...@@ -264,7 +266,7 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,
264 // by a CFI directive later on.266 // by a CFI directive later on.
265 newRegisters.setSP(cfa);267 newRegisters.setSP(cfa);
266268
267 pint_t returnAddress = 0;269 typename R::reg_t returnAddress = 0;
268 constexpr int lastReg = R::lastDwarfRegNum();270 constexpr int lastReg = R::lastDwarfRegNum();
269 static_assert(static_cast<int>(CFI_Parser<A>::kMaxRegisterNumber) >=271 static_assert(static_cast<int>(CFI_Parser<A>::kMaxRegisterNumber) >=
270 lastReg,272 lastReg,
...@@ -300,7 +302,16 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,...@@ -300,7 +302,16 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,
300302
301 isSignalFrame = cieInfo.isSignalFrame;303 isSignalFrame = cieInfo.isSignalFrame;
302304
303#if defined(_LIBUNWIND_TARGET_AARCH64)305#if defined(_LIBUNWIND_TARGET_AARCH64) && \
306 !defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
307 // There are two ways of return address signing: pac-ret (enabled via
308 // -mbranch-protection=pac-ret) and ptrauth-returns (enabled as part of
309 // Apple's arm64e or experimental pauthtest ABI on Linux). The code
310 // below handles signed RA for pac-ret, while ptrauth-returns uses
311 // different logic.
312 // TODO: unify logic for both cases, see
313 // https://github.com/llvm/llvm-project/issues/160110
314 //
304 // If the target is aarch64 then the return address may have been signed315 // If the target is aarch64 then the return address may have been signed
305 // using the v8.3 pointer authentication extensions. The original316 // using the v8.3 pointer authentication extensions. The original
306 // return address needs to be authenticated before the return address is317 // return address needs to be authenticated before the return address is
lib/libunwind/src/DwarfParser.hpp+60-22
...@@ -23,6 +23,10 @@...@@ -23,6 +23,10 @@
2323
24#include "config.h"24#include "config.h"
2525
26#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
27#include <ptrauth.h>
28#endif
29
26namespace libunwind {30namespace libunwind {
2731
28/// CFI_Parser does basic parsing of a CFI (Call Frame Information) records.32/// CFI_Parser does basic parsing of a CFI (Call Frame Information) records.
...@@ -33,6 +37,7 @@ template <typename A>...@@ -33,6 +37,7 @@ template <typename A>
33class CFI_Parser {37class CFI_Parser {
34public:38public:
35 typedef typename A::pint_t pint_t;39 typedef typename A::pint_t pint_t;
40 typedef pint_t __ptrauth_unwind_cie_info_personality personality_t;
3641
37 /// Information encoded in a CIE (Common Information Entry)42 /// Information encoded in a CIE (Common Information Entry)
38 struct CIE_Info {43 struct CIE_Info {
...@@ -43,7 +48,7 @@ public:...@@ -43,7 +48,7 @@ public:
43 uint8_t lsdaEncoding;48 uint8_t lsdaEncoding;
44 uint8_t personalityEncoding;49 uint8_t personalityEncoding;
45 uint8_t personalityOffsetInCIE;50 uint8_t personalityOffsetInCIE;
46 pint_t personality;51 personality_t personality;
47 uint32_t codeAlignFactor;52 uint32_t codeAlignFactor;
48 int dataAlignFactor;53 int dataAlignFactor;
49 bool isSignalFrame;54 bool isSignalFrame;
...@@ -155,14 +160,17 @@ public:...@@ -155,14 +160,17 @@ public:
155 }160 }
156 };161 };
157162
158 static bool findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,163 template <typename R>
159 size_t sectionLength, pint_t fdeHint, FDE_Info *fdeInfo,164 static bool findFDE(A &addressSpace, typename R::link_hardened_reg_arg_t pc,
160 CIE_Info *cieInfo);165 pint_t ehSectionStart, size_t sectionLength,
166 pint_t fdeHint, FDE_Info *fdeInfo, CIE_Info *cieInfo);
161 static const char *decodeFDE(A &addressSpace, pint_t fdeStart,167 static const char *decodeFDE(A &addressSpace, pint_t fdeStart,
162 FDE_Info *fdeInfo, CIE_Info *cieInfo,168 FDE_Info *fdeInfo, CIE_Info *cieInfo,
163 bool useCIEInfo = false);169 bool useCIEInfo = false);
170 template <typename R>
164 static bool parseFDEInstructions(A &addressSpace, const FDE_Info &fdeInfo,171 static bool parseFDEInstructions(A &addressSpace, const FDE_Info &fdeInfo,
165 const CIE_Info &cieInfo, pint_t upToPC,172 const CIE_Info &cieInfo,
173 typename R::link_hardened_reg_arg_t upToPC,
166 int arch, PrologInfo *results);174 int arch, PrologInfo *results);
167175
168 static const char *parseCIE(A &addressSpace, pint_t cie, CIE_Info *cieInfo);176 static const char *parseCIE(A &addressSpace, pint_t cie, CIE_Info *cieInfo);
...@@ -234,9 +242,12 @@ const char *CFI_Parser<A>::decodeFDE(A &addressSpace, pint_t fdeStart,...@@ -234,9 +242,12 @@ const char *CFI_Parser<A>::decodeFDE(A &addressSpace, pint_t fdeStart,
234242
235/// Scan an eh_frame section to find an FDE for a pc243/// Scan an eh_frame section to find an FDE for a pc
236template <typename A>244template <typename A>
237bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,245template <typename R>
238 size_t sectionLength, pint_t fdeHint,246bool CFI_Parser<A>::findFDE(A &addressSpace,
239 FDE_Info *fdeInfo, CIE_Info *cieInfo) {247 typename R::link_hardened_reg_arg_t pc,
248 pint_t ehSectionStart, size_t sectionLength,
249 pint_t fdeHint, FDE_Info *fdeInfo,
250 CIE_Info *cieInfo) {
240 //fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc);251 //fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc);
241 pint_t p = (fdeHint != 0) ? fdeHint : ehSectionStart;252 pint_t p = (fdeHint != 0) ? fdeHint : ehSectionStart;
242 const pint_t ehSectionEnd = (sectionLength == SIZE_MAX)253 const pint_t ehSectionEnd = (sectionLength == SIZE_MAX)
...@@ -273,7 +284,7 @@ bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,...@@ -273,7 +284,7 @@ bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,
273 pint_t pcRange = addressSpace.getEncodedP(284 pint_t pcRange = addressSpace.getEncodedP(
274 p, nextCFI, cieInfo->pointerEncoding & 0x0F);285 p, nextCFI, cieInfo->pointerEncoding & 0x0F);
275 // Test if pc is within the function this FDE covers.286 // Test if pc is within the function this FDE covers.
276 if ((pcStart < pc) && (pc <= pcStart + pcRange)) {287 if ((pcStart <= pc) && (pc < pcStart + pcRange)) {
277 // parse rest of info288 // parse rest of info
278 fdeInfo->lsda = 0;289 fdeInfo->lsda = 0;
279 // check for augmentation length290 // check for augmentation length
...@@ -369,6 +380,7 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,...@@ -369,6 +380,7 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,
369 cieInfo->returnAddressRegister = (uint8_t)raReg;380 cieInfo->returnAddressRegister = (uint8_t)raReg;
370 // parse augmentation data based on augmentation string381 // parse augmentation data based on augmentation string
371 const char *result = NULL;382 const char *result = NULL;
383 pint_t resultAddr = 0;
372 if (addressSpace.get8(strStart) == 'z') {384 if (addressSpace.get8(strStart) == 'z') {
373 // parse augmentation data length385 // parse augmentation data length
374 addressSpace.getULEB128(p, cieContentEnd);386 addressSpace.getULEB128(p, cieContentEnd);
...@@ -377,13 +389,41 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,...@@ -377,13 +389,41 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,
377 case 'z':389 case 'z':
378 cieInfo->fdesHaveAugmentationData = true;390 cieInfo->fdesHaveAugmentationData = true;
379 break;391 break;
380 case 'P':392 case 'P': {
381 cieInfo->personalityEncoding = addressSpace.get8(p);393 cieInfo->personalityEncoding = addressSpace.get8(p);
382 ++p;394 ++p;
383 cieInfo->personalityOffsetInCIE = (uint8_t)(p - cie);395 cieInfo->personalityOffsetInCIE = (uint8_t)(p - cie);
384 cieInfo->personality = addressSpace396 pint_t personality = addressSpace.getEncodedP(
385 .getEncodedP(p, cieContentEnd, cieInfo->personalityEncoding);397 p, cieContentEnd, cieInfo->personalityEncoding,
398 /*datarelBase=*/0, &resultAddr);
399#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
400 if (personality) {
401 // The GOT for the personality function was signed address
402 // authenticated. Manually re-sign with the CIE_Info::personality
403 // schema. If we could guarantee the encoding of the personality we
404 // could avoid this by simply giving resultAddr the correct ptrauth
405 // schema and performing an assignment.
406#if defined(__arm64e__)
407 const auto oldDiscriminator = resultAddr;
408#else
409 const auto oldDiscriminator = ptrauth_blend_discriminator(
410 (void *)resultAddr, __ptrauth_unwind_pauthtest_personality_disc);
411#endif
412 const auto discriminator = ptrauth_blend_discriminator(
413 &cieInfo->personality,
414 __ptrauth_unwind_cie_info_personality_disc);
415 void *signedPtr = ptrauth_auth_and_resign(
416 (void *)personality, ptrauth_key_function_pointer,
417 oldDiscriminator, ptrauth_key_function_pointer, discriminator);
418 personality = (pint_t)signedPtr;
419 }
420#endif
421 // We use memmove to set the CIE personality as we have already
422 // re-signed the pointer to the correct schema.
423 memmove((void *)&cieInfo->personality, (void *)&personality,
424 sizeof(personality));
386 break;425 break;
426 }
387 case 'L':427 case 'L':
388 cieInfo->lsdaEncoding = addressSpace.get8(p);428 cieInfo->lsdaEncoding = addressSpace.get8(p);
389 ++p;429 ++p;
...@@ -417,10 +457,10 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,...@@ -417,10 +457,10 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,
417457
418/// "run" the DWARF instructions and create the abstract PrologInfo for an FDE458/// "run" the DWARF instructions and create the abstract PrologInfo for an FDE
419template <typename A>459template <typename A>
420bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,460template <typename R>
421 const FDE_Info &fdeInfo,461bool CFI_Parser<A>::parseFDEInstructions(
422 const CIE_Info &cieInfo, pint_t upToPC,462 A &addressSpace, const FDE_Info &fdeInfo, const CIE_Info &cieInfo,
423 int arch, PrologInfo *results) {463 typename R::link_hardened_reg_arg_t upToPC, int arch, PrologInfo *results) {
424 // Alloca is used for the allocation of the rememberStack entries. It removes464 // Alloca is used for the allocation of the rememberStack entries. It removes
425 // the dependency on new/malloc but the below for loop can not be refactored465 // the dependency on new/malloc but the below for loop can not be refactored
426 // into functions. Entry could be saved during the processing of a CIE and466 // into functions. Entry could be saved during the processing of a CIE and
...@@ -808,12 +848,10 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,...@@ -808,12 +848,10 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
808 results->savedRegisters[UNW_AARCH64_RA_SIGN_STATE].value ^ 0x3;848 results->savedRegisters[UNW_AARCH64_RA_SIGN_STATE].value ^ 0x3;
809 results->setRegisterValue(UNW_AARCH64_RA_SIGN_STATE, value,849 results->setRegisterValue(UNW_AARCH64_RA_SIGN_STATE, value,
810 initialState);850 initialState);
811 // When calculating the value of the PC, it is assumed that the CFI851 // When using Feat_PAuthLR, the PC value needs to be captured so that
812 // instruction is placed before the signing instruction, however it is852 // during unwinding, the correct PC value is used for re-authentication.
813 // placed after. Because of this, we need to take into account the CFI853 // It is assumed that the CFI is placed before the signing instruction.
814 // instruction is one instruction call later than expected, and reduce854 results->ptrAuthDiversifier = fdeInfo.pcStart + codeOffset;
815 // the PC value by 4 bytes to compensate.
816 results->ptrAuthDiversifier = fdeInfo.pcStart + codeOffset - 0x4;
817 _LIBUNWIND_TRACE_DWARF(855 _LIBUNWIND_TRACE_DWARF(
818 "DW_CFA_AARCH64_negate_ra_state_with_pc(pc=0x%" PRIx64 ")\n",856 "DW_CFA_AARCH64_negate_ra_state_with_pc(pc=0x%" PRIx64 ")\n",
819 static_cast<uint64_t>(results->ptrAuthDiversifier));857 static_cast<uint64_t>(results->ptrAuthDiversifier));
lib/libunwind/src/EHHeaderParser.hpp+7-4
...@@ -37,8 +37,9 @@ public:...@@ -37,8 +37,9 @@ public:
3737
38 static bool decodeEHHdr(A &addressSpace, pint_t ehHdrStart, pint_t ehHdrEnd,38 static bool decodeEHHdr(A &addressSpace, pint_t ehHdrStart, pint_t ehHdrEnd,
39 EHHeaderInfo &ehHdrInfo);39 EHHeaderInfo &ehHdrInfo);
40 static bool findFDE(A &addressSpace, pint_t pc, pint_t ehHdrStart,40 template <typename R>
41 uint32_t sectionLength,41 static bool findFDE(A &addressSpace, typename R::link_hardened_reg_arg_t pc,
42 pint_t ehHdrStart, uint32_t sectionLength,
42 typename CFI_Parser<A>::FDE_Info *fdeInfo,43 typename CFI_Parser<A>::FDE_Info *fdeInfo,
43 typename CFI_Parser<A>::CIE_Info *cieInfo);44 typename CFI_Parser<A>::CIE_Info *cieInfo);
4445
...@@ -112,8 +113,10 @@ bool EHHeaderParser<A>::decodeTableEntry(...@@ -112,8 +113,10 @@ bool EHHeaderParser<A>::decodeTableEntry(
112}113}
113114
114template <typename A>115template <typename A>
115bool EHHeaderParser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehHdrStart,116template <typename R>
116 uint32_t sectionLength,117bool EHHeaderParser<A>::findFDE(A &addressSpace,
118 typename R::link_hardened_reg_arg_t pc,
119 pint_t ehHdrStart, uint32_t sectionLength,
117 typename CFI_Parser<A>::FDE_Info *fdeInfo,120 typename CFI_Parser<A>::FDE_Info *fdeInfo,
118 typename CFI_Parser<A>::CIE_Info *cieInfo) {121 typename CFI_Parser<A>::CIE_Info *cieInfo) {
119 pint_t ehHdrEnd = ehHdrStart + sectionLength;122 pint_t ehHdrEnd = ehHdrStart + sectionLength;
lib/libunwind/src/Registers.hpp+226-22
...@@ -17,8 +17,13 @@...@@ -17,8 +17,13 @@
1717
18#include "config.h"18#include "config.h"
19#include "libunwind.h"19#include "libunwind.h"
20#include "libunwind_ext.h"
20#include "shadow_stack_unwind.h"21#include "shadow_stack_unwind.h"
2122
23#if defined(_LIBUNWIND_HAVE_GETAUXVAL) || defined(_LIBUNWIND_HAVE_ELF_AUX_INFO)
24#include <sys/auxv.h>
25#endif
26
22namespace libunwind {27namespace libunwind {
2328
24// For emulating 128-bit registers29// For emulating 128-bit registers
...@@ -60,6 +65,10 @@ public:...@@ -60,6 +65,10 @@ public:
60 Registers_x86();65 Registers_x86();
61 Registers_x86(const void *registers);66 Registers_x86(const void *registers);
6267
68 typedef uint32_t reg_t;
69 typedef uint32_t link_reg_t;
70 typedef const link_reg_t &link_hardened_reg_arg_t;
71
63 bool validRegister(int num) const;72 bool validRegister(int num) const;
64 uint32_t getRegister(int num) const;73 uint32_t getRegister(int num) const;
65 void setRegister(int num, uint32_t value);74 void setRegister(int num, uint32_t value);
...@@ -278,6 +287,10 @@ public:...@@ -278,6 +287,10 @@ public:
278 Registers_x86_64();287 Registers_x86_64();
279 Registers_x86_64(const void *registers);288 Registers_x86_64(const void *registers);
280289
290 typedef uint64_t reg_t;
291 typedef uint64_t link_reg_t;
292 typedef const link_reg_t &link_hardened_reg_arg_t;
293
281 bool validRegister(int num) const;294 bool validRegister(int num) const;
282 uint64_t getRegister(int num) const;295 uint64_t getRegister(int num) const;
283 void setRegister(int num, uint64_t value);296 void setRegister(int num, uint64_t value);
...@@ -597,6 +610,10 @@ public:...@@ -597,6 +610,10 @@ public:
597 Registers_ppc();610 Registers_ppc();
598 Registers_ppc(const void *registers);611 Registers_ppc(const void *registers);
599612
613 typedef uint32_t reg_t;
614 typedef uint32_t link_reg_t;
615 typedef const link_reg_t &link_hardened_reg_arg_t;
616
600 bool validRegister(int num) const;617 bool validRegister(int num) const;
601 uint32_t getRegister(int num) const;618 uint32_t getRegister(int num) const;
602 void setRegister(int num, uint32_t value);619 void setRegister(int num, uint32_t value);
...@@ -1169,6 +1186,10 @@ public:...@@ -1169,6 +1186,10 @@ public:
1169 Registers_ppc64();1186 Registers_ppc64();
1170 Registers_ppc64(const void *registers);1187 Registers_ppc64(const void *registers);
11711188
1189 typedef uint64_t reg_t;
1190 typedef uint64_t link_reg_t;
1191 typedef const link_reg_t &link_hardened_reg_arg_t;
1192
1172 bool validRegister(int num) const;1193 bool validRegister(int num) const;
1173 uint64_t getRegister(int num) const;1194 uint64_t getRegister(int num) const;
1174 void setRegister(int num, uint64_t value);1195 void setRegister(int num, uint64_t value);
...@@ -1814,7 +1835,9 @@ inline const char *Registers_ppc64::getRegisterName(int regNum) {...@@ -1814,7 +1835,9 @@ inline const char *Registers_ppc64::getRegisterName(int regNum) {
1814/// Registers_arm64 holds the register state of a thread in a 64-bit arm1835/// Registers_arm64 holds the register state of a thread in a 64-bit arm
1815/// process.1836/// process.
1816class _LIBUNWIND_HIDDEN Registers_arm64;1837class _LIBUNWIND_HIDDEN Registers_arm64;
1817extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);1838extern "C" int64_t __libunwind_Registers_arm64_za_disable();
1839extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *,
1840 unsigned walkedFrames);
18181841
1819#if defined(_LIBUNWIND_USE_GCS)1842#if defined(_LIBUNWIND_USE_GCS)
1820extern "C" void *__libunwind_shstk_get_jump_target() {1843extern "C" void *__libunwind_shstk_get_jump_target() {
...@@ -1824,8 +1847,21 @@ extern "C" void *__libunwind_shstk_get_jump_target() {...@@ -1824,8 +1847,21 @@ extern "C" void *__libunwind_shstk_get_jump_target() {
18241847
1825class _LIBUNWIND_HIDDEN Registers_arm64 {1848class _LIBUNWIND_HIDDEN Registers_arm64 {
1826public:1849public:
1827 Registers_arm64();1850 Registers_arm64() = default;
1828 Registers_arm64(const void *registers);1851 Registers_arm64(const void *registers);
1852 Registers_arm64(const Registers_arm64 &);
1853 Registers_arm64 &operator=(const Registers_arm64 &);
1854
1855 typedef uint64_t reg_t;
1856 typedef uint64_t __ptrauth_unwind_registers_arm64_link_reg link_reg_t;
1857
1858 // Use `link_hardened_reg_arg_t` to pass values of `link_reg_t` type as
1859 // function arguments. We need to use a const l-value reference to keep
1860 // signature of `__ptrauth`-qualified values of `link_reg_t` type on AArch64
1861 // PAuth-enabled ABI intact. Passing the raw pointer by value would cause
1862 // authentication on the caller side and make the pointer prone to
1863 // substitution if spilled to the stack in the callee.
1864 typedef const link_reg_t &link_hardened_reg_arg_t;
18291865
1830 bool validRegister(int num) const;1866 bool validRegister(int num) const;
1831 uint64_t getRegister(int num) const;1867 uint64_t getRegister(int num) const;
...@@ -1837,7 +1873,14 @@ public:...@@ -1837,7 +1873,14 @@ public:
1837 v128 getVectorRegister(int num) const;1873 v128 getVectorRegister(int num) const;
1838 void setVectorRegister(int num, v128 value);1874 void setVectorRegister(int num, v128 value);
1839 static const char *getRegisterName(int num);1875 static const char *getRegisterName(int num);
1840 void jumpto() { __libunwind_Registers_arm64_jumpto(this); }1876 void jumpto(unsigned walkedFrames = 0) {
1877 zaDisable();
1878 __libunwind_Registers_arm64_jumpto(this, walkedFrames);
1879 }
1880#ifdef _LIBUNWIND_TRACE_RET_INJECT
1881 _LIBUNWIND_TRACE_NO_INLINE
1882 void returnto(unsigned walkedFrames) { jumpto(walkedFrames); }
1883#endif
1841 static constexpr int lastDwarfRegNum() {1884 static constexpr int lastDwarfRegNum() {
1842 return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64;1885 return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64;
1843 }1886 }
...@@ -1845,27 +1888,104 @@ public:...@@ -1845,27 +1888,104 @@ public:
18451888
1846 uint64_t getSP() const { return _registers.__sp; }1889 uint64_t getSP() const { return _registers.__sp; }
1847 void setSP(uint64_t value) { _registers.__sp = value; }1890 void setSP(uint64_t value) { _registers.__sp = value; }
1848 uint64_t getIP() const { return _registers.__pc; }1891 uint64_t getIP() const {
1849 void setIP(uint64_t value) { _registers.__pc = value; }1892 uint64_t value = _registers.__pc;
1850 uint64_t getFP() const { return _registers.__fp; }1893#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
1851 void setFP(uint64_t value) { _registers.__fp = value; }1894 // 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.
1896 value = (uint64_t)ptrauth_auth_and_resign((void *)_registers.__pc,
1897 ptrauth_key_return_address,
1898 &_registers.__pc,
1899 ptrauth_key_return_address,
1900 getSP());
1901#endif
1902 return value;
1903 }
1904 void setIP(uint64_t value) {
1905#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
1906 // Note the value which was set should have been signed with the SP.
1907 // We then resign with the slot we are being stored in to so that both SP
1908 // and LR can't be spoofed at the same time.
1909 value = (uint64_t)ptrauth_auth_and_resign((void *)value,
1910 ptrauth_key_return_address,
1911 getSP(),
1912 ptrauth_key_return_address,
1913 &_registers.__pc);
1914#endif
1915 _registers.__pc = value;
1916 }
1917 uint64_t getFP() const { return _registers.__fp; }
1918 void setFP(uint64_t value) { _registers.__fp = value; }
1919
1920#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
1921 void
1922 loadAndAuthenticateLinkRegister(reg_t inplaceAuthedLinkRegister,
1923 link_reg_t *referenceAuthedLinkRegister) {
1924 // If we are in an arm64/arm64e frame, then the PC should have been signed
1925 // with the SP
1926 *referenceAuthedLinkRegister =
1927 (uint64_t)ptrauth_auth_data((void *)inplaceAuthedLinkRegister,
1928 ptrauth_key_return_address,
1929 _registers.__sp);
1930 }
1931#endif
18521932
1853private:1933private:
1934 uint64_t lazyGetVG() const;
1935
1936 void zaDisable() const {
1937 if (!_misc_registers.__has_sme)
1938 return;
1939 if (__libunwind_Registers_arm64_za_disable() != 0)
1940 _LIBUNWIND_ABORT("SME ZA disable failed");
1941 }
1942
1943#if defined(_LIBUNWIND_HAVE_GETAUXVAL)
1944 static bool checkHasSME() {
1945 constexpr int hwcap2_sme = (1 << 23);
1946 unsigned long hwcap2 = getauxval(AT_HWCAP2);
1947 return (hwcap2 & hwcap2_sme) != 0;
1948 }
1949#elif defined(_LIBUNWIND_HAVE_ELF_AUX_INFO)
1950 static bool checkHasSME() {
1951 constexpr int hwcap2_sme = (1 << 23);
1952 unsigned long hwcap2 = 0;
1953 elf_aux_info(AT_HWCAP2, &hwcap2, sizeof(hwcap2));
1954 return (hwcap2 & hwcap2_sme) != 0;
1955 }
1956#else
1957 static bool checkHasSME() {
1958 // TODO: Support other platforms.
1959 return false;
1960 }
1961#endif
1962
1854 struct GPRs {1963 struct GPRs {
1855 uint64_t __x[29]; // x0-x281964 uint64_t __x[29] = {}; // x0-x28
1856 uint64_t __fp; // Frame pointer x291965 uint64_t __fp = 0; // Frame pointer x29
1857 uint64_t __lr; // Link register x301966 uint64_t __lr = 0; // Link register x30
1858 uint64_t __sp; // Stack pointer x311967 uint64_t __sp = 0; // Stack pointer x31
1859 uint64_t __pc; // Program counter1968 uint64_t __pc = 0; // Program counter
1860 uint64_t __ra_sign_state; // RA sign state register1969 uint64_t __ra_sign_state = 0; // RA sign state register
1970 };
1971
1972 struct Misc {
1973 mutable uint32_t __vg = 0; // Vector Granule
1974 bool __has_sme = checkHasSME();
1861 };1975 };
18621976
1863 GPRs _registers;1977 GPRs _registers = {};
1864 double _vectorHalfRegisters[32];
1865 // Currently only the lower double in 128-bit vectore registers1978 // Currently only the lower double in 128-bit vectore registers
1866 // is perserved during unwinding. We could define new register1979 // is perserved during unwinding. We could define new register
1867 // numbers (> 96) which mean whole vector registers, then this1980 // numbers (> 96) which mean whole vector registers, then this
1868 // struct would need to change to contain whole vector registers.1981 // struct would need to change to contain whole vector registers.
1982 double _vectorHalfRegisters[32] = {};
1983
1984 // Miscellaneous/virtual registers. These are stored below the GPRs and FPRs
1985 // as they do not correspond to physical registers, so do not need to be
1986 // saved/restored in UnwindRegistersRestore.S and UnwindRegistersSave.S, and
1987 // we don't want to modify the existing offsets for GPRs and FPRs.
1988 Misc _misc_registers;
1869};1989};
18701990
1871inline Registers_arm64::Registers_arm64(const void *registers) {1991inline Registers_arm64::Registers_arm64(const void *registers) {
...@@ -1877,11 +1997,31 @@ inline Registers_arm64::Registers_arm64(const void *registers) {...@@ -1877,11 +1997,31 @@ inline Registers_arm64::Registers_arm64(const void *registers) {
1877 memcpy(_vectorHalfRegisters,1997 memcpy(_vectorHalfRegisters,
1878 static_cast<const uint8_t *>(registers) + sizeof(GPRs),1998 static_cast<const uint8_t *>(registers) + sizeof(GPRs),
1879 sizeof(_vectorHalfRegisters));1999 sizeof(_vectorHalfRegisters));
2000 _misc_registers.__vg = 0;
2001
2002#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
2003 // We have to do some pointer authentication fixups after this copy,
2004 // and as part of that we need to load the source pc without
2005 // authenticating so that we maintain the signature for the resigning
2006 // performed by setIP.
2007 uint64_t pcRegister = 0;
2008 memmove(&pcRegister, ((uint8_t *)&_registers) + offsetof(GPRs, __pc),
2009 sizeof(pcRegister));
2010 setIP(pcRegister);
2011#endif
1880}2012}
18812013
1882inline Registers_arm64::Registers_arm64() {2014inline Registers_arm64::Registers_arm64(const Registers_arm64 &other) {
1883 memset(&_registers, 0, sizeof(_registers));2015 *this = other;
1884 memset(&_vectorHalfRegisters, 0, sizeof(_vectorHalfRegisters));2016}
2017
2018inline Registers_arm64 &
2019Registers_arm64::operator=(const Registers_arm64 &other) {
2020 memmove(static_cast<void *>(this), &other, sizeof(*this));
2021 // We perform this step to ensure that we correctly authenticate and re-sign
2022 // the pc after the bitwise copy.
2023 setIP(other.getIP());
2024 return *this;
1885}2025}
18862026
1887inline bool Registers_arm64::validRegister(int regNum) const {2027inline bool Registers_arm64::validRegister(int regNum) const {
...@@ -1895,22 +2035,40 @@ inline bool Registers_arm64::validRegister(int regNum) const {...@@ -1895,22 +2035,40 @@ inline bool Registers_arm64::validRegister(int regNum) const {
1895 return false;2035 return false;
1896 if (regNum == UNW_AARCH64_RA_SIGN_STATE)2036 if (regNum == UNW_AARCH64_RA_SIGN_STATE)
1897 return true;2037 return true;
2038 if (regNum == UNW_AARCH64_VG)
2039 return true;
1898 if ((regNum > 32) && (regNum < 64))2040 if ((regNum > 32) && (regNum < 64))
1899 return false;2041 return false;
1900 return true;2042 return true;
1901}2043}
19022044
2045inline uint64_t Registers_arm64::lazyGetVG() const {
2046 if (!_misc_registers.__vg) {
2047#if defined(__aarch64__)
2048 register uint64_t vg asm("x0");
2049 asm(".inst 0x04e0e3e0" // CNTD x0
2050 : "=r"(vg));
2051 _misc_registers.__vg = vg;
2052#else
2053 _LIBUNWIND_ABORT("arm64 VG undefined");
2054#endif
2055 }
2056 return _misc_registers.__vg;
2057}
2058
1903inline uint64_t Registers_arm64::getRegister(int regNum) const {2059inline uint64_t Registers_arm64::getRegister(int regNum) const {
1904 if (regNum == UNW_REG_IP || regNum == UNW_AARCH64_PC)2060 if (regNum == UNW_REG_IP || regNum == UNW_AARCH64_PC)
1905 return _registers.__pc;2061 return getIP();
1906 if (regNum == UNW_REG_SP || regNum == UNW_AARCH64_SP)2062 if (regNum == UNW_REG_SP || regNum == UNW_AARCH64_SP)
1907 return _registers.__sp;2063 return _registers.__sp;
1908 if (regNum == UNW_AARCH64_RA_SIGN_STATE)2064 if (regNum == UNW_AARCH64_RA_SIGN_STATE)
1909 return _registers.__ra_sign_state;2065 return _registers.__ra_sign_state;
1910 if (regNum == UNW_AARCH64_FP)2066 if (regNum == UNW_AARCH64_FP)
1911 return _registers.__fp;2067 return getFP();
1912 if (regNum == UNW_AARCH64_LR)2068 if (regNum == UNW_AARCH64_LR)
1913 return _registers.__lr;2069 return _registers.__lr;
2070 if (regNum == UNW_AARCH64_VG)
2071 return lazyGetVG();
1914 if ((regNum >= 0) && (regNum < 29))2072 if ((regNum >= 0) && (regNum < 29))
1915 return _registers.__x[regNum];2073 return _registers.__x[regNum];
1916 _LIBUNWIND_ABORT("unsupported arm64 register");2074 _LIBUNWIND_ABORT("unsupported arm64 register");
...@@ -1918,15 +2076,17 @@ inline uint64_t Registers_arm64::getRegister(int regNum) const {...@@ -1918,15 +2076,17 @@ inline uint64_t Registers_arm64::getRegister(int regNum) const {
19182076
1919inline void Registers_arm64::setRegister(int regNum, uint64_t value) {2077inline void Registers_arm64::setRegister(int regNum, uint64_t value) {
1920 if (regNum == UNW_REG_IP || regNum == UNW_AARCH64_PC)2078 if (regNum == UNW_REG_IP || regNum == UNW_AARCH64_PC)
1921 _registers.__pc = value;2079 setIP(value);
1922 else if (regNum == UNW_REG_SP || regNum == UNW_AARCH64_SP)2080 else if (regNum == UNW_REG_SP || regNum == UNW_AARCH64_SP)
1923 _registers.__sp = value;2081 _registers.__sp = value;
1924 else if (regNum == UNW_AARCH64_RA_SIGN_STATE)2082 else if (regNum == UNW_AARCH64_RA_SIGN_STATE)
1925 _registers.__ra_sign_state = value;2083 _registers.__ra_sign_state = value;
1926 else if (regNum == UNW_AARCH64_FP)2084 else if (regNum == UNW_AARCH64_FP)
1927 _registers.__fp = value;2085 setFP(value);
1928 else if (regNum == UNW_AARCH64_LR)2086 else if (regNum == UNW_AARCH64_LR)
1929 _registers.__lr = value;2087 _registers.__lr = value;
2088 else if (regNum == UNW_AARCH64_VG)
2089 _misc_registers.__vg = value;
1930 else if ((regNum >= 0) && (regNum < 29))2090 else if ((regNum >= 0) && (regNum < 29))
1931 _registers.__x[regNum] = value;2091 _registers.__x[regNum] = value;
1932 else2092 else
...@@ -2116,6 +2276,10 @@ public:...@@ -2116,6 +2276,10 @@ public:
2116 Registers_arm();2276 Registers_arm();
2117 Registers_arm(const void *registers);2277 Registers_arm(const void *registers);
21182278
2279 typedef uint32_t reg_t;
2280 typedef uint32_t link_reg_t;
2281 typedef const link_reg_t &link_hardened_reg_arg_t;
2282
2119 bool validRegister(int num) const;2283 bool validRegister(int num) const;
2120 uint32_t getRegister(int num) const;2284 uint32_t getRegister(int num) const;
2121 void setRegister(int num, uint32_t value);2285 void setRegister(int num, uint32_t value);
...@@ -2621,6 +2785,10 @@ public:...@@ -2621,6 +2785,10 @@ public:
2621 Registers_or1k();2785 Registers_or1k();
2622 Registers_or1k(const void *registers);2786 Registers_or1k(const void *registers);
26232787
2788 typedef uint32_t reg_t;
2789 typedef uint32_t link_reg_t;
2790 typedef const link_reg_t &link_hardened_reg_arg_t;
2791
2624 bool validRegister(int num) const;2792 bool validRegister(int num) const;
2625 uint32_t getRegister(int num) const;2793 uint32_t getRegister(int num) const;
2626 void setRegister(int num, uint32_t value);2794 void setRegister(int num, uint32_t value);
...@@ -2820,6 +2988,10 @@ public:...@@ -2820,6 +2988,10 @@ public:
2820 Registers_mips_o32();2988 Registers_mips_o32();
2821 Registers_mips_o32(const void *registers);2989 Registers_mips_o32(const void *registers);
28222990
2991 typedef uint32_t reg_t;
2992 typedef uint32_t link_reg_t;
2993 typedef const link_reg_t &link_hardened_reg_arg_t;
2994
2823 bool validRegister(int num) const;2995 bool validRegister(int num) const;
2824 uint32_t getRegister(int num) const;2996 uint32_t getRegister(int num) const;
2825 void setRegister(int num, uint32_t value);2997 void setRegister(int num, uint32_t value);
...@@ -3155,6 +3327,10 @@ public:...@@ -3155,6 +3327,10 @@ public:
3155 Registers_mips_newabi();3327 Registers_mips_newabi();
3156 Registers_mips_newabi(const void *registers);3328 Registers_mips_newabi(const void *registers);
31573329
3330 typedef uint64_t reg_t;
3331 typedef uint64_t link_reg_t;
3332 typedef const link_reg_t &link_hardened_reg_arg_t;
3333
3158 bool validRegister(int num) const;3334 bool validRegister(int num) const;
3159 uint64_t getRegister(int num) const;3335 uint64_t getRegister(int num) const;
3160 void setRegister(int num, uint64_t value);3336 void setRegister(int num, uint64_t value);
...@@ -3458,6 +3634,10 @@ public:...@@ -3458,6 +3634,10 @@ public:
3458 Registers_sparc();3634 Registers_sparc();
3459 Registers_sparc(const void *registers);3635 Registers_sparc(const void *registers);
34603636
3637 typedef uint32_t reg_t;
3638 typedef uint32_t link_reg_t;
3639 typedef const link_reg_t &link_hardened_reg_arg_t;
3640
3461 bool validRegister(int num) const;3641 bool validRegister(int num) const;
3462 uint32_t getRegister(int num) const;3642 uint32_t getRegister(int num) const;
3463 void setRegister(int num, uint32_t value);3643 void setRegister(int num, uint32_t value);
...@@ -3644,6 +3824,10 @@ public:...@@ -3644,6 +3824,10 @@ public:
3644 Registers_sparc64() = default;3824 Registers_sparc64() = default;
3645 Registers_sparc64(const void *registers);3825 Registers_sparc64(const void *registers);
36463826
3827 typedef uint64_t reg_t;
3828 typedef uint64_t link_reg_t;
3829 typedef const link_reg_t &link_hardened_reg_arg_t;
3830
3647 bool validRegister(int num) const;3831 bool validRegister(int num) const;
3648 uint64_t getRegister(int num) const;3832 uint64_t getRegister(int num) const;
3649 void setRegister(int num, uint64_t value);3833 void setRegister(int num, uint64_t value);
...@@ -3829,6 +4013,10 @@ public:...@@ -3829,6 +4013,10 @@ public:
3829 Registers_hexagon();4013 Registers_hexagon();
3830 Registers_hexagon(const void *registers);4014 Registers_hexagon(const void *registers);
38314015
4016 typedef uint32_t reg_t;
4017 typedef uint32_t link_reg_t;
4018 typedef const link_reg_t &link_hardened_reg_arg_t;
4019
3832 bool validRegister(int num) const;4020 bool validRegister(int num) const;
3833 uint32_t getRegister(int num) const;4021 uint32_t getRegister(int num) const;
3834 void setRegister(int num, uint32_t value);4022 void setRegister(int num, uint32_t value);
...@@ -4044,6 +4232,10 @@ public:...@@ -4044,6 +4232,10 @@ public:
4044 Registers_riscv();4232 Registers_riscv();
4045 Registers_riscv(const void *registers);4233 Registers_riscv(const void *registers);
40464234
4235 typedef ::libunwind::reg_t reg_t;
4236 typedef ::libunwind::reg_t link_reg_t;
4237 typedef const link_reg_t &link_hardened_reg_arg_t;
4238
4047 bool validRegister(int num) const;4239 bool validRegister(int num) const;
4048 reg_t getRegister(int num) const;4240 reg_t getRegister(int num) const;
4049 void setRegister(int num, reg_t value);4241 void setRegister(int num, reg_t value);
...@@ -4341,6 +4533,10 @@ public:...@@ -4341,6 +4533,10 @@ public:
4341 Registers_ve();4533 Registers_ve();
4342 Registers_ve(const void *registers);4534 Registers_ve(const void *registers);
43434535
4536 typedef uint64_t reg_t;
4537 typedef uint64_t link_reg_t;
4538 typedef const link_reg_t &link_hardened_reg_arg_t;
4539
4344 bool validRegister(int num) const;4540 bool validRegister(int num) const;
4345 uint64_t getRegister(int num) const;4541 uint64_t getRegister(int num) const;
4346 void setRegister(int num, uint64_t value);4542 void setRegister(int num, uint64_t value);
...@@ -4784,6 +4980,10 @@ public:...@@ -4784,6 +4980,10 @@ public:
4784 Registers_s390x();4980 Registers_s390x();
4785 Registers_s390x(const void *registers);4981 Registers_s390x(const void *registers);
47864982
4983 typedef uint64_t reg_t;
4984 typedef uint64_t link_reg_t;
4985 typedef const link_reg_t &link_hardened_reg_arg_t;
4986
4787 bool validRegister(int num) const;4987 bool validRegister(int num) const;
4788 uint64_t getRegister(int num) const;4988 uint64_t getRegister(int num) const;
4789 void setRegister(int num, uint64_t value);4989 void setRegister(int num, uint64_t value);
...@@ -5072,6 +5272,10 @@ public:...@@ -5072,6 +5272,10 @@ public:
5072 Registers_loongarch();5272 Registers_loongarch();
5073 Registers_loongarch(const void *registers);5273 Registers_loongarch(const void *registers);
50745274
5275 typedef uint64_t reg_t;
5276 typedef uint64_t link_reg_t;
5277 typedef const link_reg_t &link_hardened_reg_arg_t;
5278
5075 bool validRegister(int num) const;5279 bool validRegister(int num) const;
5076 uint64_t getRegister(int num) const;5280 uint64_t getRegister(int num) const;
5077 void setRegister(int num, uint64_t value);5281 void setRegister(int num, uint64_t value);
lib/libunwind/src/Unwind-seh.cpp+6-7
...@@ -163,7 +163,7 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,...@@ -163,7 +163,7 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,
163 // If we were called by __libunwind_seh_personality(), indicate that163 // If we were called by __libunwind_seh_personality(), indicate that
164 // a handler was found; otherwise, initiate phase 2 by unwinding.164 // a handler was found; otherwise, initiate phase 2 by unwinding.
165 if (ours && ms_exc->NumberParameters > 1)165 if (ours && ms_exc->NumberParameters > 1)
166 return 4 /* ExceptionExecuteHandler in mingw */;166 return static_cast<EXCEPTION_DISPOSITION>(4);
167 // This should never happen in phase 2.167 // This should never happen in phase 2.
168 if (IS_UNWINDING(ms_exc->ExceptionFlags))168 if (IS_UNWINDING(ms_exc->ExceptionFlags))
169 _LIBUNWIND_ABORT("Personality indicated exception handler in phase 2!");169 _LIBUNWIND_ABORT("Personality indicated exception handler in phase 2!");
...@@ -182,7 +182,7 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,...@@ -182,7 +182,7 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,
182 // a handler was found; otherwise, it's time to initiate a collided182 // a handler was found; otherwise, it's time to initiate a collided
183 // unwind to the target.183 // unwind to the target.
184 if (ours && !IS_UNWINDING(ms_exc->ExceptionFlags) && ms_exc->NumberParameters > 1)184 if (ours && !IS_UNWINDING(ms_exc->ExceptionFlags) && ms_exc->NumberParameters > 1)
185 return 4 /* ExceptionExecuteHandler in mingw */;185 return static_cast<EXCEPTION_DISPOSITION>(4);
186 // This should never happen in phase 1.186 // This should never happen in phase 1.
187 if (!IS_UNWINDING(ms_exc->ExceptionFlags))187 if (!IS_UNWINDING(ms_exc->ExceptionFlags))
188 _LIBUNWIND_ABORT("Personality installed context during phase 1!");188 _LIBUNWIND_ABORT("Personality installed context during phase 1!");
...@@ -259,13 +259,12 @@ __libunwind_seh_personality(int version, _Unwind_Action state,...@@ -259,13 +259,12 @@ __libunwind_seh_personality(int version, _Unwind_Action state,
259 (void *)disp_ctx->LanguageHandler, (void *)&ms_exc,259 (void *)disp_ctx->LanguageHandler, (void *)&ms_exc,
260 (void *)disp_ctx->EstablisherFrame,260 (void *)disp_ctx->EstablisherFrame,
261 (void *)disp_ctx->ContextRecord, (void *)disp_ctx);261 (void *)disp_ctx->ContextRecord, (void *)disp_ctx);
262 EXCEPTION_DISPOSITION ms_act = disp_ctx->LanguageHandler(&ms_exc,262 int ms_act = static_cast<int>(
263 (PVOID)disp_ctx->EstablisherFrame,263 disp_ctx->LanguageHandler(&ms_exc, (PVOID)disp_ctx->EstablisherFrame,
264 disp_ctx->ContextRecord,264 disp_ctx->ContextRecord, disp_ctx));
265 disp_ctx);
266 _LIBUNWIND_TRACE_UNWINDING("__libunwind_seh_personality() LanguageHandler "265 _LIBUNWIND_TRACE_UNWINDING("__libunwind_seh_personality() LanguageHandler "
267 "returned %d",266 "returned %d",
268 (int)ms_act);267 ms_act);
269 switch (ms_act) {268 switch (ms_act) {
270 case ExceptionContinueExecution: return _URC_END_OF_STACK;269 case ExceptionContinueExecution: return _URC_END_OF_STACK;
271 case ExceptionContinueSearch: return _URC_CONTINUE_UNWIND;270 case ExceptionContinueSearch: return _URC_CONTINUE_UNWIND;
lib/libunwind/src/Unwind-wasm.c+7-7
...@@ -37,13 +37,13 @@ struct _Unwind_LandingPadContext {...@@ -37,13 +37,13 @@ struct _Unwind_LandingPadContext {
37// function37// function
38thread_local struct _Unwind_LandingPadContext __wasm_lpad_context;38thread_local struct _Unwind_LandingPadContext __wasm_lpad_context;
3939
40/// Calls to this function is in landing pads in compiler-generated user code.40/// Calls to this function are in landing pads in compiler-generated user code.
41/// In other EH schemes, stack unwinding is done by libunwind library, which41/// In other EH schemes, stack unwinding is done by libunwind library, which
42/// calls the personality function for each each frame it lands. On the other42/// calls the personality function for each frame it lands. On the other hand,
43/// hand, WebAssembly stack unwinding process is performed by a VM, and the43/// WebAssembly stack unwinding process is performed by a VM, and the
44/// personality function cannot be called from there. So the compiler inserts44/// personality function cannot be called from there. So the compiler inserts a
45/// a call to this function in landing pads in the user code, which in turn45/// call to this function in landing pads in the user code, which in turn calls
46/// calls the personality function.46/// the personality function.
47_Unwind_Reason_Code _Unwind_CallPersonality(void *exception_ptr) {47_Unwind_Reason_Code _Unwind_CallPersonality(void *exception_ptr) {
48 struct _Unwind_Exception *exception_object =48 struct _Unwind_Exception *exception_object =
49 (struct _Unwind_Exception *)exception_ptr;49 (struct _Unwind_Exception *)exception_ptr;
...@@ -92,7 +92,7 @@ _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,...@@ -92,7 +92,7 @@ _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
9292
93/// Called by personality handler to get instruction pointer.93/// Called by personality handler to get instruction pointer.
94_LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {94_LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
95 // The result will be used as an 1-based index after decrementing 1, so we95 // The result will be used as a 1-based index after decrementing 1, so we
96 // increment 2 here96 // increment 2 here
97 uintptr_t result =97 uintptr_t result =
98 ((struct _Unwind_LandingPadContext *)context)->lpad_index + 2;98 ((struct _Unwind_LandingPadContext *)context)->lpad_index + 2;
lib/libunwind/src/UnwindCursor.hpp+167-49
...@@ -41,7 +41,8 @@...@@ -41,7 +41,8 @@
41#define _LIBUNWIND_CHECK_LINUX_SIGRETURN 141#define _LIBUNWIND_CHECK_LINUX_SIGRETURN 1
42#endif42#endif
4343
44#if defined(_LIBUNWIND_TARGET_HAIKU) && defined(_LIBUNWIND_TARGET_X86_64)44#if defined(_LIBUNWIND_TARGET_HAIKU) && \
45 (defined(_LIBUNWIND_TARGET_I386) || defined(_LIBUNWIND_TARGET_X86_64))
45#include <OS.h>46#include <OS.h>
46#include <signal.h>47#include <signal.h>
47#define _LIBUNWIND_CHECK_HAIKU_SIGRETURN 148#define _LIBUNWIND_CHECK_HAIKU_SIGRETURN 1
...@@ -120,7 +121,9 @@ class _LIBUNWIND_HIDDEN DwarfFDECache {...@@ -120,7 +121,9 @@ class _LIBUNWIND_HIDDEN DwarfFDECache {
120 typedef typename A::pint_t pint_t;121 typedef typename A::pint_t pint_t;
121public:122public:
122 static constexpr pint_t kSearchAll = static_cast<pint_t>(-1);123 static constexpr pint_t kSearchAll = static_cast<pint_t>(-1);
123 static pint_t findFDE(pint_t mh, pint_t pc);124 template <typename R>
125 static pint_t findFDE(pint_t mh, typename R::link_hardened_reg_arg_t pc);
126
124 static void add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde);127 static void add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde);
125 static void removeAllIn(pint_t mh);128 static void removeAllIn(pint_t mh);
126 static void iterateCacheEntries(void (*func)(unw_word_t ip_start,129 static void iterateCacheEntries(void (*func)(unw_word_t ip_start,
...@@ -173,7 +176,9 @@ bool DwarfFDECache<A>::_registeredForDyldUnloads = false;...@@ -173,7 +176,9 @@ bool DwarfFDECache<A>::_registeredForDyldUnloads = false;
173#endif176#endif
174177
175template <typename A>178template <typename A>
176typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {179template <typename R>
180typename DwarfFDECache<A>::pint_t
181DwarfFDECache<A>::findFDE(pint_t mh, typename R::link_hardened_reg_arg_t pc) {
177 pint_t result = 0;182 pint_t result = 0;
178 _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared());183 _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared());
179 for (entry *p = _buffer; p < _bufferUsed; ++p) {184 for (entry *p = _buffer; p < _bufferUsed; ++p) {
...@@ -471,7 +476,9 @@ public:...@@ -471,7 +476,9 @@ public:
471 virtual void getInfo(unw_proc_info_t *) {476 virtual void getInfo(unw_proc_info_t *) {
472 _LIBUNWIND_ABORT("getInfo not implemented");477 _LIBUNWIND_ABORT("getInfo not implemented");
473 }478 }
474 virtual void jumpto() { _LIBUNWIND_ABORT("jumpto not implemented"); }479 _LIBUNWIND_TRACE_NO_INLINE virtual void jumpto() {
480 _LIBUNWIND_ABORT("jumpto not implemented");
481 }
475 virtual bool isSignalFrame() {482 virtual bool isSignalFrame() {
476 _LIBUNWIND_ABORT("isSignalFrame not implemented");483 _LIBUNWIND_ABORT("isSignalFrame not implemented");
477 }484 }
...@@ -488,6 +495,12 @@ public:...@@ -488,6 +495,12 @@ public:
488 virtual void saveVFPAsX() { _LIBUNWIND_ABORT("saveVFPAsX not implemented"); }495 virtual void saveVFPAsX() { _LIBUNWIND_ABORT("saveVFPAsX not implemented"); }
489#endif496#endif
490497
498#ifdef _LIBUNWIND_TRACE_RET_INJECT
499 virtual void setWalkedFrames(unsigned) {
500 _LIBUNWIND_ABORT("setWalkedFrames not implemented");
501 }
502#endif
503
491#ifdef _AIX504#ifdef _AIX
492 virtual uintptr_t getDataRelBase() {505 virtual uintptr_t getDataRelBase() {
493 _LIBUNWIND_ABORT("getDataRelBase not implemented");506 _LIBUNWIND_ABORT("getDataRelBase not implemented");
...@@ -964,7 +977,8 @@ public:...@@ -964,7 +977,8 @@ public:
964 virtual void setFloatReg(int, unw_fpreg_t);977 virtual void setFloatReg(int, unw_fpreg_t);
965 virtual int step(bool stage2 = false);978 virtual int step(bool stage2 = false);
966 virtual void getInfo(unw_proc_info_t *);979 virtual void getInfo(unw_proc_info_t *);
967 virtual void jumpto();980 _LIBUNWIND_TRACE_NO_INLINE
981 virtual void jumpto();
968 virtual bool isSignalFrame();982 virtual bool isSignalFrame();
969 virtual bool getFunctionName(char *buf, size_t len, unw_word_t *off);983 virtual bool getFunctionName(char *buf, size_t len, unw_word_t *off);
970 virtual void setInfoBasedOnIPRegister(bool isReturnAddress = false);984 virtual void setInfoBasedOnIPRegister(bool isReturnAddress = false);
...@@ -973,6 +987,10 @@ public:...@@ -973,6 +987,10 @@ public:
973 virtual void saveVFPAsX();987 virtual void saveVFPAsX();
974#endif988#endif
975989
990#ifdef _LIBUNWIND_TRACE_RET_INJECT
991 virtual void setWalkedFrames(unsigned);
992#endif
993
976#ifdef _AIX994#ifdef _AIX
977 virtual uintptr_t getDataRelBase();995 virtual uintptr_t getDataRelBase();
978#endif996#endif
...@@ -1045,19 +1063,28 @@ private:...@@ -1045,19 +1063,28 @@ private:
1045#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)1063#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
1046 bool getInfoFromFdeCie(const typename CFI_Parser<A>::FDE_Info &fdeInfo,1064 bool getInfoFromFdeCie(const typename CFI_Parser<A>::FDE_Info &fdeInfo,
1047 const typename CFI_Parser<A>::CIE_Info &cieInfo,1065 const typename CFI_Parser<A>::CIE_Info &cieInfo,
1048 pint_t pc, uintptr_t dso_base);1066 typename R::link_hardened_reg_arg_t pc,
1049 bool getInfoFromDwarfSection(pint_t pc, const UnwindInfoSections &sects,1067 uintptr_t dso_base);
1050 uint32_t fdeSectionOffsetHint=0);1068 bool getInfoFromDwarfSection(typename R::link_hardened_reg_arg_t pc,
1069 const UnwindInfoSections &sects,
1070 uint32_t fdeSectionOffsetHint = 0);
1051 int stepWithDwarfFDE(bool stage2) {1071 int stepWithDwarfFDE(bool stage2) {
1072#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
1073 typename R::reg_t rawPC = this->getReg(UNW_REG_IP);
1074 typename R::link_reg_t pc;
1075 _registers.loadAndAuthenticateLinkRegister(rawPC, &pc);
1076#else
1077 typename R::link_reg_t pc = this->getReg(UNW_REG_IP);
1078#endif
1052 return DwarfInstructions<A, R>::stepWithDwarf(1079 return DwarfInstructions<A, R>::stepWithDwarf(
1053 _addressSpace, (pint_t)this->getReg(UNW_REG_IP),1080 _addressSpace, pc, (pint_t)_info.unwind_info, _registers,
1054 (pint_t)_info.unwind_info, _registers, _isSignalFrame, stage2);1081 _isSignalFrame, stage2);
1055 }1082 }
1056#endif1083#endif
10571084
1058#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)1085#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
1059 bool getInfoFromCompactEncodingSection(pint_t pc,1086 bool getInfoFromCompactEncodingSection(typename R::link_hardened_reg_arg_t pc,
1060 const UnwindInfoSections &sects);1087 const UnwindInfoSections &sects);
1061 int stepWithCompactEncoding(bool stage2 = false) {1088 int stepWithCompactEncoding(bool stage2 = false) {
1062#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)1089#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
1063 if ( compactSaysUseDwarf() )1090 if ( compactSaysUseDwarf() )
...@@ -1344,9 +1371,12 @@ private:...@@ -1344,9 +1371,12 @@ private:
1344 bool _unwindInfoMissing;1371 bool _unwindInfoMissing;
1345 bool _isSignalFrame;1372 bool _isSignalFrame;
1346#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) || \1373#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) || \
1347 defined(_LIBUNWIND_TARGET_HAIKU)1374 defined(_LIBUNWIND_CHECK_HAIKU_SIGRETURN)
1348 bool _isSigReturn = false;1375 bool _isSigReturn = false;
1349#endif1376#endif
1377#ifdef _LIBUNWIND_TRACE_RET_INJECT
1378 uint32_t _walkedFrames;
1379#endif
1350};1380};
13511381
13521382
...@@ -1358,13 +1388,13 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)...@@ -1358,13 +1388,13 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
1358 "UnwindCursor<> does not fit in unw_cursor_t");1388 "UnwindCursor<> does not fit in unw_cursor_t");
1359 static_assert((alignof(UnwindCursor<A, R>) <= alignof(unw_cursor_t)),1389 static_assert((alignof(UnwindCursor<A, R>) <= alignof(unw_cursor_t)),
1360 "UnwindCursor<> requires more alignment than unw_cursor_t");1390 "UnwindCursor<> requires more alignment than unw_cursor_t");
1361 memset(&_info, 0, sizeof(_info));1391 memset(static_cast<void *>(&_info), 0, sizeof(_info));
1362}1392}
13631393
1364template <typename A, typename R>1394template <typename A, typename R>
1365UnwindCursor<A, R>::UnwindCursor(A &as, void *)1395UnwindCursor<A, R>::UnwindCursor(A &as, void *)
1366 : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false) {1396 : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false) {
1367 memset(&_info, 0, sizeof(_info));1397 memset(static_cast<void *>(&_info), 0, sizeof(_info));
1368 // FIXME1398 // FIXME
1369 // fill in _registers from thread arg1399 // fill in _registers from thread arg
1370}1400}
...@@ -1401,7 +1431,46 @@ void UnwindCursor<A, R>::setFloatReg(int regNum, unw_fpreg_t value) {...@@ -1401,7 +1431,46 @@ void UnwindCursor<A, R>::setFloatReg(int regNum, unw_fpreg_t value) {
1401}1431}
14021432
1403template <typename A, typename R> void UnwindCursor<A, R>::jumpto() {1433template <typename A, typename R> void UnwindCursor<A, R>::jumpto() {
1434#ifdef _LIBUNWIND_TRACE_RET_INJECT
1435 /*
1436
1437 The value of `_walkedFrames` is computed in `unwind_phase2` and represents the
1438 number of frames walked starting `unwind_phase2` to get to the landing pad.
1439
1440 ```
1441 // uc is initialized by __unw_getcontext in the parent frame.
1442 // The first stack frame walked is unwind_phase2.
1443 unsigned framesWalked = 1;
1444 ```
1445
1446 To that, we need to add the number of function calls in libunwind between
1447 `unwind_phase2` & `__libunwind_Registers_arm64_jumpto` which performs the long
1448 jump, to rebalance the execution flow.
1449
1450 ```
1451 frame #0: libunwind.1.dylib`__libunwind_Registers_arm64_jumpto at UnwindRegistersRestore.S:646
1452 frame #1: libunwind.1.dylib`libunwind::Registers_arm64::returnto at Registers.hpp:2291:3
1453 frame #2: libunwind.1.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::jumpto at UnwindCursor.hpp:1474:14
1454 frame #3: libunwind.1.dylib`__unw_resume at libunwind.cpp:375:7
1455 frame #4: libunwind.1.dylib`__unw_resume_with_frames_walked at libunwind.cpp:363:10
1456 frame #5: libunwind.1.dylib`unwind_phase2 at UnwindLevel1.c:328:9
1457 frame #6: libunwind.1.dylib`_Unwind_RaiseException at UnwindLevel1.c:480:10
1458 frame #7: libc++abi.dylib`__cxa_throw at cxa_exception.cpp:295:5
1459 ...
1460 ```
1461
1462 If we look at the backtrace from `__libunwind_Registers_arm64_jumpto`, we see
1463 there are 5 frames on the stack to reach `unwind_phase2`. However, only 4 of
1464 them will never return, since `__libunwind_Registers_arm64_jumpto` returns
1465 back to the landing pad, so we need to subtract 1 to the number of
1466 `_EXTRA_LIBUNWIND_FRAMES_WALKED`.
1467 */
1468
1469 static constexpr size_t _EXTRA_LIBUNWIND_FRAMES_WALKED = 5 - 1;
1470 _registers.returnto(_walkedFrames + _EXTRA_LIBUNWIND_FRAMES_WALKED);
1471#else
1404 _registers.jumpto();1472 _registers.jumpto();
1473#endif
1405}1474}
14061475
1407#ifdef __arm__1476#ifdef __arm__
...@@ -1410,6 +1479,13 @@ template <typename A, typename R> void UnwindCursor<A, R>::saveVFPAsX() {...@@ -1410,6 +1479,13 @@ template <typename A, typename R> void UnwindCursor<A, R>::saveVFPAsX() {
1410}1479}
1411#endif1480#endif
14121481
1482#ifdef _LIBUNWIND_TRACE_RET_INJECT
1483template <typename A, typename R>
1484void UnwindCursor<A, R>::setWalkedFrames(unsigned walkedFrames) {
1485 _walkedFrames = walkedFrames;
1486}
1487#endif
1488
1413#ifdef _AIX1489#ifdef _AIX
1414template <typename A, typename R>1490template <typename A, typename R>
1415uintptr_t UnwindCursor<A, R>::getDataRelBase() {1491uintptr_t UnwindCursor<A, R>::getDataRelBase() {
...@@ -1658,11 +1734,11 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(...@@ -1658,11 +1734,11 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(
1658template <typename A, typename R>1734template <typename A, typename R>
1659bool UnwindCursor<A, R>::getInfoFromFdeCie(1735bool UnwindCursor<A, R>::getInfoFromFdeCie(
1660 const typename CFI_Parser<A>::FDE_Info &fdeInfo,1736 const typename CFI_Parser<A>::FDE_Info &fdeInfo,
1661 const typename CFI_Parser<A>::CIE_Info &cieInfo, pint_t pc,1737 const typename CFI_Parser<A>::CIE_Info &cieInfo,
1662 uintptr_t dso_base) {1738 typename R::link_hardened_reg_arg_t pc, uintptr_t dso_base) {
1663 typename CFI_Parser<A>::PrologInfo prolog;1739 typename CFI_Parser<A>::PrologInfo prolog;
1664 if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, pc,1740 if (CFI_Parser<A>::template parseFDEInstructions<R>(
1665 R::getArch(), &prolog)) {1741 _addressSpace, fdeInfo, cieInfo, pc, R::getArch(), &prolog)) {
1666 // Save off parsed FDE info1742 // Save off parsed FDE info
1667 _info.start_ip = fdeInfo.pcStart;1743 _info.start_ip = fdeInfo.pcStart;
1668 _info.end_ip = fdeInfo.pcEnd;1744 _info.end_ip = fdeInfo.pcEnd;
...@@ -1682,43 +1758,42 @@ bool UnwindCursor<A, R>::getInfoFromFdeCie(...@@ -1682,43 +1758,42 @@ bool UnwindCursor<A, R>::getInfoFromFdeCie(
1682}1758}
16831759
1684template <typename A, typename R>1760template <typename A, typename R>
1685bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,1761bool UnwindCursor<A, R>::getInfoFromDwarfSection(
1686 const UnwindInfoSections &sects,1762 typename R::link_hardened_reg_arg_t pc, const UnwindInfoSections &sects,
1687 uint32_t fdeSectionOffsetHint) {1763 uint32_t fdeSectionOffsetHint) {
1688 typename CFI_Parser<A>::FDE_Info fdeInfo;1764 typename CFI_Parser<A>::FDE_Info fdeInfo;
1689 typename CFI_Parser<A>::CIE_Info cieInfo;1765 typename CFI_Parser<A>::CIE_Info cieInfo;
1690 bool foundFDE = false;1766 bool foundFDE = false;
1691 bool foundInCache = false;1767 bool foundInCache = false;
1692 // If compact encoding table gave offset into dwarf section, go directly there1768 // If compact encoding table gave offset into dwarf section, go directly there
1693 if (fdeSectionOffsetHint != 0) {1769 if (fdeSectionOffsetHint != 0) {
1694 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,1770 foundFDE = CFI_Parser<A>::template findFDE<R>(
1695 sects.dwarf_section_length,1771 _addressSpace, pc, sects.dwarf_section, sects.dwarf_section_length,
1696 sects.dwarf_section + fdeSectionOffsetHint,1772 sects.dwarf_section + fdeSectionOffsetHint, &fdeInfo, &cieInfo);
1697 &fdeInfo, &cieInfo);
1698 }1773 }
1699#if defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)1774#if defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)
1700 if (!foundFDE && (sects.dwarf_index_section != 0)) {1775 if (!foundFDE && (sects.dwarf_index_section != 0)) {
1701 foundFDE = EHHeaderParser<A>::findFDE(1776 foundFDE = EHHeaderParser<A>::template findFDE<R>(
1702 _addressSpace, pc, sects.dwarf_index_section,1777 _addressSpace, pc, sects.dwarf_index_section,
1703 (uint32_t)sects.dwarf_index_section_length, &fdeInfo, &cieInfo);1778 (uint32_t)sects.dwarf_index_section_length, &fdeInfo, &cieInfo);
1704 }1779 }
1705#endif1780#endif
1706 if (!foundFDE) {1781 if (!foundFDE) {
1707 // otherwise, search cache of previously found FDEs.1782 // otherwise, search cache of previously found FDEs.
1708 pint_t cachedFDE = DwarfFDECache<A>::findFDE(sects.dso_base, pc);1783 pint_t cachedFDE =
1784 DwarfFDECache<A>::template findFDE<R>(sects.dso_base, pc);
1709 if (cachedFDE != 0) {1785 if (cachedFDE != 0) {
1710 foundFDE =1786 foundFDE = CFI_Parser<A>::template findFDE<R>(
1711 CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,1787 _addressSpace, pc, sects.dwarf_section, sects.dwarf_section_length,
1712 sects.dwarf_section_length,1788 cachedFDE, &fdeInfo, &cieInfo);
1713 cachedFDE, &fdeInfo, &cieInfo);
1714 foundInCache = foundFDE;1789 foundInCache = foundFDE;
1715 }1790 }
1716 }1791 }
1717 if (!foundFDE) {1792 if (!foundFDE) {
1718 // Still not found, do full scan of __eh_frame section.1793 // Still not found, do full scan of __eh_frame section.
1719 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,1794 foundFDE = CFI_Parser<A>::template findFDE<R>(
1720 sects.dwarf_section_length, 0,1795 _addressSpace, pc, sects.dwarf_section, sects.dwarf_section_length, 0,
1721 &fdeInfo, &cieInfo);1796 &fdeInfo, &cieInfo);
1722 }1797 }
1723 if (foundFDE) {1798 if (foundFDE) {
1724 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, sects.dso_base)) {1799 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, sects.dso_base)) {
...@@ -1742,8 +1817,8 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,...@@ -1742,8 +1817,8 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
17421817
1743#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)1818#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
1744template <typename A, typename R>1819template <typename A, typename R>
1745bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,1820bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(
1746 const UnwindInfoSections &sects) {1821 typename R::link_hardened_reg_arg_t pc, const UnwindInfoSections &sects) {
1747 const bool log = false;1822 const bool log = false;
1748 if (log)1823 if (log)
1749 fprintf(stderr, "getInfoFromCompactEncodingSection(pc=0x%llX, mh=0x%llX)\n",1824 fprintf(stderr, "getInfoFromCompactEncodingSection(pc=0x%llX, mh=0x%llX)\n",
...@@ -1974,6 +2049,16 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,...@@ -1974,6 +2049,16 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
1974 personalityIndex * sizeof(uint32_t));2049 personalityIndex * sizeof(uint32_t));
1975 pint_t personalityPointer = sects.dso_base + (pint_t)personalityDelta;2050 pint_t personalityPointer = sects.dso_base + (pint_t)personalityDelta;
1976 personality = _addressSpace.getP(personalityPointer);2051 personality = _addressSpace.getP(personalityPointer);
2052#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
2053 // The GOT for the personality function was signed address authenticated.
2054 // Resign it as a regular function pointer.
2055 const auto discriminator = ptrauth_blend_discriminator(
2056 &_info.handler, __ptrauth_unwind_upi_handler_disc);
2057 void *signedPtr = ptrauth_auth_and_resign(
2058 (void *)personality, ptrauth_key_function_pointer, personalityPointer,
2059 ptrauth_key_function_pointer, discriminator);
2060 personality = (__typeof(personality))signedPtr;
2061#endif
1977 if (log)2062 if (log)
1978 fprintf(stderr, "getInfoFromCompactEncodingSection(pc=0x%llX), "2063 fprintf(stderr, "getInfoFromCompactEncodingSection(pc=0x%llX), "
1979 "personalityDelta=0x%08X, personality=0x%08llX\n",2064 "personalityDelta=0x%08X, personality=0x%08llX\n",
...@@ -1987,7 +2072,11 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,...@@ -1987,7 +2072,11 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
1987 _info.start_ip = funcStart;2072 _info.start_ip = funcStart;
1988 _info.end_ip = funcEnd;2073 _info.end_ip = funcEnd;
1989 _info.lsda = lsda;2074 _info.lsda = lsda;
1990 _info.handler = personality;2075 // We use memmove to copy the personality function as we have already manually
2076 // re-signed the pointer, and assigning directly will attempt to incorrectly
2077 // sign the already signed value.
2078 memmove(reinterpret_cast<void *>(&_info.handler),
2079 reinterpret_cast<void *>(&personality), sizeof(personality));
1991 _info.gp = 0;2080 _info.gp = 0;
1992 _info.flags = 0;2081 _info.flags = 0;
1993 _info.format = encoding;2082 _info.format = encoding;
...@@ -2640,11 +2729,19 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {...@@ -2640,11 +2729,19 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
2640 _isSigReturn = false;2729 _isSigReturn = false;
2641#endif2730#endif
26422731
2643 pint_t pc = static_cast<pint_t>(this->getReg(UNW_REG_IP));2732 typename R::reg_t rawPC = this->getReg(UNW_REG_IP);
2733
2644#if defined(_LIBUNWIND_ARM_EHABI)2734#if defined(_LIBUNWIND_ARM_EHABI)
2645 // Remove the thumb bit so the IP represents the actual instruction address.2735 // Remove the thumb bit so the IP represents the actual instruction address.
2646 // This matches the behaviour of _Unwind_GetIP on arm.2736 // This matches the behaviour of _Unwind_GetIP on arm.
2647 pc &= (pint_t)~0x1;2737 rawPC &= (pint_t)~0x1;
2738#endif
2739
2740 typename R::link_reg_t pc;
2741#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
2742 _registers.loadAndAuthenticateLinkRegister(rawPC, &pc);
2743#else
2744 pc = rawPC;
2648#endif2745#endif
26492746
2650 // Exit early if at the top of the stack.2747 // Exit early if at the top of the stack.
...@@ -2679,7 +2776,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {...@@ -2679,7 +2776,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
26792776
2680 // Ask address space object to find unwind sections for this pc.2777 // Ask address space object to find unwind sections for this pc.
2681 UnwindInfoSections sects;2778 UnwindInfoSections sects;
2682 if (_addressSpace.findUnwindSections(pc, sects)) {2779 if (_addressSpace.template findUnwindSections<R>(pc, sects)) {
2683#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)2780#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
2684 // If there is a compact unwind encoding table, look there first.2781 // If there is a compact unwind encoding table, look there first.
2685 if (sects.compact_unwind_section != 0) {2782 if (sects.compact_unwind_section != 0) {
...@@ -2735,8 +2832,8 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {...@@ -2735,8 +2832,8 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
2735#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)2832#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
2736 // There is no static unwind info for this pc. Look to see if an FDE was2833 // There is no static unwind info for this pc. Look to see if an FDE was
2737 // dynamically registered for it.2834 // dynamically registered for it.
2738 pint_t cachedFDE = DwarfFDECache<A>::findFDE(DwarfFDECache<A>::kSearchAll,2835 pint_t cachedFDE =
2739 pc);2836 DwarfFDECache<A>::template findFDE<R>(DwarfFDECache<A>::kSearchAll, pc);
2740 if (cachedFDE != 0) {2837 if (cachedFDE != 0) {
2741 typename CFI_Parser<A>::FDE_Info fdeInfo;2838 typename CFI_Parser<A>::FDE_Info fdeInfo;
2742 typename CFI_Parser<A>::CIE_Info cieInfo;2839 typename CFI_Parser<A>::CIE_Info cieInfo;
...@@ -2748,7 +2845,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {...@@ -2748,7 +2845,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
2748 // Lastly, ask AddressSpace object about platform specific ways to locate2845 // Lastly, ask AddressSpace object about platform specific ways to locate
2749 // other FDEs.2846 // other FDEs.
2750 pint_t fde;2847 pint_t fde;
2751 if (_addressSpace.findOtherFDE(pc, fde)) {2848 if (_addressSpace.template findOtherFDE<R>(pc, fde)) {
2752 typename CFI_Parser<A>::FDE_Info fdeInfo;2849 typename CFI_Parser<A>::FDE_Info fdeInfo;
2753 typename CFI_Parser<A>::CIE_Info cieInfo;2850 typename CFI_Parser<A>::CIE_Info cieInfo;
2754 if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) {2851 if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) {
...@@ -2772,6 +2869,21 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {...@@ -2772,6 +2869,21 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
27722869
2773#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) && \2870#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) && \
2774 defined(_LIBUNWIND_TARGET_AARCH64)2871 defined(_LIBUNWIND_TARGET_AARCH64)
2872
2873/*
2874 * The linux sigreturn restorer stub will always have the form:
2875 *
2876 * d2801168 movz x8, #0x8b
2877 * d4000001 svc #0x0
2878 */
2879#if defined(__AARCH64EB__)
2880#define MOVZ_X8_8B 0x681180d2
2881#define SVC_0 0x010000d4
2882#else
2883#define MOVZ_X8_8B 0xd2801168
2884#define SVC_0 0xd4000001
2885#endif
2886
2775template <typename A, typename R>2887template <typename A, typename R>
2776bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {2888bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {
2777 // Look for the sigreturn trampoline. The trampoline's body is two2889 // Look for the sigreturn trampoline. The trampoline's body is two
...@@ -2796,7 +2908,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {...@@ -2796,7 +2908,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {
2796 return false;2908 return false;
2797 auto *instructions = reinterpret_cast<const uint32_t *>(pc);2909 auto *instructions = reinterpret_cast<const uint32_t *>(pc);
2798 // Look for instructions: mov x8, #0x8b; svc #0x02910 // Look for instructions: mov x8, #0x8b; svc #0x0
2799 if (instructions[0] != 0xd2801168 || instructions[1] != 0xd4000001)2911 if (instructions[0] != MOVZ_X8_8B || instructions[1] != SVC_0)
2800 return false;2912 return false;
28012913
2802 _info = {};2914 _info = {};
...@@ -3188,16 +3300,22 @@ template <typename A, typename R> int UnwindCursor<A, R>::step(bool stage2) {...@@ -3188,16 +3300,22 @@ template <typename A, typename R> int UnwindCursor<A, R>::step(bool stage2) {
3188template <typename A, typename R>3300template <typename A, typename R>
3189void UnwindCursor<A, R>::getInfo(unw_proc_info_t *info) {3301void UnwindCursor<A, R>::getInfo(unw_proc_info_t *info) {
3190 if (_unwindInfoMissing)3302 if (_unwindInfoMissing)
3191 memset(info, 0, sizeof(*info));3303 memset(static_cast<void *>(info), 0, sizeof(*info));
3192 else3304 else
3193 *info = _info;3305 *info = _info;
3194}3306}
31953307
3196template <typename A, typename R>3308template <typename A, typename R>
3197bool UnwindCursor<A, R>::getFunctionName(char *buf, size_t bufLen,3309bool UnwindCursor<A, R>::getFunctionName(char *buf, size_t bufLen,
3198 unw_word_t *offset) {3310 unw_word_t *offset) {
3199 return _addressSpace.findFunctionName((pint_t)this->getReg(UNW_REG_IP),3311#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
3200 buf, bufLen, offset);3312 typename R::reg_t rawPC = this->getReg(UNW_REG_IP);
3313 typename R::link_reg_t pc;
3314 _registers.loadAndAuthenticateLinkRegister(rawPC, &pc);
3315#else
3316 typename R::link_reg_t pc = this->getReg(UNW_REG_IP);
3317#endif
3318 return _addressSpace.template findFunctionName<R>(pc, buf, bufLen, offset);
3201}3319}
32023320
3203#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN)3321#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN)
lib/libunwind/src/UnwindLevel1.c+46-17
...@@ -48,16 +48,15 @@...@@ -48,16 +48,15 @@
48// avoided when invoking the `jumpto()` function. To do this, we use inline48// avoided when invoking the `jumpto()` function. To do this, we use inline
49// assemblies to "goto" the `jumpto()` for these architectures.49// assemblies to "goto" the `jumpto()` for these architectures.
50#if !defined(_LIBUNWIND_USE_CET) && !defined(_LIBUNWIND_USE_GCS)50#if !defined(_LIBUNWIND_USE_CET) && !defined(_LIBUNWIND_USE_GCS)
51#define __unw_phase2_resume(cursor, fn) \51#define __unw_phase2_resume(cursor, payload) \
52 do { \52 do { \
53 (void)fn; \53 __unw_resume_with_frames_walked((cursor), (payload)); \
54 __unw_resume((cursor)); \
55 } while (0)54 } while (0)
56#elif defined(_LIBUNWIND_TARGET_I386)55#elif defined(_LIBUNWIND_TARGET_I386)
57#define __shstk_step_size (4)56#define __shstk_step_size (4)
58#define __unw_phase2_resume(cursor, fn) \57#define __unw_phase2_resume(cursor, payload) \
59 do { \58 do { \
60 _LIBUNWIND_POP_SHSTK_SSP((fn)); \59 _LIBUNWIND_POP_SHSTK_SSP((payload)); \
61 void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \60 void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \
62 void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \61 void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \
63 __asm__ volatile("push %%edi\n\t" \62 __asm__ volatile("push %%edi\n\t" \
...@@ -67,9 +66,9 @@...@@ -67,9 +66,9 @@
67 } while (0)66 } while (0)
68#elif defined(_LIBUNWIND_TARGET_X86_64)67#elif defined(_LIBUNWIND_TARGET_X86_64)
69#define __shstk_step_size (8)68#define __shstk_step_size (8)
70#define __unw_phase2_resume(cursor, fn) \69#define __unw_phase2_resume(cursor, payload) \
71 do { \70 do { \
72 _LIBUNWIND_POP_SHSTK_SSP((fn)); \71 _LIBUNWIND_POP_SHSTK_SSP((payload)); \
73 void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \72 void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \
74 void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \73 void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \
75 __asm__ volatile("jmpq *%%rdx\n\t" ::"D"(shstkRegContext), \74 __asm__ volatile("jmpq *%%rdx\n\t" ::"D"(shstkRegContext), \
...@@ -77,19 +76,37 @@...@@ -77,19 +76,37 @@
77 } while (0)76 } while (0)
78#elif defined(_LIBUNWIND_TARGET_AARCH64)77#elif defined(_LIBUNWIND_TARGET_AARCH64)
79#define __shstk_step_size (8)78#define __shstk_step_size (8)
80#define __unw_phase2_resume(cursor, fn) \79#define __unw_phase2_resume(cursor, payload) \
81 do { \80 do { \
82 _LIBUNWIND_POP_SHSTK_SSP((fn)); \81 _LIBUNWIND_POP_SHSTK_SSP((payload)); \
83 void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \82 void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \
84 void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \83 void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \
85 __asm__ volatile("mov x0, %0\n\t" \84 __asm__ volatile("mov x0, %0\n\t" \
85 "mov x1, #0\n\t" \
86 "br %1\n\t" \86 "br %1\n\t" \
87 : \87 : \
88 : "r"(shstkRegContext), "r"(shstkJumpAddress) \88 : "r"(shstkRegContext), "r"(shstkJumpAddress) \
89 : "x0"); \89 : "x0", "x1"); \
90 } while (0)90 } while (0)
91#endif91#endif
9292
93// We need this helper function as the semantics of casting between integers and
94// function pointers mean that we end up with a function pointer without the
95// correct signature. Instead we assign to an integer with a matching schema,
96// and then memmove the result into a variable of the correct type. This memmove
97// is possible as `_Unwind_Personality_Fn` is a standard function pointer, and
98// as such is not address diversified.
99static _Unwind_Personality_Fn get_handler_function(unw_proc_info_t *frameInfo) {
100 uintptr_t __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer,
101 0,
102 ptrauth_function_pointer_type_discriminator(_Unwind_Personality_Fn))
103 reauthenticatedIntegerHandler = frameInfo->handler;
104 _Unwind_Personality_Fn handler;
105 memmove(&handler, (void *)&reauthenticatedIntegerHandler,
106 sizeof(_Unwind_Personality_Fn));
107 return handler;
108}
109
93static _Unwind_Reason_Code110static _Unwind_Reason_Code
94unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) {111unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) {
95 __unw_init_local(cursor, uc);112 __unw_init_local(cursor, uc);
...@@ -147,8 +164,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except...@@ -147,8 +164,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
147 // If there is a personality routine, ask it if it will want to stop at164 // If there is a personality routine, ask it if it will want to stop at
148 // this frame.165 // this frame.
149 if (frameInfo.handler != 0) {166 if (frameInfo.handler != 0) {
150 _Unwind_Personality_Fn p =167 _Unwind_Personality_Fn p = get_handler_function(&frameInfo);
151 (_Unwind_Personality_Fn)(uintptr_t)(frameInfo.handler);
152 _LIBUNWIND_TRACE_UNWINDING(168 _LIBUNWIND_TRACE_UNWINDING(
153 "unwind_phase1(ex_obj=%p): calling personality function %p",169 "unwind_phase1(ex_obj=%p): calling personality function %p",
154 (void *)exception_object, (void *)(uintptr_t)p);170 (void *)exception_object, (void *)(uintptr_t)p);
...@@ -184,11 +200,12 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except...@@ -184,11 +200,12 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
184 }200 }
185 return _URC_NO_REASON;201 return _URC_NO_REASON;
186}202}
187extern int __unw_step_stage2(unw_cursor_t *);
188203
189#if defined(_LIBUNWIND_USE_GCS)204#if defined(_LIBUNWIND_USE_GCS)
190// Enable the GCS target feature to permit gcspop instructions to be used.205// Enable the GCS target feature to permit gcspop instructions to be used.
191__attribute__((target("+gcs")))206__attribute__((target("+gcs")))
207#else
208_LIBUNWIND_TRACE_NO_INLINE
192#endif209#endif
193static _Unwind_Reason_Code210static _Unwind_Reason_Code
194unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,211unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,
...@@ -276,8 +293,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,...@@ -276,8 +293,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,
276 ++framesWalked;293 ++framesWalked;
277 // If there is a personality routine, tell it we are unwinding.294 // If there is a personality routine, tell it we are unwinding.
278 if (frameInfo.handler != 0) {295 if (frameInfo.handler != 0) {
279 _Unwind_Personality_Fn p =296 _Unwind_Personality_Fn p = get_handler_function(&frameInfo);
280 (_Unwind_Personality_Fn)(uintptr_t)(frameInfo.handler);
281 _Unwind_Action action = _UA_CLEANUP_PHASE;297 _Unwind_Action action = _UA_CLEANUP_PHASE;
282 if (sp == exception_object->private_2) {298 if (sp == exception_object->private_2) {
283 // Tell personality this was the frame it marked in phase 1.299 // Tell personality this was the frame it marked in phase 1.
...@@ -334,6 +350,8 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,...@@ -334,6 +350,8 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,
334#if defined(_LIBUNWIND_USE_GCS)350#if defined(_LIBUNWIND_USE_GCS)
335// Enable the GCS target feature to permit gcspop instructions to be used.351// Enable the GCS target feature to permit gcspop instructions to be used.
336__attribute__((target("+gcs")))352__attribute__((target("+gcs")))
353#else
354_LIBUNWIND_TRACE_NO_INLINE
337#endif355#endif
338static _Unwind_Reason_Code356static _Unwind_Reason_Code
339unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,357unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
...@@ -394,8 +412,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,...@@ -394,8 +412,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
394 ++framesWalked;412 ++framesWalked;
395 // If there is a personality routine, tell it we are unwinding.413 // If there is a personality routine, tell it we are unwinding.
396 if (frameInfo.handler != 0) {414 if (frameInfo.handler != 0) {
397 _Unwind_Personality_Fn p =415 _Unwind_Personality_Fn p = get_handler_function(&frameInfo);
398 (_Unwind_Personality_Fn)(intptr_t)(frameInfo.handler);
399 _LIBUNWIND_TRACE_UNWINDING(416 _LIBUNWIND_TRACE_UNWINDING(
400 "unwind_phase2_forced(ex_obj=%p): calling personality function %p",417 "unwind_phase2_forced(ex_obj=%p): calling personality function %p",
401 (void *)exception_object, (void *)(uintptr_t)p);418 (void *)exception_object, (void *)(uintptr_t)p);
...@@ -597,6 +614,18 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {...@@ -597,6 +614,18 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
597 unw_cursor_t *cursor = (unw_cursor_t *)context;614 unw_cursor_t *cursor = (unw_cursor_t *)context;
598 unw_word_t result;615 unw_word_t result;
599 __unw_get_reg(cursor, UNW_REG_IP, &result);616 __unw_get_reg(cursor, UNW_REG_IP, &result);
617
618#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
619 // If we are in an arm64e frame, then the PC should have been signed with the
620 // sp
621 {
622 unw_word_t sp;
623 __unw_get_reg(cursor, UNW_REG_SP, &sp);
624 result = (unw_word_t)ptrauth_auth_data((void *)result,
625 ptrauth_key_return_address, sp);
626 }
627#endif
628
600 _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%" PRIxPTR,629 _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%" PRIxPTR,
601 (void *)context, result);630 (void *)context, result);
602 return (uintptr_t)result;631 return (uintptr_t)result;
lib/libunwind/src/UnwindRegistersRestore.S+46-5
...@@ -6,6 +6,8 @@...@@ -6,6 +6,8 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#if !defined(__wasm__)
10
9#include "assembly.h"11#include "assembly.h"
1012
11#define FROM_0_TO_15 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1513#define FROM_0_TO_15 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
...@@ -16,13 +18,17 @@...@@ -16,13 +18,17 @@
1618
17#if defined(_AIX)19#if defined(_AIX)
18 .toc20 .toc
21#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
22 .section .text,"axy",@progbits,unique,0
19#else23#else
20 .text24 .text
21#endif25#endif
2226
23#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)27#if !defined(__USING_SJLJ_EXCEPTIONS__)
2428
25#if defined(__i386__)29#if defined(__i386__)
30.att_syntax
31
26DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)32DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
27#33#
28# extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);34# extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
...@@ -67,6 +73,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)...@@ -67,6 +73,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
67 # skip gs73 # skip gs
6874
69#elif defined(__x86_64__) && !defined(__arm64ec__)75#elif defined(__x86_64__) && !defined(__arm64ec__)
76.att_syntax
7077
71DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_64_jumpto)78DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_64_jumpto)
72#79#
...@@ -629,18 +636,35 @@ Lnovec:...@@ -629,18 +636,35 @@ Lnovec:
629636
630#elif defined(__aarch64__)637#elif defined(__aarch64__)
631638
639#ifndef __has_feature
640#define __has_feature(__feature) 0
641#endif
642
632#if defined(__ARM_FEATURE_GCS_DEFAULT)643#if defined(__ARM_FEATURE_GCS_DEFAULT)
633.arch_extension gcs644.arch_extension gcs
634#endif645#endif
635646
636//647//
637// extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);648// extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *, unsigned);
638//649//
639// On entry:650// On entry:
640// thread_state pointer is in x0651// thread_state pointer is in x0
652// walked_frames counter is in x1
641//653//
642 .p2align 2654 .p2align 2
643DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)655DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
656
657 #if defined(_LIBUNWIND_TRACE_RET_INJECT)
658 cbz w1, 1f
659 0:
660 subs w1, w1, #1
661 adr x16, #8
662 ret x16
663
664 b.ne 0b
665 1:
666 #endif
667
644 // skip restore of x0,x1 for now668 // skip restore of x0,x1 for now
645 ldp x2, x3, [x0, #0x010]669 ldp x2, x3, [x0, #0x010]
646 ldp x4, x5, [x0, #0x020]670 ldp x4, x5, [x0, #0x020]
...@@ -657,7 +681,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)...@@ -657,7 +681,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
657 ldp x24,x25, [x0, #0x0C0]681 ldp x24,x25, [x0, #0x0C0]
658 ldp x26,x27, [x0, #0x0D0]682 ldp x26,x27, [x0, #0x0D0]
659 ldp x28,x29, [x0, #0x0E0]683 ldp x28,x29, [x0, #0x0E0]
660 ldr x30, [x0, #0x100] // restore pc into lr684
661#if defined(__ARM_FP) && __ARM_FP != 0685#if defined(__ARM_FP) && __ARM_FP != 0
662 ldp d0, d1, [x0, #0x110]686 ldp d0, d1, [x0, #0x110]
663 ldp d2, d3, [x0, #0x120]687 ldp d2, d3, [x0, #0x120]
...@@ -681,7 +705,18 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)...@@ -681,7 +705,18 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
681 // context struct, because it is allocated on the stack, and an exception705 // context struct, because it is allocated on the stack, and an exception
682 // could clobber the de-allocated portion of the stack after sp has been706 // could clobber the de-allocated portion of the stack after sp has been
683 // restored.707 // restored.
684 ldr x16, [x0, #0x0F8]708
709 ldr x16, [x0, #0x0F8] // load sp into scratch
710 ldr lr, [x0, #0x100] // restore pc into lr
711
712#if __has_feature(ptrauth_calls)
713 // The LR is signed with its address inside the register state. Time
714 // to resign to be a regular ROP protected signed pointer
715 add x1, x0, #0x100
716 autib lr, x1
717 pacib lr, x16 // signed the scratch register for sp
718#endif
719
685 ldp x0, x1, [x0, #0x000] // restore x0,x1720 ldp x0, x1, [x0, #0x000] // restore x0,x1
686 mov sp,x16 // restore sp721 mov sp,x16 // restore sp
687#if defined(__ARM_FEATURE_GCS_DEFAULT)722#if defined(__ARM_FEATURE_GCS_DEFAULT)
...@@ -694,7 +729,12 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)...@@ -694,7 +729,12 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
694 gcspushm x30729 gcspushm x30
695Lnogcs:730Lnogcs:
696#endif731#endif
732
733#if __has_feature(ptrauth_calls)
734 retab
735#else
697 ret x30 // jump to pc736 ret x30 // jump to pc
737#endif
698738
699#elif defined(__arm__) && !defined(__APPLE__)739#elif defined(__arm__) && !defined(__APPLE__)
700740
...@@ -1253,7 +1293,8 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind19Registers_loongarch6jumptoEv)...@@ -1253,7 +1293,8 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind19Registers_loongarch6jumptoEv)
12531293
1254#endif1294#endif
12551295
1256#endif /* !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__) */1296#endif /* !defined(__USING_SJLJ_EXCEPTIONS__) */
12571297
1258NO_EXEC_STACK_DIRECTIVE1298NO_EXEC_STACK_DIRECTIVE
12591299
1300#endif /* !defined(__wasm__) */
lib/libunwind/src/UnwindRegistersSave.S+86-2
...@@ -6,6 +6,8 @@...@@ -6,6 +6,8 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#if !defined(__wasm__)
10
9#include "assembly.h"11#include "assembly.h"
1012
11#define FROM_0_TO_15 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1513#define FROM_0_TO_15 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
...@@ -16,13 +18,16 @@...@@ -16,13 +18,16 @@
1618
17#if defined(_AIX)19#if defined(_AIX)
18 .toc20 .toc
21#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
22 .section .text,"axy",@progbits,unique,0
19#else23#else
20 .text24 .text
21#endif25#endif
2226
23#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)27#if !defined(__USING_SJLJ_EXCEPTIONS__)
2428
25#if defined(__i386__)29#if defined(__i386__)
30.att_syntax
2631
27#32#
28# extern int __unw_getcontext(unw_context_t* thread_state)33# extern int __unw_getcontext(unw_context_t* thread_state)
...@@ -107,6 +112,7 @@ DEFINE_LIBUNWIND_FUNCTION("#__unw_getcontext")...@@ -107,6 +112,7 @@ DEFINE_LIBUNWIND_FUNCTION("#__unw_getcontext")
107 .text112 .text
108113
109#elif defined(__x86_64__)114#elif defined(__x86_64__)
115.att_syntax
110116
111#117#
112# extern int __unw_getcontext(unw_context_t* thread_state)118# extern int __unw_getcontext(unw_context_t* thread_state)
...@@ -759,6 +765,10 @@ LnoR2Fix:...@@ -759,6 +765,10 @@ LnoR2Fix:
759765
760#elif defined(__aarch64__)766#elif defined(__aarch64__)
761767
768#ifndef __has_feature
769#define __has_feature(__feature) 0
770#endif
771
762//772//
763// extern int __unw_getcontext(unw_context_t* thread_state)773// extern int __unw_getcontext(unw_context_t* thread_state)
764//774//
...@@ -767,6 +777,11 @@ LnoR2Fix:...@@ -767,6 +777,11 @@ LnoR2Fix:
767//777//
768 .p2align 2778 .p2align 2
769DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)779DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
780
781#if __has_feature(ptrauth_calls)
782 pacibsp
783#endif
784
770 stp x0, x1, [x0, #0x000]785 stp x0, x1, [x0, #0x000]
771 stp x2, x3, [x0, #0x010]786 stp x2, x3, [x0, #0x010]
772 stp x4, x5, [x0, #0x020]787 stp x4, x5, [x0, #0x020]
...@@ -807,7 +822,74 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -807,7 +822,74 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
807 str d31, [x0, #0x208]822 str d31, [x0, #0x208]
808#endif823#endif
809 mov x0, #0 // return UNW_ESUCCESS824 mov x0, #0 // return UNW_ESUCCESS
825
826#if __has_feature(ptrauth_calls)
827 retab
828#else
829 ret
830#endif
831
832//
833// extern "C" int64_t __libunwind_Registers_arm64_za_disable()
834//
835// This function implements the requirements of the __arm_za_disable ABI
836// routine, except that it will not abort; it will return a non-zero value
837// to signify the routine failed.
838//
839// Note: This function uses SME instructions. It must only be called if SME
840// has been confirmed to be available.
841//
842// On return:
843//
844// A status is placed in x0. A zero value indicates success; any non-zero
845// value indicates failure.
846//
847 .p2align 2
848DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_za_disable)
849 .variant_pcs __libunwind_Registers_arm64_za_disable
850#if __has_feature(ptrauth_calls)
851 pacibsp
852#endif
853 // If TPIDR2_EL0 is null, the subroutine just disables ZA.
854 .inst 0xd53bd0b0 // mrs x16, TPIDR2_EL0
855 cbz x16, 1f
856
857 // If any of the reserved bytes in the first 16 bytes of the TPIDR2 block are
858 // nonzero, return a non-zero value (libunwind will then abort).
859 ldrh w0, [x16, #10]
860 cbnz w0, 2f
861 ldr w0, [x16, #12]
862 cbnz w0, 2f
863
864 // If num_za_save_slices is zero, the subroutine just disables ZA.
865 ldrh w0, [x16, #8]
866 cbz x0, 1f
867
868 // If za_save_buffer is NULL, the subroutine just disables ZA.
869 ldr x16, [x16]
870 cbz x16, 1f
871
872 // Store ZA to za_save_buffer.
873 mov x15, xzr
8740:
875 .inst 0xe1206200 // str za[w15,0], [x16]
876 .inst 0x04305830 // addsvl x16, x16, #1
877 add x15, x15, #1
878 cmp x0, x15
879 b.ne 0b
8801:
881 // * Set TPIDR2_EL0 to null.
882 .inst 0xd51bd0bf // msr TPIDR2_EL0, xzr
883 // * Set PSTATE.ZA to 0.
884 .inst 0xd503447f // smstop za
885 // * Return zero (success)
886 mov x0, xzr
8872:
888#if __has_feature(ptrauth_calls)
889 retab
890#else
810 ret891 ret
892#endif
811893
812#elif defined(__arm__) && !defined(__APPLE__)894#elif defined(__arm__) && !defined(__APPLE__)
813895
...@@ -1232,6 +1314,8 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -1232,6 +1314,8 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
1232 WEAK_ALIAS(__unw_getcontext, unw_getcontext)1314 WEAK_ALIAS(__unw_getcontext, unw_getcontext)
1233#endif1315#endif
12341316
1235#endif /* !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__) */1317#endif /* !defined(__USING_SJLJ_EXCEPTIONS__) */
12361318
1237NO_EXEC_STACK_DIRECTIVE1319NO_EXEC_STACK_DIRECTIVE
1320
1321#endif /* !defined(__wasm__) */
lib/libunwind/src/assembly.h+5-1
...@@ -15,7 +15,7 @@...@@ -15,7 +15,7 @@
15#ifndef UNWIND_ASSEMBLY_H15#ifndef UNWIND_ASSEMBLY_H
16#define UNWIND_ASSEMBLY_H16#define UNWIND_ASSEMBLY_H
1717
18#if defined(__linux__) && defined(__CET__)18#if defined(__CET__)
19#include <cet.h>19#include <cet.h>
20#define _LIBUNWIND_CET_ENDBR _CET_ENDBR20#define _LIBUNWIND_CET_ENDBR _CET_ENDBR
21#else21#else
...@@ -132,6 +132,10 @@...@@ -132,6 +132,10 @@
132132
133#if defined(__APPLE__)133#if defined(__APPLE__)
134134
135#if defined(__aarch64__) || defined(__arm64__) || defined(__arm64e__)
136#define _LIBUNWIND_TRACE_RET_INJECT 1
137#endif
138
135#define SYMBOL_IS_FUNC(name)139#define SYMBOL_IS_FUNC(name)
136#define HIDDEN_SYMBOL(name) .private_extern name140#define HIDDEN_SYMBOL(name) .private_extern name
137#if defined(_LIBUNWIND_HIDE_SYMBOLS)141#if defined(_LIBUNWIND_HIDE_SYMBOLS)
lib/libunwind/src/config.h+9
...@@ -28,6 +28,9 @@...@@ -28,6 +28,9 @@
28 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 128 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
29 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 129 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
30 #endif30 #endif
31 #if defined(__aarch64__) || defined(__arm64__) || defined(__arm64e__)
32 #define _LIBUNWIND_TRACE_RET_INJECT 1
33 #endif
31#elif defined(_WIN32)34#elif defined(_WIN32)
32 #ifdef __SEH__35 #ifdef __SEH__
33 #define _LIBUNWIND_SUPPORT_SEH_UNWIND 136 #define _LIBUNWIND_SUPPORT_SEH_UNWIND 1
...@@ -61,6 +64,12 @@...@@ -61,6 +64,12 @@
61 #endif64 #endif
62#endif65#endif
6366
67#ifdef _LIBUNWIND_TRACE_RET_INJECT
68#define _LIBUNWIND_TRACE_NO_INLINE __attribute__((noinline, disable_tail_calls))
69#else
70#define _LIBUNWIND_TRACE_NO_INLINE
71#endif
72
64#if defined(_LIBUNWIND_HIDE_SYMBOLS)73#if defined(_LIBUNWIND_HIDE_SYMBOLS)
65 // The CMake file passes -fvisibility=hidden to control ELF/Mach-O visibility.74 // The CMake file passes -fvisibility=hidden to control ELF/Mach-O visibility.
66 #define _LIBUNWIND_EXPORT75 #define _LIBUNWIND_EXPORT
lib/libunwind/src/gcc_personality_v0.c+79-6
...@@ -31,6 +31,58 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,...@@ -31,6 +31,58 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
31 _Unwind_Personality_Fn);31 _Unwind_Personality_Fn);
32#endif32#endif
3333
34#ifndef __has_feature
35#define __has_feature(__feature) 0
36#endif
37
38#if __has_feature(ptrauth_calls)
39#include <ptrauth.h>
40
41// `__ptrauth_restricted_intptr` is a feature of apple clang that predates
42// support for direct application of `__ptrauth` to integer types. This
43// guard is necessary to support compilation with those compiler.
44#if __has_feature(ptrauth_restricted_intptr_qualifier)
45#define __ptrauth_gcc_personality_intptr(key, addressDiscriminated, \
46 discriminator) \
47 __ptrauth_restricted_intptr(key, addressDiscriminated, discriminator)
48#else
49#define __ptrauth_gcc_personality_intptr(key, addressDiscriminated, \
50 discriminator) \
51 __ptrauth(key, addressDiscriminated, discriminator)
52#endif
53#else
54#define __ptrauth_gcc_personality_intptr(...)
55#endif
56
57#define __ptrauth_gcc_personality_func_key ptrauth_key_function_pointer
58
59// ptrauth_string_discriminator("__gcc_personality_v0'funcStart") == 0xDFEB
60#define __ptrauth_gcc_personality_func_start \
61 __ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
62 0xDFEB)
63
64// ptrauth_string_discriminator("__gcc_personality_v0'start") == 0x52DC
65#define __ptrauth_gcc_personality_start \
66 __ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
67 0x52DC)
68
69// ptrauth_string_discriminator("__gcc_personality_v0'length") == 0xFFF7
70#define __ptrauth_gcc_personality_length \
71 __ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
72 0xFFF7)
73
74// ptrauth_string_discriminator("__gcc_personality_v0'landingPadOffset") ==
75// 0x6498
76#define __ptrauth_gcc_personality_lpoffset \
77 __ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
78 0x6498)
79
80// ptrauth_string_discriminator("__gcc_personality_v0'landingPad") == 0xA134
81#define __ptrauth_gcc_personality_lpad_disc 0xA134
82#define __ptrauth_gcc_personality_lpad \
83 __ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
84 __ptrauth_gcc_personality_lpad_disc)
85
34// Pointer encodings documented at:86// Pointer encodings documented at:
35// http://refspecs.freestandards.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html87// http://refspecs.freestandards.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html
3688
...@@ -206,7 +258,8 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(...@@ -206,7 +258,8 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
206 return continueUnwind(exceptionObject, context);258 return continueUnwind(exceptionObject, context);
207259
208 uintptr_t pc = (uintptr_t)_Unwind_GetIP(context) - 1;260 uintptr_t pc = (uintptr_t)_Unwind_GetIP(context) - 1;
209 uintptr_t funcStart = (uintptr_t)_Unwind_GetRegionStart(context);261 uintptr_t __ptrauth_gcc_personality_func_start funcStart =
262 (uintptr_t)_Unwind_GetRegionStart(context);
210 uintptr_t pcOffset = pc - funcStart;263 uintptr_t pcOffset = pc - funcStart;
211264
212 // Parse LSDA header.265 // Parse LSDA header.
...@@ -225,11 +278,14 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(...@@ -225,11 +278,14 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
225 const uint8_t *callSiteTableEnd = callSiteTableStart + callSiteTableLength;278 const uint8_t *callSiteTableEnd = callSiteTableStart + callSiteTableLength;
226 const uint8_t *p = callSiteTableStart;279 const uint8_t *p = callSiteTableStart;
227 while (p < callSiteTableEnd) {280 while (p < callSiteTableEnd) {
228 uintptr_t start = readEncodedPointer(&p, callSiteEncoding);281 uintptr_t __ptrauth_gcc_personality_start start =
229 size_t length = readEncodedPointer(&p, callSiteEncoding);282 readEncodedPointer(&p, callSiteEncoding);
230 size_t landingPad = readEncodedPointer(&p, callSiteEncoding);283 size_t __ptrauth_gcc_personality_length length =
284 readEncodedPointer(&p, callSiteEncoding);
285 size_t __ptrauth_gcc_personality_lpoffset landingPadOffset =
286 readEncodedPointer(&p, callSiteEncoding);
231 readULEB128(&p); // action value not used for C code287 readULEB128(&p); // action value not used for C code
232 if (landingPad == 0)288 if (landingPadOffset == 0)
233 continue; // no landing pad for this entry289 continue; // no landing pad for this entry
234 if ((start <= pcOffset) && (pcOffset < (start + length))) {290 if ((start <= pcOffset) && (pcOffset < (start + length))) {
235 // Found landing pad for the PC.291 // Found landing pad for the PC.
...@@ -239,7 +295,24 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(...@@ -239,7 +295,24 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
239 _Unwind_SetGR(context, __builtin_eh_return_data_regno(0),295 _Unwind_SetGR(context, __builtin_eh_return_data_regno(0),
240 (uintptr_t)exceptionObject);296 (uintptr_t)exceptionObject);
241 _Unwind_SetGR(context, __builtin_eh_return_data_regno(1), 0);297 _Unwind_SetGR(context, __builtin_eh_return_data_regno(1), 0);
242 _Unwind_SetIP(context, (funcStart + landingPad));298 size_t __ptrauth_gcc_personality_lpad landingPad =
299 funcStart + landingPadOffset;
300#if __has_feature(ptrauth_calls)
301 uintptr_t stackPointer = _Unwind_GetGR(context, -2);
302 const uintptr_t existingDiscriminator = ptrauth_blend_discriminator(
303 &landingPad, __ptrauth_gcc_personality_lpad_disc);
304 // newIP is authenticated as if it were qualified with a pseudo qualifier
305 // along the lines of:
306 // __ptrauth(ptrauth_key_return_address, <stackPointer>, 0)
307 // where the stack pointer is used in place of the strict storage
308 // address.
309 uintptr_t newIP = (uintptr_t)ptrauth_auth_and_resign(
310 *(void **)&landingPad, __ptrauth_gcc_personality_func_key,
311 existingDiscriminator, ptrauth_key_return_address, stackPointer);
312 _Unwind_SetIP(context, newIP);
313#else
314 _Unwind_SetIP(context, landingPad);
315#endif
243 return _URC_INSTALL_CONTEXT;316 return _URC_INSTALL_CONTEXT;
244 }317 }
245 }318 }
lib/libunwind/src/libunwind.cpp+104-4
...@@ -118,14 +118,55 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,...@@ -118,14 +118,55 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
118 typedef LocalAddressSpace::pint_t pint_t;118 typedef LocalAddressSpace::pint_t pint_t;
119 AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;119 AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
120 if (co->validReg(regNum)) {120 if (co->validReg(regNum)) {
121 co->setReg(regNum, (pint_t)value);
122 // special case altering IP to re-find info (being called by personality121 // special case altering IP to re-find info (being called by personality
123 // function)122 // function)
124 if (regNum == UNW_REG_IP) {123 if (regNum == UNW_REG_IP) {
125 unw_proc_info_t info;124 unw_proc_info_t info;
126 // First, get the FDE for the old location and then update it.125 // First, get the FDE for the old location and then update it.
127 co->getInfo(&info);126 co->getInfo(&info);
128 co->setInfoBasedOnIPRegister(false);127
128 pint_t sp = (pint_t)co->getReg(UNW_REG_SP);
129
130#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
131 {
132 // 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.
134 // The current signature of `value` is via the schema:
135 // __ptrauth(ptrauth_key_return_address, <<sp>>, 0)
136 // For this to be generally usable we manually re-sign it to the
137 // directly supported schema:
138 // __ptrauth(ptrauth_key_return_address, 1, 0)
139 unw_word_t
140 __unwind_ptrauth_restricted_intptr(ptrauth_key_return_address, 1,
141 0) authenticated_value;
142 unw_word_t opaque_value = (uint64_t)ptrauth_auth_and_resign(
143 (void *)value, ptrauth_key_return_address, sp,
144 ptrauth_key_return_address, &authenticated_value);
145 memmove(reinterpret_cast<void *>(&authenticated_value),
146 reinterpret_cast<void *>(&opaque_value),
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");
151
152 // PC should have been signed with the sp, so we verify that
153 // roundtripping does not fail. The `ptrauth_auth_and_resign` is
154 // guaranteed to trap on authentication failure even without FPAC
155 // feature.
156 pint_t pc = (pint_t)co->getReg(UNW_REG_IP);
157 if (ptrauth_auth_and_resign((void *)pc, ptrauth_key_return_address, sp,
158 ptrauth_key_return_address,
159 sp) != (void *)pc) {
160 _LIBUNWIND_LOG(
161 "Bad unwind with PAuth-enabled ABI (0x%zX, 0x%zX)->0x%zX\n", pc,
162 sp,
163 (pint_t)ptrauth_auth_data((void *)pc, ptrauth_key_return_address,
164 sp));
165 _LIBUNWIND_ABORT("Bad unwind with PAuth-enabled ABI");
166 }
167 }
168#endif
169
129 // If the original call expects stack adjustment, perform this now.170 // If the original call expects stack adjustment, perform this now.
130 // Normal frame unwinding would have included the offset already in the171 // Normal frame unwinding would have included the offset already in the
131 // CFA computation.172 // CFA computation.
...@@ -133,7 +174,11 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,...@@ -133,7 +174,11 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
133 // this should actually be - info.gp. LLVM doesn't currently support174 // this should actually be - info.gp. LLVM doesn't currently support
134 // any such platforms and Clang doesn't export a macro for them.175 // any such platforms and Clang doesn't export a macro for them.
135 if (info.gp)176 if (info.gp)
136 co->setReg(UNW_REG_SP, co->getReg(UNW_REG_SP) + info.gp);177 co->setReg(UNW_REG_SP, sp + info.gp);
178 co->setReg(UNW_REG_IP, value);
179 co->setInfoBasedOnIPRegister(false);
180 } else {
181 co->setReg(regNum, (pint_t)value);
137 }182 }
138 return UNW_ESUCCESS;183 return UNW_ESUCCESS;
139 }184 }
...@@ -205,7 +250,27 @@ _LIBUNWIND_HIDDEN int __unw_get_proc_info(unw_cursor_t *cursor,...@@ -205,7 +250,27 @@ _LIBUNWIND_HIDDEN int __unw_get_proc_info(unw_cursor_t *cursor,
205}250}
206_LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info)251_LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info)
207252
208/// Resume execution at cursor position (aka longjump).253/// Rebalance the execution flow by injecting the right amount of `ret`
254/// instruction relatively to the amount of `walkedFrames` then resume execution
255/// at cursor position (aka longjump).
256_LIBUNWIND_HIDDEN int __unw_resume_with_frames_walked(unw_cursor_t *cursor,
257 unsigned walkedFrames) {
258 _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p, walkedFrames=%u)",
259 static_cast<void *>(cursor), walkedFrames);
260#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
261 // Inform the ASan runtime that now might be a good time to clean stuff up.
262 __asan_handle_no_return();
263#endif
264#ifdef _LIBUNWIND_TRACE_RET_INJECT
265 AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
266 co->setWalkedFrames(walkedFrames);
267#endif
268 return __unw_resume(cursor);
269}
270_LIBUNWIND_WEAK_ALIAS(__unw_resume_with_frames_walked,
271 unw_resume_with_frames_walked)
272
273/// Legacy function. Resume execution at cursor position (aka longjump).
209_LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) {274_LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) {
210 _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor));275 _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor));
211#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)276#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
...@@ -347,6 +412,41 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) {...@@ -347,6 +412,41 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) {
347}412}
348413
349#endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)414#endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
415
416/// Maps the UNW_* error code to a textual representation
417_LIBUNWIND_HIDDEN const char *__unw_strerror(int error_code) {
418 switch (error_code) {
419 case UNW_ESUCCESS:
420 return "no error";
421 case UNW_EUNSPEC:
422 return "unspecified (general) error";
423 case UNW_ENOMEM:
424 return "out of memory";
425 case UNW_EBADREG:
426 return "bad register number";
427 case UNW_EREADONLYREG:
428 return "attempt to write read-only register";
429 case UNW_ESTOPUNWIND:
430 return "stop unwinding";
431 case UNW_EINVALIDIP:
432 return "invalid IP";
433 case UNW_EBADFRAME:
434 return "bad frame";
435 case UNW_EINVAL:
436 return "unsupported operation or bad value";
437 case UNW_EBADVERSION:
438 return "unwind info has unsupported version";
439 case UNW_ENOINFO:
440 return "no unwind info found";
441#if defined(_LIBUNWIND_TARGET_AARCH64) && !defined(_LIBUNWIND_IS_NATIVE_ONLY)
442 case UNW_ECROSSRASIGNING:
443 return "cross unwind with return address signing";
444#endif
445 }
446 return "invalid error code";
447}
448_LIBUNWIND_WEAK_ALIAS(__unw_strerror, unw_strerror)
449
350#endif // !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)450#endif // !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)
351451
352#ifdef __APPLE__452#ifdef __APPLE__
lib/libunwind/src/libunwind_ext.h+7-1
...@@ -26,11 +26,16 @@ extern "C" {...@@ -26,11 +26,16 @@ extern "C" {
26extern int __unw_getcontext(unw_context_t *);26extern int __unw_getcontext(unw_context_t *);
27extern int __unw_init_local(unw_cursor_t *, unw_context_t *);27extern int __unw_init_local(unw_cursor_t *, unw_context_t *);
28extern int __unw_step(unw_cursor_t *);28extern int __unw_step(unw_cursor_t *);
29extern int __unw_step_stage2(unw_cursor_t *);
29extern int __unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *);30extern int __unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *);
30extern int __unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *);31extern int __unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *);
31extern int __unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t);32extern int __unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t);
32extern int __unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t);33extern int __unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t);
33extern int __unw_resume(unw_cursor_t *);34_LIBUNWIND_TRACE_NO_INLINE
35 extern int __unw_resume_with_frames_walked(unw_cursor_t *, unsigned);
36// `__unw_resume` is a legacy function. Use `__unw_resume_with_frames_walked` instead.
37_LIBUNWIND_TRACE_NO_INLINE
38 extern int __unw_resume(unw_cursor_t *);
3439
35#ifdef __arm__40#ifdef __arm__
36/* Save VFP registers in FSTMX format (instead of FSTMD). */41/* Save VFP registers in FSTMX format (instead of FSTMD). */
...@@ -42,6 +47,7 @@ extern int __unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *);...@@ -42,6 +47,7 @@ extern int __unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *);
42extern int __unw_is_fpreg(unw_cursor_t *, unw_regnum_t);47extern int __unw_is_fpreg(unw_cursor_t *, unw_regnum_t);
43extern int __unw_is_signal_frame(unw_cursor_t *);48extern int __unw_is_signal_frame(unw_cursor_t *);
44extern int __unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *);49extern int __unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *);
50extern const char *__unw_strerror(int);
4551
46#if defined(_AIX)52#if defined(_AIX)
47extern uintptr_t __unw_get_data_rel_base(unw_cursor_t *);53extern uintptr_t __unw_get_data_rel_base(unw_cursor_t *);
lib/libunwind/src/shadow_stack_unwind.h+2-2
...@@ -12,8 +12,8 @@...@@ -12,8 +12,8 @@
1212
13#include "libunwind.h"13#include "libunwind.h"
1414
15// Currently, CET is implemented on Linux x86 platforms.15// Currently, CET is implemented on some ELF x86 platforms.
16#if defined(_LIBUNWIND_TARGET_LINUX) && defined(__CET__) && defined(__SHSTK__)16#if defined(__CET__) && defined(__SHSTK__)
17#define _LIBUNWIND_USE_CET 117#define _LIBUNWIND_USE_CET 1
18#endif18#endif
1919
lib/std/Io/test.zig-1
...@@ -137,7 +137,6 @@ test "File.setLength" {...@@ -137,7 +137,6 @@ test "File.setLength" {
137test "legacy setLength" {137test "legacy setLength" {
138 // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission)138 // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission)
139 if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest;139 if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest;
140 if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23806
141140
142 const io = testing.io;141 const io = testing.io;
143142
lib/std/Target.zig+11-2
...@@ -845,6 +845,12 @@ pub const Abi = enum {...@@ -845,6 +845,12 @@ pub const Abi = enum {
845 => .eabi,845 => .eabi,
846 else => .none,846 else => .none,
847 },847 },
848 .fuchsia => switch (arch) {
849 .arm,
850 .thumb,
851 => .eabihf,
852 else => .none,
853 },
848 .haiku => switch (arch) {854 .haiku => switch (arch) {
849 .arm,855 .arm,
850 .powerpc,856 .powerpc,
...@@ -928,7 +934,6 @@ pub const Abi = enum {...@@ -928,7 +934,6 @@ pub const Abi = enum {
928 .wasi, .emscripten => .musl,934 .wasi, .emscripten => .musl,
929935
930 .contiki,936 .contiki,
931 .fuchsia,
932 .hermit,937 .hermit,
933 .illumos,938 .illumos,
934 .managarm,939 .managarm,
...@@ -1014,6 +1019,7 @@ pub const Abi = enum {...@@ -1014,6 +1019,7 @@ pub const Abi = enum {
1014 .gnueabi,1019 .gnueabi,
1015 .musleabi,1020 .musleabi,
1016 .gnusf,1021 .gnusf,
1022 .muslsf,
1017 .ohoseabi,1023 .ohoseabi,
1018 => .soft,1024 => .soft,
1019 else => .hard,1025 else => .hard,
...@@ -1219,7 +1225,7 @@ pub const Cpu = struct {...@@ -1219,7 +1225,7 @@ pub const Cpu = struct {
1219 pub const Set = struct {1225 pub const Set = struct {
1220 ints: [usize_count]usize,1226 ints: [usize_count]usize,
12211227
1222 pub const needed_bit_count = 317;1228 pub const needed_bit_count = 347;
1223 pub const byte_count = (needed_bit_count + 7) / 8;1229 pub const byte_count = (needed_bit_count + 7) / 8;
1224 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);1230 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
1225 pub const Index = std.math.Log2Int(std.meta.Int(.unsigned, usize_count * @bitSizeOf(usize)));1231 pub const Index = std.math.Log2Int(std.meta.Int(.unsigned, usize_count * @bitSizeOf(usize)));
...@@ -2055,6 +2061,7 @@ pub const Cpu = struct {...@@ -2055,6 +2061,7 @@ pub const Cpu = struct {
2055 .hppa => &hppa.cpu.pa_7300lc,2061 .hppa => &hppa.cpu.pa_7300lc,
2056 .kvx => &kvx.cpu.coolidge_v2,2062 .kvx => &kvx.cpu.coolidge_v2,
2057 .lanai => &lanai.cpu.v11, // clang does not have a generic lanai model.2063 .lanai => &lanai.cpu.v11, // clang does not have a generic lanai model.
2064 .loongarch32 => &loongarch.cpu.la32v1_0,
2058 .loongarch64 => &loongarch.cpu.la64v1_0,2065 .loongarch64 => &loongarch.cpu.la64v1_0,
2059 .m68k => &m68k.cpu.M68000,2066 .m68k => &m68k.cpu.M68000,
2060 .mips => &mips.cpu.mips32r2,2067 .mips => &mips.cpu.mips32r2,
...@@ -2442,8 +2449,10 @@ pub const DynamicLinker = struct {...@@ -2442,8 +2449,10 @@ pub const DynamicLinker = struct {
2442 pub fn standard(cpu: Cpu, os: Os, abi: Abi) DynamicLinker {2449 pub fn standard(cpu: Cpu, os: Os, abi: Abi) DynamicLinker {
2443 return switch (os.tag) {2450 return switch (os.tag) {
2444 .fuchsia => switch (cpu.arch) {2451 .fuchsia => switch (cpu.arch) {
2452 .arm,
2445 .aarch64,2453 .aarch64,
2446 .riscv64,2454 .riscv64,
2455 .thumb,
2447 .x86_64,2456 .x86_64,
2448 => init("ld.so.1"), // Fuchsia is unusual in that `DT_INTERP` is just a basename.2457 => init("ld.so.1"), // Fuchsia is unusual in that `DT_INTERP` is just a basename.
2449 else => none,2458 else => none,
lib/std/Target/aarch64.zig+620-77
...@@ -9,6 +9,7 @@ pub const Feature = enum {...@@ -9,6 +9,7 @@ pub const Feature = enum {
9 addr_lsl_slow_14,9 addr_lsl_slow_14,
10 aes,10 aes,
11 aggressive_fma,11 aggressive_fma,
12 aggressive_interleaving,
12 alternate_sextload_cvt_f32_pattern,13 alternate_sextload_cvt_f32_pattern,
13 altnzcv,14 altnzcv,
14 alu_lsl_fast,15 alu_lsl_fast,
...@@ -22,6 +23,7 @@ pub const Feature = enum {...@@ -22,6 +23,7 @@ pub const Feature = enum {
22 bf16,23 bf16,
23 brbe,24 brbe,
24 bti,25 bti,
26 btie,
25 call_saved_x10,27 call_saved_x10,
26 call_saved_x11,28 call_saved_x11,
27 call_saved_x12,29 call_saved_x12,
...@@ -36,6 +38,7 @@ pub const Feature = enum {...@@ -36,6 +38,7 @@ pub const Feature = enum {
36 ccpp,38 ccpp,
37 chk,39 chk,
38 clrbhb,40 clrbhb,
41 cmh,
39 cmp_bcc_fusion,42 cmp_bcc_fusion,
40 cmpbr,43 cmpbr,
41 complxnum,44 complxnum,
...@@ -48,7 +51,9 @@ pub const Feature = enum {...@@ -48,7 +51,9 @@ pub const Feature = enum {
48 disable_fast_inc_vl,51 disable_fast_inc_vl,
49 disable_latency_sched_heuristic,52 disable_latency_sched_heuristic,
50 disable_ldp,53 disable_ldp,
54 disable_maximize_scalable_bandwidth,
51 disable_stp,55 disable_stp,
56 disable_unpredicated_ld_st_lower,
52 dit,57 dit,
53 dotprod,58 dotprod,
54 ecv,59 ecv,
...@@ -58,6 +63,9 @@ pub const Feature = enum {...@@ -58,6 +63,9 @@ pub const Feature = enum {
58 ete,63 ete,
59 execute_only,64 execute_only,
60 exynos_cheap_as_move,65 exynos_cheap_as_move,
66 f16f32dot,
67 f16f32mm,
68 f16mm,
61 f32mm,69 f32mm,
62 f64mm,70 f64mm,
63 f8f16mm,71 f8f16mm,
...@@ -86,7 +94,9 @@ pub const Feature = enum {...@@ -86,7 +94,9 @@ pub const Feature = enum {
86 fuse_arith_logic,94 fuse_arith_logic,
87 fuse_crypto_eor,95 fuse_crypto_eor,
88 fuse_csel,96 fuse_csel,
97 fuse_cset,
89 fuse_literals,98 fuse_literals,
99 gcie,
90 gcs,100 gcs,
91 harden_sls_blr,101 harden_sls_blr,
92 harden_sls_nocomdat,102 harden_sls_nocomdat,
...@@ -99,22 +109,27 @@ pub const Feature = enum {...@@ -99,22 +109,27 @@ pub const Feature = enum {
99 ldp_aligned_only,109 ldp_aligned_only,
100 lor,110 lor,
101 ls64,111 ls64,
112 lscp,
102 lse,113 lse,
103 lse128,114 lse128,
104 lse2,115 lse2,
105 lsfe,116 lsfe,
106 lsui,117 lsui,
107 lut,118 lut,
119 max_interleave_factor_4,
108 mec,120 mec,
109 mops,121 mops,
122 mops_go,
110 mpam,123 mpam,
124 mpamv2,
111 mte,125 mte,
126 mtetc,
112 neon,127 neon,
113 nmi,128 nmi,
114 no_bti_at_return_twice,129 no_bti_at_return_twice,
115 no_neg_immediates,130 no_neg_immediates,
116 no_sve_fp_ld1r,131 no_sve_fp_ld1r,
117 no_zcz_fp,132 no_zcz_fpr64,
118 nv,133 nv,
119 occmo,134 occmo,
120 olympus,135 olympus,
...@@ -125,6 +140,7 @@ pub const Feature = enum {...@@ -125,6 +140,7 @@ pub const Feature = enum {
125 pauth_lr,140 pauth_lr,
126 pcdphint,141 pcdphint,
127 perfmon,142 perfmon,
143 poe2,
128 pops,144 pops,
129 predictable_select_expensive,145 predictable_select_expensive,
130 predres,146 predres,
...@@ -174,6 +190,7 @@ pub const Feature = enum {...@@ -174,6 +190,7 @@ pub const Feature = enum {
174 sme2,190 sme2,
175 sme2p1,191 sme2p1,
176 sme2p2,192 sme2p2,
193 sme2p3,
177 sme_b16b16,194 sme_b16b16,
178 sme_f16f16,195 sme_f16f16,
179 sme_f64f64,196 sme_f64f64,
...@@ -206,19 +223,22 @@ pub const Feature = enum {...@@ -206,19 +223,22 @@ pub const Feature = enum {
206 sve2_sm4,223 sve2_sm4,
207 sve2p1,224 sve2p1,
208 sve2p2,225 sve2p2,
226 sve2p3,
209 sve_aes,227 sve_aes,
210 sve_aes2,228 sve_aes2,
211 sve_b16b16,229 sve_b16b16,
230 sve_b16mm,
212 sve_bfscale,231 sve_bfscale,
213 sve_bitperm,232 sve_bitperm,
214 sve_f16f32mm,233 sve_f16f32mm,
215 sve_sha3,234 sve_sha3,
216 sve_sm4,235 sve_sm4,
217 tagged_globals,236 tagged_globals,
237 tev,
218 the,238 the,
219 tlb_rmi,239 tlb_rmi,
240 tlbid,
220 tlbiw,241 tlbiw,
221 tme,
222 tpidr_el1,242 tpidr_el1,
223 tpidr_el2,243 tpidr_el2,
224 tpidr_el3,244 tpidr_el3,
...@@ -230,6 +250,7 @@ pub const Feature = enum {...@@ -230,6 +250,7 @@ pub const Feature = enum {
230 use_fixed_over_scalable_if_equal_cost,250 use_fixed_over_scalable_if_equal_cost,
231 use_postra_scheduler,251 use_postra_scheduler,
232 use_reciprocal_square_root,252 use_reciprocal_square_root,
253 use_wzr_to_vec_move,
233 v8_1a,254 v8_1a,
234 v8_2a,255 v8_2a,
235 v8_3a,256 v8_3a,
...@@ -247,17 +268,20 @@ pub const Feature = enum {...@@ -247,17 +268,20 @@ pub const Feature = enum {
247 v9_4a,268 v9_4a,
248 v9_5a,269 v9_5a,
249 v9_6a,270 v9_6a,
271 v9_7a,
250 v9a,272 v9a,
251 vh,273 vh,
252 wfxt,274 wfxt,
253 xs,275 xs,
276 zcm_fpr128,
254 zcm_fpr32,277 zcm_fpr32,
255 zcm_fpr64,278 zcm_fpr64,
256 zcm_gpr32,279 zcm_gpr32,
257 zcm_gpr64,280 zcm_gpr64,
258 zcz,
259 zcz_fp_workaround,281 zcz_fp_workaround,
260 zcz_gp,282 zcz_fpr128,
283 zcz_gpr32,
284 zcz_gpr64,
261};285};
262286
263pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet;287pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet;
...@@ -274,9 +298,12 @@ pub const all_features = blk: {...@@ -274,9 +298,12 @@ pub const all_features = blk: {
274 .llvm_name = "a320",298 .llvm_name = "a320",
275 .description = "Cortex-A320 ARM processors",299 .description = "Cortex-A320 ARM processors",
276 .dependencies = featureSet(&[_]Feature{300 .dependencies = featureSet(&[_]Feature{
301 .aggressive_interleaving,
277 .fuse_adrp_add,302 .fuse_adrp_add,
278 .fuse_aes,303 .fuse_aes,
304 .use_fixed_over_scalable_if_equal_cost,
279 .use_postra_scheduler,305 .use_postra_scheduler,
306 .use_wzr_to_vec_move,
280 }),307 }),
281 };308 };
282 result[@intFromEnum(Feature.addr_lsl_slow_14)] = .{309 result[@intFromEnum(Feature.addr_lsl_slow_14)] = .{
...@@ -296,6 +323,11 @@ pub const all_features = blk: {...@@ -296,6 +323,11 @@ pub const all_features = blk: {
296 .description = "Enable Aggressive FMA for floating-point.",323 .description = "Enable Aggressive FMA for floating-point.",
297 .dependencies = featureSet(&[_]Feature{}),324 .dependencies = featureSet(&[_]Feature{}),
298 };325 };
326 result[@intFromEnum(Feature.aggressive_interleaving)] = .{
327 .llvm_name = "aggressive-interleaving",
328 .description = "Make use of aggressive interleaving during vectorization",
329 .dependencies = featureSet(&[_]Feature{}),
330 };
299 result[@intFromEnum(Feature.alternate_sextload_cvt_f32_pattern)] = .{331 result[@intFromEnum(Feature.alternate_sextload_cvt_f32_pattern)] = .{
300 .llvm_name = "alternate-sextload-cvt-f32-pattern",332 .llvm_name = "alternate-sextload-cvt-f32-pattern",
301 .description = "Use alternative pattern for sextload convert to f32",333 .description = "Use alternative pattern for sextload convert to f32",
...@@ -367,6 +399,11 @@ pub const all_features = blk: {...@@ -367,6 +399,11 @@ pub const all_features = blk: {
367 .description = "Enable Branch Target Identification",399 .description = "Enable Branch Target Identification",
368 .dependencies = featureSet(&[_]Feature{}),400 .dependencies = featureSet(&[_]Feature{}),
369 };401 };
402 result[@intFromEnum(Feature.btie)] = .{
403 .llvm_name = "btie",
404 .description = "Enable Enhanced Branch Target Identification extension",
405 .dependencies = featureSet(&[_]Feature{}),
406 };
370 result[@intFromEnum(Feature.call_saved_x10)] = .{407 result[@intFromEnum(Feature.call_saved_x10)] = .{
371 .llvm_name = "call-saved-x10",408 .llvm_name = "call-saved-x10",
372 .description = "Make X10 callee saved.",409 .description = "Make X10 callee saved.",
...@@ -439,6 +476,11 @@ pub const all_features = blk: {...@@ -439,6 +476,11 @@ pub const all_features = blk: {
439 .description = "Enable Clear BHB instruction",476 .description = "Enable Clear BHB instruction",
440 .dependencies = featureSet(&[_]Feature{}),477 .dependencies = featureSet(&[_]Feature{}),
441 };478 };
479 result[@intFromEnum(Feature.cmh)] = .{
480 .llvm_name = "cmh",
481 .description = "Enable Armv9.7-A Contention Management Hints",
482 .dependencies = featureSet(&[_]Feature{}),
483 };
442 result[@intFromEnum(Feature.cmp_bcc_fusion)] = .{484 result[@intFromEnum(Feature.cmp_bcc_fusion)] = .{
443 .llvm_name = "cmp-bcc-fusion",485 .llvm_name = "cmp-bcc-fusion",
444 .description = "CPU fuses cmp+bcc operations",486 .description = "CPU fuses cmp+bcc operations",
...@@ -506,11 +548,21 @@ pub const all_features = blk: {...@@ -506,11 +548,21 @@ pub const all_features = blk: {
506 .description = "Do not emit ldp",548 .description = "Do not emit ldp",
507 .dependencies = featureSet(&[_]Feature{}),549 .dependencies = featureSet(&[_]Feature{}),
508 };550 };
551 result[@intFromEnum(Feature.disable_maximize_scalable_bandwidth)] = .{
552 .llvm_name = "disable-maximize-scalable-bandwidth",
553 .description = "Determine the maximum scalable vector length for a loop by the largest scalar type rather than the smallest",
554 .dependencies = featureSet(&[_]Feature{}),
555 };
509 result[@intFromEnum(Feature.disable_stp)] = .{556 result[@intFromEnum(Feature.disable_stp)] = .{
510 .llvm_name = "disable-stp",557 .llvm_name = "disable-stp",
511 .description = "Do not emit stp",558 .description = "Do not emit stp",
512 .dependencies = featureSet(&[_]Feature{}),559 .dependencies = featureSet(&[_]Feature{}),
513 };560 };
561 result[@intFromEnum(Feature.disable_unpredicated_ld_st_lower)] = .{
562 .llvm_name = "disable-unpredicated-ld-st-lower",
563 .description = "Disable lowering unpredicated loads/stores as LDR/STR",
564 .dependencies = featureSet(&[_]Feature{}),
565 };
514 result[@intFromEnum(Feature.dit)] = .{566 result[@intFromEnum(Feature.dit)] = .{
515 .llvm_name = "dit",567 .llvm_name = "dit",
516 .description = "Enable Armv8.4-A Data Independent Timing instructions",568 .description = "Enable Armv8.4-A Data Independent Timing instructions",
...@@ -560,6 +612,30 @@ pub const all_features = blk: {...@@ -560,6 +612,30 @@ pub const all_features = blk: {
560 .description = "Use Exynos specific handling of cheap instructions",612 .description = "Use Exynos specific handling of cheap instructions",
561 .dependencies = featureSet(&[_]Feature{}),613 .dependencies = featureSet(&[_]Feature{}),
562 };614 };
615 result[@intFromEnum(Feature.f16f32dot)] = .{
616 .llvm_name = "f16f32dot",
617 .description = "Enable Armv9.7-A Advanced SIMD half-precision dot product accumulate to single-precision",
618 .dependencies = featureSet(&[_]Feature{
619 .fullfp16,
620 .neon,
621 }),
622 };
623 result[@intFromEnum(Feature.f16f32mm)] = .{
624 .llvm_name = "f16f32mm",
625 .description = "Enable Armv9.7-A Advanced SIMD half-precision matrix multiply-accumulate to single-precision",
626 .dependencies = featureSet(&[_]Feature{
627 .fullfp16,
628 .neon,
629 }),
630 };
631 result[@intFromEnum(Feature.f16mm)] = .{
632 .llvm_name = "f16mm",
633 .description = "Enable Armv9.7-A non-widening half-precision matrix multiply-accumulate",
634 .dependencies = featureSet(&[_]Feature{
635 .fullfp16,
636 .neon,
637 }),
638 };
563 result[@intFromEnum(Feature.f32mm)] = .{639 result[@intFromEnum(Feature.f32mm)] = .{
564 .llvm_name = "f32mm",640 .llvm_name = "f32mm",
565 .description = "Enable Matrix Multiply FP32 Extension",641 .description = "Enable Matrix Multiply FP32 Extension",
...@@ -729,7 +805,12 @@ pub const all_features = blk: {...@@ -729,7 +805,12 @@ pub const all_features = blk: {
729 };805 };
730 result[@intFromEnum(Feature.fuse_csel)] = .{806 result[@intFromEnum(Feature.fuse_csel)] = .{
731 .llvm_name = "fuse-csel",807 .llvm_name = "fuse-csel",
732 .description = "CPU fuses conditional select operations",808 .description = "CPU can fuse CMP and CSEL operations",
809 .dependencies = featureSet(&[_]Feature{}),
810 };
811 result[@intFromEnum(Feature.fuse_cset)] = .{
812 .llvm_name = "fuse-cset",
813 .description = "CPU can fuse CMP and CSET operations",
733 .dependencies = featureSet(&[_]Feature{}),814 .dependencies = featureSet(&[_]Feature{}),
734 };815 };
735 result[@intFromEnum(Feature.fuse_literals)] = .{816 result[@intFromEnum(Feature.fuse_literals)] = .{
...@@ -737,6 +818,11 @@ pub const all_features = blk: {...@@ -737,6 +818,11 @@ pub const all_features = blk: {
737 .description = "CPU fuses literal generation operations",818 .description = "CPU fuses literal generation operations",
738 .dependencies = featureSet(&[_]Feature{}),819 .dependencies = featureSet(&[_]Feature{}),
739 };820 };
821 result[@intFromEnum(Feature.gcie)] = .{
822 .llvm_name = "gcie",
823 .description = "Enable GICv5 (Generic Interrupt Controller) CPU Interface Extension",
824 .dependencies = featureSet(&[_]Feature{}),
825 };
740 result[@intFromEnum(Feature.gcs)] = .{826 result[@intFromEnum(Feature.gcs)] = .{
741 .llvm_name = "gcs",827 .llvm_name = "gcs",
742 .description = "Enable Armv9.4-A Guarded Call Stack Extension",828 .description = "Enable Armv9.4-A Guarded Call Stack Extension",
...@@ -805,6 +891,11 @@ pub const all_features = blk: {...@@ -805,6 +891,11 @@ pub const all_features = blk: {
805 .description = "Enable Armv8.7-A LD64B/ST64B Accelerator Extension",891 .description = "Enable Armv8.7-A LD64B/ST64B Accelerator Extension",
806 .dependencies = featureSet(&[_]Feature{}),892 .dependencies = featureSet(&[_]Feature{}),
807 };893 };
894 result[@intFromEnum(Feature.lscp)] = .{
895 .llvm_name = "lscp",
896 .description = "Enable Armv9.7-A Load-acquire and store-release pair extension",
897 .dependencies = featureSet(&[_]Feature{}),
898 };
808 result[@intFromEnum(Feature.lse)] = .{899 result[@intFromEnum(Feature.lse)] = .{
809 .llvm_name = "lse",900 .llvm_name = "lse",
810 .description = "Enable Armv8.1-A Large System Extension (LSE) atomic instructions",901 .description = "Enable Armv8.1-A Large System Extension (LSE) atomic instructions",
...@@ -841,6 +932,11 @@ pub const all_features = blk: {...@@ -841,6 +932,11 @@ pub const all_features = blk: {
841 .neon,932 .neon,
842 }),933 }),
843 };934 };
935 result[@intFromEnum(Feature.max_interleave_factor_4)] = .{
936 .llvm_name = "max-interleave-factor-4",
937 .description = "Set the MaxInterleaveFactor to 4 (from the default 2)",
938 .dependencies = featureSet(&[_]Feature{}),
939 };
844 result[@intFromEnum(Feature.mec)] = .{940 result[@intFromEnum(Feature.mec)] = .{
845 .llvm_name = "mec",941 .llvm_name = "mec",
846 .description = "Enable Memory Encryption Contexts Extension",942 .description = "Enable Memory Encryption Contexts Extension",
...@@ -853,16 +949,36 @@ pub const all_features = blk: {...@@ -853,16 +949,36 @@ pub const all_features = blk: {
853 .description = "Enable Armv8.8-A memcpy and memset acceleration instructions",949 .description = "Enable Armv8.8-A memcpy and memset acceleration instructions",
854 .dependencies = featureSet(&[_]Feature{}),950 .dependencies = featureSet(&[_]Feature{}),
855 };951 };
952 result[@intFromEnum(Feature.mops_go)] = .{
953 .llvm_name = "mops-go",
954 .description = "Enable memset acceleration granule only",
955 .dependencies = featureSet(&[_]Feature{
956 .mops,
957 .mte,
958 }),
959 };
856 result[@intFromEnum(Feature.mpam)] = .{960 result[@intFromEnum(Feature.mpam)] = .{
857 .llvm_name = "mpam",961 .llvm_name = "mpam",
858 .description = "Enable Armv8.4-A Memory system Partitioning and Monitoring extension",962 .description = "Enable Armv8.4-A Memory system Partitioning and Monitoring extension",
859 .dependencies = featureSet(&[_]Feature{}),963 .dependencies = featureSet(&[_]Feature{}),
860 };964 };
965 result[@intFromEnum(Feature.mpamv2)] = .{
966 .llvm_name = "mpamv2",
967 .description = "Enable Armv9.7-A MPAMv2 Lookaside Buffer Invalidate instructions",
968 .dependencies = featureSet(&[_]Feature{}),
969 };
861 result[@intFromEnum(Feature.mte)] = .{970 result[@intFromEnum(Feature.mte)] = .{
862 .llvm_name = "mte",971 .llvm_name = "mte",
863 .description = "Enable Memory Tagging Extension",972 .description = "Enable Memory Tagging Extension",
864 .dependencies = featureSet(&[_]Feature{}),973 .dependencies = featureSet(&[_]Feature{}),
865 };974 };
975 result[@intFromEnum(Feature.mtetc)] = .{
976 .llvm_name = "mtetc",
977 .description = "Enable Virtual Memory Tagging Extension",
978 .dependencies = featureSet(&[_]Feature{
979 .mte,
980 }),
981 };
866 result[@intFromEnum(Feature.neon)] = .{982 result[@intFromEnum(Feature.neon)] = .{
867 .llvm_name = "neon",983 .llvm_name = "neon",
868 .description = "Enable Advanced SIMD instructions",984 .description = "Enable Advanced SIMD instructions",
...@@ -890,9 +1006,9 @@ pub const all_features = blk: {...@@ -890,9 +1006,9 @@ pub const all_features = blk: {
890 .description = "Avoid using LD1RX instructions for FP",1006 .description = "Avoid using LD1RX instructions for FP",
891 .dependencies = featureSet(&[_]Feature{}),1007 .dependencies = featureSet(&[_]Feature{}),
892 };1008 };
893 result[@intFromEnum(Feature.no_zcz_fp)] = .{1009 result[@intFromEnum(Feature.no_zcz_fpr64)] = .{
894 .llvm_name = "no-zcz-fp",1010 .llvm_name = "no-zcz-fpr64",
895 .description = "Has no zero-cycle zeroing instructions for FP registers",1011 .description = "Has no zero-cycle zeroing instructions for FPR64 registers",
896 .dependencies = featureSet(&[_]Feature{}),1012 .dependencies = featureSet(&[_]Feature{}),
897 };1013 };
898 result[@intFromEnum(Feature.nv)] = .{1014 result[@intFromEnum(Feature.nv)] = .{
...@@ -914,6 +1030,7 @@ pub const all_features = blk: {...@@ -914,6 +1030,7 @@ pub const all_features = blk: {
914 .enable_select_opt,1030 .enable_select_opt,
915 .fuse_adrp_add,1031 .fuse_adrp_add,
916 .fuse_aes,1032 .fuse_aes,
1033 .max_interleave_factor_4,
917 .predictable_select_expensive,1034 .predictable_select_expensive,
918 .use_fixed_over_scalable_if_equal_cost,1035 .use_fixed_over_scalable_if_equal_cost,
919 .use_postra_scheduler,1036 .use_postra_scheduler,
...@@ -956,6 +1073,11 @@ pub const all_features = blk: {...@@ -956,6 +1073,11 @@ pub const all_features = blk: {
956 .description = "Enable Armv8.0-A PMUv3 Performance Monitors extension",1073 .description = "Enable Armv8.0-A PMUv3 Performance Monitors extension",
957 .dependencies = featureSet(&[_]Feature{}),1074 .dependencies = featureSet(&[_]Feature{}),
958 };1075 };
1076 result[@intFromEnum(Feature.poe2)] = .{
1077 .llvm_name = "poe2",
1078 .description = "Enable Stage 1 Permission Overlays Extension 2 instructions",
1079 .dependencies = featureSet(&[_]Feature{}),
1080 };
959 result[@intFromEnum(Feature.pops)] = .{1081 result[@intFromEnum(Feature.pops)] = .{
960 .llvm_name = "pops",1082 .llvm_name = "pops",
961 .description = "Enable Armv9.6-A Point Of Physical Storage (PoPS) DC instructions",1083 .description = "Enable Armv9.6-A Point Of Physical Storage (PoPS) DC instructions",
...@@ -1224,6 +1346,13 @@ pub const all_features = blk: {...@@ -1224,6 +1346,13 @@ pub const all_features = blk: {
1224 .sme2p1,1346 .sme2p1,
1225 }),1347 }),
1226 };1348 };
1349 result[@intFromEnum(Feature.sme2p3)] = .{
1350 .llvm_name = "sme2p3",
1351 .description = "Enable Armv9.7-A Scalable Matrix Extension 2.3 instructions",
1352 .dependencies = featureSet(&[_]Feature{
1353 .sme2p2,
1354 }),
1355 };
1227 result[@intFromEnum(Feature.sme_b16b16)] = .{1356 result[@intFromEnum(Feature.sme_b16b16)] = .{
1228 .llvm_name = "sme-b16b16",1357 .llvm_name = "sme-b16b16",
1229 .description = "Enable SME2.1 ZA-targeting non-widening BFloat16 instructions",1358 .description = "Enable SME2.1 ZA-targeting non-widening BFloat16 instructions",
...@@ -1447,6 +1576,13 @@ pub const all_features = blk: {...@@ -1447,6 +1576,13 @@ pub const all_features = blk: {
1447 .sve2p1,1576 .sve2p1,
1448 }),1577 }),
1449 };1578 };
1579 result[@intFromEnum(Feature.sve2p3)] = .{
1580 .llvm_name = "sve2p3",
1581 .description = "Enable Armv9.7-A Scalable Vector Extension 2.3 instructions",
1582 .dependencies = featureSet(&[_]Feature{
1583 .sve2p2,
1584 }),
1585 };
1450 result[@intFromEnum(Feature.sve_aes)] = .{1586 result[@intFromEnum(Feature.sve_aes)] = .{
1451 .llvm_name = "sve-aes",1587 .llvm_name = "sve-aes",
1452 .description = "Enable SVE AES and quadword SVE polynomial multiply instructions",1588 .description = "Enable SVE AES and quadword SVE polynomial multiply instructions",
...@@ -1464,6 +1600,13 @@ pub const all_features = blk: {...@@ -1464,6 +1600,13 @@ pub const all_features = blk: {
1464 .description = "Enable SVE2 non-widening and SME2 Z-targeting non-widening BFloat16 instructions",1600 .description = "Enable SVE2 non-widening and SME2 Z-targeting non-widening BFloat16 instructions",
1465 .dependencies = featureSet(&[_]Feature{}),1601 .dependencies = featureSet(&[_]Feature{}),
1466 };1602 };
1603 result[@intFromEnum(Feature.sve_b16mm)] = .{
1604 .llvm_name = "sve-b16mm",
1605 .description = "Enable Armv9.7-A SVE non-widening BFloat16 matrix multiply-accumulate",
1606 .dependencies = featureSet(&[_]Feature{
1607 .sve,
1608 }),
1609 };
1467 result[@intFromEnum(Feature.sve_bfscale)] = .{1610 result[@intFromEnum(Feature.sve_bfscale)] = .{
1468 .llvm_name = "sve-bfscale",1611 .llvm_name = "sve-bfscale",
1469 .description = "Enable Armv9.6-A SVE BFloat16 scaling instructions",1612 .description = "Enable Armv9.6-A SVE BFloat16 scaling instructions",
...@@ -1500,6 +1643,11 @@ pub const all_features = blk: {...@@ -1500,6 +1643,11 @@ pub const all_features = blk: {
1500 .description = "Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits",1643 .description = "Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits",
1501 .dependencies = featureSet(&[_]Feature{}),1644 .dependencies = featureSet(&[_]Feature{}),
1502 };1645 };
1646 result[@intFromEnum(Feature.tev)] = .{
1647 .llvm_name = "tev",
1648 .description = "Enable TIndex Exception-like Vector instructions",
1649 .dependencies = featureSet(&[_]Feature{}),
1650 };
1503 result[@intFromEnum(Feature.the)] = .{1651 result[@intFromEnum(Feature.the)] = .{
1504 .llvm_name = "the",1652 .llvm_name = "the",
1505 .description = "Enable Armv8.9-A Translation Hardening Extension",1653 .description = "Enable Armv8.9-A Translation Hardening Extension",
...@@ -1510,16 +1658,16 @@ pub const all_features = blk: {...@@ -1510,16 +1658,16 @@ pub const all_features = blk: {
1510 .description = "Enable Armv8.4-A TLB Range and Maintenance instructions",1658 .description = "Enable Armv8.4-A TLB Range and Maintenance instructions",
1511 .dependencies = featureSet(&[_]Feature{}),1659 .dependencies = featureSet(&[_]Feature{}),
1512 };1660 };
1661 result[@intFromEnum(Feature.tlbid)] = .{
1662 .llvm_name = "tlbid",
1663 .description = "Enable Armv9.7-A TLBI Domains extension",
1664 .dependencies = featureSet(&[_]Feature{}),
1665 };
1513 result[@intFromEnum(Feature.tlbiw)] = .{1666 result[@intFromEnum(Feature.tlbiw)] = .{
1514 .llvm_name = "tlbiw",1667 .llvm_name = "tlbiw",
1515 .description = "Enable Armv9.5-A TLBI VMALL for Dirty State",1668 .description = "Enable Armv9.5-A TLBI VMALL for Dirty State",
1516 .dependencies = featureSet(&[_]Feature{}),1669 .dependencies = featureSet(&[_]Feature{}),
1517 };1670 };
1518 result[@intFromEnum(Feature.tme)] = .{
1519 .llvm_name = "tme",
1520 .description = "Enable Transactional Memory Extension",
1521 .dependencies = featureSet(&[_]Feature{}),
1522 };
1523 result[@intFromEnum(Feature.tpidr_el1)] = .{1671 result[@intFromEnum(Feature.tpidr_el1)] = .{
1524 .llvm_name = "tpidr-el1",1672 .llvm_name = "tpidr-el1",
1525 .description = "Permit use of TPIDR_EL1 for the TLS base",1673 .description = "Permit use of TPIDR_EL1 for the TLS base",
...@@ -1575,6 +1723,11 @@ pub const all_features = blk: {...@@ -1575,6 +1723,11 @@ pub const all_features = blk: {
1575 .description = "Use the reciprocal square root approximation",1723 .description = "Use the reciprocal square root approximation",
1576 .dependencies = featureSet(&[_]Feature{}),1724 .dependencies = featureSet(&[_]Feature{}),
1577 };1725 };
1726 result[@intFromEnum(Feature.use_wzr_to_vec_move)] = .{
1727 .llvm_name = "use-wzr-to-vec-move",
1728 .description = "Move from WZR to insert 0 into vector registers",
1729 .dependencies = featureSet(&[_]Feature{}),
1730 };
1578 result[@intFromEnum(Feature.v8_1a)] = .{1731 result[@intFromEnum(Feature.v8_1a)] = .{
1579 .llvm_name = "v8.1a",1732 .llvm_name = "v8.1a",
1580 .description = "Support ARM v8.1a architecture",1733 .description = "Support ARM v8.1a architecture",
...@@ -1783,6 +1936,16 @@ pub const all_features = blk: {...@@ -1783,6 +1936,16 @@ pub const all_features = blk: {
1783 .v9_5a,1936 .v9_5a,
1784 }),1937 }),
1785 };1938 };
1939 result[@intFromEnum(Feature.v9_7a)] = .{
1940 .llvm_name = "v9.7a",
1941 .description = "Support ARM v9.7a architecture",
1942 .dependencies = featureSet(&[_]Feature{
1943 .f16f32dot,
1944 .fprcvt,
1945 .sve2p3,
1946 .v9_6a,
1947 }),
1948 };
1786 result[@intFromEnum(Feature.v9a)] = .{1949 result[@intFromEnum(Feature.v9a)] = .{
1787 .llvm_name = "v9a",1950 .llvm_name = "v9a",
1788 .description = "Support ARM v9a architecture",1951 .description = "Support ARM v9a architecture",
...@@ -1808,6 +1971,11 @@ pub const all_features = blk: {...@@ -1808,6 +1971,11 @@ pub const all_features = blk: {
1808 .description = "Enable Armv8.7-A limited-TLB-maintenance instruction",1971 .description = "Enable Armv8.7-A limited-TLB-maintenance instruction",
1809 .dependencies = featureSet(&[_]Feature{}),1972 .dependencies = featureSet(&[_]Feature{}),
1810 };1973 };
1974 result[@intFromEnum(Feature.zcm_fpr128)] = .{
1975 .llvm_name = "zcm-fpr128",
1976 .description = "Has zero-cycle register moves for FPR128 registers",
1977 .dependencies = featureSet(&[_]Feature{}),
1978 };
1811 result[@intFromEnum(Feature.zcm_fpr32)] = .{1979 result[@intFromEnum(Feature.zcm_fpr32)] = .{
1812 .llvm_name = "zcm-fpr32",1980 .llvm_name = "zcm-fpr32",
1813 .description = "Has zero-cycle register moves for FPR32 registers",1981 .description = "Has zero-cycle register moves for FPR32 registers",
...@@ -1828,21 +1996,24 @@ pub const all_features = blk: {...@@ -1828,21 +1996,24 @@ pub const all_features = blk: {
1828 .description = "Has zero-cycle register moves for GPR64 registers",1996 .description = "Has zero-cycle register moves for GPR64 registers",
1829 .dependencies = featureSet(&[_]Feature{}),1997 .dependencies = featureSet(&[_]Feature{}),
1830 };1998 };
1831 result[@intFromEnum(Feature.zcz)] = .{
1832 .llvm_name = "zcz",
1833 .description = "Has zero-cycle zeroing instructions",
1834 .dependencies = featureSet(&[_]Feature{
1835 .zcz_gp,
1836 }),
1837 };
1838 result[@intFromEnum(Feature.zcz_fp_workaround)] = .{1999 result[@intFromEnum(Feature.zcz_fp_workaround)] = .{
1839 .llvm_name = "zcz-fp-workaround",2000 .llvm_name = "zcz-fp-workaround",
1840 .description = "The zero-cycle floating-point zeroing instruction has a bug",2001 .description = "The zero-cycle floating-point zeroing instruction has a bug",
1841 .dependencies = featureSet(&[_]Feature{}),2002 .dependencies = featureSet(&[_]Feature{}),
1842 };2003 };
1843 result[@intFromEnum(Feature.zcz_gp)] = .{2004 result[@intFromEnum(Feature.zcz_fpr128)] = .{
1844 .llvm_name = "zcz-gp",2005 .llvm_name = "zcz-fpr128",
1845 .description = "Has zero-cycle zeroing instructions for generic registers",2006 .description = "Has zero-cycle zeroing instructions for FPR128 registers",
2007 .dependencies = featureSet(&[_]Feature{}),
2008 };
2009 result[@intFromEnum(Feature.zcz_gpr32)] = .{
2010 .llvm_name = "zcz-gpr32",
2011 .description = "Has zero-cycle zeroing instructions for GPR32 registers",
2012 .dependencies = featureSet(&[_]Feature{}),
2013 };
2014 result[@intFromEnum(Feature.zcz_gpr64)] = .{
2015 .llvm_name = "zcz-gpr64",
2016 .description = "Has zero-cycle zeroing instructions for GPR64 registers",
1846 .dependencies = featureSet(&[_]Feature{}),2017 .dependencies = featureSet(&[_]Feature{}),
1847 };2018 };
1848 const ti = @typeInfo(Feature);2019 const ti = @typeInfo(Feature);
...@@ -1862,6 +2033,8 @@ pub const cpu = struct {...@@ -1862,6 +2033,8 @@ pub const cpu = struct {
1862 .aggressive_fma,2033 .aggressive_fma,
1863 .arith_bcc_fusion,2034 .arith_bcc_fusion,
1864 .complxnum,2035 .complxnum,
2036 .disable_unpredicated_ld_st_lower,
2037 .max_interleave_factor_4,
1865 .perfmon,2038 .perfmon,
1866 .predictable_select_expensive,2039 .predictable_select_expensive,
1867 .sha2,2040 .sha2,
...@@ -1886,6 +2059,7 @@ pub const cpu = struct {...@@ -1886,6 +2059,7 @@ pub const cpu = struct {
1886 .fuse_aes,2059 .fuse_aes,
1887 .fuse_literals,2060 .fuse_literals,
1888 .ldp_aligned_only,2061 .ldp_aligned_only,
2062 .max_interleave_factor_4,
1889 .perfmon,2063 .perfmon,
1890 .rand,2064 .rand,
1891 .sha3,2065 .sha3,
...@@ -1911,6 +2085,7 @@ pub const cpu = struct {...@@ -1911,6 +2085,7 @@ pub const cpu = struct {
1911 .fuse_aes,2085 .fuse_aes,
1912 .fuse_literals,2086 .fuse_literals,
1913 .ldp_aligned_only,2087 .ldp_aligned_only,
2088 .max_interleave_factor_4,
1914 .mte,2089 .mte,
1915 .perfmon,2090 .perfmon,
1916 .rand,2091 .rand,
...@@ -1939,6 +2114,7 @@ pub const cpu = struct {...@@ -1939,6 +2114,7 @@ pub const cpu = struct {
1939 .fuse_aes,2114 .fuse_aes,
1940 .fuse_literals,2115 .fuse_literals,
1941 .ldp_aligned_only,2116 .ldp_aligned_only,
2117 .max_interleave_factor_4,
1942 .mte,2118 .mte,
1943 .perfmon,2119 .perfmon,
1944 .predictable_select_expensive,2120 .predictable_select_expensive,
...@@ -1951,6 +2127,38 @@ pub const cpu = struct {...@@ -1951,6 +2127,38 @@ pub const cpu = struct {
1951 .v8_7a,2127 .v8_7a,
1952 }),2128 }),
1953 };2129 };
2130 pub const ampere1c: CpuModel = .{
2131 .name = "ampere1c",
2132 .llvm_name = "ampere1c",
2133 .features = featureSet(&[_]Feature{
2134 .aggressive_fma,
2135 .alu_lsl_fast,
2136 .arith_bcc_fusion,
2137 .cmp_bcc_fusion,
2138 .cssc,
2139 .enable_select_opt,
2140 .faminmax,
2141 .fp16fml,
2142 .fp8fma,
2143 .fuse_address,
2144 .fuse_adrp_add,
2145 .fuse_aes,
2146 .fuse_literals,
2147 .lut,
2148 .max_interleave_factor_4,
2149 .mte,
2150 .perfmon,
2151 .predictable_select_expensive,
2152 .rand,
2153 .store_pair_suppress,
2154 .sve_aes,
2155 .sve_b16b16,
2156 .sve_sha3,
2157 .sve_sm4,
2158 .use_postra_scheduler,
2159 .v9_2a,
2160 }),
2161 };
1954 pub const apple_a10: CpuModel = .{2162 pub const apple_a10: CpuModel = .{
1955 .name = "apple_a10",2163 .name = "apple_a10",
1956 .llvm_name = "apple-a10",2164 .llvm_name = "apple-a10",
...@@ -1964,6 +2172,7 @@ pub const cpu = struct {...@@ -1964,6 +2172,7 @@ pub const cpu = struct {
1964 .fuse_aes,2172 .fuse_aes,
1965 .fuse_crypto_eor,2173 .fuse_crypto_eor,
1966 .lor,2174 .lor,
2175 .no_zcz_fpr64,
1967 .pan,2176 .pan,
1968 .perfmon,2177 .perfmon,
1969 .rdm,2178 .rdm,
...@@ -1971,9 +2180,11 @@ pub const cpu = struct {...@@ -1971,9 +2180,11 @@ pub const cpu = struct {
1971 .store_pair_suppress,2180 .store_pair_suppress,
1972 .v8a,2181 .v8a,
1973 .vh,2182 .vh,
1974 .zcm_fpr64,2183 .zcm_fpr128,
1975 .zcm_gpr64,2184 .zcm_gpr64,
1976 .zcz,2185 .zcz_fpr128,
2186 .zcz_gpr32,
2187 .zcz_gpr64,
1977 }),2188 }),
1978 };2189 };
1979 pub const apple_a11: CpuModel = .{2190 pub const apple_a11: CpuModel = .{
...@@ -1988,13 +2199,16 @@ pub const cpu = struct {...@@ -1988,13 +2199,16 @@ pub const cpu = struct {
1988 .fullfp16,2199 .fullfp16,
1989 .fuse_aes,2200 .fuse_aes,
1990 .fuse_crypto_eor,2201 .fuse_crypto_eor,
2202 .no_zcz_fpr64,
1991 .perfmon,2203 .perfmon,
1992 .sha2,2204 .sha2,
1993 .store_pair_suppress,2205 .store_pair_suppress,
1994 .v8_2a,2206 .v8_2a,
1995 .zcm_fpr64,2207 .zcm_fpr128,
1996 .zcm_gpr64,2208 .zcm_gpr64,
1997 .zcz,2209 .zcz_fpr128,
2210 .zcz_gpr32,
2211 .zcz_gpr64,
1998 }),2212 }),
1999 };2213 };
2000 pub const apple_a12: CpuModel = .{2214 pub const apple_a12: CpuModel = .{
...@@ -2009,13 +2223,16 @@ pub const cpu = struct {...@@ -2009,13 +2223,16 @@ pub const cpu = struct {
2009 .fullfp16,2223 .fullfp16,
2010 .fuse_aes,2224 .fuse_aes,
2011 .fuse_crypto_eor,2225 .fuse_crypto_eor,
2226 .no_zcz_fpr64,
2012 .perfmon,2227 .perfmon,
2013 .sha2,2228 .sha2,
2014 .store_pair_suppress,2229 .store_pair_suppress,
2015 .v8_3a,2230 .v8_3a,
2016 .zcm_fpr64,2231 .zcm_fpr128,
2017 .zcm_gpr64,2232 .zcm_gpr64,
2018 .zcz,2233 .zcz_fpr128,
2234 .zcz_gpr32,
2235 .zcz_gpr64,
2019 }),2236 }),
2020 };2237 };
2021 pub const apple_a13: CpuModel = .{2238 pub const apple_a13: CpuModel = .{
...@@ -2030,13 +2247,16 @@ pub const cpu = struct {...@@ -2030,13 +2247,16 @@ pub const cpu = struct {
2030 .fp16fml,2247 .fp16fml,
2031 .fuse_aes,2248 .fuse_aes,
2032 .fuse_crypto_eor,2249 .fuse_crypto_eor,
2250 .no_zcz_fpr64,
2033 .perfmon,2251 .perfmon,
2034 .sha3,2252 .sha3,
2035 .store_pair_suppress,2253 .store_pair_suppress,
2036 .v8_4a,2254 .v8_4a,
2037 .zcm_fpr64,2255 .zcm_fpr128,
2038 .zcm_gpr64,2256 .zcm_gpr64,
2039 .zcz,2257 .zcz_fpr128,
2258 .zcz_gpr32,
2259 .zcz_gpr64,
2040 }),2260 }),
2041 };2261 };
2042 pub const apple_a14: CpuModel = .{2262 pub const apple_a14: CpuModel = .{
...@@ -2059,6 +2279,8 @@ pub const cpu = struct {...@@ -2059,6 +2279,8 @@ pub const cpu = struct {
2059 .fuse_crypto_eor,2279 .fuse_crypto_eor,
2060 .fuse_csel,2280 .fuse_csel,
2061 .fuse_literals,2281 .fuse_literals,
2282 .max_interleave_factor_4,
2283 .no_zcz_fpr64,
2062 .perfmon,2284 .perfmon,
2063 .predres,2285 .predres,
2064 .sb,2286 .sb,
...@@ -2067,9 +2289,11 @@ pub const cpu = struct {...@@ -2067,9 +2289,11 @@ pub const cpu = struct {
2067 .ssbs,2289 .ssbs,
2068 .store_pair_suppress,2290 .store_pair_suppress,
2069 .v8_4a,2291 .v8_4a,
2070 .zcm_fpr64,2292 .zcm_fpr128,
2071 .zcm_gpr64,2293 .zcm_gpr64,
2072 .zcz,2294 .zcz_fpr128,
2295 .zcz_gpr32,
2296 .zcz_gpr64,
2073 }),2297 }),
2074 };2298 };
2075 pub const apple_a15: CpuModel = .{2299 pub const apple_a15: CpuModel = .{
...@@ -2090,13 +2314,17 @@ pub const cpu = struct {...@@ -2090,13 +2314,17 @@ pub const cpu = struct {
2090 .fuse_crypto_eor,2314 .fuse_crypto_eor,
2091 .fuse_csel,2315 .fuse_csel,
2092 .fuse_literals,2316 .fuse_literals,
2317 .max_interleave_factor_4,
2318 .no_zcz_fpr64,
2093 .perfmon,2319 .perfmon,
2094 .sha3,2320 .sha3,
2095 .store_pair_suppress,2321 .store_pair_suppress,
2096 .v8_6a,2322 .v8_6a,
2097 .zcm_fpr64,2323 .zcm_fpr128,
2098 .zcm_gpr64,2324 .zcm_gpr64,
2099 .zcz,2325 .zcz_fpr128,
2326 .zcz_gpr32,
2327 .zcz_gpr64,
2100 }),2328 }),
2101 };2329 };
2102 pub const apple_a16: CpuModel = .{2330 pub const apple_a16: CpuModel = .{
...@@ -2118,13 +2346,17 @@ pub const cpu = struct {...@@ -2118,13 +2346,17 @@ pub const cpu = struct {
2118 .fuse_csel,2346 .fuse_csel,
2119 .fuse_literals,2347 .fuse_literals,
2120 .hcx,2348 .hcx,
2349 .max_interleave_factor_4,
2350 .no_zcz_fpr64,
2121 .perfmon,2351 .perfmon,
2122 .sha3,2352 .sha3,
2123 .store_pair_suppress,2353 .store_pair_suppress,
2124 .v8_6a,2354 .v8_6a,
2125 .zcm_fpr64,2355 .zcm_fpr128,
2126 .zcm_gpr64,2356 .zcm_gpr64,
2127 .zcz,2357 .zcz_fpr128,
2358 .zcz_gpr32,
2359 .zcz_gpr64,
2128 }),2360 }),
2129 };2361 };
2130 pub const apple_a17: CpuModel = .{2362 pub const apple_a17: CpuModel = .{
...@@ -2146,13 +2378,17 @@ pub const cpu = struct {...@@ -2146,13 +2378,17 @@ pub const cpu = struct {
2146 .fuse_csel,2378 .fuse_csel,
2147 .fuse_literals,2379 .fuse_literals,
2148 .hcx,2380 .hcx,
2381 .max_interleave_factor_4,
2382 .no_zcz_fpr64,
2149 .perfmon,2383 .perfmon,
2150 .sha3,2384 .sha3,
2151 .store_pair_suppress,2385 .store_pair_suppress,
2152 .v8_6a,2386 .v8_6a,
2153 .zcm_fpr64,2387 .zcm_fpr128,
2154 .zcm_gpr64,2388 .zcm_gpr64,
2155 .zcz,2389 .zcz_fpr128,
2390 .zcz_gpr32,
2391 .zcz_gpr64,
2156 }),2392 }),
2157 };2393 };
2158 pub const apple_a18: CpuModel = .{2394 pub const apple_a18: CpuModel = .{
...@@ -2173,15 +2409,58 @@ pub const cpu = struct {...@@ -2173,15 +2409,58 @@ pub const cpu = struct {
2173 .fuse_crypto_eor,2409 .fuse_crypto_eor,
2174 .fuse_csel,2410 .fuse_csel,
2175 .fuse_literals,2411 .fuse_literals,
2412 .max_interleave_factor_4,
2413 .no_zcz_fpr64,
2176 .perfmon,2414 .perfmon,
2177 .sha3,2415 .sha3,
2178 .sme2,2416 .sme2,
2179 .sme_f64f64,2417 .sme_f64f64,
2180 .sme_i16i64,2418 .sme_i16i64,
2181 .v8_7a,2419 .v8_7a,
2182 .zcm_fpr64,2420 .zcm_fpr128,
2183 .zcm_gpr64,2421 .zcm_gpr64,
2184 .zcz,2422 .zcz_fpr128,
2423 .zcz_gpr32,
2424 .zcz_gpr64,
2425 }),
2426 };
2427 pub const apple_a19: CpuModel = .{
2428 .name = "apple_a19",
2429 .llvm_name = "apple-a19",
2430 .features = featureSet(&[_]Feature{
2431 .aes,
2432 .alternate_sextload_cvt_f32_pattern,
2433 .arith_bcc_fusion,
2434 .arith_cbz_fusion,
2435 .cssc,
2436 .disable_latency_sched_heuristic,
2437 .fp16fml,
2438 .fpac,
2439 .fuse_address,
2440 .fuse_adrp_add,
2441 .fuse_aes,
2442 .fuse_arith_logic,
2443 .fuse_crypto_eor,
2444 .fuse_csel,
2445 .fuse_literals,
2446 .hbc,
2447 .max_interleave_factor_4,
2448 .mte,
2449 .no_zcz_fpr64,
2450 .perfmon,
2451 .sha3,
2452 .sme2p1,
2453 .sme_b16b16,
2454 .sme_f16f16,
2455 .sme_f64f64,
2456 .sme_i16i64,
2457 .specres2,
2458 .v8_7a,
2459 .zcm_fpr128,
2460 .zcm_gpr64,
2461 .zcz_fpr128,
2462 .zcz_gpr32,
2463 .zcz_gpr64,
2185 }),2464 }),
2186 };2465 };
2187 pub const apple_a7: CpuModel = .{2466 pub const apple_a7: CpuModel = .{
...@@ -2195,14 +2474,17 @@ pub const cpu = struct {...@@ -2195,14 +2474,17 @@ pub const cpu = struct {
2195 .disable_latency_sched_heuristic,2474 .disable_latency_sched_heuristic,
2196 .fuse_aes,2475 .fuse_aes,
2197 .fuse_crypto_eor,2476 .fuse_crypto_eor,
2477 .no_zcz_fpr64,
2198 .perfmon,2478 .perfmon,
2199 .sha2,2479 .sha2,
2200 .store_pair_suppress,2480 .store_pair_suppress,
2201 .v8a,2481 .v8a,
2202 .zcm_fpr64,2482 .zcm_fpr128,
2203 .zcm_gpr64,2483 .zcm_gpr64,
2204 .zcz,
2205 .zcz_fp_workaround,2484 .zcz_fp_workaround,
2485 .zcz_fpr128,
2486 .zcz_gpr32,
2487 .zcz_gpr64,
2206 }),2488 }),
2207 };2489 };
2208 pub const apple_a8: CpuModel = .{2490 pub const apple_a8: CpuModel = .{
...@@ -2216,14 +2498,17 @@ pub const cpu = struct {...@@ -2216,14 +2498,17 @@ pub const cpu = struct {
2216 .disable_latency_sched_heuristic,2498 .disable_latency_sched_heuristic,
2217 .fuse_aes,2499 .fuse_aes,
2218 .fuse_crypto_eor,2500 .fuse_crypto_eor,
2501 .no_zcz_fpr64,
2219 .perfmon,2502 .perfmon,
2220 .sha2,2503 .sha2,
2221 .store_pair_suppress,2504 .store_pair_suppress,
2222 .v8a,2505 .v8a,
2223 .zcm_fpr64,2506 .zcm_fpr128,
2224 .zcm_gpr64,2507 .zcm_gpr64,
2225 .zcz,
2226 .zcz_fp_workaround,2508 .zcz_fp_workaround,
2509 .zcz_fpr128,
2510 .zcz_gpr32,
2511 .zcz_gpr64,
2227 }),2512 }),
2228 };2513 };
2229 pub const apple_a9: CpuModel = .{2514 pub const apple_a9: CpuModel = .{
...@@ -2237,14 +2522,17 @@ pub const cpu = struct {...@@ -2237,14 +2522,17 @@ pub const cpu = struct {
2237 .disable_latency_sched_heuristic,2522 .disable_latency_sched_heuristic,
2238 .fuse_aes,2523 .fuse_aes,
2239 .fuse_crypto_eor,2524 .fuse_crypto_eor,
2525 .no_zcz_fpr64,
2240 .perfmon,2526 .perfmon,
2241 .sha2,2527 .sha2,
2242 .store_pair_suppress,2528 .store_pair_suppress,
2243 .v8a,2529 .v8a,
2244 .zcm_fpr64,2530 .zcm_fpr128,
2245 .zcm_gpr64,2531 .zcm_gpr64,
2246 .zcz,
2247 .zcz_fp_workaround,2532 .zcz_fp_workaround,
2533 .zcz_fpr128,
2534 .zcz_gpr32,
2535 .zcz_gpr64,
2248 }),2536 }),
2249 };2537 };
2250 pub const apple_m1: CpuModel = .{2538 pub const apple_m1: CpuModel = .{
...@@ -2267,6 +2555,8 @@ pub const cpu = struct {...@@ -2267,6 +2555,8 @@ pub const cpu = struct {
2267 .fuse_crypto_eor,2555 .fuse_crypto_eor,
2268 .fuse_csel,2556 .fuse_csel,
2269 .fuse_literals,2557 .fuse_literals,
2558 .max_interleave_factor_4,
2559 .no_zcz_fpr64,
2270 .perfmon,2560 .perfmon,
2271 .predres,2561 .predres,
2272 .sb,2562 .sb,
...@@ -2275,9 +2565,11 @@ pub const cpu = struct {...@@ -2275,9 +2565,11 @@ pub const cpu = struct {
2275 .ssbs,2565 .ssbs,
2276 .store_pair_suppress,2566 .store_pair_suppress,
2277 .v8_4a,2567 .v8_4a,
2278 .zcm_fpr64,2568 .zcm_fpr128,
2279 .zcm_gpr64,2569 .zcm_gpr64,
2280 .zcz,2570 .zcz_fpr128,
2571 .zcz_gpr32,
2572 .zcz_gpr64,
2281 }),2573 }),
2282 };2574 };
2283 pub const apple_m2: CpuModel = .{2575 pub const apple_m2: CpuModel = .{
...@@ -2298,13 +2590,17 @@ pub const cpu = struct {...@@ -2298,13 +2590,17 @@ pub const cpu = struct {
2298 .fuse_crypto_eor,2590 .fuse_crypto_eor,
2299 .fuse_csel,2591 .fuse_csel,
2300 .fuse_literals,2592 .fuse_literals,
2593 .max_interleave_factor_4,
2594 .no_zcz_fpr64,
2301 .perfmon,2595 .perfmon,
2302 .sha3,2596 .sha3,
2303 .store_pair_suppress,2597 .store_pair_suppress,
2304 .v8_6a,2598 .v8_6a,
2305 .zcm_fpr64,2599 .zcm_fpr128,
2306 .zcm_gpr64,2600 .zcm_gpr64,
2307 .zcz,2601 .zcz_fpr128,
2602 .zcz_gpr32,
2603 .zcz_gpr64,
2308 }),2604 }),
2309 };2605 };
2310 pub const apple_m3: CpuModel = .{2606 pub const apple_m3: CpuModel = .{
...@@ -2326,13 +2622,17 @@ pub const cpu = struct {...@@ -2326,13 +2622,17 @@ pub const cpu = struct {
2326 .fuse_csel,2622 .fuse_csel,
2327 .fuse_literals,2623 .fuse_literals,
2328 .hcx,2624 .hcx,
2625 .max_interleave_factor_4,
2626 .no_zcz_fpr64,
2329 .perfmon,2627 .perfmon,
2330 .sha3,2628 .sha3,
2331 .store_pair_suppress,2629 .store_pair_suppress,
2332 .v8_6a,2630 .v8_6a,
2333 .zcm_fpr64,2631 .zcm_fpr128,
2334 .zcm_gpr64,2632 .zcm_gpr64,
2335 .zcz,2633 .zcz_fpr128,
2634 .zcz_gpr32,
2635 .zcz_gpr64,
2336 }),2636 }),
2337 };2637 };
2338 pub const apple_m4: CpuModel = .{2638 pub const apple_m4: CpuModel = .{
...@@ -2353,15 +2653,58 @@ pub const cpu = struct {...@@ -2353,15 +2653,58 @@ pub const cpu = struct {
2353 .fuse_crypto_eor,2653 .fuse_crypto_eor,
2354 .fuse_csel,2654 .fuse_csel,
2355 .fuse_literals,2655 .fuse_literals,
2656 .max_interleave_factor_4,
2657 .no_zcz_fpr64,
2356 .perfmon,2658 .perfmon,
2357 .sha3,2659 .sha3,
2358 .sme2,2660 .sme2,
2359 .sme_f64f64,2661 .sme_f64f64,
2360 .sme_i16i64,2662 .sme_i16i64,
2361 .v8_7a,2663 .v8_7a,
2362 .zcm_fpr64,2664 .zcm_fpr128,
2665 .zcm_gpr64,
2666 .zcz_fpr128,
2667 .zcz_gpr32,
2668 .zcz_gpr64,
2669 }),
2670 };
2671 pub const apple_m5: CpuModel = .{
2672 .name = "apple_m5",
2673 .llvm_name = "apple-m5",
2674 .features = featureSet(&[_]Feature{
2675 .aes,
2676 .alternate_sextload_cvt_f32_pattern,
2677 .arith_bcc_fusion,
2678 .arith_cbz_fusion,
2679 .cssc,
2680 .disable_latency_sched_heuristic,
2681 .fp16fml,
2682 .fpac,
2683 .fuse_address,
2684 .fuse_adrp_add,
2685 .fuse_aes,
2686 .fuse_arith_logic,
2687 .fuse_crypto_eor,
2688 .fuse_csel,
2689 .fuse_literals,
2690 .hbc,
2691 .max_interleave_factor_4,
2692 .mte,
2693 .no_zcz_fpr64,
2694 .perfmon,
2695 .sha3,
2696 .sme2p1,
2697 .sme_b16b16,
2698 .sme_f16f16,
2699 .sme_f64f64,
2700 .sme_i16i64,
2701 .specres2,
2702 .v8_7a,
2703 .zcm_fpr128,
2363 .zcm_gpr64,2704 .zcm_gpr64,
2364 .zcz,2705 .zcz_fpr128,
2706 .zcz_gpr32,
2707 .zcz_gpr64,
2365 }),2708 }),
2366 };2709 };
2367 pub const apple_s10: CpuModel = .{2710 pub const apple_s10: CpuModel = .{
...@@ -2383,13 +2726,17 @@ pub const cpu = struct {...@@ -2383,13 +2726,17 @@ pub const cpu = struct {
2383 .fuse_csel,2726 .fuse_csel,
2384 .fuse_literals,2727 .fuse_literals,
2385 .hcx,2728 .hcx,
2729 .max_interleave_factor_4,
2730 .no_zcz_fpr64,
2386 .perfmon,2731 .perfmon,
2387 .sha3,2732 .sha3,
2388 .store_pair_suppress,2733 .store_pair_suppress,
2389 .v8_6a,2734 .v8_6a,
2390 .zcm_fpr64,2735 .zcm_fpr128,
2391 .zcm_gpr64,2736 .zcm_gpr64,
2392 .zcz,2737 .zcz_fpr128,
2738 .zcz_gpr32,
2739 .zcz_gpr64,
2393 }),2740 }),
2394 };2741 };
2395 pub const apple_s4: CpuModel = .{2742 pub const apple_s4: CpuModel = .{
...@@ -2404,13 +2751,16 @@ pub const cpu = struct {...@@ -2404,13 +2751,16 @@ pub const cpu = struct {
2404 .fullfp16,2751 .fullfp16,
2405 .fuse_aes,2752 .fuse_aes,
2406 .fuse_crypto_eor,2753 .fuse_crypto_eor,
2754 .no_zcz_fpr64,
2407 .perfmon,2755 .perfmon,
2408 .sha2,2756 .sha2,
2409 .store_pair_suppress,2757 .store_pair_suppress,
2410 .v8_3a,2758 .v8_3a,
2411 .zcm_fpr64,2759 .zcm_fpr128,
2412 .zcm_gpr64,2760 .zcm_gpr64,
2413 .zcz,2761 .zcz_fpr128,
2762 .zcz_gpr32,
2763 .zcz_gpr64,
2414 }),2764 }),
2415 };2765 };
2416 pub const apple_s5: CpuModel = .{2766 pub const apple_s5: CpuModel = .{
...@@ -2425,13 +2775,16 @@ pub const cpu = struct {...@@ -2425,13 +2775,16 @@ pub const cpu = struct {
2425 .fullfp16,2775 .fullfp16,
2426 .fuse_aes,2776 .fuse_aes,
2427 .fuse_crypto_eor,2777 .fuse_crypto_eor,
2778 .no_zcz_fpr64,
2428 .perfmon,2779 .perfmon,
2429 .sha2,2780 .sha2,
2430 .store_pair_suppress,2781 .store_pair_suppress,
2431 .v8_3a,2782 .v8_3a,
2432 .zcm_fpr64,2783 .zcm_fpr128,
2433 .zcm_gpr64,2784 .zcm_gpr64,
2434 .zcz,2785 .zcz_fpr128,
2786 .zcz_gpr32,
2787 .zcz_gpr64,
2435 }),2788 }),
2436 };2789 };
2437 pub const apple_s6: CpuModel = .{2790 pub const apple_s6: CpuModel = .{
...@@ -2446,13 +2799,16 @@ pub const cpu = struct {...@@ -2446,13 +2799,16 @@ pub const cpu = struct {
2446 .fp16fml,2799 .fp16fml,
2447 .fuse_aes,2800 .fuse_aes,
2448 .fuse_crypto_eor,2801 .fuse_crypto_eor,
2802 .no_zcz_fpr64,
2449 .perfmon,2803 .perfmon,
2450 .sha3,2804 .sha3,
2451 .store_pair_suppress,2805 .store_pair_suppress,
2452 .v8_4a,2806 .v8_4a,
2453 .zcm_fpr64,2807 .zcm_fpr128,
2454 .zcm_gpr64,2808 .zcm_gpr64,
2455 .zcz,2809 .zcz_fpr128,
2810 .zcz_gpr32,
2811 .zcz_gpr64,
2456 }),2812 }),
2457 };2813 };
2458 pub const apple_s7: CpuModel = .{2814 pub const apple_s7: CpuModel = .{
...@@ -2467,13 +2823,16 @@ pub const cpu = struct {...@@ -2467,13 +2823,16 @@ pub const cpu = struct {
2467 .fp16fml,2823 .fp16fml,
2468 .fuse_aes,2824 .fuse_aes,
2469 .fuse_crypto_eor,2825 .fuse_crypto_eor,
2826 .no_zcz_fpr64,
2470 .perfmon,2827 .perfmon,
2471 .sha3,2828 .sha3,
2472 .store_pair_suppress,2829 .store_pair_suppress,
2473 .v8_4a,2830 .v8_4a,
2474 .zcm_fpr64,2831 .zcm_fpr128,
2475 .zcm_gpr64,2832 .zcm_gpr64,
2476 .zcz,2833 .zcz_fpr128,
2834 .zcz_gpr32,
2835 .zcz_gpr64,
2477 }),2836 }),
2478 };2837 };
2479 pub const apple_s8: CpuModel = .{2838 pub const apple_s8: CpuModel = .{
...@@ -2488,13 +2847,16 @@ pub const cpu = struct {...@@ -2488,13 +2847,16 @@ pub const cpu = struct {
2488 .fp16fml,2847 .fp16fml,
2489 .fuse_aes,2848 .fuse_aes,
2490 .fuse_crypto_eor,2849 .fuse_crypto_eor,
2850 .no_zcz_fpr64,
2491 .perfmon,2851 .perfmon,
2492 .sha3,2852 .sha3,
2493 .store_pair_suppress,2853 .store_pair_suppress,
2494 .v8_4a,2854 .v8_4a,
2495 .zcm_fpr64,2855 .zcm_fpr128,
2496 .zcm_gpr64,2856 .zcm_gpr64,
2497 .zcz,2857 .zcz_fpr128,
2858 .zcz_gpr32,
2859 .zcz_gpr64,
2498 }),2860 }),
2499 };2861 };
2500 pub const apple_s9: CpuModel = .{2862 pub const apple_s9: CpuModel = .{
...@@ -2516,13 +2878,126 @@ pub const cpu = struct {...@@ -2516,13 +2878,126 @@ pub const cpu = struct {
2516 .fuse_csel,2878 .fuse_csel,
2517 .fuse_literals,2879 .fuse_literals,
2518 .hcx,2880 .hcx,
2881 .max_interleave_factor_4,
2882 .no_zcz_fpr64,
2519 .perfmon,2883 .perfmon,
2520 .sha3,2884 .sha3,
2521 .store_pair_suppress,2885 .store_pair_suppress,
2522 .v8_6a,2886 .v8_6a,
2523 .zcm_fpr64,2887 .zcm_fpr128,
2524 .zcm_gpr64,2888 .zcm_gpr64,
2525 .zcz,2889 .zcz_fpr128,
2890 .zcz_gpr32,
2891 .zcz_gpr64,
2892 }),
2893 };
2894 pub const c1_nano: CpuModel = .{
2895 .name = "c1_nano",
2896 .llvm_name = "c1-nano",
2897 .features = featureSet(&[_]Feature{
2898 .chk,
2899 .clrbhb,
2900 .ete,
2901 .fp16fml,
2902 .fpac,
2903 .fuse_adrp_add,
2904 .fuse_aes,
2905 .mte,
2906 .perfmon,
2907 .rcpc3,
2908 .sme2,
2909 .specres2,
2910 .sve_bitperm,
2911 .use_fixed_over_scalable_if_equal_cost,
2912 .use_postra_scheduler,
2913 .use_wzr_to_vec_move,
2914 .v9_3a,
2915 }),
2916 };
2917 pub const c1_premium: CpuModel = .{
2918 .name = "c1_premium",
2919 .llvm_name = "c1-premium",
2920 .features = featureSet(&[_]Feature{
2921 .alu_lsl_fast,
2922 .avoid_ldapur,
2923 .chk,
2924 .clrbhb,
2925 .enable_select_opt,
2926 .ete,
2927 .fp16fml,
2928 .fpac,
2929 .fuse_adrp_add,
2930 .fuse_aes,
2931 .fuse_csel,
2932 .fuse_cset,
2933 .mte,
2934 .perfmon,
2935 .predictable_select_expensive,
2936 .rcpc3,
2937 .sme2,
2938 .spe,
2939 .specres2,
2940 .sve_bitperm,
2941 .use_fixed_over_scalable_if_equal_cost,
2942 .use_postra_scheduler,
2943 .v9_3a,
2944 }),
2945 };
2946 pub const c1_pro: CpuModel = .{
2947 .name = "c1_pro",
2948 .llvm_name = "c1-pro",
2949 .features = featureSet(&[_]Feature{
2950 .alu_lsl_fast,
2951 .chk,
2952 .clrbhb,
2953 .cmp_bcc_fusion,
2954 .enable_select_opt,
2955 .ete,
2956 .fp16fml,
2957 .fpac,
2958 .fuse_adrp_add,
2959 .fuse_aes,
2960 .fuse_csel,
2961 .fuse_cset,
2962 .mte,
2963 .perfmon,
2964 .predictable_select_expensive,
2965 .rcpc3,
2966 .sme2,
2967 .spe,
2968 .specres2,
2969 .sve_bitperm,
2970 .use_postra_scheduler,
2971 .v9_3a,
2972 }),
2973 };
2974 pub const c1_ultra: CpuModel = .{
2975 .name = "c1_ultra",
2976 .llvm_name = "c1-ultra",
2977 .features = featureSet(&[_]Feature{
2978 .alu_lsl_fast,
2979 .avoid_ldapur,
2980 .chk,
2981 .clrbhb,
2982 .enable_select_opt,
2983 .ete,
2984 .fp16fml,
2985 .fpac,
2986 .fuse_adrp_add,
2987 .fuse_aes,
2988 .fuse_csel,
2989 .fuse_cset,
2990 .mte,
2991 .perfmon,
2992 .predictable_select_expensive,
2993 .rcpc3,
2994 .sme2,
2995 .spe,
2996 .specres2,
2997 .sve_bitperm,
2998 .use_fixed_over_scalable_if_equal_cost,
2999 .use_postra_scheduler,
3000 .v9_3a,
2526 }),3001 }),
2527 };3002 };
2528 pub const carmel: CpuModel = .{3003 pub const carmel: CpuModel = .{
...@@ -2541,12 +3016,15 @@ pub const cpu = struct {...@@ -2541,12 +3016,15 @@ pub const cpu = struct {
2541 .features = featureSet(&[_]Feature{3016 .features = featureSet(&[_]Feature{
2542 .alu_lsl_fast,3017 .alu_lsl_fast,
2543 .bf16,3018 .bf16,
3019 .disable_maximize_scalable_bandwidth,
2544 .enable_select_opt,3020 .enable_select_opt,
2545 .ete,3021 .ete,
2546 .fp16fml,3022 .fp16fml,
2547 .fpac,3023 .fpac,
2548 .fuse_adrp_add,3024 .fuse_adrp_add,
2549 .fuse_aes,3025 .fuse_aes,
3026 .fuse_csel,
3027 .fuse_cset,
2550 .i8mm,3028 .i8mm,
2551 .mte,3029 .mte,
2552 .perfmon,3030 .perfmon,
...@@ -2607,6 +3085,7 @@ pub const cpu = struct {...@@ -2607,6 +3085,7 @@ pub const cpu = struct {
2607 .sve_bitperm,3085 .sve_bitperm,
2608 .use_fixed_over_scalable_if_equal_cost,3086 .use_fixed_over_scalable_if_equal_cost,
2609 .use_postra_scheduler,3087 .use_postra_scheduler,
3088 .use_wzr_to_vec_move,
2610 .v9a,3089 .v9a,
2611 }),3090 }),
2612 };3091 };
...@@ -2624,6 +3103,7 @@ pub const cpu = struct {...@@ -2624,6 +3103,7 @@ pub const cpu = struct {
2624 .sve_bitperm,3103 .sve_bitperm,
2625 .use_fixed_over_scalable_if_equal_cost,3104 .use_fixed_over_scalable_if_equal_cost,
2626 .use_postra_scheduler,3105 .use_postra_scheduler,
3106 .use_wzr_to_vec_move,
2627 .v9_2a,3107 .v9_2a,
2628 }),3108 }),
2629 };3109 };
...@@ -2640,6 +3120,7 @@ pub const cpu = struct {...@@ -2640,6 +3120,7 @@ pub const cpu = struct {
2640 .perfmon,3120 .perfmon,
2641 .sve_bitperm,3121 .sve_bitperm,
2642 .use_postra_scheduler,3122 .use_postra_scheduler,
3123 .use_wzr_to_vec_move,
2643 .v9_2a,3124 .v9_2a,
2644 }),3125 }),
2645 };3126 };
...@@ -2655,6 +3136,7 @@ pub const cpu = struct {...@@ -2655,6 +3136,7 @@ pub const cpu = struct {
2655 .perfmon,3136 .perfmon,
2656 .sha2,3137 .sha2,
2657 .use_postra_scheduler,3138 .use_postra_scheduler,
3139 .use_wzr_to_vec_move,
2658 .v8a,3140 .v8a,
2659 }),3141 }),
2660 };3142 };
...@@ -2672,6 +3154,7 @@ pub const cpu = struct {...@@ -2672,6 +3154,7 @@ pub const cpu = struct {
2672 .rcpc,3154 .rcpc,
2673 .sha2,3155 .sha2,
2674 .use_postra_scheduler,3156 .use_postra_scheduler,
3157 .use_wzr_to_vec_move,
2675 .v8_2a,3158 .v8_2a,
2676 }),3159 }),
2677 };3160 };
...@@ -2687,6 +3170,7 @@ pub const cpu = struct {...@@ -2687,6 +3170,7 @@ pub const cpu = struct {
2687 .fuse_adrp_add,3170 .fuse_adrp_add,
2688 .fuse_aes,3171 .fuse_aes,
2689 .fuse_literals,3172 .fuse_literals,
3173 .max_interleave_factor_4,
2690 .perfmon,3174 .perfmon,
2691 .predictable_select_expensive,3175 .predictable_select_expensive,
2692 .sha2,3176 .sha2,
...@@ -2747,6 +3231,8 @@ pub const cpu = struct {...@@ -2747,6 +3231,8 @@ pub const cpu = struct {
2747 .fpac,3231 .fpac,
2748 .fuse_adrp_add,3232 .fuse_adrp_add,
2749 .fuse_aes,3233 .fuse_aes,
3234 .fuse_csel,
3235 .fuse_cset,
2750 .i8mm,3236 .i8mm,
2751 .mte,3237 .mte,
2752 .perfmon,3238 .perfmon,
...@@ -2769,6 +3255,8 @@ pub const cpu = struct {...@@ -2769,6 +3255,8 @@ pub const cpu = struct {
2769 .fpac,3255 .fpac,
2770 .fuse_adrp_add,3256 .fuse_adrp_add,
2771 .fuse_aes,3257 .fuse_aes,
3258 .fuse_csel,
3259 .fuse_cset,
2772 .i8mm,3260 .i8mm,
2773 .mte,3261 .mte,
2774 .perfmon,3262 .perfmon,
...@@ -2808,6 +3296,8 @@ pub const cpu = struct {...@@ -2808,6 +3296,8 @@ pub const cpu = struct {
2808 .fpac,3296 .fpac,
2809 .fuse_adrp_add,3297 .fuse_adrp_add,
2810 .fuse_aes,3298 .fuse_aes,
3299 .fuse_csel,
3300 .fuse_cset,
2811 .mte,3301 .mte,
2812 .perfmon,3302 .perfmon,
2813 .predictable_select_expensive,3303 .predictable_select_expensive,
...@@ -2829,6 +3319,8 @@ pub const cpu = struct {...@@ -2829,6 +3319,8 @@ pub const cpu = struct {
2829 .fpac,3319 .fpac,
2830 .fuse_adrp_add,3320 .fuse_adrp_add,
2831 .fuse_aes,3321 .fuse_aes,
3322 .fuse_csel,
3323 .fuse_cset,
2832 .mte,3324 .mte,
2833 .perfmon,3325 .perfmon,
2834 .predictable_select_expensive,3326 .predictable_select_expensive,
...@@ -2850,6 +3342,8 @@ pub const cpu = struct {...@@ -2850,6 +3342,8 @@ pub const cpu = struct {
2850 .fpac,3342 .fpac,
2851 .fuse_adrp_add,3343 .fuse_adrp_add,
2852 .fuse_aes,3344 .fuse_aes,
3345 .fuse_csel,
3346 .fuse_cset,
2853 .mte,3347 .mte,
2854 .perfmon,3348 .perfmon,
2855 .predictable_select_expensive,3349 .predictable_select_expensive,
...@@ -2967,6 +3461,8 @@ pub const cpu = struct {...@@ -2967,6 +3461,8 @@ pub const cpu = struct {
2967 .fullfp16,3461 .fullfp16,
2968 .fuse_adrp_add,3462 .fuse_adrp_add,
2969 .fuse_aes,3463 .fuse_aes,
3464 .fuse_csel,
3465 .fuse_cset,
2970 .perfmon,3466 .perfmon,
2971 .predictable_select_expensive,3467 .predictable_select_expensive,
2972 .rcpc,3468 .rcpc,
...@@ -2990,6 +3486,8 @@ pub const cpu = struct {...@@ -2990,6 +3486,8 @@ pub const cpu = struct {
2990 .fullfp16,3486 .fullfp16,
2991 .fuse_adrp_add,3487 .fuse_adrp_add,
2992 .fuse_aes,3488 .fuse_aes,
3489 .fuse_csel,
3490 .fuse_cset,
2993 .perfmon,3491 .perfmon,
2994 .predictable_select_expensive,3492 .predictable_select_expensive,
2995 .rcpc,3493 .rcpc,
...@@ -3014,6 +3512,8 @@ pub const cpu = struct {...@@ -3014,6 +3512,8 @@ pub const cpu = struct {
3014 .fullfp16,3512 .fullfp16,
3015 .fuse_adrp_add,3513 .fuse_adrp_add,
3016 .fuse_aes,3514 .fuse_aes,
3515 .fuse_csel,
3516 .fuse_cset,
3017 .pauth,3517 .pauth,
3018 .perfmon,3518 .perfmon,
3019 .predictable_select_expensive,3519 .predictable_select_expensive,
...@@ -3157,6 +3657,8 @@ pub const cpu = struct {...@@ -3157,6 +3657,8 @@ pub const cpu = struct {
3157 .fpac,3657 .fpac,
3158 .fuse_adrp_add,3658 .fuse_adrp_add,
3159 .fuse_aes,3659 .fuse_aes,
3660 .fuse_csel,
3661 .fuse_cset,
3160 .mte,3662 .mte,
3161 .perfmon,3663 .perfmon,
3162 .predictable_select_expensive,3664 .predictable_select_expensive,
...@@ -3179,6 +3681,8 @@ pub const cpu = struct {...@@ -3179,6 +3681,8 @@ pub const cpu = struct {
3179 .fpac,3681 .fpac,
3180 .fuse_adrp_add,3682 .fuse_adrp_add,
3181 .fuse_aes,3683 .fuse_aes,
3684 .fuse_csel,
3685 .fuse_cset,
3182 .mte,3686 .mte,
3183 .perfmon,3687 .perfmon,
3184 .predictable_select_expensive,3688 .predictable_select_expensive,
...@@ -3200,14 +3704,17 @@ pub const cpu = struct {...@@ -3200,14 +3704,17 @@ pub const cpu = struct {
3200 .disable_latency_sched_heuristic,3704 .disable_latency_sched_heuristic,
3201 .fuse_aes,3705 .fuse_aes,
3202 .fuse_crypto_eor,3706 .fuse_crypto_eor,
3707 .no_zcz_fpr64,
3203 .perfmon,3708 .perfmon,
3204 .sha2,3709 .sha2,
3205 .store_pair_suppress,3710 .store_pair_suppress,
3206 .v8a,3711 .v8a,
3207 .zcm_fpr64,3712 .zcm_fpr128,
3208 .zcm_gpr64,3713 .zcm_gpr64,
3209 .zcz,
3210 .zcz_fp_workaround,3714 .zcz_fp_workaround,
3715 .zcz_fpr128,
3716 .zcz_gpr32,
3717 .zcz_gpr64,
3211 }),3718 }),
3212 };3719 };
3213 pub const emag: CpuModel = .{3720 pub const emag: CpuModel = .{
...@@ -3267,6 +3774,7 @@ pub const cpu = struct {...@@ -3267,6 +3774,7 @@ pub const cpu = struct {
3267 .fuse_aes,3774 .fuse_aes,
3268 .fuse_csel,3775 .fuse_csel,
3269 .fuse_literals,3776 .fuse_literals,
3777 .max_interleave_factor_4,
3270 .perfmon,3778 .perfmon,
3271 .predictable_select_expensive,3779 .predictable_select_expensive,
3272 .sha2,3780 .sha2,
...@@ -3293,12 +3801,14 @@ pub const cpu = struct {...@@ -3293,12 +3801,14 @@ pub const cpu = struct {
3293 .fuse_arith_logic,3801 .fuse_arith_logic,
3294 .fuse_csel,3802 .fuse_csel,
3295 .fuse_literals,3803 .fuse_literals,
3804 .max_interleave_factor_4,
3296 .perfmon,3805 .perfmon,
3297 .sha2,3806 .sha2,
3298 .store_pair_suppress,3807 .store_pair_suppress,
3299 .use_postra_scheduler,3808 .use_postra_scheduler,
3300 .v8_2a,3809 .v8_2a,
3301 .zcz,3810 .zcz_gpr32,
3811 .zcz_gpr64,
3302 }),3812 }),
3303 };3813 };
3304 pub const exynos_m5: CpuModel = .{3814 pub const exynos_m5: CpuModel = .{
...@@ -3319,12 +3829,14 @@ pub const cpu = struct {...@@ -3319,12 +3829,14 @@ pub const cpu = struct {
3319 .fuse_arith_logic,3829 .fuse_arith_logic,
3320 .fuse_csel,3830 .fuse_csel,
3321 .fuse_literals,3831 .fuse_literals,
3832 .max_interleave_factor_4,
3322 .perfmon,3833 .perfmon,
3323 .sha2,3834 .sha2,
3324 .store_pair_suppress,3835 .store_pair_suppress,
3325 .use_postra_scheduler,3836 .use_postra_scheduler,
3326 .v8_2a,3837 .v8_2a,
3327 .zcz,3838 .zcz_gpr32,
3839 .zcz_gpr64,
3328 }),3840 }),
3329 };3841 };
3330 pub const falkor: CpuModel = .{3842 pub const falkor: CpuModel = .{
...@@ -3334,6 +3846,7 @@ pub const cpu = struct {...@@ -3334,6 +3846,7 @@ pub const cpu = struct {
3334 .aes,3846 .aes,
3335 .alu_lsl_fast,3847 .alu_lsl_fast,
3336 .crc,3848 .crc,
3849 .max_interleave_factor_4,
3337 .perfmon,3850 .perfmon,
3338 .predictable_select_expensive,3851 .predictable_select_expensive,
3339 .rdm,3852 .rdm,
...@@ -3342,7 +3855,8 @@ pub const cpu = struct {...@@ -3342,7 +3855,8 @@ pub const cpu = struct {
3342 .store_pair_suppress,3855 .store_pair_suppress,
3343 .use_postra_scheduler,3856 .use_postra_scheduler,
3344 .v8a,3857 .v8a,
3345 .zcz,3858 .zcz_gpr32,
3859 .zcz_gpr64,
3346 }),3860 }),
3347 };3861 };
3348 pub const fujitsu_monaka: CpuModel = .{3862 pub const fujitsu_monaka: CpuModel = .{
...@@ -3382,6 +3896,8 @@ pub const cpu = struct {...@@ -3382,6 +3896,8 @@ pub const cpu = struct {
3382 .fpac,3896 .fpac,
3383 .fuse_adrp_add,3897 .fuse_adrp_add,
3384 .fuse_aes,3898 .fuse_aes,
3899 .fuse_csel,
3900 .fuse_cset,
3385 .mte,3901 .mte,
3386 .perfmon,3902 .perfmon,
3387 .predictable_select_expensive,3903 .predictable_select_expensive,
...@@ -3422,11 +3938,13 @@ pub const cpu = struct {...@@ -3422,11 +3938,13 @@ pub const cpu = struct {
3422 .fpac,3938 .fpac,
3423 .fuse_adrp_add,3939 .fuse_adrp_add,
3424 .fuse_aes,3940 .fuse_aes,
3941 .fuse_csel,
3942 .fuse_cset,
3425 .i8mm,3943 .i8mm,
3944 .max_interleave_factor_4,
3426 .mte,3945 .mte,
3427 .perfmon,3946 .perfmon,
3428 .predictable_select_expensive,3947 .predictable_select_expensive,
3429 .rand,
3430 .spe,3948 .spe,
3431 .sve_aes,3949 .sve_aes,
3432 .sve_bitperm,3950 .sve_bitperm,
...@@ -3444,13 +3962,15 @@ pub const cpu = struct {...@@ -3444,13 +3962,15 @@ pub const cpu = struct {
3444 .aes,3962 .aes,
3445 .alu_lsl_fast,3963 .alu_lsl_fast,
3446 .crc,3964 .crc,
3965 .max_interleave_factor_4,
3447 .perfmon,3966 .perfmon,
3448 .predictable_select_expensive,3967 .predictable_select_expensive,
3449 .sha2,3968 .sha2,
3450 .store_pair_suppress,3969 .store_pair_suppress,
3451 .use_postra_scheduler,3970 .use_postra_scheduler,
3452 .v8a,3971 .v8a,
3453 .zcz,3972 .zcz_gpr32,
3973 .zcz_gpr64,
3454 }),3974 }),
3455 };3975 };
3456 pub const neoverse_512tvb: CpuModel = .{3976 pub const neoverse_512tvb: CpuModel = .{
...@@ -3467,6 +3987,7 @@ pub const cpu = struct {...@@ -3467,6 +3987,7 @@ pub const cpu = struct {
3467 .fuse_adrp_add,3987 .fuse_adrp_add,
3468 .fuse_aes,3988 .fuse_aes,
3469 .i8mm,3989 .i8mm,
3990 .max_interleave_factor_4,
3470 .perfmon,3991 .perfmon,
3471 .predictable_select_expensive,3992 .predictable_select_expensive,
3472 .rand,3993 .rand,
...@@ -3524,12 +4045,15 @@ pub const cpu = struct {...@@ -3524,12 +4045,15 @@ pub const cpu = struct {
3524 .features = featureSet(&[_]Feature{4045 .features = featureSet(&[_]Feature{
3525 .alu_lsl_fast,4046 .alu_lsl_fast,
3526 .bf16,4047 .bf16,
4048 .disable_maximize_scalable_bandwidth,
3527 .enable_select_opt,4049 .enable_select_opt,
3528 .ete,4050 .ete,
3529 .fp16fml,4051 .fp16fml,
3530 .fpac,4052 .fpac,
3531 .fuse_adrp_add,4053 .fuse_adrp_add,
3532 .fuse_aes,4054 .fuse_aes,
4055 .fuse_csel,
4056 .fuse_cset,
3533 .i8mm,4057 .i8mm,
3534 .mte,4058 .mte,
3535 .perfmon,4059 .perfmon,
...@@ -3550,6 +4074,8 @@ pub const cpu = struct {...@@ -3550,6 +4074,8 @@ pub const cpu = struct {
3550 .fpac,4074 .fpac,
3551 .fuse_adrp_add,4075 .fuse_adrp_add,
3552 .fuse_aes,4076 .fuse_aes,
4077 .fuse_csel,
4078 .fuse_cset,
3553 .mte,4079 .mte,
3554 .perfmon,4080 .perfmon,
3555 .predictable_select_expensive,4081 .predictable_select_expensive,
...@@ -3569,10 +4095,13 @@ pub const cpu = struct {...@@ -3569,10 +4095,13 @@ pub const cpu = struct {
3569 .alu_lsl_fast,4095 .alu_lsl_fast,
3570 .bf16,4096 .bf16,
3571 .ccdp,4097 .ccdp,
4098 .disable_maximize_scalable_bandwidth,
3572 .enable_select_opt,4099 .enable_select_opt,
3573 .fp16fml,4100 .fp16fml,
3574 .fuse_adrp_add,4101 .fuse_adrp_add,
3575 .fuse_aes,4102 .fuse_aes,
4103 .fuse_csel,
4104 .fuse_cset,
3576 .i8mm,4105 .i8mm,
3577 .no_sve_fp_ld1r,4106 .no_sve_fp_ld1r,
3578 .perfmon,4107 .perfmon,
...@@ -3602,7 +4131,10 @@ pub const cpu = struct {...@@ -3602,7 +4131,10 @@ pub const cpu = struct {
3602 .fpac,4131 .fpac,
3603 .fuse_adrp_add,4132 .fuse_adrp_add,
3604 .fuse_aes,4133 .fuse_aes,
4134 .fuse_csel,
4135 .fuse_cset,
3605 .i8mm,4136 .i8mm,
4137 .max_interleave_factor_4,
3606 .mte,4138 .mte,
3607 .perfmon,4139 .perfmon,
3608 .predictable_select_expensive,4140 .predictable_select_expensive,
...@@ -3627,7 +4159,10 @@ pub const cpu = struct {...@@ -3627,7 +4159,10 @@ pub const cpu = struct {
3627 .fpac,4159 .fpac,
3628 .fuse_adrp_add,4160 .fuse_adrp_add,
3629 .fuse_aes,4161 .fuse_aes,
4162 .fuse_csel,
4163 .fuse_cset,
3630 .ls64,4164 .ls64,
4165 .max_interleave_factor_4,
3631 .mte,4166 .mte,
3632 .perfmon,4167 .perfmon,
3633 .predictable_select_expensive,4168 .predictable_select_expensive,
...@@ -3651,7 +4186,10 @@ pub const cpu = struct {...@@ -3651,7 +4186,10 @@ pub const cpu = struct {
3651 .fpac,4186 .fpac,
3652 .fuse_adrp_add,4187 .fuse_adrp_add,
3653 .fuse_aes,4188 .fuse_aes,
4189 .fuse_csel,
4190 .fuse_cset,
3654 .ls64,4191 .ls64,
4192 .max_interleave_factor_4,
3655 .mte,4193 .mte,
3656 .perfmon,4194 .perfmon,
3657 .predictable_select_expensive,4195 .predictable_select_expensive,
...@@ -3700,6 +4238,7 @@ pub const cpu = struct {...@@ -3700,6 +4238,7 @@ pub const cpu = struct {
3700 .fuse_adrp_add,4238 .fuse_adrp_add,
3701 .fuse_aes,4239 .fuse_aes,
3702 .fuse_crypto_eor,4240 .fuse_crypto_eor,
4241 .max_interleave_factor_4,
3703 .perfmon,4242 .perfmon,
3704 .rand,4243 .rand,
3705 .sha3,4244 .sha3,
...@@ -3715,6 +4254,7 @@ pub const cpu = struct {...@@ -3715,6 +4254,7 @@ pub const cpu = struct {
3715 .features = featureSet(&[_]Feature{4254 .features = featureSet(&[_]Feature{
3716 .aes,4255 .aes,
3717 .alu_lsl_fast,4256 .alu_lsl_fast,
4257 .max_interleave_factor_4,
3718 .perfmon,4258 .perfmon,
3719 .predictable_select_expensive,4259 .predictable_select_expensive,
3720 .sha2,4260 .sha2,
...@@ -3722,7 +4262,8 @@ pub const cpu = struct {...@@ -3722,7 +4262,8 @@ pub const cpu = struct {
3722 .store_pair_suppress,4262 .store_pair_suppress,
3723 .use_postra_scheduler,4263 .use_postra_scheduler,
3724 .v8_4a,4264 .v8_4a,
3725 .zcz,4265 .zcz_gpr32,
4266 .zcz_gpr64,
3726 }),4267 }),
3727 };4268 };
3728 pub const thunderx: CpuModel = .{4269 pub const thunderx: CpuModel = .{
...@@ -3746,6 +4287,7 @@ pub const cpu = struct {...@@ -3746,6 +4287,7 @@ pub const cpu = struct {
3746 .aes,4287 .aes,
3747 .aggressive_fma,4288 .aggressive_fma,
3748 .arith_bcc_fusion,4289 .arith_bcc_fusion,
4290 .max_interleave_factor_4,
3749 .predictable_select_expensive,4291 .predictable_select_expensive,
3750 .sha2,4292 .sha2,
3751 .store_pair_suppress,4293 .store_pair_suppress,
...@@ -3761,6 +4303,7 @@ pub const cpu = struct {...@@ -3761,6 +4303,7 @@ pub const cpu = struct {
3761 .aggressive_fma,4303 .aggressive_fma,
3762 .arith_bcc_fusion,4304 .arith_bcc_fusion,
3763 .balance_fp_ops,4305 .balance_fp_ops,
4306 .max_interleave_factor_4,
3764 .perfmon,4307 .perfmon,
3765 .predictable_select_expensive,4308 .predictable_select_expensive,
3766 .sha2,4309 .sha2,
lib/std/Target/amdgcn.zig+421-21
...@@ -5,12 +5,17 @@ const CpuFeature = std.Target.Cpu.Feature;...@@ -5,12 +5,17 @@ const CpuFeature = std.Target.Cpu.Feature;
5const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
66
7pub const Feature = enum {7pub const Feature = enum {
8 @"1024_addressable_vgprs",
8 @"16_bit_insts",9 @"16_bit_insts",
10 @"45_bit_num_records_buffer_resource",
9 @"64_bit_literals",11 @"64_bit_literals",
10 a16,12 a16,
13 add_min_max_insts,
11 add_no_carry_insts,14 add_no_carry_insts,
15 add_sub_u64_insts,
12 addressablelocalmemorysize163840,16 addressablelocalmemorysize163840,
13 addressablelocalmemorysize32768,17 addressablelocalmemorysize32768,
18 addressablelocalmemorysize327680,
14 addressablelocalmemorysize65536,19 addressablelocalmemorysize65536,
15 agent_scope_fine_grained_remote_memory_atomics,20 agent_scope_fine_grained_remote_memory_atomics,
16 allocate1_5xvgprs,21 allocate1_5xvgprs,
...@@ -18,6 +23,7 @@ pub const Feature = enum {...@@ -18,6 +23,7 @@ pub const Feature = enum {
18 architected_flat_scratch,23 architected_flat_scratch,
19 architected_sgprs,24 architected_sgprs,
20 ashr_pk_insts,25 ashr_pk_insts,
26 assembler_permissive_wavesize,
21 atomic_buffer_global_pk_add_f16_insts,27 atomic_buffer_global_pk_add_f16_insts,
22 atomic_buffer_global_pk_add_f16_no_rtn_insts,28 atomic_buffer_global_pk_add_f16_no_rtn_insts,
23 atomic_buffer_pk_add_bf16_inst,29 atomic_buffer_pk_add_bf16_inst,
...@@ -34,15 +40,22 @@ pub const Feature = enum {...@@ -34,15 +40,22 @@ pub const Feature = enum {
34 auto_waitcnt_before_barrier,40 auto_waitcnt_before_barrier,
35 back_off_barrier,41 back_off_barrier,
36 bf16_cvt_insts,42 bf16_cvt_insts,
43 bf16_pk_insts,
37 bf16_trans_insts,44 bf16_trans_insts,
38 bf8_cvt_scale_insts,45 bf8_cvt_scale_insts,
39 bitop3_insts,46 bitop3_insts,
40 block_vgpr_csr,47 block_vgpr_csr,
41 bvh_dual_bvh_8_insts,48 bvh_dual_bvh_8_insts,
42 ci_insts,49 ci_insts,
50 clusters,
51 cube_insts,
43 cumode,52 cumode,
44 cvt_fp8_vop1_bug,53 cvt_fp8_vop1_bug,
54 cvt_norm_insts,
45 cvt_pk_f16_f32_inst,55 cvt_pk_f16_f32_inst,
56 cvt_pknorm_vop2_insts,
57 cvt_pknorm_vop3_insts,
58 d16_write_vgpr32,
46 default_component_broadcast,59 default_component_broadcast,
47 default_component_zero,60 default_component_zero,
48 dl_insts,61 dl_insts,
...@@ -65,8 +78,7 @@ pub const Feature = enum {...@@ -65,8 +78,7 @@ pub const Feature = enum {
65 dpp_src1_sgpr,78 dpp_src1_sgpr,
66 ds128,79 ds128,
67 ds_src2_insts,80 ds_src2_insts,
68 dynamic_vgpr,81 emulated_system_scope_atomics,
69 dynamic_vgpr_block_size_32,
70 extended_image_insts,82 extended_image_insts,
71 f16bf16_to_fp6bf6_cvt_scale_insts,83 f16bf16_to_fp6bf6_cvt_scale_insts,
72 f32_to_f16bf16_cvt_sr_insts,84 f32_to_f16bf16_cvt_sr_insts,
...@@ -77,10 +89,12 @@ pub const Feature = enum {...@@ -77,10 +89,12 @@ pub const Feature = enum {
77 flat_buffer_global_fadd_f64_inst,89 flat_buffer_global_fadd_f64_inst,
78 flat_for_global,90 flat_for_global,
79 flat_global_insts,91 flat_global_insts,
92 flat_gvs_mode,
80 flat_inst_offsets,93 flat_inst_offsets,
81 flat_scratch,94 flat_scratch,
82 flat_scratch_insts,95 flat_scratch_insts,
83 flat_segment_offset_bug,96 flat_segment_offset_bug,
97 fma_mix_bf16_insts,
84 fma_mix_insts,98 fma_mix_insts,
85 fmacf64_inst,99 fmacf64_inst,
86 fmaf,100 fmaf,
...@@ -113,6 +127,7 @@ pub const Feature = enum {...@@ -113,6 +127,7 @@ pub const Feature = enum {
113 gfx940_insts,127 gfx940_insts,
114 gfx950_insts,128 gfx950_insts,
115 gfx9_insts,129 gfx9_insts,
130 globally_addressable_scratch,
116 gws,131 gws,
117 half_rate_64_ops,132 half_rate_64_ops,
118 ieee_minimum_maximum_insts,133 ieee_minimum_maximum_insts,
...@@ -128,20 +143,24 @@ pub const Feature = enum {...@@ -128,20 +143,24 @@ pub const Feature = enum {
128 lds_misaligned_bug,143 lds_misaligned_bug,
129 ldsbankcount16,144 ldsbankcount16,
130 ldsbankcount32,145 ldsbankcount32,
146 lerp_inst,
131 load_store_opt,147 load_store_opt,
132 lshl_add_u64_inst,148 lshl_add_u64_inst,
133 mad_intra_fwd_bug,149 mad_intra_fwd_bug,
134 mad_mac_f32_insts,150 mad_mac_f32_insts,
135 mad_mix_insts,151 mad_mix_insts,
152 mad_u32_inst,
136 mai_insts,153 mai_insts,
137 max_hard_clause_length_32,154 max_hard_clause_length_32,
138 max_hard_clause_length_63,155 max_hard_clause_length_63,
139 max_private_element_size_16,156 max_private_element_size_16,
140 max_private_element_size_4,157 max_private_element_size_4,
141 max_private_element_size_8,158 max_private_element_size_8,
159 mcast_load_insts,
142 memory_atomic_fadd_f32_denormal_support,160 memory_atomic_fadd_f32_denormal_support,
143 mfma_inline_literal_bug,161 mfma_inline_literal_bug,
144 mimg_r128,162 mimg_r128,
163 min3_max3_pkf16,
145 minimum3_maximum3_f16,164 minimum3_maximum3_f16,
146 minimum3_maximum3_f32,165 minimum3_maximum3_f32,
147 minimum3_maximum3_pkf16,166 minimum3_maximum3_pkf16,
...@@ -160,6 +179,7 @@ pub const Feature = enum {...@@ -160,6 +179,7 @@ pub const Feature = enum {
160 partial_nsa_encoding,179 partial_nsa_encoding,
161 permlane16_swap,180 permlane16_swap,
162 permlane32_swap,181 permlane32_swap,
182 pk_add_min_max_insts,
163 pk_fmac_f16_inst,183 pk_fmac_f16_inst,
164 point_sample_accel,184 point_sample_accel,
165 precise_memory,185 precise_memory,
...@@ -168,6 +188,7 @@ pub const Feature = enum {...@@ -168,6 +188,7 @@ pub const Feature = enum {
168 promote_alloca,188 promote_alloca,
169 prt_strict_null,189 prt_strict_null,
170 pseudo_scalar_trans,190 pseudo_scalar_trans,
191 qsad_insts,
171 r128_a16,192 r128_a16,
172 real_true16,193 real_true16,
173 relaxed_buffer_oob_mode,194 relaxed_buffer_oob_mode,
...@@ -176,6 +197,9 @@ pub const Feature = enum {...@@ -176,6 +197,9 @@ pub const Feature = enum {
176 restricted_soffset,197 restricted_soffset,
177 s_memrealtime,198 s_memrealtime,
178 s_memtime_inst,199 s_memtime_inst,
200 s_wakeup_barrier_inst,
201 sad_insts,
202 safe_cu_prefetch,
179 safe_smem_prefetch,203 safe_smem_prefetch,
180 salu_float,204 salu_float,
181 scalar_atomics,205 scalar_atomics,
...@@ -190,6 +214,7 @@ pub const Feature = enum {...@@ -190,6 +214,7 @@ pub const Feature = enum {
190 sdwa_sdst,214 sdwa_sdst,
191 sea_islands,215 sea_islands,
192 setprio_inc_wg_inst,216 setprio_inc_wg_inst,
217 setreg_vgpr_msb_fixup,
193 sgpr_init_bug,218 sgpr_init_bug,
194 shader_cycles_hi_lo_registers,219 shader_cycles_hi_lo_registers,
195 shader_cycles_register,220 shader_cycles_register,
...@@ -198,6 +223,8 @@ pub const Feature = enum {...@@ -198,6 +223,8 @@ pub const Feature = enum {
198 southern_islands,223 southern_islands,
199 sramecc,224 sramecc,
200 sramecc_support,225 sramecc_support,
226 tanh_insts,
227 tensor_cvt_lut_insts,
201 tgsplit,228 tgsplit,
202 transpose_load_f4f6_insts,229 transpose_load_f4f6_insts,
203 trap_handler,230 trap_handler,
...@@ -213,7 +240,9 @@ pub const Feature = enum {...@@ -213,7 +240,9 @@ pub const Feature = enum {
213 valu_trans_use_hazard,240 valu_trans_use_hazard,
214 vcmpx_exec_war_hazard,241 vcmpx_exec_war_hazard,
215 vcmpx_permlane_hazard,242 vcmpx_permlane_hazard,
243 vgpr_align2,
216 vgpr_index_mode,244 vgpr_index_mode,
245 vmem_pref_insts,
217 vmem_to_lds_load_insts,246 vmem_to_lds_load_insts,
218 vmem_to_scalar_write_hazard,247 vmem_to_scalar_write_hazard,
219 vmem_write_vgpr_in_order,248 vmem_write_vgpr_in_order,
...@@ -223,6 +252,7 @@ pub const Feature = enum {...@@ -223,6 +252,7 @@ pub const Feature = enum {
223 vopd,252 vopd,
224 vscnt,253 vscnt,
225 wait_xcnt,254 wait_xcnt,
255 waits_before_system_scope_stores,
226 wavefrontsize16,256 wavefrontsize16,
227 wavefrontsize32,257 wavefrontsize32,
228 wavefrontsize64,258 wavefrontsize64,
...@@ -241,11 +271,21 @@ pub const all_features = blk: {...@@ -241,11 +271,21 @@ pub const all_features = blk: {
241 const len = @typeInfo(Feature).@"enum".fields.len;271 const len = @typeInfo(Feature).@"enum".fields.len;
242 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);272 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
243 var result: [len]CpuFeature = undefined;273 var result: [len]CpuFeature = undefined;
274 result[@intFromEnum(Feature.@"1024_addressable_vgprs")] = .{
275 .llvm_name = "1024-addressable-vgprs",
276 .description = "Has 1024 addressable VGPRs",
277 .dependencies = featureSet(&[_]Feature{}),
278 };
244 result[@intFromEnum(Feature.@"16_bit_insts")] = .{279 result[@intFromEnum(Feature.@"16_bit_insts")] = .{
245 .llvm_name = "16-bit-insts",280 .llvm_name = "16-bit-insts",
246 .description = "Has i16/f16 instructions",281 .description = "Has i16/f16 instructions",
247 .dependencies = featureSet(&[_]Feature{}),282 .dependencies = featureSet(&[_]Feature{}),
248 };283 };
284 result[@intFromEnum(Feature.@"45_bit_num_records_buffer_resource")] = .{
285 .llvm_name = "45-bit-num-records-buffer-resource",
286 .description = "The buffer resource (V#) supports 45-bit num_records",
287 .dependencies = featureSet(&[_]Feature{}),
288 };
249 result[@intFromEnum(Feature.@"64_bit_literals")] = .{289 result[@intFromEnum(Feature.@"64_bit_literals")] = .{
250 .llvm_name = "64-bit-literals",290 .llvm_name = "64-bit-literals",
251 .description = "Can use 64-bit literals with single DWORD instructions",291 .description = "Can use 64-bit literals with single DWORD instructions",
...@@ -256,11 +296,21 @@ pub const all_features = blk: {...@@ -256,11 +296,21 @@ pub const all_features = blk: {
256 .description = "Support A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",296 .description = "Support A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",
257 .dependencies = featureSet(&[_]Feature{}),297 .dependencies = featureSet(&[_]Feature{}),
258 };298 };
299 result[@intFromEnum(Feature.add_min_max_insts)] = .{
300 .llvm_name = "add-min-max-insts",
301 .description = "Has v_add_{min|max}_{i|u}32 instructions",
302 .dependencies = featureSet(&[_]Feature{}),
303 };
259 result[@intFromEnum(Feature.add_no_carry_insts)] = .{304 result[@intFromEnum(Feature.add_no_carry_insts)] = .{
260 .llvm_name = "add-no-carry-insts",305 .llvm_name = "add-no-carry-insts",
261 .description = "Have VALU add/sub instructions without carry out",306 .description = "Have VALU add/sub instructions without carry out",
262 .dependencies = featureSet(&[_]Feature{}),307 .dependencies = featureSet(&[_]Feature{}),
263 };308 };
309 result[@intFromEnum(Feature.add_sub_u64_insts)] = .{
310 .llvm_name = "add-sub-u64-insts",
311 .description = "Has v_add_u64 and v_sub_u64 instructions",
312 .dependencies = featureSet(&[_]Feature{}),
313 };
264 result[@intFromEnum(Feature.addressablelocalmemorysize163840)] = .{314 result[@intFromEnum(Feature.addressablelocalmemorysize163840)] = .{
265 .llvm_name = "addressablelocalmemorysize163840",315 .llvm_name = "addressablelocalmemorysize163840",
266 .description = "The size of local memory in bytes",316 .description = "The size of local memory in bytes",
...@@ -271,6 +321,11 @@ pub const all_features = blk: {...@@ -271,6 +321,11 @@ pub const all_features = blk: {
271 .description = "The size of local memory in bytes",321 .description = "The size of local memory in bytes",
272 .dependencies = featureSet(&[_]Feature{}),322 .dependencies = featureSet(&[_]Feature{}),
273 };323 };
324 result[@intFromEnum(Feature.addressablelocalmemorysize327680)] = .{
325 .llvm_name = "addressablelocalmemorysize327680",
326 .description = "The size of local memory in bytes",
327 .dependencies = featureSet(&[_]Feature{}),
328 };
274 result[@intFromEnum(Feature.addressablelocalmemorysize65536)] = .{329 result[@intFromEnum(Feature.addressablelocalmemorysize65536)] = .{
275 .llvm_name = "addressablelocalmemorysize65536",330 .llvm_name = "addressablelocalmemorysize65536",
276 .description = "The size of local memory in bytes",331 .description = "The size of local memory in bytes",
...@@ -306,6 +361,11 @@ pub const all_features = blk: {...@@ -306,6 +361,11 @@ pub const all_features = blk: {
306 .description = "Has Arithmetic Shift Pack instructions",361 .description = "Has Arithmetic Shift Pack instructions",
307 .dependencies = featureSet(&[_]Feature{}),362 .dependencies = featureSet(&[_]Feature{}),
308 };363 };
364 result[@intFromEnum(Feature.assembler_permissive_wavesize)] = .{
365 .llvm_name = "assembler-permissive-wavesize",
366 .description = "allow parsing wave32 and wave64 variants of instructions",
367 .dependencies = featureSet(&[_]Feature{}),
368 };
309 result[@intFromEnum(Feature.atomic_buffer_global_pk_add_f16_insts)] = .{369 result[@intFromEnum(Feature.atomic_buffer_global_pk_add_f16_insts)] = .{
310 .llvm_name = "atomic-buffer-global-pk-add-f16-insts",370 .llvm_name = "atomic-buffer-global-pk-add-f16-insts",
311 .description = "Has buffer_atomic_pk_add_f16 and global_atomic_pk_add_f16 instructions that can return original value",371 .description = "Has buffer_atomic_pk_add_f16 and global_atomic_pk_add_f16 instructions that can return original value",
...@@ -357,12 +417,16 @@ pub const all_features = blk: {...@@ -357,12 +417,16 @@ pub const all_features = blk: {
357 result[@intFromEnum(Feature.atomic_fmin_fmax_flat_f32)] = .{417 result[@intFromEnum(Feature.atomic_fmin_fmax_flat_f32)] = .{
358 .llvm_name = "atomic-fmin-fmax-flat-f32",418 .llvm_name = "atomic-fmin-fmax-flat-f32",
359 .description = "Has flat memory instructions for atomicrmw fmin/fmax for float",419 .description = "Has flat memory instructions for atomicrmw fmin/fmax for float",
360 .dependencies = featureSet(&[_]Feature{}),420 .dependencies = featureSet(&[_]Feature{
421 .flat_address_space,
422 }),
361 };423 };
362 result[@intFromEnum(Feature.atomic_fmin_fmax_flat_f64)] = .{424 result[@intFromEnum(Feature.atomic_fmin_fmax_flat_f64)] = .{
363 .llvm_name = "atomic-fmin-fmax-flat-f64",425 .llvm_name = "atomic-fmin-fmax-flat-f64",
364 .description = "Has flat memory instructions for atomicrmw fmin/fmax for double",426 .description = "Has flat memory instructions for atomicrmw fmin/fmax for double",
365 .dependencies = featureSet(&[_]Feature{}),427 .dependencies = featureSet(&[_]Feature{
428 .flat_address_space,
429 }),
366 };430 };
367 result[@intFromEnum(Feature.atomic_fmin_fmax_global_f32)] = .{431 result[@intFromEnum(Feature.atomic_fmin_fmax_global_f32)] = .{
368 .llvm_name = "atomic-fmin-fmax-global-f32",432 .llvm_name = "atomic-fmin-fmax-global-f32",
...@@ -396,6 +460,11 @@ pub const all_features = blk: {...@@ -396,6 +460,11 @@ pub const all_features = blk: {
396 .description = "Has bf16 conversion instructions",460 .description = "Has bf16 conversion instructions",
397 .dependencies = featureSet(&[_]Feature{}),461 .dependencies = featureSet(&[_]Feature{}),
398 };462 };
463 result[@intFromEnum(Feature.bf16_pk_insts)] = .{
464 .llvm_name = "bf16-pk-insts",
465 .description = "Has bf16 packed instructions (fma, add, mul, max, min)",
466 .dependencies = featureSet(&[_]Feature{}),
467 };
399 result[@intFromEnum(Feature.bf16_trans_insts)] = .{468 result[@intFromEnum(Feature.bf16_trans_insts)] = .{
400 .llvm_name = "bf16-trans-insts",469 .llvm_name = "bf16-trans-insts",
401 .description = "Has bf16 transcendental instructions",470 .description = "Has bf16 transcendental instructions",
...@@ -426,6 +495,16 @@ pub const all_features = blk: {...@@ -426,6 +495,16 @@ pub const all_features = blk: {
426 .description = "Additional instructions for CI+",495 .description = "Additional instructions for CI+",
427 .dependencies = featureSet(&[_]Feature{}),496 .dependencies = featureSet(&[_]Feature{}),
428 };497 };
498 result[@intFromEnum(Feature.clusters)] = .{
499 .llvm_name = "clusters",
500 .description = "Has clusters of workgroups support",
501 .dependencies = featureSet(&[_]Feature{}),
502 };
503 result[@intFromEnum(Feature.cube_insts)] = .{
504 .llvm_name = "cube-insts",
505 .description = "Has v_cube* instructions",
506 .dependencies = featureSet(&[_]Feature{}),
507 };
429 result[@intFromEnum(Feature.cumode)] = .{508 result[@intFromEnum(Feature.cumode)] = .{
430 .llvm_name = "cumode",509 .llvm_name = "cumode",
431 .description = "Enable CU wavefront execution mode",510 .description = "Enable CU wavefront execution mode",
...@@ -438,11 +517,31 @@ pub const all_features = blk: {...@@ -438,11 +517,31 @@ pub const all_features = blk: {
438 .fp8_conversion_insts,517 .fp8_conversion_insts,
439 }),518 }),
440 };519 };
520 result[@intFromEnum(Feature.cvt_norm_insts)] = .{
521 .llvm_name = "cvt-norm-insts",
522 .description = "Has v_cvt_norm* instructions",
523 .dependencies = featureSet(&[_]Feature{}),
524 };
441 result[@intFromEnum(Feature.cvt_pk_f16_f32_inst)] = .{525 result[@intFromEnum(Feature.cvt_pk_f16_f32_inst)] = .{
442 .llvm_name = "cvt-pk-f16-f32-inst",526 .llvm_name = "cvt-pk-f16-f32-inst",
443 .description = "Has cvt_pk_f16_f32 instruction",527 .description = "Has cvt_pk_f16_f32 instruction",
444 .dependencies = featureSet(&[_]Feature{}),528 .dependencies = featureSet(&[_]Feature{}),
445 };529 };
530 result[@intFromEnum(Feature.cvt_pknorm_vop2_insts)] = .{
531 .llvm_name = "cvt-pknorm-vop2-insts",
532 .description = "Has v_cvt_pk_norm_*f32 instructions/Has v_cvt_pk_norm_*_f16 instructions",
533 .dependencies = featureSet(&[_]Feature{}),
534 };
535 result[@intFromEnum(Feature.cvt_pknorm_vop3_insts)] = .{
536 .llvm_name = "cvt-pknorm-vop3-insts",
537 .description = "Has v_cvt_pk_norm_*f32 instructions/Has v_cvt_pk_norm_*_f16 instructions",
538 .dependencies = featureSet(&[_]Feature{}),
539 };
540 result[@intFromEnum(Feature.d16_write_vgpr32)] = .{
541 .llvm_name = "d16-write-vgpr32",
542 .description = "D16 instructions potentially have 32-bit data dependencies",
543 .dependencies = featureSet(&[_]Feature{}),
544 };
446 result[@intFromEnum(Feature.default_component_broadcast)] = .{545 result[@intFromEnum(Feature.default_component_broadcast)] = .{
447 .llvm_name = "default-component-broadcast",546 .llvm_name = "default-component-broadcast",
448 .description = "BUFFER/IMAGE store instructions set unspecified components to x component (GFX12)",547 .description = "BUFFER/IMAGE store instructions set unspecified components to x component (GFX12)",
...@@ -553,14 +652,9 @@ pub const all_features = blk: {...@@ -553,14 +652,9 @@ pub const all_features = blk: {
553 .description = "Has ds_*_src2 instructions",652 .description = "Has ds_*_src2 instructions",
554 .dependencies = featureSet(&[_]Feature{}),653 .dependencies = featureSet(&[_]Feature{}),
555 };654 };
556 result[@intFromEnum(Feature.dynamic_vgpr)] = .{655 result[@intFromEnum(Feature.emulated_system_scope_atomics)] = .{
557 .llvm_name = "dynamic-vgpr",656 .llvm_name = "emulated-system-scope-atomics",
558 .description = "Enable dynamic VGPR mode",657 .description = "System scope atomics unsupported by the PCI-e are emulated in HW via CAS loop and functional.",
559 .dependencies = featureSet(&[_]Feature{}),
560 };
561 result[@intFromEnum(Feature.dynamic_vgpr_block_size_32)] = .{
562 .llvm_name = "dynamic-vgpr-block-size-32",
563 .description = "Use a block size of 32 for dynamic VGPR allocation (default is 16)",
564 .dependencies = featureSet(&[_]Feature{}),658 .dependencies = featureSet(&[_]Feature{}),
565 };659 };
566 result[@intFromEnum(Feature.extended_image_insts)] = .{660 result[@intFromEnum(Feature.extended_image_insts)] = .{
...@@ -596,7 +690,9 @@ pub const all_features = blk: {...@@ -596,7 +690,9 @@ pub const all_features = blk: {
596 result[@intFromEnum(Feature.flat_atomic_fadd_f32_inst)] = .{690 result[@intFromEnum(Feature.flat_atomic_fadd_f32_inst)] = .{
597 .llvm_name = "flat-atomic-fadd-f32-inst",691 .llvm_name = "flat-atomic-fadd-f32-inst",
598 .description = "Has flat_atomic_add_f32 instruction",692 .description = "Has flat_atomic_add_f32 instruction",
599 .dependencies = featureSet(&[_]Feature{}),693 .dependencies = featureSet(&[_]Feature{
694 .flat_address_space,
695 }),
600 };696 };
601 result[@intFromEnum(Feature.flat_buffer_global_fadd_f64_inst)] = .{697 result[@intFromEnum(Feature.flat_buffer_global_fadd_f64_inst)] = .{
602 .llvm_name = "flat-buffer-global-fadd-f64-inst",698 .llvm_name = "flat-buffer-global-fadd-f64-inst",
...@@ -611,7 +707,16 @@ pub const all_features = blk: {...@@ -611,7 +707,16 @@ pub const all_features = blk: {
611 result[@intFromEnum(Feature.flat_global_insts)] = .{707 result[@intFromEnum(Feature.flat_global_insts)] = .{
612 .llvm_name = "flat-global-insts",708 .llvm_name = "flat-global-insts",
613 .description = "Have global_* flat memory instructions",709 .description = "Have global_* flat memory instructions",
614 .dependencies = featureSet(&[_]Feature{}),710 .dependencies = featureSet(&[_]Feature{
711 .flat_address_space,
712 }),
713 };
714 result[@intFromEnum(Feature.flat_gvs_mode)] = .{
715 .llvm_name = "flat-gvs-mode",
716 .description = "Have GVS addressing mode with flat_* instructions",
717 .dependencies = featureSet(&[_]Feature{
718 .flat_address_space,
719 }),
615 };720 };
616 result[@intFromEnum(Feature.flat_inst_offsets)] = .{721 result[@intFromEnum(Feature.flat_inst_offsets)] = .{
617 .llvm_name = "flat-inst-offsets",722 .llvm_name = "flat-inst-offsets",
...@@ -626,13 +731,20 @@ pub const all_features = blk: {...@@ -626,13 +731,20 @@ pub const all_features = blk: {
626 result[@intFromEnum(Feature.flat_scratch_insts)] = .{731 result[@intFromEnum(Feature.flat_scratch_insts)] = .{
627 .llvm_name = "flat-scratch-insts",732 .llvm_name = "flat-scratch-insts",
628 .description = "Have scratch_* flat memory instructions",733 .description = "Have scratch_* flat memory instructions",
629 .dependencies = featureSet(&[_]Feature{}),734 .dependencies = featureSet(&[_]Feature{
735 .flat_address_space,
736 }),
630 };737 };
631 result[@intFromEnum(Feature.flat_segment_offset_bug)] = .{738 result[@intFromEnum(Feature.flat_segment_offset_bug)] = .{
632 .llvm_name = "flat-segment-offset-bug",739 .llvm_name = "flat-segment-offset-bug",
633 .description = "GFX10 bug where inst_offset is ignored when flat instructions access global memory",740 .description = "GFX10 bug where inst_offset is ignored when flat instructions access global memory",
634 .dependencies = featureSet(&[_]Feature{}),741 .dependencies = featureSet(&[_]Feature{}),
635 };742 };
743 result[@intFromEnum(Feature.fma_mix_bf16_insts)] = .{
744 .llvm_name = "fma-mix-bf16-insts",
745 .description = "Has v_fma_mix_f32_bf16, v_fma_mixlo_bf16, v_fma_mixhi_bf16 instructions",
746 .dependencies = featureSet(&[_]Feature{}),
747 };
636 result[@intFromEnum(Feature.fma_mix_insts)] = .{748 result[@intFromEnum(Feature.fma_mix_insts)] = .{
637 .llvm_name = "fma-mix-insts",749 .llvm_name = "fma-mix-insts",
638 .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions",750 .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions",
...@@ -722,13 +834,16 @@ pub const all_features = blk: {...@@ -722,13 +834,16 @@ pub const all_features = blk: {
722 .atomic_fmin_fmax_global_f32,834 .atomic_fmin_fmax_global_f32,
723 .atomic_fmin_fmax_global_f64,835 .atomic_fmin_fmax_global_f64,
724 .ci_insts,836 .ci_insts,
837 .cube_insts,
838 .cvt_norm_insts,
839 .cvt_pknorm_vop2_insts,
840 .cvt_pknorm_vop3_insts,
725 .default_component_zero,841 .default_component_zero,
726 .dpp,842 .dpp,
727 .dpp8,843 .dpp8,
728 .extended_image_insts,844 .extended_image_insts,
729 .fast_denormal_f32,845 .fast_denormal_f32,
730 .fast_fmaf,846 .fast_fmaf,
731 .flat_address_space,
732 .flat_global_insts,847 .flat_global_insts,
733 .flat_inst_offsets,848 .flat_inst_offsets,
734 .flat_scratch_insts,849 .flat_scratch_insts,
...@@ -743,14 +858,17 @@ pub const all_features = blk: {...@@ -743,14 +858,17 @@ pub const all_features = blk: {
743 .image_insts,858 .image_insts,
744 .int_clamp_insts,859 .int_clamp_insts,
745 .inv_2pi_inline_imm,860 .inv_2pi_inline_imm,
861 .lerp_inst,
746 .max_hard_clause_length_63,862 .max_hard_clause_length_63,
747 .mimg_r128,863 .mimg_r128,
748 .movrel,864 .movrel,
749 .no_data_dep_hazard,865 .no_data_dep_hazard,
750 .no_sdst_cmpx,866 .no_sdst_cmpx,
751 .pk_fmac_f16_inst,867 .pk_fmac_f16_inst,
868 .qsad_insts,
752 .s_memrealtime,869 .s_memrealtime,
753 .s_memtime_inst,870 .s_memtime_inst,
871 .sad_insts,
754 .sdwa,872 .sdwa,
755 .sdwa_omod,873 .sdwa_omod,
756 .sdwa_scalar,874 .sdwa_scalar,
...@@ -797,13 +915,16 @@ pub const all_features = blk: {...@@ -797,13 +915,16 @@ pub const all_features = blk: {
797 .atomic_fmin_fmax_flat_f32,915 .atomic_fmin_fmax_flat_f32,
798 .atomic_fmin_fmax_global_f32,916 .atomic_fmin_fmax_global_f32,
799 .ci_insts,917 .ci_insts,
918 .cube_insts,
919 .cvt_norm_insts,
920 .cvt_pknorm_vop2_insts,
921 .cvt_pknorm_vop3_insts,
800 .default_component_zero,922 .default_component_zero,
801 .dpp,923 .dpp,
802 .dpp8,924 .dpp8,
803 .extended_image_insts,925 .extended_image_insts,
804 .fast_denormal_f32,926 .fast_denormal_f32,
805 .fast_fmaf,927 .fast_fmaf,
806 .flat_address_space,
807 .flat_global_insts,928 .flat_global_insts,
808 .flat_inst_offsets,929 .flat_inst_offsets,
809 .flat_scratch_insts,930 .flat_scratch_insts,
...@@ -821,12 +942,15 @@ pub const all_features = blk: {...@@ -821,12 +942,15 @@ pub const all_features = blk: {
821 .gws,942 .gws,
822 .int_clamp_insts,943 .int_clamp_insts,
823 .inv_2pi_inline_imm,944 .inv_2pi_inline_imm,
945 .lerp_inst,
824 .max_hard_clause_length_32,946 .max_hard_clause_length_32,
825 .mimg_r128,947 .mimg_r128,
826 .movrel,948 .movrel,
827 .no_data_dep_hazard,949 .no_data_dep_hazard,
828 .no_sdst_cmpx,950 .no_sdst_cmpx,
829 .pk_fmac_f16_inst,951 .pk_fmac_f16_inst,
952 .qsad_insts,
953 .sad_insts,
830 .true16,954 .true16,
831 .unaligned_buffer_access,955 .unaligned_buffer_access,
832 .unaligned_ds_access,956 .unaligned_ds_access,
...@@ -850,7 +974,6 @@ pub const all_features = blk: {...@@ -850,7 +974,6 @@ pub const all_features = blk: {
850 .@"16_bit_insts",974 .@"16_bit_insts",
851 .a16,975 .a16,
852 .add_no_carry_insts,976 .add_no_carry_insts,
853 .addressablelocalmemorysize65536,
854 .agent_scope_fine_grained_remote_memory_atomics,977 .agent_scope_fine_grained_remote_memory_atomics,
855 .aperture_regs,978 .aperture_regs,
856 .atomic_fmin_fmax_flat_f32,979 .atomic_fmin_fmax_flat_f32,
...@@ -861,7 +984,6 @@ pub const all_features = blk: {...@@ -861,7 +984,6 @@ pub const all_features = blk: {
861 .dpp8,984 .dpp8,
862 .fast_denormal_f32,985 .fast_denormal_f32,
863 .fast_fmaf,986 .fast_fmaf,
864 .flat_address_space,
865 .flat_global_insts,987 .flat_global_insts,
866 .flat_inst_offsets,988 .flat_inst_offsets,
867 .flat_scratch_insts,989 .flat_scratch_insts,
...@@ -926,11 +1048,14 @@ pub const all_features = blk: {...@@ -926,11 +1048,14 @@ pub const all_features = blk: {
926 .add_no_carry_insts,1048 .add_no_carry_insts,
927 .aperture_regs,1049 .aperture_regs,
928 .ci_insts,1050 .ci_insts,
1051 .cube_insts,
1052 .cvt_norm_insts,
1053 .cvt_pknorm_vop2_insts,
1054 .cvt_pknorm_vop3_insts,
929 .default_component_zero,1055 .default_component_zero,
930 .dpp,1056 .dpp,
931 .fast_denormal_f32,1057 .fast_denormal_f32,
932 .fast_fmaf,1058 .fast_fmaf,
933 .flat_address_space,
934 .flat_global_insts,1059 .flat_global_insts,
935 .flat_inst_offsets,1060 .flat_inst_offsets,
936 .flat_scratch_insts,1061 .flat_scratch_insts,
...@@ -942,10 +1067,13 @@ pub const all_features = blk: {...@@ -942,10 +1067,13 @@ pub const all_features = blk: {
942 .gws,1067 .gws,
943 .int_clamp_insts,1068 .int_clamp_insts,
944 .inv_2pi_inline_imm,1069 .inv_2pi_inline_imm,
1070 .lerp_inst,
945 .negative_scratch_offset_bug,1071 .negative_scratch_offset_bug,
1072 .qsad_insts,
946 .r128_a16,1073 .r128_a16,
947 .s_memrealtime,1074 .s_memrealtime,
948 .s_memtime_inst,1075 .s_memtime_inst,
1076 .sad_insts,
949 .scalar_atomics,1077 .scalar_atomics,
950 .scalar_flat_scratch_insts,1078 .scalar_flat_scratch_insts,
951 .scalar_stores,1079 .scalar_stores,
...@@ -997,6 +1125,11 @@ pub const all_features = blk: {...@@ -997,6 +1125,11 @@ pub const all_features = blk: {
997 .description = "Additional instructions for GFX9+",1125 .description = "Additional instructions for GFX9+",
998 .dependencies = featureSet(&[_]Feature{}),1126 .dependencies = featureSet(&[_]Feature{}),
999 };1127 };
1128 result[@intFromEnum(Feature.globally_addressable_scratch)] = .{
1129 .llvm_name = "globally-addressable-scratch",
1130 .description = "FLAT instructions can access scratch memory for any thread in any wave",
1131 .dependencies = featureSet(&[_]Feature{}),
1132 };
1000 result[@intFromEnum(Feature.gws)] = .{1133 result[@intFromEnum(Feature.gws)] = .{
1001 .llvm_name = "gws",1134 .llvm_name = "gws",
1002 .description = "Has Global Wave Sync",1135 .description = "Has Global Wave Sync",
...@@ -1072,6 +1205,11 @@ pub const all_features = blk: {...@@ -1072,6 +1205,11 @@ pub const all_features = blk: {
1072 .description = "The number of LDS banks per compute unit.",1205 .description = "The number of LDS banks per compute unit.",
1073 .dependencies = featureSet(&[_]Feature{}),1206 .dependencies = featureSet(&[_]Feature{}),
1074 };1207 };
1208 result[@intFromEnum(Feature.lerp_inst)] = .{
1209 .llvm_name = "lerp-inst",
1210 .description = "Has v_lerp_u8 instruction",
1211 .dependencies = featureSet(&[_]Feature{}),
1212 };
1075 result[@intFromEnum(Feature.load_store_opt)] = .{1213 result[@intFromEnum(Feature.load_store_opt)] = .{
1076 .llvm_name = "load-store-opt",1214 .llvm_name = "load-store-opt",
1077 .description = "Enable SI load/store optimizer pass",1215 .description = "Enable SI load/store optimizer pass",
...@@ -1097,6 +1235,11 @@ pub const all_features = blk: {...@@ -1097,6 +1235,11 @@ pub const all_features = blk: {
1097 .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions",1235 .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions",
1098 .dependencies = featureSet(&[_]Feature{}),1236 .dependencies = featureSet(&[_]Feature{}),
1099 };1237 };
1238 result[@intFromEnum(Feature.mad_u32_inst)] = .{
1239 .llvm_name = "mad-u32-inst",
1240 .description = "Has v_mad_u32 instruction",
1241 .dependencies = featureSet(&[_]Feature{}),
1242 };
1100 result[@intFromEnum(Feature.mai_insts)] = .{1243 result[@intFromEnum(Feature.mai_insts)] = .{
1101 .llvm_name = "mai-insts",1244 .llvm_name = "mai-insts",
1102 .description = "Has mAI instructions",1245 .description = "Has mAI instructions",
...@@ -1127,6 +1270,11 @@ pub const all_features = blk: {...@@ -1127,6 +1270,11 @@ pub const all_features = blk: {
1127 .description = "Maximum private access size may be 8",1270 .description = "Maximum private access size may be 8",
1128 .dependencies = featureSet(&[_]Feature{}),1271 .dependencies = featureSet(&[_]Feature{}),
1129 };1272 };
1273 result[@intFromEnum(Feature.mcast_load_insts)] = .{
1274 .llvm_name = "mcast-load-insts",
1275 .description = "Has multicast load instructions",
1276 .dependencies = featureSet(&[_]Feature{}),
1277 };
1130 result[@intFromEnum(Feature.memory_atomic_fadd_f32_denormal_support)] = .{1278 result[@intFromEnum(Feature.memory_atomic_fadd_f32_denormal_support)] = .{
1131 .llvm_name = "memory-atomic-fadd-f32-denormal-support",1279 .llvm_name = "memory-atomic-fadd-f32-denormal-support",
1132 .description = "global/flat/buffer atomic fadd for float supports denormal handling",1280 .description = "global/flat/buffer atomic fadd for float supports denormal handling",
...@@ -1142,6 +1290,11 @@ pub const all_features = blk: {...@@ -1142,6 +1290,11 @@ pub const all_features = blk: {
1142 .description = "Support 128-bit texture resources",1290 .description = "Support 128-bit texture resources",
1143 .dependencies = featureSet(&[_]Feature{}),1291 .dependencies = featureSet(&[_]Feature{}),
1144 };1292 };
1293 result[@intFromEnum(Feature.min3_max3_pkf16)] = .{
1294 .llvm_name = "min3-max3-pkf16",
1295 .description = "Has v_pk_min3_num_f16 and v_pk_max3_num_f16 instructions",
1296 .dependencies = featureSet(&[_]Feature{}),
1297 };
1145 result[@intFromEnum(Feature.minimum3_maximum3_f16)] = .{1298 result[@intFromEnum(Feature.minimum3_maximum3_f16)] = .{
1146 .llvm_name = "minimum3-maximum3-f16",1299 .llvm_name = "minimum3-maximum3-f16",
1147 .description = "Has v_minimum3_f16 and v_maximum3_f16 instructions",1300 .description = "Has v_minimum3_f16 and v_maximum3_f16 instructions",
...@@ -1232,6 +1385,11 @@ pub const all_features = blk: {...@@ -1232,6 +1385,11 @@ pub const all_features = blk: {
1232 .description = "Has v_permlane32_swap_b32 instructions",1385 .description = "Has v_permlane32_swap_b32 instructions",
1233 .dependencies = featureSet(&[_]Feature{}),1386 .dependencies = featureSet(&[_]Feature{}),
1234 };1387 };
1388 result[@intFromEnum(Feature.pk_add_min_max_insts)] = .{
1389 .llvm_name = "pk-add-min-max-insts",
1390 .description = "Has v_pk_add_{min|max}_{i|u}16 instructions",
1391 .dependencies = featureSet(&[_]Feature{}),
1392 };
1235 result[@intFromEnum(Feature.pk_fmac_f16_inst)] = .{1393 result[@intFromEnum(Feature.pk_fmac_f16_inst)] = .{
1236 .llvm_name = "pk-fmac-f16-inst",1394 .llvm_name = "pk-fmac-f16-inst",
1237 .description = "Has v_pk_fmac_f16 instruction",1395 .description = "Has v_pk_fmac_f16 instruction",
...@@ -1272,6 +1430,11 @@ pub const all_features = blk: {...@@ -1272,6 +1430,11 @@ pub const all_features = blk: {
1272 .description = "Has Pseudo Scalar Transcendental instructions",1430 .description = "Has Pseudo Scalar Transcendental instructions",
1273 .dependencies = featureSet(&[_]Feature{}),1431 .dependencies = featureSet(&[_]Feature{}),
1274 };1432 };
1433 result[@intFromEnum(Feature.qsad_insts)] = .{
1434 .llvm_name = "qsad-insts",
1435 .description = "Has v_qsad* instructions",
1436 .dependencies = featureSet(&[_]Feature{}),
1437 };
1275 result[@intFromEnum(Feature.r128_a16)] = .{1438 result[@intFromEnum(Feature.r128_a16)] = .{
1276 .llvm_name = "r128-a16",1439 .llvm_name = "r128-a16",
1277 .description = "Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128",1440 .description = "Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128",
...@@ -1312,6 +1475,21 @@ pub const all_features = blk: {...@@ -1312,6 +1475,21 @@ pub const all_features = blk: {
1312 .description = "Has s_memtime instruction",1475 .description = "Has s_memtime instruction",
1313 .dependencies = featureSet(&[_]Feature{}),1476 .dependencies = featureSet(&[_]Feature{}),
1314 };1477 };
1478 result[@intFromEnum(Feature.s_wakeup_barrier_inst)] = .{
1479 .llvm_name = "s-wakeup-barrier-inst",
1480 .description = "Has s_wakeup_barrier instruction.",
1481 .dependencies = featureSet(&[_]Feature{}),
1482 };
1483 result[@intFromEnum(Feature.sad_insts)] = .{
1484 .llvm_name = "sad-insts",
1485 .description = "Has v_sad* instructions",
1486 .dependencies = featureSet(&[_]Feature{}),
1487 };
1488 result[@intFromEnum(Feature.safe_cu_prefetch)] = .{
1489 .llvm_name = "safe-cu-prefetch",
1490 .description = "VMEM CU scope prefetches do not fail on illegal address",
1491 .dependencies = featureSet(&[_]Feature{}),
1492 };
1315 result[@intFromEnum(Feature.safe_smem_prefetch)] = .{1493 result[@intFromEnum(Feature.safe_smem_prefetch)] = .{
1316 .llvm_name = "safe-smem-prefetch",1494 .llvm_name = "safe-smem-prefetch",
1317 .description = "SMEM prefetches do not fail on illegal address",1495 .description = "SMEM prefetches do not fail on illegal address",
...@@ -1382,19 +1560,23 @@ pub const all_features = blk: {...@@ -1382,19 +1560,23 @@ pub const all_features = blk: {
1382 .atomic_fmin_fmax_global_f32,1560 .atomic_fmin_fmax_global_f32,
1383 .atomic_fmin_fmax_global_f64,1561 .atomic_fmin_fmax_global_f64,
1384 .ci_insts,1562 .ci_insts,
1563 .cube_insts,
1564 .cvt_pknorm_vop2_insts,
1385 .default_component_zero,1565 .default_component_zero,
1386 .ds_src2_insts,1566 .ds_src2_insts,
1387 .extended_image_insts,1567 .extended_image_insts,
1388 .flat_address_space,
1389 .fp64,1568 .fp64,
1390 .gds,1569 .gds,
1391 .gfx7_gfx8_gfx9_insts,1570 .gfx7_gfx8_gfx9_insts,
1392 .gws,1571 .gws,
1393 .image_insts,1572 .image_insts,
1573 .lerp_inst,
1394 .mad_mac_f32_insts,1574 .mad_mac_f32_insts,
1395 .mimg_r128,1575 .mimg_r128,
1396 .movrel,1576 .movrel,
1577 .qsad_insts,
1397 .s_memtime_inst,1578 .s_memtime_inst,
1579 .sad_insts,
1398 .trig_reduced_range,1580 .trig_reduced_range,
1399 .unaligned_buffer_access,1581 .unaligned_buffer_access,
1400 .vmem_write_vgpr_in_order,1582 .vmem_write_vgpr_in_order,
...@@ -1406,6 +1588,11 @@ pub const all_features = blk: {...@@ -1406,6 +1588,11 @@ pub const all_features = blk: {
1406 .description = "Has s_setprio_inc_wg instruction.",1588 .description = "Has s_setprio_inc_wg instruction.",
1407 .dependencies = featureSet(&[_]Feature{}),1589 .dependencies = featureSet(&[_]Feature{}),
1408 };1590 };
1591 result[@intFromEnum(Feature.setreg_vgpr_msb_fixup)] = .{
1592 .llvm_name = "setreg-vgpr-msb-fixup",
1593 .description = "S_SETREG to MODE clobbers VGPR MSB bits, requires fixup",
1594 .dependencies = featureSet(&[_]Feature{}),
1595 };
1409 result[@intFromEnum(Feature.sgpr_init_bug)] = .{1596 result[@intFromEnum(Feature.sgpr_init_bug)] = .{
1410 .llvm_name = "sgpr-init-bug",1597 .llvm_name = "sgpr-init-bug",
1411 .description = "VI SGPR initialization bug requiring a fixed SGPR allocation size",1598 .description = "VI SGPR initialization bug requiring a fixed SGPR allocation size",
...@@ -1438,6 +1625,8 @@ pub const all_features = blk: {...@@ -1438,6 +1625,8 @@ pub const all_features = blk: {
1438 .addressablelocalmemorysize32768,1625 .addressablelocalmemorysize32768,
1439 .atomic_fmin_fmax_global_f32,1626 .atomic_fmin_fmax_global_f32,
1440 .atomic_fmin_fmax_global_f64,1627 .atomic_fmin_fmax_global_f64,
1628 .cube_insts,
1629 .cvt_pknorm_vop2_insts,
1441 .default_component_zero,1630 .default_component_zero,
1442 .ds_src2_insts,1631 .ds_src2_insts,
1443 .extended_image_insts,1632 .extended_image_insts,
...@@ -1446,10 +1635,12 @@ pub const all_features = blk: {...@@ -1446,10 +1635,12 @@ pub const all_features = blk: {
1446 .gws,1635 .gws,
1447 .image_insts,1636 .image_insts,
1448 .ldsbankcount32,1637 .ldsbankcount32,
1638 .lerp_inst,
1449 .mad_mac_f32_insts,1639 .mad_mac_f32_insts,
1450 .mimg_r128,1640 .mimg_r128,
1451 .movrel,1641 .movrel,
1452 .s_memtime_inst,1642 .s_memtime_inst,
1643 .sad_insts,
1453 .trig_reduced_range,1644 .trig_reduced_range,
1454 .vmem_write_vgpr_in_order,1645 .vmem_write_vgpr_in_order,
1455 .wavefrontsize64,1646 .wavefrontsize64,
...@@ -1465,6 +1656,16 @@ pub const all_features = blk: {...@@ -1465,6 +1656,16 @@ pub const all_features = blk: {
1465 .description = "Hardware supports SRAMECC",1656 .description = "Hardware supports SRAMECC",
1466 .dependencies = featureSet(&[_]Feature{}),1657 .dependencies = featureSet(&[_]Feature{}),
1467 };1658 };
1659 result[@intFromEnum(Feature.tanh_insts)] = .{
1660 .llvm_name = "tanh-insts",
1661 .description = "Has v_tanh_f32/f16 instructions",
1662 .dependencies = featureSet(&[_]Feature{}),
1663 };
1664 result[@intFromEnum(Feature.tensor_cvt_lut_insts)] = .{
1665 .llvm_name = "tensor-cvt-lut-insts",
1666 .description = "Has v_perm_pk16* instructions",
1667 .dependencies = featureSet(&[_]Feature{}),
1668 };
1468 result[@intFromEnum(Feature.tgsplit)] = .{1669 result[@intFromEnum(Feature.tgsplit)] = .{
1469 .llvm_name = "tgsplit",1670 .llvm_name = "tgsplit",
1470 .description = "Enable threadgroup split execution",1671 .description = "Enable threadgroup split execution",
...@@ -1540,11 +1741,21 @@ pub const all_features = blk: {...@@ -1540,11 +1741,21 @@ pub const all_features = blk: {
1540 .description = "TODO: describe me",1741 .description = "TODO: describe me",
1541 .dependencies = featureSet(&[_]Feature{}),1742 .dependencies = featureSet(&[_]Feature{}),
1542 };1743 };
1744 result[@intFromEnum(Feature.vgpr_align2)] = .{
1745 .llvm_name = "vgpr-align2",
1746 .description = "VGPR and AGPR tuple operands require even alignment",
1747 .dependencies = featureSet(&[_]Feature{}),
1748 };
1543 result[@intFromEnum(Feature.vgpr_index_mode)] = .{1749 result[@intFromEnum(Feature.vgpr_index_mode)] = .{
1544 .llvm_name = "vgpr-index-mode",1750 .llvm_name = "vgpr-index-mode",
1545 .description = "Has VGPR mode register indexing",1751 .description = "Has VGPR mode register indexing",
1546 .dependencies = featureSet(&[_]Feature{}),1752 .dependencies = featureSet(&[_]Feature{}),
1547 };1753 };
1754 result[@intFromEnum(Feature.vmem_pref_insts)] = .{
1755 .llvm_name = "vmem-pref-insts",
1756 .description = "Has flat_prefect_b8 and global_prefetch_b8 instructions",
1757 .dependencies = featureSet(&[_]Feature{}),
1758 };
1548 result[@intFromEnum(Feature.vmem_to_lds_load_insts)] = .{1759 result[@intFromEnum(Feature.vmem_to_lds_load_insts)] = .{
1549 .llvm_name = "vmem-to-lds-load-insts",1760 .llvm_name = "vmem-to-lds-load-insts",
1550 .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.",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.",
...@@ -1567,6 +1778,8 @@ pub const all_features = blk: {...@@ -1567,6 +1778,8 @@ pub const all_features = blk: {
1567 .@"16_bit_insts",1778 .@"16_bit_insts",
1568 .addressablelocalmemorysize65536,1779 .addressablelocalmemorysize65536,
1569 .ci_insts,1780 .ci_insts,
1781 .cube_insts,
1782 .cvt_pknorm_vop2_insts,
1570 .default_component_zero,1783 .default_component_zero,
1571 .dpp,1784 .dpp,
1572 .ds_src2_insts,1785 .ds_src2_insts,
...@@ -1582,11 +1795,14 @@ pub const all_features = blk: {...@@ -1582,11 +1795,14 @@ pub const all_features = blk: {
1582 .image_insts,1795 .image_insts,
1583 .int_clamp_insts,1796 .int_clamp_insts,
1584 .inv_2pi_inline_imm,1797 .inv_2pi_inline_imm,
1798 .lerp_inst,
1585 .mad_mac_f32_insts,1799 .mad_mac_f32_insts,
1586 .mimg_r128,1800 .mimg_r128,
1587 .movrel,1801 .movrel,
1802 .qsad_insts,
1588 .s_memrealtime,1803 .s_memrealtime,
1589 .s_memtime_inst,1804 .s_memtime_inst,
1805 .sad_insts,
1590 .scalar_stores,1806 .scalar_stores,
1591 .sdwa,1807 .sdwa,
1592 .sdwa_mav,1808 .sdwa_mav,
...@@ -1623,6 +1839,11 @@ pub const all_features = blk: {...@@ -1623,6 +1839,11 @@ pub const all_features = blk: {
1623 .description = "Has s_wait_xcnt instruction",1839 .description = "Has s_wait_xcnt instruction",
1624 .dependencies = featureSet(&[_]Feature{}),1840 .dependencies = featureSet(&[_]Feature{}),
1625 };1841 };
1842 result[@intFromEnum(Feature.waits_before_system_scope_stores)] = .{
1843 .llvm_name = "waits-before-system-scope-stores",
1844 .description = "Target requires waits for loads and atomics before system scope stores",
1845 .dependencies = featureSet(&[_]Feature{}),
1846 };
1626 result[@intFromEnum(Feature.wavefrontsize16)] = .{1847 result[@intFromEnum(Feature.wavefrontsize16)] = .{
1627 .llvm_name = "wavefrontsize16",1848 .llvm_name = "wavefrontsize16",
1628 .description = "The number of threads per wavefront",1849 .description = "The number of threads per wavefront",
...@@ -2044,6 +2265,8 @@ pub const cpu = struct {...@@ -2044,6 +2265,8 @@ pub const cpu = struct {
2044 .architected_flat_scratch,2265 .architected_flat_scratch,
2045 .atomic_fadd_no_rtn_insts,2266 .atomic_fadd_no_rtn_insts,
2046 .atomic_fadd_rtn_insts,2267 .atomic_fadd_rtn_insts,
2268 .back_off_barrier,
2269 .d16_write_vgpr32,
2047 .dl_insts,2270 .dl_insts,
2048 .dot10_insts,2271 .dot10_insts,
2049 .dot12_insts,2272 .dot12_insts,
...@@ -2077,6 +2300,8 @@ pub const cpu = struct {...@@ -2077,6 +2300,8 @@ pub const cpu = struct {
2077 .architected_flat_scratch,2300 .architected_flat_scratch,
2078 .atomic_fadd_no_rtn_insts,2301 .atomic_fadd_no_rtn_insts,
2079 .atomic_fadd_rtn_insts,2302 .atomic_fadd_rtn_insts,
2303 .back_off_barrier,
2304 .d16_write_vgpr32,
2080 .dl_insts,2305 .dl_insts,
2081 .dot10_insts,2306 .dot10_insts,
2082 .dot12_insts,2307 .dot12_insts,
...@@ -2108,6 +2333,8 @@ pub const cpu = struct {...@@ -2108,6 +2333,8 @@ pub const cpu = struct {
2108 .architected_flat_scratch,2333 .architected_flat_scratch,
2109 .atomic_fadd_no_rtn_insts,2334 .atomic_fadd_no_rtn_insts,
2110 .atomic_fadd_rtn_insts,2335 .atomic_fadd_rtn_insts,
2336 .back_off_barrier,
2337 .d16_write_vgpr32,
2111 .dl_insts,2338 .dl_insts,
2112 .dot10_insts,2339 .dot10_insts,
2113 .dot12_insts,2340 .dot12_insts,
...@@ -2140,6 +2367,8 @@ pub const cpu = struct {...@@ -2140,6 +2367,8 @@ pub const cpu = struct {
2140 .architected_flat_scratch,2367 .architected_flat_scratch,
2141 .atomic_fadd_no_rtn_insts,2368 .atomic_fadd_no_rtn_insts,
2142 .atomic_fadd_rtn_insts,2369 .atomic_fadd_rtn_insts,
2370 .back_off_barrier,
2371 .d16_write_vgpr32,
2143 .dl_insts,2372 .dl_insts,
2144 .dot10_insts,2373 .dot10_insts,
2145 .dot12_insts,2374 .dot12_insts,
...@@ -2171,6 +2400,8 @@ pub const cpu = struct {...@@ -2171,6 +2400,8 @@ pub const cpu = struct {
2171 .architected_flat_scratch,2400 .architected_flat_scratch,
2172 .atomic_fadd_no_rtn_insts,2401 .atomic_fadd_no_rtn_insts,
2173 .atomic_fadd_rtn_insts,2402 .atomic_fadd_rtn_insts,
2403 .back_off_barrier,
2404 .d16_write_vgpr32,
2174 .dl_insts,2405 .dl_insts,
2175 .dot10_insts,2406 .dot10_insts,
2176 .dot12_insts,2407 .dot12_insts,
...@@ -2188,6 +2419,7 @@ pub const cpu = struct {...@@ -2188,6 +2419,7 @@ pub const cpu = struct {
2188 .packed_tid,2419 .packed_tid,
2189 .partial_nsa_encoding,2420 .partial_nsa_encoding,
2190 .point_sample_accel,2421 .point_sample_accel,
2422 .real_true16,
2191 .required_export_priority,2423 .required_export_priority,
2192 .salu_float,2424 .salu_float,
2193 .shader_cycles_register,2425 .shader_cycles_register,
...@@ -2202,6 +2434,8 @@ pub const cpu = struct {...@@ -2202,6 +2434,8 @@ pub const cpu = struct {
2202 .architected_flat_scratch,2434 .architected_flat_scratch,
2203 .atomic_fadd_no_rtn_insts,2435 .atomic_fadd_no_rtn_insts,
2204 .atomic_fadd_rtn_insts,2436 .atomic_fadd_rtn_insts,
2437 .back_off_barrier,
2438 .d16_write_vgpr32,
2205 .dl_insts,2439 .dl_insts,
2206 .dot10_insts,2440 .dot10_insts,
2207 .dot12_insts,2441 .dot12_insts,
...@@ -2219,6 +2453,7 @@ pub const cpu = struct {...@@ -2219,6 +2453,7 @@ pub const cpu = struct {
2219 .packed_tid,2453 .packed_tid,
2220 .partial_nsa_encoding,2454 .partial_nsa_encoding,
2221 .point_sample_accel,2455 .point_sample_accel,
2456 .real_true16,
2222 .required_export_priority,2457 .required_export_priority,
2223 .salu_float,2458 .salu_float,
2224 .shader_cycles_register,2459 .shader_cycles_register,
...@@ -2232,6 +2467,8 @@ pub const cpu = struct {...@@ -2232,6 +2467,8 @@ pub const cpu = struct {
2232 .architected_flat_scratch,2467 .architected_flat_scratch,
2233 .atomic_fadd_no_rtn_insts,2468 .atomic_fadd_no_rtn_insts,
2234 .atomic_fadd_rtn_insts,2469 .atomic_fadd_rtn_insts,
2470 .back_off_barrier,
2471 .d16_write_vgpr32,
2235 .dl_insts,2472 .dl_insts,
2236 .dot10_insts,2473 .dot10_insts,
2237 .dot12_insts,2474 .dot12_insts,
...@@ -2249,6 +2486,7 @@ pub const cpu = struct {...@@ -2249,6 +2486,7 @@ pub const cpu = struct {
2249 .packed_tid,2486 .packed_tid,
2250 .partial_nsa_encoding,2487 .partial_nsa_encoding,
2251 .point_sample_accel,2488 .point_sample_accel,
2489 .real_true16,
2252 .required_export_priority,2490 .required_export_priority,
2253 .salu_float,2491 .salu_float,
2254 .shader_cycles_register,2492 .shader_cycles_register,
...@@ -2262,6 +2500,8 @@ pub const cpu = struct {...@@ -2262,6 +2500,8 @@ pub const cpu = struct {
2262 .architected_flat_scratch,2500 .architected_flat_scratch,
2263 .atomic_fadd_no_rtn_insts,2501 .atomic_fadd_no_rtn_insts,
2264 .atomic_fadd_rtn_insts,2502 .atomic_fadd_rtn_insts,
2503 .back_off_barrier,
2504 .d16_write_vgpr32,
2265 .dl_insts,2505 .dl_insts,
2266 .dot10_insts,2506 .dot10_insts,
2267 .dot12_insts,2507 .dot12_insts,
...@@ -2278,6 +2518,7 @@ pub const cpu = struct {...@@ -2278,6 +2518,7 @@ pub const cpu = struct {
2278 .nsa_encoding,2518 .nsa_encoding,
2279 .packed_tid,2519 .packed_tid,
2280 .partial_nsa_encoding,2520 .partial_nsa_encoding,
2521 .real_true16,
2281 .required_export_priority,2522 .required_export_priority,
2282 .salu_float,2523 .salu_float,
2283 .shader_cycles_register,2524 .shader_cycles_register,
...@@ -2291,6 +2532,8 @@ pub const cpu = struct {...@@ -2291,6 +2532,8 @@ pub const cpu = struct {
2291 .architected_flat_scratch,2532 .architected_flat_scratch,
2292 .atomic_fadd_no_rtn_insts,2533 .atomic_fadd_no_rtn_insts,
2293 .atomic_fadd_rtn_insts,2534 .atomic_fadd_rtn_insts,
2535 .back_off_barrier,
2536 .d16_write_vgpr32,
2294 .dl_insts,2537 .dl_insts,
2295 .dot10_insts,2538 .dot10_insts,
2296 .dot12_insts,2539 .dot12_insts,
...@@ -2309,6 +2552,7 @@ pub const cpu = struct {...@@ -2309,6 +2552,7 @@ pub const cpu = struct {
2309 .packed_tid,2552 .packed_tid,
2310 .partial_nsa_encoding,2553 .partial_nsa_encoding,
2311 .priv_enabled_trap2_nop_bug,2554 .priv_enabled_trap2_nop_bug,
2555 .real_true16,
2312 .required_export_priority,2556 .required_export_priority,
2313 .requires_cov6,2557 .requires_cov6,
2314 .shader_cycles_register,2558 .shader_cycles_register,
...@@ -2321,6 +2565,7 @@ pub const cpu = struct {...@@ -2321,6 +2565,7 @@ pub const cpu = struct {
2321 .name = "gfx1200",2565 .name = "gfx1200",
2322 .llvm_name = "gfx1200",2566 .llvm_name = "gfx1200",
2323 .features = featureSet(&[_]Feature{2567 .features = featureSet(&[_]Feature{
2568 .addressablelocalmemorysize65536,
2324 .allocate1_5xvgprs,2569 .allocate1_5xvgprs,
2325 .architected_flat_scratch,2570 .architected_flat_scratch,
2326 .architected_sgprs,2571 .architected_sgprs,
...@@ -2331,7 +2576,13 @@ pub const cpu = struct {...@@ -2331,7 +2576,13 @@ pub const cpu = struct {
2331 .atomic_fadd_rtn_insts,2576 .atomic_fadd_rtn_insts,
2332 .atomic_flat_pk_add_16_insts,2577 .atomic_flat_pk_add_16_insts,
2333 .atomic_global_pk_add_bf16_inst,2578 .atomic_global_pk_add_bf16_inst,
2579 .back_off_barrier,
2334 .bvh_dual_bvh_8_insts,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,
2335 .dl_insts,2586 .dl_insts,
2336 .dot10_insts,2587 .dot10_insts,
2337 .dot11_insts,2588 .dot11_insts,
...@@ -2346,22 +2597,27 @@ pub const cpu = struct {...@@ -2346,22 +2597,27 @@ pub const cpu = struct {
2346 .gfx12,2597 .gfx12,
2347 .image_insts,2598 .image_insts,
2348 .ldsbankcount32,2599 .ldsbankcount32,
2600 .lerp_inst,
2349 .memory_atomic_fadd_f32_denormal_support,2601 .memory_atomic_fadd_f32_denormal_support,
2350 .nsa_encoding,2602 .nsa_encoding,
2351 .packed_tid,2603 .packed_tid,
2352 .partial_nsa_encoding,2604 .partial_nsa_encoding,
2353 .pseudo_scalar_trans,2605 .pseudo_scalar_trans,
2606 .qsad_insts,
2354 .restricted_soffset,2607 .restricted_soffset,
2608 .sad_insts,
2355 .salu_float,2609 .salu_float,
2356 .scalar_dwordx3_loads,2610 .scalar_dwordx3_loads,
2357 .shader_cycles_hi_lo_registers,2611 .shader_cycles_hi_lo_registers,
2358 .vcmpx_permlane_hazard,2612 .vcmpx_permlane_hazard,
2613 .waits_before_system_scope_stores,
2359 }),2614 }),
2360 };2615 };
2361 pub const gfx1201: CpuModel = .{2616 pub const gfx1201: CpuModel = .{
2362 .name = "gfx1201",2617 .name = "gfx1201",
2363 .llvm_name = "gfx1201",2618 .llvm_name = "gfx1201",
2364 .features = featureSet(&[_]Feature{2619 .features = featureSet(&[_]Feature{
2620 .addressablelocalmemorysize65536,
2365 .allocate1_5xvgprs,2621 .allocate1_5xvgprs,
2366 .architected_flat_scratch,2622 .architected_flat_scratch,
2367 .architected_sgprs,2623 .architected_sgprs,
...@@ -2372,7 +2628,13 @@ pub const cpu = struct {...@@ -2372,7 +2628,13 @@ pub const cpu = struct {
2372 .atomic_fadd_rtn_insts,2628 .atomic_fadd_rtn_insts,
2373 .atomic_flat_pk_add_16_insts,2629 .atomic_flat_pk_add_16_insts,
2374 .atomic_global_pk_add_bf16_inst,2630 .atomic_global_pk_add_bf16_inst,
2631 .back_off_barrier,
2375 .bvh_dual_bvh_8_insts,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,
2376 .dl_insts,2638 .dl_insts,
2377 .dot10_insts,2639 .dot10_insts,
2378 .dot11_insts,2640 .dot11_insts,
...@@ -2387,23 +2649,32 @@ pub const cpu = struct {...@@ -2387,23 +2649,32 @@ pub const cpu = struct {
2387 .gfx12,2649 .gfx12,
2388 .image_insts,2650 .image_insts,
2389 .ldsbankcount32,2651 .ldsbankcount32,
2652 .lerp_inst,
2390 .memory_atomic_fadd_f32_denormal_support,2653 .memory_atomic_fadd_f32_denormal_support,
2391 .nsa_encoding,2654 .nsa_encoding,
2392 .packed_tid,2655 .packed_tid,
2393 .partial_nsa_encoding,2656 .partial_nsa_encoding,
2394 .pseudo_scalar_trans,2657 .pseudo_scalar_trans,
2658 .qsad_insts,
2395 .restricted_soffset,2659 .restricted_soffset,
2660 .sad_insts,
2396 .salu_float,2661 .salu_float,
2397 .scalar_dwordx3_loads,2662 .scalar_dwordx3_loads,
2398 .shader_cycles_hi_lo_registers,2663 .shader_cycles_hi_lo_registers,
2399 .vcmpx_permlane_hazard,2664 .vcmpx_permlane_hazard,
2665 .waits_before_system_scope_stores,
2400 }),2666 }),
2401 };2667 };
2402 pub const gfx1250: CpuModel = .{2668 pub const gfx1250: CpuModel = .{
2403 .name = "gfx1250",2669 .name = "gfx1250",
2404 .llvm_name = "gfx1250",2670 .llvm_name = "gfx1250",
2405 .features = featureSet(&[_]Feature{2671 .features = featureSet(&[_]Feature{
2672 .@"1024_addressable_vgprs",
2673 .@"45_bit_num_records_buffer_resource",
2406 .@"64_bit_literals",2674 .@"64_bit_literals",
2675 .add_min_max_insts,
2676 .add_sub_u64_insts,
2677 .addressablelocalmemorysize327680,
2407 .architected_flat_scratch,2678 .architected_flat_scratch,
2408 .architected_sgprs,2679 .architected_sgprs,
2409 .ashr_pk_insts,2680 .ashr_pk_insts,
...@@ -2417,49 +2688,164 @@ pub const cpu = struct {...@@ -2417,49 +2688,164 @@ pub const cpu = struct {
2417 .atomic_fmin_fmax_global_f64,2688 .atomic_fmin_fmax_global_f64,
2418 .atomic_global_pk_add_bf16_inst,2689 .atomic_global_pk_add_bf16_inst,
2419 .bf16_cvt_insts,2690 .bf16_cvt_insts,
2691 .bf16_pk_insts,
2420 .bf16_trans_insts,2692 .bf16_trans_insts,
2421 .bitop3_insts,2693 .bitop3_insts,
2694 .clusters,
2695 .cube_insts,
2422 .cumode,2696 .cumode,
2697 .cvt_norm_insts,
2423 .cvt_pk_f16_f32_inst,2698 .cvt_pk_f16_f32_inst,
2699 .cvt_pknorm_vop2_insts,
2700 .cvt_pknorm_vop3_insts,
2701 .d16_write_vgpr32,
2424 .dl_insts,2702 .dl_insts,
2425 .dot7_insts,2703 .dot7_insts,
2426 .dot8_insts,2704 .dot8_insts,
2427 .dpp_src1_sgpr,2705 .dpp_src1_sgpr,
2706 .emulated_system_scope_atomics,
2428 .flat_atomic_fadd_f32_inst,2707 .flat_atomic_fadd_f32_inst,
2429 .flat_buffer_global_fadd_f64_inst,2708 .flat_buffer_global_fadd_f64_inst,
2709 .flat_gvs_mode,
2710 .fma_mix_bf16_insts,
2430 .fmacf64_inst,2711 .fmacf64_inst,
2431 .fp8_conversion_insts,2712 .fp8_conversion_insts,
2432 .fp8e5m3_insts,2713 .fp8e5m3_insts,
2433 .gfx12,2714 .gfx12,
2434 .gfx1250_insts,2715 .gfx1250_insts,
2716 .globally_addressable_scratch,
2435 .kernarg_preload,2717 .kernarg_preload,
2436 .lds_barrier_arrive_atomic,2718 .lds_barrier_arrive_atomic,
2437 .ldsbankcount32,2719 .ldsbankcount32,
2720 .lerp_inst,
2438 .lshl_add_u64_inst,2721 .lshl_add_u64_inst,
2722 .mad_u32_inst,
2439 .max_hard_clause_length_63,2723 .max_hard_clause_length_63,
2724 .mcast_load_insts,
2440 .memory_atomic_fadd_f32_denormal_support,2725 .memory_atomic_fadd_f32_denormal_support,
2726 .min3_max3_pkf16,
2441 .minimum3_maximum3_pkf16,2727 .minimum3_maximum3_pkf16,
2442 .packed_fp32_ops,2728 .packed_fp32_ops,
2443 .packed_tid,2729 .packed_tid,
2444 .permlane16_swap,2730 .permlane16_swap,
2731 .pk_add_min_max_insts,
2445 .prng_inst,2732 .prng_inst,
2446 .pseudo_scalar_trans,2733 .pseudo_scalar_trans,
2734 .qsad_insts,
2447 .restricted_soffset,2735 .restricted_soffset,
2736 .s_wakeup_barrier_inst,
2737 .sad_insts,
2448 .salu_float,2738 .salu_float,
2449 .scalar_dwordx3_loads,2739 .scalar_dwordx3_loads,
2450 .setprio_inc_wg_inst,2740 .setprio_inc_wg_inst,
2741 .setreg_vgpr_msb_fixup,
2451 .shader_cycles_hi_lo_registers,2742 .shader_cycles_hi_lo_registers,
2452 .sramecc_support,2743 .sramecc_support,
2744 .tanh_insts,
2745 .tensor_cvt_lut_insts,
2453 .transpose_load_f4f6_insts,2746 .transpose_load_f4f6_insts,
2454 .vcmpx_permlane_hazard,2747 .vcmpx_permlane_hazard,
2748 .vgpr_align2,
2749 .vmem_pref_insts,
2455 .wait_xcnt,2750 .wait_xcnt,
2456 .wavefrontsize32,2751 .wavefrontsize32,
2752 .xnack,
2753 .xnack_support,
2754 }),
2755 };
2756 pub const gfx1251: CpuModel = .{
2757 .name = "gfx1251",
2758 .llvm_name = "gfx1251",
2759 .features = featureSet(&[_]Feature{
2760 .@"1024_addressable_vgprs",
2761 .@"45_bit_num_records_buffer_resource",
2762 .@"64_bit_literals",
2763 .add_min_max_insts,
2764 .add_sub_u64_insts,
2765 .addressablelocalmemorysize327680,
2766 .architected_flat_scratch,
2767 .architected_sgprs,
2768 .ashr_pk_insts,
2769 .atomic_buffer_global_pk_add_f16_insts,
2770 .atomic_buffer_pk_add_bf16_inst,
2771 .atomic_ds_pk_add_16_insts,
2772 .atomic_fadd_no_rtn_insts,
2773 .atomic_fadd_rtn_insts,
2774 .atomic_flat_pk_add_16_insts,
2775 .atomic_fmin_fmax_flat_f64,
2776 .atomic_fmin_fmax_global_f64,
2777 .atomic_global_pk_add_bf16_inst,
2778 .bf16_cvt_insts,
2779 .bf16_pk_insts,
2780 .bf16_trans_insts,
2781 .bitop3_insts,
2782 .clusters,
2783 .cube_insts,
2784 .cumode,
2785 .cvt_norm_insts,
2786 .cvt_pk_f16_f32_inst,
2787 .cvt_pknorm_vop2_insts,
2788 .cvt_pknorm_vop3_insts,
2789 .d16_write_vgpr32,
2790 .dl_insts,
2791 .dot7_insts,
2792 .dot8_insts,
2793 .dpp_64bit,
2794 .dpp_src1_sgpr,
2795 .emulated_system_scope_atomics,
2796 .flat_atomic_fadd_f32_inst,
2797 .flat_buffer_global_fadd_f64_inst,
2798 .flat_gvs_mode,
2799 .fma_mix_bf16_insts,
2800 .fmacf64_inst,
2801 .fp8_conversion_insts,
2802 .fp8e5m3_insts,
2803 .gfx12,
2804 .gfx1250_insts,
2805 .globally_addressable_scratch,
2806 .kernarg_preload,
2807 .lds_barrier_arrive_atomic,
2808 .ldsbankcount32,
2809 .lerp_inst,
2810 .lshl_add_u64_inst,
2811 .mad_u32_inst,
2812 .max_hard_clause_length_63,
2813 .mcast_load_insts,
2814 .memory_atomic_fadd_f32_denormal_support,
2815 .min3_max3_pkf16,
2816 .minimum3_maximum3_pkf16,
2817 .packed_fp32_ops,
2818 .packed_tid,
2819 .permlane16_swap,
2820 .pk_add_min_max_insts,
2821 .prng_inst,
2822 .pseudo_scalar_trans,
2823 .qsad_insts,
2824 .restricted_soffset,
2825 .s_wakeup_barrier_inst,
2826 .sad_insts,
2827 .salu_float,
2828 .scalar_dwordx3_loads,
2829 .setprio_inc_wg_inst,
2830 .shader_cycles_hi_lo_registers,
2831 .sramecc_support,
2832 .tanh_insts,
2833 .tensor_cvt_lut_insts,
2834 .transpose_load_f4f6_insts,
2835 .vcmpx_permlane_hazard,
2836 .vgpr_align2,
2837 .vmem_pref_insts,
2838 .wait_xcnt,
2839 .wavefrontsize32,
2840 .xnack,
2841 .xnack_support,
2457 }),2842 }),
2458 };2843 };
2459 pub const gfx12_generic: CpuModel = .{2844 pub const gfx12_generic: CpuModel = .{
2460 .name = "gfx12_generic",2845 .name = "gfx12_generic",
2461 .llvm_name = "gfx12-generic",2846 .llvm_name = "gfx12-generic",
2462 .features = featureSet(&[_]Feature{2847 .features = featureSet(&[_]Feature{
2848 .addressablelocalmemorysize65536,
2463 .allocate1_5xvgprs,2849 .allocate1_5xvgprs,
2464 .architected_flat_scratch,2850 .architected_flat_scratch,
2465 .architected_sgprs,2851 .architected_sgprs,
...@@ -2470,7 +2856,13 @@ pub const cpu = struct {...@@ -2470,7 +2856,13 @@ pub const cpu = struct {
2470 .atomic_fadd_rtn_insts,2856 .atomic_fadd_rtn_insts,
2471 .atomic_flat_pk_add_16_insts,2857 .atomic_flat_pk_add_16_insts,
2472 .atomic_global_pk_add_bf16_inst,2858 .atomic_global_pk_add_bf16_inst,
2859 .back_off_barrier,
2473 .bvh_dual_bvh_8_insts,2860 .bvh_dual_bvh_8_insts,
2861 .cube_insts,
2862 .cvt_norm_insts,
2863 .cvt_pknorm_vop2_insts,
2864 .cvt_pknorm_vop3_insts,
2865 .d16_write_vgpr32,
2474 .dl_insts,2866 .dl_insts,
2475 .dot10_insts,2867 .dot10_insts,
2476 .dot11_insts,2868 .dot11_insts,
...@@ -2485,17 +2877,21 @@ pub const cpu = struct {...@@ -2485,17 +2877,21 @@ pub const cpu = struct {
2485 .gfx12,2877 .gfx12,
2486 .image_insts,2878 .image_insts,
2487 .ldsbankcount32,2879 .ldsbankcount32,
2880 .lerp_inst,
2488 .memory_atomic_fadd_f32_denormal_support,2881 .memory_atomic_fadd_f32_denormal_support,
2489 .nsa_encoding,2882 .nsa_encoding,
2490 .packed_tid,2883 .packed_tid,
2491 .partial_nsa_encoding,2884 .partial_nsa_encoding,
2492 .pseudo_scalar_trans,2885 .pseudo_scalar_trans,
2886 .qsad_insts,
2493 .requires_cov6,2887 .requires_cov6,
2494 .restricted_soffset,2888 .restricted_soffset,
2889 .sad_insts,
2495 .salu_float,2890 .salu_float,
2496 .scalar_dwordx3_loads,2891 .scalar_dwordx3_loads,
2497 .shader_cycles_hi_lo_registers,2892 .shader_cycles_hi_lo_registers,
2498 .vcmpx_permlane_hazard,2893 .vcmpx_permlane_hazard,
2894 .waits_before_system_scope_stores,
2499 }),2895 }),
2500 };2896 };
2501 pub const gfx600: CpuModel = .{2897 pub const gfx600: CpuModel = .{
...@@ -2779,6 +3175,7 @@ pub const cpu = struct {...@@ -2779,6 +3175,7 @@ pub const cpu = struct {
2779 .packed_tid,3175 .packed_tid,
2780 .pk_fmac_f16_inst,3176 .pk_fmac_f16_inst,
2781 .sramecc_support,3177 .sramecc_support,
3178 .vgpr_align2,
2782 }),3179 }),
2783 };3180 };
2784 pub const gfx90c: CpuModel = .{3181 pub const gfx90c: CpuModel = .{
...@@ -2842,6 +3239,7 @@ pub const cpu = struct {...@@ -2842,6 +3239,7 @@ pub const cpu = struct {
2842 .packed_tid,3239 .packed_tid,
2843 .pk_fmac_f16_inst,3240 .pk_fmac_f16_inst,
2844 .sramecc_support,3241 .sramecc_support,
3242 .vgpr_align2,
2845 .xf32_insts,3243 .xf32_insts,
2846 }),3244 }),
2847 };3245 };
...@@ -2897,6 +3295,7 @@ pub const cpu = struct {...@@ -2897,6 +3295,7 @@ pub const cpu = struct {
2897 .pk_fmac_f16_inst,3295 .pk_fmac_f16_inst,
2898 .prng_inst,3296 .prng_inst,
2899 .sramecc_support,3297 .sramecc_support,
3298 .vgpr_align2,
2900 }),3299 }),
2901 };3300 };
2902 pub const gfx9_4_generic: CpuModel = .{3301 pub const gfx9_4_generic: CpuModel = .{
...@@ -2943,6 +3342,7 @@ pub const cpu = struct {...@@ -2943,6 +3342,7 @@ pub const cpu = struct {
2943 .pk_fmac_f16_inst,3342 .pk_fmac_f16_inst,
2944 .requires_cov6,3343 .requires_cov6,
2945 .sramecc_support,3344 .sramecc_support,
3345 .vgpr_align2,
2946 }),3346 }),
2947 };3347 };
2948 pub const gfx9_generic: CpuModel = .{3348 pub const gfx9_generic: CpuModel = .{
lib/std/Target/arm.zig+40-6
...@@ -88,6 +88,7 @@ pub const Feature = enum {...@@ -88,6 +88,7 @@ pub const Feature = enum {
88 has_v9_4a,88 has_v9_4a,
89 has_v9_5a,89 has_v9_5a,
90 has_v9_6a,90 has_v9_6a,
91 has_v9_7a,
91 has_v9a,92 has_v9a,
92 hwdiv,93 hwdiv,
93 hwdiv_arm,94 hwdiv_arm,
...@@ -107,7 +108,6 @@ pub const Feature = enum {...@@ -107,7 +108,6 @@ pub const Feature = enum {
107 mve2beat,108 mve2beat,
108 mve4beat,109 mve4beat,
109 mve_fp,110 mve_fp,
110 nacl_trap,
111 neon,111 neon,
112 neon_fpmovs,112 neon_fpmovs,
113 neonfp,113 neonfp,
...@@ -187,6 +187,7 @@ pub const Feature = enum {...@@ -187,6 +187,7 @@ pub const Feature = enum {
187 v9_4a,187 v9_4a,
188 v9_5a,188 v9_5a,
189 v9_6a,189 v9_6a,
190 v9_7a,
190 v9a,191 v9a,
191 vfp2,192 vfp2,
192 vfp2sp,193 vfp2sp,
...@@ -748,6 +749,13 @@ pub const all_features = blk: {...@@ -748,6 +749,13 @@ pub const all_features = blk: {
748 .has_v9_5a,749 .has_v9_5a,
749 }),750 }),
750 };751 };
752 result[@intFromEnum(Feature.has_v9_7a)] = .{
753 .llvm_name = "v9.7a",
754 .description = "Support ARM v9.7a instructions",
755 .dependencies = featureSet(&[_]Feature{
756 .has_v9_6a,
757 }),
758 };
751 result[@intFromEnum(Feature.has_v9a)] = .{759 result[@intFromEnum(Feature.has_v9a)] = .{
752 .llvm_name = "v9a",760 .llvm_name = "v9a",
753 .description = "Support ARM v9a instructions",761 .description = "Support ARM v9a instructions",
...@@ -859,11 +867,6 @@ pub const all_features = blk: {...@@ -859,11 +867,6 @@ pub const all_features = blk: {
859 .mve,867 .mve,
860 }),868 }),
861 };869 };
862 result[@intFromEnum(Feature.nacl_trap)] = .{
863 .llvm_name = "nacl-trap",
864 .description = "NaCl trap",
865 .dependencies = featureSet(&[_]Feature{}),
866 };
867 result[@intFromEnum(Feature.neon)] = .{870 result[@intFromEnum(Feature.neon)] = .{
868 .llvm_name = "neon",871 .llvm_name = "neon",
869 .description = "Enable NEON instructions",872 .description = "Enable NEON instructions",
...@@ -1579,6 +1582,22 @@ pub const all_features = blk: {...@@ -1579,6 +1582,22 @@ pub const all_features = blk: {
1579 .virtualization,1582 .virtualization,
1580 }),1583 }),
1581 };1584 };
1585 result[@intFromEnum(Feature.v9_7a)] = .{
1586 .llvm_name = "armv9.7-a",
1587 .description = "ARMv97a architecture",
1588 .dependencies = featureSet(&[_]Feature{
1589 .aclass,
1590 .crc,
1591 .db,
1592 .dsp,
1593 .fp_armv8,
1594 .has_v9_7a,
1595 .mp,
1596 .ras,
1597 .trustzone,
1598 .virtualization,
1599 }),
1600 };
1582 result[@intFromEnum(Feature.v9a)] = .{1601 result[@intFromEnum(Feature.v9a)] = .{
1583 .llvm_name = "armv9-a",1602 .llvm_name = "armv9-a",
1584 .description = "ARMv9a architecture",1603 .description = "ARMv9a architecture",
...@@ -2658,6 +2677,21 @@ pub const cpu = struct {...@@ -2658,6 +2677,21 @@ pub const cpu = struct {
2658 .v8m_main,2677 .v8m_main,
2659 }),2678 }),
2660 };2679 };
2680 pub const star_mc3: CpuModel = .{
2681 .name = "star_mc3",
2682 .llvm_name = "star-mc3",
2683 .features = featureSet(&[_]Feature{
2684 .fp_armv8d16,
2685 .loop_align,
2686 .mve1beat,
2687 .mve_fp,
2688 .no_branch_predictor,
2689 .pacbti,
2690 .slowfpvmlx,
2691 .use_misched,
2692 .v8_1m_main,
2693 }),
2694 };
2661 pub const strongarm: CpuModel = .{2695 pub const strongarm: CpuModel = .{
2662 .name = "strongarm",2696 .name = "strongarm",
2663 .llvm_name = "strongarm",2697 .llvm_name = "strongarm",
lib/std/Target/bpf.zig+6
...@@ -5,6 +5,7 @@ const CpuFeature = std.Target.Cpu.Feature;...@@ -5,6 +5,7 @@ const CpuFeature = std.Target.Cpu.Feature;
5const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
66
7pub const Feature = enum {7pub const Feature = enum {
8 allows_misaligned_mem_access,
8 alu32,9 alu32,
9 dummy,10 dummy,
10 dwarfris,11 dwarfris,
...@@ -19,6 +20,11 @@ pub const all_features = blk: {...@@ -19,6 +20,11 @@ pub const all_features = blk: {
19 const len = @typeInfo(Feature).@"enum".fields.len;20 const len = @typeInfo(Feature).@"enum".fields.len;
20 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);21 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
21 var result: [len]CpuFeature = undefined;22 var result: [len]CpuFeature = undefined;
23 result[@intFromEnum(Feature.allows_misaligned_mem_access)] = .{
24 .llvm_name = "allows-misaligned-mem-access",
25 .description = "Allows misaligned memory access",
26 .dependencies = featureSet(&[_]Feature{}),
27 };
22 result[@intFromEnum(Feature.alu32)] = .{28 result[@intFromEnum(Feature.alu32)] = .{
23 .llvm_name = "alu32",29 .llvm_name = "alu32",
24 .description = "Enable ALU32 instructions",30 .description = "Enable ALU32 instructions",
lib/std/Target/hexagon.zig+41-6
...@@ -25,6 +25,7 @@ pub const Feature = enum {...@@ -25,6 +25,7 @@ pub const Feature = enum {
25 hvxv73,25 hvxv73,
26 hvxv75,26 hvxv75,
27 hvxv79,27 hvxv79,
28 hvxv81,
28 long_calls,29 long_calls,
29 mem_noshuf,30 mem_noshuf,
30 memops,31 memops,
...@@ -36,7 +37,6 @@ pub const Feature = enum {...@@ -36,7 +37,6 @@ pub const Feature = enum {
36 reserved_r19,37 reserved_r19,
37 small_data,38 small_data,
38 tinycore,39 tinycore,
39 unsafe_fp,
40 v5,40 v5,
41 v55,41 v55,
42 v60,42 v60,
...@@ -50,6 +50,7 @@ pub const Feature = enum {...@@ -50,6 +50,7 @@ pub const Feature = enum {
50 v73,50 v73,
51 v75,51 v75,
52 v79,52 v79,
53 v81,
53 zreg,54 zreg,
54};55};
5556
...@@ -189,6 +190,13 @@ pub const all_features = blk: {...@@ -189,6 +190,13 @@ pub const all_features = blk: {
189 .hvxv75,190 .hvxv75,
190 }),191 }),
191 };192 };
193 result[@intFromEnum(Feature.hvxv81)] = .{
194 .llvm_name = "hvxv81",
195 .description = "Hexagon HVX instructions",
196 .dependencies = featureSet(&[_]Feature{
197 .hvxv79,
198 }),
199 };
192 result[@intFromEnum(Feature.long_calls)] = .{200 result[@intFromEnum(Feature.long_calls)] = .{
193 .llvm_name = "long-calls",201 .llvm_name = "long-calls",
194 .description = "Use constant-extended calls",202 .description = "Use constant-extended calls",
...@@ -248,11 +256,6 @@ pub const all_features = blk: {...@@ -248,11 +256,6 @@ pub const all_features = blk: {
248 .description = "Hexagon Tiny Core",256 .description = "Hexagon Tiny Core",
249 .dependencies = featureSet(&[_]Feature{}),257 .dependencies = featureSet(&[_]Feature{}),
250 };258 };
251 result[@intFromEnum(Feature.unsafe_fp)] = .{
252 .llvm_name = "unsafe-fp",
253 .description = "Use unsafe FP math",
254 .dependencies = featureSet(&[_]Feature{}),
255 };
256 result[@intFromEnum(Feature.v5)] = .{259 result[@intFromEnum(Feature.v5)] = .{
257 .llvm_name = "v5",260 .llvm_name = "v5",
258 .description = "Enable Hexagon V5 architecture",261 .description = "Enable Hexagon V5 architecture",
...@@ -318,6 +321,11 @@ pub const all_features = blk: {...@@ -318,6 +321,11 @@ pub const all_features = blk: {
318 .description = "Enable Hexagon V79 architecture",321 .description = "Enable Hexagon V79 architecture",
319 .dependencies = featureSet(&[_]Feature{}),322 .dependencies = featureSet(&[_]Feature{}),
320 };323 };
324 result[@intFromEnum(Feature.v81)] = .{
325 .llvm_name = "v81",
326 .description = "Enable Hexagon V81 architecture",
327 .dependencies = featureSet(&[_]Feature{}),
328 };
321 result[@intFromEnum(Feature.zreg)] = .{329 result[@intFromEnum(Feature.zreg)] = .{
322 .llvm_name = "zreg",330 .llvm_name = "zreg",
323 .description = "Hexagon ZReg extension instructions",331 .description = "Hexagon ZReg extension instructions",
...@@ -662,4 +670,31 @@ pub const cpu = struct {...@@ -662,4 +670,31 @@ pub const cpu = struct {
662 .v79,670 .v79,
663 }),671 }),
664 };672 };
673 pub const hexagonv81: CpuModel = .{
674 .name = "hexagonv81",
675 .llvm_name = "hexagonv81",
676 .features = featureSet(&[_]Feature{
677 .compound,
678 .duplex,
679 .mem_noshuf,
680 .memops,
681 .nvj,
682 .nvs,
683 .small_data,
684 .v5,
685 .v55,
686 .v60,
687 .v62,
688 .v65,
689 .v66,
690 .v67,
691 .v68,
692 .v69,
693 .v71,
694 .v73,
695 .v75,
696 .v79,
697 .v81,
698 }),
699 };
665};700};
lib/std/Target/loongarch.zig+18
...@@ -175,6 +175,24 @@ pub const cpu = struct {...@@ -175,6 +175,24 @@ pub const cpu = struct {
175 .ual,175 .ual,
176 }),176 }),
177 };177 };
178 pub const la32rv1_0: CpuModel = .{
179 .name = "la32rv1_0",
180 .llvm_name = null,
181 .features = featureSet(&[_]Feature{
182 .@"32bit",
183 .ual,
184 }),
185 };
186 pub const la32v1_0: CpuModel = .{
187 .name = "la32v1_0",
188 .llvm_name = null,
189 .features = featureSet(&[_]Feature{
190 .@"32bit",
191 .@"32s",
192 .d,
193 .ual,
194 }),
195 };
178 pub const la464: CpuModel = .{196 pub const la464: CpuModel = .{
179 .name = "la464",197 .name = "la464",
180 .llvm_name = "la464",198 .llvm_name = "la464",
lib/std/Target/mips.zig+6
...@@ -56,6 +56,7 @@ pub const Feature = enum {...@@ -56,6 +56,7 @@ pub const Feature = enum {
56 soft_float,56 soft_float,
57 strict_align,57 strict_align,
58 sym32,58 sym32,
59 use_compact_branches,
59 use_indirect_jump_hazard,60 use_indirect_jump_hazard,
60 use_tcc_in_div,61 use_tcc_in_div,
61 vfpu,62 vfpu,
...@@ -391,6 +392,11 @@ pub const all_features = blk: {...@@ -391,6 +392,11 @@ pub const all_features = blk: {
391 .description = "Symbols are 32 bit on Mips64",392 .description = "Symbols are 32 bit on Mips64",
392 .dependencies = featureSet(&[_]Feature{}),393 .dependencies = featureSet(&[_]Feature{}),
393 };394 };
395 result[@intFromEnum(Feature.use_compact_branches)] = .{
396 .llvm_name = "use-compact-branches",
397 .description = "Use compact branch instructions for MIPS32R6/MIPS64R6",
398 .dependencies = featureSet(&[_]Feature{}),
399 };
394 result[@intFromEnum(Feature.use_indirect_jump_hazard)] = .{400 result[@intFromEnum(Feature.use_indirect_jump_hazard)] = .{
395 .llvm_name = "use-indirect-jump-hazard",401 .llvm_name = "use-indirect-jump-hazard",
396 .description = "Use indirect jump guards to prevent certain speculation based attacks",402 .description = "Use indirect jump guards to prevent certain speculation based attacks",
lib/std/Target/nvptx.zig+58-35
...@@ -35,6 +35,7 @@ pub const Feature = enum {...@@ -35,6 +35,7 @@ pub const Feature = enum {
35 ptx86,35 ptx86,
36 ptx87,36 ptx87,
37 ptx88,37 ptx88,
38 ptx90,
38 sm_100,39 sm_100,
39 sm_100a,40 sm_100a,
40 sm_100f,41 sm_100f,
...@@ -44,6 +45,9 @@ pub const Feature = enum {...@@ -44,6 +45,9 @@ pub const Feature = enum {
44 sm_103,45 sm_103,
45 sm_103a,46 sm_103a,
46 sm_103f,47 sm_103f,
48 sm_110,
49 sm_110a,
50 sm_110f,
47 sm_120,51 sm_120,
48 sm_120a,52 sm_120a,
49 sm_120f,53 sm_120f,
...@@ -68,6 +72,7 @@ pub const Feature = enum {...@@ -68,6 +72,7 @@ pub const Feature = enum {
68 sm_80,72 sm_80,
69 sm_86,73 sm_86,
70 sm_87,74 sm_87,
75 sm_88,
71 sm_89,76 sm_89,
72 sm_90,77 sm_90,
73 sm_90a,78 sm_90a,
...@@ -232,6 +237,11 @@ pub const all_features = blk: {...@@ -232,6 +237,11 @@ pub const all_features = blk: {
232 .description = "Use PTX version 88",237 .description = "Use PTX version 88",
233 .dependencies = featureSet(&[_]Feature{}),238 .dependencies = featureSet(&[_]Feature{}),
234 };239 };
240 result[@intFromEnum(Feature.ptx90)] = .{
241 .llvm_name = "ptx90",
242 .description = "Use PTX version 90",
243 .dependencies = featureSet(&[_]Feature{}),
244 };
235 result[@intFromEnum(Feature.sm_100)] = .{245 result[@intFromEnum(Feature.sm_100)] = .{
236 .llvm_name = "sm_100",246 .llvm_name = "sm_100",
237 .description = "Target SM 100",247 .description = "Target SM 100",
...@@ -277,6 +287,21 @@ pub const all_features = blk: {...@@ -277,6 +287,21 @@ pub const all_features = blk: {
277 .description = "Target SM 103f",287 .description = "Target SM 103f",
278 .dependencies = featureSet(&[_]Feature{}),288 .dependencies = featureSet(&[_]Feature{}),
279 };289 };
290 result[@intFromEnum(Feature.sm_110)] = .{
291 .llvm_name = "sm_110",
292 .description = "Target SM 110",
293 .dependencies = featureSet(&[_]Feature{}),
294 };
295 result[@intFromEnum(Feature.sm_110a)] = .{
296 .llvm_name = "sm_110a",
297 .description = "Target SM 110a",
298 .dependencies = featureSet(&[_]Feature{}),
299 };
300 result[@intFromEnum(Feature.sm_110f)] = .{
301 .llvm_name = "sm_110f",
302 .description = "Target SM 110f",
303 .dependencies = featureSet(&[_]Feature{}),
304 };
280 result[@intFromEnum(Feature.sm_120)] = .{305 result[@intFromEnum(Feature.sm_120)] = .{
281 .llvm_name = "sm_120",306 .llvm_name = "sm_120",
282 .description = "Target SM 120",307 .description = "Target SM 120",
...@@ -397,6 +422,11 @@ pub const all_features = blk: {...@@ -397,6 +422,11 @@ pub const all_features = blk: {
397 .description = "Target SM 87",422 .description = "Target SM 87",
398 .dependencies = featureSet(&[_]Feature{}),423 .dependencies = featureSet(&[_]Feature{}),
399 };424 };
425 result[@intFromEnum(Feature.sm_88)] = .{
426 .llvm_name = "sm_88",
427 .description = "Target SM 88",
428 .dependencies = featureSet(&[_]Feature{}),
429 };
400 result[@intFromEnum(Feature.sm_89)] = .{430 result[@intFromEnum(Feature.sm_89)] = .{
401 .llvm_name = "sm_89",431 .llvm_name = "sm_89",
402 .description = "Target SM 89",432 .description = "Target SM 89",
...@@ -425,7 +455,6 @@ pub const cpu = struct {...@@ -425,7 +455,6 @@ pub const cpu = struct {
425 .name = "sm_100",455 .name = "sm_100",
426 .llvm_name = "sm_100",456 .llvm_name = "sm_100",
427 .features = featureSet(&[_]Feature{457 .features = featureSet(&[_]Feature{
428 .ptx86,
429 .sm_100,458 .sm_100,
430 }),459 }),
431 };460 };
...@@ -433,7 +462,6 @@ pub const cpu = struct {...@@ -433,7 +462,6 @@ pub const cpu = struct {
433 .name = "sm_100a",462 .name = "sm_100a",
434 .llvm_name = "sm_100a",463 .llvm_name = "sm_100a",
435 .features = featureSet(&[_]Feature{464 .features = featureSet(&[_]Feature{
436 .ptx86,
437 .sm_100a,465 .sm_100a,
438 }),466 }),
439 };467 };
...@@ -441,7 +469,6 @@ pub const cpu = struct {...@@ -441,7 +469,6 @@ pub const cpu = struct {
441 .name = "sm_100f",469 .name = "sm_100f",
442 .llvm_name = "sm_100f",470 .llvm_name = "sm_100f",
443 .features = featureSet(&[_]Feature{471 .features = featureSet(&[_]Feature{
444 .ptx88,
445 .sm_100f,472 .sm_100f,
446 }),473 }),
447 };474 };
...@@ -449,7 +476,6 @@ pub const cpu = struct {...@@ -449,7 +476,6 @@ pub const cpu = struct {
449 .name = "sm_101",476 .name = "sm_101",
450 .llvm_name = "sm_101",477 .llvm_name = "sm_101",
451 .features = featureSet(&[_]Feature{478 .features = featureSet(&[_]Feature{
452 .ptx86,
453 .sm_101,479 .sm_101,
454 }),480 }),
455 };481 };
...@@ -457,7 +483,6 @@ pub const cpu = struct {...@@ -457,7 +483,6 @@ pub const cpu = struct {
457 .name = "sm_101a",483 .name = "sm_101a",
458 .llvm_name = "sm_101a",484 .llvm_name = "sm_101a",
459 .features = featureSet(&[_]Feature{485 .features = featureSet(&[_]Feature{
460 .ptx86,
461 .sm_101a,486 .sm_101a,
462 }),487 }),
463 };488 };
...@@ -465,7 +490,6 @@ pub const cpu = struct {...@@ -465,7 +490,6 @@ pub const cpu = struct {
465 .name = "sm_101f",490 .name = "sm_101f",
466 .llvm_name = "sm_101f",491 .llvm_name = "sm_101f",
467 .features = featureSet(&[_]Feature{492 .features = featureSet(&[_]Feature{
468 .ptx88,
469 .sm_101f,493 .sm_101f,
470 }),494 }),
471 };495 };
...@@ -473,7 +497,6 @@ pub const cpu = struct {...@@ -473,7 +497,6 @@ pub const cpu = struct {
473 .name = "sm_103",497 .name = "sm_103",
474 .llvm_name = "sm_103",498 .llvm_name = "sm_103",
475 .features = featureSet(&[_]Feature{499 .features = featureSet(&[_]Feature{
476 .ptx88,
477 .sm_103,500 .sm_103,
478 }),501 }),
479 };502 };
...@@ -481,7 +504,6 @@ pub const cpu = struct {...@@ -481,7 +504,6 @@ pub const cpu = struct {
481 .name = "sm_103a",504 .name = "sm_103a",
482 .llvm_name = "sm_103a",505 .llvm_name = "sm_103a",
483 .features = featureSet(&[_]Feature{506 .features = featureSet(&[_]Feature{
484 .ptx88,
485 .sm_103a,507 .sm_103a,
486 }),508 }),
487 };509 };
...@@ -489,15 +511,34 @@ pub const cpu = struct {...@@ -489,15 +511,34 @@ pub const cpu = struct {
489 .name = "sm_103f",511 .name = "sm_103f",
490 .llvm_name = "sm_103f",512 .llvm_name = "sm_103f",
491 .features = featureSet(&[_]Feature{513 .features = featureSet(&[_]Feature{
492 .ptx88,
493 .sm_103f,514 .sm_103f,
494 }),515 }),
495 };516 };
517 pub const sm_110: CpuModel = .{
518 .name = "sm_110",
519 .llvm_name = "sm_110",
520 .features = featureSet(&[_]Feature{
521 .sm_110,
522 }),
523 };
524 pub const sm_110a: CpuModel = .{
525 .name = "sm_110a",
526 .llvm_name = "sm_110a",
527 .features = featureSet(&[_]Feature{
528 .sm_110a,
529 }),
530 };
531 pub const sm_110f: CpuModel = .{
532 .name = "sm_110f",
533 .llvm_name = "sm_110f",
534 .features = featureSet(&[_]Feature{
535 .sm_110f,
536 }),
537 };
496 pub const sm_120: CpuModel = .{538 pub const sm_120: CpuModel = .{
497 .name = "sm_120",539 .name = "sm_120",
498 .llvm_name = "sm_120",540 .llvm_name = "sm_120",
499 .features = featureSet(&[_]Feature{541 .features = featureSet(&[_]Feature{
500 .ptx87,
501 .sm_120,542 .sm_120,
502 }),543 }),
503 };544 };
...@@ -505,7 +546,6 @@ pub const cpu = struct {...@@ -505,7 +546,6 @@ pub const cpu = struct {
505 .name = "sm_120a",546 .name = "sm_120a",
506 .llvm_name = "sm_120a",547 .llvm_name = "sm_120a",
507 .features = featureSet(&[_]Feature{548 .features = featureSet(&[_]Feature{
508 .ptx87,
509 .sm_120a,549 .sm_120a,
510 }),550 }),
511 };551 };
...@@ -513,7 +553,6 @@ pub const cpu = struct {...@@ -513,7 +553,6 @@ pub const cpu = struct {
513 .name = "sm_120f",553 .name = "sm_120f",
514 .llvm_name = "sm_120f",554 .llvm_name = "sm_120f",
515 .features = featureSet(&[_]Feature{555 .features = featureSet(&[_]Feature{
516 .ptx88,
517 .sm_120f,556 .sm_120f,
518 }),557 }),
519 };558 };
...@@ -521,7 +560,6 @@ pub const cpu = struct {...@@ -521,7 +560,6 @@ pub const cpu = struct {
521 .name = "sm_121",560 .name = "sm_121",
522 .llvm_name = "sm_121",561 .llvm_name = "sm_121",
523 .features = featureSet(&[_]Feature{562 .features = featureSet(&[_]Feature{
524 .ptx88,
525 .sm_121,563 .sm_121,
526 }),564 }),
527 };565 };
...@@ -529,7 +567,6 @@ pub const cpu = struct {...@@ -529,7 +567,6 @@ pub const cpu = struct {
529 .name = "sm_121a",567 .name = "sm_121a",
530 .llvm_name = "sm_121a",568 .llvm_name = "sm_121a",
531 .features = featureSet(&[_]Feature{569 .features = featureSet(&[_]Feature{
532 .ptx88,
533 .sm_121a,570 .sm_121a,
534 }),571 }),
535 };572 };
...@@ -537,7 +574,6 @@ pub const cpu = struct {...@@ -537,7 +574,6 @@ pub const cpu = struct {
537 .name = "sm_121f",574 .name = "sm_121f",
538 .llvm_name = "sm_121f",575 .llvm_name = "sm_121f",
539 .features = featureSet(&[_]Feature{576 .features = featureSet(&[_]Feature{
540 .ptx88,
541 .sm_121f,577 .sm_121f,
542 }),578 }),
543 };579 };
...@@ -545,7 +581,6 @@ pub const cpu = struct {...@@ -545,7 +581,6 @@ pub const cpu = struct {
545 .name = "sm_20",581 .name = "sm_20",
546 .llvm_name = "sm_20",582 .llvm_name = "sm_20",
547 .features = featureSet(&[_]Feature{583 .features = featureSet(&[_]Feature{
548 .ptx32,
549 .sm_20,584 .sm_20,
550 }),585 }),
551 };586 };
...@@ -553,7 +588,6 @@ pub const cpu = struct {...@@ -553,7 +588,6 @@ pub const cpu = struct {
553 .name = "sm_21",588 .name = "sm_21",
554 .llvm_name = "sm_21",589 .llvm_name = "sm_21",
555 .features = featureSet(&[_]Feature{590 .features = featureSet(&[_]Feature{
556 .ptx32,
557 .sm_21,591 .sm_21,
558 }),592 }),
559 };593 };
...@@ -568,7 +602,6 @@ pub const cpu = struct {...@@ -568,7 +602,6 @@ pub const cpu = struct {
568 .name = "sm_32",602 .name = "sm_32",
569 .llvm_name = "sm_32",603 .llvm_name = "sm_32",
570 .features = featureSet(&[_]Feature{604 .features = featureSet(&[_]Feature{
571 .ptx40,
572 .sm_32,605 .sm_32,
573 }),606 }),
574 };607 };
...@@ -576,7 +609,6 @@ pub const cpu = struct {...@@ -576,7 +609,6 @@ pub const cpu = struct {
576 .name = "sm_35",609 .name = "sm_35",
577 .llvm_name = "sm_35",610 .llvm_name = "sm_35",
578 .features = featureSet(&[_]Feature{611 .features = featureSet(&[_]Feature{
579 .ptx32,
580 .sm_35,612 .sm_35,
581 }),613 }),
582 };614 };
...@@ -584,7 +616,6 @@ pub const cpu = struct {...@@ -584,7 +616,6 @@ pub const cpu = struct {
584 .name = "sm_37",616 .name = "sm_37",
585 .llvm_name = "sm_37",617 .llvm_name = "sm_37",
586 .features = featureSet(&[_]Feature{618 .features = featureSet(&[_]Feature{
587 .ptx41,
588 .sm_37,619 .sm_37,
589 }),620 }),
590 };621 };
...@@ -592,7 +623,6 @@ pub const cpu = struct {...@@ -592,7 +623,6 @@ pub const cpu = struct {
592 .name = "sm_50",623 .name = "sm_50",
593 .llvm_name = "sm_50",624 .llvm_name = "sm_50",
594 .features = featureSet(&[_]Feature{625 .features = featureSet(&[_]Feature{
595 .ptx40,
596 .sm_50,626 .sm_50,
597 }),627 }),
598 };628 };
...@@ -600,7 +630,6 @@ pub const cpu = struct {...@@ -600,7 +630,6 @@ pub const cpu = struct {
600 .name = "sm_52",630 .name = "sm_52",
601 .llvm_name = "sm_52",631 .llvm_name = "sm_52",
602 .features = featureSet(&[_]Feature{632 .features = featureSet(&[_]Feature{
603 .ptx41,
604 .sm_52,633 .sm_52,
605 }),634 }),
606 };635 };
...@@ -608,7 +637,6 @@ pub const cpu = struct {...@@ -608,7 +637,6 @@ pub const cpu = struct {
608 .name = "sm_53",637 .name = "sm_53",
609 .llvm_name = "sm_53",638 .llvm_name = "sm_53",
610 .features = featureSet(&[_]Feature{639 .features = featureSet(&[_]Feature{
611 .ptx42,
612 .sm_53,640 .sm_53,
613 }),641 }),
614 };642 };
...@@ -616,7 +644,6 @@ pub const cpu = struct {...@@ -616,7 +644,6 @@ pub const cpu = struct {
616 .name = "sm_60",644 .name = "sm_60",
617 .llvm_name = "sm_60",645 .llvm_name = "sm_60",
618 .features = featureSet(&[_]Feature{646 .features = featureSet(&[_]Feature{
619 .ptx50,
620 .sm_60,647 .sm_60,
621 }),648 }),
622 };649 };
...@@ -624,7 +651,6 @@ pub const cpu = struct {...@@ -624,7 +651,6 @@ pub const cpu = struct {
624 .name = "sm_61",651 .name = "sm_61",
625 .llvm_name = "sm_61",652 .llvm_name = "sm_61",
626 .features = featureSet(&[_]Feature{653 .features = featureSet(&[_]Feature{
627 .ptx50,
628 .sm_61,654 .sm_61,
629 }),655 }),
630 };656 };
...@@ -632,7 +658,6 @@ pub const cpu = struct {...@@ -632,7 +658,6 @@ pub const cpu = struct {
632 .name = "sm_62",658 .name = "sm_62",
633 .llvm_name = "sm_62",659 .llvm_name = "sm_62",
634 .features = featureSet(&[_]Feature{660 .features = featureSet(&[_]Feature{
635 .ptx50,
636 .sm_62,661 .sm_62,
637 }),662 }),
638 };663 };
...@@ -640,7 +665,6 @@ pub const cpu = struct {...@@ -640,7 +665,6 @@ pub const cpu = struct {
640 .name = "sm_70",665 .name = "sm_70",
641 .llvm_name = "sm_70",666 .llvm_name = "sm_70",
642 .features = featureSet(&[_]Feature{667 .features = featureSet(&[_]Feature{
643 .ptx60,
644 .sm_70,668 .sm_70,
645 }),669 }),
646 };670 };
...@@ -648,7 +672,6 @@ pub const cpu = struct {...@@ -648,7 +672,6 @@ pub const cpu = struct {
648 .name = "sm_72",672 .name = "sm_72",
649 .llvm_name = "sm_72",673 .llvm_name = "sm_72",
650 .features = featureSet(&[_]Feature{674 .features = featureSet(&[_]Feature{
651 .ptx61,
652 .sm_72,675 .sm_72,
653 }),676 }),
654 };677 };
...@@ -656,7 +679,6 @@ pub const cpu = struct {...@@ -656,7 +679,6 @@ pub const cpu = struct {
656 .name = "sm_75",679 .name = "sm_75",
657 .llvm_name = "sm_75",680 .llvm_name = "sm_75",
658 .features = featureSet(&[_]Feature{681 .features = featureSet(&[_]Feature{
659 .ptx63,
660 .sm_75,682 .sm_75,
661 }),683 }),
662 };684 };
...@@ -664,7 +686,6 @@ pub const cpu = struct {...@@ -664,7 +686,6 @@ pub const cpu = struct {
664 .name = "sm_80",686 .name = "sm_80",
665 .llvm_name = "sm_80",687 .llvm_name = "sm_80",
666 .features = featureSet(&[_]Feature{688 .features = featureSet(&[_]Feature{
667 .ptx70,
668 .sm_80,689 .sm_80,
669 }),690 }),
670 };691 };
...@@ -672,7 +693,6 @@ pub const cpu = struct {...@@ -672,7 +693,6 @@ pub const cpu = struct {
672 .name = "sm_86",693 .name = "sm_86",
673 .llvm_name = "sm_86",694 .llvm_name = "sm_86",
674 .features = featureSet(&[_]Feature{695 .features = featureSet(&[_]Feature{
675 .ptx71,
676 .sm_86,696 .sm_86,
677 }),697 }),
678 };698 };
...@@ -680,15 +700,20 @@ pub const cpu = struct {...@@ -680,15 +700,20 @@ pub const cpu = struct {
680 .name = "sm_87",700 .name = "sm_87",
681 .llvm_name = "sm_87",701 .llvm_name = "sm_87",
682 .features = featureSet(&[_]Feature{702 .features = featureSet(&[_]Feature{
683 .ptx74,
684 .sm_87,703 .sm_87,
685 }),704 }),
686 };705 };
706 pub const sm_88: CpuModel = .{
707 .name = "sm_88",
708 .llvm_name = "sm_88",
709 .features = featureSet(&[_]Feature{
710 .sm_88,
711 }),
712 };
687 pub const sm_89: CpuModel = .{713 pub const sm_89: CpuModel = .{
688 .name = "sm_89",714 .name = "sm_89",
689 .llvm_name = "sm_89",715 .llvm_name = "sm_89",
690 .features = featureSet(&[_]Feature{716 .features = featureSet(&[_]Feature{
691 .ptx78,
692 .sm_89,717 .sm_89,
693 }),718 }),
694 };719 };
...@@ -696,7 +721,6 @@ pub const cpu = struct {...@@ -696,7 +721,6 @@ pub const cpu = struct {
696 .name = "sm_90",721 .name = "sm_90",
697 .llvm_name = "sm_90",722 .llvm_name = "sm_90",
698 .features = featureSet(&[_]Feature{723 .features = featureSet(&[_]Feature{
699 .ptx78,
700 .sm_90,724 .sm_90,
701 }),725 }),
702 };726 };
...@@ -704,7 +728,6 @@ pub const cpu = struct {...@@ -704,7 +728,6 @@ pub const cpu = struct {
704 .name = "sm_90a",728 .name = "sm_90a",
705 .llvm_name = "sm_90a",729 .llvm_name = "sm_90a",
706 .features = featureSet(&[_]Feature{730 .features = featureSet(&[_]Feature{
707 .ptx80,
708 .sm_90a,731 .sm_90a,
709 }),732 }),
710 };733 };
lib/std/Target/powerpc.zig+27-19
...@@ -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 @"64bit",8 @"64bit",
9 @"64bit_support",
9 @"64bitregs",10 @"64bitregs",
10 allow_unaligned_fp_access,11 allow_unaligned_fp_access,
11 altivec,12 altivec,
...@@ -97,7 +98,14 @@ pub const all_features = blk: {...@@ -97,7 +98,14 @@ pub const all_features = blk: {
97 var result: [len]CpuFeature = undefined;98 var result: [len]CpuFeature = undefined;
98 result[@intFromEnum(Feature.@"64bit")] = .{99 result[@intFromEnum(Feature.@"64bit")] = .{
99 .llvm_name = "64bit",100 .llvm_name = "64bit",
100 .description = "Enable 64-bit instructions",101 .description = "Enable 64-bit mode",
102 .dependencies = featureSet(&[_]Feature{
103 .@"64bit_support",
104 }),
105 };
106 result[@intFromEnum(Feature.@"64bit_support")] = .{
107 .llvm_name = "64bit-support",
108 .description = "Supports 64-bit instructions",
101 .dependencies = featureSet(&[_]Feature{}),109 .dependencies = featureSet(&[_]Feature{}),
102 };110 };
103 result[@intFromEnum(Feature.@"64bitregs")] = .{111 result[@intFromEnum(Feature.@"64bitregs")] = .{
...@@ -705,7 +713,7 @@ pub const cpu = struct {...@@ -705,7 +713,7 @@ pub const cpu = struct {
705 .name = "970",713 .name = "970",
706 .llvm_name = "970",714 .llvm_name = "970",
707 .features = featureSet(&[_]Feature{715 .features = featureSet(&[_]Feature{
708 .@"64bit",716 .@"64bit_support",
709 .altivec,717 .altivec,
710 .fres,718 .fres,
711 .frsqrte,719 .frsqrte,
...@@ -718,7 +726,7 @@ pub const cpu = struct {...@@ -718,7 +726,7 @@ pub const cpu = struct {
718 .name = "a2",726 .name = "a2",
719 .llvm_name = "a2",727 .llvm_name = "a2",
720 .features = featureSet(&[_]Feature{728 .features = featureSet(&[_]Feature{
721 .@"64bit",729 .@"64bit_support",
722 .booke,730 .booke,
723 .cmpb,731 .cmpb,
724 .fcpsgn,732 .fcpsgn,
...@@ -761,7 +769,7 @@ pub const cpu = struct {...@@ -761,7 +769,7 @@ pub const cpu = struct {
761 .name = "e5500",769 .name = "e5500",
762 .llvm_name = "e5500",770 .llvm_name = "e5500",
763 .features = featureSet(&[_]Feature{771 .features = featureSet(&[_]Feature{
764 .@"64bit",772 .@"64bit_support",
765 .booke,773 .booke,
766 .isel,774 .isel,
767 .mfocrf,775 .mfocrf,
...@@ -772,7 +780,7 @@ pub const cpu = struct {...@@ -772,7 +780,7 @@ pub const cpu = struct {
772 .name = "future",780 .name = "future",
773 .llvm_name = "future",781 .llvm_name = "future",
774 .features = featureSet(&[_]Feature{782 .features = featureSet(&[_]Feature{
775 .@"64bit",783 .@"64bit_support",
776 .allow_unaligned_fp_access,784 .allow_unaligned_fp_access,
777 .bpermd,785 .bpermd,
778 .cmpb,786 .cmpb,
...@@ -846,7 +854,7 @@ pub const cpu = struct {...@@ -846,7 +854,7 @@ pub const cpu = struct {
846 .name = "g5",854 .name = "g5",
847 .llvm_name = "g5",855 .llvm_name = "g5",
848 .features = featureSet(&[_]Feature{856 .features = featureSet(&[_]Feature{
849 .@"64bit",857 .@"64bit_support",
850 .altivec,858 .altivec,
851 .fres,859 .fres,
852 .frsqrte,860 .frsqrte,
...@@ -873,7 +881,7 @@ pub const cpu = struct {...@@ -873,7 +881,7 @@ pub const cpu = struct {
873 .name = "ppc64",881 .name = "ppc64",
874 .llvm_name = "ppc64",882 .llvm_name = "ppc64",
875 .features = featureSet(&[_]Feature{883 .features = featureSet(&[_]Feature{
876 .@"64bit",884 .@"64bit_support",
877 .altivec,885 .altivec,
878 .fres,886 .fres,
879 .frsqrte,887 .frsqrte,
...@@ -886,7 +894,7 @@ pub const cpu = struct {...@@ -886,7 +894,7 @@ pub const cpu = struct {
886 .name = "ppc64le",894 .name = "ppc64le",
887 .llvm_name = "ppc64le",895 .llvm_name = "ppc64le",
888 .features = featureSet(&[_]Feature{896 .features = featureSet(&[_]Feature{
889 .@"64bit",897 .@"64bit_support",
890 .allow_unaligned_fp_access,898 .allow_unaligned_fp_access,
891 .bpermd,899 .bpermd,
892 .cmpb,900 .cmpb,
...@@ -926,7 +934,7 @@ pub const cpu = struct {...@@ -926,7 +934,7 @@ pub const cpu = struct {
926 .name = "pwr10",934 .name = "pwr10",
927 .llvm_name = "pwr10",935 .llvm_name = "pwr10",
928 .features = featureSet(&[_]Feature{936 .features = featureSet(&[_]Feature{
929 .@"64bit",937 .@"64bit_support",
930 .allow_unaligned_fp_access,938 .allow_unaligned_fp_access,
931 .bpermd,939 .bpermd,
932 .cmpb,940 .cmpb,
...@@ -973,7 +981,7 @@ pub const cpu = struct {...@@ -973,7 +981,7 @@ pub const cpu = struct {
973 .name = "pwr11",981 .name = "pwr11",
974 .llvm_name = "pwr11",982 .llvm_name = "pwr11",
975 .features = featureSet(&[_]Feature{983 .features = featureSet(&[_]Feature{
976 .@"64bit",984 .@"64bit_support",
977 .allow_unaligned_fp_access,985 .allow_unaligned_fp_access,
978 .bpermd,986 .bpermd,
979 .cmpb,987 .cmpb,
...@@ -1020,7 +1028,7 @@ pub const cpu = struct {...@@ -1020,7 +1028,7 @@ pub const cpu = struct {
1020 .name = "pwr3",1028 .name = "pwr3",
1021 .llvm_name = "pwr3",1029 .llvm_name = "pwr3",
1022 .features = featureSet(&[_]Feature{1030 .features = featureSet(&[_]Feature{
1023 .@"64bit",1031 .@"64bit_support",
1024 .altivec,1032 .altivec,
1025 .fres,1033 .fres,
1026 .frsqrte,1034 .frsqrte,
...@@ -1032,7 +1040,7 @@ pub const cpu = struct {...@@ -1032,7 +1040,7 @@ pub const cpu = struct {
1032 .name = "pwr4",1040 .name = "pwr4",
1033 .llvm_name = "pwr4",1041 .llvm_name = "pwr4",
1034 .features = featureSet(&[_]Feature{1042 .features = featureSet(&[_]Feature{
1035 .@"64bit",1043 .@"64bit_support",
1036 .altivec,1044 .altivec,
1037 .fres,1045 .fres,
1038 .frsqrte,1046 .frsqrte,
...@@ -1045,7 +1053,7 @@ pub const cpu = struct {...@@ -1045,7 +1053,7 @@ pub const cpu = struct {
1045 .name = "pwr5",1053 .name = "pwr5",
1046 .llvm_name = "pwr5",1054 .llvm_name = "pwr5",
1047 .features = featureSet(&[_]Feature{1055 .features = featureSet(&[_]Feature{
1048 .@"64bit",1056 .@"64bit_support",
1049 .altivec,1057 .altivec,
1050 .fre,1058 .fre,
1051 .fres,1059 .fres,
...@@ -1060,7 +1068,7 @@ pub const cpu = struct {...@@ -1060,7 +1068,7 @@ pub const cpu = struct {
1060 .name = "pwr5x",1068 .name = "pwr5x",
1061 .llvm_name = "pwr5x",1069 .llvm_name = "pwr5x",
1062 .features = featureSet(&[_]Feature{1070 .features = featureSet(&[_]Feature{
1063 .@"64bit",1071 .@"64bit_support",
1064 .altivec,1072 .altivec,
1065 .fprnd,1073 .fprnd,
1066 .fre,1074 .fre,
...@@ -1076,7 +1084,7 @@ pub const cpu = struct {...@@ -1076,7 +1084,7 @@ pub const cpu = struct {
1076 .name = "pwr6",1084 .name = "pwr6",
1077 .llvm_name = "pwr6",1085 .llvm_name = "pwr6",
1078 .features = featureSet(&[_]Feature{1086 .features = featureSet(&[_]Feature{
1079 .@"64bit",1087 .@"64bit_support",
1080 .altivec,1088 .altivec,
1081 .cmpb,1089 .cmpb,
1082 .fcpsgn,1090 .fcpsgn,
...@@ -1096,7 +1104,7 @@ pub const cpu = struct {...@@ -1096,7 +1104,7 @@ pub const cpu = struct {
1096 .name = "pwr6x",1104 .name = "pwr6x",
1097 .llvm_name = "pwr6x",1105 .llvm_name = "pwr6x",
1098 .features = featureSet(&[_]Feature{1106 .features = featureSet(&[_]Feature{
1099 .@"64bit",1107 .@"64bit_support",
1100 .altivec,1108 .altivec,
1101 .cmpb,1109 .cmpb,
1102 .fcpsgn,1110 .fcpsgn,
...@@ -1116,7 +1124,7 @@ pub const cpu = struct {...@@ -1116,7 +1124,7 @@ pub const cpu = struct {
1116 .name = "pwr7",1124 .name = "pwr7",
1117 .llvm_name = "pwr7",1125 .llvm_name = "pwr7",
1118 .features = featureSet(&[_]Feature{1126 .features = featureSet(&[_]Feature{
1119 .@"64bit",1127 .@"64bit_support",
1120 .allow_unaligned_fp_access,1128 .allow_unaligned_fp_access,
1121 .bpermd,1129 .bpermd,
1122 .cmpb,1130 .cmpb,
...@@ -1145,7 +1153,7 @@ pub const cpu = struct {...@@ -1145,7 +1153,7 @@ pub const cpu = struct {
1145 .name = "pwr8",1153 .name = "pwr8",
1146 .llvm_name = "pwr8",1154 .llvm_name = "pwr8",
1147 .features = featureSet(&[_]Feature{1155 .features = featureSet(&[_]Feature{
1148 .@"64bit",1156 .@"64bit_support",
1149 .allow_unaligned_fp_access,1157 .allow_unaligned_fp_access,
1150 .bpermd,1158 .bpermd,
1151 .cmpb,1159 .cmpb,
...@@ -1185,7 +1193,7 @@ pub const cpu = struct {...@@ -1185,7 +1193,7 @@ pub const cpu = struct {
1185 .name = "pwr9",1193 .name = "pwr9",
1186 .llvm_name = "pwr9",1194 .llvm_name = "pwr9",
1187 .features = featureSet(&[_]Feature{1195 .features = featureSet(&[_]Feature{
1188 .@"64bit",1196 .@"64bit_support",
1189 .allow_unaligned_fp_access,1197 .allow_unaligned_fp_access,
1190 .bpermd,1198 .bpermd,
1191 .cmpb,1199 .cmpb,
lib/std/Target/riscv.zig+415-177
...@@ -8,49 +8,40 @@ pub const Feature = enum {...@@ -8,49 +8,40 @@ pub const Feature = enum {
8 @"32bit",8 @"32bit",
9 @"64bit",9 @"64bit",
10 a,10 a,
11 add_load_fusion,
12 addi_load_fusion,
11 andes45,13 andes45,
12 auipc_addi_fusion,14 auipc_addi_fusion,
15 auipc_load_fusion,
13 b,16 b,
17 bfext_fusion,
14 c,18 c,
15 conditional_cmv_fusion,19 conditional_cmv_fusion,
16 d,20 d,
17 disable_latency_sched_heuristic,21 disable_latency_sched_heuristic,
22 disable_misched_load_clustering,
23 disable_misched_store_clustering,
24 disable_postmisched_load_clustering,
25 disable_postmisched_store_clustering,
18 dlen_factor_2,26 dlen_factor_2,
19 e,27 e,
28 enable_vsetvli_sched_heuristic,
20 exact_asm,29 exact_asm,
21 experimental,30 experimental,
22 experimental_p,31 experimental_p,
23 experimental_rvm23u32,32 experimental_rvm23u32,
24 experimental_smctr,33 experimental_smpmpmt,
25 experimental_ssctr,
26 experimental_svukte,34 experimental_svukte,
27 experimental_xqccmp,
28 experimental_xqcia,
29 experimental_xqciac,
30 experimental_xqcibi,
31 experimental_xqcibm,
32 experimental_xqcicli,
33 experimental_xqcicm,
34 experimental_xqcics,
35 experimental_xqcicsr,
36 experimental_xqciint,
37 experimental_xqciio,
38 experimental_xqcilb,
39 experimental_xqcili,
40 experimental_xqcilia,
41 experimental_xqcilo,
42 experimental_xqcilsm,
43 experimental_xqcisim,
44 experimental_xqcisls,
45 experimental_xqcisync,
46 experimental_xrivosvisni,35 experimental_xrivosvisni,
47 experimental_xrivosvizip,36 experimental_xrivosvizip,
48 experimental_xsfmclic,37 experimental_xsfmclic,
49 experimental_xsfsclic,38 experimental_xsfsclic,
50 experimental_zalasr,39 experimental_zibi,
51 experimental_zicfilp,40 experimental_zicfilp,
52 experimental_zicfiss,41 experimental_zicfiss,
53 experimental_zvbc32e,42 experimental_zvbc32e,
43 experimental_zvfbfa,
44 experimental_zvfofp8min,
54 experimental_zvkgs,45 experimental_zvkgs,
55 experimental_zvqdotq,46 experimental_zvqdotq,
56 f,47 f,
...@@ -60,6 +51,7 @@ pub const Feature = enum {...@@ -60,6 +51,7 @@ pub const Feature = enum {
60 ld_add_fusion,51 ld_add_fusion,
61 log_vrgather,52 log_vrgather,
62 lui_addi_fusion,53 lui_addi_fusion,
54 lui_load_fusion,
63 m,55 m,
64 mips_p8700,56 mips_p8700,
65 no_default_unroll,57 no_default_unroll,
...@@ -73,6 +65,7 @@ pub const Feature = enum {...@@ -73,6 +65,7 @@ pub const Feature = enum {
73 optimized_nf7_segment_load_store,65 optimized_nf7_segment_load_store,
74 optimized_nf8_segment_load_store,66 optimized_nf8_segment_load_store,
75 optimized_zero_stride_load,67 optimized_zero_stride_load,
68 permissive_zalrsc,
76 predictable_select_expensive,69 predictable_select_expensive,
77 prefer_vsetvli_over_read_vlenb,70 prefer_vsetvli_over_read_vlenb,
78 prefer_w_inst,71 prefer_w_inst,
...@@ -127,15 +120,21 @@ pub const Feature = enum {...@@ -127,15 +120,21 @@ pub const Feature = enum {
127 shgatpa,120 shgatpa,
128 shifted_zextw_fusion,121 shifted_zextw_fusion,
129 shlcofideleg,122 shlcofideleg,
130 short_forward_branch_opt,123 short_forward_branch_ialu,
124 short_forward_branch_iload,
125 short_forward_branch_iminmax,
126 short_forward_branch_imul,
131 shtvala,127 shtvala,
132 shvsatpa,128 shvsatpa,
133 shvstvala,129 shvstvala,
134 shvstvecd,130 shvstvecd,
131 shxadd_load_fusion,
132 single_element_vec_fp64,
135 smaia,133 smaia,
136 smcdeleg,134 smcdeleg,
137 smcntrpmf,135 smcntrpmf,
138 smcsrind,136 smcsrind,
137 smctr,
139 smdbltrp,138 smdbltrp,
140 smepmp,139 smepmp,
141 smmpm,140 smmpm,
...@@ -148,6 +147,7 @@ pub const Feature = enum {...@@ -148,6 +147,7 @@ pub const Feature = enum {
148 sscofpmf,147 sscofpmf,
149 sscounterenw,148 sscounterenw,
150 sscsrind,149 sscsrind,
150 ssctr,
151 ssdbltrp,151 ssdbltrp,
152 ssnpm,152 ssnpm,
153 sspm,153 sspm,
...@@ -179,6 +179,7 @@ pub const Feature = enum {...@@ -179,6 +179,7 @@ pub const Feature = enum {
179 xandesvbfhcvt,179 xandesvbfhcvt,
180 xandesvdot,180 xandesvdot,
181 xandesvpackfph,181 xandesvpackfph,
182 xandesvsinth,
182 xandesvsintload,183 xandesvsintload,
183 xcvalu,184 xcvalu,
184 xcvbi,185 xcvbi,
...@@ -189,7 +190,28 @@ pub const Feature = enum {...@@ -189,7 +190,28 @@ pub const Feature = enum {
189 xcvsimd,190 xcvsimd,
190 xmipscbop,191 xmipscbop,
191 xmipscmov,192 xmipscmov,
193 xmipsexectl,
192 xmipslsp,194 xmipslsp,
195 xqccmp,
196 xqci,
197 xqcia,
198 xqciac,
199 xqcibi,
200 xqcibm,
201 xqcicli,
202 xqcicm,
203 xqcics,
204 xqcicsr,
205 xqciint,
206 xqciio,
207 xqcilb,
208 xqcili,
209 xqcilia,
210 xqcilo,
211 xqcilsm,
212 xqcisim,
213 xqcisls,
214 xqcisync,
193 xsfcease,215 xsfcease,
194 xsfmm128t,216 xsfmm128t,
195 xsfmm16t,217 xsfmm16t,
...@@ -202,12 +224,18 @@ pub const Feature = enum {...@@ -202,12 +224,18 @@ pub const Feature = enum {
202 xsfmm64t,224 xsfmm64t,
203 xsfmmbase,225 xsfmmbase,
204 xsfvcp,226 xsfvcp,
227 xsfvfbfexp16e,
228 xsfvfexp16e,
229 xsfvfexp32e,
230 xsfvfexpa,
231 xsfvfexpa64e,
205 xsfvfnrclipxfqf,232 xsfvfnrclipxfqf,
206 xsfvfwmaccqqq,233 xsfvfwmaccqqq,
207 xsfvqmaccdod,234 xsfvqmaccdod,
208 xsfvqmaccqoq,235 xsfvqmaccqoq,
209 xsifivecdiscarddlone,236 xsifivecdiscarddlone,
210 xsifivecflushdlone,237 xsifivecflushdlone,
238 xsmtvdot,
211 xtheadba,239 xtheadba,
212 xtheadbb,240 xtheadbb,
213 xtheadbs,241 xtheadbs,
...@@ -226,6 +254,7 @@ pub const Feature = enum {...@@ -226,6 +254,7 @@ pub const Feature = enum {
226 zaamo,254 zaamo,
227 zabha,255 zabha,
228 zacas,256 zacas,
257 zalasr,
229 zalrsc,258 zalrsc,
230 zama16b,259 zama16b,
231 zawrs,260 zawrs,
...@@ -272,6 +301,7 @@ pub const Feature = enum {...@@ -272,6 +301,7 @@ pub const Feature = enum {
272 zihintpause,301 zihintpause,
273 zihpm,302 zihpm,
274 zilsd,303 zilsd,
304 zilsd_4byte_align,
275 zimop,305 zimop,
276 zk,306 zk,
277 zkn,307 zkn,
...@@ -352,6 +382,16 @@ pub const all_features = blk: {...@@ -352,6 +382,16 @@ pub const all_features = blk: {
352 .zalrsc,382 .zalrsc,
353 }),383 }),
354 };384 };
385 result[@intFromEnum(Feature.add_load_fusion)] = .{
386 .llvm_name = "add-load-fusion",
387 .description = "Enable ADD(.UW) + load macrofusion",
388 .dependencies = featureSet(&[_]Feature{}),
389 };
390 result[@intFromEnum(Feature.addi_load_fusion)] = .{
391 .llvm_name = "addi-load-fusion",
392 .description = "Enable ADDI + load macrofusion",
393 .dependencies = featureSet(&[_]Feature{}),
394 };
355 result[@intFromEnum(Feature.andes45)] = .{395 result[@intFromEnum(Feature.andes45)] = .{
356 .llvm_name = "andes45",396 .llvm_name = "andes45",
357 .description = "Andes 45-Series processors",397 .description = "Andes 45-Series processors",
...@@ -362,6 +402,11 @@ pub const all_features = blk: {...@@ -362,6 +402,11 @@ pub const all_features = blk: {
362 .description = "Enable AUIPC+ADDI macrofusion",402 .description = "Enable AUIPC+ADDI macrofusion",
363 .dependencies = featureSet(&[_]Feature{}),403 .dependencies = featureSet(&[_]Feature{}),
364 };404 };
405 result[@intFromEnum(Feature.auipc_load_fusion)] = .{
406 .llvm_name = "auipc-load-fusion",
407 .description = "Enable AUIPC + load macrofusion",
408 .dependencies = featureSet(&[_]Feature{}),
409 };
365 result[@intFromEnum(Feature.b)] = .{410 result[@intFromEnum(Feature.b)] = .{
366 .llvm_name = "b",411 .llvm_name = "b",
367 .description = "'B' (the collection of the Zba, Zbb, Zbs extensions)",412 .description = "'B' (the collection of the Zba, Zbb, Zbs extensions)",
...@@ -371,6 +416,11 @@ pub const all_features = blk: {...@@ -371,6 +416,11 @@ pub const all_features = blk: {
371 .zbs,416 .zbs,
372 }),417 }),
373 };418 };
419 result[@intFromEnum(Feature.bfext_fusion)] = .{
420 .llvm_name = "bfext-fusion",
421 .description = "Enable SLLI+SRLI (bitfield extract) macrofusion",
422 .dependencies = featureSet(&[_]Feature{}),
423 };
374 result[@intFromEnum(Feature.c)] = .{424 result[@intFromEnum(Feature.c)] = .{
375 .llvm_name = "c",425 .llvm_name = "c",
376 .description = "'C' (Compressed Instructions)",426 .description = "'C' (Compressed Instructions)",
...@@ -395,6 +445,26 @@ pub const all_features = blk: {...@@ -395,6 +445,26 @@ pub const all_features = blk: {
395 .description = "Disable latency scheduling heuristic",445 .description = "Disable latency scheduling heuristic",
396 .dependencies = featureSet(&[_]Feature{}),446 .dependencies = featureSet(&[_]Feature{}),
397 };447 };
448 result[@intFromEnum(Feature.disable_misched_load_clustering)] = .{
449 .llvm_name = "disable-misched-load-clustering",
450 .description = "Disable load clustering in the machine scheduler",
451 .dependencies = featureSet(&[_]Feature{}),
452 };
453 result[@intFromEnum(Feature.disable_misched_store_clustering)] = .{
454 .llvm_name = "disable-misched-store-clustering",
455 .description = "Disable store clustering in the machine scheduler",
456 .dependencies = featureSet(&[_]Feature{}),
457 };
458 result[@intFromEnum(Feature.disable_postmisched_load_clustering)] = .{
459 .llvm_name = "disable-postmisched-load-clustering",
460 .description = "Disable PostRA load clustering in the machine scheduler",
461 .dependencies = featureSet(&[_]Feature{}),
462 };
463 result[@intFromEnum(Feature.disable_postmisched_store_clustering)] = .{
464 .llvm_name = "disable-postmisched-store-clustering",
465 .description = "Disable PostRA store clustering in the machine scheduler",
466 .dependencies = featureSet(&[_]Feature{}),
467 };
398 result[@intFromEnum(Feature.dlen_factor_2)] = .{468 result[@intFromEnum(Feature.dlen_factor_2)] = .{
399 .llvm_name = "dlen-factor-2",469 .llvm_name = "dlen-factor-2",
400 .description = "Vector unit DLEN(data path width) is half of VLEN",470 .description = "Vector unit DLEN(data path width) is half of VLEN",
...@@ -405,6 +475,11 @@ pub const all_features = blk: {...@@ -405,6 +475,11 @@ pub const all_features = blk: {
405 .description = "'E' (Embedded Instruction Set with 16 GPRs)",475 .description = "'E' (Embedded Instruction Set with 16 GPRs)",
406 .dependencies = featureSet(&[_]Feature{}),476 .dependencies = featureSet(&[_]Feature{}),
407 };477 };
478 result[@intFromEnum(Feature.enable_vsetvli_sched_heuristic)] = .{
479 .llvm_name = "enable-vsetvli-sched-heuristic",
480 .description = "Enable vsetvli-based scheduling heuristic",
481 .dependencies = featureSet(&[_]Feature{}),
482 };
408 result[@intFromEnum(Feature.exact_asm)] = .{483 result[@intFromEnum(Feature.exact_asm)] = .{
409 .llvm_name = "exact-asm",484 .llvm_name = "exact-asm",
410 .description = "Enable Exact Assembly (Disables Compression and Relaxation)",485 .description = "Enable Exact Assembly (Disables Compression and Relaxation)",
...@@ -437,144 +512,16 @@ pub const all_features = blk: {...@@ -437,144 +512,16 @@ pub const all_features = blk: {
437 .zimop,512 .zimop,
438 }),513 }),
439 };514 };
440 result[@intFromEnum(Feature.experimental_smctr)] = .{515 result[@intFromEnum(Feature.experimental_smpmpmt)] = .{
441 .llvm_name = "experimental-smctr",516 .llvm_name = "experimental-smpmpmt",
442 .description = "'Smctr' (Control Transfer Records Machine Level)",517 .description = "'Smpmpmt' (PMP-based Memory Types Extension)",
443 .dependencies = featureSet(&[_]Feature{518 .dependencies = featureSet(&[_]Feature{}),
444 .sscsrind,
445 }),
446 };
447 result[@intFromEnum(Feature.experimental_ssctr)] = .{
448 .llvm_name = "experimental-ssctr",
449 .description = "'Ssctr' (Control Transfer Records Supervisor Level)",
450 .dependencies = featureSet(&[_]Feature{
451 .sscsrind,
452 }),
453 };519 };
454 result[@intFromEnum(Feature.experimental_svukte)] = .{520 result[@intFromEnum(Feature.experimental_svukte)] = .{
455 .llvm_name = "experimental-svukte",521 .llvm_name = "experimental-svukte",
456 .description = "'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)",522 .description = "'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)",
457 .dependencies = featureSet(&[_]Feature{}),523 .dependencies = featureSet(&[_]Feature{}),
458 };524 };
459 result[@intFromEnum(Feature.experimental_xqccmp)] = .{
460 .llvm_name = "experimental-xqccmp",
461 .description = "'Xqccmp' (Qualcomm 16-bit Push/Pop and Double Moves)",
462 .dependencies = featureSet(&[_]Feature{
463 .zca,
464 }),
465 };
466 result[@intFromEnum(Feature.experimental_xqcia)] = .{
467 .llvm_name = "experimental-xqcia",
468 .description = "'Xqcia' (Qualcomm uC Arithmetic Extension)",
469 .dependencies = featureSet(&[_]Feature{}),
470 };
471 result[@intFromEnum(Feature.experimental_xqciac)] = .{
472 .llvm_name = "experimental-xqciac",
473 .description = "'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)",
474 .dependencies = featureSet(&[_]Feature{
475 .zca,
476 }),
477 };
478 result[@intFromEnum(Feature.experimental_xqcibi)] = .{
479 .llvm_name = "experimental-xqcibi",
480 .description = "'Xqcibi' (Qualcomm uC Branch Immediate Extension)",
481 .dependencies = featureSet(&[_]Feature{
482 .zca,
483 }),
484 };
485 result[@intFromEnum(Feature.experimental_xqcibm)] = .{
486 .llvm_name = "experimental-xqcibm",
487 .description = "'Xqcibm' (Qualcomm uC Bit Manipulation Extension)",
488 .dependencies = featureSet(&[_]Feature{
489 .zca,
490 }),
491 };
492 result[@intFromEnum(Feature.experimental_xqcicli)] = .{
493 .llvm_name = "experimental-xqcicli",
494 .description = "'Xqcicli' (Qualcomm uC Conditional Load Immediate Extension)",
495 .dependencies = featureSet(&[_]Feature{}),
496 };
497 result[@intFromEnum(Feature.experimental_xqcicm)] = .{
498 .llvm_name = "experimental-xqcicm",
499 .description = "'Xqcicm' (Qualcomm uC Conditional Move Extension)",
500 .dependencies = featureSet(&[_]Feature{
501 .zca,
502 }),
503 };
504 result[@intFromEnum(Feature.experimental_xqcics)] = .{
505 .llvm_name = "experimental-xqcics",
506 .description = "'Xqcics' (Qualcomm uC Conditional Select Extension)",
507 .dependencies = featureSet(&[_]Feature{}),
508 };
509 result[@intFromEnum(Feature.experimental_xqcicsr)] = .{
510 .llvm_name = "experimental-xqcicsr",
511 .description = "'Xqcicsr' (Qualcomm uC CSR Extension)",
512 .dependencies = featureSet(&[_]Feature{}),
513 };
514 result[@intFromEnum(Feature.experimental_xqciint)] = .{
515 .llvm_name = "experimental-xqciint",
516 .description = "'Xqciint' (Qualcomm uC Interrupts Extension)",
517 .dependencies = featureSet(&[_]Feature{
518 .zca,
519 }),
520 };
521 result[@intFromEnum(Feature.experimental_xqciio)] = .{
522 .llvm_name = "experimental-xqciio",
523 .description = "'Xqciio' (Qualcomm uC External Input Output Extension)",
524 .dependencies = featureSet(&[_]Feature{}),
525 };
526 result[@intFromEnum(Feature.experimental_xqcilb)] = .{
527 .llvm_name = "experimental-xqcilb",
528 .description = "'Xqcilb' (Qualcomm uC Long Branch Extension)",
529 .dependencies = featureSet(&[_]Feature{
530 .zca,
531 }),
532 };
533 result[@intFromEnum(Feature.experimental_xqcili)] = .{
534 .llvm_name = "experimental-xqcili",
535 .description = "'Xqcili' (Qualcomm uC Load Large Immediate Extension)",
536 .dependencies = featureSet(&[_]Feature{
537 .zca,
538 }),
539 };
540 result[@intFromEnum(Feature.experimental_xqcilia)] = .{
541 .llvm_name = "experimental-xqcilia",
542 .description = "'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension)",
543 .dependencies = featureSet(&[_]Feature{
544 .zca,
545 }),
546 };
547 result[@intFromEnum(Feature.experimental_xqcilo)] = .{
548 .llvm_name = "experimental-xqcilo",
549 .description = "'Xqcilo' (Qualcomm uC Large Offset Load Store Extension)",
550 .dependencies = featureSet(&[_]Feature{
551 .zca,
552 }),
553 };
554 result[@intFromEnum(Feature.experimental_xqcilsm)] = .{
555 .llvm_name = "experimental-xqcilsm",
556 .description = "'Xqcilsm' (Qualcomm uC Load Store Multiple Extension)",
557 .dependencies = featureSet(&[_]Feature{}),
558 };
559 result[@intFromEnum(Feature.experimental_xqcisim)] = .{
560 .llvm_name = "experimental-xqcisim",
561 .description = "'Xqcisim' (Qualcomm uC Simulation Hint Extension)",
562 .dependencies = featureSet(&[_]Feature{
563 .zca,
564 }),
565 };
566 result[@intFromEnum(Feature.experimental_xqcisls)] = .{
567 .llvm_name = "experimental-xqcisls",
568 .description = "'Xqcisls' (Qualcomm uC Scaled Load Store Extension)",
569 .dependencies = featureSet(&[_]Feature{}),
570 };
571 result[@intFromEnum(Feature.experimental_xqcisync)] = .{
572 .llvm_name = "experimental-xqcisync",
573 .description = "'Xqcisync' (Qualcomm uC Sync Delay Extension)",
574 .dependencies = featureSet(&[_]Feature{
575 .zca,
576 }),
577 };
578 result[@intFromEnum(Feature.experimental_xrivosvisni)] = .{525 result[@intFromEnum(Feature.experimental_xrivosvisni)] = .{
579 .llvm_name = "experimental-xrivosvisni",526 .llvm_name = "experimental-xrivosvisni",
580 .description = "'XRivosVisni' (Rivos Vector Integer Small New)",527 .description = "'XRivosVisni' (Rivos Vector Integer Small New)",
...@@ -595,9 +542,9 @@ pub const all_features = blk: {...@@ -595,9 +542,9 @@ pub const all_features = blk: {
595 .description = "'XSfsclic' (SiFive CLIC Supervisor-mode CSRs)",542 .description = "'XSfsclic' (SiFive CLIC Supervisor-mode CSRs)",
596 .dependencies = featureSet(&[_]Feature{}),543 .dependencies = featureSet(&[_]Feature{}),
597 };544 };
598 result[@intFromEnum(Feature.experimental_zalasr)] = .{545 result[@intFromEnum(Feature.experimental_zibi)] = .{
599 .llvm_name = "experimental-zalasr",546 .llvm_name = "experimental-zibi",
600 .description = "'Zalasr' (Load-Acquire and Store-Release Instructions)",547 .description = "'Zibi' (Branch with Immediate)",
601 .dependencies = featureSet(&[_]Feature{}),548 .dependencies = featureSet(&[_]Feature{}),
602 };549 };
603 result[@intFromEnum(Feature.experimental_zicfilp)] = .{550 result[@intFromEnum(Feature.experimental_zicfilp)] = .{
...@@ -622,6 +569,21 @@ pub const all_features = blk: {...@@ -622,6 +569,21 @@ pub const all_features = blk: {
622 .zve32x,569 .zve32x,
623 }),570 }),
624 };571 };
572 result[@intFromEnum(Feature.experimental_zvfbfa)] = .{
573 .llvm_name = "experimental-zvfbfa",
574 .description = "'Zvfbfa' (Additional BF16 vector compute support)",
575 .dependencies = featureSet(&[_]Feature{
576 .zfbfmin,
577 .zve32f,
578 }),
579 };
580 result[@intFromEnum(Feature.experimental_zvfofp8min)] = .{
581 .llvm_name = "experimental-zvfofp8min",
582 .description = "'Zvfofp8min' (Vector OFP8 Converts)",
583 .dependencies = featureSet(&[_]Feature{
584 .zve32f,
585 }),
586 };
625 result[@intFromEnum(Feature.experimental_zvkgs)] = .{587 result[@intFromEnum(Feature.experimental_zvkgs)] = .{
626 .llvm_name = "experimental-zvkgs",588 .llvm_name = "experimental-zvkgs",
627 .description = "'Zvkgs' (Vector-Scalar GCM instructions for Cryptography)",589 .description = "'Zvkgs' (Vector-Scalar GCM instructions for Cryptography)",
...@@ -673,6 +635,11 @@ pub const all_features = blk: {...@@ -673,6 +635,11 @@ pub const all_features = blk: {
673 .description = "Enable LUI+ADDI macro fusion",635 .description = "Enable LUI+ADDI macro fusion",
674 .dependencies = featureSet(&[_]Feature{}),636 .dependencies = featureSet(&[_]Feature{}),
675 };637 };
638 result[@intFromEnum(Feature.lui_load_fusion)] = .{
639 .llvm_name = "lui-load-fusion",
640 .description = "Enable LUI + load macrofusion",
641 .dependencies = featureSet(&[_]Feature{}),
642 };
676 result[@intFromEnum(Feature.m)] = .{643 result[@intFromEnum(Feature.m)] = .{
677 .llvm_name = "m",644 .llvm_name = "m",
678 .description = "'M' (Integer Multiplication and Division)",645 .description = "'M' (Integer Multiplication and Division)",
...@@ -740,6 +707,11 @@ pub const all_features = blk: {...@@ -740,6 +707,11 @@ pub const all_features = blk: {
740 .description = "Optimized (perform fewer memory operations)zero-stride vector load",707 .description = "Optimized (perform fewer memory operations)zero-stride vector load",
741 .dependencies = featureSet(&[_]Feature{}),708 .dependencies = featureSet(&[_]Feature{}),
742 };709 };
710 result[@intFromEnum(Feature.permissive_zalrsc)] = .{
711 .llvm_name = "permissive-zalrsc",
712 .description = "Implementation permits non-base instructions between LR/SC pairs",
713 .dependencies = featureSet(&[_]Feature{}),
714 };
743 result[@intFromEnum(Feature.predictable_select_expensive)] = .{715 result[@intFromEnum(Feature.predictable_select_expensive)] = .{
744 .llvm_name = "predictable-select-expensive",716 .llvm_name = "predictable-select-expensive",
745 .description = "Prefer likely predicted branches over selects",717 .description = "Prefer likely predicted branches over selects",
...@@ -1262,11 +1234,32 @@ pub const all_features = blk: {...@@ -1262,11 +1234,32 @@ pub const all_features = blk: {
1262 .description = "'Shlcofideleg' (Delegating LCOFI Interrupts to VS-mode)",1234 .description = "'Shlcofideleg' (Delegating LCOFI Interrupts to VS-mode)",
1263 .dependencies = featureSet(&[_]Feature{}),1235 .dependencies = featureSet(&[_]Feature{}),
1264 };1236 };
1265 result[@intFromEnum(Feature.short_forward_branch_opt)] = .{1237 result[@intFromEnum(Feature.short_forward_branch_ialu)] = .{
1266 .llvm_name = "short-forward-branch-opt",1238 .llvm_name = "short-forward-branch-ialu",
1267 .description = "Enable short forward branch optimization",1239 .description = "Enable short forward branch optimization for RVI base instructions",
1268 .dependencies = featureSet(&[_]Feature{}),1240 .dependencies = featureSet(&[_]Feature{}),
1269 };1241 };
1242 result[@intFromEnum(Feature.short_forward_branch_iload)] = .{
1243 .llvm_name = "short-forward-branch-iload",
1244 .description = "Enable short forward branch optimization for load instructions",
1245 .dependencies = featureSet(&[_]Feature{
1246 .short_forward_branch_ialu,
1247 }),
1248 };
1249 result[@intFromEnum(Feature.short_forward_branch_iminmax)] = .{
1250 .llvm_name = "short-forward-branch-iminmax",
1251 .description = "Enable short forward branch optimization for MIN,MAX instructions in Zbb",
1252 .dependencies = featureSet(&[_]Feature{
1253 .short_forward_branch_ialu,
1254 }),
1255 };
1256 result[@intFromEnum(Feature.short_forward_branch_imul)] = .{
1257 .llvm_name = "short-forward-branch-imul",
1258 .description = "Enable short forward branch optimization for MUL instruction",
1259 .dependencies = featureSet(&[_]Feature{
1260 .short_forward_branch_ialu,
1261 }),
1262 };
1270 result[@intFromEnum(Feature.shtvala)] = .{1263 result[@intFromEnum(Feature.shtvala)] = .{
1271 .llvm_name = "shtvala",1264 .llvm_name = "shtvala",
1272 .description = "'Shtvala' (htval provides all needed values)",1265 .description = "'Shtvala' (htval provides all needed values)",
...@@ -1287,6 +1280,16 @@ pub const all_features = blk: {...@@ -1287,6 +1280,16 @@ pub const all_features = blk: {
1287 .description = "'Shvstvecd' (vstvec supports Direct mode)",1280 .description = "'Shvstvecd' (vstvec supports Direct mode)",
1288 .dependencies = featureSet(&[_]Feature{}),1281 .dependencies = featureSet(&[_]Feature{}),
1289 };1282 };
1283 result[@intFromEnum(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[@intFromEnum(Feature.single_element_vec_fp64)] = .{
1289 .llvm_name = "single-element-vec-fp64",
1290 .description = "Certain vector FP64 operations produce a single result element per cycle",
1291 .dependencies = featureSet(&[_]Feature{}),
1292 };
1290 result[@intFromEnum(Feature.smaia)] = .{1293 result[@intFromEnum(Feature.smaia)] = .{
1291 .llvm_name = "smaia",1294 .llvm_name = "smaia",
1292 .description = "'Smaia' (Advanced Interrupt Architecture Machine Level)",1295 .description = "'Smaia' (Advanced Interrupt Architecture Machine Level)",
...@@ -1307,6 +1310,13 @@ pub const all_features = blk: {...@@ -1307,6 +1310,13 @@ pub const all_features = blk: {
1307 .description = "'Smcsrind' (Indirect CSR Access Machine Level)",1310 .description = "'Smcsrind' (Indirect CSR Access Machine Level)",
1308 .dependencies = featureSet(&[_]Feature{}),1311 .dependencies = featureSet(&[_]Feature{}),
1309 };1312 };
1313 result[@intFromEnum(Feature.smctr)] = .{
1314 .llvm_name = "smctr",
1315 .description = "'Smctr' (Control Transfer Records Machine Level)",
1316 .dependencies = featureSet(&[_]Feature{
1317 .sscsrind,
1318 }),
1319 };
1310 result[@intFromEnum(Feature.smdbltrp)] = .{1320 result[@intFromEnum(Feature.smdbltrp)] = .{
1311 .llvm_name = "smdbltrp",1321 .llvm_name = "smdbltrp",
1312 .description = "'Smdbltrp' (Double Trap Machine Level)",1322 .description = "'Smdbltrp' (Double Trap Machine Level)",
...@@ -1369,6 +1379,13 @@ pub const all_features = blk: {...@@ -1369,6 +1379,13 @@ pub const all_features = blk: {
1369 .description = "'Sscsrind' (Indirect CSR Access Supervisor Level)",1379 .description = "'Sscsrind' (Indirect CSR Access Supervisor Level)",
1370 .dependencies = featureSet(&[_]Feature{}),1380 .dependencies = featureSet(&[_]Feature{}),
1371 };1381 };
1382 result[@intFromEnum(Feature.ssctr)] = .{
1383 .llvm_name = "ssctr",
1384 .description = "'Ssctr' (Control Transfer Records Supervisor Level)",
1385 .dependencies = featureSet(&[_]Feature{
1386 .sscsrind,
1387 }),
1388 };
1372 result[@intFromEnum(Feature.ssdbltrp)] = .{1389 result[@intFromEnum(Feature.ssdbltrp)] = .{
1373 .llvm_name = "ssdbltrp",1390 .llvm_name = "ssdbltrp",
1374 .description = "'Ssdbltrp' (Double Trap Supervisor Level)",1391 .description = "'Ssdbltrp' (Double Trap Supervisor Level)",
...@@ -1537,6 +1554,13 @@ pub const all_features = blk: {...@@ -1537,6 +1554,13 @@ pub const all_features = blk: {
1537 .f,1554 .f,
1538 }),1555 }),
1539 };1556 };
1557 result[@intFromEnum(Feature.xandesvsinth)] = .{
1558 .llvm_name = "xandesvsinth",
1559 .description = "'XAndesVSIntH' (Andes Vector Small INT Handling Extension)",
1560 .dependencies = featureSet(&[_]Feature{
1561 .zve32x,
1562 }),
1563 };
1540 result[@intFromEnum(Feature.xandesvsintload)] = .{1564 result[@intFromEnum(Feature.xandesvsintload)] = .{
1541 .llvm_name = "xandesvsintload",1565 .llvm_name = "xandesvsintload",
1542 .description = "'XAndesVSIntLoad' (Andes Vector INT4 Load Extension)",1566 .description = "'XAndesVSIntLoad' (Andes Vector INT4 Load Extension)",
...@@ -1589,11 +1613,159 @@ pub const all_features = blk: {...@@ -1589,11 +1613,159 @@ pub const all_features = blk: {
1589 .description = "'XMIPSCMov' (MIPS conditional move instruction (mips.ccmov))",1613 .description = "'XMIPSCMov' (MIPS conditional move instruction (mips.ccmov))",
1590 .dependencies = featureSet(&[_]Feature{}),1614 .dependencies = featureSet(&[_]Feature{}),
1591 };1615 };
1616 result[@intFromEnum(Feature.xmipsexectl)] = .{
1617 .llvm_name = "xmipsexectl",
1618 .description = "'XMIPSEXECTL' (MIPS execution control)",
1619 .dependencies = featureSet(&[_]Feature{}),
1620 };
1592 result[@intFromEnum(Feature.xmipslsp)] = .{1621 result[@intFromEnum(Feature.xmipslsp)] = .{
1593 .llvm_name = "xmipslsp",1622 .llvm_name = "xmipslsp",
1594 .description = "'XMIPSLSP' (MIPS optimization for hardware load-store bonding)",1623 .description = "'XMIPSLSP' (MIPS optimization for hardware load-store bonding)",
1595 .dependencies = featureSet(&[_]Feature{}),1624 .dependencies = featureSet(&[_]Feature{}),
1596 };1625 };
1626 result[@intFromEnum(Feature.xqccmp)] = .{
1627 .llvm_name = "xqccmp",
1628 .description = "'Xqccmp' (Qualcomm 16-bit Push/Pop and Double Moves)",
1629 .dependencies = featureSet(&[_]Feature{
1630 .zca,
1631 }),
1632 };
1633 result[@intFromEnum(Feature.xqci)] = .{
1634 .llvm_name = "xqci",
1635 .description = "'Xqci' (Qualcomm uC Extension)",
1636 .dependencies = featureSet(&[_]Feature{
1637 .xqcia,
1638 .xqciac,
1639 .xqcibi,
1640 .xqcibm,
1641 .xqcicli,
1642 .xqcicm,
1643 .xqcics,
1644 .xqcicsr,
1645 .xqciint,
1646 .xqciio,
1647 .xqcilb,
1648 .xqcili,
1649 .xqcilia,
1650 .xqcilo,
1651 .xqcilsm,
1652 .xqcisim,
1653 .xqcisls,
1654 .xqcisync,
1655 }),
1656 };
1657 result[@intFromEnum(Feature.xqcia)] = .{
1658 .llvm_name = "xqcia",
1659 .description = "'Xqcia' (Qualcomm uC Arithmetic Extension)",
1660 .dependencies = featureSet(&[_]Feature{}),
1661 };
1662 result[@intFromEnum(Feature.xqciac)] = .{
1663 .llvm_name = "xqciac",
1664 .description = "'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)",
1665 .dependencies = featureSet(&[_]Feature{
1666 .zca,
1667 }),
1668 };
1669 result[@intFromEnum(Feature.xqcibi)] = .{
1670 .llvm_name = "xqcibi",
1671 .description = "'Xqcibi' (Qualcomm uC Branch Immediate Extension)",
1672 .dependencies = featureSet(&[_]Feature{
1673 .zca,
1674 }),
1675 };
1676 result[@intFromEnum(Feature.xqcibm)] = .{
1677 .llvm_name = "xqcibm",
1678 .description = "'Xqcibm' (Qualcomm uC Bit Manipulation Extension)",
1679 .dependencies = featureSet(&[_]Feature{
1680 .zca,
1681 }),
1682 };
1683 result[@intFromEnum(Feature.xqcicli)] = .{
1684 .llvm_name = "xqcicli",
1685 .description = "'Xqcicli' (Qualcomm uC Conditional Load Immediate Extension)",
1686 .dependencies = featureSet(&[_]Feature{}),
1687 };
1688 result[@intFromEnum(Feature.xqcicm)] = .{
1689 .llvm_name = "xqcicm",
1690 .description = "'Xqcicm' (Qualcomm uC Conditional Move Extension)",
1691 .dependencies = featureSet(&[_]Feature{
1692 .zca,
1693 }),
1694 };
1695 result[@intFromEnum(Feature.xqcics)] = .{
1696 .llvm_name = "xqcics",
1697 .description = "'Xqcics' (Qualcomm uC Conditional Select Extension)",
1698 .dependencies = featureSet(&[_]Feature{}),
1699 };
1700 result[@intFromEnum(Feature.xqcicsr)] = .{
1701 .llvm_name = "xqcicsr",
1702 .description = "'Xqcicsr' (Qualcomm uC CSR Extension)",
1703 .dependencies = featureSet(&[_]Feature{}),
1704 };
1705 result[@intFromEnum(Feature.xqciint)] = .{
1706 .llvm_name = "xqciint",
1707 .description = "'Xqciint' (Qualcomm uC Interrupts Extension)",
1708 .dependencies = featureSet(&[_]Feature{
1709 .zca,
1710 }),
1711 };
1712 result[@intFromEnum(Feature.xqciio)] = .{
1713 .llvm_name = "xqciio",
1714 .description = "'Xqciio' (Qualcomm uC External Input Output Extension)",
1715 .dependencies = featureSet(&[_]Feature{}),
1716 };
1717 result[@intFromEnum(Feature.xqcilb)] = .{
1718 .llvm_name = "xqcilb",
1719 .description = "'Xqcilb' (Qualcomm uC Long Branch Extension)",
1720 .dependencies = featureSet(&[_]Feature{
1721 .zca,
1722 }),
1723 };
1724 result[@intFromEnum(Feature.xqcili)] = .{
1725 .llvm_name = "xqcili",
1726 .description = "'Xqcili' (Qualcomm uC Load Large Immediate Extension)",
1727 .dependencies = featureSet(&[_]Feature{
1728 .zca,
1729 }),
1730 };
1731 result[@intFromEnum(Feature.xqcilia)] = .{
1732 .llvm_name = "xqcilia",
1733 .description = "'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension)",
1734 .dependencies = featureSet(&[_]Feature{
1735 .zca,
1736 }),
1737 };
1738 result[@intFromEnum(Feature.xqcilo)] = .{
1739 .llvm_name = "xqcilo",
1740 .description = "'Xqcilo' (Qualcomm uC Large Offset Load Store Extension)",
1741 .dependencies = featureSet(&[_]Feature{
1742 .zca,
1743 }),
1744 };
1745 result[@intFromEnum(Feature.xqcilsm)] = .{
1746 .llvm_name = "xqcilsm",
1747 .description = "'Xqcilsm' (Qualcomm uC Load Store Multiple Extension)",
1748 .dependencies = featureSet(&[_]Feature{}),
1749 };
1750 result[@intFromEnum(Feature.xqcisim)] = .{
1751 .llvm_name = "xqcisim",
1752 .description = "'Xqcisim' (Qualcomm uC Simulation Hint Extension)",
1753 .dependencies = featureSet(&[_]Feature{
1754 .zca,
1755 }),
1756 };
1757 result[@intFromEnum(Feature.xqcisls)] = .{
1758 .llvm_name = "xqcisls",
1759 .description = "'Xqcisls' (Qualcomm uC Scaled Load Store Extension)",
1760 .dependencies = featureSet(&[_]Feature{}),
1761 };
1762 result[@intFromEnum(Feature.xqcisync)] = .{
1763 .llvm_name = "xqcisync",
1764 .description = "'Xqcisync' (Qualcomm uC Sync Delay Extension)",
1765 .dependencies = featureSet(&[_]Feature{
1766 .zca,
1767 }),
1768 };
1597 result[@intFromEnum(Feature.xsfcease)] = .{1769 result[@intFromEnum(Feature.xsfcease)] = .{
1598 .llvm_name = "xsfcease",1770 .llvm_name = "xsfcease",
1599 .description = "'XSfcease' (SiFive sf.cease Instruction)",1771 .description = "'XSfcease' (SiFive sf.cease Instruction)",
...@@ -1684,6 +1856,40 @@ pub const all_features = blk: {...@@ -1684,6 +1856,40 @@ pub const all_features = blk: {
1684 .zve32x,1856 .zve32x,
1685 }),1857 }),
1686 };1858 };
1859 result[@intFromEnum(Feature.xsfvfbfexp16e)] = .{
1860 .llvm_name = "xsfvfbfexp16e",
1861 .description = "'XSfvfbfexp16e' (SiFive Vector Floating-Point Exponential Function Instruction, BFloat16)",
1862 .dependencies = featureSet(&[_]Feature{}),
1863 };
1864 result[@intFromEnum(Feature.xsfvfexp16e)] = .{
1865 .llvm_name = "xsfvfexp16e",
1866 .description = "'XSfvfexp16e' (SiFive Vector Floating-Point Exponential Function Instruction, Half Precision)",
1867 .dependencies = featureSet(&[_]Feature{
1868 .zvfh,
1869 }),
1870 };
1871 result[@intFromEnum(Feature.xsfvfexp32e)] = .{
1872 .llvm_name = "xsfvfexp32e",
1873 .description = "'XSfvfexp32e' (SiFive Vector Floating-Point Exponential Function Instruction, Single Precision)",
1874 .dependencies = featureSet(&[_]Feature{
1875 .zve32f,
1876 }),
1877 };
1878 result[@intFromEnum(Feature.xsfvfexpa)] = .{
1879 .llvm_name = "xsfvfexpa",
1880 .description = "'XSfvfexpa' (SiFive Vector Floating-Point Exponential Approximation Instruction)",
1881 .dependencies = featureSet(&[_]Feature{
1882 .zve32f,
1883 }),
1884 };
1885 result[@intFromEnum(Feature.xsfvfexpa64e)] = .{
1886 .llvm_name = "xsfvfexpa64e",
1887 .description = "'XSfvfexpa64e' (SiFive Vector Floating-Point Exponential Approximation Instruction with Double-Precision)",
1888 .dependencies = featureSet(&[_]Feature{
1889 .xsfvfexpa,
1890 .zve64d,
1891 }),
1892 };
1687 result[@intFromEnum(Feature.xsfvfnrclipxfqf)] = .{1893 result[@intFromEnum(Feature.xsfvfnrclipxfqf)] = .{
1688 .llvm_name = "xsfvfnrclipxfqf",1894 .llvm_name = "xsfvfnrclipxfqf",
1689 .description = "'XSfvfnrclipxfqf' (SiFive FP32-to-int8 Ranged Clip Instructions)",1895 .description = "'XSfvfnrclipxfqf' (SiFive FP32-to-int8 Ranged Clip Instructions)",
...@@ -1696,6 +1902,7 @@ pub const all_features = blk: {...@@ -1696,6 +1902,7 @@ pub const all_features = blk: {
1696 .description = "'XSfvfwmaccqqq' (SiFive Matrix Multiply Accumulate Instruction (4-by-4))",1902 .description = "'XSfvfwmaccqqq' (SiFive Matrix Multiply Accumulate Instruction (4-by-4))",
1697 .dependencies = featureSet(&[_]Feature{1903 .dependencies = featureSet(&[_]Feature{
1698 .zvfbfmin,1904 .zvfbfmin,
1905 .zvl128b,
1699 }),1906 }),
1700 };1907 };
1701 result[@intFromEnum(Feature.xsfvqmaccdod)] = .{1908 result[@intFromEnum(Feature.xsfvqmaccdod)] = .{
...@@ -1703,6 +1910,7 @@ pub const all_features = blk: {...@@ -1703,6 +1910,7 @@ pub const all_features = blk: {
1703 .description = "'XSfvqmaccdod' (SiFive Int8 Matrix Multiplication Instructions (2-by-8 and 8-by-2))",1910 .description = "'XSfvqmaccdod' (SiFive Int8 Matrix Multiplication Instructions (2-by-8 and 8-by-2))",
1704 .dependencies = featureSet(&[_]Feature{1911 .dependencies = featureSet(&[_]Feature{
1705 .zve32x,1912 .zve32x,
1913 .zvl128b,
1706 }),1914 }),
1707 };1915 };
1708 result[@intFromEnum(Feature.xsfvqmaccqoq)] = .{1916 result[@intFromEnum(Feature.xsfvqmaccqoq)] = .{
...@@ -1710,6 +1918,7 @@ pub const all_features = blk: {...@@ -1710,6 +1918,7 @@ pub const all_features = blk: {
1710 .description = "'XSfvqmaccqoq' (SiFive Int8 Matrix Multiplication Instructions (4-by-8 and 8-by-4))",1918 .description = "'XSfvqmaccqoq' (SiFive Int8 Matrix Multiplication Instructions (4-by-8 and 8-by-4))",
1711 .dependencies = featureSet(&[_]Feature{1919 .dependencies = featureSet(&[_]Feature{
1712 .zve32x,1920 .zve32x,
1921 .zvl256b,
1713 }),1922 }),
1714 };1923 };
1715 result[@intFromEnum(Feature.xsifivecdiscarddlone)] = .{1924 result[@intFromEnum(Feature.xsifivecdiscarddlone)] = .{
...@@ -1722,6 +1931,13 @@ pub const all_features = blk: {...@@ -1722,6 +1931,13 @@ pub const all_features = blk: {
1722 .description = "'XSiFivecflushdlone' (SiFive sf.cflush.d.l1 Instruction)",1931 .description = "'XSiFivecflushdlone' (SiFive sf.cflush.d.l1 Instruction)",
1723 .dependencies = featureSet(&[_]Feature{}),1932 .dependencies = featureSet(&[_]Feature{}),
1724 };1933 };
1934 result[@intFromEnum(Feature.xsmtvdot)] = .{
1935 .llvm_name = "xsmtvdot",
1936 .description = "'XSMTVDot' (SpacemiT Vector Dot Product Extension)",
1937 .dependencies = featureSet(&[_]Feature{
1938 .zve32f,
1939 }),
1940 };
1725 result[@intFromEnum(Feature.xtheadba)] = .{1941 result[@intFromEnum(Feature.xtheadba)] = .{
1726 .llvm_name = "xtheadba",1942 .llvm_name = "xtheadba",
1727 .description = "'XTHeadBa' (T-Head address calculation instructions)",1943 .description = "'XTHeadBa' (T-Head address calculation instructions)",
...@@ -1820,6 +2036,11 @@ pub const all_features = blk: {...@@ -1820,6 +2036,11 @@ pub const all_features = blk: {
1820 .zaamo,2036 .zaamo,
1821 }),2037 }),
1822 };2038 };
2039 result[@intFromEnum(Feature.zalasr)] = .{
2040 .llvm_name = "zalasr",
2041 .description = "'Zalasr' (Load-Acquire and Store-Release Instructions)",
2042 .dependencies = featureSet(&[_]Feature{}),
2043 };
1823 result[@intFromEnum(Feature.zalrsc)] = .{2044 result[@intFromEnum(Feature.zalrsc)] = .{
1824 .llvm_name = "zalrsc",2045 .llvm_name = "zalrsc",
1825 .description = "'Zalrsc' (Load-Reserved/Store-Conditional)",2046 .description = "'Zalrsc' (Load-Reserved/Store-Conditional)",
...@@ -2092,6 +2313,11 @@ pub const all_features = blk: {...@@ -2092,6 +2313,11 @@ pub const all_features = blk: {
2092 .description = "'Zilsd' (Load/Store Pair Instructions)",2313 .description = "'Zilsd' (Load/Store Pair Instructions)",
2093 .dependencies = featureSet(&[_]Feature{}),2314 .dependencies = featureSet(&[_]Feature{}),
2094 };2315 };
2316 result[@intFromEnum(Feature.zilsd_4byte_align)] = .{
2317 .llvm_name = "zilsd-4byte-align",
2318 .description = "Allow 4-byte alignment for Zilsd LD/SD instructions",
2319 .dependencies = featureSet(&[_]Feature{}),
2320 };
2095 result[@intFromEnum(Feature.zimop)] = .{2321 result[@intFromEnum(Feature.zimop)] = .{
2096 .llvm_name = "zimop",2322 .llvm_name = "zimop",
2097 .description = "'Zimop' (May-Be-Operations)",2323 .description = "'Zimop' (May-Be-Operations)",
...@@ -2461,7 +2687,7 @@ pub const cpu = struct {...@@ -2461,7 +2687,7 @@ pub const cpu = struct {
2461 .features = featureSet(&[_]Feature{2687 .features = featureSet(&[_]Feature{
2462 .andes45,2688 .andes45,
2463 .no_default_unroll,2689 .no_default_unroll,
2464 .short_forward_branch_opt,2690 .short_forward_branch_ialu,
2465 .use_postra_scheduler,2691 .use_postra_scheduler,
2466 }),2692 }),
2467 };2693 };
...@@ -2491,7 +2717,7 @@ pub const cpu = struct {...@@ -2491,7 +2717,7 @@ pub const cpu = struct {
2491 .i,2717 .i,
2492 .m,2718 .m,
2493 .no_default_unroll,2719 .no_default_unroll,
2494 .short_forward_branch_opt,2720 .short_forward_branch_ialu,
2495 .use_postra_scheduler,2721 .use_postra_scheduler,
2496 .xandesperf,2722 .xandesperf,
2497 .zifencei,2723 .zifencei,
...@@ -2523,7 +2749,7 @@ pub const cpu = struct {...@@ -2523,7 +2749,7 @@ pub const cpu = struct {
2523 .i,2749 .i,
2524 .m,2750 .m,
2525 .no_default_unroll,2751 .no_default_unroll,
2526 .short_forward_branch_opt,2752 .short_forward_branch_ialu,
2527 .use_postra_scheduler,2753 .use_postra_scheduler,
2528 .xandesperf,2754 .xandesperf,
2529 .zifencei,2755 .zifencei,
...@@ -2540,7 +2766,7 @@ pub const cpu = struct {...@@ -2540,7 +2766,7 @@ pub const cpu = struct {
2540 .i,2766 .i,
2541 .m,2767 .m,
2542 .no_default_unroll,2768 .no_default_unroll,
2543 .short_forward_branch_opt,2769 .short_forward_branch_ialu,
2544 .use_postra_scheduler,2770 .use_postra_scheduler,
2545 .v,2771 .v,
2546 .xandesperf,2772 .xandesperf,
...@@ -2559,7 +2785,7 @@ pub const cpu = struct {...@@ -2559,7 +2785,7 @@ pub const cpu = struct {
2559 .i,2785 .i,
2560 .m,2786 .m,
2561 .no_default_unroll,2787 .no_default_unroll,
2562 .short_forward_branch_opt,2788 .short_forward_branch_ialu,
2563 .use_postra_scheduler,2789 .use_postra_scheduler,
2564 .xandesperf,2790 .xandesperf,
2565 .zifencei,2791 .zifencei,
...@@ -2577,7 +2803,7 @@ pub const cpu = struct {...@@ -2577,7 +2803,7 @@ pub const cpu = struct {
2577 .i,2803 .i,
2578 .m,2804 .m,
2579 .no_default_unroll,2805 .no_default_unroll,
2580 .short_forward_branch_opt,2806 .short_forward_branch_ialu,
2581 .use_postra_scheduler,2807 .use_postra_scheduler,
2582 .xandesperf,2808 .xandesperf,
2583 .zifencei,2809 .zifencei,
...@@ -2648,6 +2874,7 @@ pub const cpu = struct {...@@ -2648,6 +2874,7 @@ pub const cpu = struct {
2648 .mips_p8700,2874 .mips_p8700,
2649 .xmipscbop,2875 .xmipscbop,
2650 .xmipscmov,2876 .xmipscmov,
2877 .xmipsexectl,
2651 .xmipslsp,2878 .xmipslsp,
2652 .zba,2879 .zba,
2653 .zbb,2880 .zbb,
...@@ -2703,7 +2930,7 @@ pub const cpu = struct {...@@ -2703,7 +2930,7 @@ pub const cpu = struct {
2703 .llvm_name = "sifive-7-series",2930 .llvm_name = "sifive-7-series",
2704 .features = featureSet(&[_]Feature{2931 .features = featureSet(&[_]Feature{
2705 .no_default_unroll,2932 .no_default_unroll,
2706 .short_forward_branch_opt,2933 .short_forward_branch_ialu,
2707 .use_postra_scheduler,2934 .use_postra_scheduler,
2708 }),2935 }),
2709 };2936 };
...@@ -2782,7 +3009,7 @@ pub const cpu = struct {...@@ -2782,7 +3009,7 @@ pub const cpu = struct {
2782 .i,3009 .i,
2783 .m,3010 .m,
2784 .no_default_unroll,3011 .no_default_unroll,
2785 .short_forward_branch_opt,3012 .short_forward_branch_ialu,
2786 .use_postra_scheduler,3013 .use_postra_scheduler,
2787 .zifencei,3014 .zifencei,
2788 }),3015 }),
...@@ -2815,7 +3042,6 @@ pub const cpu = struct {...@@ -2815,7 +3042,6 @@ pub const cpu = struct {
2815 .ziccif,3042 .ziccif,
2816 .zicclsm,3043 .zicclsm,
2817 .ziccrse,3044 .ziccrse,
2818 .zicntr,
2819 .zifencei,3045 .zifencei,
2820 .zihintntl,3046 .zihintntl,
2821 .zihintpause,3047 .zihintpause,
...@@ -2855,7 +3081,6 @@ pub const cpu = struct {...@@ -2855,7 +3081,6 @@ pub const cpu = struct {
2855 .ziccif,3081 .ziccif,
2856 .zicclsm,3082 .zicclsm,
2857 .ziccrse,3083 .ziccrse,
2858 .zicntr,
2859 .zifencei,3084 .zifencei,
2860 .zihintntl,3085 .zihintntl,
2861 .zihintpause,3086 .zihintpause,
...@@ -2918,7 +3143,6 @@ pub const cpu = struct {...@@ -2918,7 +3143,6 @@ pub const cpu = struct {
2918 .ziccif,3143 .ziccif,
2919 .zicclsm,3144 .zicclsm,
2920 .ziccrse,3145 .ziccrse,
2921 .zicntr,
2922 .zifencei,3146 .zifencei,
2923 .zihintntl,3147 .zihintntl,
2924 .zihintpause,3148 .zihintpause,
...@@ -3035,7 +3259,7 @@ pub const cpu = struct {...@@ -3035,7 +3259,7 @@ pub const cpu = struct {
3035 .i,3259 .i,
3036 .m,3260 .m,
3037 .no_default_unroll,3261 .no_default_unroll,
3038 .short_forward_branch_opt,3262 .short_forward_branch_ialu,
3039 .use_postra_scheduler,3263 .use_postra_scheduler,
3040 .zifencei,3264 .zifencei,
3041 .zihintpause,3265 .zihintpause,
...@@ -3065,7 +3289,7 @@ pub const cpu = struct {...@@ -3065,7 +3289,7 @@ pub const cpu = struct {
3065 .i,3289 .i,
3066 .m,3290 .m,
3067 .no_default_unroll,3291 .no_default_unroll,
3068 .short_forward_branch_opt,3292 .short_forward_branch_ialu,
3069 .use_postra_scheduler,3293 .use_postra_scheduler,
3070 .zifencei,3294 .zifencei,
3071 }),3295 }),
...@@ -3083,7 +3307,7 @@ pub const cpu = struct {...@@ -3083,7 +3307,7 @@ pub const cpu = struct {
3083 .no_default_unroll,3307 .no_default_unroll,
3084 .optimized_nf2_segment_load_store,3308 .optimized_nf2_segment_load_store,
3085 .optimized_zero_stride_load,3309 .optimized_zero_stride_load,
3086 .short_forward_branch_opt,3310 .short_forward_branch_ialu,
3087 .use_postra_scheduler,3311 .use_postra_scheduler,
3088 .v,3312 .v,
3089 .vl_dependent_latency,3313 .vl_dependent_latency,
...@@ -3111,7 +3335,8 @@ pub const cpu = struct {...@@ -3111,7 +3335,8 @@ pub const cpu = struct {
3111 .no_default_unroll,3335 .no_default_unroll,
3112 .optimized_nf2_segment_load_store,3336 .optimized_nf2_segment_load_store,
3113 .optimized_zero_stride_load,3337 .optimized_zero_stride_load,
3114 .short_forward_branch_opt,3338 .short_forward_branch_ialu,
3339 .single_element_vec_fp64,
3115 .use_postra_scheduler,3340 .use_postra_scheduler,
3116 .v,3341 .v,
3117 .vl_dependent_latency,3342 .vl_dependent_latency,
...@@ -3173,6 +3398,7 @@ pub const cpu = struct {...@@ -3173,6 +3398,7 @@ pub const cpu = struct {
3173 .unaligned_scalar_mem,3398 .unaligned_scalar_mem,
3174 .v,3399 .v,
3175 .vxrm_pipeline_flush,3400 .vxrm_pipeline_flush,
3401 .xsmtvdot,
3176 .za64rs,3402 .za64rs,
3177 .zbc,3403 .zbc,
3178 .zbkc,3404 .zbkc,
...@@ -3341,6 +3567,13 @@ pub const cpu = struct {...@@ -3341,6 +3567,13 @@ pub const cpu = struct {
3341 .log_vrgather,3567 .log_vrgather,
3342 .m,3568 .m,
3343 .no_default_unroll,3569 .no_default_unroll,
3570 .optimized_nf2_segment_load_store,
3571 .optimized_nf3_segment_load_store,
3572 .optimized_nf4_segment_load_store,
3573 .optimized_nf5_segment_load_store,
3574 .optimized_nf6_segment_load_store,
3575 .optimized_nf7_segment_load_store,
3576 .optimized_nf8_segment_load_store,
3344 .optimized_zero_stride_load,3577 .optimized_zero_stride_load,
3345 .sha,3578 .sha,
3346 .smaia,3579 .smaia,
...@@ -3400,12 +3633,17 @@ pub const cpu = struct {...@@ -3400,12 +3633,17 @@ pub const cpu = struct {
3400 .features = featureSet(&[_]Feature{3633 .features = featureSet(&[_]Feature{
3401 .@"64bit",3634 .@"64bit",
3402 .a,3635 .a,
3636 .add_load_fusion,
3403 .auipc_addi_fusion,3637 .auipc_addi_fusion,
3638 .auipc_load_fusion,
3404 .c,3639 .c,
3405 .d,3640 .d,
3641 .disable_misched_load_clustering,
3642 .disable_postmisched_load_clustering,
3643 .disable_postmisched_store_clustering,
3406 .i,3644 .i,
3407 .ld_add_fusion,
3408 .lui_addi_fusion,3645 .lui_addi_fusion,
3646 .lui_load_fusion,
3409 .m,3647 .m,
3410 .shifted_zextw_fusion,3648 .shifted_zextw_fusion,
3411 .ventana_veyron,3649 .ventana_veyron,
lib/std/Target/sparc.zig+17
...@@ -5,6 +5,7 @@ const CpuFeature = std.Target.Cpu.Feature;...@@ -5,6 +5,7 @@ const CpuFeature = std.Target.Cpu.Feature;
5const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
66
7pub const Feature = enum {7pub const Feature = enum {
8 @"64bit",
8 crypto,9 crypto,
9 deprecated_v8,10 deprecated_v8,
10 detectroundchange,11 detectroundchange,
...@@ -23,6 +24,7 @@ pub const Feature = enum {...@@ -23,6 +24,7 @@ pub const Feature = enum {
23 leonpwrpsr,24 leonpwrpsr,
24 no_fmuls,25 no_fmuls,
25 no_fsmuld,26 no_fsmuld,
27 no_predictor,
26 osa2011,28 osa2011,
27 popc,29 popc,
28 reserve_g1,30 reserve_g1,
...@@ -73,6 +75,13 @@ pub const all_features = blk: {...@@ -73,6 +75,13 @@ pub const all_features = blk: {
73 const len = @typeInfo(Feature).@"enum".fields.len;75 const len = @typeInfo(Feature).@"enum".fields.len;
74 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);76 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
75 var result: [len]CpuFeature = undefined;77 var result: [len]CpuFeature = undefined;
78 result[@intFromEnum(Feature.@"64bit")] = .{
79 .llvm_name = "64bit",
80 .description = "Enable 64-bit mode",
81 .dependencies = featureSet(&[_]Feature{
82 .v9,
83 }),
84 };
76 result[@intFromEnum(Feature.crypto)] = .{85 result[@intFromEnum(Feature.crypto)] = .{
77 .llvm_name = "crypto",86 .llvm_name = "crypto",
78 .description = "Enable cryptographic extensions",87 .description = "Enable cryptographic extensions",
...@@ -165,6 +174,11 @@ pub const all_features = blk: {...@@ -165,6 +174,11 @@ pub const all_features = blk: {
165 .description = "Disable the fsmuld instruction.",174 .description = "Disable the fsmuld instruction.",
166 .dependencies = featureSet(&[_]Feature{}),175 .dependencies = featureSet(&[_]Feature{}),
167 };176 };
177 result[@intFromEnum(Feature.no_predictor)] = .{
178 .llvm_name = "no-predictor",
179 .description = "Processor has no branch predictor, branches stall execution",
180 .dependencies = featureSet(&[_]Feature{}),
181 };
168 result[@intFromEnum(Feature.osa2011)] = .{182 result[@intFromEnum(Feature.osa2011)] = .{
169 .llvm_name = "osa2011",183 .llvm_name = "osa2011",
170 .description = "Enable Oracle SPARC Architecture 2011 extensions",184 .description = "Enable Oracle SPARC Architecture 2011 extensions",
...@@ -586,6 +600,7 @@ pub const cpu = struct {...@@ -586,6 +600,7 @@ pub const cpu = struct {
586 .llvm_name = "niagara",600 .llvm_name = "niagara",
587 .features = featureSet(&[_]Feature{601 .features = featureSet(&[_]Feature{
588 .deprecated_v8,602 .deprecated_v8,
603 .no_predictor,
589 .ua2005,604 .ua2005,
590 }),605 }),
591 };606 };
...@@ -594,6 +609,7 @@ pub const cpu = struct {...@@ -594,6 +609,7 @@ pub const cpu = struct {
594 .llvm_name = "niagara2",609 .llvm_name = "niagara2",
595 .features = featureSet(&[_]Feature{610 .features = featureSet(&[_]Feature{
596 .deprecated_v8,611 .deprecated_v8,
612 .no_predictor,
597 .popc,613 .popc,
598 .ua2005,614 .ua2005,
599 }),615 }),
...@@ -603,6 +619,7 @@ pub const cpu = struct {...@@ -603,6 +619,7 @@ pub const cpu = struct {
603 .llvm_name = "niagara3",619 .llvm_name = "niagara3",
604 .features = featureSet(&[_]Feature{620 .features = featureSet(&[_]Feature{
605 .deprecated_v8,621 .deprecated_v8,
622 .no_predictor,
606 .popc,623 .popc,
607 .ua2005,624 .ua2005,
608 .ua2007,625 .ua2007,
lib/std/Target/wasm.zig+7
...@@ -12,6 +12,7 @@ pub const Feature = enum {...@@ -12,6 +12,7 @@ pub const Feature = enum {
12 exception_handling,12 exception_handling,
13 extended_const,13 extended_const,
14 fp16,14 fp16,
15 gc,
15 multimemory,16 multimemory,
16 multivalue,17 multivalue,
17 mutable_globals,18 mutable_globals,
...@@ -71,6 +72,11 @@ pub const all_features = blk: {...@@ -71,6 +72,11 @@ pub const all_features = blk: {
71 .description = "Enable FP16 instructions",72 .description = "Enable FP16 instructions",
72 .dependencies = featureSet(&[_]Feature{}),73 .dependencies = featureSet(&[_]Feature{}),
73 };74 };
75 result[@intFromEnum(Feature.gc)] = .{
76 .llvm_name = "gc",
77 .description = "Enable wasm gc",
78 .dependencies = featureSet(&[_]Feature{}),
79 };
74 result[@intFromEnum(Feature.multimemory)] = .{80 result[@intFromEnum(Feature.multimemory)] = .{
75 .llvm_name = "multimemory",81 .llvm_name = "multimemory",
76 .description = "Enable multiple memories",82 .description = "Enable multiple memories",
...@@ -148,6 +154,7 @@ pub const cpu = struct {...@@ -148,6 +154,7 @@ pub const cpu = struct {
148 .exception_handling,154 .exception_handling,
149 .extended_const,155 .extended_const,
150 .fp16,156 .fp16,
157 .gc,
151 .multimemory,158 .multimemory,
152 .multivalue,159 .multivalue,
153 .mutable_globals,160 .mutable_globals,
lib/std/Target/x86.zig+200-31
...@@ -22,7 +22,6 @@ pub const Feature = enum {...@@ -22,7 +22,6 @@ pub const Feature = enum {
22 amx_movrs,22 amx_movrs,
23 amx_tf32,23 amx_tf32,
24 amx_tile,24 amx_tile,
25 amx_transpose,
26 avx,25 avx,
27 avx10_1,26 avx10_1,
28 avx10_2,27 avx10_2,
...@@ -67,7 +66,6 @@ pub const Feature = enum {...@@ -67,7 +66,6 @@ pub const Feature = enum {
67 egpr,66 egpr,
68 enqcmd,67 enqcmd,
69 ermsb,68 ermsb,
70 evex512,
71 f16c,69 f16c,
72 false_deps_getmant,70 false_deps_getmant,
73 false_deps_lzcnt_tzcnt,71 false_deps_lzcnt_tzcnt,
...@@ -136,6 +134,7 @@ pub const Feature = enum {...@@ -136,6 +134,7 @@ pub const Feature = enum {
136 ppx,134 ppx,
137 prefer_128_bit,135 prefer_128_bit,
138 prefer_256_bit,136 prefer_256_bit,
137 prefer_legacy_setcc,
139 prefer_mask_registers,138 prefer_mask_registers,
140 prefer_movmsk_over_vtest,139 prefer_movmsk_over_vtest,
141 prefer_no_gather,140 prefer_no_gather,
...@@ -168,6 +167,7 @@ pub const Feature = enum {...@@ -168,6 +167,7 @@ pub const Feature = enum {
168 slow_lea,167 slow_lea,
169 slow_pmaddwd,168 slow_pmaddwd,
170 slow_pmulld,169 slow_pmulld,
170 slow_pmullq,
171 slow_shld,171 slow_shld,
172 slow_two_mem_ops,172 slow_two_mem_ops,
173 slow_unaligned_mem_16,173 slow_unaligned_mem_16,
...@@ -199,6 +199,7 @@ pub const Feature = enum {...@@ -199,6 +199,7 @@ pub const Feature = enum {
199 waitpkg,199 waitpkg,
200 wbnoinvd,200 wbnoinvd,
201 widekl,201 widekl,
202 x32,
202 x87,203 x87,
203 xop,204 xop,
204 xsave,205 xsave,
...@@ -324,13 +325,6 @@ pub const all_features = blk: {...@@ -324,13 +325,6 @@ pub const all_features = blk: {
324 .description = "Support AMX-TILE instructions",325 .description = "Support AMX-TILE instructions",
325 .dependencies = featureSet(&[_]Feature{}),326 .dependencies = featureSet(&[_]Feature{}),
326 };327 };
327 result[@intFromEnum(Feature.amx_transpose)] = .{
328 .llvm_name = "amx-transpose",
329 .description = "Support AMX amx-transpose instructions",
330 .dependencies = featureSet(&[_]Feature{
331 .amx_tile,
332 }),
333 };
334 result[@intFromEnum(Feature.avx)] = .{328 result[@intFromEnum(Feature.avx)] = .{
335 .llvm_name = "avx",329 .llvm_name = "avx",
336 .description = "Enable AVX instructions",330 .description = "Enable AVX instructions",
...@@ -339,8 +333,8 @@ pub const all_features = blk: {...@@ -339,8 +333,8 @@ pub const all_features = blk: {
339 }),333 }),
340 };334 };
341 result[@intFromEnum(Feature.avx10_1)] = .{335 result[@intFromEnum(Feature.avx10_1)] = .{
342 .llvm_name = "avx10.1-512",336 .llvm_name = "avx10.1",
343 .description = "Support AVX10.1 up to 512-bit instruction",337 .description = "Support AVX10.1 instruction",
344 .dependencies = featureSet(&[_]Feature{338 .dependencies = featureSet(&[_]Feature{
345 .avx512bf16,339 .avx512bf16,
346 .avx512bitalg,340 .avx512bitalg,
...@@ -356,8 +350,8 @@ pub const all_features = blk: {...@@ -356,8 +350,8 @@ pub const all_features = blk: {
356 }),350 }),
357 };351 };
358 result[@intFromEnum(Feature.avx10_2)] = .{352 result[@intFromEnum(Feature.avx10_2)] = .{
359 .llvm_name = "avx10.2-512",353 .llvm_name = "avx10.2",
360 .description = "Support AVX10.2 up to 512-bit instruction",354 .description = "Support AVX10.2 instruction",
361 .dependencies = featureSet(&[_]Feature{355 .dependencies = featureSet(&[_]Feature{
362 .avx10_1,356 .avx10_1,
363 }),357 }),
...@@ -416,7 +410,6 @@ pub const all_features = blk: {...@@ -416,7 +410,6 @@ pub const all_features = blk: {
416 .description = "Enable AVX-512 instructions",410 .description = "Enable AVX-512 instructions",
417 .dependencies = featureSet(&[_]Feature{411 .dependencies = featureSet(&[_]Feature{
418 .avx2,412 .avx2,
419 .evex512,
420 .f16c,413 .f16c,
421 .fma,414 .fma,
422 }),415 }),
...@@ -616,11 +609,6 @@ pub const all_features = blk: {...@@ -616,11 +609,6 @@ pub const all_features = blk: {
616 .description = "REP MOVS/STOS are fast",609 .description = "REP MOVS/STOS are fast",
617 .dependencies = featureSet(&[_]Feature{}),610 .dependencies = featureSet(&[_]Feature{}),
618 };611 };
619 result[@intFromEnum(Feature.evex512)] = .{
620 .llvm_name = "evex512",
621 .description = "Support ZMM and 64-bit mask instructions",
622 .dependencies = featureSet(&[_]Feature{}),
623 };
624 result[@intFromEnum(Feature.f16c)] = .{612 result[@intFromEnum(Feature.f16c)] = .{
625 .llvm_name = "f16c",613 .llvm_name = "f16c",
626 .description = "Support 16-bit floating point conversion instructions",614 .description = "Support 16-bit floating point conversion instructions",
...@@ -974,6 +962,11 @@ pub const all_features = blk: {...@@ -974,6 +962,11 @@ pub const all_features = blk: {
974 .description = "Prefer 256-bit AVX instructions",962 .description = "Prefer 256-bit AVX instructions",
975 .dependencies = featureSet(&[_]Feature{}),963 .dependencies = featureSet(&[_]Feature{}),
976 };964 };
965 result[@intFromEnum(Feature.prefer_legacy_setcc)] = .{
966 .llvm_name = "prefer-legacy-setcc",
967 .description = "Prefer to emit legacy SetCC.",
968 .dependencies = featureSet(&[_]Feature{}),
969 };
977 result[@intFromEnum(Feature.prefer_mask_registers)] = .{970 result[@intFromEnum(Feature.prefer_mask_registers)] = .{
978 .llvm_name = "prefer-mask-registers",971 .llvm_name = "prefer-mask-registers",
979 .description = "Prefer AVX512 mask registers over PTEST/MOVMSK",972 .description = "Prefer AVX512 mask registers over PTEST/MOVMSK",
...@@ -1145,6 +1138,11 @@ pub const all_features = blk: {...@@ -1145,6 +1138,11 @@ pub const all_features = blk: {
1145 .description = "PMULLD instruction is slow (compared to PMULLW/PMULHW and PMULUDQ)",1138 .description = "PMULLD instruction is slow (compared to PMULLW/PMULHW and PMULUDQ)",
1146 .dependencies = featureSet(&[_]Feature{}),1139 .dependencies = featureSet(&[_]Feature{}),
1147 };1140 };
1141 result[@intFromEnum(Feature.slow_pmullq)] = .{
1142 .llvm_name = "slow-pmullq",
1143 .description = "PMULLQ instruction is slow",
1144 .dependencies = featureSet(&[_]Feature{}),
1145 };
1148 result[@intFromEnum(Feature.slow_shld)] = .{1146 result[@intFromEnum(Feature.slow_shld)] = .{
1149 .llvm_name = "slow-shld",1147 .llvm_name = "slow-shld",
1150 .description = "SHLD instruction is slow",1148 .description = "SHLD instruction is slow",
...@@ -1325,6 +1323,11 @@ pub const all_features = blk: {...@@ -1325,6 +1323,11 @@ pub const all_features = blk: {
1325 .kl,1323 .kl,
1326 }),1324 }),
1327 };1325 };
1326 result[@intFromEnum(Feature.x32)] = .{
1327 .llvm_name = "x32",
1328 .description = "64-bit with ILP32 programming model (e.g. x32 ABI)",
1329 .dependencies = featureSet(&[_]Feature{}),
1330 };
1328 result[@intFromEnum(Feature.x87)] = .{1331 result[@intFromEnum(Feature.x87)] = .{
1329 .llvm_name = "x87",1332 .llvm_name = "x87",
1330 .description = "Enable X87 float instructions",1333 .description = "Enable X87 float instructions",
...@@ -1393,7 +1396,6 @@ pub const cpu = struct {...@@ -1393,7 +1396,6 @@ pub const cpu = struct {
1393 .cx16,1396 .cx16,
1394 .f16c,1397 .f16c,
1395 .false_deps_perm,1398 .false_deps_perm,
1396 .false_deps_popcnt,
1397 .fast_15bytenop,1399 .fast_15bytenop,
1398 .fast_gather,1400 .fast_gather,
1399 .fast_scalar_fsqrt,1401 .fast_scalar_fsqrt,
...@@ -1432,6 +1434,7 @@ pub const cpu = struct {...@@ -1432,6 +1434,7 @@ pub const cpu = struct {
1432 .sha,1434 .sha,
1433 .shstk,1435 .shstk,
1434 .slow_3ops_lea,1436 .slow_3ops_lea,
1437 .slow_pmullq,
1435 .smap,1438 .smap,
1436 .smep,1439 .smep,
1437 .tuning_fast_imm_vector_shift,1440 .tuning_fast_imm_vector_shift,
...@@ -1490,7 +1493,6 @@ pub const cpu = struct {...@@ -1490,7 +1493,6 @@ pub const cpu = struct {
1490 .enqcmd,1493 .enqcmd,
1491 .f16c,1494 .f16c,
1492 .false_deps_perm,1495 .false_deps_perm,
1493 .false_deps_popcnt,
1494 .fast_15bytenop,1496 .fast_15bytenop,
1495 .fast_gather,1497 .fast_gather,
1496 .fast_scalar_fsqrt,1498 .fast_scalar_fsqrt,
...@@ -1529,6 +1531,7 @@ pub const cpu = struct {...@@ -1529,6 +1531,7 @@ pub const cpu = struct {
1529 .sha,1531 .sha,
1530 .shstk,1532 .shstk,
1531 .slow_3ops_lea,1533 .slow_3ops_lea,
1534 .slow_pmullq,
1532 .smap,1535 .smap,
1533 .smep,1536 .smep,
1534 .tuning_fast_imm_vector_shift,1537 .tuning_fast_imm_vector_shift,
...@@ -1566,7 +1569,6 @@ pub const cpu = struct {...@@ -1566,7 +1569,6 @@ pub const cpu = struct {
1566 .enqcmd,1569 .enqcmd,
1567 .f16c,1570 .f16c,
1568 .false_deps_perm,1571 .false_deps_perm,
1569 .false_deps_popcnt,
1570 .fast_15bytenop,1572 .fast_15bytenop,
1571 .fast_gather,1573 .fast_gather,
1572 .fast_scalar_fsqrt,1574 .fast_scalar_fsqrt,
...@@ -1606,6 +1608,7 @@ pub const cpu = struct {...@@ -1606,6 +1608,7 @@ pub const cpu = struct {
1606 .sha512,1608 .sha512,
1607 .shstk,1609 .shstk,
1608 .slow_3ops_lea,1610 .slow_3ops_lea,
1611 .slow_pmullq,
1609 .sm3,1612 .sm3,
1610 .sm4,1613 .sm4,
1611 .smap,1614 .smap,
...@@ -2204,6 +2207,7 @@ pub const cpu = struct {...@@ -2204,6 +2207,7 @@ pub const cpu = struct {
2204 .sahf,2207 .sahf,
2205 .sha,2208 .sha,
2206 .slow_3ops_lea,2209 .slow_3ops_lea,
2210 .slow_pmullq,
2207 .smap,2211 .smap,
2208 .smep,2212 .smep,
2209 .tuning_fast_imm_vector_shift,2213 .tuning_fast_imm_vector_shift,
...@@ -2297,7 +2301,6 @@ pub const cpu = struct {...@@ -2297,7 +2301,6 @@ pub const cpu = struct {
2297 .enqcmd,2301 .enqcmd,
2298 .f16c,2302 .f16c,
2299 .false_deps_perm,2303 .false_deps_perm,
2300 .false_deps_popcnt,
2301 .fast_15bytenop,2304 .fast_15bytenop,
2302 .fast_gather,2305 .fast_gather,
2303 .fast_scalar_fsqrt,2306 .fast_scalar_fsqrt,
...@@ -2338,6 +2341,7 @@ pub const cpu = struct {...@@ -2338,6 +2341,7 @@ pub const cpu = struct {
2338 .sha512,2341 .sha512,
2339 .shstk,2342 .shstk,
2340 .slow_3ops_lea,2343 .slow_3ops_lea,
2344 .slow_pmullq,
2341 .sm3,2345 .sm3,
2342 .sm4,2346 .sm4,
2343 .tuning_fast_imm_vector_shift,2347 .tuning_fast_imm_vector_shift,
...@@ -2464,7 +2468,6 @@ pub const cpu = struct {...@@ -2464,7 +2468,6 @@ pub const cpu = struct {
2464 .amx_int8,2468 .amx_int8,
2465 .amx_movrs,2469 .amx_movrs,
2466 .amx_tf32,2470 .amx_tf32,
2467 .amx_transpose,
2468 .avx10_2,2471 .avx10_2,
2469 .avxifma,2472 .avxifma,
2470 .avxneconvert,2473 .avxneconvert,
...@@ -2475,7 +2478,6 @@ pub const cpu = struct {...@@ -2475,7 +2478,6 @@ pub const cpu = struct {
2475 .bmi2,2478 .bmi2,
2476 .branch_hint,2479 .branch_hint,
2477 .ccmp,2480 .ccmp,
2478 .cf,
2479 .cldemote,2481 .cldemote,
2480 .clflushopt,2482 .clflushopt,
2481 .clwb,2483 .clwb,
...@@ -2533,12 +2535,12 @@ pub const cpu = struct {...@@ -2533,12 +2535,12 @@ pub const cpu = struct {
2533 .sha,2535 .sha,
2534 .sha512,2536 .sha512,
2535 .shstk,2537 .shstk,
2538 .slow_pmullq,
2536 .sm3,2539 .sm3,
2537 .sm4,2540 .sm4,
2538 .tsxldtrk,2541 .tsxldtrk,
2539 .tuning_fast_imm_vector_shift,2542 .tuning_fast_imm_vector_shift,
2540 .uintr,2543 .uintr,
2541 .usermsr,
2542 .vaes,2544 .vaes,
2543 .vpclmulqdq,2545 .vpclmulqdq,
2544 .vzeroupper,2546 .vzeroupper,
...@@ -2622,6 +2624,7 @@ pub const cpu = struct {...@@ -2622,6 +2624,7 @@ pub const cpu = struct {
2622 .serialize,2624 .serialize,
2623 .sha,2625 .sha,
2624 .shstk,2626 .shstk,
2627 .slow_pmullq,
2625 .smap,2628 .smap,
2626 .smep,2629 .smep,
2627 .tsxldtrk,2630 .tsxldtrk,
...@@ -2935,6 +2938,7 @@ pub const cpu = struct {...@@ -2935,6 +2938,7 @@ pub const cpu = struct {
2935 .serialize,2938 .serialize,
2936 .sha,2939 .sha,
2937 .shstk,2940 .shstk,
2941 .slow_pmullq,
2938 .tsxldtrk,2942 .tsxldtrk,
2939 .tuning_fast_imm_vector_shift,2943 .tuning_fast_imm_vector_shift,
2940 .uintr,2944 .uintr,
...@@ -3024,6 +3028,7 @@ pub const cpu = struct {...@@ -3024,6 +3028,7 @@ pub const cpu = struct {
3024 .serialize,3028 .serialize,
3025 .sha,3029 .sha,
3026 .shstk,3030 .shstk,
3031 .slow_pmullq,
3027 .tsxldtrk,3032 .tsxldtrk,
3028 .tuning_fast_imm_vector_shift,3033 .tuning_fast_imm_vector_shift,
3029 .uintr,3034 .uintr,
...@@ -3181,6 +3186,7 @@ pub const cpu = struct {...@@ -3181,6 +3186,7 @@ pub const cpu = struct {
3181 .rdseed,3186 .rdseed,
3182 .sahf,3187 .sahf,
3183 .sha,3188 .sha,
3189 .slow_pmullq,
3184 .tuning_fast_imm_vector_shift,3190 .tuning_fast_imm_vector_shift,
3185 .vaes,3191 .vaes,
3186 .vpclmulqdq,3192 .vpclmulqdq,
...@@ -3245,6 +3251,7 @@ pub const cpu = struct {...@@ -3245,6 +3251,7 @@ pub const cpu = struct {
3245 .rdseed,3251 .rdseed,
3246 .sahf,3252 .sahf,
3247 .sha,3253 .sha,
3254 .slow_pmullq,
3248 .tuning_fast_imm_vector_shift,3255 .tuning_fast_imm_vector_shift,
3249 .vaes,3256 .vaes,
3250 .vpclmulqdq,3257 .vpclmulqdq,
...@@ -3475,7 +3482,6 @@ pub const cpu = struct {...@@ -3475,7 +3482,6 @@ pub const cpu = struct {
3475 .enqcmd,3482 .enqcmd,
3476 .f16c,3483 .f16c,
3477 .false_deps_perm,3484 .false_deps_perm,
3478 .false_deps_popcnt,
3479 .fast_15bytenop,3485 .fast_15bytenop,
3480 .fast_gather,3486 .fast_gather,
3481 .fast_scalar_fsqrt,3487 .fast_scalar_fsqrt,
...@@ -3515,6 +3521,7 @@ pub const cpu = struct {...@@ -3515,6 +3521,7 @@ pub const cpu = struct {
3515 .sha512,3521 .sha512,
3516 .shstk,3522 .shstk,
3517 .slow_3ops_lea,3523 .slow_3ops_lea,
3524 .slow_pmullq,
3518 .sm3,3525 .sm3,
3519 .sm4,3526 .sm4,
3520 .tuning_fast_imm_vector_shift,3527 .tuning_fast_imm_vector_shift,
...@@ -3546,7 +3553,6 @@ pub const cpu = struct {...@@ -3546,7 +3553,6 @@ pub const cpu = struct {
3546 .cx16,3553 .cx16,
3547 .f16c,3554 .f16c,
3548 .false_deps_perm,3555 .false_deps_perm,
3549 .false_deps_popcnt,
3550 .fast_15bytenop,3556 .fast_15bytenop,
3551 .fast_gather,3557 .fast_gather,
3552 .fast_scalar_fsqrt,3558 .fast_scalar_fsqrt,
...@@ -3585,6 +3591,7 @@ pub const cpu = struct {...@@ -3585,6 +3591,7 @@ pub const cpu = struct {
3585 .sha,3591 .sha,
3586 .shstk,3592 .shstk,
3587 .slow_3ops_lea,3593 .slow_3ops_lea,
3594 .slow_pmullq,
3588 .smap,3595 .smap,
3589 .smep,3596 .smep,
3590 .tuning_fast_imm_vector_shift,3597 .tuning_fast_imm_vector_shift,
...@@ -3635,6 +3642,90 @@ pub const cpu = struct {...@@ -3635,6 +3642,90 @@ pub const cpu = struct {
3635 .x87,3642 .x87,
3636 }),3643 }),
3637 };3644 };
3645 pub const novalake: CpuModel = .{
3646 .name = "novalake",
3647 .llvm_name = "novalake",
3648 .features = featureSet(&[_]Feature{
3649 .@"64bit",
3650 .adx,
3651 .allow_light_256_bit,
3652 .avx10_2,
3653 .avxifma,
3654 .avxneconvert,
3655 .avxvnni,
3656 .avxvnniint16,
3657 .avxvnniint8,
3658 .bmi,
3659 .bmi2,
3660 .ccmp,
3661 .clflushopt,
3662 .clwb,
3663 .cmov,
3664 .cmpccxadd,
3665 .cx16,
3666 .egpr,
3667 .enqcmd,
3668 .false_deps_perm,
3669 .fast_15bytenop,
3670 .fast_gather,
3671 .fast_scalar_fsqrt,
3672 .fast_shld_rotate,
3673 .fast_variable_crosslane_shuffle,
3674 .fast_variable_perlane_shuffle,
3675 .fast_vector_fsqrt,
3676 .fsgsbase,
3677 .fxsr,
3678 .gfni,
3679 .hreset,
3680 .idivq_to_divl,
3681 .invpcid,
3682 .lzcnt,
3683 .macrofusion,
3684 .mmx,
3685 .movbe,
3686 .movdir64b,
3687 .movdiri,
3688 .movrs,
3689 .ndd,
3690 .nf,
3691 .no_bypass_delay_blend,
3692 .no_bypass_delay_mov,
3693 .no_bypass_delay_shuffle,
3694 .nopl,
3695 .pconfig,
3696 .pku,
3697 .popcnt,
3698 .ppx,
3699 .prefer_movmsk_over_vtest,
3700 .prefetchi,
3701 .prfchw,
3702 .ptwrite,
3703 .push2pop2,
3704 .rdpid,
3705 .rdrnd,
3706 .rdseed,
3707 .sahf,
3708 .serialize,
3709 .sha,
3710 .sha512,
3711 .shstk,
3712 .slow_3ops_lea,
3713 .slow_pmullq,
3714 .sm3,
3715 .sm4,
3716 .tuning_fast_imm_vector_shift,
3717 .uintr,
3718 .vaes,
3719 .vpclmulqdq,
3720 .vzeroupper,
3721 .waitpkg,
3722 .x87,
3723 .xsavec,
3724 .xsaveopt,
3725 .xsaves,
3726 .zu,
3727 }),
3728 };
3638 pub const opteron: CpuModel = .{3729 pub const opteron: CpuModel = .{
3639 .name = "opteron",3730 .name = "opteron",
3640 .llvm_name = "opteron",3731 .llvm_name = "opteron",
...@@ -3697,7 +3788,6 @@ pub const cpu = struct {...@@ -3697,7 +3788,6 @@ pub const cpu = struct {
3697 .enqcmd,3788 .enqcmd,
3698 .f16c,3789 .f16c,
3699 .false_deps_perm,3790 .false_deps_perm,
3700 .false_deps_popcnt,
3701 .fast_15bytenop,3791 .fast_15bytenop,
3702 .fast_gather,3792 .fast_gather,
3703 .fast_scalar_fsqrt,3793 .fast_scalar_fsqrt,
...@@ -3726,7 +3816,6 @@ pub const cpu = struct {...@@ -3726,7 +3816,6 @@ pub const cpu = struct {
3726 .pku,3816 .pku,
3727 .popcnt,3817 .popcnt,
3728 .prefer_movmsk_over_vtest,3818 .prefer_movmsk_over_vtest,
3729 .prefetchi,
3730 .prfchw,3819 .prfchw,
3731 .ptwrite,3820 .ptwrite,
3732 .rdpid,3821 .rdpid,
...@@ -3738,6 +3827,7 @@ pub const cpu = struct {...@@ -3738,6 +3827,7 @@ pub const cpu = struct {
3738 .sha512,3827 .sha512,
3739 .shstk,3828 .shstk,
3740 .slow_3ops_lea,3829 .slow_3ops_lea,
3830 .slow_pmullq,
3741 .sm3,3831 .sm3,
3742 .sm4,3832 .sm4,
3743 .tuning_fast_imm_vector_shift,3833 .tuning_fast_imm_vector_shift,
...@@ -3908,7 +3998,6 @@ pub const cpu = struct {...@@ -3908,7 +3998,6 @@ pub const cpu = struct {
3908 .cx16,3998 .cx16,
3909 .f16c,3999 .f16c,
3910 .false_deps_perm,4000 .false_deps_perm,
3911 .false_deps_popcnt,
3912 .fast_15bytenop,4001 .fast_15bytenop,
3913 .fast_gather,4002 .fast_gather,
3914 .fast_scalar_fsqrt,4003 .fast_scalar_fsqrt,
...@@ -3947,6 +4036,7 @@ pub const cpu = struct {...@@ -3947,6 +4036,7 @@ pub const cpu = struct {
3947 .sha,4036 .sha,
3948 .shstk,4037 .shstk,
3949 .slow_3ops_lea,4038 .slow_3ops_lea,
4039 .slow_pmullq,
3950 .smap,4040 .smap,
3951 .smep,4041 .smep,
3952 .tuning_fast_imm_vector_shift,4042 .tuning_fast_imm_vector_shift,
...@@ -4013,6 +4103,7 @@ pub const cpu = struct {...@@ -4013,6 +4103,7 @@ pub const cpu = struct {
4013 .rdseed,4103 .rdseed,
4014 .sahf,4104 .sahf,
4015 .sha,4105 .sha,
4106 .slow_pmullq,
4016 .smap,4107 .smap,
4017 .smep,4108 .smep,
4018 .tuning_fast_imm_vector_shift,4109 .tuning_fast_imm_vector_shift,
...@@ -4124,6 +4215,7 @@ pub const cpu = struct {...@@ -4124,6 +4215,7 @@ pub const cpu = struct {
4124 .serialize,4215 .serialize,
4125 .sha,4216 .sha,
4126 .shstk,4217 .shstk,
4218 .slow_pmullq,
4127 .smap,4219 .smap,
4128 .smep,4220 .smep,
4129 .tsxldtrk,4221 .tsxldtrk,
...@@ -4494,6 +4586,7 @@ pub const cpu = struct {...@@ -4494,6 +4586,7 @@ pub const cpu = struct {
4494 .sahf,4586 .sahf,
4495 .sha,4587 .sha,
4496 .shstk,4588 .shstk,
4589 .slow_pmullq,
4497 .smap,4590 .smap,
4498 .smep,4591 .smep,
4499 .tuning_fast_imm_vector_shift,4592 .tuning_fast_imm_vector_shift,
...@@ -4567,6 +4660,82 @@ pub const cpu = struct {...@@ -4567,6 +4660,82 @@ pub const cpu = struct {
4567 .x87,4660 .x87,
4568 }),4661 }),
4569 };4662 };
4663 pub const wildcatlake: CpuModel = .{
4664 .name = "wildcatlake",
4665 .llvm_name = "wildcatlake",
4666 .features = featureSet(&[_]Feature{
4667 .@"64bit",
4668 .adx,
4669 .allow_light_256_bit,
4670 .avxifma,
4671 .avxneconvert,
4672 .avxvnni,
4673 .avxvnniint16,
4674 .avxvnniint8,
4675 .bmi,
4676 .bmi2,
4677 .clflushopt,
4678 .clwb,
4679 .cmov,
4680 .cmpccxadd,
4681 .cx16,
4682 .enqcmd,
4683 .f16c,
4684 .false_deps_perm,
4685 .fast_15bytenop,
4686 .fast_gather,
4687 .fast_scalar_fsqrt,
4688 .fast_shld_rotate,
4689 .fast_variable_crosslane_shuffle,
4690 .fast_variable_perlane_shuffle,
4691 .fast_vector_fsqrt,
4692 .fma,
4693 .fsgsbase,
4694 .fxsr,
4695 .gfni,
4696 .hreset,
4697 .idivq_to_divl,
4698 .invpcid,
4699 .lzcnt,
4700 .macrofusion,
4701 .mmx,
4702 .movbe,
4703 .movdir64b,
4704 .movdiri,
4705 .no_bypass_delay_blend,
4706 .no_bypass_delay_mov,
4707 .no_bypass_delay_shuffle,
4708 .nopl,
4709 .pconfig,
4710 .pku,
4711 .popcnt,
4712 .prefer_movmsk_over_vtest,
4713 .prfchw,
4714 .ptwrite,
4715 .rdpid,
4716 .rdrnd,
4717 .rdseed,
4718 .sahf,
4719 .serialize,
4720 .sha,
4721 .sha512,
4722 .shstk,
4723 .slow_3ops_lea,
4724 .slow_pmullq,
4725 .sm3,
4726 .sm4,
4727 .tuning_fast_imm_vector_shift,
4728 .uintr,
4729 .vaes,
4730 .vpclmulqdq,
4731 .vzeroupper,
4732 .waitpkg,
4733 .x87,
4734 .xsavec,
4735 .xsaveopt,
4736 .xsaves,
4737 }),
4738 };
4570 pub const winchip2: CpuModel = .{4739 pub const winchip2: CpuModel = .{
4571 .name = "winchip2",4740 .name = "winchip2",
4572 .llvm_name = "winchip2",4741 .llvm_name = "winchip2",
lib/std/Target/xtensa.zig+65
...@@ -15,6 +15,7 @@ pub const Feature = enum {...@@ -15,6 +15,7 @@ pub const Feature = enum {
15 div32,15 div32,
16 exception,16 exception,
17 extendedl32r,17 extendedl32r,
18 forced_atomics,
18 fp,19 fp,
19 highpriinterrupts,20 highpriinterrupts,
20 highpriinterrupts_level3,21 highpriinterrupts_level3,
...@@ -34,6 +35,7 @@ pub const Feature = enum {...@@ -34,6 +35,7 @@ pub const Feature = enum {
34 prid,35 prid,
35 regprotect,36 regprotect,
36 rvector,37 rvector,
38 s32c1i,
37 sext,39 sext,
38 threadptr,40 threadptr,
39 timers1,41 timers1,
...@@ -101,6 +103,11 @@ pub const all_features = blk: {...@@ -101,6 +103,11 @@ pub const all_features = blk: {
101 .description = "Enable Xtensa Extended L32R option",103 .description = "Enable Xtensa Extended L32R option",
102 .dependencies = featureSet(&[_]Feature{}),104 .dependencies = featureSet(&[_]Feature{}),
103 };105 };
106 result[@intFromEnum(Feature.forced_atomics)] = .{
107 .llvm_name = "forced-atomics",
108 .description = "Assume that lock-free native-width atomics are available",
109 .dependencies = featureSet(&[_]Feature{}),
110 };
104 result[@intFromEnum(Feature.fp)] = .{111 result[@intFromEnum(Feature.fp)] = .{
105 .llvm_name = "fp",112 .llvm_name = "fp",
106 .description = "Enable Xtensa Single FP instructions",113 .description = "Enable Xtensa Single FP instructions",
...@@ -206,6 +213,11 @@ pub const all_features = blk: {...@@ -206,6 +213,11 @@ pub const all_features = blk: {
206 .description = "Enable Xtensa Relocatable Vector option",213 .description = "Enable Xtensa Relocatable Vector option",
207 .dependencies = featureSet(&[_]Feature{}),214 .dependencies = featureSet(&[_]Feature{}),
208 };215 };
216 result[@intFromEnum(Feature.s32c1i)] = .{
217 .llvm_name = "s32c1i",
218 .description = "Enable Xtensa S32C1I option",
219 .dependencies = featureSet(&[_]Feature{}),
220 };
209 result[@intFromEnum(Feature.sext)] = .{221 result[@intFromEnum(Feature.sext)] = .{
210 .llvm_name = "sext",222 .llvm_name = "sext",
211 .description = "Enable Xtensa Sign Extend option",223 .description = "Enable Xtensa Sign Extend option",
...@@ -245,6 +257,59 @@ pub const all_features = blk: {...@@ -245,6 +257,59 @@ pub const all_features = blk: {
245};257};
246258
247pub const cpu = struct {259pub const cpu = struct {
260 pub const esp32: CpuModel = .{
261 .name = "esp32",
262 .llvm_name = "esp32",
263 .features = featureSet(&[_]Feature{
264 .bool,
265 .clamps,
266 .coprocessor,
267 .dcache,
268 .debug,
269 .density,
270 .dfpaccel,
271 .div32,
272 .exception,
273 .fp,
274 .highpriinterrupts_level7,
275 .interrupt,
276 .loop,
277 .mac16,
278 .minmax,
279 .miscsr,
280 .mul16,
281 .mul32,
282 .mul32high,
283 .nsa,
284 .prid,
285 .regprotect,
286 .rvector,
287 .s32c1i,
288 .sext,
289 .threadptr,
290 .timers3,
291 .windowed,
292 }),
293 };
294 pub const esp8266: CpuModel = .{
295 .name = "esp8266",
296 .llvm_name = "esp8266",
297 .features = featureSet(&[_]Feature{
298 .debug,
299 .density,
300 .exception,
301 .extendedl32r,
302 .highpriinterrupts_level3,
303 .interrupt,
304 .mul16,
305 .mul32,
306 .nsa,
307 .prid,
308 .regprotect,
309 .rvector,
310 .timers1,
311 }),
312 };
248 pub const generic: CpuModel = .{313 pub const generic: CpuModel = .{
249 .name = "generic",314 .name = "generic",
250 .llvm_name = "generic",315 .llvm_name = "generic",
lib/std/hash/xxhash.zig-6
...@@ -780,8 +780,6 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64)...@@ -780,8 +780,6 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64)
780}780}
781781
782test "xxhash3" {782test "xxhash3" {
783 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
784
785 const H = XxHash3;783 const H = XxHash3;
786 // Non-Seeded Tests784 // Non-Seeded Tests
787 try testExpect(H, 0, "", 0x2d06800538d394c2);785 try testExpect(H, 0, "", 0x2d06800538d394c2);
...@@ -813,8 +811,6 @@ test "xxhash3" {...@@ -813,8 +811,6 @@ test "xxhash3" {
813}811}
814812
815test "xxhash3 smhasher" {813test "xxhash3 smhasher" {
816 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
817
818 const Test = struct {814 const Test = struct {
819 fn do() !void {815 fn do() !void {
820 try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405);816 try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405);
...@@ -826,8 +822,6 @@ test "xxhash3 smhasher" {...@@ -826,8 +822,6 @@ test "xxhash3 smhasher" {
826}822}
827823
828test "xxhash3 iterative api" {824test "xxhash3 iterative api" {
829 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
830
831 const Test = struct {825 const Test = struct {
832 fn do() !void {826 fn do() !void {
833 try verify.iterativeApi(XxHash3);827 try verify.iterativeApi(XxHash3);
lib/std/math/big/int_test.zig+1-3
...@@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void {...@@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void {
484 );484 );
485}485}
486test toFloat {486test toFloat {
487 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24191487 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
488 try toFloat(f16);488 try toFloat(f16);
489 try toFloat(f32);489 try toFloat(f32);
490 try toFloat(f64);490 try toFloat(f64);
...@@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" {...@@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" {
2801 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO2801 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
2802 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO2802 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
2803 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2803 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2804 // LLVM: unexpected runtime library name: __umodei4
2805 if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
28062804
2807 var a = try Managed.initSet(testing.allocator, maxInt(Limb));2805 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
2808 defer a.deinit();2806 defer a.deinit();
lib/std/math/log10.zig-2
...@@ -139,8 +139,6 @@ test log10_int {...@@ -139,8 +139,6 @@ test log10_int {
139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
140 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO140 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
141 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO141 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
142 if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
143 if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch == .hexagon) return error.SkipZigTest;
144142
145 inline for (143 inline for (
146 .{ u8, u16, u32, u64, u128, u256, u512 },144 .{ u8, u16, u32, u64, u128, u256, u512 },
lib/std/math/modf.zig-1
...@@ -87,7 +87,6 @@ fn ModfTests(comptime T: type) type {...@@ -87,7 +87,6 @@ fn ModfTests(comptime T: type) type {
87 test "vector" {87 test "vector" {
88 if (builtin.os.tag.isDarwin() and builtin.cpu.arch == .aarch64) return error.SkipZigTest;88 if (builtin.os.tag.isDarwin() and builtin.cpu.arch == .aarch64) return error.SkipZigTest;
89 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;89 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
90 if (comptime builtin.cpu.has(.loongarch, .lsx)) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/159529
9190
92 const widths = [_]comptime_int{ 1, 2, 3, 4, 8, 16 };91 const widths = [_]comptime_int{ 1, 2, 3, 4, 8, 16 };
9392
lib/std/mem.zig+1-2
...@@ -4809,8 +4809,7 @@ pub fn doNotOptimizeAway(val: anytype) void {...@@ -4809,8 +4809,7 @@ pub fn doNotOptimizeAway(val: anytype) void {
4809 } else doNotOptimizeAway(&val);4809 } else doNotOptimizeAway(&val);
4810 },4810 },
4811 .float => {4811 .float => {
4812 // https://github.com/llvm/llvm-project/issues/1592004812 if ((t.float.bits == 32 or t.float.bits == 64) and builtin.zig_backend != .stage2_c) {
4813 if ((t.float.bits == 32 or t.float.bits == 64) and builtin.zig_backend != .stage2_c and !builtin.cpu.arch.isLoongArch()) {
4814 asm volatile (""4813 asm volatile (""
4815 :4814 :
4816 : [_] "rm" (val),4815 : [_] "rm" (val),
lib/std/os/linux/test.zig-2
...@@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual;...@@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual;
10const fs = std.fs;10const fs = std.fs;
1111
12test "fallocate" {12test "fallocate" {
13 if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/30220
14
15 const io = std.testing.io;13 const io = std.testing.io;
1614
17 var tmp = std.testing.tmpDir(.{});15 var tmp = std.testing.tmpDir(.{});
lib/std/os/windows.zig+130-1
...@@ -5665,7 +5665,136 @@ pub const PF = enum(DWORD) {...@@ -5665,7 +5665,136 @@ pub const PF = enum(DWORD) {
5665 ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44,5665 ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44,
56665666
5667 /// This Arm processor implements the Arm v8.3 LRCPC instructions (for example, LDAPR). Note that certain Arm v8.2 CPUs may optionally support the LRCPC instructions.5667 /// This Arm processor implements the Arm v8.3 LRCPC instructions (for example, LDAPR). Note that certain Arm v8.2 CPUs may optionally support the LRCPC instructions.
5668 ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE,5668 ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE = 45,
5669
5670 /// This Arm processor implements the SVE (Scalable Vector Extension) instructions (FEAT_SVE).
5671 ARM_SVE_INSTRUCTIONS_AVAILABLE = 46,
5672
5673 /// This Arm processor implements the SVE2 instructions (FEAT_SVE2).
5674 ARM_SVE2_INSTRUCTIONS_AVAILABLE = 47,
5675
5676 /// This Arm processor implements the SVE2.1 instructions (FEAT_SVE2p1).
5677 ARM_SVE2_1_INSTRUCTIONS_AVAILABLE = 48,
5678
5679 /// This Arm processor implements the SVE AES instructions (FEAT_SVE_AES).
5680 ARM_SVE_AES_INSTRUCTIONS_AVAILABLE = 49,
5681
5682 /// This Arm processor implements the SVE 128-bit polynomial multiply long instructions (FEAT_SVE_PMULL128).
5683 ARM_SVE_PMULL128_INSTRUCTIONS_AVAILABLE = 50,
5684
5685 /// This Arm processor implements the SVE bit permute instructions (FEAT_SVE_BitPerm).
5686 ARM_SVE_BITPERM_INSTRUCTIONS_AVAILABLE = 51,
5687
5688 /// This Arm processor implements the SVE BF16 (BFloat16) instructions (FEAT_BF16).
5689 ARM_SVE_BF16_INSTRUCTIONS_AVAILABLE = 52,
5690
5691 /// This Arm processor implements the SVE EBF16 (Extended BFloat16) instructions (FEAT_EBF16).
5692 ARM_SVE_EBF16_INSTRUCTIONS_AVAILABLE = 53,
5693
5694 /// This Arm processor implements the SVE B16B16 instructions (FEAT_SVE_B16B16).
5695 ARM_SVE_B16B16_INSTRUCTIONS_AVAILABLE = 54,
5696
5697 /// This Arm processor implements the SVE SHA-3 cryptographic instructions (FEAT_SVE_SHA3).
5698 ARM_SVE_SHA3_INSTRUCTIONS_AVAILABLE = 55,
5699
5700 /// This Arm processor implements the SVE SM4 cryptographic instructions (FEAT_SVE_SM4).
5701 ARM_SVE_SM4_INSTRUCTIONS_AVAILABLE = 56,
5702
5703 /// This Arm processor implements the SVE I8MM (Int8 matrix multiply) instructions (FEAT_I8MM).
5704 ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE = 57,
5705
5706 /// This Arm processor implements the SVE F32MM (FP32 matrix multiply) instructions (FEAT_F32MM).
5707 ARM_SVE_F32MM_INSTRUCTIONS_AVAILABLE = 58,
5708
5709 /// This Arm processor implements the SVE F64MM (FP64 matrix multiply) instructions (FEAT_F64MM).
5710 ARM_SVE_F64MM_INSTRUCTIONS_AVAILABLE = 59,
5711
5712 /// This x64 processor implements the BMI2 instruction set.
5713 BMI2_INSTRUCTIONS_AVAILABLE = 60,
5714
5715 /// This x64 processor implements the MOVDIR64B instruction.
5716 MOVDIR64B_INSTRUCTION_AVAILABLE = 61,
5717
5718 /// This Arm processor implements the LSE2 atomic instructions (FEAT_LSE2).
5719 ARM_LSE2_AVAILABLE = 62,
5720
5721 /// This Arm processor implements the SHA-3 cryptographic instructions (FEAT_SHA3).
5722 ARM_SHA3_INSTRUCTIONS_AVAILABLE = 64,
5723
5724 /// This Arm processor implements the SHA-512 cryptographic instructions (FEAT_SHA512).
5725 ARM_SHA512_INSTRUCTIONS_AVAILABLE = 65,
5726
5727 /// This Arm processor implements the I8MM (Int8 matrix multiply) NEON instructions (FEAT_I8MM).
5728 ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE = 66,
5729
5730 /// This Arm processor implements the FP16 (half-precision floating point) NEON instructions (FEAT_FP16).
5731 ARM_V82_FP16_INSTRUCTIONS_AVAILABLE = 67,
5732
5733 /// This Arm processor implements the BF16 (BFloat16) NEON instructions (FEAT_BF16).
5734 ARM_V86_BF16_INSTRUCTIONS_AVAILABLE = 68,
5735
5736 /// This Arm processor implements the EBF16 (Extended BFloat16) NEON instructions (FEAT_EBF16).
5737 ARM_V86_EBF16_INSTRUCTIONS_AVAILABLE = 69,
5738
5739 /// This Arm processor implements the SME (Scalable Matrix Extension) instructions (FEAT_SME).
5740 ARM_SME_INSTRUCTIONS_AVAILABLE = 70,
5741
5742 /// This Arm processor implements the SME2 instructions (FEAT_SME2).
5743 ARM_SME2_INSTRUCTIONS_AVAILABLE = 71,
5744
5745 /// This Arm processor implements the SME2.1 instructions (FEAT_SME2p1).
5746 ARM_SME2_1_INSTRUCTIONS_AVAILABLE = 72,
5747
5748 /// This Arm processor implements the SME2.2 instructions (FEAT_SME2p2).
5749 ARM_SME2_2_INSTRUCTIONS_AVAILABLE = 73,
5750
5751 /// This Arm processor implements the SVE AES instructions when in Streaming SVE mode (FEAT_SSVE_AES).
5752 ARM_SME_AES_INSTRUCTIONS_AVAILABLE = 74,
5753
5754 /// This Arm processor implements the SVE bit permute instructions when in Streaming SVE mode (FEAT_SSVE_BitPerm).
5755 ARM_SME_SBITPERM_INSTRUCTIONS_AVAILABLE = 75,
5756
5757 /// This Arm processor implements the SVE FMMLA (widening, 4-way, FP8 to FP16) instruction when in Streaming SVE mode (FEAT_SSVE_F8F16MM).
5758 ARM_SME_SF8MM4_INSTRUCTIONS_AVAILABLE = 76,
5759
5760 /// This Arm processor implements the SVE FMMLA (widening, 8-way, FP8 to FP32) instruction when in Streaming SVE mode (FEAT_SSVE_F8F32MM).
5761 ARM_SME_SF8MM8_INSTRUCTIONS_AVAILABLE = 77,
5762
5763 /// This Arm processor implements the SVE2 FP8DOT2 instructions when in Streaming SVE mode (FEAT_SSVE_FP8DOT2).
5764 ARM_SME_SF8DP2_INSTRUCTIONS_AVAILABLE = 78,
5765
5766 /// This Arm processor implements the SVE2 FP8DOT4 instructions when in Streaming SVE mode (FEAT_SSVE_FP8DOT4).
5767 ARM_SME_SF8DP4_INSTRUCTIONS_AVAILABLE = 79,
5768
5769 /// This Arm processor implements the SVE2 FP8FMA instructions when in Streaming SVE mode (FEAT_SSVE_FP8FMA).
5770 ARM_SME_SF8FMA_INSTRUCTIONS_AVAILABLE = 80,
5771
5772 /// This Arm processor implements the SME F8F32 instructions (FEAT_SME_F8F32).
5773 ARM_SME_F8F32_INSTRUCTIONS_AVAILABLE = 81,
5774
5775 /// This Arm processor implements the SME F8F16 instructions (FEAT_SME_F8F16).
5776 ARM_SME_F8F16_INSTRUCTIONS_AVAILABLE = 82,
5777
5778 /// This Arm processor implements the SME F16F16 instructions (FEAT_SME_F16F16).
5779 ARM_SME_F16F16_INSTRUCTIONS_AVAILABLE = 83,
5780
5781 /// This Arm processor implements the SME B16B16 instructions (FEAT_SME_B16B16).
5782 ARM_SME_B16B16_INSTRUCTIONS_AVAILABLE = 84,
5783
5784 /// This Arm processor implements the SME F64F64 instructions (FEAT_SME_F64F64).
5785 ARM_SME_F64F64_INSTRUCTIONS_AVAILABLE = 85,
5786
5787 /// This Arm processor implements the SME I16I64 instructions (FEAT_SME_I16I64).
5788 ARM_SME_I16I64_INSTRUCTIONS_AVAILABLE = 86,
5789
5790 /// This Arm processor implements the SME LUTv2 instructions (FEAT_SME_LUTv2).
5791 ARM_SME_LUTv2_INSTRUCTIONS_AVAILABLE = 87,
5792
5793 /// This Arm processor implements SME FA64 (Full AArch64 instruction set when in Streaming SVE mode) (FEAT_SME_FA64).
5794 ARM_SME_FA64_INSTRUCTIONS_AVAILABLE = 88,
5795
5796 /// This x64 processor implements the UMONITOR instruction.
5797 UMONITOR_INSTRUCTION_AVAILABLE = 89,
5669};5798};
56705799
5671pub const MAX_WOW64_SHARED_ENTRIES = 16;5800pub const MAX_WOW64_SHARED_ENTRIES = 16;
lib/std/simd.zig+4-21
...@@ -157,13 +157,6 @@ pub fn join(a: anytype, b: anytype) @Vector(vectorLength(@TypeOf(a)) + vectorLen...@@ -157,13 +157,6 @@ pub fn join(a: anytype, b: anytype) @Vector(vectorLength(@TypeOf(a)) + vectorLen
157/// Returns a vector whose elements alternates between those of each input vector.157/// Returns a vector whose elements alternates between those of each input vector.
158/// For example, `interlace(.{[4]u32{11, 12, 13, 14}, [4]u32{21, 22, 23, 24}})` returns a vector containing `.{11, 21, 12, 22, 13, 23, 14, 24}`.158/// For example, `interlace(.{[4]u32{11, 12, 13, 14}, [4]u32{21, 22, 23, 24}})` returns a vector containing `.{11, 21, 12, 22, 13, 23, 14, 24}`.
159pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.len, std.meta.Child(@TypeOf(vecs[0]))) {159pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.len, std.meta.Child(@TypeOf(vecs[0]))) {
160 // interlace doesn't work on MIPS, for some reason.
161 // Notes from earlier debug attempt:
162 // The indices are correct. The problem seems to be with the @shuffle builtin.
163 // On MIPS, the test that interlaces small_base gives { 0, 2, 0, 0, 64, 255, 248, 200, 0, 0 }.
164 // Calling this with two inputs seems to work fine, but I'll let the compile error trigger for all inputs, just to be safe.
165 if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why interlace() doesn't work on MIPS");
166
167 const VecType = @TypeOf(vecs[0]);160 const VecType = @TypeOf(vecs[0]);
168 const vecs_arr = @as([vecs.len]VecType, vecs);161 const vecs_arr = @as([vecs.len]VecType, vecs);
169 const Child = std.meta.Child(@TypeOf(vecs_arr[0]));162 const Child = std.meta.Child(@TypeOf(vecs_arr[0]));
...@@ -247,13 +240,11 @@ test "vector patterns" {...@@ -247,13 +240,11 @@ test "vector patterns" {
247 try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base));240 try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base));
248 try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2));241 try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2));
249242
250 if (!builtin.cpu.arch.isMIPS()) {243 try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base }));
251 try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base }));
252244
253 const small_braid = interlace(small_bases);245 const small_braid = interlace(small_bases);
254 try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid);246 try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid);
255 try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid));247 try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid));
256 }
257}248}
258249
259/// Joins two vectors, shifts them leftwards (towards lower indices) and extracts the leftmost elements into a vector the length of a and b.250/// Joins two vectors, shifts them leftwards (towards lower indices) and extracts the leftmost elements into a vector the length of a and b.
...@@ -384,9 +375,6 @@ pub fn prefixScanWithFunc(...@@ -384,9 +375,6 @@ pub fn prefixScanWithFunc(
384 /// For example, this should be 0 for addition or 1 for multiplication.375 /// For example, this should be 0 for addition or 1 for multiplication.
385 comptime identity: std.meta.Child(@TypeOf(vec)),376 comptime identity: std.meta.Child(@TypeOf(vec)),
386) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec) {377) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec) {
387 // I haven't debugged this, but it might be a cousin of sorts to what's going on with interlace.
388 if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why prefixScan doesn't work on MIPS");
389
390 const len = vectorLength(@TypeOf(vec));378 const len = vectorLength(@TypeOf(vec));
391379
392 if (hop == 0) @compileError("hop can not be 0; you'd be going nowhere forever!");380 if (hop == 0) @compileError("hop can not be 0; you'd be going nowhere forever!");
...@@ -456,11 +444,6 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a...@@ -456,11 +444,6 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a
456}444}
457445
458test "vector prefix scan" {446test "vector prefix scan" {
459 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893
460 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
461
462 if (builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
463
464 const int_base = @Vector(4, i32){ 11, 23, 9, -21 };447 const int_base = @Vector(4, i32){ 11, 23, 9, -21 };
465 const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 };448 const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 };
466 const bool_base = @Vector(4, bool){ true, false, true, false };449 const bool_base = @Vector(4, bool){ true, false, true, false };
lib/std/start.zig+4-3
...@@ -20,8 +20,9 @@ comptime {...@@ -20,8 +20,9 @@ comptime {
20 _ = root;20 _ = root;
2121
22 if (builtin.output_mode == .Lib and builtin.link_mode == .dynamic) {22 if (builtin.output_mode == .Lib and builtin.link_mode == .dynamic) {
23 if (native_os == .windows and !@hasDecl(root, "_DllMainCRTStartup")) {23 const dll_main_crt_startup = if (builtin.abi.isGnu()) "DllMainCRTStartup" else "_DllMainCRTStartup";
24 @export(&_DllMainCRTStartup, .{ .name = "_DllMainCRTStartup" });24 if (native_os == .windows and !builtin.link_libc and !@hasDecl(root, dll_main_crt_startup)) {
25 @export(&DllMainCRTStartup, .{ .name = dll_main_crt_startup });
25 }26 }
26 } else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {27 } else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {
27 if (builtin.link_libc and @hasDecl(root, "main")) {28 if (builtin.link_libc and @hasDecl(root, "main")) {
...@@ -71,7 +72,7 @@ comptime {...@@ -71,7 +72,7 @@ comptime {
71 }72 }
72}73}
7374
74fn _DllMainCRTStartup(75fn DllMainCRTStartup(
75 hinstDLL: std.os.windows.HINSTANCE,76 hinstDLL: std.os.windows.HINSTANCE,
76 fdwReason: std.os.windows.DWORD,77 fdwReason: std.os.windows.DWORD,
77 lpReserved: std.os.windows.LPVOID,78 lpReserved: std.os.windows.LPVOID,
lib/std/zig/llvm/Builder.zig+2-2
...@@ -13947,8 +13947,8 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13947,8 +13947,8 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13947 const bit_count = extra.type.scalarBits(self);13947 const bit_count = extra.type.scalarBits(self);
13948 const val: i64 = if (bit_count <= 64)13948 const val: i64 = if (bit_count <= 64)
13949 bigint.toInt(i64) catch unreachable13949 bigint.toInt(i64) catch unreachable
13950 else if (bigint.toInt(u64)) |val|13950 else if (bigint.toInt(u63)) |val|
13951 @bitCast(val)13951 @bitCast(@as(u64, val))
13952 else |_| {13952 else |_| {
13953 const limbs = try record.addManyAsSlice(13953 const limbs = try record.addManyAsSlice(
13954 self.gpa,13954 self.gpa,
lib/std/zig/system.zig-10
...@@ -460,16 +460,6 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target {...@@ -460,16 +460,6 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target {
460 if (result.cpu.arch.isArm() and result.abi.float() == .soft) {460 if (result.cpu.arch.isArm() and result.abi.float() == .soft) {
461 result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2));461 result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2));
462 }462 }
463
464 // https://github.com/llvm/llvm-project/issues/135283
465 if (result.cpu.arch.isMIPS() and result.abi.float() == .soft) {
466 result.cpu.features.addFeature(@intFromEnum(Target.mips.Feature.soft_float));
467 }
468
469 // https://github.com/llvm/llvm-project/issues/168992
470 if (result.cpu.arch == .s390x) {
471 result.cpu.features.removeFeature(@intFromEnum(Target.s390x.Feature.vector));
472 }
473 }463 }
474464
475 // It's possible that we detect the native ABI, but fail to detect the OS version or were told465 // It's possible that we detect the native ABI, but fail to detect the OS version or were told
lib/std/zig/system/arm.zig+56-2
...@@ -21,7 +21,7 @@ pub const cpu_models = struct {...@@ -21,7 +21,7 @@ pub const cpu_models = struct {
21 };21 };
2222
23 // implementer = 0x4123 // implementer = 0x41
24 const ARM = [_]E{24 const Arm = [_]E{
25 E{ .part = 0x926, .m32 = &A32.arm926ej_s },25 E{ .part = 0x926, .m32 = &A32.arm926ej_s },
26 E{ .part = 0xb02, .m32 = &A32.mpcore },26 E{ .part = 0xb02, .m32 = &A32.mpcore },
27 E{ .part = 0xb36, .m32 = &A32.arm1136j_s },27 E{ .part = 0xb36, .m32 = &A32.arm1136j_s },
...@@ -88,8 +88,12 @@ pub const cpu_models = struct {...@@ -88,8 +88,12 @@ pub const cpu_models = struct {
88 E{ .part = 0xd87, .m64 = &A64.cortex_a725 },88 E{ .part = 0xd87, .m64 = &A64.cortex_a725 },
89 E{ .part = 0xd88, .m64 = &A64.cortex_a520ae },89 E{ .part = 0xd88, .m64 = &A64.cortex_a520ae },
90 E{ .part = 0xd89, .m64 = &A64.cortex_a720ae },90 E{ .part = 0xd89, .m64 = &A64.cortex_a720ae },
91 E{ .part = 0xd8a, .m64 = &A64.c1_nano },
92 E{ .part = 0xd8b, .m64 = &A64.c1_pro },
93 E{ .part = 0xd8c, .m64 = &A64.c1_ultra },
91 E{ .part = 0xd8e, .m64 = &A64.neoverse_n3 },94 E{ .part = 0xd8e, .m64 = &A64.neoverse_n3 },
92 E{ .part = 0xd8f, .m64 = &A64.cortex_a320 },95 E{ .part = 0xd8f, .m64 = &A64.cortex_a320 },
96 E{ .part = 0xd90, .m64 = &A64.c1_premium },
93 };97 };
94 // implementer = 0x4298 // implementer = 0x42
95 const Broadcom = [_]E{99 const Broadcom = [_]E{
...@@ -102,10 +106,17 @@ pub const cpu_models = struct {...@@ -102,10 +106,17 @@ pub const cpu_models = struct {
102 E{ .part = 0x0a3, .m64 = &A64.thunderxt83 },106 E{ .part = 0x0a3, .m64 = &A64.thunderxt83 },
103 E{ .part = 0x0a1, .m64 = &A64.thunderxt88 },107 E{ .part = 0x0a1, .m64 = &A64.thunderxt88 },
104 E{ .part = 0x0af, .m64 = &A64.thunderx2t99 },108 E{ .part = 0x0af, .m64 = &A64.thunderx2t99 },
109 E{ .part = 0x0b0, .m64 = &A64.cortex_a57 },
110 E{ .part = 0x0b1, .m64 = &A64.cortex_a57 },
111 E{ .part = 0x0b2, .m64 = &A64.cortex_a57 },
112 E{ .part = 0x0b3, .m64 = &A64.cortex_a57 },
113 E{ .part = 0x0b4, .m64 = &A64.cortex_a57 },
114 E{ .part = 0x0b5, .m64 = &A64.cortex_a57 },
105 };115 };
106 // implementer = 0x46116 // implementer = 0x46
107 const Fujitsu = [_]E{117 const Fujitsu = [_]E{
108 E{ .part = 0x001, .m64 = &A64.a64fx },118 E{ .part = 0x001, .m64 = &A64.a64fx },
119 E{ .part = 0x003, .m64 = &A64.fujitsu_monaka },
109 };120 };
110 // implementer = 0x48121 // implementer = 0x48
111 const HiSilicon = [_]E{122 const HiSilicon = [_]E{
...@@ -137,8 +148,14 @@ pub const cpu_models = struct {...@@ -137,8 +148,14 @@ pub const cpu_models = struct {
137 E{ .part = 0xc00, .m64 = &A64.falkor },148 E{ .part = 0xc00, .m64 = &A64.falkor },
138 E{ .part = 0xc01, .m64 = &A64.saphira },149 E{ .part = 0xc01, .m64 = &A64.saphira },
139 };150 };
151 // implementer = 0x53
152 const Samsung = [_]E{
153 E{ .part = 0x000, .m64 = &A64.exynos_m1 },
154 };
140 // implementer = 0x61155 // implementer = 0x61
141 const Apple = [_]E{156 const Apple = [_]E{
157 E{ .part = 0x020, .m64 = &A64.apple_m1 },
158 E{ .part = 0x021, .m64 = &A64.apple_m1 },
142 E{ .part = 0x022, .m64 = &A64.apple_m1 },159 E{ .part = 0x022, .m64 = &A64.apple_m1 },
143 E{ .part = 0x023, .m64 = &A64.apple_m1 },160 E{ .part = 0x023, .m64 = &A64.apple_m1 },
144 E{ .part = 0x024, .m64 = &A64.apple_m1 },161 E{ .part = 0x024, .m64 = &A64.apple_m1 },
...@@ -151,11 +168,43 @@ pub const cpu_models = struct {...@@ -151,11 +168,43 @@ pub const cpu_models = struct {
151 E{ .part = 0x035, .m64 = &A64.apple_m2 },168 E{ .part = 0x035, .m64 = &A64.apple_m2 },
152 E{ .part = 0x038, .m64 = &A64.apple_m2 },169 E{ .part = 0x038, .m64 = &A64.apple_m2 },
153 E{ .part = 0x039, .m64 = &A64.apple_m2 },170 E{ .part = 0x039, .m64 = &A64.apple_m2 },
171 E{ .part = 0x042, .m64 = &A64.apple_m3 },
172 E{ .part = 0x043, .m64 = &A64.apple_m3 },
173 E{ .part = 0x044, .m64 = &A64.apple_m3 },
174 E{ .part = 0x045, .m64 = &A64.apple_m3 },
175 E{ .part = 0x048, .m64 = &A64.apple_m3 },
176 E{ .part = 0x049, .m64 = &A64.apple_m3 },
177 E{ .part = 0x052, .m64 = &A64.apple_m4 },
178 E{ .part = 0x053, .m64 = &A64.apple_m4 },
179 E{ .part = 0x054, .m64 = &A64.apple_m4 },
180 E{ .part = 0x055, .m64 = &A64.apple_m4 },
181 E{ .part = 0x058, .m64 = &A64.apple_m4 },
182 E{ .part = 0x059, .m64 = &A64.apple_m4 },
183 };
184 // implementer = 0x63
185 const ArmChina = [_]E{
186 E{ .part = 0x132, .m32 = &A32.star_mc1 },
187 E{ .part = 0xd25, .m32 = &A32.star_mc3 },
188 };
189 // implementer = 0x68
190 const Hxt = [_]E{
191 E{ .part = 0x000, .m64 = &A64.cortex_a57 },
192 };
193 // implementer = 0x6d
194 const Microsoft = [_]E{
195 E{ .part = 0xd49, .m64 = &A64.neoverse_n2 },
196 };
197 // implementer = 0xC0
198 const AmpereOne = [_]E{
199 E{ .part = 0xac3, .m64 = &A64.ampere1 },
200 E{ .part = 0xac4, .m64 = &A64.ampere1a },
201 E{ .part = 0xac5, .m64 = &A64.ampere1b },
202 E{ .part = 0xac7, .m64 = &A64.ampere1c },
154 };203 };
155204
156 pub fn isKnown(core: CoreInfo, is_64bit: bool) ?*const Target.Cpu.Model {205 pub fn isKnown(core: CoreInfo, is_64bit: bool) ?*const Target.Cpu.Model {
157 const models = switch (core.implementer) {206 const models = switch (core.implementer) {
158 0x41 => &ARM,207 0x41 => &Arm,
159 0x42 => &Broadcom,208 0x42 => &Broadcom,
160 0x43 => &Cavium,209 0x43 => &Cavium,
161 0x46 => &Fujitsu,210 0x46 => &Fujitsu,
...@@ -163,7 +212,12 @@ pub const cpu_models = struct {...@@ -163,7 +212,12 @@ pub const cpu_models = struct {
163 0x4e => &Nvidia,212 0x4e => &Nvidia,
164 0x50 => &Ampere,213 0x50 => &Ampere,
165 0x51 => &Qualcomm,214 0x51 => &Qualcomm,
215 0x53 => &Samsung,
166 0x61 => &Apple,216 0x61 => &Apple,
217 0x63 => &ArmChina,
218 0x68 => &Hxt,
219 0x6d => &Microsoft,
220 0xC0 => &AmpereOne,
167 else => return null,221 else => return null,
168 };222 };
169223
lib/std/zig/system/windows.zig+34-1
...@@ -215,10 +215,43 @@ fn genericCpuAndNativeFeatures(arch: Target.Cpu.Arch) Target.Cpu {...@@ -215,10 +215,43 @@ fn genericCpuAndNativeFeatures(arch: Target.Cpu.Arch) Target.Cpu {
215 // Override any features that are either present or absent215 // Override any features that are either present or absent
216 setFeature(Feature, &cpu, .neon, IsProcessorFeaturePresent(PF.ARM_NEON_INSTRUCTIONS_AVAILABLE));216 setFeature(Feature, &cpu, .neon, IsProcessorFeaturePresent(PF.ARM_NEON_INSTRUCTIONS_AVAILABLE));
217 setFeature(Feature, &cpu, .crc, IsProcessorFeaturePresent(PF.ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE));217 setFeature(Feature, &cpu, .crc, IsProcessorFeaturePresent(PF.ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE));
218 setFeature(Feature, &cpu, .crypto, IsProcessorFeaturePresent(PF.ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE));218 setFeature(Feature, &cpu, .aes, IsProcessorFeaturePresent(PF.ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE));
219 setFeature(Feature, &cpu, .sha2, IsProcessorFeaturePresent(PF.ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE));
219 setFeature(Feature, &cpu, .lse, IsProcessorFeaturePresent(PF.ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE));220 setFeature(Feature, &cpu, .lse, IsProcessorFeaturePresent(PF.ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE));
220 setFeature(Feature, &cpu, .dotprod, IsProcessorFeaturePresent(PF.ARM_V82_DP_INSTRUCTIONS_AVAILABLE));221 setFeature(Feature, &cpu, .dotprod, IsProcessorFeaturePresent(PF.ARM_V82_DP_INSTRUCTIONS_AVAILABLE));
221 setFeature(Feature, &cpu, .jsconv, IsProcessorFeaturePresent(PF.ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE));222 setFeature(Feature, &cpu, .jsconv, IsProcessorFeaturePresent(PF.ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE));
223 setFeature(Feature, &cpu, .rcpc, IsProcessorFeaturePresent(PF.ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE));
224 setFeature(Feature, &cpu, .sve, IsProcessorFeaturePresent(PF.ARM_SVE_INSTRUCTIONS_AVAILABLE));
225 setFeature(Feature, &cpu, .sve2, IsProcessorFeaturePresent(PF.ARM_SVE2_INSTRUCTIONS_AVAILABLE));
226 setFeature(Feature, &cpu, .sve2p1, IsProcessorFeaturePresent(PF.ARM_SVE2_1_INSTRUCTIONS_AVAILABLE));
227 setFeature(Feature, &cpu, .sve_aes, IsProcessorFeaturePresent(PF.ARM_SVE_AES_INSTRUCTIONS_AVAILABLE) or IsProcessorFeaturePresent(PF.ARM_SVE_PMULL128_INSTRUCTIONS_AVAILABLE));
228 setFeature(Feature, &cpu, .sve_bitperm, IsProcessorFeaturePresent(PF.ARM_SVE_BITPERM_INSTRUCTIONS_AVAILABLE));
229 setFeature(Feature, &cpu, .bf16, IsProcessorFeaturePresent(PF.ARM_V86_BF16_INSTRUCTIONS_AVAILABLE));
230 setFeature(Feature, &cpu, .sve_b16b16, IsProcessorFeaturePresent(PF.ARM_SVE_B16B16_INSTRUCTIONS_AVAILABLE));
231 setFeature(Feature, &cpu, .sve_sha3, IsProcessorFeaturePresent(PF.ARM_SVE_SHA3_INSTRUCTIONS_AVAILABLE));
232 setFeature(Feature, &cpu, .sve_sm4, IsProcessorFeaturePresent(PF.ARM_SVE_SM4_INSTRUCTIONS_AVAILABLE));
233 setFeature(Feature, &cpu, .i8mm, IsProcessorFeaturePresent(PF.ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE));
234 setFeature(Feature, &cpu, .f32mm, IsProcessorFeaturePresent(PF.ARM_SVE_F32MM_INSTRUCTIONS_AVAILABLE));
235 setFeature(Feature, &cpu, .f64mm, IsProcessorFeaturePresent(PF.ARM_SVE_F64MM_INSTRUCTIONS_AVAILABLE));
236 setFeature(Feature, &cpu, .sme, IsProcessorFeaturePresent(PF.ARM_SME_INSTRUCTIONS_AVAILABLE));
237 setFeature(Feature, &cpu, .sme2, IsProcessorFeaturePresent(PF.ARM_SME2_INSTRUCTIONS_AVAILABLE));
238 setFeature(Feature, &cpu, .lse2, IsProcessorFeaturePresent(PF.ARM_LSE2_AVAILABLE));
239 setFeature(Feature, &cpu, .sha3, IsProcessorFeaturePresent(PF.ARM_SHA3_INSTRUCTIONS_AVAILABLE) and IsProcessorFeaturePresent(PF.ARM_SHA512_INSTRUCTIONS_AVAILABLE));
240 setFeature(Feature, &cpu, .fullfp16, IsProcessorFeaturePresent(PF.ARM_V82_FP16_INSTRUCTIONS_AVAILABLE));
241 setFeature(Feature, &cpu, .sme2p1, IsProcessorFeaturePresent(PF.ARM_SME2_1_INSTRUCTIONS_AVAILABLE));
242 setFeature(Feature, &cpu, .sme2p2, IsProcessorFeaturePresent(PF.ARM_SME2_2_INSTRUCTIONS_AVAILABLE));
243 setFeature(Feature, &cpu, .ssve_aes, IsProcessorFeaturePresent(PF.ARM_SME_AES_INSTRUCTIONS_AVAILABLE));
244 setFeature(Feature, &cpu, .ssve_bitperm, IsProcessorFeaturePresent(PF.ARM_SME_SBITPERM_INSTRUCTIONS_AVAILABLE));
245 setFeature(Feature, &cpu, .ssve_fp8dot2, IsProcessorFeaturePresent(PF.ARM_SME_SF8DP2_INSTRUCTIONS_AVAILABLE));
246 setFeature(Feature, &cpu, .ssve_fp8dot4, IsProcessorFeaturePresent(PF.ARM_SME_SF8DP4_INSTRUCTIONS_AVAILABLE));
247 setFeature(Feature, &cpu, .ssve_fp8fma, IsProcessorFeaturePresent(PF.ARM_SME_SF8FMA_INSTRUCTIONS_AVAILABLE));
248 setFeature(Feature, &cpu, .sme_f8f32, IsProcessorFeaturePresent(PF.ARM_SME_F8F32_INSTRUCTIONS_AVAILABLE));
249 setFeature(Feature, &cpu, .sme_f8f16, IsProcessorFeaturePresent(PF.ARM_SME_F8F16_INSTRUCTIONS_AVAILABLE));
250 setFeature(Feature, &cpu, .sme_b16b16, IsProcessorFeaturePresent(PF.ARM_SME_B16B16_INSTRUCTIONS_AVAILABLE));
251 setFeature(Feature, &cpu, .sme_f64f64, IsProcessorFeaturePresent(PF.ARM_SME_F64F64_INSTRUCTIONS_AVAILABLE));
252 setFeature(Feature, &cpu, .sme_i16i64, IsProcessorFeaturePresent(PF.ARM_SME_I16I64_INSTRUCTIONS_AVAILABLE));
253 setFeature(Feature, &cpu, .sme_lutv2, IsProcessorFeaturePresent(PF.ARM_SME_LUTv2_INSTRUCTIONS_AVAILABLE));
254 setFeature(Feature, &cpu, .sme_fa64, IsProcessorFeaturePresent(PF.ARM_SME_FA64_INSTRUCTIONS_AVAILABLE));
222 },255 },
223 else => {},256 else => {},
224 }257 }
lib/std/zig/system/x86.zig+60-16
...@@ -232,7 +232,7 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32...@@ -232,7 +232,7 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32
232 cpu.model = &Target.x86.cpu.lunarlake;232 cpu.model = &Target.x86.cpu.lunarlake;
233 return;233 return;
234 },234 },
235 0xcc => {235 0xcc, 0xd5 => {
236 cpu.model = &Target.x86.cpu.pantherlake;236 cpu.model = &Target.x86.cpu.pantherlake;
237 return;237 return;
238 },238 },
...@@ -307,6 +307,20 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32...@@ -307,6 +307,20 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32
307 cpu.model = &Target.x86.cpu.pentium4;307 cpu.model = &Target.x86.cpu.pentium4;
308 return;308 return;
309 },309 },
310 18 => switch (model) {
311 0x01, 0x03 => {
312 cpu.model = &Target.x86.cpu.novalake;
313 return;
314 },
315 else => return, // Unknown CPU Model
316 },
317 19 => switch (model) {
318 0x01 => {
319 cpu.model = &Target.x86.cpu.diamondrapids;
320 return;
321 },
322 else => return, // Unknown CPU Model
323 },
310 else => return, // Unknown CPU Model324 else => return, // Unknown CPU Model
311 }325 }
312}326}
...@@ -412,6 +426,8 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -412,6 +426,8 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
412 // AMX requires additional context to be saved by the OS.426 // AMX requires additional context to be saved by the OS.
413 const has_amx_save = xcr0.xtilecfg and xcr0.xtiledata;427 const has_amx_save = xcr0.xtilecfg and xcr0.xtiledata;
414428
429 const has_apx_save = xcr0.apx;
430
415 setFeature(cpu, .avx, has_avx_save);431 setFeature(cpu, .avx, has_avx_save);
416 setFeature(cpu, .fma, bit(leaf.ecx, 12) and has_avx_save);432 setFeature(cpu, .fma, bit(leaf.ecx, 12) and has_avx_save);
417 // Only enable XSAVE if OS has enabled support for saving YMM state.433 // Only enable XSAVE if OS has enabled support for saving YMM state.
...@@ -470,7 +486,20 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -470,7 +486,20 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
470 }486 }
471 }487 }
472488
473 if (max_level >= 0x7) {489 if (max_ext_level >= 0x80000021) {
490 leaf = cpuid(0x80000021, 0);
491
492 // AMD uses a different bit for prefetchi.
493 setFeature(cpu, .prefetchi, bit(leaf.eax, 20));
494 } else {
495 for ([_]Target.x86.Feature{
496 .prefetchi,
497 }) |feat| {
498 setFeature(cpu, feat, false);
499 }
500 }
501
502 const has_avx10 = if (max_level >= 0x7) has_avx10: {
474 leaf = cpuid(0x7, 0);503 leaf = cpuid(0x7, 0);
475504
476 setFeature(cpu, .fsgsbase, bit(leaf.ebx, 0));505 setFeature(cpu, .fsgsbase, bit(leaf.ebx, 0));
...@@ -484,7 +513,6 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -484,7 +513,6 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
484 setFeature(cpu, .rtm, bit(leaf.ebx, 11));513 setFeature(cpu, .rtm, bit(leaf.ebx, 11));
485 // AVX512 is only supported if the OS supports the context save for it.514 // AVX512 is only supported if the OS supports the context save for it.
486 setFeature(cpu, .avx512f, bit(leaf.ebx, 16) and has_avx512_save);515 setFeature(cpu, .avx512f, bit(leaf.ebx, 16) and has_avx512_save);
487 setFeature(cpu, .evex512, bit(leaf.ebx, 16) and has_avx512_save);
488 setFeature(cpu, .avx512dq, bit(leaf.ebx, 17) and has_avx512_save);516 setFeature(cpu, .avx512dq, bit(leaf.ebx, 17) and has_avx512_save);
489 setFeature(cpu, .rdseed, bit(leaf.ebx, 18));517 setFeature(cpu, .rdseed, bit(leaf.ebx, 18));
490 setFeature(cpu, .adx, bit(leaf.ebx, 19));518 setFeature(cpu, .adx, bit(leaf.ebx, 19));
...@@ -556,15 +584,20 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -556,15 +584,20 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
556 setFeature(cpu, .avxneconvert, bit(leaf.edx, 5) and has_avx_save);584 setFeature(cpu, .avxneconvert, bit(leaf.edx, 5) and has_avx_save);
557 setFeature(cpu, .amx_complex, bit(leaf.edx, 8) and has_amx_save);585 setFeature(cpu, .amx_complex, bit(leaf.edx, 8) and has_amx_save);
558 setFeature(cpu, .avxvnniint16, bit(leaf.edx, 10) and has_avx_save);586 setFeature(cpu, .avxvnniint16, bit(leaf.edx, 10) and has_avx_save);
559 setFeature(cpu, .prefetchi, bit(leaf.edx, 14));587 // This needs to account for prefetchi already being detected above on AMD.
588 setFeature(cpu, .prefetchi, cpu.has(.x86, .prefetchi) or bit(leaf.edx, 14));
560 setFeature(cpu, .usermsr, bit(leaf.edx, 15));589 setFeature(cpu, .usermsr, bit(leaf.edx, 15));
561 // APX590 // APX
562 setFeature(cpu, .egpr, bit(leaf.edx, 21));591 setFeature(cpu, .egpr, bit(leaf.edx, 21) and has_apx_save);
563 setFeature(cpu, .push2pop2, bit(leaf.edx, 21));592 setFeature(cpu, .push2pop2, bit(leaf.edx, 21) and has_apx_save);
564 setFeature(cpu, .ppx, bit(leaf.edx, 21));593 setFeature(cpu, .ppx, bit(leaf.edx, 21) and has_apx_save);
565 setFeature(cpu, .ndd, bit(leaf.edx, 21));594 setFeature(cpu, .ndd, bit(leaf.edx, 21) and has_apx_save);
566 setFeature(cpu, .ccmp, bit(leaf.edx, 21));595 setFeature(cpu, .ccmp, bit(leaf.edx, 21) and has_apx_save);
567 setFeature(cpu, .cf, bit(leaf.edx, 21));596 setFeature(cpu, .nf, bit(leaf.edx, 21) and has_apx_save);
597 setFeature(cpu, .cf, bit(leaf.edx, 21) and has_apx_save);
598 setFeature(cpu, .zu, bit(leaf.edx, 21) and has_apx_save);
599
600 break :has_avx10 bit(leaf.edx, 19);
568 } else {601 } else {
569 for ([_]Target.x86.Feature{602 for ([_]Target.x86.Feature{
570 .sha512,603 .sha512,
...@@ -582,19 +615,23 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -582,19 +615,23 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
582 .avxneconvert,615 .avxneconvert,
583 .amx_complex,616 .amx_complex,
584 .avxvnniint16,617 .avxvnniint16,
585 .prefetchi,618 // prefetchi already handled earlier.
586 .usermsr,619 .usermsr,
587 .egpr,620 .egpr,
588 .push2pop2,621 .push2pop2,
589 .ppx,622 .ppx,
590 .ndd,623 .ndd,
591 .ccmp,624 .ccmp,
625 .nf,
592 .cf,626 .cf,
627 .zu,
593 }) |feat| {628 }) |feat| {
594 setFeature(cpu, feat, false);629 setFeature(cpu, feat, false);
595 }630 }
596 }631 }
597 } else {632
633 break :has_avx10 false;
634 } else has_avx10: {
598 for ([_]Target.x86.Feature{635 for ([_]Target.x86.Feature{
599 .fsgsbase,636 .fsgsbase,
600 .sgx,637 .sgx,
...@@ -605,7 +642,6 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -605,7 +642,6 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
605 .invpcid,642 .invpcid,
606 .rtm,643 .rtm,
607 .avx512f,644 .avx512f,
608 .evex512,
609 .avx512dq,645 .avx512dq,
610 .rdseed,646 .rdseed,
611 .adx,647 .adx,
...@@ -664,18 +700,22 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -664,18 +700,22 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
664 .avxneconvert,700 .avxneconvert,
665 .amx_complex,701 .amx_complex,
666 .avxvnniint16,702 .avxvnniint16,
667 .prefetchi,703 // prefetchi already handled earlier.
668 .usermsr,704 .usermsr,
669 .egpr,705 .egpr,
670 .push2pop2,706 .push2pop2,
671 .ppx,707 .ppx,
672 .ndd,708 .ndd,
673 .ccmp,709 .ccmp,
710 .nf,
674 .cf,711 .cf,
712 .zu,
675 }) |feat| {713 }) |feat| {
676 setFeature(cpu, feat, false);714 setFeature(cpu, feat, false);
677 }715 }
678 }716
717 break :has_avx10 false;
718 };
679719
680 if (max_level >= 0xD and has_avx_save) {720 if (max_level >= 0xD and has_avx_save) {
681 leaf = cpuid(0xD, 0x1);721 leaf = cpuid(0xD, 0x1);
...@@ -721,10 +761,14 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {...@@ -721,10 +761,14 @@ fn detectNativeFeatures(cpu: *Target.Cpu, os_tag: Target.Os.Tag) void {
721 if (max_level >= 0x24) {761 if (max_level >= 0x24) {
722 leaf = cpuid(0x24, 0);762 leaf = cpuid(0x24, 0);
723763
724 setFeature(cpu, .avx10_1, bit(leaf.ebx, 18));764 const avx_ver = leaf.ebx & 0xff;
765
766 setFeature(cpu, .avx10_1, has_avx10 and avx_ver >= 1);
767 setFeature(cpu, .avx10_2, has_avx10 and avx_ver >= 2);
725 } else {768 } else {
726 for ([_]Target.x86.Feature{769 for ([_]Target.x86.Feature{
727 .avx10_1,770 .avx10_1,
771 .avx10_2,
728 }) |feat| {772 }) |feat| {
729 setFeature(cpu, feat, false);773 setFeature(cpu, feat, false);
730 }774 }
src/Compilation.zig+18-2
...@@ -3013,6 +3013,13 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE...@@ -3013,6 +3013,13 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE
3013 try comp.appendFileSystemInput(try .fromUnresolved(arena, comp.dirs, &.{c_object.src.src_path}));3013 try comp.appendFileSystemInput(try .fromUnresolved(arena, comp.dirs, &.{c_object.src.src_path}));
3014 }3014 }
30153015
3016 for (comp.link_inputs) |input| if (input.path()) |path| {
3017 try comp.appendFileSystemInput(try .fromUnresolved(arena, comp.dirs, &.{
3018 path.root_dir.path orelse ".",
3019 path.sub_path,
3020 }));
3021 };
3022
3016 // For compiling Win32 resources, we rely on the cache hash system to avoid duplicating work.3023 // For compiling Win32 resources, we rely on the cache hash system to avoid duplicating work.
3017 // Add a Job for each Win32 resource file.3024 // Add a Job for each Win32 resource file.
3018 try comp.win32_resource_work_queue.ensureUnusedCapacity(gpa, comp.win32_resource_table.count());3025 try comp.win32_resource_work_queue.ensureUnusedCapacity(gpa, comp.win32_resource_table.count());
...@@ -4763,12 +4770,12 @@ fn writeDepFile(...@@ -4763,12 +4770,12 @@ fn writeDepFile(
47634770
4764 try w.print("{f}:", .{bin_file});4771 try w.print("{f}:", .{bin_file});
47654772
4766 {4773 if (fsi.len > 0) {
4767 var it = std.mem.splitScalar(u8, fsi, 0);4774 var it = std.mem.splitScalar(u8, fsi, 0);
4768 while (it.next()) |input| try w.print(" \\\n {f}{s}", .{ prefixes[input[0] - 1], input[1..] });4775 while (it.next()) |input| try w.print(" \\\n {f}{s}", .{ prefixes[input[0] - 1], input[1..] });
4769 }4776 }
47704777
4771 {4778 if (fsi.len > 0) {
4772 var it = std.mem.splitScalar(u8, fsi, 0);4779 var it = std.mem.splitScalar(u8, fsi, 0);
4773 while (it.next()) |input| try w.print("\n\n{f}{s}:", .{ prefixes[input[0] - 1], input[1..] });4780 while (it.next()) |input| try w.print("\n\n{f}{s}:", .{ prefixes[input[0] - 1], input[1..] });
4774 }4781 }
...@@ -6355,6 +6362,13 @@ fn addCommonCCArgs(...@@ -6355,6 +6362,13 @@ fn addCommonCCArgs(
6355 try argv.append(6362 try argv.append(
6356 try std.fmt.allocPrint(arena, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}),6363 try std.fmt.allocPrint(arena, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}),
6357 );6364 );
6365
6366 // MinGW-w64's inline functions in headers (e.g. `fabs`), which are emitted with `linkonce_odr`
6367 // linkage, sometimes cause duplicate symbol errors due to us providing the same symbols with
6368 // `weak` linkage in compiler-rt or libzigc. So just disable them. Besides, they undermine the
6369 // goal of moving more libc code to Zig, and they're also just kind of unnecessary since LLVM is
6370 // perfectly capable of recognizing and optimizing libcalls.
6371 try argv.append("-D__CRT__NO_INLINE");
6358 } else if (target.isFreeBSDLibC()) {6372 } else if (target.isFreeBSDLibC()) {
6359 // https://docs.freebsd.org/en/books/porters-handbook/versions6373 // https://docs.freebsd.org/en/books/porters-handbook/versions
6360 const min_ver = target.os.version_range.semver.min;6374 const min_ver = target.os.version_range.semver.min;
...@@ -6794,6 +6808,8 @@ pub fn addCCArgs(...@@ -6794,6 +6808,8 @@ pub fn addCCArgs(
6794 // We communicate these to Clang through the dedicated options.6808 // We communicate these to Clang through the dedicated options.
6795 if (std.mem.startsWith(u8, llvm_name, "soft-float") or6809 if (std.mem.startsWith(u8, llvm_name, "soft-float") or
6796 std.mem.startsWith(u8, llvm_name, "hard-float") or6810 std.mem.startsWith(u8, llvm_name, "hard-float") or
6811 (target.cpu.arch.isPowerPC() and std.mem.startsWith(u8, llvm_name, "64bit")) or
6812 (target.cpu.arch.isX86() and std.mem.startsWith(u8, llvm_name, "x32")) or
6797 (target.cpu.arch == .s390x and std.mem.eql(u8, llvm_name, "backchain")))6813 (target.cpu.arch == .s390x and std.mem.eql(u8, llvm_name, "backchain")))
6798 continue;6814 continue;
67996815
src/Package/Module.zig+3
...@@ -347,6 +347,9 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {...@@ -347,6 +347,9 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
347 // See https://github.com/ziglang/zig/issues/23539347 // See https://github.com/ziglang/zig/issues/23539
348 if (target_util.isDynamicAMDGCNFeature(target, feature)) continue;348 if (target_util.isDynamicAMDGCNFeature(target, feature)) continue;
349349
350 if (target.cpu.arch.isPowerPC() and @as(std.Target.powerpc.Feature, @enumFromInt(feature.index)) == .@"64bit") continue;
351 if (target.cpu.arch.isX86() and @as(std.Target.x86.Feature, @enumFromInt(feature.index)) == .x32) continue;
352
350 var is_enabled = target.cpu.features.isEnabled(feature.index);353 var is_enabled = target.cpu.features.isEnabled(feature.index);
351 if (target.cpu.arch == .s390x and @as(std.Target.s390x.Feature, @enumFromInt(feature.index)) == .backchain) {354 if (target.cpu.arch == .s390x and @as(std.Target.s390x.Feature, @enumFromInt(feature.index)) == .backchain) {
352 is_enabled = !omit_frame_pointer;355 is_enabled = !omit_frame_pointer;
src/clang_options.zon+93-17
...@@ -273,6 +273,9 @@...@@ -273,6 +273,9 @@
273.{ .name = "utf-8", .psl = true },273.{ .name = "utf-8", .psl = true },
274.{ .name = "validate-charset", .psl = true },274.{ .name = "validate-charset", .psl = true },
275.{ .name = "validate-charset-", .psl = true },275.{ .name = "validate-charset-", .psl = true },
276.{ .name = "vlen", .psl = true },
277.{ .name = "vlen=256", .psl = true },
278.{ .name = "vlen=512", .psl = true },
276.{ .name = "vmb", .psl = true },279.{ .name = "vmb", .psl = true },
277.{ .name = "vmg", .psl = true },280.{ .name = "vmg", .psl = true },
278.{ .name = "vmm", .psl = true },281.{ .name = "vmm", .psl = true },
...@@ -692,9 +695,9 @@...@@ -692,9 +695,9 @@
692.{ .name = "fnew-alignment", .syntax = .separate },695.{ .name = "fnew-alignment", .syntax = .separate },
693.{ .name = "faligned-new" },696.{ .name = "faligned-new" },
694.{ .name = "fno-aligned-new" },697.{ .name = "fno-aligned-new" },
695.{ .name = "fsched-interblock" },
696.{ .name = "fcuda-rdc" },698.{ .name = "fcuda-rdc" },
697.{ .name = "fno-cuda-rdc" },699.{ .name = "fno-cuda-rdc" },
700.{ .name = "fsched-interblock" },
698.{ .name = "ftree-vectorize" },701.{ .name = "ftree-vectorize" },
699.{ .name = "fno-tree-vectorize" },702.{ .name = "fno-tree-vectorize" },
700.{ .name = "ftree-slp-vectorize" },703.{ .name = "ftree-slp-vectorize" },
...@@ -723,6 +726,8 @@...@@ -723,6 +726,8 @@
723.{ .name = "mtune=help", .ze = .mcpu },726.{ .name = "mtune=help", .ze = .mcpu },
724.{ .name = "integrated-as" },727.{ .name = "integrated-as" },
725.{ .name = "no-integrated-as" },728.{ .name = "no-integrated-as" },
729.{ .name = "shared-libasan" },
730.{ .name = "static-libasan" },
726.{ .name = "fopenmp-is-device" },731.{ .name = "fopenmp-is-device" },
727.{ .name = "fcuda-approx-transcendentals" },732.{ .name = "fcuda-approx-transcendentals" },
728.{ .name = "fno-cuda-approx-transcendentals" },733.{ .name = "fno-cuda-approx-transcendentals" },
...@@ -760,14 +765,12 @@...@@ -760,14 +765,12 @@
760.{ .name = "Oy-", .psl = true },765.{ .name = "Oy-", .psl = true },
761.{ .name = "Qgather-", .psl = true },766.{ .name = "Qgather-", .psl = true },
762.{ .name = "Qscatter-", .psl = true },767.{ .name = "Qscatter-", .psl = true },
763.{ .name = "shared-libasan" },
764.{ .name = "Xmicrosoft-visualc-tools-root", .syntax = .separate },768.{ .name = "Xmicrosoft-visualc-tools-root", .syntax = .separate },
765.{ .name = "Xmicrosoft-visualc-tools-version", .syntax = .separate },769.{ .name = "Xmicrosoft-visualc-tools-version", .syntax = .separate },
766.{ .name = "Xmicrosoft-windows-sdk-root", .syntax = .separate },770.{ .name = "Xmicrosoft-windows-sdk-root", .syntax = .separate },
767.{ .name = "Xmicrosoft-windows-sdk-version", .syntax = .separate },771.{ .name = "Xmicrosoft-windows-sdk-version", .syntax = .separate },
768.{ .name = "Xmicrosoft-windows-sys-root", .syntax = .separate },772.{ .name = "Xmicrosoft-windows-sys-root", .syntax = .separate },
769.{ .name = "Qembed_debug", .psl = true },773.{ .name = "Qembed_debug", .psl = true },
770.{ .name = "static-libasan" },
771.{ .name = "fslp-vectorize-aggressive" },774.{ .name = "fslp-vectorize-aggressive" },
772.{ .name = "fident" },775.{ .name = "fident" },
773.{ .name = "fno-ident" },776.{ .name = "fno-ident" },
...@@ -787,13 +790,13 @@...@@ -787,13 +790,13 @@
787.{ .name = "fno-sanitize-blacklist" },790.{ .name = "fno-sanitize-blacklist" },
788.{ .name = "fhonor-infinites" },791.{ .name = "fhonor-infinites" },
789.{ .name = "fno-honor-infinites" },792.{ .name = "fno-honor-infinites" },
790.{ .name = "findirect-virtual-calls" },
791.{793.{
792 .name = "config",794 .name = "config",
793 .syntax = .separate,795 .syntax = .separate,
794 .pd1 = false,796 .pd1 = false,
795 .pd2 = true,797 .pd2 = true,
796},798},
799.{ .name = "findirect-virtual-calls" },
797.{ .name = "ansi", .pd2 = true },800.{ .name = "ansi", .pd2 = true },
798.{ .name = "arch", .syntax = .separate },801.{ .name = "arch", .syntax = .separate },
799.{ .name = "arch_errors_fatal" },802.{ .name = "arch_errors_fatal" },
...@@ -900,6 +903,7 @@...@@ -900,6 +903,7 @@
900.{ .name = "dead_strip" },903.{ .name = "dead_strip" },
901.{ .name = "debug-forward-template-params" },904.{ .name = "debug-forward-template-params" },
902.{ .name = "debug-info-macro" },905.{ .name = "debug-info-macro" },
906.{ .name = "debug-info-macro-expansion-loc" },
903.{ .name = "default-function-attr", .syntax = .separate },907.{ .name = "default-function-attr", .syntax = .separate },
904.{908.{
905 .name = "defsym",909 .name = "defsym",
...@@ -934,14 +938,19 @@...@@ -934,14 +938,19 @@
934.{ .name = "dwarf-debug-producer", .syntax = .separate },938.{ .name = "dwarf-debug-producer", .syntax = .separate },
935.{ .name = "dwarf-explicit-import" },939.{ .name = "dwarf-explicit-import" },
936.{ .name = "dwarf-ext-refs" },940.{ .name = "dwarf-ext-refs" },
941.{ .name = "all-resources-bound", .psl = true },
942.{ .name = "Zpc", .psl = true },
937.{ .name = "Vd", .psl = true },943.{ .name = "Vd", .psl = true },
938.{ .name = "Gis", .psl = true },944.{ .name = "Gis", .psl = true },
939.{ .name = "hlsl-no-stdinc", .psl = true },945.{ .name = "hlsl-no-stdinc", .psl = true },
946.{ .name = "rootsig-define", .syntax = .separate },
940.{947.{
941 .name = "force-rootsig-ver",948 .name = "force-rootsig-ver",
942 .syntax = .separate,949 .syntax = .separate,
943 .psl = true,950 .psl = true,
944},951},
952.{ .name = "Zpr", .psl = true },
953.{ .name = "Qstrip-rootsignature", .psl = true },
945.{ .name = "dylib_file", .syntax = .separate },954.{ .name = "dylib_file", .syntax = .separate },
946.{ .name = "dylinker" },955.{ .name = "dylinker" },
947.{ .name = "dynamic", .ze = .dynamic },956.{ .name = "dynamic", .ze = .dynamic },
...@@ -1089,6 +1098,7 @@...@@ -1089,6 +1098,7 @@
1089.{ .name = "fcheck-array-temporaries" },1098.{ .name = "fcheck-array-temporaries" },
1090.{ .name = "fcheck-new" },1099.{ .name = "fcheck-new" },
1091.{ .name = "fclangir" },1100.{ .name = "fclangir" },
1101.{ .name = "fcoarray" },
1092.{ .name = "fcodegen-data-generate" },1102.{ .name = "fcodegen-data-generate" },
1093.{ .name = "fcodegen-data-use" },1103.{ .name = "fcodegen-data-use" },
1094.{ .name = "fcolor-diagnostics", .ze = .color_diagnostics },1104.{ .name = "fcolor-diagnostics", .ze = .color_diagnostics },
...@@ -1148,8 +1158,11 @@...@@ -1148,8 +1158,11 @@
1148.{ .name = "fdeclspec" },1158.{ .name = "fdeclspec" },
1149.{ .name = "fdefault-double-8" },1159.{ .name = "fdefault-double-8" },
1150.{ .name = "fdefault-inline" },1160.{ .name = "fdefault-inline" },
1161.{ .name = "fdefault-integer-4" },
1151.{ .name = "fdefault-integer-8" },1162.{ .name = "fdefault-integer-8" },
1163.{ .name = "fdefault-real-4" },
1152.{ .name = "fdefault-real-8" },1164.{ .name = "fdefault-real-8" },
1165.{ .name = "fdefer-ts" },
1153.{ .name = "fdefine-target-os-macros" },1166.{ .name = "fdefine-target-os-macros" },
1154.{ .name = "fdelayed-template-parsing" },1167.{ .name = "fdelayed-template-parsing" },
1155.{ .name = "fdelete-null-pointer-checks" },1168.{ .name = "fdelete-null-pointer-checks" },
...@@ -1205,9 +1218,11 @@...@@ -1205,9 +1218,11 @@
1205.{ .name = "ferror-limit", .syntax = .separate },1218.{ .name = "ferror-limit", .syntax = .separate },
1206.{ .name = "fescaping-block-tail-calls" },1219.{ .name = "fescaping-block-tail-calls" },
1207.{ .name = "fexceptions" },1220.{ .name = "fexceptions" },
1221.{ .name = "fexperimental-call-graph-section" },
1208.{ .name = "fexperimental-isel" },1222.{ .name = "fexperimental-isel" },
1209.{ .name = "fexperimental-late-parse-attributes" },1223.{ .name = "fexperimental-late-parse-attributes" },
1210.{ .name = "fexperimental-library" },1224.{ .name = "fexperimental-library" },
1225.{ .name = "fexperimental-loop-fusion" },
1211.{ .name = "fexperimental-new-constant-interpreter" },1226.{ .name = "fexperimental-new-constant-interpreter" },
1212.{ .name = "fexperimental-omit-vtable-rtti" },1227.{ .name = "fexperimental-omit-vtable-rtti" },
1213.{ .name = "fexperimental-relative-c++-abi-vtables" },1228.{ .name = "fexperimental-relative-c++-abi-vtables" },
...@@ -1221,6 +1236,7 @@...@@ -1221,6 +1236,7 @@
1221.{ .name = "ff2c" },1236.{ .name = "ff2c" },
1222.{ .name = "ffake-address-space-map" },1237.{ .name = "ffake-address-space-map" },
1223.{ .name = "ffast-math" },1238.{ .name = "ffast-math" },
1239.{ .name = "ffast-real-mod" },
1224.{ .name = "ffat-lto-objects" },1240.{ .name = "ffat-lto-objects" },
1225.{ .name = "ffile-reproducible" },1241.{ .name = "ffile-reproducible" },
1226.{ .name = "fimplicit-modules-use-lock" },1242.{ .name = "fimplicit-modules-use-lock" },
...@@ -1345,6 +1361,8 @@...@@ -1345,6 +1361,8 @@
1345.{ .name = "fhip-fp32-correctly-rounded-divide-sqrt" },1361.{ .name = "fhip-fp32-correctly-rounded-divide-sqrt" },
1346.{ .name = "fhip-kernel-arg-name" },1362.{ .name = "fhip-kernel-arg-name" },
1347.{ .name = "fhip-new-launch-api" },1363.{ .name = "fhip-new-launch-api" },
1364.{ .name = "fspv-enable-maximal-reconvergence" },
1365.{ .name = "fspv-use-unknown-image-format" },
1348.{ .name = "fhlsl-strict-availability" },1366.{ .name = "fhlsl-strict-availability" },
1349.{ .name = "fhonor-infinities" },1367.{ .name = "fhonor-infinities" },
1350.{ .name = "fhonor-nans" },1368.{ .name = "fhonor-nans" },
...@@ -1393,6 +1411,7 @@...@@ -1393,6 +1411,7 @@
1393.{ .name = "flat_namespace" },1411.{ .name = "flat_namespace" },
1394.{ .name = "flax-vector-conversions" },1412.{ .name = "flax-vector-conversions" },
1395.{ .name = "fexperimental-lifetime-safety" },1413.{ .name = "fexperimental-lifetime-safety" },
1414.{ .name = "fexperimental-lifetime-safety-inference" },
1396.{ .name = "flimit-debug-info" },1415.{ .name = "flimit-debug-info" },
1397.{ .name = "flogical-abbreviations" },1416.{ .name = "flogical-abbreviations" },
1398.{ .name = "floop-interchange" },1417.{ .name = "floop-interchange" },
...@@ -1428,7 +1447,9 @@...@@ -1428,7 +1447,9 @@
1428.{ .name = "fmodules-force-validate-user-headers" },1447.{ .name = "fmodules-force-validate-user-headers" },
1429.{ .name = "fmodules-hash-content" },1448.{ .name = "fmodules-hash-content" },
1430.{ .name = "fmodules-local-submodule-visibility" },1449.{ .name = "fmodules-local-submodule-visibility" },
1450.{ .name = "fmodules-reduced-bmi" },
1431.{ .name = "fmodules-search-all" },1451.{ .name = "fmodules-search-all" },
1452.{ .name = "fmodules-single-module-parse-mode" },
1432.{ .name = "fmodules-skip-diagnostic-options" },1453.{ .name = "fmodules-skip-diagnostic-options" },
1433.{ .name = "fmodules-skip-header-search-paths" },1454.{ .name = "fmodules-skip-header-search-paths" },
1434.{ .name = "fmodules-strict-context-hash" },1455.{ .name = "fmodules-strict-context-hash" },
...@@ -1448,8 +1469,10 @@...@@ -1448,8 +1469,10 @@
1448.{ .name = "fms-volatile" },1469.{ .name = "fms-volatile" },
1449.{ .name = "fmudflap" },1470.{ .name = "fmudflap" },
1450.{ .name = "fmudflapth" },1471.{ .name = "fmudflapth" },
1472.{ .name = "fnamed-loops" },
1451.{ .name = "fnative-half-arguments-and-returns" },1473.{ .name = "fnative-half-arguments-and-returns" },
1452.{ .name = "fnative-half-type" },1474.{ .name = "fnative-half-type" },
1475.{ .name = "fnative-int16-type" },
1453.{ .name = "fnested-functions" },1476.{ .name = "fnested-functions" },
1454.{ .name = "fnew-infallible" },1477.{ .name = "fnew-infallible" },
1455.{ .name = "fnext-runtime" },1478.{ .name = "fnext-runtime" },
...@@ -1539,6 +1562,7 @@...@@ -1539,6 +1562,7 @@
1539.{ .name = "fno-debug-types-section" },1562.{ .name = "fno-debug-types-section" },
1540.{ .name = "fno-declspec" },1563.{ .name = "fno-declspec" },
1541.{ .name = "fno-default-inline" },1564.{ .name = "fno-default-inline" },
1565.{ .name = "fno-defer-ts" },
1542.{ .name = "fno-define-target-os-macros" },1566.{ .name = "fno-define-target-os-macros" },
1543.{ .name = "fno-delayed-template-parsing" },1567.{ .name = "fno-delayed-template-parsing" },
1544.{ .name = "fno-delete-null-pointer-checks" },1568.{ .name = "fno-delete-null-pointer-checks" },
...@@ -1573,14 +1597,17 @@...@@ -1573,14 +1597,17 @@
1573.{ .name = "fno-emulated-tls" },1597.{ .name = "fno-emulated-tls" },
1574.{ .name = "fno-escaping-block-tail-calls" },1598.{ .name = "fno-escaping-block-tail-calls" },
1575.{ .name = "fno-exceptions" },1599.{ .name = "fno-exceptions" },
1600.{ .name = "fno-experimental-call-graph-section" },
1576.{ .name = "fno-experimental-isel" },1601.{ .name = "fno-experimental-isel" },
1577.{ .name = "fno-experimental-late-parse-attributes" },1602.{ .name = "fno-experimental-late-parse-attributes" },
1578.{ .name = "fno-experimental-library" },1603.{ .name = "fno-experimental-library" },
1604.{ .name = "fno-experimental-loop-fusion" },
1579.{ .name = "fno-experimental-omit-vtable-rtti" },1605.{ .name = "fno-experimental-omit-vtable-rtti" },
1580.{ .name = "fno-experimental-relative-c++-abi-vtables" },1606.{ .name = "fno-experimental-relative-c++-abi-vtables" },
1581.{ .name = "fno-external-blas" },1607.{ .name = "fno-external-blas" },
1582.{ .name = "fno-f2c" },1608.{ .name = "fno-f2c" },
1583.{ .name = "fno-fast-math" },1609.{ .name = "fno-fast-math" },
1610.{ .name = "fno-fast-real-mod" },
1584.{ .name = "fno-fat-lto-objects" },1611.{ .name = "fno-fat-lto-objects" },
1585.{ .name = "fno-file-reproducible" },1612.{ .name = "fno-file-reproducible" },
1586.{ .name = "fno-implicit-modules-use-lock" },1613.{ .name = "fno-implicit-modules-use-lock" },
...@@ -1646,6 +1673,7 @@...@@ -1646,6 +1673,7 @@
1646.{ .name = "fno-knr-functions" },1673.{ .name = "fno-knr-functions" },
1647.{ .name = "fno-lax-vector-conversions" },1674.{ .name = "fno-lax-vector-conversions" },
1648.{ .name = "fno-experimental-lifetime-safety" },1675.{ .name = "fno-experimental-lifetime-safety" },
1676.{ .name = "fno-experimental-lifetime-safety-inference" },
1649.{ .name = "fno-limit-debug-info" },1677.{ .name = "fno-limit-debug-info" },
1650.{ .name = "fno-logical-abbreviations" },1678.{ .name = "fno-logical-abbreviations" },
1651.{ .name = "fno-loop-interchange" },1679.{ .name = "fno-loop-interchange" },
...@@ -1671,6 +1699,7 @@...@@ -1671,6 +1699,7 @@
1671.{ .name = "fno-modules-force-validate-user-headers" },1699.{ .name = "fno-modules-force-validate-user-headers" },
1672.{ .name = "fno-modules-global-index" },1700.{ .name = "fno-modules-global-index" },
1673.{ .name = "fno-modules-prune-non-affecting-module-map-files" },1701.{ .name = "fno-modules-prune-non-affecting-module-map-files" },
1702.{ .name = "fno-modules-reduced-bmi" },
1674.{ .name = "fno-modules-search-all" },1703.{ .name = "fno-modules-search-all" },
1675.{ .name = "fno-modules-share-filemanager" },1704.{ .name = "fno-modules-share-filemanager" },
1676.{ .name = "fno-modules-skip-diagnostic-options" },1705.{ .name = "fno-modules-skip-diagnostic-options" },
...@@ -1685,12 +1714,14 @@...@@ -1685,12 +1714,14 @@
1685.{ .name = "fno-ms-extensions" },1714.{ .name = "fno-ms-extensions" },
1686.{ .name = "fno-ms-tls-guards" },1715.{ .name = "fno-ms-tls-guards" },
1687.{ .name = "fno-ms-volatile" },1716.{ .name = "fno-ms-volatile" },
1717.{ .name = "fno-named-loops" },
1688.{ .name = "fno-new-infallible" },1718.{ .name = "fno-new-infallible" },
1689.{ .name = "fno-non-call-exceptions" },1719.{ .name = "fno-non-call-exceptions" },
1690.{ .name = "fno-objc-arc" },1720.{ .name = "fno-objc-arc" },
1691.{ .name = "fno-objc-arc-exceptions" },1721.{ .name = "fno-objc-arc-exceptions" },
1692.{ .name = "fno-objc-avoid-heapify-local-blocks" },1722.{ .name = "fno-objc-avoid-heapify-local-blocks" },
1693.{ .name = "fno-objc-convert-messages-to-runtime-calls" },1723.{ .name = "fno-objc-convert-messages-to-runtime-calls" },
1724.{ .name = "fno-objc-direct-precondition-thunk" },
1694.{ .name = "fno-objc-encode-cxx-class-template-spec" },1725.{ .name = "fno-objc-encode-cxx-class-template-spec" },
1695.{ .name = "fno-objc-exceptions" },1726.{ .name = "fno-objc-exceptions" },
1696.{ .name = "fno-objc-infer-related-result-type" },1727.{ .name = "fno-objc-infer-related-result-type" },
...@@ -1718,6 +1749,7 @@...@@ -1718,6 +1749,7 @@
1718.{ .name = "fno-pack-derived" },1749.{ .name = "fno-pack-derived" },
1719.{ .name = "fno-pack-struct" },1750.{ .name = "fno-pack-struct" },
1720.{ .name = "fno-padding-on-unsigned-fixed-point" },1751.{ .name = "fno-padding-on-unsigned-fixed-point" },
1752.{ .name = "fno-partition-static-data-sections" },
1721.{ .name = "fno-pascal-strings" },1753.{ .name = "fno-pascal-strings" },
1722.{ .name = "fno-pch-codegen" },1754.{ .name = "fno-pch-codegen" },
1723.{ .name = "fno-pch-debuginfo" },1755.{ .name = "fno-pch-debuginfo" },
...@@ -1802,9 +1834,13 @@...@@ -1802,9 +1834,13 @@
1802.{ .name = "fno-sanitize-address-poison-custom-array-cookie" },1834.{ .name = "fno-sanitize-address-poison-custom-array-cookie" },
1803.{ .name = "fno-sanitize-address-use-after-scope" },1835.{ .name = "fno-sanitize-address-use-after-scope" },
1804.{ .name = "fno-sanitize-address-use-odr-indicator" },1836.{ .name = "fno-sanitize-address-use-odr-indicator" },
1837.{ .name = "fno-sanitize-alloc-token-extended" },
1838.{ .name = "fno-sanitize-alloc-token-fast-abi" },
1805.{ .name = "fno-sanitize-annotate-debug-info" },1839.{ .name = "fno-sanitize-annotate-debug-info" },
1806.{ .name = "fno-sanitize-cfi-canonical-jump-tables" },1840.{ .name = "fno-sanitize-cfi-canonical-jump-tables" },
1807.{ .name = "fno-sanitize-cfi-cross-dso" },1841.{ .name = "fno-sanitize-cfi-cross-dso" },
1842.{ .name = "fno-sanitize-debug-trap-reasons" },
1843.{ .name = "fno-sanitize-handler-preserve-all-regs" },
1808.{ .name = "fno-sanitize-hwaddress-experimental-aliasing" },1844.{ .name = "fno-sanitize-hwaddress-experimental-aliasing" },
1809.{ .name = "fno-sanitize-ignorelist" },1845.{ .name = "fno-sanitize-ignorelist" },
1810.{ .name = "fno-sanitize-link-c++-runtime" },1846.{ .name = "fno-sanitize-link-c++-runtime" },
...@@ -1821,6 +1857,7 @@...@@ -1821,6 +1857,7 @@
1821.{ .name = "fno-sanitize-thread-func-entry-exit" },1857.{ .name = "fno-sanitize-thread-func-entry-exit" },
1822.{ .name = "fno-sanitize-thread-memory-access" },1858.{ .name = "fno-sanitize-thread-memory-access" },
1823.{ .name = "fno-sanitize-trap", .ze = .no_sanitize_trap },1859.{ .name = "fno-sanitize-trap", .ze = .no_sanitize_trap },
1860.{ .name = "fno-sanitize-type-outline-instrumentation" },
1824.{ .name = "fno-sanitize-undefined-trap-on-error" },1861.{ .name = "fno-sanitize-undefined-trap-on-error" },
1825.{ .name = "fno-save-main-program" },1862.{ .name = "fno-save-main-program" },
1826.{ .name = "fno-save-optimization-record" },1863.{ .name = "fno-save-optimization-record" },
...@@ -1887,6 +1924,7 @@...@@ -1887,6 +1924,7 @@
1887.{ .name = "fno-unique-source-file-names" },1924.{ .name = "fno-unique-source-file-names" },
1888.{ .name = "fno-unroll-all-loops" },1925.{ .name = "fno-unroll-all-loops" },
1889.{ .name = "fno-unroll-loops" },1926.{ .name = "fno-unroll-loops" },
1927.{ .name = "fno-unsafe-cray-pointers" },
1890.{ .name = "fno-unsafe-loop-optimizations" },1928.{ .name = "fno-unsafe-loop-optimizations" },
1891.{ .name = "fno-unsafe-math-optimizations" },1929.{ .name = "fno-unsafe-math-optimizations" },
1892.{ .name = "fno-unsigned" },1930.{ .name = "fno-unsigned" },
...@@ -1938,6 +1976,7 @@...@@ -1938,6 +1976,7 @@
1938.{ .name = "fobjc-avoid-heapify-local-blocks" },1976.{ .name = "fobjc-avoid-heapify-local-blocks" },
1939.{ .name = "fobjc-call-cxx-cdtors" },1977.{ .name = "fobjc-call-cxx-cdtors" },
1940.{ .name = "fobjc-convert-messages-to-runtime-calls" },1978.{ .name = "fobjc-convert-messages-to-runtime-calls" },
1979.{ .name = "fobjc-direct-precondition-thunk" },
1941.{ .name = "fobjc-disable-direct-methods-for-testing" },1980.{ .name = "fobjc-disable-direct-methods-for-testing" },
1942.{ .name = "fobjc-encode-cxx-class-template-spec" },1981.{ .name = "fobjc-encode-cxx-class-template-spec" },
1943.{ .name = "fobjc-exceptions" },1982.{ .name = "fobjc-exceptions" },
...@@ -1987,6 +2026,7 @@...@@ -1987,6 +2026,7 @@
1987.{ .name = "fpack-struct" },2026.{ .name = "fpack-struct" },
1988.{ .name = "fpadding-on-unsigned-fixed-point" },2027.{ .name = "fpadding-on-unsigned-fixed-point" },
1989.{ .name = "fparse-all-comments" },2028.{ .name = "fparse-all-comments" },
2029.{ .name = "fpartition-static-data-sections" },
1990.{ .name = "fpascal-strings" },2030.{ .name = "fpascal-strings" },
1991.{ .name = "fpass-by-value-is-noalias" },2031.{ .name = "fpass-by-value-is-noalias" },
1992.{ .name = "fpcc-struct-return" },2032.{ .name = "fpcc-struct-return" },
...@@ -2081,6 +2121,8 @@...@@ -2081,6 +2121,8 @@
2081.{ .name = "fsanitize-address-poison-custom-array-cookie" },2121.{ .name = "fsanitize-address-poison-custom-array-cookie" },
2082.{ .name = "fsanitize-address-use-after-scope" },2122.{ .name = "fsanitize-address-use-after-scope" },
2083.{ .name = "fsanitize-address-use-odr-indicator" },2123.{ .name = "fsanitize-address-use-odr-indicator" },
2124.{ .name = "fsanitize-alloc-token-extended" },
2125.{ .name = "fsanitize-alloc-token-fast-abi" },
2084.{ .name = "fsanitize-annotate-debug-info" },2126.{ .name = "fsanitize-annotate-debug-info" },
2085.{ .name = "fsanitize-cfi-canonical-jump-tables" },2127.{ .name = "fsanitize-cfi-canonical-jump-tables" },
2086.{ .name = "fsanitize-cfi-cross-dso" },2128.{ .name = "fsanitize-cfi-cross-dso" },
...@@ -2102,6 +2144,8 @@...@@ -2102,6 +2144,8 @@
2102.{ .name = "fsanitize-coverage-trace-pc" },2144.{ .name = "fsanitize-coverage-trace-pc" },
2103.{ .name = "fsanitize-coverage-trace-pc-guard", .ze = .san_cov_trace_pc_guard },2145.{ .name = "fsanitize-coverage-trace-pc-guard", .ze = .san_cov_trace_pc_guard },
2104.{ .name = "fsanitize-coverage-trace-stores" },2146.{ .name = "fsanitize-coverage-trace-stores" },
2147.{ .name = "fsanitize-debug-trap-reasons" },
2148.{ .name = "fsanitize-handler-preserve-all-regs" },
2105.{ .name = "fsanitize-hwaddress-experimental-aliasing" },2149.{ .name = "fsanitize-hwaddress-experimental-aliasing" },
2106.{ .name = "fsanitize-kcfi-arity" },2150.{ .name = "fsanitize-kcfi-arity" },
2107.{ .name = "fsanitize-link-c++-runtime" },2151.{ .name = "fsanitize-link-c++-runtime" },
...@@ -2118,6 +2162,7 @@...@@ -2118,6 +2162,7 @@
2118.{ .name = "fsanitize-thread-func-entry-exit" },2162.{ .name = "fsanitize-thread-func-entry-exit" },
2119.{ .name = "fsanitize-thread-memory-access" },2163.{ .name = "fsanitize-thread-memory-access" },
2120.{ .name = "fsanitize-trap", .ze = .sanitize_trap },2164.{ .name = "fsanitize-trap", .ze = .sanitize_trap },
2165.{ .name = "fsanitize-type-outline-instrumentation" },
2121.{ .name = "fsanitize-undefined-trap-on-error" },2166.{ .name = "fsanitize-undefined-trap-on-error" },
2122.{ .name = "fsave-main-program" },2167.{ .name = "fsave-main-program" },
2123.{ .name = "fsave-optimization-record" },2168.{ .name = "fsave-optimization-record" },
...@@ -2205,6 +2250,7 @@...@@ -2205,6 +2250,7 @@
2205.{ .name = "funknown-anytype" },2250.{ .name = "funknown-anytype" },
2206.{ .name = "funroll-all-loops" },2251.{ .name = "funroll-all-loops" },
2207.{ .name = "funroll-loops" },2252.{ .name = "funroll-loops" },
2253.{ .name = "funsafe-cray-pointers" },
2208.{ .name = "funsafe-loop-optimizations" },2254.{ .name = "funsafe-loop-optimizations" },
2209.{ .name = "funsafe-math-optimizations" },2255.{ .name = "funsafe-math-optimizations" },
2210.{ .name = "funsigned" },2256.{ .name = "funsigned" },
...@@ -2259,6 +2305,7 @@...@@ -2259,6 +2305,7 @@
2259.{ .name = "g2" },2305.{ .name = "g2" },
2260.{ .name = "g3" },2306.{ .name = "g3" },
2261.{ .name = "g", .ze = .debug },2307.{ .name = "g", .ze = .debug },
2308.{ .name = "gcall-site-info" },
2262.{ .name = "gcodeview" },2309.{ .name = "gcodeview" },
2263.{ .name = "gcodeview-command-line" },2310.{ .name = "gcodeview-command-line" },
2264.{ .name = "gcodeview-ghash" },2311.{ .name = "gcodeview-ghash" },
...@@ -2271,6 +2318,7 @@...@@ -2271,6 +2318,7 @@
2271.{ .name = "gdwarf-3", .ze = .debug },2318.{ .name = "gdwarf-3", .ze = .debug },
2272.{ .name = "gdwarf-4", .ze = .debug },2319.{ .name = "gdwarf-4", .ze = .debug },
2273.{ .name = "gdwarf-5", .ze = .debug },2320.{ .name = "gdwarf-5", .ze = .debug },
2321.{ .name = "gdwarf-6" },
2274.{ .name = "gdwarf-aranges" },2322.{ .name = "gdwarf-aranges" },
2275.{ .name = "gembed-source" },2323.{ .name = "gembed-source" },
2276.{ .name = "gen-cdb-fragment-path", .syntax = .separate },2324.{ .name = "gen-cdb-fragment-path", .syntax = .separate },
...@@ -2289,6 +2337,7 @@...@@ -2289,6 +2337,7 @@
2289.{ .name = "glldb" },2337.{ .name = "glldb" },
2290.{ .name = "gmlt" },2338.{ .name = "gmlt" },
2291.{ .name = "gmodules" },2339.{ .name = "gmodules" },
2340.{ .name = "gno-call-site-info" },
2292.{ .name = "gno-codeview-command-line" },2341.{ .name = "gno-codeview-command-line" },
2293.{ .name = "gno-codeview-ghash" },2342.{ .name = "gno-codeview-ghash" },
2294.{ .name = "gno-column-info" },2343.{ .name = "gno-column-info" },
...@@ -2303,6 +2352,7 @@...@@ -2303,6 +2352,7 @@
2303.{ .name = "gno-simple-template-names" },2352.{ .name = "gno-simple-template-names" },
2304.{ .name = "gno-split-dwarf" },2353.{ .name = "gno-split-dwarf" },
2305.{ .name = "gno-strict-dwarf" },2354.{ .name = "gno-strict-dwarf" },
2355.{ .name = "gno-structor-decl-linkage-names" },
2306.{ .name = "gno-template-alias" },2356.{ .name = "gno-template-alias" },
2307.{ .name = "gomit-unreferenced-methods" },2357.{ .name = "gomit-unreferenced-methods" },
2308.{2358.{
...@@ -2319,9 +2369,15 @@...@@ -2319,9 +2369,15 @@
2319.{ .name = "gpulibc" },2369.{ .name = "gpulibc" },
2320.{ .name = "grecord-command-line" },2370.{ .name = "grecord-command-line" },
2321.{ .name = "gsce" },2371.{ .name = "gsce" },
2372.{
2373 .name = "gsframe",
2374 .pd1 = false,
2375 .pd2 = true,
2376},
2322.{ .name = "gsimple-template-names" },2377.{ .name = "gsimple-template-names" },
2323.{ .name = "gsplit-dwarf" },2378.{ .name = "gsplit-dwarf" },
2324.{ .name = "gstrict-dwarf" },2379.{ .name = "gstrict-dwarf" },
2380.{ .name = "gstructor-decl-linkage-names" },
2325.{ .name = "gtemplate-alias" },2381.{ .name = "gtemplate-alias" },
2326.{ .name = "gtoggle" },2382.{ .name = "gtoggle" },
2327.{ .name = "gused" },2383.{ .name = "gused" },
...@@ -2347,6 +2403,7 @@...@@ -2347,6 +2403,7 @@
2347 .pd1 = false,2403 .pd1 = false,
2348 .pd2 = true,2404 .pd2 = true,
2349},2405},
2406.{ .name = "hlsl-all-resources-bound", .psl = true },
2350.{ .name = "ibuiltininc" },2407.{ .name = "ibuiltininc" },
2351.{ .name = "ignore-pch" },2408.{ .name = "ignore-pch" },
2352.{ .name = "image_base", .syntax = .separate },2409.{ .name = "image_base", .syntax = .separate },
...@@ -2397,6 +2454,7 @@...@@ -2397,6 +2454,7 @@
2397.{ .name = "maix-struct-return" },2454.{ .name = "maix-struct-return" },
2398.{ .name = "malign-double" },2455.{ .name = "malign-double" },
2399.{ .name = "maltivec", .ze = .m },2456.{ .name = "maltivec", .ze = .m },
2457.{ .name = "mamdgpu-expand-waitcnt-profiling" },
2400.{ .name = "mamdgpu-ieee" },2458.{ .name = "mamdgpu-ieee" },
2401.{ .name = "mamdgpu-precise-memory-op" },2459.{ .name = "mamdgpu-precise-memory-op" },
2402.{ .name = "mamx-avx512", .ze = .m },2460.{ .name = "mamx-avx512", .ze = .m },
...@@ -2408,7 +2466,6 @@...@@ -2408,7 +2466,6 @@
2408.{ .name = "mamx-movrs", .ze = .m },2466.{ .name = "mamx-movrs", .ze = .m },
2409.{ .name = "mamx-tf32", .ze = .m },2467.{ .name = "mamx-tf32", .ze = .m },
2410.{ .name = "mamx-tile", .ze = .m },2468.{ .name = "mamx-tile", .ze = .m },
2411.{ .name = "mamx-transpose", .ze = .m },
2412.{ .name = "mannotate-tablejump" },2469.{ .name = "mannotate-tablejump" },
2413.{ .name = "mapx-inline-asm-use-gpr32" },2470.{ .name = "mapx-inline-asm-use-gpr32" },
2414.{ .name = "mapxf" },2471.{ .name = "mapxf" },
...@@ -2418,11 +2475,7 @@...@@ -2418,11 +2475,7 @@
2418.{ .name = "matomics", .ze = .m },2475.{ .name = "matomics", .ze = .m },
2419.{ .name = "mavx", .ze = .m },2476.{ .name = "mavx", .ze = .m },
2420.{ .name = "mavx10.1" },2477.{ .name = "mavx10.1" },
2421.{ .name = "mavx10.1-256" },
2422.{ .name = "mavx10.1-512", .ze = .m },
2423.{ .name = "mavx10.2" },2478.{ .name = "mavx10.2" },
2424.{ .name = "mavx10.2-256" },
2425.{ .name = "mavx10.2-512", .ze = .m },
2426.{ .name = "mavx2", .ze = .m },2479.{ .name = "mavx2", .ze = .m },
2427.{ .name = "mavx512bf16", .ze = .m },2480.{ .name = "mavx512bf16", .ze = .m },
2428.{ .name = "mavx512bitalg", .ze = .m },2481.{ .name = "mavx512bitalg", .ze = .m },
...@@ -2485,7 +2538,6 @@...@@ -2485,7 +2538,6 @@
2485.{ .name = "menable-no-nans" },2538.{ .name = "menable-no-nans" },
2486.{ .name = "menqcmd", .ze = .m },2539.{ .name = "menqcmd", .ze = .m },
2487.{ .name = "metal", .psl = true },2540.{ .name = "metal", .psl = true },
2488.{ .name = "mevex512", .ze = .m },
2489.{ .name = "mexception-handling", .ze = .m },2541.{ .name = "mexception-handling", .ze = .m },
2490.{ .name = "mexecute-only", .ze = .m },2542.{ .name = "mexecute-only", .ze = .m },
2491.{ .name = "mextended-const", .ze = .m },2543.{ .name = "mextended-const", .ze = .m },
...@@ -2517,6 +2569,7 @@...@@ -2517,6 +2569,7 @@
2517.{ .name = "mfsgsbase", .ze = .m },2569.{ .name = "mfsgsbase", .ze = .m },
2518.{ .name = "mfsmuld" },2570.{ .name = "mfsmuld" },
2519.{ .name = "mfxsr", .ze = .m },2571.{ .name = "mfxsr", .ze = .m },
2572.{ .name = "mgc" },
2520.{ .name = "mgeneral-regs-only" },2573.{ .name = "mgeneral-regs-only" },
2521.{ .name = "mgfni", .ze = .m },2574.{ .name = "mgfni", .ze = .m },
2522.{ .name = "mginv", .ze = .m },2575.{ .name = "mginv", .ze = .m },
...@@ -2614,6 +2667,7 @@...@@ -2614,6 +2667,7 @@
2614.{ .name = "mno-adx", .ze = .m },2667.{ .name = "mno-adx", .ze = .m },
2615.{ .name = "mno-aes", .ze = .m },2668.{ .name = "mno-aes", .ze = .m },
2616.{ .name = "mno-altivec", .ze = .m },2669.{ .name = "mno-altivec", .ze = .m },
2670.{ .name = "mno-amdgpu-expand-waitcnt-profiling" },
2617.{ .name = "mno-amdgpu-ieee" },2671.{ .name = "mno-amdgpu-ieee" },
2618.{ .name = "mno-amdgpu-precise-memory-op" },2672.{ .name = "mno-amdgpu-precise-memory-op" },
2619.{ .name = "mno-amx-avx512", .ze = .m },2673.{ .name = "mno-amx-avx512", .ze = .m },
...@@ -2625,14 +2679,11 @@...@@ -2625,14 +2679,11 @@
2625.{ .name = "mno-amx-movrs", .ze = .m },2679.{ .name = "mno-amx-movrs", .ze = .m },
2626.{ .name = "mno-amx-tf32", .ze = .m },2680.{ .name = "mno-amx-tf32", .ze = .m },
2627.{ .name = "mno-amx-tile", .ze = .m },2681.{ .name = "mno-amx-tile", .ze = .m },
2628.{ .name = "mno-amx-transpose", .ze = .m },
2629.{ .name = "mno-annotate-tablejump" },2682.{ .name = "mno-annotate-tablejump" },
2630.{ .name = "mno-apxf" },2683.{ .name = "mno-apxf" },
2631.{ .name = "mno-atomics", .ze = .m },2684.{ .name = "mno-atomics", .ze = .m },
2632.{ .name = "mno-avx", .ze = .m },2685.{ .name = "mno-avx", .ze = .m },
2633.{ .name = "mno-avx10.1" },2686.{ .name = "mno-avx10.1" },
2634.{ .name = "mno-avx10.1-256" },
2635.{ .name = "mno-avx10.1-512", .ze = .m },
2636.{ .name = "mno-avx10.2" },2687.{ .name = "mno-avx10.2" },
2637.{ .name = "mno-avx2", .ze = .m },2688.{ .name = "mno-avx2", .ze = .m },
2638.{ .name = "mno-avx512bf16", .ze = .m },2689.{ .name = "mno-avx512bf16", .ze = .m },
...@@ -2682,7 +2733,6 @@...@@ -2682,7 +2733,6 @@
2682.{ .name = "mno-dspr2", .ze = .m },2733.{ .name = "mno-dspr2", .ze = .m },
2683.{ .name = "mno-embedded-data" },2734.{ .name = "mno-embedded-data" },
2684.{ .name = "mno-enqcmd", .ze = .m },2735.{ .name = "mno-enqcmd", .ze = .m },
2685.{ .name = "mno-evex512", .ze = .m },
2686.{ .name = "mno-exception-handling", .ze = .m },2736.{ .name = "mno-exception-handling", .ze = .m },
2687.{ .name = "mnoexecstack" },2737.{ .name = "mnoexecstack" },
2688.{ .name = "mno-execute-only", .ze = .m },2738.{ .name = "mno-execute-only", .ze = .m },
...@@ -2707,6 +2757,7 @@...@@ -2707,6 +2757,7 @@
2707.{ .name = "mno-fsmuld", .ze = .m },2757.{ .name = "mno-fsmuld", .ze = .m },
2708.{ .name = "mno-fxsr", .ze = .m },2758.{ .name = "mno-fxsr", .ze = .m },
2709.{ .name = "mno-gather" },2759.{ .name = "mno-gather" },
2760.{ .name = "mno-gc" },
2710.{ .name = "mno-gfni", .ze = .m },2761.{ .name = "mno-gfni", .ze = .m },
2711.{ .name = "mno-ginv", .ze = .m },2762.{ .name = "mno-ginv", .ze = .m },
2712.{ .name = "mno-global-merge" },2763.{ .name = "mno-global-merge" },
...@@ -2798,6 +2849,7 @@...@@ -2798,6 +2849,7 @@
2798.{ .name = "mno-relax-all" },2849.{ .name = "mno-relax-all" },
2799.{ .name = "mno-relax-pic-calls" },2850.{ .name = "mno-relax-pic-calls" },
2800.{ .name = "mno-relaxed-simd", .ze = .m },2851.{ .name = "mno-relaxed-simd", .ze = .m },
2852.{ .name = "mno-reserve-frame-pointer-reg" },
2801.{ .name = "mno-restrict-it" },2853.{ .name = "mno-restrict-it" },
2802.{ .name = "mno-retpoline", .ze = .m },2854.{ .name = "mno-retpoline", .ze = .m },
2803.{ .name = "mno-retpoline-external-thunk", .ze = .m },2855.{ .name = "mno-retpoline-external-thunk", .ze = .m },
...@@ -2886,7 +2938,6 @@...@@ -2886,7 +2938,6 @@
2886.{ .name = "module-file-deps" },2938.{ .name = "module-file-deps" },
2887.{ .name = "module-file-info" },2939.{ .name = "module-file-info" },
2888.{ .name = "module-suffix", .syntax = .separate },2940.{ .name = "module-suffix", .syntax = .separate },
2889.{ .name = "fmodules-reduced-bmi" },
2890.{ .name = "momit-leaf-frame-pointer" },2941.{ .name = "momit-leaf-frame-pointer" },
2891.{ .name = "moutline" },2942.{ .name = "moutline" },
2892.{ .name = "moutline-atomics", .ze = .m },2943.{ .name = "moutline-atomics", .ze = .m },
...@@ -2931,6 +2982,7 @@...@@ -2931,6 +2982,7 @@
2931.{ .name = "mrelax-relocations=no" },2982.{ .name = "mrelax-relocations=no" },
2932.{ .name = "mrelaxed-simd", .ze = .m },2983.{ .name = "mrelaxed-simd", .ze = .m },
2933.{ .name = "mrelocation-model", .syntax = .separate },2984.{ .name = "mrelocation-model", .syntax = .separate },
2985.{ .name = "mreserve-frame-pointer-reg" },
2934.{ .name = "mrestrict-it" },2986.{ .name = "mrestrict-it" },
2935.{ .name = "mretpoline", .ze = .m },2987.{ .name = "mretpoline", .ze = .m },
2936.{ .name = "mretpoline-external-thunk", .ze = .m },2988.{ .name = "mretpoline-external-thunk", .ze = .m },
...@@ -3007,6 +3059,7 @@...@@ -3007,6 +3059,7 @@
3007.{ .name = "mv73", .ze = .m },3059.{ .name = "mv73", .ze = .m },
3008.{ .name = "mv75", .ze = .m },3060.{ .name = "mv75", .ze = .m },
3009.{ .name = "mv79", .ze = .m },3061.{ .name = "mv79", .ze = .m },
3062.{ .name = "mv81" },
3010.{ .name = "mv8plus", .ze = .m },3063.{ .name = "mv8plus", .ze = .m },
3011.{ .name = "mvaes", .ze = .m },3064.{ .name = "mvaes", .ze = .m },
3012.{ .name = "mvector-strict-align" },3065.{ .name = "mvector-strict-align" },
...@@ -3101,6 +3154,7 @@...@@ -3101,6 +3154,7 @@
3101.{ .name = "no-pthread" },3154.{ .name = "no-pthread" },
3102.{ .name = "no-round-trip-args" },3155.{ .name = "no-round-trip-args" },
3103.{ .name = "no-struct-path-tbaa" },3156.{ .name = "no-struct-path-tbaa" },
3157.{ .name = "no-use-spirv-backend" },
3104.{3158.{
3105 .name = "no-wasm-opt",3159 .name = "no-wasm-opt",
3106 .pd1 = false,3160 .pd1 = false,
...@@ -3311,6 +3365,7 @@...@@ -3311,6 +3365,7 @@
3311.{ .name = "static-openmp" },3365.{ .name = "static-openmp" },
3312.{ .name = "static-pie" },3366.{ .name = "static-pie" },
3313.{ .name = "stats-file-append" },3367.{ .name = "stats-file-append" },
3368.{ .name = "stats-file-timers" },
3314.{ .name = "stdlib" },3369.{ .name = "stdlib" },
3315.{3370.{
3316 .name = "sycl-link",3371 .name = "sycl-link",
...@@ -3368,6 +3423,7 @@...@@ -3368,6 +3423,7 @@
3368.{ .name = "Wrealloc-lhs-all", .pd2 = true },3423.{ .name = "Wrealloc-lhs-all", .pd2 = true },
3369.{ .name = "Wfrontend-loop-interchange", .pd2 = true },3424.{ .name = "Wfrontend-loop-interchange", .pd2 = true },
3370.{ .name = "Wtarget-lifetime", .pd2 = true },3425.{ .name = "Wtarget-lifetime", .pd2 = true },
3426.{ .name = "use-spirv-backend" },
3371.{ .name = "v", .ze = .verbose },3427.{ .name = "v", .ze = .verbose },
3372.{ .name = "vectorize-loops" },3428.{ .name = "vectorize-loops" },
3373.{ .name = "vectorize-slp" },3429.{ .name = "vectorize-slp" },
...@@ -3469,6 +3525,7 @@...@@ -3469,6 +3525,7 @@
3469.{ .name = "fobjc-nonfragile-abi-version=", .syntax = .joined },3525.{ .name = "fobjc-nonfragile-abi-version=", .syntax = .joined },
3470.{ .name = "fprofile-instrument-use-path=", .syntax = .joined },3526.{ .name = "fprofile-instrument-use-path=", .syntax = .joined },
3471.{ .name = "fsanitize-coverage-allowlist=", .syntax = .joined },3527.{ .name = "fsanitize-coverage-allowlist=", .syntax = .joined },
3528.{ .name = "fsanitize-debug-trap-reasons=", .syntax = .joined },
3472.{ .name = "fxray-instrumentation-bundle=", .syntax = .joined },3529.{ .name = "fxray-instrumentation-bundle=", .syntax = .joined },
3473.{ .name = "fsanitize-address-destructor=", .syntax = .joined },3530.{ .name = "fsanitize-address-destructor=", .syntax = .joined },
3474.{3531.{
...@@ -3567,6 +3624,8 @@...@@ -3567,6 +3624,8 @@
3567.{ .name = "analyzer-disable-checker=", .syntax = .joined },3624.{ .name = "analyzer-disable-checker=", .syntax = .joined },
3568.{ .name = "fbuild-session-timestamp=", .syntax = .joined },3625.{ .name = "fbuild-session-timestamp=", .syntax = .joined },
3569.{ .name = "fdo-concurrent-to-openmp=", .syntax = .joined },3626.{ .name = "fdo-concurrent-to-openmp=", .syntax = .joined },
3627.{ .name = "fdx-rootsignature-define=", .syntax = .joined },
3628.{ .name = "fms-layout-compatibility=", .syntax = .joined },
3570.{ .name = "fprofile-function-groups=", .syntax = .joined },3629.{ .name = "fprofile-function-groups=", .syntax = .joined },
3571.{ .name = "fprofile-instrument-path=", .syntax = .joined },3630.{ .name = "fprofile-instrument-path=", .syntax = .joined },
3572.{ .name = "header-include-filtering=", .syntax = .joined },3631.{ .name = "header-include-filtering=", .syntax = .joined },
...@@ -3589,11 +3648,13 @@...@@ -3589,11 +3648,13 @@
3589.{ .name = "dump-minimization-hints=", .syntax = .joined },3648.{ .name = "dump-minimization-hints=", .syntax = .joined },
3590.{ .name = "fapinotes-swift-version=", .syntax = .joined },3649.{ .name = "fapinotes-swift-version=", .syntax = .joined },
3591.{ .name = "fcomment-block-commands=", .syntax = .comma_joined },3650.{ .name = "fcomment-block-commands=", .syntax = .comma_joined },
3651.{ .name = "fintrinsic-modules-path=", .syntax = .joined },
3592.{ .name = "flax-vector-conversions=", .syntax = .joined },3652.{ .name = "flax-vector-conversions=", .syntax = .joined },
3593.{ .name = "fmodules-embed-all-files", .syntax = .joined },3653.{ .name = "fmodules-embed-all-files", .syntax = .joined },
3594.{ .name = "fmodules-prune-interval=", .syntax = .joined },3654.{ .name = "fmodules-prune-interval=", .syntax = .joined },
3595.{ .name = "foverride-record-layout=", .syntax = .joined },3655.{ .name = "foverride-record-layout=", .syntax = .joined },
3596.{ .name = "fprofile-instr-generate=", .syntax = .joined },3656.{ .name = "fprofile-instr-generate=", .syntax = .joined },
3657.{ .name = "fprofile-instrument-use=", .syntax = .joined },
3597.{ .name = "fprofile-remapping-file=", .syntax = .joined },3658.{ .name = "fprofile-remapping-file=", .syntax = .joined },
3598.{ .name = "fsanitize-coverage-type=", .syntax = .joined },3659.{ .name = "fsanitize-coverage-type=", .syntax = .joined },
3599.{ .name = "fsanitize-hwaddress-abi=", .syntax = .joined },3660.{ .name = "fsanitize-hwaddress-abi=", .syntax = .joined },
...@@ -3619,6 +3680,7 @@...@@ -3619,6 +3680,7 @@
3619.{ .name = "fdebug-compilation-dir=", .syntax = .joined },3680.{ .name = "fdebug-compilation-dir=", .syntax = .joined },
3620.{ .name = "fdebug-default-version=", .syntax = .joined },3681.{ .name = "fdebug-default-version=", .syntax = .joined },
3621.{ .name = "ffp-exception-behavior=", .syntax = .joined },3682.{ .name = "ffp-exception-behavior=", .syntax = .joined },
3683.{ .name = "finitial-counter-value=", .syntax = .joined },
3622.{ .name = "fmacro-backtrace-limit=", .syntax = .joined },3684.{ .name = "fmacro-backtrace-limit=", .syntax = .joined },
3623.{ .name = "fmax-array-constructor=", .syntax = .joined },3685.{ .name = "fmax-array-constructor=", .syntax = .joined },
3624.{ .name = "fmcdc-max-test-vectors=", .syntax = .joined },3686.{ .name = "fmcdc-max-test-vectors=", .syntax = .joined },
...@@ -3640,6 +3702,7 @@...@@ -3640,6 +3702,7 @@
3640.{ .name = "ffile-compilation-dir=", .syntax = .joined },3702.{ .name = "ffile-compilation-dir=", .syntax = .joined },
3641.{ .name = "fgpu-inline-threshold=", .syntax = .joined },3703.{ .name = "fgpu-inline-threshold=", .syntax = .joined },
3642.{ .name = "finline-max-stacksize=", .syntax = .joined },3704.{ .name = "finline-max-stacksize=", .syntax = .joined },
3705.{ .name = "fmatrix-memory-layout=", .syntax = .joined },
3643.{ .name = "fmax-subrecord-length=", .syntax = .joined },3706.{ .name = "fmax-subrecord-length=", .syntax = .joined },
3644.{ .name = "fmodules-ignore-macro=", .syntax = .joined },3707.{ .name = "fmodules-ignore-macro=", .syntax = .joined },
3645.{3708.{
...@@ -3732,6 +3795,7 @@...@@ -3732,6 +3795,7 @@
3732.{ .name = "fms-omit-default-lib", .syntax = .joined },3795.{ .name = "fms-omit-default-lib", .syntax = .joined },
3733.{ .name = "fprofile-instrument=", .syntax = .joined },3796.{ .name = "fprofile-instrument=", .syntax = .joined },
3734.{ .name = "fprofile-sample-use=", .syntax = .joined },3797.{ .name = "fprofile-sample-use=", .syntax = .joined },
3798.{ .name = "fsanitize-kcfi-hash=", .syntax = .joined },
3735.{ .name = "fstrict-flex-arrays=", .syntax = .joined },3799.{ .name = "fstrict-flex-arrays=", .syntax = .joined },
3736.{3800.{
3737 .name = "hipstdpar-prim-path=",3801 .name = "hipstdpar-prim-path=",
...@@ -3817,6 +3881,7 @@...@@ -3817,6 +3881,7 @@
3817 .pd1 = false,3881 .pd1 = false,
3818 .pd2 = true,3882 .pd2 = true,
3819},3883},
3884.{ .name = "falloc-token-mode=", .syntax = .joined },
3820.{ .name = "fbinutils-version=", .syntax = .joined },3885.{ .name = "fbinutils-version=", .syntax = .joined },
3821.{ .name = "fclang-abi-compat=", .syntax = .joined },3886.{ .name = "fclang-abi-compat=", .syntax = .joined },
3822.{ .name = "fcodegen-data-use=", .syntax = .joined },3887.{ .name = "fcodegen-data-use=", .syntax = .joined },
...@@ -3865,6 +3930,7 @@...@@ -3865,6 +3930,7 @@
3865 .pd2 = true,3930 .pd2 = true,
3866},3931},
3867.{ .name = "falign-functions=", .syntax = .joined },3932.{ .name = "falign-functions=", .syntax = .joined },
3933.{ .name = "falloc-token-max=", .syntax = .joined },
3868.{ .name = "fconstexpr-depth=", .syntax = .joined },3934.{ .name = "fconstexpr-depth=", .syntax = .joined },
3869.{ .name = "fconstexpr-steps=", .syntax = .joined },3935.{ .name = "fconstexpr-steps=", .syntax = .joined },
3870.{ .name = "ffile-prefix-map=", .syntax = .joined },3936.{ .name = "ffile-prefix-map=", .syntax = .joined },
...@@ -3951,7 +4017,7 @@...@@ -3951,7 +4017,7 @@
3951.{ .name = "mzos-hlq-csslib=", .syntax = .joined },4017.{ .name = "mzos-hlq-csslib=", .syntax = .joined },
3952.{4018.{
3953 .name = "no-offload-arch=",4019 .name = "no-offload-arch=",
3954 .syntax = .joined,4020 .syntax = .comma_joined,
3955 .pd1 = false,4021 .pd1 = false,
3956 .pd2 = true,4022 .pd2 = true,
3957},4023},
...@@ -4296,6 +4362,12 @@...@@ -4296,6 +4362,12 @@
4296.{ .name = "inline-asm=", .syntax = .joined },4362.{ .name = "inline-asm=", .syntax = .joined },
4297.{ .name = "ivfsoverlay", .syntax = .joined_or_separate },4363.{ .name = "ivfsoverlay", .syntax = .joined_or_separate },
4298.{ .name = "iwithprefix", .syntax = .joined_or_separate },4364.{ .name = "iwithprefix", .syntax = .joined_or_separate },
4365.{
4366 .name = "libclc-lib=",
4367 .syntax = .joined,
4368 .pd1 = false,
4369 .pd2 = true,
4370},
4299.{ .name = "mfloat-abi=", .syntax = .joined },4371.{ .name = "mfloat-abi=", .syntax = .joined },
4300.{ .name = "plugin-arg-", .syntax = .joined_and_separate },4372.{ .name = "plugin-arg-", .syntax = .joined_and_separate },
4301.{4373.{
...@@ -4457,7 +4529,6 @@...@@ -4457,7 +4529,6 @@
4457 .pd1 = false,4529 .pd1 = false,
4458 .pd2 = true,4530 .pd2 = true,
4459},4531},
4460.{ .name = "fcoarray=", .syntax = .joined },
4461.{ .name = "fconvert=", .syntax = .joined },4532.{ .name = "fconvert=", .syntax = .joined },
4462.{ .name = "fc++-abi=", .syntax = .joined },4533.{ .name = "fc++-abi=", .syntax = .joined },
4463.{ .name = "fextdirs=", .syntax = .joined },4534.{ .name = "fextdirs=", .syntax = .joined },
...@@ -4782,6 +4853,11 @@...@@ -4782,6 +4853,11 @@
4782 .syntax = .joined,4853 .syntax = .joined,
4783 .psl = true,4854 .psl = true,
4784},4855},
4856.{
4857 .name = "Frs",
4858 .syntax = .joined_or_separate,
4859 .psl = true,
4860},
4785.{ .name = "gz=", .syntax = .joined },4861.{ .name = "gz=", .syntax = .joined },
4786.{ .name = "A-", .syntax = .joined },4862.{ .name = "A-", .syntax = .joined },
4787.{ .name = "G=", .syntax = .joined },4863.{ .name = "G=", .syntax = .joined },
src/codegen/c.zig+19-1
...@@ -3497,9 +3497,27 @@ fn airOverflow(f: *Function, inst: Air.Inst.Index, operation: []const u8, info:...@@ -3497,9 +3497,27 @@ fn airOverflow(f: *Function, inst: Air.Inst.Index, operation: []const u8, info:
3497 try w.writeAll(operation);3497 try w.writeAll(operation);
3498 try w.writeAll("o_");3498 try w.writeAll("o_");
3499 try f.dg.renderTypeForBuiltinFnName(w, scalar_ty);3499 try f.dg.renderTypeForBuiltinFnName(w, scalar_ty);
3500 try w.writeAll("(&");3500 try w.writeByte('(');
3501
3502 // '&dest', possibly preceded by a cast
3503 switch (zcu.intern_pool.indexToKey(scalar_ty.toIntern())) {
3504 .int_type => {}, // we already have a '[u]intX_t *'
3505 .simple_type => {
3506 // '&dest' will be something like a 'uintptr_t *', which might be a different C type to
3507 // the equivalent sized integer (e.g. 'uint64_t *'), so we need a cast. We don't need a
3508 // cast on the *operands* because they are passed by value (except for big integers,
3509 // where this issue doesn't exist because no "simple" int type needs bigint repr).
3510 try w.print("({s}int{d}_t *)", .{
3511 if (scalar_ty.isUnsignedInt(zcu)) "u" else "",
3512 scalar_ty.abiSize(zcu) * 8,
3513 });
3514 },
3515 else => unreachable,
3516 }
3517 try w.writeByte('&');
3501 try f.writeCValueMember(w, local, .{ .field = 0 });3518 try f.writeCValueMember(w, local, .{ .field = 0 });
3502 try v.elem(f, w);3519 try v.elem(f, w);
3520
3503 try w.writeAll(", ");3521 try w.writeAll(", ");
3504 if (ref_arg) try w.writeByte('&');3522 if (ref_arg) try w.writeByte('&');
3505 try f.writeCValue(w, lhs, .other);3523 try f.writeCValue(w, lhs, .other);
src/codegen/llvm.zig+15-35
...@@ -162,6 +162,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8...@@ -162,6 +162,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
162 .{ .v9_4a, "v9.4a" },162 .{ .v9_4a, "v9.4a" },
163 .{ .v9_5a, "v9.5a" },163 .{ .v9_5a, "v9.5a" },
164 .{ .v9_6a, "v9.6a" },164 .{ .v9_6a, "v9.6a" },
165 .{ .v9_7a, "v9.7a" },
165 }),166 }),
166 .powerpc => subArchName(target, .powerpc, .{167 .powerpc => subArchName(target, .powerpc, .{
167 .{ .spe, "spe" },168 .{ .spe, "spe" },
...@@ -255,11 +256,15 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8...@@ -255,11 +256,15 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
255 .none,256 .none,
256 .windows,257 .windows,
257 => {},258 => {},
258 .semver => |ver| try llvm_triple.print("{d}.{d}.{d}", .{259 .semver => |ver| if (target.os.tag == .wasi and ver.min.major == 0) {
259 ver.min.major,260 try llvm_triple.print("p{d}", .{ver.min.minor});
260 ver.min.minor,261 } else {
261 ver.min.patch,262 try llvm_triple.print("{d}.{d}.{d}", .{
262 }),263 ver.min.major,
264 ver.min.minor,
265 ver.min.patch,
266 });
267 },
263 inline .linux, .hurd => |ver| try llvm_triple.print("{d}.{d}.{d}", .{268 inline .linux, .hurd => |ver| try llvm_triple.print("{d}.{d}.{d}", .{
264 ver.range.min.major,269 ver.range.min.major,
265 ver.range.min.minor,270 ver.range.min.minor,
...@@ -383,16 +388,9 @@ pub fn dataLayout(target: *const std.Target) []const u8 {...@@ -383,16 +388,9 @@ pub fn dataLayout(target: *const std.Target) []const u8 {
383 .powerpc => "E-m:e-p:32:32-Fn32-i64:64-n32",388 .powerpc => "E-m:e-p:32:32-Fn32-i64:64-n32",
384 .powerpcle => "e-m:e-p:32:32-Fn32-i64:64-n32",389 .powerpcle => "e-m:e-p:32:32-Fn32-i64:64-n32",
385 .powerpc64 => switch (target.os.tag) {390 .powerpc64 => switch (target.os.tag) {
386 .linux => if (target.abi.isMusl())391 .linux => "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512",
387 "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512"
388 else
389 "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512",
390 .ps3 => "E-m:e-p:32:32-Fi64-i64:64-i128:128-n32:64",392 .ps3 => "E-m:e-p:32:32-Fi64-i64:64-i128:128-n32:64",
391 else => if (target.os.tag == .openbsd or393 else => "E-m:e-Fn32-i64:64-i128:128-n32:64",
392 (target.os.tag == .freebsd and target.os.version_range.semver.isAtLeast(.{ .major = 13, .minor = 0, .patch = 0 }) orelse false))
393 "E-m:e-Fn32-i64:64-i128:128-n32:64"
394 else
395 "E-m:e-Fi64-i64:64-i128:128-n32:64",
396 },394 },
397 .powerpc64le => if (target.os.tag == .linux)395 .powerpc64le => if (target.os.tag == .linux)
398 "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512"396 "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512"
...@@ -400,7 +398,7 @@ pub fn dataLayout(target: *const std.Target) []const u8 {...@@ -400,7 +398,7 @@ pub fn dataLayout(target: *const std.Target) []const u8 {
400 "e-m:e-Fn32-i64:64-i128:128-n32:64",398 "e-m:e-Fn32-i64:64-i128:128-n32:64",
401 .nvptx => "e-p:32:32-p6:32:32-p7:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64",399 .nvptx => "e-p:32:32-p6:32:32-p7:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64",
402 .nvptx64 => "e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64",400 .nvptx64 => "e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64",
403 .amdgcn => "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9",401 .amdgcn => "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9",
404 .riscv32 => if (target.cpu.has(.riscv, .e))402 .riscv32 => if (target.cpu.has(.riscv, .e))
405 "e-m:e-p:32:32-i64:64-n32-S32"403 "e-m:e-p:32:32-i64:64-n32-S32"
406 else404 else
...@@ -1748,6 +1746,7 @@ pub const Object = struct {...@@ -1748,6 +1746,7 @@ pub const Object = struct {
1748 if (name.eqlSlice("WinMainCRTStartup", ip)) flags.winmain_crt_startup = true;1746 if (name.eqlSlice("WinMainCRTStartup", ip)) flags.winmain_crt_startup = true;
1749 if (name.eqlSlice("wWinMainCRTStartup", ip)) flags.wwinmain_crt_startup = true;1747 if (name.eqlSlice("wWinMainCRTStartup", ip)) flags.wwinmain_crt_startup = true;
1750 if (name.eqlSlice("DllMainCRTStartup", ip)) flags.dllmain_crt_startup = true;1748 if (name.eqlSlice("DllMainCRTStartup", ip)) flags.dllmain_crt_startup = true;
1749 if (name.eqlSlice("_DllMainCRTStartup", ip)) flags.dllmain_crt_startup = true;
1751 }1750 }
1752 }1751 }
17531752
...@@ -4652,20 +4651,6 @@ fn toLlvmGlobalAddressSpace(wanted_address_space: std.builtin.AddressSpace, targ...@@ -4652,20 +4651,6 @@ fn toLlvmGlobalAddressSpace(wanted_address_space: std.builtin.AddressSpace, targ
4652/// or if it produces miscompilations.4651/// or if it produces miscompilations.
4653pub fn backendSupportsF16(target: *const std.Target) bool {4652pub fn backendSupportsF16(target: *const std.Target) bool {
4654 return switch (target.cpu.arch) {4653 return switch (target.cpu.arch) {
4655 // https://github.com/llvm/llvm-project/issues/97981
4656 .csky,
4657 // https://github.com/llvm/llvm-project/issues/97981
4658 .powerpc,
4659 .powerpcle,
4660 .powerpc64,
4661 .powerpc64le,
4662 // https://github.com/llvm/llvm-project/issues/97981
4663 .wasm32,
4664 .wasm64,
4665 // https://github.com/llvm/llvm-project/issues/97981
4666 .sparc,
4667 .sparc64,
4668 => false,
4669 .arm,4654 .arm,
4670 .armeb,4655 .armeb,
4671 .thumb,4656 .thumb,
...@@ -4692,11 +4677,6 @@ pub fn backendSupportsF128(target: *const std.Target) bool {...@@ -4692,11 +4677,6 @@ pub fn backendSupportsF128(target: *const std.Target) bool {
4692 return switch (target.cpu.arch) {4677 return switch (target.cpu.arch) {
4693 // https://github.com/llvm/llvm-project/issues/1211224678 // https://github.com/llvm/llvm-project/issues/121122
4694 .amdgcn,4679 .amdgcn,
4695 // Test failures all over the place.
4696 .mips64,
4697 .mips64el,
4698 // https://github.com/llvm/llvm-project/issues/41838
4699 .sparc,
4700 => false,4680 => false,
4701 .arm,4681 .arm,
4702 .armeb,4682 .armeb,
...@@ -4839,7 +4819,7 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {...@@ -4839,7 +4819,7 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
4839 bindings.LLVMInitializeXtensaTarget();4819 bindings.LLVMInitializeXtensaTarget();
4840 bindings.LLVMInitializeXtensaTargetInfo();4820 bindings.LLVMInitializeXtensaTargetInfo();
4841 bindings.LLVMInitializeXtensaTargetMC();4821 bindings.LLVMInitializeXtensaTargetMC();
4842 // There is no LLVMInitializeXtensaAsmPrinter function.4822 bindings.LLVMInitializeXtensaAsmPrinter();
4843 bindings.LLVMInitializeXtensaAsmParser();4823 bindings.LLVMInitializeXtensaAsmParser();
4844 }4824 }
4845 },4825 },
src/codegen/llvm/FuncGen.zig+4-4
...@@ -6630,11 +6630,11 @@ const ParamTypeIterator = struct {...@@ -6630,11 +6630,11 @@ const ParamTypeIterator = struct {
6630 } else if (isByRef(ty, zcu)) {6630 } else if (isByRef(ty, zcu)) {
6631 return .byref;6631 return .byref;
6632 } else if (target.cpu.arch.isX86() and6632 } else if (target.cpu.arch.isX86() and
6633 !target.cpu.has(.x86, .evex512) and6633 !target.cpu.has(.x86, .avx512f) and
6634 ty.totalVectorBits(zcu) >= 512)6634 ty.totalVectorBits(zcu) >= 512)
6635 {6635 {
6636 // As of LLVM 18, passing a vector byval with fastcc that is 512 bits or more returns6636 // As of LLVM 18, passing a vector byval with fastcc that is 512 bits or more returns
6637 // "512-bit vector arguments require 'evex512' for AVX512"6637 // "512-bit vector arguments require 'avx512f' for AVX512"
6638 return .byref;6638 return .byref;
6639 } else {6639 } else {
6640 return .byval;6640 return .byval;
...@@ -6903,11 +6903,11 @@ fn returnTypeByRef(zcu: *Zcu, target: *const std.Target, ty: Type) bool {...@@ -6903,11 +6903,11 @@ fn returnTypeByRef(zcu: *Zcu, target: *const std.Target, ty: Type) bool {
6903 if (isByRef(ty, zcu)) {6903 if (isByRef(ty, zcu)) {
6904 return true;6904 return true;
6905 } else if (target.cpu.arch.isX86() and6905 } else if (target.cpu.arch.isX86() and
6906 !target.cpu.has(.x86, .evex512) and6906 !target.cpu.has(.x86, .avx512f) and
6907 ty.totalVectorBits(zcu) >= 512)6907 ty.totalVectorBits(zcu) >= 512)
6908 {6908 {
6909 // As of LLVM 18, passing a vector byval with fastcc that is 512 bits or more returns6909 // As of LLVM 18, passing a vector byval with fastcc that is 512 bits or more returns
6910 // "512-bit vector arguments require 'evex512' for AVX512"6910 // "512-bit vector arguments require 'avx512f' for AVX512"
6911 return true;6911 return true;
6912 } else {6912 } else {
6913 return false;6913 return false;
src/codegen/llvm/bindings.zig+1
...@@ -279,6 +279,7 @@ pub extern fn LLVMInitializeSystemZAsmPrinter() void;...@@ -279,6 +279,7 @@ pub extern fn LLVMInitializeSystemZAsmPrinter() void;
279pub extern fn LLVMInitializeWebAssemblyAsmPrinter() void;279pub extern fn LLVMInitializeWebAssemblyAsmPrinter() void;
280pub extern fn LLVMInitializeX86AsmPrinter() void;280pub extern fn LLVMInitializeX86AsmPrinter() void;
281pub extern fn LLVMInitializeXCoreAsmPrinter() void;281pub extern fn LLVMInitializeXCoreAsmPrinter() void;
282pub extern fn LLVMInitializeXtensaAsmPrinter() void;
282pub extern fn LLVMInitializeM68kAsmPrinter() void;283pub extern fn LLVMInitializeM68kAsmPrinter() void;
283pub extern fn LLVMInitializeVEAsmPrinter() void;284pub extern fn LLVMInitializeVEAsmPrinter() void;
284pub extern fn LLVMInitializeARCAsmPrinter() void;285pub extern fn LLVMInitializeARCAsmPrinter() void;
src/libs/libcxx.zig+14-5
...@@ -538,11 +538,20 @@ pub fn addCxxArgs(...@@ -538,11 +538,20 @@ pub fn addCxxArgs(
538 // Compilation.addCCArgs. This option makes it use serial backend which538 // Compilation.addCCArgs. This option makes it use serial backend which
539 // is simple and works everywhere.539 // is simple and works everywhere.
540 try cflags.append("-D_LIBCPP_PSTL_BACKEND_SERIAL");540 try cflags.append("-D_LIBCPP_PSTL_BACKEND_SERIAL");
541 try cflags.append(switch (optimize_mode) {541 switch (optimize_mode) {
542 .Debug => "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG",542 .Debug => {
543 .ReleaseFast, .ReleaseSmall => "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE",543 try cflags.append("-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG");
544 .ReleaseSafe => "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST",544 try cflags.append("-D_LIBCPP_ASSERTION_SEMANTIC_DEFAULT=_LIBCPP_ASSERTION_SEMANTIC_ENFORCE");
545 });545 },
546 .ReleaseFast, .ReleaseSmall => {
547 try cflags.append("-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE");
548 try cflags.append("-D_LIBCPP_ASSERTION_SEMANTIC_DEFAULT=_LIBCPP_ASSERTION_SEMANTIC_IGNORE");
549 },
550 .ReleaseSafe => {
551 try cflags.append("-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST");
552 try cflags.append("-D_LIBCPP_ASSERTION_SEMANTIC_DEFAULT=_LIBCPP_ASSERTION_SEMANTIC_ENFORCE");
553 },
554 }
546 if (target.isGnuLibC()) {555 if (target.isGnuLibC()) {
547 // glibc 2.16 introduced aligned_alloc556 // glibc 2.16 introduced aligned_alloc
548 if (target.os.versionRange().gnuLibCVersion().?.order(.{ .major = 2, .minor = 16, .patch = 0 }) == .lt) {557 if (target.os.versionRange().gnuLibCVersion().?.order(.{ .major = 2, .minor = 16, .patch = 0 }) == .lt) {
src/link/Lld.zig+3-12
...@@ -637,17 +637,7 @@ fn coffLink(lld: *Lld, arena: Allocator) !void {...@@ -637,17 +637,7 @@ fn coffLink(lld: *Lld, arena: Allocator) !void {
637 try argv.append("-ALTERNATENAME:__image_base__=__ImageBase");637 try argv.append("-ALTERNATENAME:__image_base__=__ImageBase");
638 }638 }
639639
640 if (is_dyn_lib) {640 try argv.append(try comp.crtFileAsString(arena, if (is_dyn_lib) "dllcrt2.obj" else "crt2.obj"));
641 try argv.append(try comp.crtFileAsString(arena, "dllcrt2.obj"));
642 if (target.cpu.arch == .x86) {
643 try argv.append("-ALTERNATENAME:__DllMainCRTStartup@12=_DllMainCRTStartup@12");
644 } else {
645 try argv.append("-ALTERNATENAME:_DllMainCRTStartup=DllMainCRTStartup");
646 }
647 } else {
648 try argv.append(try comp.crtFileAsString(arena, "crt2.obj"));
649 }
650
651 try argv.append(try comp.crtFileAsString(arena, "libmingw32.lib"));641 try argv.append(try comp.crtFileAsString(arena, "libmingw32.lib"));
652 } else {642 } else {
653 try argv.append(switch (comp.config.link_mode) {643 try argv.append(switch (comp.config.link_mode) {
...@@ -812,7 +802,8 @@ fn elfLink(lld: *Lld, arena: Allocator) !void {...@@ -812,7 +802,8 @@ fn elfLink(lld: *Lld, arena: Allocator) !void {
812 target.cpu.arch == .m68k or802 target.cpu.arch == .m68k or
813 target.cpu.arch.isSPARC() or803 target.cpu.arch.isSPARC() or
814 target.cpu.arch == .ve or804 target.cpu.arch == .ve or
815 target.cpu.arch == .xcore))805 target.cpu.arch == .xcore or
806 target.cpu.arch == .xtensa))
816 {807 {
817 // In this case we must do a simple file copy808 // In this case we must do a simple file copy
818 // here. TODO: think carefully about how we can avoid this redundant operation when doing809 // here. TODO: think carefully about how we can avoid this redundant operation when doing
src/link/Wasm.zig+3
...@@ -2829,6 +2829,7 @@ pub const Feature = packed struct(u8) {...@@ -2829,6 +2829,7 @@ pub const Feature = packed struct(u8) {
2829 @"exception-handling",2829 @"exception-handling",
2830 @"extended-const",2830 @"extended-const",
2831 fp16,2831 fp16,
2832 gc,
2832 memory64,2833 memory64,
2833 multimemory,2834 multimemory,
2834 multivalue,2835 multivalue,
...@@ -2852,6 +2853,7 @@ pub const Feature = packed struct(u8) {...@@ -2852,6 +2853,7 @@ pub const Feature = packed struct(u8) {
2852 .exception_handling => .@"exception-handling",2853 .exception_handling => .@"exception-handling",
2853 .extended_const => .@"extended-const",2854 .extended_const => .@"extended-const",
2854 .fp16 => .fp16,2855 .fp16 => .fp16,
2856 .gc => .gc,
2855 .multimemory => .multimemory,2857 .multimemory => .multimemory,
2856 .multivalue => .multivalue,2858 .multivalue => .multivalue,
2857 .mutable_globals => .@"mutable-globals",2859 .mutable_globals => .@"mutable-globals",
...@@ -2875,6 +2877,7 @@ pub const Feature = packed struct(u8) {...@@ -2875,6 +2877,7 @@ pub const Feature = packed struct(u8) {
2875 .@"exception-handling" => .exception_handling,2877 .@"exception-handling" => .exception_handling,
2876 .@"extended-const" => .extended_const,2878 .@"extended-const" => .extended_const,
2877 .fp16 => .fp16,2879 .fp16 => .fp16,
2880 .gc => .gc,
2878 .memory64 => null, // Linker-only feature.2881 .memory64 => null, // Linker-only feature.
2879 .multimemory => .multimemory,2882 .multimemory => .multimemory,
2880 .multivalue => .multivalue,2883 .multivalue => .multivalue,
src/main.zig+5-2
...@@ -977,6 +977,11 @@ fn buildOutputType(...@@ -977,6 +977,11 @@ fn buildOutputType(
977 var cc_argv: std.ArrayList([]const u8) = .empty;977 var cc_argv: std.ArrayList([]const u8) = .empty;
978 var deps: std.ArrayList(CliModule.Dep) = .empty;978 var deps: std.ArrayList(CliModule.Dep) = .empty;
979979
980 // We need to raise the FD limit *before* CLI parsing, because we open link inputs during CLI
981 // parsing (in `createModule`), so a large number of link inputs could push us past the limit on
982 // targets with a low soft limit (e.g. macOS has a default limit of 256).
983 process.raiseFileDescriptorLimit();
984
980 // Contains every module specified via -M. The dependencies are added985 // Contains every module specified via -M. The dependencies are added
981 // after argument parsing is completed. We use a StringArrayHashMap to make986 // after argument parsing is completed. We use a StringArrayHashMap to make
982 // error output consistent. "root" is special.987 // error output consistent. "root" is special.
...@@ -3534,8 +3539,6 @@ fn buildOutputType(...@@ -3534,8 +3539,6 @@ fn buildOutputType(
3534 break :b .whole;3539 break :b .whole;
3535 };3540 };
35363541
3537 process.raiseFileDescriptorLimit();
3538
3539 var file_system_inputs: std.ArrayList(u8) = .empty;3542 var file_system_inputs: std.ArrayList(u8) = .empty;
3540 defer file_system_inputs.deinit(gpa);3543 defer file_system_inputs.deinit(gpa);
35413544
src/target.zig+5-3
...@@ -227,11 +227,11 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat)...@@ -227,11 +227,11 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat)
227 .wasm32,227 .wasm32,
228 .wasm64,228 .wasm64,
229 .ve,229 .ve,
230 .xtensa,
230 => true,231 => true,
231232
232 // LLVM backend exists but can produce neither assembly nor object files.233 // LLVM backend exists but can produce neither assembly nor object files.
233 .csky,234 .csky,
234 .xtensa,
235 => false,235 => false,
236236
237 // Third-party LLVM backend exists.237 // Third-party LLVM backend exists.
...@@ -388,6 +388,8 @@ pub fn hasDebugInfo(target: *const std.Target) bool {...@@ -388,6 +388,8 @@ pub fn hasDebugInfo(target: *const std.Target) bool {
388 .ptx85,388 .ptx85,
389 .ptx86,389 .ptx86,
390 .ptx87,390 .ptx87,
391 .ptx88,
392 .ptx90,
391 }),393 }),
392 .bpfel, .bpfeb => false,394 .bpfel, .bpfeb => false,
393 else => true,395 else => true,
...@@ -684,8 +686,8 @@ pub fn llvmMachineAbi(target: *const std.Target) ?[:0]const u8 {...@@ -684,8 +686,8 @@ pub fn llvmMachineAbi(target: *const std.Target) ?[:0]const u8 {
684 else => "lp64d",686 else => "lp64d",
685 },687 },
686 .loongarch32 => switch (target.abi) {688 .loongarch32 => switch (target.abi) {
687 .gnusf => "ilp32s",689 .gnusf, .muslsf => "ilp32s",
688 .gnuf32 => "ilp32f",690 .gnuf32, .muslf32 => "ilp32f",
689 else => "ilp32d",691 else => "ilp32d",
690 },692 },
691 .mips, .mipsel => "o32",693 .mips, .mipsel => "o32",
src/zig_clang_cc1_main.cpp+26-27
...@@ -12,19 +12,20 @@...@@ -12,19 +12,20 @@
12//12//
13//===----------------------------------------------------------------------===//13//===----------------------------------------------------------------------===//
1414
15#include "clang/Basic/DiagnosticFrontend.h"
15#include "clang/Basic/Stack.h"16#include "clang/Basic/Stack.h"
16#include "clang/Basic/TargetOptions.h"17#include "clang/Basic/TargetOptions.h"
17#include "clang/CodeGen/ObjectFilePCHContainerWriter.h"18#include "clang/CodeGen/ObjectFilePCHContainerWriter.h"
18#include "clang/Config/config.h"19#include "clang/Config/config.h"
20#include "clang/Driver/Driver.h"
19#include "clang/Driver/DriverDiagnostic.h"21#include "clang/Driver/DriverDiagnostic.h"
20#include "clang/Driver/Options.h"
21#include "clang/Frontend/CompilerInstance.h"22#include "clang/Frontend/CompilerInstance.h"
22#include "clang/Frontend/CompilerInvocation.h"23#include "clang/Frontend/CompilerInvocation.h"
23#include "clang/Frontend/FrontendDiagnostic.h"
24#include "clang/Frontend/TextDiagnosticBuffer.h"24#include "clang/Frontend/TextDiagnosticBuffer.h"
25#include "clang/Frontend/TextDiagnosticPrinter.h"25#include "clang/Frontend/TextDiagnosticPrinter.h"
26#include "clang/Frontend/Utils.h"26#include "clang/Frontend/Utils.h"
27#include "clang/FrontendTool/Utils.h"27#include "clang/FrontendTool/Utils.h"
28#include "clang/Options/Options.h"
28#include "clang/Serialization/ObjectFilePCHContainerReader.h"29#include "clang/Serialization/ObjectFilePCHContainerReader.h"
29#include "llvm/ADT/Statistic.h"30#include "llvm/ADT/Statistic.h"
30#include "llvm/ADT/StringExtras.h"31#include "llvm/ADT/StringExtras.h"
...@@ -38,6 +39,7 @@...@@ -38,6 +39,7 @@
38#include "llvm/Support/BuryPointer.h"39#include "llvm/Support/BuryPointer.h"
39#include "llvm/Support/Compiler.h"40#include "llvm/Support/Compiler.h"
40#include "llvm/Support/ErrorHandling.h"41#include "llvm/Support/ErrorHandling.h"
42#include "llvm/Support/IOSandbox.h"
41#include "llvm/Support/ManagedStatic.h"43#include "llvm/Support/ManagedStatic.h"
42#include "llvm/Support/Path.h"44#include "llvm/Support/Path.h"
43#include "llvm/Support/Process.h"45#include "llvm/Support/Process.h"
...@@ -217,7 +219,7 @@ static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {...@@ -217,7 +219,7 @@ static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
217int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {219int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
218 ensureSufficientStack();220 ensureSufficientStack();
219221
220 IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());222 IntrusiveRefCntPtr<DiagnosticIDs> DiagID = DiagnosticIDs::create();
221223
222 // Register the support for object-file-wrapped Clang modules.224 // Register the support for object-file-wrapped Clang modules.
223 auto PCHOps = std::make_shared<PCHContainerOperations>();225 auto PCHOps = std::make_shared<PCHContainerOperations>();
...@@ -269,12 +271,17 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -269,12 +271,17 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
269 if (Clang->getHeaderSearchOpts().UseBuiltinIncludes &&271 if (Clang->getHeaderSearchOpts().UseBuiltinIncludes &&
270 Clang->getHeaderSearchOpts().ResourceDir.empty())272 Clang->getHeaderSearchOpts().ResourceDir.empty())
271 Clang->getHeaderSearchOpts().ResourceDir =273 Clang->getHeaderSearchOpts().ResourceDir =
272 CompilerInvocation::GetResourcesPath(Argv0, MainAddr);274 GetResourcesPath(Argv0, MainAddr);
275
276 /// Create the actual file system.
277 auto VFS = [] {
278 auto BypassSandbox = llvm::sys::sandbox::scopedDisable();
279 return llvm::vfs::getRealFileSystem();
280 }();
281 Clang->createVirtualFileSystem(std::move(VFS), DiagsBuffer);
273282
274 // Create the actual diagnostics engine.283 // Create the actual diagnostics engine.
275 Clang->createDiagnostics(*llvm::vfs::getRealFileSystem());284 Clang->createDiagnostics();
276 if (!Clang->hasDiagnostics())
277 return 1;
278285
279 // Set an error handler, so that any LLVM backend diagnostics go through our286 // Set an error handler, so that any LLVM backend diagnostics go through our
280 // error handler.287 // error handler.
...@@ -299,29 +306,21 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -299,29 +306,21 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
299306
300 // If any timers were active but haven't been destroyed yet, print their307 // If any timers were active but haven't been destroyed yet, print their
301 // results now. This happens in -disable-free mode.308 // results now. This happens in -disable-free mode.
302 std::unique_ptr<raw_ostream> IOFile = llvm::CreateInfoOutputFile();309 {
303 if (Clang->getCodeGenOpts().TimePassesJson) {310 // This isn't a formal input or output of the compiler.
304 *IOFile << "{\n";311 auto BypassSandbox = llvm::sys::sandbox::scopedDisable();
305 llvm::TimerGroup::printAllJSONValues(*IOFile, "");312 std::unique_ptr<raw_ostream> IOFile = llvm::CreateInfoOutputFile();
306 *IOFile << "\n}\n";313 if (Clang->getCodeGenOpts().TimePassesJson) {
307 } else {314 *IOFile << "{\n";
308 llvm::TimerGroup::printAll(*IOFile);315 llvm::TimerGroup::printAllJSONValues(*IOFile, "");
316 *IOFile << "\n}\n";
317 } else if (!Clang->getCodeGenOpts().TimePassesStatsFile) {
318 llvm::TimerGroup::printAll(*IOFile);
319 }
320 llvm::TimerGroup::clearAll();
309 }321 }
310 llvm::TimerGroup::clearAll();
311322
312 if (llvm::timeTraceProfilerEnabled()) {323 if (llvm::timeTraceProfilerEnabled()) {
313 // It is possible that the compiler instance doesn't own a file manager here
314 // if we're compiling a module unit. Since the file manager are owned by AST
315 // when we're compiling a module unit. So the file manager may be invalid
316 // here.
317 //
318 // It should be fine to create file manager here since the file system
319 // options are stored in the compiler invocation and we can recreate the VFS
320 // from the compiler invocation.
321 if (!Clang->hasFileManager())
322 Clang->createFileManager(createVFSFromCompilerInvocation(
323 Clang->getInvocation(), Clang->getDiagnostics()));
324
325 if (auto profilerOutput = Clang->createOutputFile(324 if (auto profilerOutput = Clang->createOutputFile(
326 Clang->getFrontendOpts().TimeTracePath, /*Binary=*/false,325 Clang->getFrontendOpts().TimeTracePath, /*Binary=*/false,
327 /*RemoveFileOnSignal=*/false,326 /*RemoveFileOnSignal=*/false,
src/zig_clang_cc1as_main.cpp+48-27
...@@ -12,12 +12,12 @@...@@ -12,12 +12,12 @@
12//===----------------------------------------------------------------------===//12//===----------------------------------------------------------------------===//
1313
14#include "clang/Basic/Diagnostic.h"14#include "clang/Basic/Diagnostic.h"
15#include "clang/Basic/DiagnosticFrontend.h"
15#include "clang/Basic/DiagnosticOptions.h"16#include "clang/Basic/DiagnosticOptions.h"
16#include "clang/Driver/DriverDiagnostic.h"17#include "clang/Driver/DriverDiagnostic.h"
17#include "clang/Driver/Options.h"
18#include "clang/Frontend/FrontendDiagnostic.h"
19#include "clang/Frontend/TextDiagnosticPrinter.h"18#include "clang/Frontend/TextDiagnosticPrinter.h"
20#include "clang/Frontend/Utils.h"19#include "clang/Frontend/Utils.h"
20#include "clang/Options/Options.h"
21#include "llvm/ADT/STLExtras.h"21#include "llvm/ADT/STLExtras.h"
22#include "llvm/ADT/StringExtras.h"22#include "llvm/ADT/StringExtras.h"
23#include "llvm/ADT/StringSwitch.h"23#include "llvm/ADT/StringSwitch.h"
...@@ -45,6 +45,7 @@...@@ -45,6 +45,7 @@
45#include "llvm/Support/ErrorHandling.h"45#include "llvm/Support/ErrorHandling.h"
46#include "llvm/Support/FileSystem.h"46#include "llvm/Support/FileSystem.h"
47#include "llvm/Support/FormattedStream.h"47#include "llvm/Support/FormattedStream.h"
48#include "llvm/Support/IOSandbox.h"
48#include "llvm/Support/MemoryBuffer.h"49#include "llvm/Support/MemoryBuffer.h"
49#include "llvm/Support/Path.h"50#include "llvm/Support/Path.h"
50#include "llvm/Support/Process.h"51#include "llvm/Support/Process.h"
...@@ -59,8 +60,7 @@...@@ -59,8 +60,7 @@
59#include <optional>60#include <optional>
60#include <system_error>61#include <system_error>
61using namespace clang;62using namespace clang;
62using namespace clang::driver;63using namespace clang::options;
63using namespace clang::driver::options;
64using namespace llvm;64using namespace llvm;
65using namespace llvm::opt;65using namespace llvm::opt;
6666
...@@ -71,8 +71,8 @@ struct AssemblerInvocation {...@@ -71,8 +71,8 @@ struct AssemblerInvocation {
71 /// @name Target Options71 /// @name Target Options
72 /// @{72 /// @{
7373
74 /// The name of the target triple to assemble for.74 /// The target triple to assemble for.
75 std::string Triple;75 llvm::Triple Triple;
7676
77 /// If given, the name of the target CPU to determine which instructions77 /// If given, the name of the target CPU to determine which instructions
78 /// are legal.78 /// are legal.
...@@ -163,6 +163,10 @@ struct AssemblerInvocation {...@@ -163,6 +163,10 @@ struct AssemblerInvocation {
163 LLVM_PREFERRED_TYPE(bool)163 LLVM_PREFERRED_TYPE(bool)
164 unsigned EmitCompactUnwindNonCanonical : 1;164 unsigned EmitCompactUnwindNonCanonical : 1;
165165
166 // Whether to emit sframe unwind sections.
167 LLVM_PREFERRED_TYPE(bool)
168 unsigned EmitSFrameUnwind : 1;
169
166 LLVM_PREFERRED_TYPE(bool)170 LLVM_PREFERRED_TYPE(bool)
167 unsigned Crel : 1;171 unsigned Crel : 1;
168 LLVM_PREFERRED_TYPE(bool)172 LLVM_PREFERRED_TYPE(bool)
...@@ -192,9 +196,12 @@ struct AssemblerInvocation {...@@ -192,9 +196,12 @@ struct AssemblerInvocation {
192 std::string AsSecureLogFile;196 std::string AsSecureLogFile;
193 /// @}197 /// @}
194198
199 void setTriple(llvm::StringRef Str) {
200 Triple = llvm::Triple(llvm::Triple::normalize(Str));
201 }
202
195public:203public:
196 AssemblerInvocation() {204 AssemblerInvocation() {
197 Triple = "";
198 NoInitialTextSection = 0;205 NoInitialTextSection = 0;
199 InputFile = "-";206 InputFile = "-";
200 OutputPath = "-";207 OutputPath = "-";
...@@ -261,7 +268,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -261,7 +268,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
261 // Construct the invocation.268 // Construct the invocation.
262269
263 // Target Options270 // Target Options
264 Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));271 Opts.setTriple(Args.getLastArgValue(OPT_triple));
265 if (Arg *A = Args.getLastArg(options::OPT_darwin_target_variant_triple))272 if (Arg *A = Args.getLastArg(options::OPT_darwin_target_variant_triple))
266 Opts.DarwinTargetVariantTriple = llvm::Triple(A->getValue());273 Opts.DarwinTargetVariantTriple = llvm::Triple(A->getValue());
267 if (Arg *A = Args.getLastArg(OPT_darwin_target_variant_sdk_version_EQ)) {274 if (Arg *A = Args.getLastArg(OPT_darwin_target_variant_sdk_version_EQ)) {
...@@ -278,7 +285,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -278,7 +285,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
278285
279 // Use the default target triple if unspecified.286 // Use the default target triple if unspecified.
280 if (Opts.Triple.empty())287 if (Opts.Triple.empty())
281 Opts.Triple = llvm::sys::getDefaultTargetTriple();288 Opts.setTriple(llvm::sys::getDefaultTargetTriple());
282289
283 // Language Options290 // Language Options
284 Opts.IncludePaths = Args.getAllArgValues(OPT_I);291 Opts.IncludePaths = Args.getAllArgValues(OPT_I);
...@@ -385,6 +392,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -385,6 +392,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
385392
386 Opts.EmitCompactUnwindNonCanonical =393 Opts.EmitCompactUnwindNonCanonical =
387 Args.hasArg(OPT_femit_compact_unwind_non_canonical);394 Args.hasArg(OPT_femit_compact_unwind_non_canonical);
395 Opts.EmitSFrameUnwind = Args.hasArg(OPT_gsframe);
388 Opts.Crel = Args.hasArg(OPT_crel);396 Opts.Crel = Args.hasArg(OPT_crel);
389 Opts.ImplicitMapsyms = Args.hasArg(OPT_mmapsyms_implicit);397 Opts.ImplicitMapsyms = Args.hasArg(OPT_mmapsyms_implicit);
390 Opts.X86RelaxRelocations = !Args.hasArg(OPT_mrelax_relocations_no);398 Opts.X86RelaxRelocations = !Args.hasArg(OPT_mrelax_relocations_no);
...@@ -414,15 +422,19 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) {...@@ -414,15 +422,19 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) {
414}422}
415423
416static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,424static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
417 DiagnosticsEngine &Diags) {425 DiagnosticsEngine &Diags,
426 IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
418 // Get the target specific parser.427 // Get the target specific parser.
419 std::string Error;428 std::string Error;
420 const Target *TheTarget = TargetRegistry::lookupTarget(Opts.Triple, Error);429 const Target *TheTarget = TargetRegistry::lookupTarget(Opts.Triple, Error);
421 if (!TheTarget)430 if (!TheTarget)
422 return Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;431 return Diags.Report(diag::err_target_unknown_triple) << Opts.Triple.str();
423432
424 ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer =433 ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer = [&] {
425 MemoryBuffer::getFileOrSTDIN(Opts.InputFile, /*IsText=*/true);434 // FIXME(sandboxing): Make this a proper input file.
435 auto BypassSandbox = sys::sandbox::scopedDisable();
436 return MemoryBuffer::getFileOrSTDIN(Opts.InputFile, /*IsText=*/true);
437 }();
426438
427 if (std::error_code EC = Buffer.getError()) {439 if (std::error_code EC = Buffer.getError()) {
428 return Diags.Report(diag::err_fe_error_reading)440 return Diags.Report(diag::err_fe_error_reading)
...@@ -437,6 +449,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -437,6 +449,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
437 // Record the location of the include directories so that the lexer can find449 // Record the location of the include directories so that the lexer can find
438 // it later.450 // it later.
439 SrcMgr.setIncludeDirs(Opts.IncludePaths);451 SrcMgr.setIncludeDirs(Opts.IncludePaths);
452 SrcMgr.setVirtualFileSystem(VFS);
440453
441 std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple));454 std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple));
442 assert(MRI && "Unable to create target register info!");455 assert(MRI && "Unable to create target register info!");
...@@ -445,11 +458,13 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -445,11 +458,13 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
445 MCOptions.MCRelaxAll = Opts.RelaxAll;458 MCOptions.MCRelaxAll = Opts.RelaxAll;
446 MCOptions.EmitDwarfUnwind = Opts.EmitDwarfUnwind;459 MCOptions.EmitDwarfUnwind = Opts.EmitDwarfUnwind;
447 MCOptions.EmitCompactUnwindNonCanonical = Opts.EmitCompactUnwindNonCanonical;460 MCOptions.EmitCompactUnwindNonCanonical = Opts.EmitCompactUnwindNonCanonical;
461 MCOptions.EmitSFrameUnwind = Opts.EmitSFrameUnwind;
448 MCOptions.MCSaveTempLabels = Opts.SaveTemporaryLabels;462 MCOptions.MCSaveTempLabels = Opts.SaveTemporaryLabels;
449 MCOptions.Crel = Opts.Crel;463 MCOptions.Crel = Opts.Crel;
450 MCOptions.ImplicitMapSyms = Opts.ImplicitMapsyms;464 MCOptions.ImplicitMapSyms = Opts.ImplicitMapsyms;
451 MCOptions.X86RelaxRelocations = Opts.X86RelaxRelocations;465 MCOptions.X86RelaxRelocations = Opts.X86RelaxRelocations;
452 MCOptions.X86Sse2Avx = Opts.X86Sse2Avx;466 MCOptions.X86Sse2Avx = Opts.X86Sse2Avx;
467 MCOptions.MCNoExecStack = Opts.NoExecStack;
453 MCOptions.CompressDebugSections = Opts.CompressDebugSections;468 MCOptions.CompressDebugSections = Opts.CompressDebugSections;
454 MCOptions.AsSecureLogFile = Opts.AsSecureLogFile;469 MCOptions.AsSecureLogFile = Opts.AsSecureLogFile;
455470
...@@ -477,7 +492,10 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -477,7 +492,10 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
477492
478 std::unique_ptr<MCSubtargetInfo> STI(493 std::unique_ptr<MCSubtargetInfo> STI(
479 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));494 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
480 assert(STI && "Unable to create subtarget info!");495 if (!STI) {
496 return Diags.Report(diag::err_fe_unable_to_create_subtarget)
497 << Opts.CPU << FS.empty() << FS;
498 }
481499
482 MCContext Ctx(Triple(Opts.Triple), MAI.get(), MRI.get(), STI.get(), &SrcMgr,500 MCContext Ctx(Triple(Opts.Triple), MAI.get(), MRI.get(), STI.get(), &SrcMgr,
483 &MCOptions);501 &MCOptions);
...@@ -509,9 +527,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -509,9 +527,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
509 Ctx.setCompilationDir(Opts.DebugCompilationDir);527 Ctx.setCompilationDir(Opts.DebugCompilationDir);
510 else {528 else {
511 // If no compilation dir is set, try to use the current directory.529 // If no compilation dir is set, try to use the current directory.
512 SmallString<128> CWD;530 if (auto CWD = VFS->getCurrentWorkingDirectory())
513 if (!sys::fs::current_path(CWD))531 Ctx.setCompilationDir(*CWD);
514 Ctx.setCompilationDir(CWD);
515 }532 }
516 if (!Opts.DebugPrefixMap.empty())533 if (!Opts.DebugPrefixMap.empty())
517 for (const auto &KV : Opts.DebugPrefixMap)534 for (const auto &KV : Opts.DebugPrefixMap)
...@@ -577,7 +594,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -577,7 +594,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
577 Triple T(Opts.Triple);594 Triple T(Opts.Triple);
578 Str.reset(TheTarget->createMCObjectStreamer(595 Str.reset(TheTarget->createMCObjectStreamer(
579 T, Ctx, std::move(MAB), std::move(OW), std::move(CE), *STI));596 T, Ctx, std::move(MAB), std::move(OW), std::move(CE), *STI));
580 Str->initSections(Opts.NoExecStack, *STI);
581 if (T.isOSBinFormatMachO() && T.isOSDarwin()) {597 if (T.isOSBinFormatMachO() && T.isOSDarwin()) {
582 Triple *TVT = Opts.DarwinTargetVariantTriple598 Triple *TVT = Opts.DarwinTargetVariantTriple
583 ? &*Opts.DarwinTargetVariantTriple599 ? &*Opts.DarwinTargetVariantTriple
...@@ -605,7 +621,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -605,7 +621,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
605 std::unique_ptr<MCTargetAsmParser> TAP(621 std::unique_ptr<MCTargetAsmParser> TAP(
606 TheTarget->createMCAsmParser(*STI, *Parser, *MCII, MCOptions));622 TheTarget->createMCAsmParser(*STI, *Parser, *MCII, MCOptions));
607 if (!TAP)623 if (!TAP)
608 Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;624 Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple.str();
609625
610 // Set values for symbols, if any.626 // Set values for symbols, if any.
611 for (auto &S : Opts.SymbolDefs) {627 for (auto &S : Opts.SymbolDefs) {
...@@ -627,8 +643,9 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -627,8 +643,9 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
627}643}
628644
629static bool ExecuteAssembler(AssemblerInvocation &Opts,645static bool ExecuteAssembler(AssemblerInvocation &Opts,
630 DiagnosticsEngine &Diags) {646 DiagnosticsEngine &Diags,
631 bool Failed = ExecuteAssemblerImpl(Opts, Diags);647 IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
648 bool Failed = ExecuteAssemblerImpl(Opts, Diags, VFS);
632649
633 // Delete output file if there were errors.650 // Delete output file if there were errors.
634 if (Failed) {651 if (Failed) {
...@@ -662,8 +679,12 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -662,8 +679,12 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
662 TextDiagnosticPrinter *DiagClient =679 TextDiagnosticPrinter *DiagClient =
663 new TextDiagnosticPrinter(errs(), DiagOpts);680 new TextDiagnosticPrinter(errs(), DiagOpts);
664 DiagClient->setPrefix("clang -cc1as");681 DiagClient->setPrefix("clang -cc1as");
665 IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());682 DiagnosticsEngine Diags(DiagnosticIDs::create(), DiagOpts, DiagClient);
666 DiagnosticsEngine Diags(DiagID, DiagOpts, DiagClient);683
684 auto VFS = [] {
685 auto BypassSandbox = sys::sandbox::scopedDisable();
686 return vfs::getRealFileSystem();
687 }();
667688
668 // Set an error handler, so that any LLVM backend diagnostics go through our689 // Set an error handler, so that any LLVM backend diagnostics go through our
669 // error handler.690 // error handler.
...@@ -679,8 +700,7 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -679,8 +700,7 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
679 getDriverOptTable().printHelp(700 getDriverOptTable().printHelp(
680 llvm::outs(), "clang -cc1as [options] file...",701 llvm::outs(), "clang -cc1as [options] file...",
681 "Clang Integrated Assembler", /*ShowHidden=*/false,702 "Clang Integrated Assembler", /*ShowHidden=*/false,
682 /*ShowAllAliases=*/false,703 /*ShowAllAliases=*/false, llvm::opt::Visibility(options::CC1AsOption));
683 llvm::opt::Visibility(driver::options::CC1AsOption));
684704
685 return 0;705 return 0;
686 }706 }
...@@ -703,11 +723,12 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -703,11 +723,12 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
703 for (unsigned i = 0; i != NumArgs; ++i)723 for (unsigned i = 0; i != NumArgs; ++i)
704 Args[i + 1] = Asm.LLVMArgs[i].c_str();724 Args[i + 1] = Asm.LLVMArgs[i].c_str();
705 Args[NumArgs + 1] = nullptr;725 Args[NumArgs + 1] = nullptr;
706 llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get());726 llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get(), /*Overview=*/"",
727 /*Errs=*/nullptr, /*VFS=*/VFS.get());
707 }728 }
708729
709 // Execute the invocation, unless there were parsing errors.730 // Execute the invocation, unless there were parsing errors.
710 bool Failed = Diags.hasErrorOccurred() || ExecuteAssembler(Asm, Diags);731 bool Failed = Diags.hasErrorOccurred() || ExecuteAssembler(Asm, Diags, VFS);
711732
712 // If any timers were active but haven't been destroyed yet, print their733 // If any timers were active but haven't been destroyed yet, print their
713 // results now.734 // results now.
src/zig_clang_driver.cpp+22-14
...@@ -18,13 +18,13 @@...@@ -18,13 +18,13 @@
18#include "clang/Config/config.h"18#include "clang/Config/config.h"
19#include "clang/Driver/Compilation.h"19#include "clang/Driver/Compilation.h"
20#include "clang/Driver/DriverDiagnostic.h"20#include "clang/Driver/DriverDiagnostic.h"
21#include "clang/Driver/Options.h"
22#include "clang/Driver/ToolChain.h"21#include "clang/Driver/ToolChain.h"
23#include "clang/Frontend/ChainedDiagnosticConsumer.h"22#include "clang/Frontend/ChainedDiagnosticConsumer.h"
24#include "clang/Frontend/CompilerInvocation.h"23#include "clang/Frontend/CompilerInvocation.h"
25#include "clang/Frontend/SerializedDiagnosticPrinter.h"24#include "clang/Frontend/SerializedDiagnosticPrinter.h"
26#include "clang/Frontend/TextDiagnosticPrinter.h"25#include "clang/Frontend/TextDiagnosticPrinter.h"
27#include "clang/Frontend/Utils.h"26#include "clang/Frontend/Utils.h"
27#include "clang/Options/Options.h"
28#include "llvm/ADT/ArrayRef.h"28#include "llvm/ADT/ArrayRef.h"
29#include "llvm/ADT/SmallString.h"29#include "llvm/ADT/SmallString.h"
30#include "llvm/ADT/SmallVector.h"30#include "llvm/ADT/SmallVector.h"
...@@ -38,6 +38,7 @@...@@ -38,6 +38,7 @@
38#include "llvm/Support/CrashRecoveryContext.h"38#include "llvm/Support/CrashRecoveryContext.h"
39#include "llvm/Support/ErrorHandling.h"39#include "llvm/Support/ErrorHandling.h"
40#include "llvm/Support/FileSystem.h"40#include "llvm/Support/FileSystem.h"
41#include "llvm/Support/IOSandbox.h"
41#include "llvm/Support/LLVMDriver.h"42#include "llvm/Support/LLVMDriver.h"
42#include "llvm/Support/Path.h"43#include "llvm/Support/Path.h"
43#include "llvm/Support/PrettyStackTrace.h"44#include "llvm/Support/PrettyStackTrace.h"
...@@ -201,7 +202,8 @@ static void FixupDiagPrefixExeName(TextDiagnosticPrinter *DiagClient,...@@ -201,7 +202,8 @@ static void FixupDiagPrefixExeName(TextDiagnosticPrinter *DiagClient,
201}202}
202203
203static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,204static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,
204 const llvm::ToolContext &ToolContext) {205 const llvm::ToolContext &ToolContext,
206 IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
205 // If we call the cc1 tool from the clangDriver library (through207 // If we call the cc1 tool from the clangDriver library (through
206 // Driver::CC1Main), we need to clean up the options usage count. The options208 // Driver::CC1Main), we need to clean up the options usage count. The options
207 // are currently global, and they might have been used previously by the209 // are currently global, and they might have been used previously by the
...@@ -209,7 +211,8 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,...@@ -209,7 +211,8 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,
209 llvm::cl::ResetAllOptionOccurrences();211 llvm::cl::ResetAllOptionOccurrences();
210212
211 llvm::BumpPtrAllocator A;213 llvm::BumpPtrAllocator A;
212 llvm::cl::ExpansionContext ECtx(A, llvm::cl::TokenizeGNUCommandLine);214 llvm::cl::ExpansionContext ECtx(A, llvm::cl::TokenizeGNUCommandLine,
215 VFS.get());
213 if (llvm::Error Err = ECtx.expandResponseFiles(ArgV)) {216 if (llvm::Error Err = ECtx.expandResponseFiles(ArgV)) {
214 llvm::errs() << toString(std::move(Err)) << '\n';217 llvm::errs() << toString(std::move(Err)) << '\n';
215 return 1;218 return 1;
...@@ -249,14 +252,22 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -249,14 +252,22 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
249 bool ClangCLMode =252 bool ClangCLMode =
250 IsClangCL(getDriverMode(ProgName, llvm::ArrayRef(Args).slice(1)));253 IsClangCL(getDriverMode(ProgName, llvm::ArrayRef(Args).slice(1)));
251254
252 if (llvm::Error Err = expandResponseFiles(Args, ClangCLMode, A)) {255 auto VFS = llvm::vfs::getRealFileSystem();
256
257 if (llvm::Error Err = expandResponseFiles(Args, ClangCLMode, A, VFS.get())) {
253 llvm::errs() << toString(std::move(Err)) << '\n';258 llvm::errs() << toString(std::move(Err)) << '\n';
254 return 1;259 return 1;
255 }260 }
256261
257 // Handle -cc1 integrated tools.262 // Handle -cc1 integrated tools.
258 if (Args.size() >= 2 && StringRef(Args[1]).starts_with("-cc1"))263 if (Args.size() >= 2 && StringRef(Args[1]).starts_with("-cc1")) {
259 return ExecuteCC1Tool(Args, ToolContext);264 // Note that this only enables the sandbox for direct -cc1 invocations and
265 // out-of-process -cc1 invocations launched by the driver. For in-process
266 // -cc1 invocations launched by the driver, the sandbox is enabled in
267 // CC1Command::Execute() for better crash recovery.
268 auto EnableSandbox = llvm::sys::sandbox::scopedEnable();
269 return ExecuteCC1Tool(Args, ToolContext, VFS);
270 }
260271
261 // Handle options that need handling before the real command line parsing in272 // Handle options that need handling before the real command line parsing in
262 // Driver::BuildCompilation()273 // Driver::BuildCompilation()
...@@ -326,9 +337,7 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -326,9 +337,7 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
326 new TextDiagnosticPrinter(llvm::errs(), *DiagOpts);337 new TextDiagnosticPrinter(llvm::errs(), *DiagOpts);
327 FixupDiagPrefixExeName(DiagClient, ProgName);338 FixupDiagPrefixExeName(DiagClient, ProgName);
328339
329 IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());340 DiagnosticsEngine Diags(DiagnosticIDs::create(), *DiagOpts, DiagClient);
330
331 DiagnosticsEngine Diags(DiagID, *DiagOpts, DiagClient);
332341
333 if (!DiagOpts->DiagnosticSerializationFile.empty()) {342 if (!DiagOpts->DiagnosticSerializationFile.empty()) {
334 auto SerializedConsumer =343 auto SerializedConsumer =
...@@ -338,7 +347,6 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -338,7 +347,6 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
338 Diags.takeClient(), std::move(SerializedConsumer)));347 Diags.takeClient(), std::move(SerializedConsumer)));
339 }348 }
340349
341 auto VFS = llvm::vfs::getRealFileSystem();
342 ProcessWarningOptions(Diags, *DiagOpts, *VFS, /*ReportDiags=*/false);350 ProcessWarningOptions(Diags, *DiagOpts, *VFS, /*ReportDiags=*/false);
343351
344 Driver TheDriver(Path, llvm::sys::getDefaultTargetTriple(), Diags,352 Driver TheDriver(Path, llvm::sys::getDefaultTargetTriple(), Diags,
...@@ -358,10 +366,10 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -358,10 +366,10 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
358 if (!SetBackdoorDriverOutputsFromEnvVars(TheDriver))366 if (!SetBackdoorDriverOutputsFromEnvVars(TheDriver))
359 return 1;367 return 1;
360368
361 auto ExecuteCC1WithContext =369 auto ExecuteCC1WithContext = [&ToolContext,
362 [&ToolContext](SmallVectorImpl<const char *> &ArgV) {370 &VFS](SmallVectorImpl<const char *> &ArgV) {
363 return ExecuteCC1Tool(ArgV, ToolContext);371 return ExecuteCC1Tool(ArgV, ToolContext, VFS);
364 };372 };
365 if (!UseNewCC1Process) {373 if (!UseNewCC1Process) {
366 TheDriver.CC1Main = ExecuteCC1WithContext;374 TheDriver.CC1Main = ExecuteCC1WithContext;
367 // Ensure the CC1Command actually catches cc1 crashes375 // Ensure the CC1Command actually catches cc1 crashes
src/zig_llvm-ar.cpp+1
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12//===----------------------------------------------------------------------===//12//===----------------------------------------------------------------------===//
1313
14#include "llvm/ADT/StringExtras.h"14#include "llvm/ADT/StringExtras.h"
15#include "llvm/ADT/StringMap.h"
15#include "llvm/ADT/StringSwitch.h"16#include "llvm/ADT/StringSwitch.h"
16#include "llvm/BinaryFormat/Magic.h"17#include "llvm/BinaryFormat/Magic.h"
17#include "llvm/IR/LLVMContext.h"18#include "llvm/IR/LLVMContext.h"
src/zig_llvm.cpp+1-1
...@@ -439,7 +439,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi...@@ -439,7 +439,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi
439439
440void ZigLLVMSetOptBisectLimit(LLVMContextRef context_ref, int limit) {440void ZigLLVMSetOptBisectLimit(LLVMContextRef context_ref, int limit) {
441 static OptBisect opt_bisect;441 static OptBisect opt_bisect;
442 opt_bisect.setLimit(limit);442 opt_bisect.setIntervals({0, limit});
443 unwrap(context_ref)->setOptPassGate(opt_bisect);443 unwrap(context_ref)->setOptPassGate(opt_bisect);
444}444}
445445
stage1/zig.h+354-1
...@@ -79,6 +79,9 @@...@@ -79,6 +79,9 @@
79#elif defined(__I86__)79#elif defined(__I86__)
80#define zig_x86_1680#define zig_x86_16
81#define zig_x8681#define zig_x86
82#elif defined (__ez80)
83#define zig_ez80
84#define zig_z80
82#endif85#endif
8386
84#if defined(zig_msvc) || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__87#if defined(zig_msvc) || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
...@@ -409,6 +412,8 @@...@@ -409,6 +412,8 @@
409#define zig_trap() __asm__ volatile("int $0x3")412#define zig_trap() __asm__ volatile("int $0x3")
410#elif defined(zig_x86)413#elif defined(zig_x86)
411#define zig_trap() __asm__ volatile("ud2")414#define zig_trap() __asm__ volatile("ud2")
415#elif defined(zig_z80)
416#define zig_trap() __asm__ volatile("rst 00h")
412#else417#else
413#define zig_trap() zig_trap_unavailable418#define zig_trap() zig_trap_unavailable
414#endif419#endif
...@@ -511,7 +516,7 @@ zig_extern void *memcpy (void *zig_restrict, void const *zig_restrict, size_t);...@@ -511,7 +516,7 @@ zig_extern void *memcpy (void *zig_restrict, void const *zig_restrict, size_t);
511zig_extern void *memset (void *, int, size_t);516zig_extern void *memset (void *, int, size_t);
512zig_extern void *memmove (void *, void const *, size_t);517zig_extern void *memmove (void *, void const *, size_t);
513518
514/* ================ Bool and 8/16/32/64-bit Integer Support ================= */519/* ================ Bool and 8/16/24/32/48/64-bit Integer Support ================= */
515520
516#include <limits.h>521#include <limits.h>
517522
...@@ -590,6 +595,16 @@ typedef signed long long int16_t;...@@ -590,6 +595,16 @@ typedef signed long long int16_t;
590#define INT16_MAX ( INT16_C(0x7FFF))595#define INT16_MAX ( INT16_C(0x7FFF))
591#define UINT16_MAX ( INT16_C(0xFFFF))596#define UINT16_MAX ( INT16_C(0xFFFF))
592597
598#if defined(zig_ez80)
599typedef unsigned int uint24_t;
600typedef signed int int24_t;
601#define INT24_C(c) c
602#define UINT24_C(c) c##U
603#endif
604#define INT24_MIN (~INT24_C(0x7FFF))
605#define INT24_MAX ( INT24_C(0x7FFF))
606#define UINT24_MAX ( INT24_C(0xFFFF))
607
593#if SCHAR_MIN == ~0x7FFFFFFF && SCHAR_MAX == 0x7FFFFFFF && UCHAR_MAX == 0xFFFFFFFF608#if SCHAR_MIN == ~0x7FFFFFFF && SCHAR_MAX == 0x7FFFFFFF && UCHAR_MAX == 0xFFFFFFFF
594typedef unsigned char uint32_t;609typedef unsigned char uint32_t;
595typedef signed char int32_t;610typedef signed char int32_t;
...@@ -620,6 +635,17 @@ typedef signed long long int32_t;...@@ -620,6 +635,17 @@ typedef signed long long int32_t;
620#define INT32_MAX ( INT32_C(0x7FFFFFFF))635#define INT32_MAX ( INT32_C(0x7FFFFFFF))
621#define UINT32_MAX ( INT32_C(0xFFFFFFFF))636#define UINT32_MAX ( INT32_C(0xFFFFFFFF))
622637
638#if defined(zig_ez80)
639typedef unsigned __int48 uint48_t;
640typedef signed __int48 int48_t;
641#define INT48_C(c) c
642/* no suffix */
643#define UINT48_C(c) ((uint48_t)(c))
644#endif
645#define INT48_MIN (~INT48_C(0x7FFFFFFFFFFF))
646#define INT48_MAX ( INT48_C(0x7FFFFFFFFFFF))
647#define UINT48_MAX ( INT48_C(0xFFFFFFFFFFFF))
648
623#if SCHAR_MIN == ~0x7FFFFFFFFFFFFFFF && SCHAR_MAX == 0x7FFFFFFFFFFFFFFF && UCHAR_MAX == 0xFFFFFFFFFFFFFFFF649#if SCHAR_MIN == ~0x7FFFFFFFFFFFFFFF && SCHAR_MAX == 0x7FFFFFFFFFFFFFFF && UCHAR_MAX == 0xFFFFFFFFFFFFFFFF
624typedef unsigned char uint64_t;650typedef unsigned char uint64_t;
625typedef signed char int64_t;651typedef signed char int64_t;
...@@ -663,10 +689,18 @@ typedef ptrdiff_t intptr_t;...@@ -663,10 +689,18 @@ typedef ptrdiff_t intptr_t;
663#define zig_maxInt_i16 INT16_MAX689#define zig_maxInt_i16 INT16_MAX
664#define zig_minInt_u16 UINT16_C(0)690#define zig_minInt_u16 UINT16_C(0)
665#define zig_maxInt_u16 UINT16_MAX691#define zig_maxInt_u16 UINT16_MAX
692#define zig_minInt_i24 INT24_MIN
693#define zig_maxInt_i24 INT24_MAX
694#define zig_minInt_u24 UINT24_C(0)
695#define zig_maxInt_u24 UINT24_MAX
666#define zig_minInt_i32 INT32_MIN696#define zig_minInt_i32 INT32_MIN
667#define zig_maxInt_i32 INT32_MAX697#define zig_maxInt_i32 INT32_MAX
668#define zig_minInt_u32 UINT32_C(0)698#define zig_minInt_u32 UINT32_C(0)
669#define zig_maxInt_u32 UINT32_MAX699#define zig_maxInt_u32 UINT32_MAX
700#define zig_minInt_i48 INT48_MIN
701#define zig_maxInt_i48 INT48_MAX
702#define zig_minInt_u48 UINT48_C(0)
703#define zig_maxInt_u48 UINT48_MAX
670#define zig_minInt_i64 INT64_MIN704#define zig_minInt_i64 INT64_MIN
671#define zig_maxInt_i64 INT64_MAX705#define zig_maxInt_i64 INT64_MAX
672#define zig_minInt_u64 UINT64_C(0)706#define zig_minInt_u64 UINT64_C(0)
...@@ -786,6 +820,17 @@ zig_int_helpers(16, unsigned long long)...@@ -786,6 +820,17 @@ zig_int_helpers(16, unsigned long long)
786#else820#else
787zig_int_helpers(16, uint16_t)821zig_int_helpers(16, uint16_t)
788#endif822#endif
823#if defined(zig_ez80)
824#if UINT24_MAX <= UINT_MAX
825zig_int_helpers(24, unsigned int)
826#elif UINT24_MAX <= ULONG_MAX
827zig_int_helpers(24, unsigned long)
828#elif UINT24_MAX <= ULLONG_MAX
829zig_int_helpers(24, unsigned long long)
830#else
831zig_int_helpers(24, uint24_t)
832#endif
833#endif
789#if UINT32_MAX <= UINT_MAX834#if UINT32_MAX <= UINT_MAX
790zig_int_helpers(32, unsigned int)835zig_int_helpers(32, unsigned int)
791#elif UINT32_MAX <= ULONG_MAX836#elif UINT32_MAX <= ULONG_MAX
...@@ -795,6 +840,17 @@ zig_int_helpers(32, unsigned long long)...@@ -795,6 +840,17 @@ zig_int_helpers(32, unsigned long long)
795#else840#else
796zig_int_helpers(32, uint32_t)841zig_int_helpers(32, uint32_t)
797#endif842#endif
843#if defined(zig_ez80)
844#if UINT24_MAX <= UINT_MAX
845zig_int_helpers(48, unsigned int)
846#elif UINT24_MAX <= ULONG_MAX
847zig_int_helpers(48, unsigned long)
848#elif UINT24_MAX <= ULLONG_MAX
849zig_int_helpers(48, unsigned long long)
850#else
851zig_int_helpers(48, uint48_t)
852#endif
853#endif
798#if UINT64_MAX <= UINT_MAX854#if UINT64_MAX <= UINT_MAX
799zig_int_helpers(64, unsigned int)855zig_int_helpers(64, unsigned int)
800#elif UINT64_MAX <= ULONG_MAX856#elif UINT64_MAX <= ULONG_MAX
...@@ -909,6 +965,66 @@ static inline bool zig_addo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t...@@ -909,6 +965,66 @@ static inline bool zig_addo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t
909#endif965#endif
910}966}
911967
968#if defined(zig_ez80)
969static inline bool zig_addo_u24(uint24_t *res, uint24_t lhs, uint24_t rhs, uint8_t bits) {
970#if zig_has_builtin(add_overflow) || defined(zig_gcc)
971 uint24_t full_res;
972 bool overflow = __builtin_add_overflow(lhs, rhs, &full_res);
973 *res = zig_wrap_u24(full_res, bits);
974 return overflow || full_res < zig_minInt_u(24, bits) || full_res > zig_maxInt_u(24, bits);
975#else
976 uint32_t full_res;
977 bool overflow = zig_addo_u32(&full_res, lhs, rhs, bits);
978 *res = (uint24_t)full_res;
979 return overflow;
980#endif
981}
982
983static inline bool zig_addo_i24(int24_t *res, int24_t lhs, int24_t rhs, uint8_t bits) {
984#if zig_has_builtin(add_overflow) || defined(zig_gcc)
985 int24_t full_res;
986 bool overflow = __builtin_add_overflow(lhs, rhs, &full_res);
987 *res = zig_wrap_i24(full_res, bits);
988 return overflow || full_res < zig_minInt_i(24, bits) || full_res > zig_maxInt_i(24, bits);
989#else
990 int32_t full_res;
991 bool overflow = zig_addo_i32(&full_res, lhs, rhs, bits);
992 *res = (int24_t)full_res;
993 return overflow;
994#endif
995}
996#endif
997
998#if defined(zig_ez80)
999static inline bool zig_addo_u48(uint48_t *res, uint48_t lhs, uint48_t rhs, uint8_t bits) {
1000#if zig_has_builtin(add_overflow) || defined(zig_gcc)
1001 uint48_t full_res;
1002 bool overflow = __builtin_add_overflow(lhs, rhs, &full_res);
1003 *res = zig_wrap_u48(full_res, bits);
1004 return overflow || full_res < zig_minInt_u(48, bits) || full_res > zig_maxInt_u(48, bits);
1005#else
1006 uint64_t full_res;
1007 bool overflow = zig_addo_u64(&full_res, lhs, rhs, bits);
1008 *res = (uint48_t)full_res;
1009 return overflow;
1010#endif
1011}
1012
1013static inline bool zig_addo_i48(int48_t *res, int48_t lhs, int48_t rhs, uint8_t bits) {
1014#if zig_has_builtin(add_overflow) || defined(zig_gcc)
1015 int48_t full_res;
1016 bool overflow = __builtin_add_overflow(lhs, rhs, &full_res);
1017 *res = zig_wrap_i48(full_res, bits);
1018 return overflow || full_res < zig_minInt_i(48, bits) || full_res > zig_maxInt_i(48, bits);
1019#else
1020 int64_t full_res;
1021 bool overflow = zig_addo_i64(&full_res, lhs, rhs, bits);
1022 *res = (int48_t)full_res;
1023 return overflow;
1024#endif
1025}
1026#endif
1027
912static inline bool zig_subo_u32(uint32_t *res, uint32_t lhs, uint32_t rhs, uint8_t bits) {1028static inline bool zig_subo_u32(uint32_t *res, uint32_t lhs, uint32_t rhs, uint8_t bits) {
913#if zig_has_builtin(sub_overflow) || defined(zig_gcc)1029#if zig_has_builtin(sub_overflow) || defined(zig_gcc)
914 uint32_t full_res;1030 uint32_t full_res;
...@@ -933,6 +1049,7 @@ static inline bool zig_subo_i32(int32_t *res, int32_t lhs, int32_t rhs, uint8_t...@@ -933,6 +1049,7 @@ static inline bool zig_subo_i32(int32_t *res, int32_t lhs, int32_t rhs, uint8_t
933 return overflow || full_res < zig_minInt_i(32, bits) || full_res > zig_maxInt_i(32, bits);1049 return overflow || full_res < zig_minInt_i(32, bits) || full_res > zig_maxInt_i(32, bits);
934}1050}
9351051
1052
936static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {1053static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
937#if zig_has_builtin(sub_overflow) || defined(zig_gcc)1054#if zig_has_builtin(sub_overflow) || defined(zig_gcc)
938 uint64_t full_res;1055 uint64_t full_res;
...@@ -1013,6 +1130,66 @@ static inline bool zig_subo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t...@@ -1013,6 +1130,66 @@ static inline bool zig_subo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t
1013#endif1130#endif
1014}1131}
10151132
1133#if defined(zig_ez80)
1134static inline bool zig_subo_u24(uint24_t *res, uint24_t lhs, uint24_t rhs, uint8_t bits) {
1135#if zig_has_builtin(sub_overflow) || defined(zig_gcc)
1136 uint24_t full_res;
1137 bool overflow = __builtin_sub_overflow(lhs, rhs, &full_res);
1138 *res = zig_wrap_u24(full_res, bits);
1139 return overflow || full_res < zig_minInt_u(24, bits) || full_res > zig_maxInt_u(24, bits);
1140#else
1141 uint32_t full_res;
1142 bool overflow = zig_subo_u32(&full_res, lhs, rhs, bits);
1143 *res = (uint24_t)full_res;
1144 return overflow;
1145#endif
1146}
1147
1148static inline bool zig_subo_i24(int24_t *res, int24_t lhs, int24_t rhs, uint8_t bits) {
1149#if zig_has_builtin(sub_overflow) || defined(zig_gcc)
1150 int24_t full_res;
1151 bool overflow = __builtin_sub_overflow(lhs, rhs, &full_res);
1152 *res = zig_wrap_i24(full_res, bits);
1153 return overflow || full_res < zig_minInt_i(24, bits) || full_res > zig_maxInt_i(24, bits);
1154#else
1155 int32_t full_res;
1156 bool overflow = zig_subo_i32(&full_res, lhs, rhs, bits);
1157 *res = (int24_t)full_res;
1158 return overflow;
1159#endif
1160}
1161#endif
1162
1163#if defined(zig_ez80)
1164static inline bool zig_subo_u48(uint48_t *res, uint48_t lhs, uint48_t rhs, uint8_t bits) {
1165#if zig_has_builtin(sub_overflow) || defined(zig_gcc)
1166 uint48_t full_res;
1167 bool overflow = __builtin_sub_overflow(lhs, rhs, &full_res);
1168 *res = zig_wrap_u48(full_res, bits);
1169 return overflow || full_res < zig_minInt_u(48, bits) || full_res > zig_maxInt_u(48, bits);
1170#else
1171 uint64_t full_res;
1172 bool overflow = zig_subo_u64(&full_res, lhs, rhs, bits);
1173 *res = (uint48_t)full_res;
1174 return overflow;
1175#endif
1176}
1177
1178static inline bool zig_subo_i48(int48_t *res, int48_t lhs, int48_t rhs, uint8_t bits) {
1179#if zig_has_builtin(sub_overflow) || defined(zig_gcc)
1180 int48_t full_res;
1181 bool overflow = __builtin_sub_overflow(lhs, rhs, &full_res);
1182 *res = zig_wrap_i48(full_res, bits);
1183 return overflow || full_res < zig_minInt_i(48, bits) || full_res > zig_maxInt_i(48, bits);
1184#else
1185 int64_t full_res;
1186 bool overflow = zig_subo_i64(&full_res, lhs, rhs, bits);
1187 *res = (int48_t)full_res;
1188 return overflow;
1189#endif
1190}
1191#endif
1192
1016static inline bool zig_mulo_u32(uint32_t *res, uint32_t lhs, uint32_t rhs, uint8_t bits) {1193static inline bool zig_mulo_u32(uint32_t *res, uint32_t lhs, uint32_t rhs, uint8_t bits) {
1017#if zig_has_builtin(mul_overflow) || defined(zig_gcc)1194#if zig_has_builtin(mul_overflow) || defined(zig_gcc)
1018 uint32_t full_res;1195 uint32_t full_res;
...@@ -1121,6 +1298,66 @@ static inline bool zig_mulo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t...@@ -1121,6 +1298,66 @@ static inline bool zig_mulo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t
1121#endif1298#endif
1122}1299}
11231300
1301#if defined(zig_ez80)
1302static inline bool zig_mulo_u24(uint24_t *res, uint24_t lhs, uint24_t rhs, uint8_t bits) {
1303#if zig_has_builtin(mul_overflow) || defined(zig_gcc)
1304 uint24_t full_res;
1305 bool overflow = __builtin_mul_overflow(lhs, rhs, &full_res);
1306 *res = zig_wrap_u24(full_res, bits);
1307 return overflow || full_res < zig_minInt_u(24, bits) || full_res > zig_maxInt_u(24, bits);
1308#else
1309 uint32_t full_res;
1310 bool overflow = zig_mulo_u32(&full_res, lhs, rhs, bits);
1311 *res = (uint24_t)full_res;
1312 return overflow;
1313#endif
1314}
1315
1316static inline bool zig_mulo_i24(int24_t *res, int24_t lhs, int24_t rhs, uint8_t bits) {
1317#if zig_has_builtin(mul_overflow) || defined(zig_gcc)
1318 int24_t full_res;
1319 bool overflow = __builtin_mul_overflow(lhs, rhs, &full_res);
1320 *res = zig_wrap_i24(full_res, bits);
1321 return overflow || full_res < zig_minInt_i(24, bits) || full_res > zig_maxInt_i(24, bits);
1322#else
1323 int32_t full_res;
1324 bool overflow = zig_mulo_i32(&full_res, lhs, rhs, bits);
1325 *res = (int24_t)full_res;
1326 return overflow;
1327#endif
1328}
1329#endif
1330
1331#if defined(zig_ez80)
1332static inline bool zig_mulo_u48(uint48_t *res, uint48_t lhs, uint48_t rhs, uint8_t bits) {
1333#if zig_has_builtin(mul_overflow) || defined(zig_gcc)
1334 uint48_t full_res;
1335 bool overflow = __builtin_mul_overflow(lhs, rhs, &full_res);
1336 *res = zig_wrap_u48(full_res, bits);
1337 return overflow || full_res < zig_minInt_u(48, bits) || full_res > zig_maxInt_u(48, bits);
1338#else
1339 uint64_t full_res;
1340 bool overflow = zig_mulo_u64(&full_res, lhs, rhs, bits);
1341 *res = (uint48_t)full_res;
1342 return overflow;
1343#endif
1344}
1345
1346static inline bool zig_mulo_i48(int48_t *res, int48_t lhs, int48_t rhs, uint8_t bits) {
1347#if zig_has_builtin(mul_overflow) || defined(zig_gcc)
1348 int48_t full_res;
1349 bool overflow = __builtin_mul_overflow(lhs, rhs, &full_res);
1350 *res = zig_wrap_i48(full_res, bits);
1351 return overflow || full_res < zig_minInt_i(48, bits) || full_res > zig_maxInt_i(48, bits);
1352#else
1353 int64_t full_res;
1354 bool overflow = zig_mulo_i64(&full_res, lhs, rhs, bits);
1355 *res = (int48_t)full_res;
1356 return overflow;
1357#endif
1358}
1359#endif
1360
1124#define zig_int_builtins(w) \1361#define zig_int_builtins(w) \
1125 static inline bool zig_shlo_u##w(uint##w##_t *res, uint##w##_t lhs, uint8_t rhs, uint8_t bits) { \1362 static inline bool zig_shlo_u##w(uint##w##_t *res, uint##w##_t lhs, uint8_t rhs, uint8_t bits) { \
1126 *res = zig_shlw_u##w(lhs, rhs, bits); \1363 *res = zig_shlw_u##w(lhs, rhs, bits); \
...@@ -1180,7 +1417,13 @@ static inline bool zig_mulo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t...@@ -1180,7 +1417,13 @@ static inline bool zig_mulo_i16(int16_t *res, int16_t lhs, int16_t rhs, uint8_t
1180 }1417 }
1181zig_int_builtins(8)1418zig_int_builtins(8)
1182zig_int_builtins(16)1419zig_int_builtins(16)
1420#if defined(zig_ez80)
1421zig_int_builtins(24)
1422#endif
1183zig_int_builtins(32)1423zig_int_builtins(32)
1424#if defined(zig_ez80)
1425zig_int_builtins(48)
1426#endif
1184zig_int_builtins(64)1427zig_int_builtins(64)
11851428
1186#define zig_builtin8(name, val) __builtin_##name(val)1429#define zig_builtin8(name, val) __builtin_##name(val)
...@@ -1189,6 +1432,11 @@ typedef unsigned int zig_Builtin8;...@@ -1189,6 +1432,11 @@ typedef unsigned int zig_Builtin8;
1189#define zig_builtin16(name, val) __builtin_##name(val)1432#define zig_builtin16(name, val) __builtin_##name(val)
1190typedef unsigned int zig_Builtin16;1433typedef unsigned int zig_Builtin16;
11911434
1435#if defined(zig_ez80)
1436#define zig_builtin24(name, val) __builtin_##name(val)
1437typedef unsigned int zig_Builtin24;
1438#endif
1439
1192#if INT_MIN <= INT32_MIN1440#if INT_MIN <= INT32_MIN
1193#define zig_builtin32(name, val) __builtin_##name(val)1441#define zig_builtin32(name, val) __builtin_##name(val)
1194typedef unsigned int zig_Builtin32;1442typedef unsigned int zig_Builtin32;
...@@ -1197,6 +1445,11 @@ typedef unsigned int zig_Builtin32;...@@ -1197,6 +1445,11 @@ typedef unsigned int zig_Builtin32;
1197typedef unsigned long zig_Builtin32;1445typedef unsigned long zig_Builtin32;
1198#endif1446#endif
11991447
1448#if defined(zig_ez80)
1449#define zig_builtin48(name, val) __builtin_##name(val)
1450typedef unsigned long long zig_Builtin48;
1451#endif
1452
1200#if INT_MIN <= INT64_MIN1453#if INT_MIN <= INT64_MIN
1201#define zig_builtin64(name, val) __builtin_##name(val)1454#define zig_builtin64(name, val) __builtin_##name(val)
1202typedef unsigned int zig_Builtin64;1455typedef unsigned int zig_Builtin64;
...@@ -1231,6 +1484,23 @@ static inline int16_t zig_byte_swap_i16(int16_t val, uint8_t bits) {...@@ -1231,6 +1484,23 @@ static inline int16_t zig_byte_swap_i16(int16_t val, uint8_t bits) {
1231 return zig_wrap_i16((int16_t)zig_byte_swap_u16((uint16_t)val, bits), bits);1484 return zig_wrap_i16((int16_t)zig_byte_swap_u16((uint16_t)val, bits), bits);
1232}1485}
12331486
1487#if defined(zig_ez80)
1488static inline uint16_t zig_byte_swap_u24(uint24_t val, uint8_t bits) {
1489 uint24_t full_res;
1490#if zig_has_builtin(bswap24) || defined(zig_gcc)
1491 full_res = __builtin_bswap24(val);
1492#else
1493 full_res = (uint24_t)zig_byte_swap_u8((uint8_t)(val >> 0), 8) << 16 |
1494 (uint24_t)zig_byte_swap_u16((uint16_t)(val >> 8), 16) >> 0;
1495#endif
1496 return zig_wrap_u24(full_res >> (24 - bits), bits);
1497}
1498
1499static inline int16_t zig_byte_swap_i24(int24_t val, uint8_t bits) {
1500 return zig_wrap_i24((int24_t)zig_byte_swap_u24((uint24_t)val, bits), bits);
1501}
1502#endif
1503
1234static inline uint32_t zig_byte_swap_u32(uint32_t val, uint8_t bits) {1504static inline uint32_t zig_byte_swap_u32(uint32_t val, uint8_t bits) {
1235 uint32_t full_res;1505 uint32_t full_res;
1236#if zig_has_builtin(bswap32) || defined(zig_gcc)1506#if zig_has_builtin(bswap32) || defined(zig_gcc)
...@@ -1246,6 +1516,23 @@ static inline int32_t zig_byte_swap_i32(int32_t val, uint8_t bits) {...@@ -1246,6 +1516,23 @@ static inline int32_t zig_byte_swap_i32(int32_t val, uint8_t bits) {
1246 return zig_wrap_i32((int32_t)zig_byte_swap_u32((uint32_t)val, bits), bits);1516 return zig_wrap_i32((int32_t)zig_byte_swap_u32((uint32_t)val, bits), bits);
1247}1517}
12481518
1519#if defined(zig_ez80)
1520static inline uint32_t zig_byte_swap_u48(uint48_t val, uint8_t bits) {
1521 uint48_t full_res;
1522#if zig_has_builtin(bswap48) || defined(zig_gcc)
1523 full_res = __builtin_bswap48(val);
1524#else
1525 full_res = (uint48_t)zig_byte_swap_u24((uint24_t)(val >> 0), 24) << 24 |
1526 (uint48_t)zig_byte_swap_u24((uint24_t)(val >> 24), 24) >> 0;
1527#endif
1528 return zig_wrap_u48(full_res >> (48 - bits), bits);
1529}
1530
1531static inline int32_t zig_byte_swap_i48(int48_t val, uint8_t bits) {
1532 return zig_wrap_i48((int48_t)zig_byte_swap_u48((uint48_t)val, bits), bits);
1533}
1534#endif
1535
1249static inline uint64_t zig_byte_swap_u64(uint64_t val, uint8_t bits) {1536static inline uint64_t zig_byte_swap_u64(uint64_t val, uint8_t bits) {
1250 uint64_t full_res;1537 uint64_t full_res;
1251#if zig_has_builtin(bswap64) || defined(zig_gcc)1538#if zig_has_builtin(bswap64) || defined(zig_gcc)
...@@ -1294,6 +1581,23 @@ static inline int16_t zig_bit_reverse_i16(int16_t val, uint8_t bits) {...@@ -1294,6 +1581,23 @@ static inline int16_t zig_bit_reverse_i16(int16_t val, uint8_t bits) {
1294 return zig_wrap_i16((int16_t)zig_bit_reverse_u16((uint16_t)val, bits), bits);1581 return zig_wrap_i16((int16_t)zig_bit_reverse_u16((uint16_t)val, bits), bits);
1295}1582}
12961583
1584#if defined(zig_ez80)
1585static inline uint24_t zig_bit_reverse_u24(uint24_t val, uint8_t bits) {
1586 uint24_t full_res;
1587#if zig_has_builtin(bitreverse24)
1588 full_res = __builtin_bitreverse24(val);
1589#else
1590 full_res = (uint24_t)zig_bit_reverse_u8((uint8_t)(val >> 0), 8) << 16 |
1591 (uint24_t)zig_bit_reverse_u16((uint16_t)(val >> 8), 16) >> 0;
1592#endif
1593 return zig_wrap_u24(full_res >> (24 - bits), bits);
1594}
1595
1596static inline int24_t zig_bit_reverse_i24(int24_t val, uint8_t bits) {
1597 return zig_wrap_i24((int24_t)zig_bit_reverse_u24((uint24_t)val, bits), bits);
1598}
1599#endif
1600
1297static inline uint32_t zig_bit_reverse_u32(uint32_t val, uint8_t bits) {1601static inline uint32_t zig_bit_reverse_u32(uint32_t val, uint8_t bits) {
1298 uint32_t full_res;1602 uint32_t full_res;
1299#if zig_has_builtin(bitreverse32)1603#if zig_has_builtin(bitreverse32)
...@@ -1309,6 +1613,23 @@ static inline int32_t zig_bit_reverse_i32(int32_t val, uint8_t bits) {...@@ -1309,6 +1613,23 @@ static inline int32_t zig_bit_reverse_i32(int32_t val, uint8_t bits) {
1309 return zig_wrap_i32((int32_t)zig_bit_reverse_u32((uint32_t)val, bits), bits);1613 return zig_wrap_i32((int32_t)zig_bit_reverse_u32((uint32_t)val, bits), bits);
1310}1614}
13111615
1616#if defined(zig_ez80)
1617static inline uint32_t zig_bit_reverse_u48(uint48_t val, uint8_t bits) {
1618 uint48_t full_res;
1619#if zig_has_builtin(bitreverse48)
1620 full_res = __builtin_bitreverse48(val);
1621#else
1622 full_res = (uint48_t)zig_bit_reverse_u24((uint24_t)(val >> 0), 24) << 24 |
1623 (uint48_t)zig_bit_reverse_u24((uint24_t)(val >> 24), 24) >> 0;
1624#endif
1625 return zig_wrap_u32(full_res >> (48 - bits), bits);
1626}
1627
1628static inline int32_t zig_bit_reverse_i48(int48_t val, uint8_t bits) {
1629 return zig_wrap_i48((int48_t)zig_bit_reverse_u48((uint48_t)val, bits), bits);
1630}
1631#endif
1632
1312static inline uint64_t zig_bit_reverse_u64(uint64_t val, uint8_t bits) {1633static inline uint64_t zig_bit_reverse_u64(uint64_t val, uint8_t bits) {
1313 uint64_t full_res;1634 uint64_t full_res;
1314#if zig_has_builtin(bitreverse64)1635#if zig_has_builtin(bitreverse64)
...@@ -1350,7 +1671,13 @@ static inline int64_t zig_bit_reverse_i64(int64_t val, uint8_t bits) {...@@ -1350,7 +1671,13 @@ static inline int64_t zig_bit_reverse_i64(int64_t val, uint8_t bits) {
1350#endif1671#endif
1351zig_builtin_popcount(8)1672zig_builtin_popcount(8)
1352zig_builtin_popcount(16)1673zig_builtin_popcount(16)
1674#if defined(zig_ez80)
1675zig_builtin_popcount(24)
1676#endif
1353zig_builtin_popcount(32)1677zig_builtin_popcount(32)
1678#if defined(zig_ez80)
1679zig_builtin_popcount(48)
1680#endif
1354zig_builtin_popcount(64)1681zig_builtin_popcount(64)
13551682
1356#define zig_builtin_ctz_common(w) \1683#define zig_builtin_ctz_common(w) \
...@@ -1375,7 +1702,13 @@ zig_builtin_popcount(64)...@@ -1375,7 +1702,13 @@ zig_builtin_popcount(64)
1375#endif1702#endif
1376zig_builtin_ctz(8)1703zig_builtin_ctz(8)
1377zig_builtin_ctz(16)1704zig_builtin_ctz(16)
1705#if defined(zig_ez80)
1706zig_builtin_ctz(24)
1707#endif
1378zig_builtin_ctz(32)1708zig_builtin_ctz(32)
1709#if defined(zig_ez80)
1710zig_builtin_ctz(48)
1711#endif
1379zig_builtin_ctz(64)1712zig_builtin_ctz(64)
13801713
1381#define zig_builtin_clz_common(w) \1714#define zig_builtin_clz_common(w) \
...@@ -1400,7 +1733,13 @@ zig_builtin_ctz(64)...@@ -1400,7 +1733,13 @@ zig_builtin_ctz(64)
1400#endif1733#endif
1401zig_builtin_clz(8)1734zig_builtin_clz(8)
1402zig_builtin_clz(16)1735zig_builtin_clz(16)
1736#if defined(zig_ez80)
1737zig_builtin_clz(24)
1738#endif
1403zig_builtin_clz(32)1739zig_builtin_clz(32)
1740#if defined(zig_ez80)
1741zig_builtin_clz(48)
1742#endif
1404zig_builtin_clz(64)1743zig_builtin_clz(64)
14051744
1406/* ======================== 128-bit Integer Support ========================= */1745/* ======================== 128-bit Integer Support ========================= */
...@@ -1981,6 +2320,20 @@ static inline zig_i128 zig_bit_reverse_i128(zig_i128 val, uint8_t bits) {...@@ -1981,6 +2320,20 @@ static inline zig_i128 zig_bit_reverse_i128(zig_i128 val, uint8_t bits) {
1981 return zig_bitCast_i128(zig_bit_reverse_u128(zig_bitCast_u128(val), bits));2320 return zig_bitCast_i128(zig_bit_reverse_u128(zig_bitCast_u128(val), bits));
1982}2321}
19832322
2323#if zig_has_int128
2324#define zig_switch_int128(operand) switch (operand)
2325#define zig_switch_prong_begin_int128()
2326#define zig_switch_case_int128(Type, operand, value) case value:
2327#define zig_switch_prong_end_int128()
2328#define zig_switch_default_int128() default:
2329#else // zig_has_int128
2330#define zig_switch_int128(operand)
2331#define zig_switch_prong_begin_int128() if (0
2332#define zig_switch_case_int128(Type, operand, value) || (zig_cmp_##Type(operand, value) == 0)
2333#define zig_switch_prong_end_int128() )
2334#define zig_switch_default_int128()
2335#endif // zig_has_int128
2336
1984/* ========================== Big Integer Support =========================== */2337/* ========================== Big Integer Support =========================== */
19852338
1986static inline uint16_t zig_int_bytes(uint16_t bits) {2339static inline uint16_t zig_int_bytes(uint16_t bits) {
stage1/zig1.wasm
Binary files a/stage1/zig1.wasm and b/stage1/zig1.wasm differ
test/behavior/align.zig-1
...@@ -317,7 +317,6 @@ test "@alignCast functions" {...@@ -317,7 +317,6 @@ test "@alignCast functions" {
317317
318 // function alignment is a compile error on wasm318 // function alignment is a compile error on wasm
319 if (native_arch.isWasm()) return error.SkipZigTest;319 if (native_arch.isWasm()) return error.SkipZigTest;
320 if (native_arch.isThumb()) return error.SkipZigTest;
321320
322 try expect(fnExpectsOnly1(simple4) == 0x19);321 try expect(fnExpectsOnly1(simple4) == 0x19);
323}322}
test/behavior/asm.zig+1-5
...@@ -67,7 +67,6 @@ test "alternative constraints" {...@@ -67,7 +67,6 @@ test "alternative constraints" {
67 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO67 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
68 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;68 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
69 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;69 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
70 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isLoongArch()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/159200
7170
72 if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support inline assembly71 if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support inline assembly
7372
...@@ -247,12 +246,9 @@ test "extern output types (x86_64)" {...@@ -247,12 +246,9 @@ test "extern output types (x86_64)" {
247 }246 }
248}247}
249248
250test "riscv abi register aliases as clobbers" {249test "abi register aliases as clobbers (RISC-V)" {
251 if (!builtin.target.cpu.arch.isRISCV()) return error.SkipZigTest;250 if (!builtin.target.cpu.arch.isRISCV()) return error.SkipZigTest;
252 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;251 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
253 if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest;
254
255 if (!comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
256252
257 // Verify that ABI alias names are accepted as clobbers for RISC-V.253 // Verify that ABI alias names are accepted as clobbers for RISC-V.
258 asm volatile ("" ::: .{ .ra = true, .sp = true, .gp = true, .tp = true });254 asm volatile ("" ::: .{ .ra = true, .sp = true, .gp = true, .tp = true });
test/behavior/basic.zig+1-5
...@@ -1407,11 +1407,7 @@ test "allocation and looping over 3-byte integer" {...@@ -1407,11 +1407,7 @@ test "allocation and looping over 3-byte integer" {
1407 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1407 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1408 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1408 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1409 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1409 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
14101410 if (builtin.zig_backend == .stage2_llvm and builtin.os.tag.isDarwin()) return error.SkipZigTest; // TODO
1411 if (builtin.zig_backend == .stage2_llvm and builtin.os.tag.isDarwin()) {
1412 return error.SkipZigTest; // TODO
1413 }
1414 if (builtin.cpu.arch == .s390x and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO
14151411
1416 try expect(@sizeOf(u24) == 4);1412 try expect(@sizeOf(u24) == 4);
1417 try expect(@sizeOf([1]u24) == 4);1413 try expect(@sizeOf([1]u24) == 4);
test/behavior/field_parent_ptr.zig-1
...@@ -1757,7 +1757,6 @@ test "@fieldParentPtr packed union" {...@@ -1757,7 +1757,6 @@ test "@fieldParentPtr packed union" {
1757 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1757 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1758 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1758 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1759 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1759 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1760 if (builtin.target.cpu.arch.endian() == .big) return error.SkipZigTest; // TODO
17611760
1762 const C = packed union {1761 const C = packed union {
1763 a: packed struct(u32) {1762 a: packed struct(u32) {
test/behavior/floatop.zig+4-10
...@@ -136,7 +136,6 @@ test "cmp f32" {...@@ -136,7 +136,6 @@ test "cmp f32" {
136test "cmp f64" {136test "cmp f64" {
137 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;137 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
138 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO138 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
139 if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
140139
141 try testCmp(f64);140 try testCmp(f64);
142 try comptime testCmp(f64);141 try comptime testCmp(f64);
...@@ -155,7 +154,6 @@ test "cmp f128" {...@@ -155,7 +154,6 @@ test "cmp f128" {
155test "cmp f80/c_longdouble" {154test "cmp f80/c_longdouble" {
156 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO155 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
157 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;156 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
158 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
159 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;157 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
160 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;158 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
161159
...@@ -223,8 +221,7 @@ test "vector cmp f16" {...@@ -223,8 +221,7 @@ test "vector cmp f16" {
223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;221 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
224 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO222 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
225 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;223 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
226 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;224 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest;
227 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
228 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;225 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
229226
230 try testCmpVector(f16);227 try testCmpVector(f16);
...@@ -236,8 +233,8 @@ test "vector cmp f32" {...@@ -236,8 +233,8 @@ test "vector cmp f32" {
236 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;233 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
237 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO234 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
238 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;235 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
239 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;236 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest;
240 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;237 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
241 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;238 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
242239
243 try testCmpVector(f32);240 try testCmpVector(f32);
...@@ -248,8 +245,6 @@ test "vector cmp f64" {...@@ -248,8 +245,6 @@ test "vector cmp f64" {
248 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;245 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
249 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO246 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
250 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;247 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
251 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
252 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
253 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;248 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
254249
255 try testCmpVector(f64);250 try testCmpVector(f64);
...@@ -262,8 +257,7 @@ test "vector cmp f128" {...@@ -262,8 +257,7 @@ test "vector cmp f128" {
262 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;257 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
263 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;258 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
264 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;259 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
265 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;260 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .powerpc64le) return error.SkipZigTest;
266 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
267 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;261 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
268262
269 try testCmpVector(f128);263 try testCmpVector(f128);
test/behavior/generics.zig-4
...@@ -305,8 +305,6 @@ test "generic function instantiation non-duplicates" {...@@ -305,8 +305,6 @@ test "generic function instantiation non-duplicates" {
305 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO305 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
306 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;306 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
307307
308 if (builtin.os.tag == .wasi) return error.SkipZigTest;
309
310 const S = struct {308 const S = struct {
311 fn copy(comptime T: type, dest: []T, source: []const T) void {309 fn copy(comptime T: type, dest: []T, source: []const T) void {
312 @export(&foo, .{ .name = "test_generic_instantiation_non_dupe" });310 @export(&foo, .{ .name = "test_generic_instantiation_non_dupe" });
...@@ -323,8 +321,6 @@ test "generic function instantiation non-duplicates" {...@@ -323,8 +321,6 @@ test "generic function instantiation non-duplicates" {
323test "generic instantiation of tagged union with only one field" {321test "generic instantiation of tagged union with only one field" {
324 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO322 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
325323
326 if (builtin.os.tag == .wasi) return error.SkipZigTest;
327
328 const S = struct {324 const S = struct {
329 const U = union(enum) {325 const U = union(enum) {
330 s: []const u8,326 s: []const u8,
test/behavior/math.zig-6
...@@ -110,8 +110,6 @@ test "@clz vectors" {...@@ -110,8 +110,6 @@ test "@clz vectors" {
110}110}
111111
112fn testClzVectors() !void {112fn testClzVectors() !void {
113 if (comptime builtin.cpu.has(.loongarch, .lsx)) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/159529
114
115 const Vu4 = @Vector(64, u4);113 const Vu4 = @Vector(64, u4);
116 const Vu8 = @Vector(64, u8);114 const Vu8 = @Vector(64, u8);
117 const Vu128 = @Vector(64, u128);115 const Vu128 = @Vector(64, u128);
...@@ -193,8 +191,6 @@ test "@ctz vectors" {...@@ -193,8 +191,6 @@ test "@ctz vectors" {
193}191}
194192
195fn testCtzVectors() !void {193fn testCtzVectors() !void {
196 if (comptime builtin.cpu.has(.loongarch, .lsx)) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/159529
197
198 const Vu4 = @Vector(64, u4);194 const Vu4 = @Vector(64, u4);
199 const Vu8 = @Vector(64, u8);195 const Vu8 = @Vector(64, u8);
200 @setEvalBranchQuota(10_000);196 @setEvalBranchQuota(10_000);
...@@ -2429,7 +2425,6 @@ test "runtime comparison to NaN is comptime-known" {...@@ -2429,7 +2425,6 @@ test "runtime comparison to NaN is comptime-known" {
2429 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2425 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2430 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;2426 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2431 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;2427 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
2432 if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
24332428
2434 const S = struct {2429 const S = struct {
2435 fn doTheTest(comptime F: type, x: F) void {2430 fn doTheTest(comptime F: type, x: F) void {
...@@ -2458,7 +2453,6 @@ test "runtime int comparison to inf is comptime-known" {...@@ -2458,7 +2453,6 @@ test "runtime int comparison to inf is comptime-known" {
2458 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2453 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2459 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;2454 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2460 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;2455 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
2461 if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
24622456
2463 const S = struct {2457 const S = struct {
2464 fn doTheTest(comptime F: type, x: u32) void {2458 fn doTheTest(comptime F: type, x: u32) void {
test/behavior/maximum_minimum.zig-2
...@@ -138,8 +138,6 @@ test "@min/max for floats" {...@@ -138,8 +138,6 @@ test "@min/max for floats" {
138 };138 };
139139
140 inline for (.{ f16, f32, f64, f80, f128, c_longdouble }) |T| {140 inline for (.{ f16, f32, f64, f80, f128, c_longdouble }) |T| {
141 if (T == c_longdouble and builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21090
142
143 try S.doTheTest(T);141 try S.doTheTest(T);
144 try comptime S.doTheTest(T);142 try comptime S.doTheTest(T);
145 }143 }
test/behavior/packed-struct.zig-1
...@@ -1196,7 +1196,6 @@ test "packed struct with signed field" {...@@ -1196,7 +1196,6 @@ test "packed struct with signed field" {
11961196
1197test "assign packed struct initialized with RLS to packed struct literal field" {1197test "assign packed struct initialized with RLS to packed struct literal field" {
1198 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1198 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1199 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isWasm()) return error.SkipZigTest;
1200 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1199 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1201 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1200 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12021201
test/behavior/saturating_arithmetic.zig-10
...@@ -147,11 +147,6 @@ test "saturating multiplication <= 32 bits" {...@@ -147,11 +147,6 @@ test "saturating multiplication <= 32 bits" {
147 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;147 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
148 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;148 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
149149
150 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isWasm()) {
151 // https://github.com/ziglang/zig/issues/9660
152 return error.SkipZigTest;
153 }
154
155 try testSatMul(u8, 0, maxInt(u8), 0);150 try testSatMul(u8, 0, maxInt(u8), 0);
156 try testSatMul(u8, 1 << 7, 1 << 7, maxInt(u8));151 try testSatMul(u8, 1 << 7, 1 << 7, maxInt(u8));
157 try testSatMul(u8, maxInt(u8) - 1, 2, maxInt(u8));152 try testSatMul(u8, maxInt(u8) - 1, 2, maxInt(u8));
...@@ -246,11 +241,6 @@ test "saturating multiplication" {...@@ -246,11 +241,6 @@ test "saturating multiplication" {
246 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;241 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
247 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;242 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
248243
249 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isWasm()) {
250 // https://github.com/ziglang/zig/issues/9660
251 return error.SkipZigTest;
252 }
253
254 const S = struct {244 const S = struct {
255 fn doTheTest() !void {245 fn doTheTest() !void {
256 try testSatMul(i8, -3, 10, -30);246 try testSatMul(i8, -3, 10, -30);
test/behavior/struct.zig-2
...@@ -404,7 +404,6 @@ test "packed struct 24bits" {...@@ -404,7 +404,6 @@ test "packed struct 24bits" {
404 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;404 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
405 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;405 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
406 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO406 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
407 if (builtin.cpu.arch.isArm()) return error.SkipZigTest; // TODO
408 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO407 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
409 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO408 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
410409
...@@ -921,7 +920,6 @@ test "tuple assigned to variable" {...@@ -921,7 +920,6 @@ test "tuple assigned to variable" {
921920
922test "comptime struct field" {921test "comptime struct field" {
923 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO922 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
924 if (builtin.cpu.arch.isArm()) return error.SkipZigTest; // TODO
925923
926 const T = struct {924 const T = struct {
927 a: i32,925 a: i32,
test/behavior/switch.zig+1
...@@ -683,6 +683,7 @@ test "switch on pointer type" {...@@ -683,6 +683,7 @@ test "switch on pointer type" {
683 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;683 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
684 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO684 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
685 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;685 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
686 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/176634
686687
687 const S = struct {688 const S = struct {
688 const X = struct {689 const X = struct {
test/behavior/union.zig-3
...@@ -1592,7 +1592,6 @@ test "memset packed union" {...@@ -1592,7 +1592,6 @@ test "memset packed union" {
15921592
1593 try comptime S.doTheTest();1593 try comptime S.doTheTest();
15941594
1595 if (builtin.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
1596 try S.doTheTest();1595 try S.doTheTest();
1597}1596}
15981597
...@@ -1750,8 +1749,6 @@ test "reinterpret packed union" {...@@ -1750,8 +1749,6 @@ test "reinterpret packed union" {
1750 try comptime S.doTheTest();1749 try comptime S.doTheTest();
17511750
1752 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO1751 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
1753 if (builtin.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
1754 if (builtin.cpu.arch.endian() == .big) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21050
1755 try S.doTheTest();1752 try S.doTheTest();
1756}1753}
17571754
test/behavior/vector.zig-23
...@@ -7,7 +7,6 @@ const expect = std.testing.expect;...@@ -7,7 +7,6 @@ const expect = std.testing.expect;
7const expectEqual = std.testing.expectEqual;7const expectEqual = std.testing.expectEqual;
88
9test "implicit cast vector to array - bool" {9test "implicit cast vector to array - bool" {
10 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
11 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;10 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1211
13 const S = struct {12 const S = struct {
...@@ -622,11 +621,6 @@ test "vector bitwise not operator" {...@@ -622,11 +621,6 @@ test "vector bitwise not operator" {
622 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO621 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
623 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;622 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
624623
625 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) {
626 // https://github.com/ziglang/zig/issues/24061
627 return error.SkipZigTest;
628 }
629
630 const S = struct {624 const S = struct {
631 fn doTheTestNot(comptime T: type, x: @Vector(4, T)) !void {625 fn doTheTestNot(comptime T: type, x: @Vector(4, T)) !void {
632 const y = ~x;626 const y = ~x;
...@@ -660,11 +654,6 @@ test "vector boolean not operator" {...@@ -660,11 +654,6 @@ test "vector boolean not operator" {
660 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO654 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
661 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;655 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
662656
663 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) {
664 // https://github.com/ziglang/zig/issues/24061
665 return error.SkipZigTest;
666 }
667
668 const S = struct {657 const S = struct {
669 fn doTheTestNot(comptime T: type, x: @Vector(4, T)) !void {658 fn doTheTestNot(comptime T: type, x: @Vector(4, T)) !void {
670 const y = !x;659 const y = !x;
...@@ -759,7 +748,6 @@ test "vector reduce operation" {...@@ -759,7 +748,6 @@ test "vector reduce operation" {
759 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;748 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
760 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;749 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
761 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;750 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
762 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21091
763 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isSPARC()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23719751 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isSPARC()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23719
764752
765 const S = struct {753 const S = struct {
...@@ -1096,9 +1084,6 @@ test "saturating multiplication" {...@@ -1096,9 +1084,6 @@ test "saturating multiplication" {
1096 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1084 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1097 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1085 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
10981086
1099 // TODO: once #9660 has been solved, remove this line
1100 if (builtin.target.cpu.arch.isWasm()) return error.SkipZigTest;
1101
1102 const S = struct {1087 const S = struct {
1103 fn doTheTest() !void {1088 fn doTheTest() !void {
1104 // Broken out to avoid https://github.com/ziglang/zig/issues/112511089 // Broken out to avoid https://github.com/ziglang/zig/issues/11251
...@@ -1165,7 +1150,6 @@ test "@addWithOverflow" {...@@ -1165,7 +1150,6 @@ test "@addWithOverflow" {
1165 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1150 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1166 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1151 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1167 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1152 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1168 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
11691153
1170 const S = struct {1154 const S = struct {
1171 fn doTheTest() !void {1155 fn doTheTest() !void {
...@@ -1213,7 +1197,6 @@ test "@subWithOverflow" {...@@ -1213,7 +1197,6 @@ test "@subWithOverflow" {
1213 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1197 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1214 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1198 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1215 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1199 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1216 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
12171200
1218 const S = struct {1201 const S = struct {
1219 fn doTheTest() !void {1202 fn doTheTest() !void {
...@@ -1244,7 +1227,6 @@ test "@mulWithOverflow" {...@@ -1244,7 +1227,6 @@ test "@mulWithOverflow" {
1244 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1227 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1245 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1228 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1246 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1229 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1247 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
12481230
1249 const S = struct {1231 const S = struct {
1250 fn doTheTest() !void {1232 fn doTheTest() !void {
...@@ -1265,7 +1247,6 @@ test "@shlWithOverflow" {...@@ -1265,7 +1247,6 @@ test "@shlWithOverflow" {
1265 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1247 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1266 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1248 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1267 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1249 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1268 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
12691250
1270 const S = struct {1251 const S = struct {
1271 fn doTheTest() !void {1252 fn doTheTest() !void {
...@@ -1347,7 +1328,6 @@ test "byte vector initialized in inline function" {...@@ -1347,7 +1328,6 @@ test "byte vector initialized in inline function" {
1347 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1328 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1348 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1329 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1349 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1330 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1350 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
1351 if (builtin.cpu.arch == .hexagon and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;1331 if (builtin.cpu.arch == .hexagon and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
13521332
1353 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64 and comptime builtin.cpu.has(.x86, .avx512f)) {1333 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64 and comptime builtin.cpu.has(.x86, .avx512f)) {
...@@ -1463,7 +1443,6 @@ test "store packed vector element" {...@@ -1463,7 +1443,6 @@ test "store packed vector element" {
1463 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1443 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1464 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO1444 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
1465 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1445 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1466 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
14671446
1468 var v = @Vector(4, u1){ 1, 1, 1, 1 };1447 var v = @Vector(4, u1){ 1, 1, 1, 1 };
1469 try expectEqual(@Vector(4, u1){ 1, 1, 1, 1 }, v);1448 try expectEqual(@Vector(4, u1){ 1, 1, 1, 1 }, v);
...@@ -1496,7 +1475,6 @@ test "store vector with memset" {...@@ -1496,7 +1475,6 @@ test "store vector with memset" {
1496 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO1475 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO
1497 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO1476 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
1498 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1477 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1499 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
15001478
1501 var a: [5]@Vector(2, i1) = undefined;1479 var a: [5]@Vector(2, i1) = undefined;
1502 var b: [5]@Vector(2, u2) = undefined;1480 var b: [5]@Vector(2, u2) = undefined;
...@@ -1596,7 +1574,6 @@ test "bitcast to vector with different child type" {...@@ -1596,7 +1574,6 @@ test "bitcast to vector with different child type" {
1596 }1574 }
1597 };1575 };
15981576
1599 // Originally reported at https://github.com/ziglang/zig/issues/8184
1600 try S.doTheTest();1577 try S.doTheTest();
1601 try comptime S.doTheTest();1578 try comptime S.doTheTest();
1602}1579}
test/behavior/wrapping_arithmetic.zig-3
...@@ -82,9 +82,6 @@ test "wrapping multiplication" {...@@ -82,9 +82,6 @@ test "wrapping multiplication" {
82 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;82 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
83 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;83 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
8484
85 // TODO: once #9660 has been solved, remove this line
86 if (builtin.cpu.arch.isWasm()) return error.SkipZigTest;
87
88 const S = struct {85 const S = struct {
89 fn doTheTest() !void {86 fn doTheTest() !void {
90 try testWrapMul(i8, -3, 10, -30);87 try testWrapMul(i8, -3, 10, -30);
test/c_abi/cfuncs.c+4
...@@ -65,6 +65,10 @@ static void assert_or_panic(bool ok) {...@@ -65,6 +65,10 @@ static void assert_or_panic(bool ok) {
65# define ZIG_NO_COMPLEX65# define ZIG_NO_COMPLEX
66#endif66#endif
6767
68#if defined(__loongarch__) && defined(__loongarch_soft_float)
69# define ZIG_NO_COMPLEX
70#endif
71
68#ifdef __powerpc__72#ifdef __powerpc__
69# define ZIG_NO_COMPLEX73# define ZIG_NO_COMPLEX
70#endif74#endif
test/c_abi/main.zig+3-1
...@@ -187,7 +187,8 @@ extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;...@@ -187,7 +187,8 @@ extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;
187const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and187const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and
188 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV() and188 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV() and
189 builtin.cpu.arch != .hexagon and189 builtin.cpu.arch != .hexagon and
190 builtin.cpu.arch != .s390x;190 builtin.cpu.arch != .s390x and
191 !(builtin.cpu.arch.isLoongArch() and builtin.abi.float() == .soft);
191192
192test "C ABI complex float" {193test "C ABI complex float" {
193 if (!complex_abi_compatible) return error.SkipZigTest;194 if (!complex_abi_compatible) return error.SkipZigTest;
...@@ -5676,6 +5677,7 @@ test "C ABI pointer sized float struct" {...@@ -5676,6 +5677,7 @@ test "C ABI pointer sized float struct" {
5676 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5677 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5677 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5678 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5678 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;5679 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
5680 if (builtin.cpu.arch.isLoongArch() and builtin.abi.float() == .soft) return error.SkipZigTest;
5679 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;5681 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
56805682
5681 c_ptr_size_float_struct(.{ .x = 1, .y = 2 });5683 c_ptr_size_float_struct(.{ .x = 1, .y = 2 });
test/llvm_targets.zig+14-4
...@@ -52,6 +52,7 @@ const targets = [_]std.Target.Query{...@@ -52,6 +52,7 @@ const targets = [_]std.Target.Query{
52 .{ .cpu_arch = .arm, .os_tag = .freebsd, .abi = .eabihf },52 .{ .cpu_arch = .arm, .os_tag = .freebsd, .abi = .eabihf },
53 .{ .cpu_arch = .arm, .os_tag = .freestanding, .abi = .eabi },53 .{ .cpu_arch = .arm, .os_tag = .freestanding, .abi = .eabi },
54 .{ .cpu_arch = .arm, .os_tag = .freestanding, .abi = .eabihf },54 .{ .cpu_arch = .arm, .os_tag = .freestanding, .abi = .eabihf },
55 .{ .cpu_arch = .arm, .os_tag = .fuchsia, .abi = .eabihf },
55 .{ .cpu_arch = .arm, .os_tag = .haiku, .abi = .eabi },56 .{ .cpu_arch = .arm, .os_tag = .haiku, .abi = .eabi },
56 .{ .cpu_arch = .arm, .os_tag = .haiku, .abi = .eabihf },57 .{ .cpu_arch = .arm, .os_tag = .haiku, .abi = .eabihf },
57 .{ .cpu_arch = .arm, .os_tag = .linux, .abi = .androideabi },58 .{ .cpu_arch = .arm, .os_tag = .linux, .abi = .androideabi },
...@@ -99,12 +100,19 @@ const targets = [_]std.Target.Query{...@@ -99,12 +100,19 @@ const targets = [_]std.Target.Query{
99 // .{ .cpu_arch = .csky, .os_tag = .linux, .abi = .gnueabihf },100 // .{ .cpu_arch = .csky, .os_tag = .linux, .abi = .gnueabihf },
100101
101 .{ .cpu_arch = .hexagon, .os_tag = .freestanding, .abi = .none },102 .{ .cpu_arch = .hexagon, .os_tag = .freestanding, .abi = .none },
103 .{ .cpu_arch = .hexagon, .os_tag = .linux, .abi = .musl },
102 .{ .cpu_arch = .hexagon, .os_tag = .linux, .abi = .none },104 .{ .cpu_arch = .hexagon, .os_tag = .linux, .abi = .none },
103105
104 .{ .cpu_arch = .lanai, .os_tag = .freestanding, .abi = .none },106 .{ .cpu_arch = .lanai, .os_tag = .freestanding, .abi = .none },
105107
106 // .{ .cpu_arch = .loongarch32, .os_tag = .freestanding, .abi = .none },108 .{ .cpu_arch = .loongarch32, .os_tag = .freestanding, .abi = .none },
107 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .none },109 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnu },
110 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnuf32 },
111 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnusf },
112 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .musl },
113 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .muslf32 },
114 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .muslsf },
115 .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .none },
108 // .{ .cpu_arch = .loongarch32, .os_tag = .uefi, .abi = .none },116 // .{ .cpu_arch = .loongarch32, .os_tag = .uefi, .abi = .none },
109117
110 .{ .cpu_arch = .loongarch64, .os_tag = .freestanding, .abi = .none },118 .{ .cpu_arch = .loongarch64, .os_tag = .freestanding, .abi = .none },
...@@ -172,6 +180,7 @@ const targets = [_]std.Target.Query{...@@ -172,6 +180,7 @@ const targets = [_]std.Target.Query{
172180
173 .{ .cpu_arch = .nvptx, .os_tag = .cuda, .abi = .none },181 .{ .cpu_arch = .nvptx, .os_tag = .cuda, .abi = .none },
174 .{ .cpu_arch = .nvptx, .os_tag = .nvcl, .abi = .none },182 .{ .cpu_arch = .nvptx, .os_tag = .nvcl, .abi = .none },
183
175 .{ .cpu_arch = .nvptx64, .os_tag = .cuda, .abi = .none },184 .{ .cpu_arch = .nvptx64, .os_tag = .cuda, .abi = .none },
176 .{ .cpu_arch = .nvptx64, .os_tag = .nvcl, .abi = .none },185 .{ .cpu_arch = .nvptx64, .os_tag = .nvcl, .abi = .none },
177186
...@@ -255,6 +264,7 @@ const targets = [_]std.Target.Query{...@@ -255,6 +264,7 @@ const targets = [_]std.Target.Query{
255264
256 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi },265 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi },
257 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf },266 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf },
267 .{ .cpu_arch = .thumb, .os_tag = .fuchsia, .abi = .eabihf },
258 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .eabi },268 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .eabi },
259 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .eabihf },269 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .eabihf },
260 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .musleabi },270 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .musleabi },
...@@ -342,8 +352,8 @@ const targets = [_]std.Target.Query{...@@ -342,8 +352,8 @@ const targets = [_]std.Target.Query{
342352
343 .{ .cpu_arch = .xcore, .os_tag = .freestanding, .abi = .none },353 .{ .cpu_arch = .xcore, .os_tag = .freestanding, .abi = .none },
344354
345 // .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .none },355 .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .none },
346 // .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .none },356 .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .none },
347};357};
348358
349pub fn addCases(359pub fn addCases(
test/tests.zig+50-8
...@@ -410,6 +410,14 @@ const module_test_targets = blk: {...@@ -410,6 +410,14 @@ const module_test_targets = blk: {
410 .extra_target = true,410 .extra_target = true,
411 },411 },
412412
413 .{
414 .target = .{
415 .cpu_arch = .loongarch32,
416 .os_tag = .linux,
417 .abi = .none,
418 },
419 },
420
413 .{421 .{
414 .target = .{422 .target = .{
415 .cpu_arch = .loongarch64,423 .cpu_arch = .loongarch64,
...@@ -435,6 +443,25 @@ const module_test_targets = blk: {...@@ -435,6 +443,25 @@ const module_test_targets = blk: {
435 .link_libc = true,443 .link_libc = true,
436 .extra_target = true,444 .extra_target = true,
437 },445 },
446 .{
447 .target = .{
448 .cpu_arch = .loongarch64,
449 .os_tag = .linux,
450 .abi = .muslsf,
451 },
452 .link_libc = true,
453 .extra_target = true,
454 },
455 .{
456 .target = .{
457 .cpu_arch = .loongarch64,
458 .os_tag = .linux,
459 .abi = .muslsf,
460 },
461 .linkage = .dynamic,
462 .link_libc = true,
463 .extra_target = true,
464 },
438 .{465 .{
439 .target = .{466 .target = .{
440 .cpu_arch = .loongarch64,467 .cpu_arch = .loongarch64,
...@@ -443,6 +470,15 @@ const module_test_targets = blk: {...@@ -443,6 +470,15 @@ const module_test_targets = blk: {
443 },470 },
444 .link_libc = true,471 .link_libc = true,
445 },472 },
473 .{
474 .target = .{
475 .cpu_arch = .loongarch64,
476 .os_tag = .linux,
477 .abi = .gnusf,
478 },
479 .link_libc = true,
480 .extra_target = true,
481 },
446482
447 .{483 .{
448 .target = .{484 .target = .{
...@@ -1713,14 +1749,13 @@ const c_abi_targets = blk: {...@@ -1713,14 +1749,13 @@ const c_abi_targets = blk: {
1713 },1749 },
1714 },1750 },
17151751
1716 // https://gitlab.com/qemu-project/qemu/-/issues/32911752 .{
1717 // .{1753 .target = .{
1718 // .target = .{1754 .cpu_arch = .hexagon,
1719 // .cpu_arch = .hexagon,1755 .os_tag = .linux,
1720 // .os_tag = .linux,1756 .abi = .musl,
1721 // .abi = .musl,1757 },
1722 // },1758 },
1723 // },
17241759
1725 .{1760 .{
1726 .target = .{1761 .target = .{
...@@ -1729,6 +1764,13 @@ const c_abi_targets = blk: {...@@ -1729,6 +1764,13 @@ const c_abi_targets = blk: {
1729 .abi = .musl,1764 .abi = .musl,
1730 },1765 },
1731 },1766 },
1767 .{
1768 .target = .{
1769 .cpu_arch = .loongarch64,
1770 .os_tag = .linux,
1771 .abi = .muslsf,
1772 },
1773 },
17321774
1733 .{1775 .{
1734 .target = .{1776 .target = .{
tools/update_clang_options.zig+1-1
...@@ -675,7 +675,7 @@ pub fn main(init: std.process.Init) !void {...@@ -675,7 +675,7 @@ pub fn main(init: std.process.Init) !void {
675 const child_args = [_][]const u8{675 const child_args = [_][]const u8{
676 llvm_tblgen_exe,676 llvm_tblgen_exe,
677 "--dump-json",677 "--dump-json",
678 try std.fmt.allocPrint(arena, "{s}/clang/include/clang/Driver/Options.td", .{llvm_src_root}),678 try std.fmt.allocPrint(arena, "{s}/clang/include/clang/Options/Options.td", .{llvm_src_root}),
679 try std.fmt.allocPrint(arena, "-I={s}/llvm/include", .{llvm_src_root}),679 try std.fmt.allocPrint(arena, "-I={s}/llvm/include", .{llvm_src_root}),
680 try std.fmt.allocPrint(arena, "-I={s}/clang/include/clang/Driver", .{llvm_src_root}),680 try std.fmt.allocPrint(arena, "-I={s}/clang/include/clang/Driver", .{llvm_src_root}),
681 };681 };
tools/update_cpu_features.zig+55-13
...@@ -203,6 +203,10 @@ const targets = [_]ArchTarget{...@@ -203,6 +203,10 @@ const targets = [_]ArchTarget{
203 .llvm_name = "ampere1a",203 .llvm_name = "ampere1a",
204 .flatten = true,204 .flatten = true,
205 },205 },
206 .{
207 .llvm_name = "ampere1c",
208 .flatten = true,
209 },
206 .{210 .{
207 .llvm_name = "apple-a7",211 .llvm_name = "apple-a7",
208 .flatten = true,212 .flatten = true,
...@@ -247,6 +251,26 @@ const targets = [_]ArchTarget{...@@ -247,6 +251,26 @@ const targets = [_]ArchTarget{
247 .llvm_name = "apple-m4",251 .llvm_name = "apple-m4",
248 .flatten = true,252 .flatten = true,
249 },253 },
254 .{
255 .llvm_name = "apple-m5",
256 .flatten = true,
257 },
258 .{
259 .llvm_name = "c1-nano",
260 .flatten = true,
261 },
262 .{
263 .llvm_name = "c1-premium",
264 .flatten = true,
265 },
266 .{
267 .llvm_name = "c1-pro",
268 .flatten = true,
269 },
270 .{
271 .llvm_name = "c1-ultra",
272 .flatten = true,
273 },
250 .{274 .{
251 .llvm_name = "carmel",275 .llvm_name = "carmel",
252 .flatten = true,276 .flatten = true,
...@@ -862,6 +886,10 @@ const targets = [_]ArchTarget{...@@ -862,6 +886,10 @@ const targets = [_]ArchTarget{
862 .llvm_name = "armv9.6-a",886 .llvm_name = "armv9.6-a",
863 .zig_name = "v9_6a",887 .zig_name = "v9_6a",
864 },888 },
889 .{
890 .llvm_name = "armv9.7-a",
891 .zig_name = "v9_7a",
892 },
865 .{893 .{
866 .llvm_name = "armv9-a",894 .llvm_name = "armv9-a",
867 .zig_name = "v9a",895 .zig_name = "v9a",
...@@ -982,6 +1010,10 @@ const targets = [_]ArchTarget{...@@ -982,6 +1010,10 @@ const targets = [_]ArchTarget{
982 .llvm_name = "v9.6a",1010 .llvm_name = "v9.6a",
983 .zig_name = "has_v9_6a",1011 .zig_name = "has_v9_6a",
984 },1012 },
1013 .{
1014 .llvm_name = "v9.7a",
1015 .zig_name = "has_v9_7a",
1016 },
985 },1017 },
986 .extra_cpus = &.{1018 .extra_cpus = &.{
987 .{1019 .{
...@@ -1249,6 +1281,24 @@ const targets = [_]ArchTarget{...@@ -1249,6 +1281,24 @@ const targets = [_]ArchTarget{
1249 .td_name = "LoongArch",1281 .td_name = "LoongArch",
1250 },1282 },
1251 .extra_cpus = &.{1283 .extra_cpus = &.{
1284 .{
1285 .llvm_name = null,
1286 .zig_name = "la32v1_0",
1287 .features = &.{
1288 "32bit",
1289 "32s",
1290 "d",
1291 "ual",
1292 },
1293 },
1294 .{
1295 .llvm_name = null,
1296 .zig_name = "la32rv1_0",
1297 .features = &.{
1298 "32bit",
1299 "ual",
1300 },
1301 },
1252 .{1302 .{
1253 .llvm_name = null,1303 .llvm_name = null,
1254 .zig_name = "la64v1_0",1304 .zig_name = "la64v1_0",
...@@ -1276,6 +1326,7 @@ const targets = [_]ArchTarget{...@@ -1276,6 +1326,7 @@ const targets = [_]ArchTarget{
1276 },1326 },
1277 .omit_cpus = &.{1327 .omit_cpus = &.{
1278 "generic",1328 "generic",
1329 "loongarch32",
1279 "loongarch64",1330 "loongarch64",
1280 },1331 },
1281 },1332 },
...@@ -1557,26 +1608,17 @@ const targets = [_]ArchTarget{...@@ -1557,26 +1608,17 @@ const targets = [_]ArchTarget{
1557 .llvm_name = "64bit-mode",1608 .llvm_name = "64bit-mode",
1558 .omit = true,1609 .omit = true,
1559 },1610 },
1560 // Remove these when LLVM removes AVX10.N-256 support.
1561 .{
1562 .llvm_name = "avx10.1-256",
1563 .flatten = true,
1564 },
1565 .{
1566 .llvm_name = "avx10.2-256",
1567 .flatten = true,
1568 },
1569 .{1611 .{
1570 .llvm_name = "avx10.1-512",1612 .llvm_name = "avx10.1-512",
1571 .zig_name = "avx10_1",1613 .omit = true,
1572 },1614 },
1573 .{1615 .{
1574 .llvm_name = "avx10.2-512",1616 .llvm_name = "avx10.2-512",
1575 .zig_name = "avx10_2",1617 .omit = true,
1576 },1618 },
1577 .{1619 .{
1578 .llvm_name = "avx512f",1620 .llvm_name = "evex512",
1579 .extra_deps = &.{"evex512"},1621 .omit = true,
1580 },1622 },
1581 .{1623 .{
1582 .llvm_name = "alderlake",1624 .llvm_name = "alderlake",